Skip to content

Commit

Permalink
Merge pull request #136 from okto-hq/main
Browse files Browse the repository at this point in the history
adv pages
  • Loading branch information
oviawork authored Nov 18, 2024
2 parents 908b1aa + d9dfaaf commit 7abf47c
Show file tree
Hide file tree
Showing 26 changed files with 688 additions and 182 deletions.
4 changes: 4 additions & 0 deletions app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
@tailwind components;
@tailwind utilities;

html {
scroll-behavior: smooth;
}

@layer base {
:root {
--card-foreground: 240 10% 3.9%;
Expand Down
13 changes: 13 additions & 0 deletions app/server-api-errors/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { ReactNode } from 'react';

export const metadata = {
title: 'Server API Errors',
}

export default function ToolsLayout({ children }: { children: ReactNode }) {
return (
<div>
{children}
</div>
)
}
127 changes: 127 additions & 0 deletions app/server-api-errors/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
'use client';

import * as React from "react"
import { AlertCircle, Code } from "lucide-react"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion"
import { Badge } from "@/components/ui/badge"

const apiErrors = [
{
name: "User Authentication API",
description: "Handles user authentication and authorization processes.",
errors: [
{
code: "AUTH001",
message: "Invalid credentials",
description: "The provided username and password combination is incorrect or does not exist in our system."
},
{
code: "AUTH002",
message: "Token expired",
description: "The authentication token has expired. Please request a new token to continue."
},
{
code: "AUTH003",
message: "User not found",
description: "The requested user account does not exist in our database."
},
],
},
{
name: "Data Retrieval API",
description: "Manages data retrieval operations from our databases.",
errors: [
{
code: "DATA001",
message: "Database connection failed",
description: "Unable to establish a connection with the database. This could be due to network issues or database server downtime."
},
{
code: "DATA002",
message: "Query timeout",
description: "The database query took too long to execute and timed out. This may indicate a need for query optimization."
},
{
code: "DATA003",
message: "Invalid data format",
description: "The data retrieved does not match the expected format or schema."
},
],
},
{
name: "Network Operations API",
description: "Handles network-related operations and diagnostics.",
errors: [
{
code: "NET001",
message: "Network unreachable",
description: "The target network or host is currently unreachable. This could be due to network outages or firewall restrictions."
},
{
code: "NET002",
message: "DNS resolution failed",
description: "Unable to resolve the domain name to an IP address. This could indicate DNS server issues or an invalid domain name."
},
{
code: "NET003",
message: "Connection refused",
description: "The target host actively refused the connection attempt. This may be due to the service being down or blocked."
},
],
},
]

export default function APIErrorPage() {
return (
<div className="container mx-auto p-6">
<h1 className="text-3xl font-bold mb-6">Server Error Reference</h1>
<p className="text-muted-foreground mb-8">
This page lists out potential errors that can occur when using our Server APIs.
Each section details specific errors for different API categories.
</p>

<div className="space-y-8">
{apiErrors.map((api) => (
<Card key={api.name} className="w-full">
<CardHeader>
<CardTitle className="text-2xl">{api.name}</CardTitle>
<CardDescription className="text-base">{api.description}</CardDescription>
</CardHeader>
<CardContent>
<Accordion type="single" collapsible className="w-full">
{api.errors.map((error, index) => (
<AccordionItem value={`item-${index}`} key={error.code}>
<AccordionTrigger className="hover:no-underline">
<div className="flex items-center gap-2">
<AlertCircle className="h-5 w-5 text-red-500" />
<span className="font-semibold">{error.code}: {error.message}</span>
</div>
</AccordionTrigger>
<AccordionContent className="pt-4">
<div className="space-y-4">
<p className="text-muted-foreground">{error.description}</p>
<div className="flex items-center gap-2">
<Badge variant="outline">
<Code className="mr-1 h-3 w-3" />
Error Code
</Badge>
<span className="text-sm font-mono">{error.code}</span>
</div>
</div>
</AccordionContent>
</AccordionItem>
))}
</Accordion>
</CardContent>
</Card>
))}
</div>
</div>
)
}
59 changes: 59 additions & 0 deletions app/tools/components/EnumData.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export const enumData = [
{
key: "ORDER_TYPE",
keyDesc: "Specifies the type of order.",
apiUrls: [
"https://docs.okto.tech/api-docs#tag/client/GET/api/v1/orders",
"https://docs.okto.tech/api-docs#tag/client/GET/api/v1/nft/order_details"
],
values: [
{ value: "MINT", desc: "Indicates that the order is for minting a new NFT." },
{ value: "NFT_TRANSFER", desc: "Indicates that the order is for transferring an NFT to another address." },
{ value: "TOKEN_TRANSFER_EXECUTE", desc: "Indicates that the order is for executing a token transfer transaction." },
{ value: "EXECUTE_RAW_TX", desc: "Indicates that the order is for executing a raw blockchain transaction." }
]
},
{
key: "OPERATION_TYPE",
keyDesc: "Specifies the type of operation being performed.",
apiUrls: [
"https://docs.okto.tech/api-docs#tag/client/POST/api/v1/nft/transfer"
],
values: [
{ value: "MINT", desc: "Indicates that the order is for minting a new NFT." },
{ value: "NFT_TRANSFER", desc: "Indicates that the order is for transferring an NFT to another address." },
{ value: "TOKEN_TRANSFER_EXECUTE", desc: "Indicates that the order is for executing a token transfer transaction." },
{ value: "EXECUTE_RAW_TX", desc: "Indicates that the order is for executing a raw blockchain transaction." }
]
},
{
key: "STATUS",
keyDesc: "Represents the current status of the order or transaction.",
apiUrls: [
"https://docs.okto.tech/api-docs#tag/client/GET/api/v1/orders",
"https://docs.okto.tech/api-docs#tag/client/GET/api/v1/nft/order_details",
"https://docs.okto.tech/api-docs#tag/client/GET/api/v1/rawtransaction/status"
],
values: [
{ value: "WAITING_INITIALIZATION", desc: "The order is in queue and has not yet started processing." },
{ value: "CREATED", desc: "The order has been initialized and is ready for processing." },
{ value: "RUNNING", desc: "The transaction is being processed on the blockchain." },
{ value: "WAITING_FOR_SIGNATURE", desc: "The system is in the process of signing the transaction payload." },
{ value: "REJECTED", desc: "The order was rejected and will not be processed further." },
{ value: "SUCCESS", desc: "The order was successfully processed and confirmed on the blockchain." },
{ value: "FAILED", desc: "The order failed during processing." }
]
},
{
key: "ENTITY_TYPE",
keyDesc: "Defines the type of NFT or asset involved in the transaction.",
apiUrls: [
"https://docs.okto.tech/api-docs#tag/client/GET/api/v1/nft/order_details"
],
values: [
{ value: "ERC721", desc: "An ERC-721 standard NFT on EVM-compatible blockchains." },
{ value: "ERC1155", desc: "An ERC-1155 standard NFT on EVM-compatible blockchains." },
{ value: "NFT", desc: "An NFT on non-EVM blockchains." }
]
}
]
108 changes: 108 additions & 0 deletions app/tools/components/TokenNetworkInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
export const tokens = [
{
token_name: "APT",
token_address: "0x1::aptos_coin::AptosCoin",
network_name: "APTOS"
},
{
token_name: "APT_TESTNET",
token_address: "0x1::aptos_coin::AptosCoin",
network_name: "APTOS_TESTNET"
},
{
token_name: "ETH",
token_address: "",
network_name: "BASE"
},
{
token_name: "MATIC",
token_address: "",
network_name: "POLYGON_TESTNET_AMOY"
},
{
token_name: "POL",
token_address: "",
network_name: "POLYGON"
},
{
token_name: "SOL",
token_address: "",
network_name: "SOLANA"
},
{
token_name: "SOL_DEVNET",
token_address: "",
network_name: "SOLANA_DEVNET"
},
{
token_name: "Temp USDC",
token_address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
network_name: "POLYGON"
},
{
token_name: "USDC",
token_address: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
network_name: "SOLANA_DEVNET"
},
{
token_name: "USDC",
token_address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
network_name: "SOLANA"
},
{
token_name: "USDC",
token_address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
network_name: "BASE"
},
{
token_name: "USDC",
token_address: "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",
network_name: "POLYGON_TESTNET_AMOY"
},
{
token_name: "USDT",
token_address: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
network_name: "POLYGON"
},
{
token_name: "USDT",
token_address: "0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDT",
network_name: "APTOS"
},
{
token_name: "USDT",
token_address: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
network_name: "SOLANA"
}
]

export const networks = [
{
network_name: "APTOS",
chain_id: "1"
},
{
network_name: "APTOS_TESTNET",
chain_id: "2"
},
{
network_name: "BASE",
chain_id: "8453"
},
{
network_name: "POLYGON",
chain_id: "137"
},
{
network_name: "POLYGON_TESTNET_AMOY",
chain_id: "80002"
},
{
network_name: "SOLANA",
chain_id: "101"
},
{
network_name: "SOLANA_DEVNET",
chain_id: "103"
}
]
2 changes: 1 addition & 1 deletion app/tools/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const tools: Tool[] = [
{
title: 'API Explorer',
description: 'Interactive tool to explore and test our SDK\'s API endpoints.',
link: '/docs/api-reference',
link: '/api-docs',
},
{
title: 'Google ID Token Generator',
Expand Down
15 changes: 15 additions & 0 deletions app/tools/technical-reference/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// app/tools/layout.js or wherever your layout file is located
import type { ReactNode } from 'react';

export const metadata = {
title: 'Advanced Technical Reference',
}

export default function ToolsLayout({ children }: { children: ReactNode }) {
return (
<div>
{children}
</div>
)
}

Loading

0 comments on commit 7abf47c

Please sign in to comment.