Wallet Infrastructure
Wallet Infrastructure
Swaps

Prepare swap

POST
/v1/swaps/prepare

Requires scope transactions:create.

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"
amount*string

Amount of fromToken to sell, in token units (for example "100" USDT).

Match^\d+(\.\d{1,6})?$
Lengthlength <= 80
safeAddress*string

The Safe doing the swap.

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

Response Body

200application/json

Unsigned swap userOperation

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
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

Language

curl -X POST 'https://api.pilot.shiga.io/v1/swaps/prepare' \  -H 'Authorization: Bearer sk_test_...' \  -H 'Content-Type: application/json' \  -d '{  "chain": "ethereum",  "fromToken": "usdt",  "toToken": "usdt",  "amount": "string",  "safeAddress": "string",  "passkeyPublicKey": {    "x": "string",    "y": "string"  }}'
Example Response
{  "data": {    "chain": "ethereum",    "safeAddress": "string",    "userOp": {},    "userOpHash": "string",    "fromToken": "usdt",    "toToken": "xaut",    "amountIn": "string",    "amountOut": "string",    "minAmountOut": "string",    "slippageBps": 100,    "feeToken": "usdt"  },  "status": 200,  "success": true}