Skip to main content

Wallet Endpoints

Convenience endpoints for wallet applications — query native balances, CW20 token holdings, transaction history, and broadcast signed transactions through the backend.

Get Native Balance

Returns the uxyz balance for an address.
GET /api/wallet/balance?address=xyz1useraddress...
{
  "address": "xyz1useraddress...",
  "balance": "5000000000"
}
The balance is in uxyz. Divide by 1,000,000 for XYZ.

Get Token Holdings

Returns all CW20 token balances for an address by querying each known token contract.
GET /api/wallet/tokens?address=xyz1useraddress...
{
  "address": "xyz1useraddress...",
  "tokens": [
    {
      "address": "xyz1tokencontract...",
      "name": "Example Token",
      "symbol": "EXT",
      "balance": "50000000000",
      "price_uxyz": "52000",
      "graduated": true
    }
  ]
}
FieldDescription
balanceToken balance in micro-units
price_uxyzCurrent token price (uxyz per token, scaled by 10^6)
graduatedWhether the token has moved to AMM trading

Get Transaction History

Returns transactions for an address, ordered by most recent first.
GET /api/wallet/transactions?address=xyz1useraddress...
Query Parameters:
ParameterTypeDefaultDescription
addressstringrequiredXYZ Chain address
limitnumber20Max results (1-100)
pagenumber1Page number

Get Prices

Returns the current XYZ/USD price fetched from pump.fun.
GET /api/wallet/prices
{
  "XYZ": 0.00042
}
The price is cached for 5 minutes. Returns { "XYZ": 0 } if the price feed is unavailable.

Broadcast Transaction

Submit a signed transaction through the backend node. The backend relays it to the chain and returns the result.
POST /api/wallet/broadcast

Request Body

{
  "tx_bytes": "base64-encoded-signed-transaction"
}

Response

{
  "tx_hash": "A1B2C3D4E5F6...",
  "code": 0,
  "raw_log": ""
}
FieldDescription
tx_hashTransaction hash (use to query status later)
code0 = success, non-zero = error
raw_logError details if code is non-zero
The broadcast endpoint includes deduplication — submitting the same signed transaction twice will return the hash from the first submission rather than broadcasting again.

Error Codes

CodeMeaning
0Success
4Unauthorized (wrong signer)
5Insufficient funds
11Out of gas
32Account sequence mismatch (re-query account and retry)