Comment on page
Approval - Build-tx
Returns transaction data for approval of token spending
How this endpoint is to be used :
- This endpoint generates the transaction data needed for a transaction to give Socket contracts approval/allowance to spend a token on behalf of the token holder.
- The response also returns
from addressas needed for a transaction
API-KEY param needs to be passed in the headers while making the
amountparameter in the query needs to be decimal adjusted. For example 1 USDC = 1000000 as USDC supports upto 6 decimal places. Where as 1 UNI = 1000000000000000000 as UNI supports upto 18 decimal places.
NOTE :The token allowance is granted to Socket implementation contracts of bridges and DEXs, but bridging transactions need to be initiated via the Socket Registry contract
TEST QUERY :
Once the transaction data is retrieved on the frontend, a contract call needs to be made using the returned data to give Socket contracts approval to spend user tokens on behalf of user.