diff --git a/apps/portal/src/app/wallets/sidebar.tsx b/apps/portal/src/app/wallets/sidebar.tsx index 967dfd82ba0..6851d8ca3b5 100644 --- a/apps/portal/src/app/wallets/sidebar.tsx +++ b/apps/portal/src/app/wallets/sidebar.tsx @@ -82,6 +82,10 @@ export const sidebar: SideBar = { href: `${walletSlug}/monitor`, name: "Monitor Transactions", }, + { + href: `${walletSlug}/solana`, + name: "Solana Transactions", + }, ], }, { separator: true }, diff --git a/apps/portal/src/app/wallets/solana/page.mdx b/apps/portal/src/app/wallets/solana/page.mdx new file mode 100644 index 00000000000..f381fc07d7b --- /dev/null +++ b/apps/portal/src/app/wallets/solana/page.mdx @@ -0,0 +1,237 @@ +import { + Callout, + createMetadata, + OpenApiEndpoint, + Steps, + Step, + Tabs, + TabsList, + TabsTrigger, + TabsContent, +} from "@doc"; + +export const metadata = createMetadata({ + image: { + title: "Solana Server Wallets", + icon: "wallets", + }, + title: "Solana Server Wallets | thirdweb", + description: + "Create and manage Solana server wallets for backend applications", +}); + +# Solana Server Wallets + +Create and manage Solana wallets for backend applications using thirdweb's secure server wallet infrastructure. + + + Solana server wallets are **not sponsored**. You must fund your wallet with SOL to transact. + + +## Capabilities + +- **Wallet Management**: Create and list Solana wallets +- **Balance & Transactions**: Check balances, send SOL/SPL tokens, query transaction status +- **Signing**: Sign messages and transactions without broadcasting +- **Token Swaps**: Get quotes and execute swaps (mainnet only) +- **Raw Transactions**: Build and broadcast custom transactions with full instruction control + +## Getting Started + + + + Create a Solana server wallet from the [dashboard](https://thirdweb.com/team/~/~/settings/server-wallets) or via API. + + + + Transfer SOL to your wallet address to cover transaction fees. + + + + Send tokens, sign messages, execute swaps, or submit custom transactions. + + + +--- + +## Wallet Management + +### List Solana Wallets + + + +### Create Solana Wallet + + + +--- + +## Balance & Tokens + +### Get Wallet Balance + + + +### Send Tokens + +Transfer native SOL or SPL tokens. Automatically handles token account creation for SPL tokens. + + + +--- + +## Message & Transaction Signing + +### Sign Message + + + +### Sign Transaction + +Sign a transaction without broadcasting. Provide a serialized transaction or instructions to assemble one. + + + +### Broadcast Signed Transaction + + + +--- + +## Custom Transactions + +### Send Transaction + +Submit a transaction composed of one or more instructions. Transactions are queued and processed asynchronously. + + + +### Get Transaction Status + + + +--- + +## Token Swaps + + + Token swaps are only available on Solana mainnet. + + +### Get Swap Quote + + + +### Execute Swap + + + +--- + +## Example Workflow + + + + 1. Create Wallet + 2. Check Balance + 3. Send Tokens + 4. Swap Tokens + + + + ```bash + curl -X POST "https://api.thirdweb.com/v1/solana/wallets" \ + -H "Content-Type: application/json" \ + -H "x-secret-key: YOUR_SECRET_KEY" \ + -d '{"label": "treasury-wallet"}' + ``` + + ```json + { + "result": { + "address": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B", + "label": "treasury-wallet", + "createdAt": "2024-01-15T10:30:00Z", + "updatedAt": "2024-01-15T10:30:00Z" + } + } + ``` + + + + ```bash + curl -X GET "https://api.thirdweb.com/v1/solana/wallets/8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B/balance?chainId=solana:mainnet" \ + -H "x-secret-key: YOUR_SECRET_KEY" + ``` + + ```json + { + "result": { + "chainId": "solana:mainnet", + "decimals": 9, + "displayValue": "1.5", + "value": "1500000000" + } + } + ``` + + + + ```bash + curl -X POST "https://api.thirdweb.com/v1/solana/send" \ + -H "Content-Type: application/json" \ + -H "x-secret-key: YOUR_SECRET_KEY" \ + -d '{ + "from": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B", + "to": "FhtwVYF1wKAm7fWmE2N5P2eCv13wt2aT8W4Q9NQ9YcJH", + "amount": "100000000", + "chainId": "solana:mainnet" + }' + ``` + + ```json + { + "result": { + "transactionId": "tx_abc123..." + } + } + ``` + + + + ```bash + curl -X POST "https://api.thirdweb.com/v1/solana/swap" \ + -H "Content-Type: application/json" \ + -H "x-secret-key: YOUR_SECRET_KEY" \ + -d '{ + "address": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B", + "tokenIn": "So11111111111111111111111111111111111111112", + "tokenOut": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", + "amount": "100000000", + "chainId": "solana:mainnet" + }' + ``` + + ```json + { + "result": { + "signature": "5ttCNobho7nk5F...", + "inputMint": "So11111111111111111111111111111111111111112", + "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", + "inputAmount": "100000000", + "outputAmount": "95423156", + "requestId": "uuid-1234-5678" + } + } + ``` + + + +--- + +## Network Identifiers + +| Network | Identifier | +|---------|------------| +| Mainnet | `solana:mainnet` | +| Devnet | `solana:devnet` |