From b205280960beb74408982df0afdfe21fbf74d723 Mon Sep 17 00:00:00 2001 From: samina <57885104+saminacodes@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:53:35 -0700 Subject: [PATCH] initial nebula docs (#5720) Co-authored-by: greg --- apps/portal/src/app/Header.tsx | 4 + .../erc-20-paymaster/page.mdx | 51 ++ apps/portal/src/app/connect/sidebar.tsx | 4 + apps/portal/src/app/layout.tsx | 6 +- .../src/app/nebula/api-reference/page.mdx | 657 ++++++++++++++++++ apps/portal/src/app/nebula/layout.tsx | 17 + apps/portal/src/app/nebula/page.mdx | 20 + apps/portal/src/app/nebula/sidebar.tsx | 15 + apps/portal/src/app/page.tsx | 26 +- apps/portal/src/icons/index.ts | 2 + .../src/icons/products/nebula/NebulaIcon.tsx | 44 ++ apps/portal/tsconfig.json | 8 +- 12 files changed, 837 insertions(+), 17 deletions(-) create mode 100644 apps/portal/src/app/connect/account-abstraction/erc-20-paymaster/page.mdx create mode 100644 apps/portal/src/app/nebula/api-reference/page.mdx create mode 100644 apps/portal/src/app/nebula/layout.tsx create mode 100644 apps/portal/src/app/nebula/page.mdx create mode 100644 apps/portal/src/app/nebula/sidebar.tsx create mode 100644 apps/portal/src/icons/products/nebula/NebulaIcon.tsx diff --git a/apps/portal/src/app/Header.tsx b/apps/portal/src/app/Header.tsx index b1d33a84f53..ff8c67d9d28 100644 --- a/apps/portal/src/app/Header.tsx +++ b/apps/portal/src/app/Header.tsx @@ -32,6 +32,10 @@ const links = [ name: "Insight", href: "/insight", }, + { + name: "Nebula", + href: "/nebula", + }, ]; const toolLinks = [ diff --git a/apps/portal/src/app/connect/account-abstraction/erc-20-paymaster/page.mdx b/apps/portal/src/app/connect/account-abstraction/erc-20-paymaster/page.mdx new file mode 100644 index 00000000000..610498964e2 --- /dev/null +++ b/apps/portal/src/app/connect/account-abstraction/erc-20-paymaster/page.mdx @@ -0,0 +1,51 @@ + + +# ERC-20 Paymaster + +In traditional Ethereum transactions, users pay gas fees in the native cryptocurrency of the network, such as ETH. This requirement can create friction, especially for applications where users interact with smart contracts without holding native tokens. ERC-20 Paymaster enables users pay gas fees using ERC-20 tokens. [Learn more about ERC-20 Paymasters.](https://blog.thirdweb.com/account-abstraction-paymaster-pay-evm-gas-fees-with-usdt-usdc-or-any-other-erc-20-token/) + +### Get Started + + +1. Install Connect SDK + +```bash +npm install thirdweb +``` + +2. Configure the Paymaster In your SDK code, specify the ERC-20 token you wish to use for gas fees. + +Currently you may use Lisk LSK, Base USDC or Celo CUSD. + + +```tsx +import { base, lisk, celo } from "thirdweb/chains"; +import { TokenPaymaster, smartWallet } from "thirdweb/wallets"; + +// Have users pay for gas in Base USDC +const usdcWallet = smartWallet({ + chain: base, + sponsorGas: true, + overrides: { + tokenPaymaster: TokenPaymaster.BASE_USDC, + }, +}); + +// Have users pay for gas in Lisk LSK +const lskWallet = smartWallet({ + chain: lisk, + sponsorGas: true, + overrides: { + tokenPaymaster: TokenPaymaster.LISK_LSK, + }, +}); + +// Have users pay for gas in Celo CUSD +const cusdWallet = smartWallet({ + chain: celo, + sponsorGas: true, + overrides: { + tokenPaymaster: TokenPaymaster.CELO_CUSD, + }, +}); +``` \ No newline at end of file diff --git a/apps/portal/src/app/connect/sidebar.tsx b/apps/portal/src/app/connect/sidebar.tsx index 3b53c844cd8..4585f769b00 100644 --- a/apps/portal/src/app/connect/sidebar.tsx +++ b/apps/portal/src/app/connect/sidebar.tsx @@ -172,6 +172,10 @@ export const sidebar: SideBar = { }, ], }, + { + name: "ERC-20 Paymaster", + href: `${aAslug}/erc-20-paymaster`, + }, { name: "Account Factories", href: `${aAslug}/factories`, diff --git a/apps/portal/src/app/layout.tsx b/apps/portal/src/app/layout.tsx index a6ce7be7133..c40a2af1f84 100644 --- a/apps/portal/src/app/layout.tsx +++ b/apps/portal/src/app/layout.tsx @@ -66,9 +66,9 @@ export default function RootLayout({ {/* Note: Please change id as well when changing text or href so that new banner is shown to user even if user dismissed the older one */}
diff --git a/apps/portal/src/app/nebula/api-reference/page.mdx b/apps/portal/src/app/nebula/api-reference/page.mdx new file mode 100644 index 00000000000..2b23cc03ba6 --- /dev/null +++ b/apps/portal/src/app/nebula/api-reference/page.mdx @@ -0,0 +1,657 @@ +# Nebula API Reference + +Nebula provides a conversational interface to interact with blockchain data and services, and access to thirdweb tools. + +## Table of Contents + +- [Base URL](#base-url) +- [Authentication](#authentication) +- [Sessions](#sessions) +- [Context Filtering](#context-filtering) +- [Execute Configuration](#execute-configuration) +- [Response Handling](#response-handling) +- [API Endpoints](#api-endpoints) + - [Chat](#chat) +- [Error Handling](#error-handling) + +## Base URL + +All API requests should be made to: + +```bash +https://nebula-api.thirdweb.com +``` + +## Authentication + +All API endpoints require authentication using the thirdweb secret key. Include this key in your request headers: + +```bash +x-secret-key: YOUR_THIRDWEB_SECRET_KEY +``` + +Example curl with authentication: +```bash +curl -X POST https://nebula-api.thirdweb.com/chat \ + -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" + } + }' +``` + +## Sessions + +Sessions maintain conversation threads with the AI and can be: + +- Created explicitly via the `/session` endpoint +- Created automatically when sending a message without a session_id +- Reused to maintain context across multiple messages +- Configured with specific execution parameters + +Sessions persist your conversation history and custom configurations for blockchain data and thirdweb tools interactions. + +## Context Filtering + +Control what blockchain data informs AI responses through context filtering: + +```json +{ + "context_filter": { + "chain_ids": [1], // Ethereum mainnet + "contract_addresses": ["0x..."] // Target contract address + } +} +``` + +Benefits: +- Filter by blockchain networks using chain IDs +- Target specific contract addresses +- Control context scope for relevant responses +- Optimize token usage and response relevance + +## Execute Configuration + +Configure transaction execution behavior using the execute config: + +```json +{ + "execute_config": { + "mode": "client", + "signer_wallet_address": "0x..." + } +} +``` + +Parameters: +- `mode`: Execution mode (currently supports "client") +- `signer_wallet_address`: Wallet address for transaction signing + +When mode is "client", Nebula returns an unsigned transaction for local wallet signing. + +## Response Handling + +Nebula API supports two types of response modes: streaming and non-streaming. The mode is controlled by the `stream` parameter in your request. + +### Non-Streaming Responses + +When `stream: false`, the API returns a single JSON response: + +```json +{ + "result": { + "message": "The last 5 blocks on polygon are...", + "session_id": "abc", + "message_id": "1234", + "created_at": "2024-01-01T00:00:00Z", + "usage": { + "prompt_tokens": 10, + "completion_tokens": 15, + "total_tokens": 25 + } + } +} +``` + +### Streaming Responses + +When `stream: true`, the API uses Server-Sent Events (SSE) to stream the response. You'll need to handle the following event types: + +1. `init`: Initializes the stream and provides session information +2. `presence`: Provides backend status updates about worker processing +3. `action`: Contains blockchain transaction or action data +4. `delta`: Contains chunks of the response message text +5. `error`: Contains error information if something goes wrong + +**Example SSE Stream:** +```tsx +event: init +data: { + "session_id": "f4b45429-9570-4ee8-8c8f-8b267429915a", + "request_id": "9efc7f6a-8576-4d9c-8603-f6c72aa72164", + "type": "init", + "source": "user", + "data": "" +} + +event: presence +data: { + "session_id": "f4b45429-9570-4ee8-8c8f-8b267429915a", + "request_id": "9efc7f6a-8576-4d9c-8603-f6c72aa72164", + "type": "presence", + "source": "executor", + "data": "Performing function execution: ExecuteNativeTransferClientSigning" +} + +event: action +data: { + "session_id": "f4b45429-9570-4ee8-8c8f-8b267429915a", + "request_id": "9efc7f6a-8576-4d9c-8603-f6c72aa72164", + "type": "sign_transaction", + "source": "executor", + "data": "{\"maxPriorityFeePerGas\": 13620452, \"maxFeePerGas\": 53197870998, \"chainId\": 11155111, \"from\": \"0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE\", \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": 100000000000000, \"gas\": 0}" +} + +event: delta +data: {"v": "To send 0.0001 ETH on the Sepolia network"} + +event: delta +data: {"v": " to the address associated with"} +``` + +**JavaScript Example for Handling Streams:** +```javascript +const eventSource = new EventSource('/chat', { + headers: { + 'x-secret-key': 'YOUR_THIRDWEB_SECRET_KEY' + } +}); + +let messageText = ''; + +eventSource.addEventListener('init', (event) => { + const data = JSON.parse(event.data); + console.log('Stream initialized:', data); +}); + +eventSource.addEventListener('presence', (event) => { + const data = JSON.parse(event.data); + console.log('Backend status:', data.data); +}); + +eventSource.addEventListener('action', (event) => { + const data = JSON.parse(event.data); + console.log('Received action:', data); + if (data.type === 'sign_transaction') { + // Handle transaction signing + handleTransaction(data); + } +}); + +eventSource.addEventListener('delta', (event) => { + const data = JSON.parse(event.data); + messageText += data.v; + console.log('Current message:', messageText); +}); + +eventSource.addEventListener('error', (event) => { + const error = JSON.parse(event.data); + console.error('Error:', error); + eventSource.close(); +}); +``` +## API Endpoints + +### 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.."] + }, + "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": "You need to sign the following blockchain transaction to transfer 0.0001 ETH to the address resolved from the ENS name `vitalik.eth`, which is `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`. The transaction simulation shows that it will most likely succeed.\n\nHere are the transaction details:\n\n- **From:** 0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE\n- **To:** 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\n- **Value:** 0.0001 ETH\n- **Gas Limit:** 0 (will be set automatically)\n- **Chain ID:** 11155111 (Sepolia)\n\nPlease sign the transaction with the following details:\n\n{\"maxPriorityFeePerGas\":16142638,\"maxFeePerGas\":2673759432,\"chainId\":11155111,\"from\":\"0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE\",\"to\":\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\"data\":\"0x\",\"value\":100000000000000,\"gas\":0}", + "actions": [ + { + "session_id": "41d577b7-87d0-40fd-9a82-6dac2783e340", + "request_id": "d5caf693-775f-4906-ac18-d98163474dfa", + "type": "sign_transaction", + "source": "executor", + "data": "{\"maxPriorityFeePerGas\": 16142638, \"maxFeePerGas\": 2673759432, \"chainId\": 11155111, \"from\": \"0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE\", \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": 100000000000000, \"gas\": 0}" + } + ], + "session_id": "41d577b7-87d0-40fd-9a82-6dac2783e340", + "request_id": "d5caf693-775f-4906-ac18-d98163474dfa" +} +``` + +**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: + - `maxPriorityFeePerGas`: Maximum priority fee per gas unit + - `maxFeePerGas`: Maximum total fee per gas unit + - `chainId`: Network identifier (e.g., 11155111 for Sepolia) + - `from`: Sender's address + - `to`: Recipient's address + - `data`: Transaction data (if any) + - `value`: Amount to send in wei + - `gas`: Gas limit (0 for automatic estimation) + +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), + maxFeePerGas: BigInt(txData.maxFeePerGas), + maxPriorityFeePerGas: BigInt(txData.maxPriorityFeePerGas), + 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); +``` + +#### Execute Command + + + +```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 is to transfer 0.0001 ETH to the address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045. The transaction simulation indicates that it will most likely succeed. \n\nPlease go ahead and sign and confirm the transaction.", + "actions": [ + { + "session_id": "d8ca7326-fea4-4bcc-9bb7-9c84dd138379", + "request_id": "40404a54-be4a-4540-8c97-d74f8c454d0e", + "type": "sign_transaction", + "source": "executor", + "data": "{\"maxPriorityFeePerGas\": \"0x6a392bd\", \"maxFeePerGas\": \"0x546126ce9\", \"chainId\": 11155111, \"from\": \"0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE\", \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": \"0x5af3107a4000\", \"gas\": \"0x5208\"}" + } + ], + "session_id": "d8ca7326-fea4-4bcc-9bb7-9c84dd138379", + "request_id": "40404a54-be4a-4540-8c97-d74f8c454d0e" +} +``` + +**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: + - `maxPriorityFeePerGas`: Maximum priority fee per gas in hex + - `maxFeePerGas`: Maximum fee per gas in hex + - `chainId`: Network identifier + - `from`: Sender's address + - `to`: Recipient's address + - `data`: Transaction data + - `value`: Amount to send in hex + - `gas`: Gas limit 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 + +```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": [] + } +} +``` + +#### 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/layout.tsx b/apps/portal/src/app/nebula/layout.tsx new file mode 100644 index 00000000000..2c1a868e190 --- /dev/null +++ b/apps/portal/src/app/nebula/layout.tsx @@ -0,0 +1,17 @@ +import { DocLayout } from "@/components/Layouts/DocLayout"; +import { createMetadata } from "@doc"; +import { sidebar } from "./sidebar"; + +export default async function Layout(props: { children: React.ReactNode }) { + return ( + + {props.children} + + ); +} + +export const metadata = createMetadata({ + title: "thirdweb Nebula Documentation", + description: + "thirdweb Nebula Docs : explore the Nebula API Reference and unlock the most powerful AI to interact with the blockchain yet.", +}); diff --git a/apps/portal/src/app/nebula/page.mdx b/apps/portal/src/app/nebula/page.mdx new file mode 100644 index 00000000000..36f12df5c4e --- /dev/null +++ b/apps/portal/src/app/nebula/page.mdx @@ -0,0 +1,20 @@ +# 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) + +### With Nebula, you can: + +- 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). \ No newline at end of file diff --git a/apps/portal/src/app/nebula/sidebar.tsx b/apps/portal/src/app/nebula/sidebar.tsx new file mode 100644 index 00000000000..8e23da6b441 --- /dev/null +++ b/apps/portal/src/app/nebula/sidebar.tsx @@ -0,0 +1,15 @@ +import type { SideBar } from "@/components/Layouts/DocLayout"; + +export const sidebar: SideBar = { + name: "Nebula", + links: [ + { + name: "Overview", + href: "/nebula", + }, + { + name: "API Reference", + href: "/nebula/api-reference", + }, + ], +}; diff --git a/apps/portal/src/app/page.tsx b/apps/portal/src/app/page.tsx index 2ec7194ef0e..10bd74818dc 100644 --- a/apps/portal/src/app/page.tsx +++ b/apps/portal/src/app/page.tsx @@ -8,12 +8,12 @@ import { ConnectOverviewIcon, ContractDeployIcon, ContractExploreIcon, - ContractInteractIcon, ContractModularContractIcon, ContractPublishIcon, DotNetIcon, InfraEngineIcon, InfraInsightIcon, + NebulaIcon, PayIcon, ReactIcon, TypeScriptIcon, @@ -45,6 +45,7 @@ export default function Page() { + ); } @@ -314,12 +315,6 @@ function ContractsSection() { href="/contracts/build/overview" icon={ContractModularContractIcon} /> - + +
+ + + + + ); +} + function SectionTitle(props: { title: string; id: string; diff --git a/apps/portal/src/icons/index.ts b/apps/portal/src/icons/index.ts index 6bd16f5db15..037bfc41c63 100644 --- a/apps/portal/src/icons/index.ts +++ b/apps/portal/src/icons/index.ts @@ -29,6 +29,8 @@ export { WalletsAuthIcon } from "./products/wallets/WalletsAuthIcon"; export { WalletsConnectIcon } from "./products/wallets/WalletsConnectIcon"; export { WalletsInAppIcon } from "./products/wallets/WalletsInAppIcon"; export { WalletsSmartIcon } from "./products/wallets/WalletsSmartIcon"; +//nebula +export { NebulaIcon } from "./products/nebula/NebulaIcon"; // solutions export { GamingIcon } from "./solutions/GamingIcon"; diff --git a/apps/portal/src/icons/products/nebula/NebulaIcon.tsx b/apps/portal/src/icons/products/nebula/NebulaIcon.tsx new file mode 100644 index 00000000000..8b894e4e56f --- /dev/null +++ b/apps/portal/src/icons/products/nebula/NebulaIcon.tsx @@ -0,0 +1,44 @@ +export function NebulaIcon(props: { className?: string }) { + return ( + + nebula + + + + + + ); +} diff --git a/apps/portal/tsconfig.json b/apps/portal/tsconfig.json index 21173007022..c4f61b222f4 100644 --- a/apps/portal/tsconfig.json +++ b/apps/portal/tsconfig.json @@ -28,13 +28,7 @@ }, "forceConsistentCasingInFileNames": true }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts", - "src/app/react/v5/components/onchain/page.mdx" - ], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"], "ts-node": { "compilerOptions": {