Learn how to use the getSwap JSON-RPC method.
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.fromTokenAddress
- string.toTokenAddress
- string.amount
- string.slippage
- integer.Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Request to execute a token swap.
The body is of type object
.
Successful response with swap transaction details.
The response is of type object
.