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. |
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. |
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 }'