Function build

  • Builds transaction instructions based on the provided action type and parameters

    Parameters

    Returns Promise<Instruction[]>

    Promise resolving to an array of Instruction

    Example

    // Bridge tokens example
    const bridgeInstructions = await build(
    { account: myMultichainAccount },
    {
    type: "intent",
    data: {
    amount: BigInt(1000000),
    mcToken: mcUSDC,
    chain: optimism
    }
    }
    );

    Example

    // Default action example
    const defaultInstructions = await build(
    { account: myMultichainAccount },
    {
    type: "default",
    data: {
    instructions: myExistingInstruction
    }
    }
    );