POST /wallets/transfer
Transfer SOL or an SPL token from a user-owned wallet.
Sync — waits for tx confirmation and returns the signature. Creates the destination ATA on SPL transfers if missing (sender pays rent).
Use case
Consolidating balances between user wallets, funding sniper wallets before a launch, or withdrawing to an external address.
Body
| Field | Type | Required | Description |
|---|---|---|---|
fromWallet | string | yes | Source pubkey; must be user-owned. |
toWallet | string | yes | Destination pubkey. Cannot equal fromWallet. |
tokenAddress | string | no | Token mint. Omit for native SOL. |
amount | number | conditional | Required unless sendAllFunds: true. UI units (1.5 = 1.5 SOL / tokens). |
sendAllFunds | boolean | no | Send full balance minus fee reserve; ignores amount. |
Headers
| Header | Required | Description |
|---|---|---|
Idempotency-Key | no | 8–128 chars of [A-Za-z0-9_-]. A retry with the same key within 24 hours returns the first response (with Idempotent-Replayed: true) instead of sending a second transfer. Keys are scoped to the client and end user. 409 while the first request is still running; 503 if idempotency is unavailable. |
For SPL transfers the destination ATA is created by the sender if missing (sender pays the ATA rent).
Response 200
{ "message": "Transfer successful", "signature": "3k…" }
Errors
| Status | Meaning |
|---|---|
400 | Invalid addresses, amount out of range, insufficient balance, or self-transfer. |
403 | Source wallet was imported through /wallets/import and is reserved for Smart Sell. |
404 | Source wallet not found / not owned. |
Examples
SOL:
curl -X POST "$BASE_URL/wallets/transfer" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Content-Type: application/json" \
-d '{ "fromWallet": "…", "toWallet": "…", "amount": 0.1 }'
SPL, send everything:
curl -X POST "$BASE_URL/wallets/transfer" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Content-Type: application/json" \
-d '{ "fromWallet": "…", "toWallet": "…", "tokenAddress": "<mint>", "sendAllFunds": true }'