Skip to content

Commit b27fcd3

Browse files
committed
Add Solana wallet docs and sidebar link (#8489)
Added a new sidebar entry for Solana Transactions in the wallets section and introduced a comprehensive Solana server wallet documentation page covering wallet management, balances, transactions, signing, swaps, and example API workflows. Closes BLD-414 <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces support for managing Solana transactions in the application, including wallet creation, balance checking, token transfers, and swaps. It enhances the user interface with detailed documentation and examples for developers. ### Detailed summary - Added a new sidebar entry for `Solana Transactions`. - Created a detailed `page.mdx` for Solana server wallets. - Included metadata for the `Solana Server Wallets` page. - Documented capabilities: wallet management, balance checking, signing, token swaps, and custom transactions. - Provided example workflows using `curl` commands for various operations. - Defined network identifiers for `Mainnet` and `Devnet`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Solana Transactions link in Server Wallets navigation for streamlined access to Solana wallet operations * **Documentation** * New Solana server wallets documentation page with getting started guides, API workflows for wallet creation, balance retrieval, token transfers, transaction signing, and token swap operations <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent c40603f commit b27fcd3

File tree

2 files changed

+241
-0
lines changed

2 files changed

+241
-0
lines changed

apps/portal/src/app/wallets/sidebar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export const sidebar: SideBar = {
8282
href: `${walletSlug}/monitor`,
8383
name: "Monitor Transactions",
8484
},
85+
{
86+
href: `${walletSlug}/solana`,
87+
name: "Solana Transactions",
88+
},
8589
],
8690
},
8791
{ separator: true },
Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
import {
2+
Callout,
3+
createMetadata,
4+
OpenApiEndpoint,
5+
Steps,
6+
Step,
7+
Tabs,
8+
TabsList,
9+
TabsTrigger,
10+
TabsContent,
11+
} from "@doc";
12+
13+
export const metadata = createMetadata({
14+
image: {
15+
title: "Solana Server Wallets",
16+
icon: "wallets",
17+
},
18+
title: "Solana Server Wallets | thirdweb",
19+
description:
20+
"Create and manage Solana server wallets for backend applications",
21+
});
22+
23+
# Solana Server Wallets
24+
25+
Create and manage Solana wallets for backend applications using thirdweb's secure server wallet infrastructure.
26+
27+
<Callout variant="info" title="Funding Required">
28+
Solana server wallets are **not sponsored**. You must fund your wallet with SOL to transact.
29+
</Callout>
30+
31+
## Capabilities
32+
33+
- **Wallet Management**: Create and list Solana wallets
34+
- **Balance & Transactions**: Check balances, send SOL/SPL tokens, query transaction status
35+
- **Signing**: Sign messages and transactions without broadcasting
36+
- **Token Swaps**: Get quotes and execute swaps (mainnet only)
37+
- **Raw Transactions**: Build and broadcast custom transactions with full instruction control
38+
39+
## Getting Started
40+
41+
<Steps>
42+
<Step title="Create a Server Wallet">
43+
Create a Solana server wallet from the [dashboard](https://thirdweb.com/team/~/~/settings/server-wallets) or via API.
44+
</Step>
45+
46+
<Step title="Fund Your Wallet">
47+
Transfer SOL to your wallet address to cover transaction fees.
48+
</Step>
49+
50+
<Step title="Start Transacting">
51+
Send tokens, sign messages, execute swaps, or submit custom transactions.
52+
</Step>
53+
</Steps>
54+
55+
---
56+
57+
## Wallet Management
58+
59+
### List Solana Wallets
60+
61+
<OpenApiEndpoint path="/v1/solana/wallets" method="GET" />
62+
63+
### Create Solana Wallet
64+
65+
<OpenApiEndpoint path="/v1/solana/wallets" method="POST" />
66+
67+
---
68+
69+
## Balance & Tokens
70+
71+
### Get Wallet Balance
72+
73+
<OpenApiEndpoint path="/v1/solana/wallets/{address}/balance" method="GET" />
74+
75+
### Send Tokens
76+
77+
Transfer native SOL or SPL tokens. Automatically handles token account creation for SPL tokens.
78+
79+
<OpenApiEndpoint path="/v1/solana/send" method="POST" />
80+
81+
---
82+
83+
## Message & Transaction Signing
84+
85+
### Sign Message
86+
87+
<OpenApiEndpoint path="/v1/solana/sign-message" method="POST" />
88+
89+
### Sign Transaction
90+
91+
Sign a transaction without broadcasting. Provide a serialized transaction or instructions to assemble one.
92+
93+
<OpenApiEndpoint path="/v1/solana/sign-transaction" method="POST" />
94+
95+
### Broadcast Signed Transaction
96+
97+
<OpenApiEndpoint path="/v1/solana/broadcast-transaction" method="POST" />
98+
99+
---
100+
101+
## Custom Transactions
102+
103+
### Send Transaction
104+
105+
Submit a transaction composed of one or more instructions. Transactions are queued and processed asynchronously.
106+
107+
<OpenApiEndpoint path="/v1/solana/transactions" method="POST" />
108+
109+
### Get Transaction Status
110+
111+
<OpenApiEndpoint path="/v1/solana/transactions/{transactionId}" method="GET" />
112+
113+
---
114+
115+
## Token Swaps
116+
117+
<Callout variant="info" title="Mainnet Only">
118+
Token swaps are only available on Solana mainnet.
119+
</Callout>
120+
121+
### Get Swap Quote
122+
123+
<OpenApiEndpoint path="/v1/solana/swap" method="GET" />
124+
125+
### Execute Swap
126+
127+
<OpenApiEndpoint path="/v1/solana/swap" method="POST" />
128+
129+
---
130+
131+
## Example Workflow
132+
133+
<Tabs defaultValue="create">
134+
<TabsList>
135+
<TabsTrigger value="create">1. Create Wallet</TabsTrigger>
136+
<TabsTrigger value="fund">2. Check Balance</TabsTrigger>
137+
<TabsTrigger value="send">3. Send Tokens</TabsTrigger>
138+
<TabsTrigger value="swap">4. Swap Tokens</TabsTrigger>
139+
</TabsList>
140+
141+
<TabsContent value="create">
142+
```bash
143+
curl -X POST "https://api.thirdweb.com/v1/solana/wallets" \
144+
-H "Content-Type: application/json" \
145+
-H "x-secret-key: YOUR_SECRET_KEY" \
146+
-d '{"label": "treasury-wallet"}'
147+
```
148+
149+
```json
150+
{
151+
"result": {
152+
"address": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
153+
"label": "treasury-wallet",
154+
"createdAt": "2024-01-15T10:30:00Z",
155+
"updatedAt": "2024-01-15T10:30:00Z"
156+
}
157+
}
158+
```
159+
</TabsContent>
160+
161+
<TabsContent value="fund">
162+
```bash
163+
curl -X GET "https://api.thirdweb.com/v1/solana/wallets/8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B/balance?chainId=solana:mainnet" \
164+
-H "x-secret-key: YOUR_SECRET_KEY"
165+
```
166+
167+
```json
168+
{
169+
"result": {
170+
"chainId": "solana:mainnet",
171+
"decimals": 9,
172+
"displayValue": "1.5",
173+
"value": "1500000000"
174+
}
175+
}
176+
```
177+
</TabsContent>
178+
179+
<TabsContent value="send">
180+
```bash
181+
curl -X POST "https://api.thirdweb.com/v1/solana/send" \
182+
-H "Content-Type: application/json" \
183+
-H "x-secret-key: YOUR_SECRET_KEY" \
184+
-d '{
185+
"from": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
186+
"to": "FhtwVYF1wKAm7fWmE2N5P2eCv13wt2aT8W4Q9NQ9YcJH",
187+
"amount": "100000000",
188+
"chainId": "solana:mainnet"
189+
}'
190+
```
191+
192+
```json
193+
{
194+
"result": {
195+
"transactionId": "tx_abc123..."
196+
}
197+
}
198+
```
199+
</TabsContent>
200+
201+
<TabsContent value="swap">
202+
```bash
203+
curl -X POST "https://api.thirdweb.com/v1/solana/swap" \
204+
-H "Content-Type: application/json" \
205+
-H "x-secret-key: YOUR_SECRET_KEY" \
206+
-d '{
207+
"address": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
208+
"tokenIn": "So11111111111111111111111111111111111111112",
209+
"tokenOut": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
210+
"amount": "100000000",
211+
"chainId": "solana:mainnet"
212+
}'
213+
```
214+
215+
```json
216+
{
217+
"result": {
218+
"signature": "5ttCNobho7nk5F...",
219+
"inputMint": "So11111111111111111111111111111111111111112",
220+
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
221+
"inputAmount": "100000000",
222+
"outputAmount": "95423156",
223+
"requestId": "uuid-1234-5678"
224+
}
225+
}
226+
```
227+
</TabsContent>
228+
</Tabs>
229+
230+
---
231+
232+
## Network Identifiers
233+
234+
| Network | Identifier |
235+
|---------|------------|
236+
| Mainnet | `solana:mainnet` |
237+
| Devnet | `solana:devnet` |

0 commit comments

Comments
 (0)