Bridge Batch Requests
You can utilize MiniBridge API to make batch bridge requests on multiple wallets. It helps to bridge hundreds of wallets between MiniBridge-supported blockchains within seconds. To move forward, please get familiar with MiniBridge API Docs first. In this tutorial, we will be using Web3.js to manage wallets and interact with the blockchain. Please take it as a reference and feel free to use your desired SDK such as ether.js, alchemy.js, etc.
Prepare the Main Wallet
The first step is to prepare a main wallet which will be used to distribute funds to multiple sub-wallets to make bridge requests.
Distribute ETH
The next step is to write a function to distribute ETH from the main wallet to a bunch of sub-wallets which you would like to do a batch bridge.
Then make the ETH distribution in a loop and document all the sub-wallets info into accounts.txt
for later use.
Make Bridge Request
Now we have a bunch of wallets with ETH inside, it's time to fill the gap in the while loop to make the real bridge request.
Confirm your bridge request source chain and destination chain, namely
from_id
andto_id
Query Mini Bridge config file: https://minibridge-conf.chaineye.tools/conf.json Find the
fee amount
according tofrom_id
andto_id
In the source chain, transfer ETH to the Mini Bridge address
0x00000000000007736e2F9aA5630B8c812E1F3fc9
with the transfer value set toexpected receive amount
+fee amount
+ 8000 +destination chain interalId.
For example, if you want to bridge from Arbitrum to Linea and receive 0.01 ETH on Linea, you should set the transfer value to:0.01*10**18 + 0.00045*10**18 + 8000 + 4
= 10450000000008004
Check Bridge Request Status
This step is optional. Usually, the bridge request is fulfilled within 1 minute. You can check your destination chain balance to confirm the bridge request status. Alternatively, you can also use this API to query the status of your bridge requests per wallet:
https://minibridge-conf.chaineye.tools/0x1e0bee6dba877b97e7320d8d6a5757d5a17e1c44.json
Replace the address with your address from the previous step, and make sure to use a lowercase address.
Last updated