Swap RPC
checkApprove
Learn how to use the checkApprove JSON-RPC method.
POST
/
#particle_swap_checkApprove
Contextualizing checkApprove
checkApprove
returns a Boolean based upon whether a given address has approved spending of a specified amount for a particular ERC-20 token. It takes:address
- string.- Token object, containing:
tokenAddress
- string.amount
- string.
Query example
JSON
Authorizations
Authorization
string
headerrequiredBasic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Body
application/json
jsonrpc
string
default: 2.0requiredVersion of the JSON-RPC protocol, should be 2.0.
id
integer
default: 1requiredThe request identifier.
method
enum<string>
requiredAPI method being called.
Available options:
particle_swap_checkApprove
params
array
requiredParameters for checking token approval.
chainId
integer
The blockchain chain ID.
Response
200 - application/json
jsonrpc
string
default: 2.0requiredVersion of the JSON-RPC protocol, should be 2.0.
id
integer
default: 1requiredThe request identifier.
result
object
requiredApproval status and transaction details.
chainId
integer
The blockchain chain ID.
Was this page helpful?