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.

    Parameters

    Returns Promise<BridgingInstructions>

    Promise resolving to BridgingInstructions containing all necessary operations

    Throws

    Error if insufficient balance is available for bridging

    Throws

    Error if chain configuration is missing for any deployment

    Example

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