Skip to main content
POST
/
wallet
/
transfer
curl --request POST \ --url https://api.onswitch.xyz/wallet/transfer \ --header 'Content-Type: application/json' \ --header 'x-service-key: <api-key>' \ --data ' { "wallet_id": "699a6555fd4cab59e6175f79", "amount": 10, "asset": "base:usdc", "recipient": "0xe316E8aFA91864f5720af31094f114761356b3E0" } '
{
  "success": true,
  "message": "Transfer initiated successfully",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "data": {
    "reference": "550e8400-e29b-41d4-a716-446655440000",
    "transaction_hash": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
    "explorer_url": "https://blockscan.com/tx/0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
    "type": "transfer",
    "date": "2024-01-01T00:00:00.000Z",
    "status": "processing",
    "sender": "0x04e05B9bCed583e4F25F7942684dCfe8Ab2632E1",
    "receiver": "0xe316E8aFA91864f5720af31094f114761356b3E0",
    "fee": {
      "amount": 0.01,
      "assets": [
        {
          "id": "base:usdc",
          "amount": 0.01
        }
      ]
    },
    "input": {
      "amount": 10,
      "assets": [
        {
          "id": "base:usdc",
          "amount": 10
        }
      ]
    },
    "output": {
      "amount": 10,
      "assets": [
        {
          "id": "arbitrum:usdc",
          "amount": 10
        }
      ]
    }
  }
}

Authorizations

x-service-key
string
header
required

Service key for API authentication

Body

application/json
wallet_id
string
required

Unique identifier for the wallet

Pattern: ^[a-f0-9]{24}$
asset
enum<string>
required
Available options:
base:usdc,
solana:usdc,
solana:usdt,
ethereum:usdc,
ethereum:usdt,
polygon:usdc,
polygon:usdt,
bsc:usdc,
bsc:usdt,
arbitrum:usdc,
optimism:usdc,
gnosis:usdc,
gnosis:usdt,
arbitrum:usdt,
avalanche:usdc,
monad:usdc,
optimism:usdt,
monad:usdt,
plasma:usdt,
avalanche:usdt,
tron:usdt,
linea:usdt,
mantle:usdt,
hyperevm:usdt,
berachain:usdt,
linea:usdc,
berachain:usdc,
sonic:usdc,
base:cngn,
bsc:cngn
recipient
string
required

Recipient wallet address (EVM or Solana depending on asset)

full_balance
boolean
default:false

Withdraws the full balance of the given wallet to the specified recipient.

amount
number

Amount to send to the specified recipient. Required when full_balance is false.

Required range: x > 0

Response

Transfer initiated successfully

success
boolean
required
message
string
required
timestamp
string<date-time>
required
data
object
required