Learn how to use the getQuote JSON-RPC method.
getQuotegetQuote calculates and returns the quote price for the swap (the amount of toTokenAddress tokens you’ll receive) alongside details about the swap. It takes:
address - string.fromTokenAddress - string.toTokenAddress - string.amount - string.Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Request to get a quote for a token swap.
Version of the JSON-RPC protocol, should be 2.0.
"2.0"
The request identifier.
1
API method being called.
particle_swap_getQuote Parameters for the API method call. Parameters for getting a swap quote.
User address.
"0x369aa8a7a7BE683E1a46d9A056806B2B3FD778C8"
The blockchain chain ID.
1
Successful response with swap quote.