Function buildBridgeInstructions

Makes sure that the user has enough funds on the selected chain before filling the supertransaction. Bridges funds from other chains if needed.

Error if insufficient balance is available for bridging

Error if chain configuration is missing for any deployment

const bridgeInstructions = await buildBridgeInstructions({
account: myMultichainAccount,
amount: BigInt("1000000"), // 1 USDC
toChain: optimism,
unifiedBalance: myTokenBalance,
bridgingPlugins: [acrossPlugin],
feeData: {
txFeeChainId: 1,
txFeeAmount: BigInt("100000")
}
});