Lens Crosschain Swap Guide
Understanding the /swap/approval Endpoint
/swap/approval EndpointAPI Endpoint
Basic Execution
Returns data required to execute a cross-chain swap.
If the input token requires approval, approvalTxns will be included in the response.
Type of trade. Use minOutput, exactInput or exactOutput.
exactInputPossible values: Required amount of output token in smallest unit.
1000000Address of the input token on the origin chain.
0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85Address of the output token on the destination chain.
0x82aF49447D8a07e3bd95BD0d56f35241523fBab1Chain ID of the origin chain.
1Chain ID of the destination chain.
232Address of the depositor initiating the swap.
0xDEPOSITOR_ADDRESSAddress of the account receiving the output token.
0xRECIPIENT_ADDRESS2-byte hex-string that identifies the integrator. E.g., "0xdead".
0xdeadAddress to receive refunds. Defaults to depositor if not provided.
0xDEPOSITOR_ADDRESSSpecifies whether refund should be sent on the origin chain. Defaults to true.
trueSlippage tolerance percentage (e.g., 1 for 1%, 0.5 for 0.5%).
1Swap approval data returned successfully.
Bad request due to invalid input parameter.
Quickstart Code Snippets
Lens Use Cases using /swap/approval Endpoint
/swap/approval Endpoint1. Bridge ETH on Ethereum Mainnet to ETH on Lens Chain
2. Bridge GHO from Ethereum Mainnet to GHO on Lens Chain
3. Swap USDC on Ethereum Mainnet to GHO on Lens Chain
Last updated