Skip to main content
POST
/
wallet
/
rescue
Rescue token
curl --request POST \
  --url https://api.onswitch.xyz/wallet/rescue \
  --header 'Content-Type: application/json' \
  --header 'x-service-key: <api-key>' \
  --data '
{
  "wallet_id": "699a6555fd4cab59e6175f79",
  "blockchain": "BASE",
  "token_address": "0xe3cf8dbcbdc9b220ddead0bd6342e245daff934d",
  "recipient": "0x2E1C4bD954853fe0dD025dCc74A9f5a67aad95f9"
}
'
{
  "success": true,
  "message": "Token rescue initiated successfully",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "data": {
    "reference": "550e8400-e29b-41d4-a716-446655440000",
    "transaction_hash": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
    "explorer_url": "https://basescan.org/tx/0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb"
  }
}

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}$
blockchain
enum<string>
required

Blockchain where the token is held

Available options:
BASE,
ETHEREUM,
SOLANA,
POLYGON,
BSC,
ARBITRUM,
OPTIMISM,
AVALANCHE,
MONAD,
GNOSIS,
PLASMA
token_address
string
required

Token contract address (EVM 0x... or Solana base58)

recipient
string
required

Recipient wallet address (format must match blockchain)

Response

Token rescue initiated successfully

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