Swap RPC
getSwap
Learn how to use the getSwap JSON-RPC method.
POST
/
#particle_swap_getSwap
Understanding getSwap
getSwap
returns a detailed object containing swap information, a price quote, and a complete transaction object to have the user sign for swap execution. It takes:address
- string.- Swap information object:
fromTokenAddress
- string.toTokenAddress
- string.amount
- string.slippage
- integer.
Query example
JSON
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Body
application/json
Version of the JSON-RPC protocol, should be 2.0.
The request identifier.
API method being called.
Available options:
particle_swap_getSwap
Parameters for executing a swap.
The blockchain chain ID.
Was this page helpful?