From 73b6c78316355da4c7fd7356407a135dd2c3e436 Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 24 Dec 2024 11:55:01 -0700 Subject: [PATCH 1/5] re-organized nebula documentation --- .../app/nebula/api-reference/chat/page.mdx | 189 +++++++++++++ .../api-reference/clear-session/page.mdx | 13 + .../api-reference/create-session/page.mdx | 32 +++ .../api-reference/delete-session/page.mdx | 13 + .../app/nebula/api-reference/execute/page.mdx | 77 +++++ .../nebula/api-reference/get-session/page.mdx | 28 ++ .../api-reference/list-session/page.mdx | 29 ++ .../src/app/nebula/api-reference/page.mdx | 266 ------------------ .../api-reference/update-session/page.mdx | 52 ++++ apps/portal/src/app/nebula/page.mdx | 79 ------ .../src/app/nebula/prompt-guide/page.mdx | 15 + apps/portal/src/app/nebula/sidebar.tsx | 56 ++++ apps/portal/src/app/nebula/use-cases/page.mdx | 48 ++++ apps/portal/src/icons/API/GetIcon.tsx | 8 + apps/portal/src/icons/index.ts | 10 + apps/portal/src/icons/sidebar/BrickIcon.tsx | 5 + apps/portal/src/icons/sidebar/CodeIcon.tsx | 5 + apps/portal/src/icons/sidebar/EditIcon.tsx | 5 + .../src/icons/sidebar/NebulaSideIcon.tsx | 8 + 19 files changed, 593 insertions(+), 345 deletions(-) create mode 100644 apps/portal/src/app/nebula/api-reference/chat/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/clear-session/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/create-session/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/delete-session/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/execute/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/get-session/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/list-session/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/update-session/page.mdx create mode 100644 apps/portal/src/app/nebula/prompt-guide/page.mdx create mode 100644 apps/portal/src/app/nebula/use-cases/page.mdx create mode 100644 apps/portal/src/icons/API/GetIcon.tsx create mode 100644 apps/portal/src/icons/sidebar/BrickIcon.tsx create mode 100644 apps/portal/src/icons/sidebar/CodeIcon.tsx create mode 100644 apps/portal/src/icons/sidebar/EditIcon.tsx create mode 100644 apps/portal/src/icons/sidebar/NebulaSideIcon.tsx diff --git a/apps/portal/src/app/nebula/api-reference/chat/page.mdx b/apps/portal/src/app/nebula/api-reference/chat/page.mdx new file mode 100644 index 00000000000..1989835c3b6 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/chat/page.mdx @@ -0,0 +1,189 @@ +### Send Message + +```http +POST /chat +``` + +**Request Body:** +```json +{ + "message": "Find the last 5 blocks", + "session_id": "abc", + "stream": true, + "context_filter": { + "chain_ids": [137], + "contract_addresses": ["0x..."], + "wallet_addresses": ["0x..."] + }, + "execute_config": { + "mode": "client", + "signer_wallet_address": "0x..." + } +} +``` + +**Request Parameters:** + +- `message` (required) + - Type: string + - Description: The user's input message or command to be processed by Nebula + +- `session_id` (optional) + - Type: string + - Description: Identifier for maintaining conversation context + - Default: A new session will be created if omitted + +- `stream` (optional) + - Type: boolean + - Description: Controls whether the response is streamed or returned as a single response + - Default: false + +- `context_filter` (optional) + - Type: object + - Description: Controls which blockchain data sources are used for context + - Properties: + - `chain_ids`: Array of numbers representing blockchain network IDs + - `contract_addresses`: Array of strings containing contract addresses to focus on + +- `execute_config` (optional) + - Type: object + - Description: Configuration for transaction execution + - Properties: + - `mode`: String indicating execution mode (currently only "client" is supported) + - `signer_wallet_address`: String containing the wallet address that will sign transactions + + #### Chat Messages + +Chat messages are natural language responses from Nebula. They appear in the `message` field of the response and provide formatted information, explanations, or answers to your queries. Messages can include formatted text, blockchain data, and technical details. + +**Example Response with Chat Message:** +```json +{ + "message": "The last block on the Arbitrum mainnet is block number **284204124**. Here are the details:\n\n- **Block Hash:** 0xf42e3d624ae1e3fd6b89d4680f39943eb1cd3b8f0606918ef818d3021b7724f1\n- **Parent Hash:** 0x4c45cd0964281833b070b633980d8f530debdd21dfbdbf6eddf96cc93cbaac8e\n- **Timestamp:** 1734063299\n- **Gas Used:** 5,064,851\n- **Gas Limit:** 1,125,899,906,842,624\n- **Base Fee per Gas:** 10,000,000\n- **Transaction Count:** 7\n- **Withdrawals Count:** 0\n\nIf you need any more information about this block or related transactions, feel free to ask!", + "actions": [], + "session_id": "5d579903-5a63-434f-8667-788adfae9304", + "request_id": "d46cfb80-de6a-48a6-9a97-746e1708d066" +} +``` + +Response properties: +- `message`: A formatted string containing the response, which may include: + - Markdown formatting for better readability + - Technical data (hashes, addresses, numbers) + - Structured information about blockchain state +- `actions`: Array of actions (empty when no transactions are needed) +- `session_id`: Unique identifier for the current session +- `request_id`: Unique identifier for the specific request + +#### Chat Actions + +Chat actions represent blockchain transactions or operations that Nebula has prepared in response to your request. The response includes both a detailed explanation in the `message` field and the actual transaction data in the `actions` array. + +**Example Response with Chat Action:** +```json +{ + "message": "The transaction to transfer 0.0001 ETH to the address resolved from the ENS name `vitalik.eth` (which is `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`) is set up successfully. The simulation indicates that the transaction is likely to succeed.\n\nPlease proceed by signing and confirming the transaction.", + "actions": [ + { + "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", + "request_id": "c2b51ed6-da79-49ac-b411-206a42059509", + "type": "sign_transaction", + "source": "executor", + "data": "{\"chainId\": 11155111, \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": \"0x5af3107a4000\"}" + } + ], + "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", + "request_id": "c2b51ed6-da79-49ac-b411-206a42059509" +} +``` + +**Action Properties:** +- `session_id`: Unique identifier for the current session +- `request_id`: Unique identifier for the specific request +- `type`: The type of action (e.g., "sign_transaction") +- `source`: Origin of the action (e.g., "executor") +- `data`: Transaction parameters including: + - `chainId`: Network identifier (e.g., 11155111 for Sepolia) + - `to`: Recipient's address + - `data`: Transaction data (if any) + - `value`: Amount to send in wei + +When handling actions: +1. Parse the `message` field for human-readable transaction details +2. Extract the transaction data from the `actions` array +3. Present transaction details to the user for review +4. Use a local wallet to sign the transaction +5. Broadcast the signed transaction to the network + +**Example Implementation with thirdweb SDK:** +```javascript +import { + createThirdwebClient, + prepareTransaction, + sendTransaction, + privateKeyToAccount +} from "thirdweb"; + +// Example function to handle the API response +async function handleNebulaResponse(response) { + // Initialize thirdweb client + const client = createThirdwebClient({ + secretKey: process.env.THIRDWEB_SECRET_KEY + }); + + // Initialize account + const account = privateKeyToAccount({ + client, + privateKey: process.env.EOA_PRIVATE_KEY + }); + + // Check if we have any actions + if (response.actions && response.actions.length > 0) { + const action = response.actions[0]; + + // Parse the transaction data from the action + const txData = JSON.parse(action.data); + + try { + // Prepare transaction with client + const transaction = prepareTransaction({ + to: txData.to, + data: txData.data, + value: BigInt(txData.value), + chain: txData.chainId, + client + }); + + // Send transaction with account + const result = await sendTransaction({ + transaction, + account + }); + + return result; + } catch (error) { + console.error("Error processing transaction:", error); + throw error; + } + } +} + +// Example usage +const response = await fetch('https://nebula-api.thirdweb.com/chat', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'x-secret-key': 'YOUR_THIRDWEB_SECRET_KEY' + }, + body: JSON.stringify({ + message: "send 0.0001 ETH on sepolia to vitalik.eth", + execute_config: { + mode: "client", + signer_wallet_address: "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE" + } + }) +}); + +const data = await response.json(); +const result = await handleNebulaResponse(data); +``` diff --git a/apps/portal/src/app/nebula/api-reference/clear-session/page.mdx b/apps/portal/src/app/nebula/api-reference/clear-session/page.mdx new file mode 100644 index 00000000000..f337139cde0 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/clear-session/page.mdx @@ -0,0 +1,13 @@ +#### Clear Session + +Clear a session's message history. + +```bash +POST /session/{session_id}/clear +``` + +**Example curl:** +```bash +curl -X POST https://nebula-api.thirdweb.com/session/abc123/clear \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" +``` \ No newline at end of file diff --git a/apps/portal/src/app/nebula/api-reference/create-session/page.mdx b/apps/portal/src/app/nebula/api-reference/create-session/page.mdx new file mode 100644 index 00000000000..1613fb7280a --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/create-session/page.mdx @@ -0,0 +1,32 @@ +#### Create Session + +Create a new chat session. + +```bash +POST /session +``` +**Request Body:** +```tsx +{ + "title": "My DeFi Research", // Optional: Custom session title + "is_public": true, // Optional: Make session publicly accessible + "context_filter": { // Optional: Filter data sources + "chain_ids": [1], + "contract_addresses": ["0x..."] + } +} +``` + +**Example curl:** +```bash +curl -X POST https://nebula-api.thirdweb.com/session \ + -H "Content-Type: application/json" \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ + -d '{ + "title": "My DeFi Research", + "is_public": true, + "context_filter": { + "chain_ids": [1] + } + }' +``` \ No newline at end of file diff --git a/apps/portal/src/app/nebula/api-reference/delete-session/page.mdx b/apps/portal/src/app/nebula/api-reference/delete-session/page.mdx new file mode 100644 index 00000000000..b766e9c1da2 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/delete-session/page.mdx @@ -0,0 +1,13 @@ +Delete Session + + +Delete a session. + +```bash +DELETE /session/{session_id} +``` + +Example curl: + +curl -X DELETE https://nebula-api.thirdweb.com/session/abc123 \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ No newline at end of file diff --git a/apps/portal/src/app/nebula/api-reference/execute/page.mdx b/apps/portal/src/app/nebula/api-reference/execute/page.mdx new file mode 100644 index 00000000000..449879b9cc1 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/execute/page.mdx @@ -0,0 +1,77 @@ +### Execute + +Execute specific blockchain commands or actions. This endpoint is designed for direct command execution without the conversational context of the chat endpoint. + +```bash +POST /execute +``` + +**Request Body:** +```bash +{ + "message": "send 0.0001 ETH on sepolia to vitalik.eth", + "user_id": "default-user", + "stream": false, + "execute_config": { + "mode": "client", + "signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE" + } +} +``` + +**Request Parameters:** +- `message` (required): The command to execute +- `user_id` (optional): Identifier for the user making the request +- `stream` (optional): Whether to stream the response +- `execute_config` (optional): Configuration for transaction execution + - `mode`: Execution mode (currently only "client" is supported) + - `signer_wallet_address`: Address that will sign the transaction + +**Example Response:** +```json +{ + "message": "The transaction to transfer 0.0001 ETH to the address resolved from the ENS name `vitalik.eth` (which is `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`) is set up successfully. The simulation indicates that the transaction is likely to succeed.\n\nPlease proceed by signing and confirming the transaction.", + "actions": [ + { + "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", + "request_id": "c2b51ed6-da79-49ac-b411-206a42059509", + "type": "sign_transaction", + "source": "executor", + "data": "{\"chainId\": 11155111, \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": \"0x5af3107a4000\"}" + } + ], + "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", + "request_id": "c2b51ed6-da79-49ac-b411-206a42059509" +} +``` + +**Example curl:** +```bash +curl -X POST https://nebula-api.thirdweb.com/execute \ + -H "Content-Type: application/json" \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ + -d '{ + "message": "send 0.0001 ETH on sepolia to vitalik.eth", + "user_id": "default-user", + "stream": false, + "execute_config": { + "mode": "client", + "signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE" + } + }' +``` + +**Response Properties:** +- `message`: A human-readable description of the action to be taken +- `actions`: Array of actions to be executed + - `session_id`: Unique identifier for the session + - `request_id`: Unique identifier for this request + - `type`: The type of action (e.g., "sign_transaction") + - `source`: Origin of the action + - `data`: Transaction data in hexadecimal format including: + - `chainId`: Network identifier + - `to`: Recipient's address + - `data`: Transaction data + - `value`: Amount to send in hex +- `session_id`: Session identifier for this execution +- `request_id`: Unique identifier for this request \ No newline at end of file diff --git a/apps/portal/src/app/nebula/api-reference/get-session/page.mdx b/apps/portal/src/app/nebula/api-reference/get-session/page.mdx new file mode 100644 index 00000000000..5503eff39e8 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/get-session/page.mdx @@ -0,0 +1,28 @@ +#### Get Session + +Get details for a specific session. + +```bash +GET /session/{session_id} +``` + +**Example curl:** +```bash +curl -X GET https://nebula-api.thirdweb.com/session/abc123 \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" +``` + +**Response:** +```tsx +{ + "result": { + "id": "string", + "title": "string", + "model_name": "string", + "is_public": boolean, + "created_at": "datetime", + "updated_at": "datetime", + "messages": [] + } +} +``` \ No newline at end of file diff --git a/apps/portal/src/app/nebula/api-reference/list-session/page.mdx b/apps/portal/src/app/nebula/api-reference/list-session/page.mdx new file mode 100644 index 00000000000..f34c8a97648 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/list-session/page.mdx @@ -0,0 +1,29 @@ +#### List Sessions + +Retrieve available sessions for the authenticated account. + +```bash +GET /session/list +``` + +**Example curl:** +```bash +curl -X GET https://nebula-api.thirdweb.com/session/list \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" +``` + +**Response:** +```bash +{ + "result": [ + { + "id": "string", + "title": "string", + "model_name": "string", + "is_public": boolean, + "created_at": "datetime", + "updated_at": "datetime" + } + ] +} +``` \ No newline at end of file diff --git a/apps/portal/src/app/nebula/api-reference/page.mdx b/apps/portal/src/app/nebula/api-reference/page.mdx index 0e0d2f409c2..60da3e9dc64 100644 --- a/apps/portal/src/app/nebula/api-reference/page.mdx +++ b/apps/portal/src/app/nebula/api-reference/page.mdx @@ -206,59 +206,6 @@ eventSource.addEventListener('error', (event) => { ### Chat -#### Send Message - -```http -POST /chat -``` - -**Request Body:** -```json -{ - "message": "Find the last 5 blocks", - "session_id": "abc", - "stream": true, - "context_filter": { - "chain_ids": [137], - "contract_addresses": ["0x..."], - "wallet_addresses": ["0x..."] - }, - "execute_config": { - "mode": "client", - "signer_wallet_address": "0x..." - } -} -``` - -**Request Parameters:** - -- `message` (required) - - Type: string - - Description: The user's input message or command to be processed by Nebula - -- `session_id` (optional) - - Type: string - - Description: Identifier for maintaining conversation context - - Default: A new session will be created if omitted - -- `stream` (optional) - - Type: boolean - - Description: Controls whether the response is streamed or returned as a single response - - Default: false - -- `context_filter` (optional) - - Type: object - - Description: Controls which blockchain data sources are used for context - - Properties: - - `chain_ids`: Array of numbers representing blockchain network IDs - - `contract_addresses`: Array of strings containing contract addresses to focus on - -- `execute_config` (optional) - - Type: object - - Description: Configuration for transaction execution - - Properties: - - `mode`: String indicating execution mode (currently only "client" is supported) - - `signer_wallet_address`: String containing the wallet address that will sign transactions #### Chat Messages @@ -396,115 +343,7 @@ const data = await response.json(); const result = await handleNebulaResponse(data); ``` -### Execute - - -```bash -POST /execute -``` -Execute specific blockchain commands or actions. This endpoint is designed for direct command execution without the conversational context of the chat endpoint. - -**Request Body:** -```bash -{ - "message": "send 0.0001 ETH on sepolia to vitalik.eth", - "user_id": "default-user", - "stream": false, - "execute_config": { - "mode": "client", - "signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE" - } -} -``` - -**Request Parameters:** -- `message` (required): The command to execute -- `user_id` (optional): Identifier for the user making the request -- `stream` (optional): Whether to stream the response -- `execute_config` (optional): Configuration for transaction execution - - `mode`: Execution mode (currently only "client" is supported) - - `signer_wallet_address`: Address that will sign the transaction - -**Example Response:** -```json -{ - "message": "The transaction to transfer 0.0001 ETH to the address resolved from the ENS name `vitalik.eth` (which is `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`) is set up successfully. The simulation indicates that the transaction is likely to succeed.\n\nPlease proceed by signing and confirming the transaction.", - "actions": [ - { - "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", - "request_id": "c2b51ed6-da79-49ac-b411-206a42059509", - "type": "sign_transaction", - "source": "executor", - "data": "{\"chainId\": 11155111, \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": \"0x5af3107a4000\"}" - } - ], - "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", - "request_id": "c2b51ed6-da79-49ac-b411-206a42059509" -} -``` - -**Example curl:** -```bash -curl -X POST https://nebula-api.thirdweb.com/execute \ - -H "Content-Type: application/json" \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ - -d '{ - "message": "send 0.0001 ETH on sepolia to vitalik.eth", - "user_id": "default-user", - "stream": false, - "execute_config": { - "mode": "client", - "signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE" - } - }' -``` - -**Response Properties:** -- `message`: A human-readable description of the action to be taken -- `actions`: Array of actions to be executed - - `session_id`: Unique identifier for the session - - `request_id`: Unique identifier for this request - - `type`: The type of action (e.g., "sign_transaction") - - `source`: Origin of the action - - `data`: Transaction data in hexadecimal format including: - - `chainId`: Network identifier - - `to`: Recipient's address - - `data`: Transaction data - - `value`: Amount to send in hex -- `session_id`: Session identifier for this execution -- `request_id`: Unique identifier for this request - -### Sessions - -#### List Sessions - -```bash -GET /session/list -``` - -Retrieve available sessions for the authenticated account. -**Example curl:** -```bash -curl -X GET https://nebula-api.thirdweb.com/session/list \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" -``` - -**Response:** -```bash -{ - "result": [ - { - "id": "string", - "title": "string", - "model_name": "string", - "is_public": boolean, - "created_at": "datetime", - "updated_at": "datetime" - } - ] -} -``` #### Get Session @@ -535,109 +374,4 @@ curl -X GET https://nebula-api.thirdweb.com/session/abc123 \ } ``` -#### Create Session - -```bash -POST /session -``` - -Create a new chat session. - -**Request Body:** -```tsx -{ - "title": "My DeFi Research", // Optional: Custom session title - "is_public": true, // Optional: Make session publicly accessible - "context_filter": { // Optional: Filter data sources - "chain_ids": [1], - "contract_addresses": ["0x..."] - } -} -``` - -**Example curl:** -```bash -curl -X POST https://nebula-api.thirdweb.com/session \ - -H "Content-Type: application/json" \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ - -d '{ - "title": "My DeFi Research", - "is_public": true, - "context_filter": { - "chain_ids": [1] - } - }' -``` - -#### Update Session - -```bash -PUT /session/{session_id} -``` - -Update an existing session. - -**Example curl:** -```bash -curl -X PUT https://nebula-api.thirdweb.com/session/abc123 \ - -H "Content-Type: application/json" \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ - -d '{ - "title": "Updated Title", - "is_public": true - }' -``` - -**Request Body:** -```tsx -{ - "title": "string", - "is_public": boolean -} -``` - -#### Clear Session - -```bash -POST /session/{session_id}/clear -``` - -Clear a session's message history. - -**Example curl:** -```bash -curl -X POST https://nebula-api.thirdweb.com/session/abc123/clear \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" -``` - -#### Delete Session - -```bash -DELETE /session/{session_id} -``` - -Delete a session. - -**Example curl:** -```bash -curl -X DELETE https://nebula-api.thirdweb.com/session/abc123 \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" -``` - -## Error Handling - -The API uses standard HTTP status codes and returns errors in this format: - -```bash -{ - "error": { - "message": "Error description" - } -} -``` -Common Status Codes: -- 400: Bad Request -- 401: Unauthorized -- 404: Not Found -- 500: Internal Server Error diff --git a/apps/portal/src/app/nebula/api-reference/update-session/page.mdx b/apps/portal/src/app/nebula/api-reference/update-session/page.mdx new file mode 100644 index 00000000000..abf7c5411f6 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/update-session/page.mdx @@ -0,0 +1,52 @@ +#### Update Session + +Update an existing session. + +```bash +PUT /session/{session_id} +``` + +**Example curl:** +```bash +curl -X PUT https://nebula-api.thirdweb.com/session/abc123 \ + -H "Content-Type: application/json" \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ + -d '{ + "title": "Updated Title", + "is_public": true + }' +``` + +**Request Body:** +```tsx +{ + "title": "string", + "is_public": boolean +} +``` + +#### Delete Session + +```bash +DELETE /session/{session_id} +``` + +Delete a session. + +**Example curl:** +```bash +curl -X DELETE https://nebula-api.thirdweb.com/session/abc123 \ + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" +``` + +## Error Handling + +The API uses standard HTTP status codes and returns errors in this format: + +```bash +{ + "error": { + "message": "Error description" + } +} +``` \ No newline at end of file diff --git a/apps/portal/src/app/nebula/page.mdx b/apps/portal/src/app/nebula/page.mdx index 7c5d1d14a94..e9ecc6cca2b 100644 --- a/apps/portal/src/app/nebula/page.mdx +++ b/apps/portal/src/app/nebula/page.mdx @@ -4,84 +4,5 @@ Natural language model with blockchain reasoning, autonomous transaction capabil Nebula is currently available in Alpha. [Join the waitlist.](https://thirdweb.com/nebula) -## What Can Nebula Do? - -### Smart Contract Intelligence -- Analyze any smart contract's functionality and features -- Explain contract interfaces and supported standards -- Read contract data and state -- Help you understand function behaviors and parameters -- Decode complex contract interactions -- Retrieve detailed contract metadata and source code analysis - -### Blockchain Network Information -- Provide real-time network status and gas prices -- Explain block and transaction details -- Help you understand blockchain network specifications -- Offer insights about different blockchain networks -- Track transaction status and history -- Access detailed chain metadata including RPC endpoints - -### Token Analysis -- Look up token information across different networks -- Track token prices and market data -- Explain token standards and implementations -- Help you understand token bridges and cross-chain aspects -- Monitor trading pairs and liquidity -- Fetch token metadata and current exchange rates - -### Transaction and Wallet Management -- Retrieve detailed transaction information using transaction hashes -- Provide wallet balance and transaction history - -### thirdweb Product Guidance - -- Connect Integration: Implement wallet connections and social login setups with how-to guides and code snippets for user authentication flows and wallet management strategies. -- Smart Contract Development: Deploy smart contracts and manage permissions with practical examples and code snippets for contract interaction and NFT minting. -- Account Abstraction: How to use thirdweb Account Abstraction services to provide a seamless user experience for your users. -- Engine Implementation: Integrate backend systems with thirdweb Engine using transaction management and API implementation examples. - - -## Example Questions You Can Ask - -### Understanding Smart Contracts -- "What ERC standards are implemented by contract address 0x59325733eb952a92e069C87F0A6168b29E80627f on Ethereum?" -- "What functions can I use to mint more of my contract's NFTs?" -- "What is the total supply of NFTs for my contract?" - -### Interacting with wallets -- "How much ETH is in my wallet?" -- "What is the wallet address of vitalik.eth?" -- "Does my wallet hold USDC on Base?" - -### Exploring Blockchain Networks -- "What is the last block on zkSync?" -- "What is the current gas price on Avalanche C-Chain?" -- "Can you show me transaction details for 0xdfc450bb39e44bd37c22e0bfd0e5212edbea571e4e534d87b5cbbf06f10b9e04 on Optimism?" - -### Researching Tokens and Prices -- "What is the address of USDC on Ethereum?" -- "Is there a UNI token on Arbitrum?" -- "What is the current price of ARB?" - -### Building with thirdweb -- "How can I add a connect wallet button to my web app? I want to support users connecting with both email/social wallets and MetaMask and use smart wallets." -- "Can you show me how to claim an NFT from an ERC721 using TypeScript?" -- "I have an ERC1155 contract from thirdweb. Can you show me how to generate and mint with a signature?" -- "I have an ERC20 token. Can you show me how I'd use Engine to mint additional tokens to a user wallet?" -- "How can I query for the status of queued transactions on Engine?" - -## What Can You Build With Nebula? - -- Chat with an AI with blockchain context - answer questions about transactions, wallets, and smart contracts in real-time -- Create code editors that can write web3 apps & games -- Build blockchain explorers that explain complex transactions in plain English -- Build automated trading agents that can monitor and execute trades based on specific conditions -- Perform smart contract security analysis and audit assistance -- Create wallet management assistants that help users track portfolios and suggest optimizations -- Create DeFi strategy advisors that analyze yields and risks across protocols -- Create NFT collection managers that can mint, list, and track market activity -- Enable automated customer support for web3 products - ## Supported Chains Nebula is supported on every EVM compatible chain. To view the full list, visit [thirdweb chainlist](https://thirdweb.com/chainlist). diff --git a/apps/portal/src/app/nebula/prompt-guide/page.mdx b/apps/portal/src/app/nebula/prompt-guide/page.mdx new file mode 100644 index 00000000000..0945e3350d1 --- /dev/null +++ b/apps/portal/src/app/nebula/prompt-guide/page.mdx @@ -0,0 +1,15 @@ +# Prompt Guide + +Maximize the potential of Nebula. Whether you’re new to blockchain development or an experienced user, this document will help you craft prompts that fully leverage Nebula’s blockchain specific features. + +### Supported Actions + +| **Action** | **Description** | **Examples** | +|-----------------------------|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Understand** | Retrieve information about smart contracts. | • "What ERC standards are implemented by contract address 0x59325733eb952a92e069C87F0A6168b29E80627f on Ethereum?"
• "What functions can I use to mint more of my contract's NFTs?"
• "What is the total supply of NFTs for my contract?" | +| **Interact** | Query wallet balances, addresses, and token holdings. | • "How much ETH is in my wallet?"
• "What is the wallet address of vitalik.eth?"
• "Does my wallet hold USDC on Base?" | +| **Explore** | Access blockchain-specific data. | • "What is the last block on zkSync?"
• "What is the current gas price on Avalanche C-Chain?"
• "Can you show me transaction details for 0xdfc450bb39e44bd37c22e0bfd0e5212edbea571e4e534d87b5cbbf06f10b9e04 on Optimism?" | +| **Research** | Obtain details about tokens, their addresses, and current prices. | • "What is the address of USDC on Ethereum?"
• "Is there a UNI token on Arbitrum?"
• "What is the current price of ARB?" | +| **Build** | Implement features using Web3 SDKs and tools. | • "How can I add a connect wallet button to my web app? I want to support users connecting with both email/social wallets and MetaMask and use smart wallets."
• "Can you show me how to claim an NFT from an ERC721 using TypeScript?"
• "I have an ERC1155 contract from thirdweb. Can you show me how to generate and mint with a signature?"
• "I have an ERC20 token. Can you show me how I'd use Engine to mint additional tokens to a user wallet?"
• "How can I query for the status of queued transactions on Engine?" | + + diff --git a/apps/portal/src/app/nebula/sidebar.tsx b/apps/portal/src/app/nebula/sidebar.tsx index 8e23da6b441..4ea97f9add3 100644 --- a/apps/portal/src/app/nebula/sidebar.tsx +++ b/apps/portal/src/app/nebula/sidebar.tsx @@ -1,4 +1,5 @@ import type { SideBar } from "@/components/Layouts/DocLayout"; +import { NebulaSideIcon, EditIcon, CodeIcon, GetIcon, BrickIcon } from "@/icons"; export const sidebar: SideBar = { name: "Nebula", @@ -6,10 +7,65 @@ export const sidebar: SideBar = { { name: "Overview", href: "/nebula", + icon: , + }, + { + name: "Use Cases", + href: "/nebula/use-cases", + icon: , + }, + { + name: "Prompt Guide", + href: "/nebula/prompt-guide", + icon: , }, { name: "API Reference", href: "/nebula/api-reference", + icon: , + links: [ + { + name: "Send Message", + href: "/nebula/api-reference/chat", + icon: + }, + { + name: "Execute Transaction", + href: "/nebula/api-reference/execute", + icon: + }, + { + name: "List Sessions", + href: "/nebula/api-reference/list-session", + icon: , + }, + { + name: "Get Session", + href: "/nebula/api-reference/get-session", + icon: , + }, + { + name: "Create Session", + href: "/nebula/api-reference/create-session", + icon: , + }, + + { + name: "Update Session", + href: "/nebula/api-reference/update-session", + icon: + }, + { + name: "Clear Session", + href: "/nebula/api-reference/clear-session", + icon: , + }, + { + name: "Delete Session", + href: "/nebula/api-reference/delete-session", + icon: , + } + ] }, ], }; diff --git a/apps/portal/src/app/nebula/use-cases/page.mdx b/apps/portal/src/app/nebula/use-cases/page.mdx new file mode 100644 index 00000000000..c3ff7287251 --- /dev/null +++ b/apps/portal/src/app/nebula/use-cases/page.mdx @@ -0,0 +1,48 @@ +## What Can Nebula Do? + +### Smart Contract Intelligence +- Analyze any smart contract's functionality and features +- Explain contract interfaces and supported standards +- Read contract data and state +- Help you understand function behaviors and parameters +- Decode complex contract interactions +- Retrieve detailed contract metadata and source code analysis + +### Blockchain Network Information +- Provide real-time network status and gas prices +- Explain block and transaction details +- Help you understand blockchain network specifications +- Offer insights about different blockchain networks +- Track transaction status and history +- Access detailed chain metadata including RPC endpoints + +### Token Analysis +- Look up token information across different networks +- Track token prices and market data +- Explain token standards and implementations +- Help you understand token bridges and cross-chain aspects +- Monitor trading pairs and liquidity +- Fetch token metadata and current exchange rates + +### Transaction and Wallet Management +- Retrieve detailed transaction information using transaction hashes +- Provide wallet balance and transaction history + +### thirdweb Product Guidance + +- Connect Integration: Implement wallet connections and social login setups with how-to guides and code snippets for user authentication flows and wallet management strategies. +- Smart Contract Development: Deploy smart contracts and manage permissions with practical examples and code snippets for contract interaction and NFT minting. +- Account Abstraction: How to use thirdweb Account Abstraction services to provide a seamless user experience for your users. +- Engine Implementation: Integrate backend systems with thirdweb Engine using transaction management and API implementation examples. + +## What Can You Build With Nebula? + +- Chat with an AI with blockchain context - answer questions about transactions, wallets, and smart contracts in real-time +- Create code editors that can write web3 apps & games +- Build blockchain explorers that explain complex transactions in plain English +- Build automated trading agents that can monitor and execute trades based on specific conditions +- Perform smart contract security analysis and audit assistance +- Create wallet management assistants that help users track portfolios and suggest optimizations +- Create DeFi strategy advisors that analyze yields and risks across protocols +- Create NFT collection managers that can mint, list, and track market activity +- Enable automated customer support for web3 products \ No newline at end of file diff --git a/apps/portal/src/icons/API/GetIcon.tsx b/apps/portal/src/icons/API/GetIcon.tsx new file mode 100644 index 00000000000..ebf1dd1b9d6 --- /dev/null +++ b/apps/portal/src/icons/API/GetIcon.tsx @@ -0,0 +1,8 @@ +export function GetIcon(props: { className?: string }) { + return ( + + + + + ) +} \ No newline at end of file diff --git a/apps/portal/src/icons/index.ts b/apps/portal/src/icons/index.ts index 037bfc41c63..841310b0e0d 100644 --- a/apps/portal/src/icons/index.ts +++ b/apps/portal/src/icons/index.ts @@ -1,3 +1,4 @@ +import { editionDropContract } from './../../../playground-web/src/components/account-abstraction/sponsored-tx'; // sdks export { GoIcon } from "./sdks/GoIcon"; export { PythonIcon } from "./sdks/PythonIcon"; @@ -34,5 +35,14 @@ export { NebulaIcon } from "./products/nebula/NebulaIcon"; // solutions export { GamingIcon } from "./solutions/GamingIcon"; +//sidebar +export { EditIcon} from "./sidebar/EditIcon"; +export { CodeIcon} from "./sidebar/CodeIcon"; +export { BrickIcon} from "./sidebar/BrickIcon"; +export {NebulaSideIcon} from "./sidebar/NebulaSideIcon"; + +//api icons +export {GetIcon} from "./API/GetIcon"; + // general purposes export { ExternalLinkIcon } from "./ExternalLinkIcon"; diff --git a/apps/portal/src/icons/sidebar/BrickIcon.tsx b/apps/portal/src/icons/sidebar/BrickIcon.tsx new file mode 100644 index 00000000000..0503b70173f --- /dev/null +++ b/apps/portal/src/icons/sidebar/BrickIcon.tsx @@ -0,0 +1,5 @@ +export function BrickIcon(props: { className?: string }) { + return ( + + ) +} \ No newline at end of file diff --git a/apps/portal/src/icons/sidebar/CodeIcon.tsx b/apps/portal/src/icons/sidebar/CodeIcon.tsx new file mode 100644 index 00000000000..6e230f5d40e --- /dev/null +++ b/apps/portal/src/icons/sidebar/CodeIcon.tsx @@ -0,0 +1,5 @@ +export function CodeIcon(props: { className?: string }) { + return ( + + ) +} \ No newline at end of file diff --git a/apps/portal/src/icons/sidebar/EditIcon.tsx b/apps/portal/src/icons/sidebar/EditIcon.tsx new file mode 100644 index 00000000000..f49798c9143 --- /dev/null +++ b/apps/portal/src/icons/sidebar/EditIcon.tsx @@ -0,0 +1,5 @@ +export function EditIcon(props: { className?: string }) { + return ( + + ) +} \ No newline at end of file diff --git a/apps/portal/src/icons/sidebar/NebulaSideIcon.tsx b/apps/portal/src/icons/sidebar/NebulaSideIcon.tsx new file mode 100644 index 00000000000..d14f753c0ef --- /dev/null +++ b/apps/portal/src/icons/sidebar/NebulaSideIcon.tsx @@ -0,0 +1,8 @@ +export function NebulaSideIcon(props: { className?: string }) { +return ( + + + + +) +} \ No newline at end of file From 03d03b4c0ea71c262a162e7bc9f9bed8b4b4af8d Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 24 Dec 2024 12:08:09 -0700 Subject: [PATCH 2/5] lint errors --- .../src/app/nebula/api-reference/page.mdx | 169 ------------------ apps/portal/src/app/nebula/sidebar.tsx | 26 +-- apps/portal/src/icons/API/GetIcon.tsx | 25 ++- apps/portal/src/icons/index.ts | 11 +- apps/portal/src/icons/sidebar/BrickIcon.tsx | 18 +- apps/portal/src/icons/sidebar/CodeIcon.tsx | 18 +- apps/portal/src/icons/sidebar/EditIcon.tsx | 18 +- .../src/icons/sidebar/NebulaSideIcon.tsx | 26 ++- 8 files changed, 100 insertions(+), 211 deletions(-) diff --git a/apps/portal/src/app/nebula/api-reference/page.mdx b/apps/portal/src/app/nebula/api-reference/page.mdx index 60da3e9dc64..9b61fd0042d 100644 --- a/apps/portal/src/app/nebula/api-reference/page.mdx +++ b/apps/portal/src/app/nebula/api-reference/page.mdx @@ -202,176 +202,7 @@ eventSource.addEventListener('error', (event) => { eventSource.close(); }); ``` -## API Endpoints -### Chat -#### Chat Messages - -Chat messages are natural language responses from Nebula. They appear in the `message` field of the response and provide formatted information, explanations, or answers to your queries. Messages can include formatted text, blockchain data, and technical details. - -**Example Response with Chat Message:** -```json -{ - "message": "The last block on the Arbitrum mainnet is block number **284204124**. Here are the details:\n\n- **Block Hash:** 0xf42e3d624ae1e3fd6b89d4680f39943eb1cd3b8f0606918ef818d3021b7724f1\n- **Parent Hash:** 0x4c45cd0964281833b070b633980d8f530debdd21dfbdbf6eddf96cc93cbaac8e\n- **Timestamp:** 1734063299\n- **Gas Used:** 5,064,851\n- **Gas Limit:** 1,125,899,906,842,624\n- **Base Fee per Gas:** 10,000,000\n- **Transaction Count:** 7\n- **Withdrawals Count:** 0\n\nIf you need any more information about this block or related transactions, feel free to ask!", - "actions": [], - "session_id": "5d579903-5a63-434f-8667-788adfae9304", - "request_id": "d46cfb80-de6a-48a6-9a97-746e1708d066" -} -``` - -Response properties: -- `message`: A formatted string containing the response, which may include: - - Markdown formatting for better readability - - Technical data (hashes, addresses, numbers) - - Structured information about blockchain state -- `actions`: Array of actions (empty when no transactions are needed) -- `session_id`: Unique identifier for the current session -- `request_id`: Unique identifier for the specific request - -#### Chat Actions - -Chat actions represent blockchain transactions or operations that Nebula has prepared in response to your request. The response includes both a detailed explanation in the `message` field and the actual transaction data in the `actions` array. - -**Example Response with Chat Action:** -```json -{ - "message": "The transaction to transfer 0.0001 ETH to the address resolved from the ENS name `vitalik.eth` (which is `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`) is set up successfully. The simulation indicates that the transaction is likely to succeed.\n\nPlease proceed by signing and confirming the transaction.", - "actions": [ - { - "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", - "request_id": "c2b51ed6-da79-49ac-b411-206a42059509", - "type": "sign_transaction", - "source": "executor", - "data": "{\"chainId\": 11155111, \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": \"0x5af3107a4000\"}" - } - ], - "session_id": "437a0df7-d512-4ef4-95b5-6168ccbbe097", - "request_id": "c2b51ed6-da79-49ac-b411-206a42059509" -} -``` - -**Action Properties:** -- `session_id`: Unique identifier for the current session -- `request_id`: Unique identifier for the specific request -- `type`: The type of action (e.g., "sign_transaction") -- `source`: Origin of the action (e.g., "executor") -- `data`: Transaction parameters including: - - `chainId`: Network identifier (e.g., 11155111 for Sepolia) - - `to`: Recipient's address - - `data`: Transaction data (if any) - - `value`: Amount to send in wei - -When handling actions: -1. Parse the `message` field for human-readable transaction details -2. Extract the transaction data from the `actions` array -3. Present transaction details to the user for review -4. Use a local wallet to sign the transaction -5. Broadcast the signed transaction to the network - -**Example Implementation with thirdweb SDK:** -```javascript -import { - createThirdwebClient, - prepareTransaction, - sendTransaction, - privateKeyToAccount -} from "thirdweb"; - -// Example function to handle the API response -async function handleNebulaResponse(response) { - // Initialize thirdweb client - const client = createThirdwebClient({ - secretKey: process.env.THIRDWEB_SECRET_KEY - }); - - // Initialize account - const account = privateKeyToAccount({ - client, - privateKey: process.env.EOA_PRIVATE_KEY - }); - - // Check if we have any actions - if (response.actions && response.actions.length > 0) { - const action = response.actions[0]; - - // Parse the transaction data from the action - const txData = JSON.parse(action.data); - - try { - // Prepare transaction with client - const transaction = prepareTransaction({ - to: txData.to, - data: txData.data, - value: BigInt(txData.value), - chain: txData.chainId, - client - }); - - // Send transaction with account - const result = await sendTransaction({ - transaction, - account - }); - - return result; - } catch (error) { - console.error("Error processing transaction:", error); - throw error; - } - } -} - -// Example usage -const response = await fetch('https://nebula-api.thirdweb.com/chat', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'x-secret-key': 'YOUR_THIRDWEB_SECRET_KEY' - }, - body: JSON.stringify({ - message: "send 0.0001 ETH on sepolia to vitalik.eth", - execute_config: { - mode: "client", - signer_wallet_address: "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE" - } - }) -}); - -const data = await response.json(); -const result = await handleNebulaResponse(data); -``` - - - -#### Get Session - -```bash -GET /session/{session_id} -``` - -Get details for a specific session. - -**Example curl:** -```bash -curl -X GET https://nebula-api.thirdweb.com/session/abc123 \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" -``` - -**Response:** -```tsx -{ - "result": { - "id": "string", - "title": "string", - "model_name": "string", - "is_public": boolean, - "created_at": "datetime", - "updated_at": "datetime", - "messages": [] - } -} -``` - diff --git a/apps/portal/src/app/nebula/sidebar.tsx b/apps/portal/src/app/nebula/sidebar.tsx index 4ea97f9add3..4e389eb6546 100644 --- a/apps/portal/src/app/nebula/sidebar.tsx +++ b/apps/portal/src/app/nebula/sidebar.tsx @@ -1,5 +1,11 @@ import type { SideBar } from "@/components/Layouts/DocLayout"; -import { NebulaSideIcon, EditIcon, CodeIcon, GetIcon, BrickIcon } from "@/icons"; +import { + BrickIcon, + CodeIcon, + EditIcon, + GetIcon, + NebulaSideIcon, +} from "@/icons"; export const sidebar: SideBar = { name: "Nebula", @@ -7,32 +13,32 @@ export const sidebar: SideBar = { { name: "Overview", href: "/nebula", - icon: , + icon: , }, { name: "Use Cases", href: "/nebula/use-cases", - icon: , + icon: , }, { name: "Prompt Guide", href: "/nebula/prompt-guide", - icon: , + icon: , }, { name: "API Reference", href: "/nebula/api-reference", - icon: , + icon: , links: [ { name: "Send Message", href: "/nebula/api-reference/chat", - icon: + icon: , }, { name: "Execute Transaction", href: "/nebula/api-reference/execute", - icon: + icon: , }, { name: "List Sessions", @@ -53,7 +59,7 @@ export const sidebar: SideBar = { { name: "Update Session", href: "/nebula/api-reference/update-session", - icon: + icon: , }, { name: "Clear Session", @@ -64,8 +70,8 @@ export const sidebar: SideBar = { name: "Delete Session", href: "/nebula/api-reference/delete-session", icon: , - } - ] + }, + ], }, ], }; diff --git a/apps/portal/src/icons/API/GetIcon.tsx b/apps/portal/src/icons/API/GetIcon.tsx index ebf1dd1b9d6..aa1f07917a2 100644 --- a/apps/portal/src/icons/API/GetIcon.tsx +++ b/apps/portal/src/icons/API/GetIcon.tsx @@ -1,8 +1,19 @@ export function GetIcon(props: { className?: string }) { - return ( - - - - - ) -} \ No newline at end of file + return ( + + Get Icon + + + + ); +} diff --git a/apps/portal/src/icons/index.ts b/apps/portal/src/icons/index.ts index 841310b0e0d..de830bb96de 100644 --- a/apps/portal/src/icons/index.ts +++ b/apps/portal/src/icons/index.ts @@ -1,4 +1,3 @@ -import { editionDropContract } from './../../../playground-web/src/components/account-abstraction/sponsored-tx'; // sdks export { GoIcon } from "./sdks/GoIcon"; export { PythonIcon } from "./sdks/PythonIcon"; @@ -36,13 +35,13 @@ export { NebulaIcon } from "./products/nebula/NebulaIcon"; export { GamingIcon } from "./solutions/GamingIcon"; //sidebar -export { EditIcon} from "./sidebar/EditIcon"; -export { CodeIcon} from "./sidebar/CodeIcon"; -export { BrickIcon} from "./sidebar/BrickIcon"; -export {NebulaSideIcon} from "./sidebar/NebulaSideIcon"; +export { EditIcon } from "./sidebar/EditIcon"; +export { CodeIcon } from "./sidebar/CodeIcon"; +export { BrickIcon } from "./sidebar/BrickIcon"; +export { NebulaSideIcon } from "./sidebar/NebulaSideIcon"; //api icons -export {GetIcon} from "./API/GetIcon"; +export { GetIcon } from "./API/GetIcon"; // general purposes export { ExternalLinkIcon } from "./ExternalLinkIcon"; diff --git a/apps/portal/src/icons/sidebar/BrickIcon.tsx b/apps/portal/src/icons/sidebar/BrickIcon.tsx index 0503b70173f..1d13036ea4e 100644 --- a/apps/portal/src/icons/sidebar/BrickIcon.tsx +++ b/apps/portal/src/icons/sidebar/BrickIcon.tsx @@ -1,5 +1,15 @@ export function BrickIcon(props: { className?: string }) { - return ( - - ) -} \ No newline at end of file + return ( + + Brick Icon + + + ); +} diff --git a/apps/portal/src/icons/sidebar/CodeIcon.tsx b/apps/portal/src/icons/sidebar/CodeIcon.tsx index 6e230f5d40e..76d53345da0 100644 --- a/apps/portal/src/icons/sidebar/CodeIcon.tsx +++ b/apps/portal/src/icons/sidebar/CodeIcon.tsx @@ -1,5 +1,15 @@ export function CodeIcon(props: { className?: string }) { - return ( - - ) -} \ No newline at end of file + return ( + + Code Icon + + + ); +} diff --git a/apps/portal/src/icons/sidebar/EditIcon.tsx b/apps/portal/src/icons/sidebar/EditIcon.tsx index f49798c9143..1dadec69164 100644 --- a/apps/portal/src/icons/sidebar/EditIcon.tsx +++ b/apps/portal/src/icons/sidebar/EditIcon.tsx @@ -1,5 +1,15 @@ export function EditIcon(props: { className?: string }) { - return ( - - ) -} \ No newline at end of file + return ( + + Edit Icon + + + ); +} diff --git a/apps/portal/src/icons/sidebar/NebulaSideIcon.tsx b/apps/portal/src/icons/sidebar/NebulaSideIcon.tsx index d14f753c0ef..f0072d30d40 100644 --- a/apps/portal/src/icons/sidebar/NebulaSideIcon.tsx +++ b/apps/portal/src/icons/sidebar/NebulaSideIcon.tsx @@ -1,8 +1,20 @@ export function NebulaSideIcon(props: { className?: string }) { -return ( - - - - -) -} \ No newline at end of file + return ( + + Nebula Side Icon + + + ); +} From 398a5da7bb1ff3610a75b0010f56bca25a231b6a Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 24 Dec 2024 12:39:45 -0700 Subject: [PATCH 3/5] graphite fixes --- .../api-reference/delete-session/page.mdx | 4 ++- .../api-reference/update-session/page.mdx | 26 ------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/apps/portal/src/app/nebula/api-reference/delete-session/page.mdx b/apps/portal/src/app/nebula/api-reference/delete-session/page.mdx index b766e9c1da2..c7734e15150 100644 --- a/apps/portal/src/app/nebula/api-reference/delete-session/page.mdx +++ b/apps/portal/src/app/nebula/api-reference/delete-session/page.mdx @@ -9,5 +9,7 @@ DELETE /session/{session_id} Example curl: +```bash curl -X DELETE https://nebula-api.thirdweb.com/session/abc123 \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \ No newline at end of file + -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" +``` \ No newline at end of file diff --git a/apps/portal/src/app/nebula/api-reference/update-session/page.mdx b/apps/portal/src/app/nebula/api-reference/update-session/page.mdx index abf7c5411f6..1d2baeeb278 100644 --- a/apps/portal/src/app/nebula/api-reference/update-session/page.mdx +++ b/apps/portal/src/app/nebula/api-reference/update-session/page.mdx @@ -23,30 +23,4 @@ curl -X PUT https://nebula-api.thirdweb.com/session/abc123 \ "title": "string", "is_public": boolean } -``` - -#### Delete Session - -```bash -DELETE /session/{session_id} -``` - -Delete a session. - -**Example curl:** -```bash -curl -X DELETE https://nebula-api.thirdweb.com/session/abc123 \ - -H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" -``` - -## Error Handling - -The API uses standard HTTP status codes and returns errors in this format: - -```bash -{ - "error": { - "message": "Error description" - } -} ``` \ No newline at end of file From f0ef4e705dbc5cbb41fb0e3bbfd2dadbfddd8917 Mon Sep 17 00:00:00 2001 From: samina Date: Fri, 27 Dec 2024 18:33:04 -0700 Subject: [PATCH 4/5] added troubleshoot and faqs page --- apps/portal/src/app/nebula/faqs/page.mdx | 5 ++ apps/portal/src/app/nebula/page.mdx | 46 +++++++++++++++++++ .../src/app/nebula/plugins/eliza/page.mdx | 5 ++ apps/portal/src/app/nebula/plugins/page.mdx | 3 ++ apps/portal/src/app/nebula/sidebar.tsx | 24 ++++++++++ .../src/app/nebula/troubleshoot/page.mdx | 3 ++ apps/portal/src/app/nebula/use-cases/page.mdx | 10 ++-- apps/portal/src/icons/index.ts | 3 ++ apps/portal/src/icons/sidebar/CodeIcon.tsx | 2 +- apps/portal/src/icons/sidebar/PluginIcon.tsx | 15 ++++++ .../portal/src/icons/sidebar/QuestionIcon.tsx | 15 ++++++ .../src/icons/sidebar/TroubleshootIcon.tsx | 15 ++++++ 12 files changed, 140 insertions(+), 6 deletions(-) create mode 100644 apps/portal/src/app/nebula/faqs/page.mdx create mode 100644 apps/portal/src/app/nebula/plugins/eliza/page.mdx create mode 100644 apps/portal/src/app/nebula/plugins/page.mdx create mode 100644 apps/portal/src/app/nebula/troubleshoot/page.mdx create mode 100644 apps/portal/src/icons/sidebar/PluginIcon.tsx create mode 100644 apps/portal/src/icons/sidebar/QuestionIcon.tsx create mode 100644 apps/portal/src/icons/sidebar/TroubleshootIcon.tsx diff --git a/apps/portal/src/app/nebula/faqs/page.mdx b/apps/portal/src/app/nebula/faqs/page.mdx new file mode 100644 index 00000000000..2311a328da5 --- /dev/null +++ b/apps/portal/src/app/nebula/faqs/page.mdx @@ -0,0 +1,5 @@ +# Nebula FAQs + +### When will pricing be available for Nebula? + +Pricing options will be available in beta (estimated mid January 2025). \ No newline at end of file diff --git a/apps/portal/src/app/nebula/page.mdx b/apps/portal/src/app/nebula/page.mdx index e9ecc6cca2b..a87d578da25 100644 --- a/apps/portal/src/app/nebula/page.mdx +++ b/apps/portal/src/app/nebula/page.mdx @@ -1,8 +1,54 @@ +import { PencilRulerIcon, HandCoinsIcon, BlocksIcon, WorkflowIcon, ShieldCheckIcon, CirclePlusIcon } from "lucide-react"; +import { DocImage, createMetadata, FeatureCard } from "@doc"; + + # What is Nebula? Natural language model with blockchain reasoning, autonomous transaction capabilities and real-time access to the blockchain. Nebula is currently available in Alpha. [Join the waitlist.](https://thirdweb.com/nebula) +## Features + +
+ } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> +
+ ## Supported Chains Nebula is supported on every EVM compatible chain. To view the full list, visit [thirdweb chainlist](https://thirdweb.com/chainlist). diff --git a/apps/portal/src/app/nebula/plugins/eliza/page.mdx b/apps/portal/src/app/nebula/plugins/eliza/page.mdx new file mode 100644 index 00000000000..8b6ab36470a --- /dev/null +++ b/apps/portal/src/app/nebula/plugins/eliza/page.mdx @@ -0,0 +1,5 @@ +### Coming Soon + +We are actively developing plugins to develop with other frameworks and languages. If you have a specific request, please [contact us](https://thirdweb.com/contact). + + diff --git a/apps/portal/src/app/nebula/plugins/page.mdx b/apps/portal/src/app/nebula/plugins/page.mdx new file mode 100644 index 00000000000..31c221768a6 --- /dev/null +++ b/apps/portal/src/app/nebula/plugins/page.mdx @@ -0,0 +1,3 @@ +### Coming Soon + +We are actively developing plugins to develop with other frameworks and languages. If you have a specific request, please [contact us](https://thirdweb.com/contact). \ No newline at end of file diff --git a/apps/portal/src/app/nebula/sidebar.tsx b/apps/portal/src/app/nebula/sidebar.tsx index 4e389eb6546..5c12ff95597 100644 --- a/apps/portal/src/app/nebula/sidebar.tsx +++ b/apps/portal/src/app/nebula/sidebar.tsx @@ -5,6 +5,9 @@ import { EditIcon, GetIcon, NebulaSideIcon, + PluginIcon, + QuestionIcon, + TroubleshootIcon, } from "@/icons"; export const sidebar: SideBar = { @@ -25,6 +28,17 @@ export const sidebar: SideBar = { href: "/nebula/prompt-guide", icon: , }, + { + name: "Plugins", + href: "/nebula/plugins", + icon: , + links: [ + { + name: "Eliza", + href: "/nebula/plugins/eliza", + }, + ], + }, { name: "API Reference", href: "/nebula/api-reference", @@ -73,5 +87,15 @@ export const sidebar: SideBar = { }, ], }, + { + name: "Troubleshoot", + href: "/nebula/troubleshoot", + icon: , + }, + { + name: "FAQs", + href: "/nebula/faqs", + icon: , + }, ], }; diff --git a/apps/portal/src/app/nebula/troubleshoot/page.mdx b/apps/portal/src/app/nebula/troubleshoot/page.mdx new file mode 100644 index 00000000000..a8e5d0e25e1 --- /dev/null +++ b/apps/portal/src/app/nebula/troubleshoot/page.mdx @@ -0,0 +1,3 @@ +# Troubleshoot + +For any issues you encounter while using Nebula, please [visit our support site](https://thirdweb.com/support). \ No newline at end of file diff --git a/apps/portal/src/app/nebula/use-cases/page.mdx b/apps/portal/src/app/nebula/use-cases/page.mdx index c3ff7287251..25afe3f0cc8 100644 --- a/apps/portal/src/app/nebula/use-cases/page.mdx +++ b/apps/portal/src/app/nebula/use-cases/page.mdx @@ -1,6 +1,6 @@ ## What Can Nebula Do? -### Smart Contract Intelligence +**Smart Contract Intelligence** - Analyze any smart contract's functionality and features - Explain contract interfaces and supported standards - Read contract data and state @@ -8,7 +8,7 @@ - Decode complex contract interactions - Retrieve detailed contract metadata and source code analysis -### Blockchain Network Information +**Blockchain Network Information** - Provide real-time network status and gas prices - Explain block and transaction details - Help you understand blockchain network specifications @@ -16,7 +16,7 @@ - Track transaction status and history - Access detailed chain metadata including RPC endpoints -### Token Analysis +**Token Analysis** - Look up token information across different networks - Track token prices and market data - Explain token standards and implementations @@ -24,11 +24,11 @@ - Monitor trading pairs and liquidity - Fetch token metadata and current exchange rates -### Transaction and Wallet Management +**Transaction and Wallet Management** - Retrieve detailed transaction information using transaction hashes - Provide wallet balance and transaction history -### thirdweb Product Guidance +**Product Guidance** - Connect Integration: Implement wallet connections and social login setups with how-to guides and code snippets for user authentication flows and wallet management strategies. - Smart Contract Development: Deploy smart contracts and manage permissions with practical examples and code snippets for contract interaction and NFT minting. diff --git a/apps/portal/src/icons/index.ts b/apps/portal/src/icons/index.ts index de830bb96de..988690a6388 100644 --- a/apps/portal/src/icons/index.ts +++ b/apps/portal/src/icons/index.ts @@ -38,7 +38,10 @@ export { GamingIcon } from "./solutions/GamingIcon"; export { EditIcon } from "./sidebar/EditIcon"; export { CodeIcon } from "./sidebar/CodeIcon"; export { BrickIcon } from "./sidebar/BrickIcon"; +export { QuestionIcon } from "./sidebar/QuestionIcon"; export { NebulaSideIcon } from "./sidebar/NebulaSideIcon"; +export { PluginIcon } from "./sidebar/PluginIcon"; +export { TroubleshootIcon } from "./sidebar/TroubleshootIcon"; //api icons export { GetIcon } from "./API/GetIcon"; diff --git a/apps/portal/src/icons/sidebar/CodeIcon.tsx b/apps/portal/src/icons/sidebar/CodeIcon.tsx index 76d53345da0..dd8f31193bc 100644 --- a/apps/portal/src/icons/sidebar/CodeIcon.tsx +++ b/apps/portal/src/icons/sidebar/CodeIcon.tsx @@ -9,7 +9,7 @@ export function CodeIcon(props: { className?: string }) { className={props.className} > Code Icon - + ); } diff --git a/apps/portal/src/icons/sidebar/PluginIcon.tsx b/apps/portal/src/icons/sidebar/PluginIcon.tsx new file mode 100644 index 00000000000..5827a6a5187 --- /dev/null +++ b/apps/portal/src/icons/sidebar/PluginIcon.tsx @@ -0,0 +1,15 @@ +export function PluginIcon(props: { className?: string }) { + return ( + + Question Icon + + + ); +} diff --git a/apps/portal/src/icons/sidebar/QuestionIcon.tsx b/apps/portal/src/icons/sidebar/QuestionIcon.tsx new file mode 100644 index 00000000000..f0c0790f000 --- /dev/null +++ b/apps/portal/src/icons/sidebar/QuestionIcon.tsx @@ -0,0 +1,15 @@ +export function QuestionIcon(props: { className?: string }) { + return ( + + Question Icon + + + ); +} diff --git a/apps/portal/src/icons/sidebar/TroubleshootIcon.tsx b/apps/portal/src/icons/sidebar/TroubleshootIcon.tsx new file mode 100644 index 00000000000..ac9d004b149 --- /dev/null +++ b/apps/portal/src/icons/sidebar/TroubleshootIcon.tsx @@ -0,0 +1,15 @@ +export function TroubleshootIcon(props: { className?: string }) { + return ( + + Troubleshoot Icon + + + ); +} From 194d337da88e73e9d6281b4793fb749d5a32074a Mon Sep 17 00:00:00 2001 From: samina Date: Fri, 27 Dec 2024 19:08:41 -0700 Subject: [PATCH 5/5] fixed features list --- apps/portal/src/app/nebula/page.mdx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/portal/src/app/nebula/page.mdx b/apps/portal/src/app/nebula/page.mdx index a87d578da25..1308164e8ee 100644 --- a/apps/portal/src/app/nebula/page.mdx +++ b/apps/portal/src/app/nebula/page.mdx @@ -14,38 +14,38 @@ Nebula is currently available in Alpha. [Join the waitlist.](https://thirdweb.co className="my-4 grid gap-2 md:grid-cols-2 lg:grid-cols-2 " > } /> } /> } /> } /> } /> } />