Transfer action.

Implements

Constructors

Properties

Constructors

Properties

argsSchema: ZodObject<
    {
        amount: ZodType<Amount, ZodTypeDef, Amount>;
        assetId: ZodString;
        destination: ZodString;
        gasless: ZodDefault<ZodBoolean>;
    },
    "strip",
    ZodTypeAny,
    { amount: Amount; assetId: string; destination: string; gasless: boolean },
    { amount: Amount; assetId: string; destination: string; gasless?: boolean },
> = TransferInput

Schema for validating action arguments

description: string = TRANSFER_PROMPT

A description of what the action does

func: (
    wallet: Wallet,
    args: {
        amount: Amount;
        assetId: string;
        destination: string;
        gasless: boolean;
    },
) => Promise<string> = transfer

The function to execute for this action

Type declaration

    • (
          wallet: Wallet,
          args: {
              amount: Amount;
              assetId: string;
              destination: string;
              gasless: boolean;
          },
      ): Promise<string>
    • Transfers a specified amount of an asset to a destination onchain.

      Parameters

      • wallet: Wallet

        The wallet to transfer the asset from.

      • args: { amount: Amount; assetId: string; destination: string; gasless: boolean }

        The input arguments for the action.

      Returns Promise<string>

      A message containing the transfer details.

name: string = "transfer"

The name of the action