Wallet Infrastructure
Wallet Infrastructure
Swaps

Get max swap amount

POST
/v1/swaps/max

Requires scope quotes:read and the passkey public key, because it reports the wallet's balance — it will not answer for a Safe the passkey does not own.

Authorization

ApiKey
headerAuthorizationBearer <sk_test_ or sk_live_ key>

Your sk_live_ / sk_test_ API key

Request Body

application/json
  1. body
chain*string

Only ethereum is routable for USDT/XAUT today.

Value in"ethereum""base""arbitrum""polygon""celo""optimism""plasma"
fromToken*string

Token being sold.

Value in"usdt""xaut"
toToken*string

Token being bought.

Value in"usdt""xaut"
safeAddress*string

The Safe doing the swap.

Match^0x[0-9a-fA-F]{40}$
passkeyPublicKey*

Response Body

200application/json

Largest swappable amount

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
400application/json

Malformed body, or a chain the aggregator cannot route USDT/XAUT on

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
401application/json

The Authorization header is missing, malformed, or the API key is unknown or revoked

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
403application/json

The API key lacks the quotes:read scope

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
409application/json

The passkey does not own this Safe, the wallet is under recovery, or the Safe is not deployed on this chain

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
429application/json

The API key exceeded its request budget for the window

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
502application/json

The swap aggregator or the chain's RPC node could not be reached

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean

Language

curl -X POST 'https://api.pilot.shiga.io/v1/swaps/max' \  -H 'Authorization: Bearer sk_test_...' \  -H 'Content-Type: application/json' \  -d '{  "chain": "ethereum",  "fromToken": "usdt",  "toToken": "usdt",  "safeAddress": "string",  "passkeyPublicKey": {    "x": "string",    "y": "string"  }}'
Example Response
{  "data": {    "chain": "ethereum",    "safeAddress": "string",    "fromToken": "usdt",    "toToken": "xaut",    "balance": "string",    "feeToken": "usdt",    "gas": "string",    "gasEstimated": true,    "maxAmountIn": "string",    "belowMinimum": true  },  "status": 200,  "success": true}