Function buildTransferFrom

  • Builds an instruction for transferring tokens using transferFrom. This function is used when transferring tokens from an address that has approved the spender.

    Parameters

    Returns Promise<Instruction[]>

    Promise resolving to array of instructions

    Example

    const instructions = await buildTransferFrom(
    { account: myMultichainAccount },
    {
    chainId: 1,
    tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
    amount: 1000000n, // 1 USDC
    gasLimit: 75000n,
    owner: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
    recipient: "0x1234567890123456789012345678901234567890"
    }
    );