Transfer SPL tokens (USDT/USDC) with optional sponsorship, or transfer SOL (non-sponsored) with fee retention.
POST
Content-Type: application/json
Auth: None
Response: JSON
https://solana.wsbank.cc
mint = "" → SOL transfer • mint != "" → SPL token transfer.
| Field | Type | Required | Description |
|---|---|---|---|
sponsored |
boolean |
Yes |
If true, attempts a sponsored SPL token transfer (USDT/USDC only).
If false, sender pays the network fee.
|
mint |
string |
Yes | SPL token mint (base58 public key). Use "" to send SOL. |
fromAddress |
string |
Yes | Sender wallet address (base58, 32 bytes). |
toAddress |
string |
Yes | Recipient wallet address (base58, 32 bytes). |
fromPrivateKey |
string |
Yes |
Sender private key (base58/base64 64 bytes, or JSON array string with 64 integers
[..]).
|
memo |
string |
No | Optional memo text (empty string allowed). |
amount |
number |
Yes | Transfer amount in UI units (must be > 0). |
INCORRECT_PARAMETERS (HTTP 400). Unknown fields are rejected.
When sponsored=true, only the mints below are accepted:
{
"USDT": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"USDC": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
{
"sponsored": true,
"mint": "MINT_USDT_OR_USDC", // EX.: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNY
"fromAddress": "SENDER_ADDRESS",
"fromPrivateKey": "SENDER_PRIVATE_KEY",
"toAddress": "RECIPIENT_ADDRESS",
"memo": "",
"amount": 10.25
}
mint="" (SOL) and sponsored=true, the request is rejected.
{
"sponsored": false,
"mint": "MINT_USDT_OR_USDC", // EX.: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNY
"fromAddress": "SENDER_ADDRESS",
"fromPrivateKey": "SENDER_PRIVATE_KEY",
"toAddress": "RECIPIENT_ADDRESS",
"memo": "optional memo",
"amount": 0.50
}
{
"sponsored": false,
"mint": "",
"fromAddress": "SENDER_ADDRESS",
"fromPrivateKey": "SENDER_PRIVATE_KEY",
"toAddress": "RECIPIENT_ADDRESS",
"memo": "",
"amount": 0.015
}
sponsored=false.
On success, the endpoint returns the transaction signature and the sent amount.
{
"success": true,
"data": {
"tx": "TRANSACTION_SIGNATURE",
"amount": "SENT_AMOUNT"
}
}
{
"success": false,
"error": {
"code": "INCORRECT_PARAMETERS",
"message": "Incorrect parameters.",
"details": [
{
"field": "fromAddress",
"message": "address must be a valid Solana address (base58 public key)"
}
]
}
}
{
"success": false,
"error": {
"code": "NOT_BALANCE",
"message": "The wallet does not have enough funds to complete this transaction."
}
}
{
"success": false,
"error": {
"code": "NOT_SUPPORTED",
"message": "Sponsored transactions are currently supported only for USDT and USDC."
}
}
{
"success": false,
"error": {
"code": "METHOD_NOT_ALLOWED",
"message": "Only POST requests are allowed."
}
}
application/json.© 2swap.io - All rights reserved