Quote
SDK methodCALLmoney.quote
- Quote is read-only and does not execute a transaction.
- Keep quote parameters unchanged before swap execution.
# SDK method (no HTTP endpoint)
# Use JavaScript snippet instead.
Example success response
{
"fromToken": "ETH",
"toToken": "USDC",
"fromAmount": "0.5",
"toAmount": "1234.56",
"rate": "1 ETH = 2469.12 USDC",
"priceImpact": "0.42",
"provider": "paraswap",
"chain": "ethereum",
"network": "mainnet"
}Example failure responses
Failure
{
"code": "UNSUPPORTED_OPERATION",
"message": "Swap/quote requires mainnet. Testnet DEXes have no liquidity."
}Recovery: Set `network: "mainnet"` explicitly.
Failure
{
"code": "UNSUPPORTED_OPERATION",
"message": "No swap provider available for chain \"fast\"."
}Recovery: Use a supported swap chain/provider pair.
Swap
SDK methodCALLmoney.swap
- Swap executes on-chain and returns tx hash + explorer URL.
- UI requires a fresh quote with matching params before execution.
# SDK method (no HTTP endpoint)
# Use JavaScript snippet instead.
Example success response
{
"txHash": "0x...",
"explorerUrl": "https://...",
"fromToken": "ETH",
"toToken": "USDC",
"fromAmount": "0.5",
"toAmount": "1234.56",
"provider": "paraswap",
"chain": "ethereum",
"network": "mainnet"
}Example failure responses
Failure
{
"code": "CHAIN_NOT_CONFIGURED",
"message": "Chain \"ethereum\" is not configured for mainnet."
}Recovery: Run setup first: await money.setup({ chain: "ethereum", network: "mainnet" })
Failure
{
"code": "UNSUPPORTED_OPERATION",
"message": "Swap requires mainnet. Testnet DEXes have no liquidity."
}Recovery: Switch to mainnet and re-run quote before swap.