GET v1/{chainID}/transaction/approve

Generates transaction input parameters to provide access to the user's tokens for the exchange smart contract

Input Parameters

NameRequiredDescription

chainID

+

ID of the blockchain the token is located on (supported networks - /v1/platforms).

tokenAddress

+

Address of the smart contract of the token for which the access request is generated.

amount

-

The amount of user tokens to which access is granted. By default - infinite number.

gasPrice

-

Value of gas price for making a transaction in WEI (nAVAX for Avalanche) (1 GWEI = 1000000000 WEI), default value – the value high from the method /gasprices.

Response Options

NameData TypeDescription

calldata

str

One of the input parameters for processing a transaction providing access to tokens.

estimate_gas

str

The estimated amount of gas that will be used during the transaction.

gas_price

str

Gas price value for a transaction in WEI.

to

str

Address of the smart contract the transaction should be sent to.

Request Example

https://api.yad.finance/v1/1/transaction/approve?tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7&amount=100000000000&gasPrice=100000000000

Response Example

{
  "calldata": "0x095ea7b30000000000000000000000001aaad07998466cd3eb8140827dddb37570be1e63000000000000000000000000000000000000000000000000000000174876e800",
  "gas_price": "100000000000",
  "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "estimate_gas": "48561"
}

Last updated

Change request #88: