• Sends ABI method call. The two type arguments in combination with the name argument are used to form the the method signature to ensure typesafety.

    Example

    Calling a method and getting the return value

    // call createNFT(string,string)uint64
    const createdAsset = sendMethodCall<[string, string], Asset>({
    applicationID: factoryApp,
    name: 'createNFT',
    methodArgs: ['My NFT', 'MNFT'],
    });

    Returns

    The return value of the method call

    Type Parameters

    • ArgsType

      A tuple type corresponding to the types of the method arguments

    • ReturnType

      The return type of the method

    Parameters

    • params: {
          accounts?: Address[];
          applicationArgs?: bytes[];
          applicationID?: Application;
          applications?: Application[];
          approvalProgram?: NewableFunction | bytes;
          assets?: Asset[];
          clearStateProgram?: bytes;
          extraProgramPages?: uint64;
          fee?: uint64;
          globalNumByteSlice?: uint64;
          globalNumUint?: uint64;
          localNumByteSlice?: uint64;
          localNumUint?: uint64;
          methodArgs?: ArgsType;
          name: string;
          note?: string;
          onCompletion?: "NoOp" | "OptIn" | "CloseOut" | "ClearState" | "UpdateApplication" | "DeleteApplication" | "CreateApplication";
          rekeyTo?: Address;
          sender?: Address;
      }

      The parameters of the method call

      • Optional accounts?: Address[]
      • Optional applicationArgs?: bytes[]
      • Optional applicationID?: Application
      • Optional applications?: Application[]
      • Optional approvalProgram?: NewableFunction | bytes
      • Optional assets?: Asset[]
      • Optional clearStateProgram?: bytes
      • Optional extraProgramPages?: uint64
      • Optional fee?: uint64
      • Optional globalNumByteSlice?: uint64
      • Optional globalNumUint?: uint64
      • Optional localNumByteSlice?: uint64
      • Optional localNumUint?: uint64
      • Optional methodArgs?: ArgsType

        ABI method arguments

      • name: string

        Name of the ABI method

      • Optional note?: string
      • Optional onCompletion?: "NoOp" | "OptIn" | "CloseOut" | "ClearState" | "UpdateApplication" | "DeleteApplication" | "CreateApplication"
      • Optional rekeyTo?: Address
      • Optional sender?: Address

    Returns ReturnType

Generated using TypeDoc