Skip to main content

Create Wallet

Create a new wallet with secure key custody.
curl -X POST \
  -H "x-api-key: dev-api-key" \
  -H "Content-Type: application/json" \
  -d '{"label": "trading-bot-1"}' \
  http://localhost:3000/api/v1/wallets

Request Body

label
string
Human-readable label for the wallet (1-128 characters)
autoFund
boolean
default:false
Automatically fund with devnet SOL (devnet only)
fundLamports
number
Amount to fund in lamports when autoFund is true (max: 10,000,000,000)

Response

id
string
required
Unique wallet identifier (UUID)
publicKey
string
required
Base58-encoded Solana public key
provider
enum
required
Signer backend: local-dev, local-memory, kms, hsm, mpc
status
enum
required
Wallet status: active or disabled
label
string
Wallet label
createdAt
string
required
ISO 8601 timestamp
keyProvenance
object
Key custody information

Example Response

{
  "status": "success",
  "stage": "completed",
  "traceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "publicKey": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
    "provider": "local-dev",
    "status": "active",
    "label": "trading-bot-1",
    "createdAt": "2026-03-08T12:00:00.000Z",
    "keyProvenance": {
      "backend": "encrypted-file",
      "custody": "local",
      "deterministicAddressing": false
    }
  }
}

Get Wallet

Retrieve wallet details by ID.
cURL
curl -H "x-api-key: dev-api-key" \
     http://localhost:3000/api/v1/wallets/550e8400-e29b-41d4-a716-446655440000

Path Parameters

walletId
string
required
Wallet UUID

Response

Returns the same structure as Create Wallet.

List Wallets

List all wallets for the current tenant.
cURL
curl -H "x-api-key: dev-api-key" \
     "http://localhost:3000/api/v1/wallets?limit=20&offset=0"

Query Parameters

limit
number
default:"50"
Maximum number of wallets to return (max: 100)
offset
number
default:"0"
Number of wallets to skip

Response

{
  "status": "success",
  "stage": "completed",
  "traceId": "...",
  "data": {
    "wallets": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "publicKey": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy",
        "provider": "local-dev",
        "status": "active",
        "label": "trading-bot-1",
        "createdAt": "2026-03-08T12:00:00.000Z"
      }
    ],
    "total": 1,
    "limit": 20,
    "offset": 0
  }
}

Get Balance

Retrieve SOL balance for a wallet.
cURL
curl -H "x-api-key: dev-api-key" \
     http://localhost:3000/api/v1/wallets/550e8400-e29b-41d4-a716-446655440000/balance

Path Parameters

walletId
string
required
Wallet UUID

Response

lamports
number
required
Balance in lamports (1 SOL = 1,000,000,000 lamports)
sol
number
required
Balance in SOL (decimal)
{
  "status": "success",
  "stage": "completed",
  "traceId": "...",
  "data": {
    "lamports": 1000000000,
    "sol": 1.0
  }
}

Get Tokens

List all SPL token balances for a wallet.
cURL
curl -H "x-api-key: dev-api-key" \
     http://localhost:3000/api/v1/wallets/550e8400-e29b-41d4-a716-446655440000/tokens

Path Parameters

walletId
string
required
Wallet UUID

Response

tokens
array
required
Array of token balances
{
  "status": "success",
  "stage": "completed",
  "traceId": "...",
  "data": {
    "tokens": [
      {
        "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "amount": "1000000",
        "decimals": 6,
        "uiAmount": 1.0,
        "tokenAccount": "3pXZ..."
      }
    ]
  }
}

Sign Message

Sign a message or transaction with the wallet’s private key.
curl -X POST \
  -H "x-api-key: dev-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..."
  }' \
  http://localhost:3000/api/v1/wallets/550e8400-e29b-41d4-a716-446655440000/sign

Path Parameters

walletId
string
required
Wallet UUID

Request Body

transaction
string
Base64-encoded transaction (mutually exclusive with message)
message
string
Base64-encoded message (mutually exclusive with transaction)
Provide exactly one of transaction or message.

Response

signature
string
required
Base64-encoded signature
publicKey
string
required
Base58-encoded public key used for signing
{
  "status": "success",
  "stage": "completed",
  "traceId": "...",
  "data": {
    "signature": "3kZ8...",
    "publicKey": "7xKLvUhXW9XqHZzN3Jw8wVHGK6R4tN2gqV9mP3kL5eXy"
  }
}

Signer Backends

The wallet service supports multiple signer backends configured via environment variables:
Best for: Local development and prototyping
WALLET_SIGNER_BACKEND=encrypted-file
WALLET_KEY_ENCRYPTION_SECRET=your-secret-key
Keys are encrypted at rest using AES-256-GCM.

Security Considerations

Private keys are never exposed via the API. All signing happens within the wallet engine boundary.
Use labels to identify wallets instead of storing public keys in your application.
Best Practices:
  1. Use appropriate signer backend for your security requirements
  2. Enable auto-fund only on devnet for testing
  3. Implement wallet balance monitoring
  4. Track wallet usage via audit events
  5. Regularly rotate encryption secrets for encrypted-file backend
  6. Use HSM or MPC backends for production custody

Build docs developers (and LLMs) love