Here you will some of the examples of the API integration
The values and responses provided are solely for illustrative purposes and to aid in the understanding of requests and responses; actual values and responses may vary.
1. ExactIn swap: Get Transaction Data for swap from USDC to APT when fromTokenAmount is entered
POSThttps://api.panora.exchange/swap
constend_point='https://api.panora.exchange/swap'constquery={fromTokenAddress:"0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b",toTokenAddress:"0xa",toWalletAddress:"0x1c3206329806286fd2223647c9f9b130e66baeb6d7224a18c1f642ffe48f3b4c",fromTokenAmount:100,};constheaders={"x-api-key":"Your API key"};constqueryString=newURLSearchParams(query).toString();consturl=`${end_point}?${queryString}`;constresponse=await (awaitfetch(url,{method:'POST',headers:headers})).json();
Below is the response for the above request
This response can be sent to Aptos chain with the required signatures to execute the transaction.
2. ExactOut swap: Get transaction data for swap from USDC to APT when toTokenAmount is entered
POSThttps://api.panora.exchange/swap
Note: toTokenAmount here is amount (without Token Decimals) that the user desires to receive after the swap is executed
Below is the response for the above request
This response can be sent to Aptos chain with the required signatures to execute the transaction.
3. ExactIn swap: Get Quote Data for swap from USDC to APT when fromTokenAmount is entered
GEThttps://api.panora.exchange/swap/quote
Below is the response for the above request
4. ExactOut swap: Get Quote data for swap from USDC to APT when toTokenAmount is entered