### Swap API Request Example Source: https://nordstern.finance Example of a GET request to the Nordstern Finance Swap API to get swap quotes. Specify source and destination tokens, and the amount. ```http GET https://api.nordstern.finance/aggregator/8453? src=0x420...0006& dst=0x833...2913& amount=1000000000000000000& ``` -------------------------------- ### Swap API Response Example Source: https://nordstern.finance Example JSON response from the Nordstern Finance Swap API, detailing swap information including amounts, tokens, and transaction data. ```json { "dst": "0x833589fCD6eDb6E08f4c7C32D...", "fromAmount": "1000000000000000000", "src": "0x4200000000000000000000000...", "swaps": ["..."], "toAmount": "4441628141", "tx": { "data": "0x3f0bde256e9ee578184bc88eb...", "from": "0xYourWalletAddress", "to": "0xC87De04e2EC1F4282dFF2933A...", "value": "0" } } ``` -------------------------------- ### Swap API Endpoint Source: https://nordstern.finance This endpoint allows you to get the optimal swap transaction details by specifying the source token, destination token, and amount. It scans millions of liquidity pools across supported chains to find the best rates. ```APIDOC ## GET /aggregator/{chainId} ### Description Retrieves the optimal swap transaction details for a given chain. ### Method GET ### Endpoint `https://api.nordstern.finance/aggregator/{chainId}` ### Parameters #### Query Parameters - **src** (string) - Required - The contract address of the source token. - **dst** (string) - Required - The contract address of the destination token. - **amount** (string) - Required - The amount of the source token to swap, in wei. ### Request Example ``` GET https://api.nordstern.finance/aggregator/8453?src=0x4200000000000000000000000000000000000006&dst=0x833589fCD6eDb6E08f4c7C32D4f71b0706295690&amount=1000000000000000000 ``` ### Response #### Success Response (200) - **dst** (string) - The contract address of the destination token. - **fromAmount** (string) - The input amount of the source token. - **src** (string) - The contract address of the source token. - **swaps** (array) - An array of swap route details. - **toAmount** (string) - The estimated output amount of the destination token. - **tx** (object) - Transaction details for executing the swap. - **data** (string) - The transaction data. - **from** (string) - The sender's wallet address. - **to** (string) - The recipient contract address for the swap. - **value** (string) - The value to be sent with the transaction (usually '0'). #### Response Example ```json { "dst": "0x833589fCD6eDb6E08f4c7C32D4f71b0706295690", "fromAmount": "1000000000000000000", "src": "0x4200000000000000000000000000000000000006", "swaps": ["..."], "toAmount": "4441628141", "tx": { "data": "0x3f0bde256e9ee578184bc88eb...", "from": "0xYourWalletAddress", "to": "0xC87De04e2EC1F4282dFF2933A...", "value": "0" } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.