curl --request POST \
--url https://mainnet.anyspend.com/orders/quote \
--header 'Content-Type: application/json' \
--data '{
"type": "swap",
"srcChain": 1,
"dstChain": 8453,
"srcTokenAddress": "0x0000000000000000000000000000000000000000",
"dstTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tradeType": "EXACT_INPUT",
"amount": "1000000000000000000",
"onrampVendor": "coinbase"
}'
{
"success": true,
"message": "Get quote successfully",
"data": {
"operation": "swap",
"sender": "0x15846E6A7C839A208765a0B4754C2dd15E879990",
"recipient": "0xaF1ae1B78bc767DaEBB91196Adf982E9d560AAB9",
"currencyIn": {
"currency": {
"chainId": 1,
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"name": "Ether",
"decimals": 18,
"metadata": {
"logoURI": "https://assets.relay.link/icons/1/light.png"
}
},
"amount": "1000000000000000000",
"amountFormatted": "1.0",
"amountUsd": "3229.715818",
"minimumAmount": "1000000000000000000"
},
"currencyOut": {
"currency": {
"chainId": 8453,
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6,
"metadata": {
"logoURI": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
}
},
"amount": "3224805862",
"amountFormatted": "3224.805862",
"amountUsd": "3224.512405",
"minimumAmount": "3192557803"
},
"totalImpact": {
"usd": "-5.203413",
"percent": "-0.16"
},
"swapImpact": {
"usd": "-4.102797",
"percent": "-0.13"
},
"rate": "3224.805862",
"slippageTolerance": {
"origin": {
"usd": "0.000000",
"value": "0",
"percent": "0.00"
},
"destination": {
"usd": "32.245124",
"value": "32248059",
"percent": "1.00"
}
},
"timeEstimate": 24,
"userBalance": "0"
},
"statusCode": 200
}
Retrieves a quote to swap or execute contract
curl --request POST \
--url https://mainnet.anyspend.com/orders/quote \
--header 'Content-Type: application/json' \
--data '{
"type": "swap",
"srcChain": 1,
"dstChain": 8453,
"srcTokenAddress": "0x0000000000000000000000000000000000000000",
"dstTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tradeType": "EXACT_INPUT",
"amount": "1000000000000000000",
"onrampVendor": "coinbase"
}'
{
"success": true,
"message": "Get quote successfully",
"data": {
"operation": "swap",
"sender": "0x15846E6A7C839A208765a0B4754C2dd15E879990",
"recipient": "0xaF1ae1B78bc767DaEBB91196Adf982E9d560AAB9",
"currencyIn": {
"currency": {
"chainId": 1,
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"name": "Ether",
"decimals": 18,
"metadata": {
"logoURI": "https://assets.relay.link/icons/1/light.png"
}
},
"amount": "1000000000000000000",
"amountFormatted": "1.0",
"amountUsd": "3229.715818",
"minimumAmount": "1000000000000000000"
},
"currencyOut": {
"currency": {
"chainId": 8453,
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6,
"metadata": {
"logoURI": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
}
},
"amount": "3224805862",
"amountFormatted": "3224.805862",
"amountUsd": "3224.512405",
"minimumAmount": "3192557803"
},
"totalImpact": {
"usd": "-5.203413",
"percent": "-0.16"
},
"swapImpact": {
"usd": "-4.102797",
"percent": "-0.13"
},
"rate": "3224.805862",
"slippageTolerance": {
"origin": {
"usd": "0.000000",
"value": "0",
"percent": "0.00"
},
"destination": {
"usd": "32.245124",
"value": "32248059",
"percent": "1.00"
}
},
"timeEstimate": 24,
"userBalance": "0"
},
"statusCode": 200
}
Quote for swap order
Quote retrieved successfully
The response is of type object
.