Overview
The Inbox Contract integration is required for native tokens and can also be used for ERC20 tokens when:- Permit2 is not an option
- The integration is directly onchain
- You prefer a fully onchain approach
- Getting a quote from the Bungee API
- Creating and submitting a request via the inbox contract
- Monitoring the status via the API
Integration Steps
Step 1: Get a Quote
For native tokens, request a quote using the address0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.
How to enable ERC20 onchain requests
How to enable ERC20 onchain requests
When integrating Bungee Auto, you can specify the Before submitting a user request to BungeeInbox, check if the request needs approval.You can verify this by checking if the field
useInbox parameter to directly create a request onchain and bypass permit2 gasless signatures:useInbox: EnablesautoRoute.txDatafor ERC20 tokens and disablesautoRoute.signTypedData
Example
autoRoute.approvalData contains any data.- If
approvalDatais present and populated, it means approval is required. - If
approvalDatais empty, no approval is needed, and you can submit the request directly.
Step 2: Submit the Transaction to the Inbox Contract
For native tokens, submit the transaction directly to the inbox contract using the transaction data from the quote.Step 3: Check Request Status
After submitting the request, check its status to track progress. You can implement a polling mechanism to continuously check until completion:Complete Integration Example
Complete Integration Using Viem for native token requests
Complete Integration Using Viem for native token requests