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.
import Web3 from 'web3';
const mainPrivateKey = 'Your Main Wallet Private Key';
const mainAccount = web3.eth.accounts.privateKeyToAccount(mainPrivateKey);
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.
In the source chain, transfer ETH to the Mini Bridge address 0x00000000000007736e2F9aA5630B8c812E1F3fc9 with the transfer value set to expected 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: