Wallets

Solana Server Wallets

Create and manage Solana wallets for backend applications using thirdweb's secure server wallet infrastructure.

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 Server Wallet

    Create a Solana server wallet from the dashboard or via API.

  • Fund Your Wallet

    Transfer SOL to your wallet address to cover transaction fees.

  • Start Transacting

    Send tokens, sign messages, execute swaps, or submit custom transactions.


Wallet Management

List Solana Wallets

Request

fetch("https://api.thirdweb.com/v1/solana/wallets?page=1&limit=100", {
method: "GET",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
});

Response

{
"result": {
"wallets": [
{
"address": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
"createdAt": "string",
"updatedAt": "string",
"label": "value"
}
],
"pagination": {
"totalCount": 0,
"page": 0,
"limit": 0
}
}
}

Create Solana Wallet

Request

fetch("https://api.thirdweb.com/v1/solana/wallets", {
method: "POST",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
body: {
label: "treasury-solana-wallet",
},
});

Response

{
"result": {
"address": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
"createdAt": "string",
"updatedAt": "string",
"label": "value"
}
}

Balance & Tokens

Get Wallet Balance

Request

fetch(
"https://api.thirdweb.com/v1/solana/wallets/{address}/balance?tokenAddress=8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
{
method: "GET",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
},
);

Response

{
"result": {
"chainId": "solana:mainnet",
"decimals": 0,
"displayValue": "string",
"value": "string"
}
}

Send Tokens

Transfer native SOL or SPL tokens. Automatically handles token account creation for SPL tokens.

Request

fetch("https://api.thirdweb.com/v1/solana/send", {
method: "POST",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
body: {
from: "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
to: "FhtwVYF1wKAm7fWmE2N5P2eCv13wt2aT8W4Q9NQ9YcJH",
amount: "1000000",
chainId: "solana:devnet",
},
});

Response

{
"result": {
"transactionId": "string"
}
}

Message & Transaction Signing

Sign Message

Request

fetch("https://api.thirdweb.com/v1/solana/sign-message", {
method: "POST",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
body: {
from: "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
message: "Welcome to thirdweb",
},
});

Response

{
"result": {
"signature": "string"
}
}

Sign Transaction

Sign a transaction without broadcasting. Provide a serialized transaction or instructions to assemble one.

Request

fetch("https://api.thirdweb.com/v1/solana/sign-transaction", {
method: "POST",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
body: {
from: "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
chainId: "solana:devnet",
transaction:
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAECAwQFBg==",
},
});

Response

{
"result": {
"signature": "3TZx4Ev7fWN7jk7CHTrxmsf9cXB1LQjs44aYGuC9kPYcyJ8D1V8efFgAfL9QGmxZXZMpDnwhzUbBeAf7dByoDwyx",
"signedTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIAAQIDBAUGBwgJ"
}
}

Broadcast Signed Transaction

Request

fetch("https://api.thirdweb.com/v1/solana/broadcast-transaction", {
method: "POST",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
body: {
chainId: "solana:devnet",
signedTransaction:
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIAAQIDBAUGBwgJ",
},
});

Response

{
"result": {
"signature": "5ttCNobho7nk5F1Hh4pU4d9T2o1yAFn3p1w8z8jk2jKd9KWCKN6dzyuT5xP1ny4wz9f5xCLjAF6Y9s9EoTW4aE1X"
}
}

Custom Transactions

Send Transaction

Submit a transaction composed of one or more instructions. Transactions are queued and processed asynchronously.

Request

fetch("https://api.thirdweb.com/v1/solana/transactions", {
method: "POST",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
body: {
from: "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
chainId: "solana:devnet",
instructions: [
{
programId: "11111111111111111111111111111111",
accounts: [
{
address: "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
isSigner: true,
isWritable: true,
},
{
address: "FhtwVYF1wKAm7fWmE2N5P2eCv13wt2aT8W4Q9NQ9YcJH",
isSigner: false,
isWritable: true,
},
],
data: "02000000e888b30000000000",
encoding: "hex",
},
],
},
});

Response

{
"result": {
"transactionId": "string"
}
}

Get Transaction Status

Failed to load OpenAPI specification: Path /v1/solana/transactions/{transactionId} not found in OpenAPI spec

Token Swaps

Get Swap Quote

Request

fetch(
"https://api.thirdweb.com/v1/solana/swap?address=8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B&tokenIn=8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B&tokenOut=8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
{
method: "GET",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
},
);

Response

{
"result": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inputAmount": "100000000",
"outputAmount": "95423156",
"inputUsdValue": 10.5,
"outputUsdValue": 10.48,
"slippageBps": 50,
"requestId": "uuid-1234-5678"
}
}

Execute Swap

Request

fetch("https://api.thirdweb.com/v1/solana/swap", {
method: "POST",
headers: {
"x-secret-key": "<your-project-secret-key>",
},
body: {
address: "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
tokenIn: "So11111111111111111111111111111111111111112",
tokenOut: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
amount: "100000000",
chainId: "solana:mainnet",
},
});

Response

{
"result": {
"signature": "5ttCNobho7nk5F1Hh4pU4d9T2o1yAFn3p1w8z8jk2jKd9KWCKN6dzyuT5xP1ny4wz9f5xCLjAF6Y9s9EoTW4aE1X",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inputAmount": "100000000",
"outputAmount": "95423156",
"inputUsdValue": 10.5,
"outputUsdValue": 10.48,
"requestId": "uuid-1234-5678"
}
}

Example Workflow

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"}'
{
"result": {
"address": "8JBLmveV4YF5AQ7EVnKJgyj6etGgVkPp3tYqQMTu3p5B",
"label": "treasury-wallet",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}

Network Identifiers

NetworkIdentifier
Mainnetsolana:mainnet
Devnetsolana:devnet