Skip to main content

Managed Wallets

A SolanaLaser API key owns one or more managed wallets. Every execution endpoint uses the default wallet unless its request includes wallet with the public key of another wallet on the same API key.

Use Laser Setup once to get an API key and its first default wallet. Use the endpoints below only when you need additional wallets or want to import one you already control.

Wallet Lifecycle

  1. Create or import a wallet.
  2. Save the private key returned by POST /v1/wallets immediately. It is never returned again. Imported keys are never returned.
  3. Make a wallet default when you want calls without wallet to use it.
  4. Delink a wallet only when you no longer want SolanaLaser to manage it. Delinking removes SolanaLaser's encrypted copy of the private key.

Create a Wallet

POST /v1/wallets

Set set_default: true to use this new wallet for subsequent requests that do not include wallet. It is false by default.

Request

const response = await fetch("https://api.solanalaser.xyz/v1/wallets", {
method: "POST",
headers: {
"content-type": "application/json",
"x-api-key": "sl_your_key",
},
body: JSON.stringify({set_default: true}),
});

const wallet = await response.json();

Response: 200

{
"id": 2,
"public_key": "MANAGED_WALLET_PUBLIC_KEY",
"status": "active",
"is_default": true,
"created_at": "2026-07-18T07:00:00",
"private_key_base58": "BASE58_64_BYTE_SECRET_KEY",
"private_key_format": "base58_64_byte_secret_key"
}

Keep private_key_base58 private. It is returned only by this endpoint and is the independent backup for this wallet.

Import a Wallet

POST /v1/wallets/import

Import a base58 64-byte secret key or a 32-byte seed. The server derives the public key, encrypts the key at rest, and never returns the secret.

Request

const response = await fetch("https://api.solanalaser.xyz/v1/wallets/import", {
method: "POST",
headers: {
"content-type": "application/json",
"x-api-key": "sl_your_key",
},
body: JSON.stringify({
private_key_base58: "BASE58_64_BYTE_SECRET_KEY",
set_default: true,
}),
});

const wallet = await response.json();

Response: 200

{
"id": 3,
"public_key": "MANAGED_WALLET_PUBLIC_KEY",
"status": "active",
"is_default": true,
"created_at": "2026-07-18T07:00:00"
}

List Wallets

GET /v1/wallets

This returns public metadata only. Private keys are never included.

Request

const response = await fetch("https://api.solanalaser.xyz/v1/wallets", {
headers: {"x-api-key": "sl_your_key"},
});

const wallets = await response.json();

Response: 200

[
{
"id": 1,
"public_key": "DEFAULT_WALLET_PUBLIC_KEY",
"status": "active",
"is_default": true,
"created_at": "2026-07-18T07:00:00"
},
{
"id": 2,
"public_key": "SECOND_WALLET_PUBLIC_KEY",
"status": "active",
"is_default": false,
"created_at": "2026-07-18T07:05:00"
}
]

Change the Default Wallet

PUT /v1/wallets/{public_key}/default

Use the public key from GET /v1/wallets. The wallet must belong to this API key. Future requests that omit wallet use this wallet.

Request

const publicKey = "SECOND_WALLET_PUBLIC_KEY";
const response = await fetch(
`https://api.solanalaser.xyz/v1/wallets/${publicKey}/default`,
{
method: "PUT",
headers: {"x-api-key": "sl_your_key"},
},
);

const wallet = await response.json();

Response: 200

{
"id": 2,
"public_key": "SECOND_WALLET_PUBLIC_KEY",
"status": "active",
"is_default": true,
"created_at": "2026-07-18T07:05:00"
}

DELETE /v1/wallets/{public_key}

This permanently deletes SolanaLaser's encrypted private-key copy and local execution history for that wallet. It does not change the wallet or its assets on Solana.

Request

const publicKey = "SECOND_WALLET_PUBLIC_KEY";
const response = await fetch(
`https://api.solanalaser.xyz/v1/wallets/${publicKey}`,
{
method: "DELETE",
headers: {"x-api-key": "sl_your_key"},
},
);

const result = await response.json();

Response: 200

{
"ok": true
}

If you delink the default wallet while other managed wallets remain, the oldest remaining wallet becomes the default.