POST
/
check_approval
Check if token approval is required
curl --request POST \
  --url https://trade-api.gateway.uniswap.org/v1/check_approval \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "walletAddress": "<string>",
  "token": "<string>",
  "amount": "<string>",
  "chainId": 1,
  "urgency": "urgent",
  "includeGasInfo": false,
  "tokenOut": "<string>",
  "tokenOutChainId": 1
}'
{
  "requestId": "<string>",
  "approval": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "cancel": {
    "to": "<string>",
    "from": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>",
    "chainId": 1,
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "gasPrice": "<string>"
  },
  "gasFee": "<string>",
  "cancelGasFee": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json
walletAddress
string
required

The wallet address which will be used to send the token.

token
string
required

The token which will be sent, specified by its token address. For a list of supported tokens, see the FAQ.

amount
string
required

The quantity of tokens denominated in the token's base units. (For example, for an ERC20 token one token is 1x10^18 base units. For one USDC token one token is 1x10^6 base units.) This value must be greater than 0.

chainId
enum<number>
required

The unique ID of the blockchain. For a list of supported chains see the FAQ.

Available options:
1,
10,
56,
130,
137,
324,
480,
1868,
8453,
10143,
42161,
42220,
43114,
81457,
7777777,
1301,
84532,
11155111
urgency
enum<string>
default:urgent

The urgency impacts the estimated gas price of the transaction. The higher the urgency, the higher the gas price, and the faster the transaction is likely to be selected from the mempool. The default value is urgent.

Available options:
normal,
fast,
urgent
includeGasInfo
boolean
default:false

If set to true, the response will include the estimated gas fee for the proposed transaction.

tokenOut
string

The token which will be received, specified by its token address. For a list of supported tokens, see the FAQ.

tokenOutChainId
enum<number>

The unique ID of the blockchain. For a list of supported chains see the FAQ.

Available options:
1,
10,
56,
130,
137,
324,
480,
1868,
8453,
10143,
42161,
42220,
43114,
81457,
7777777,
1301,
84532,
11155111

Response

Check approval successful.

requestId
string
required

A unique ID for the request.

approval
object
required
cancel
object
required
gasFee
string

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

cancelGasFee
string

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.