Function convertCallArgument

  • Converts a entry function argument into CallArgument, if necessary. This function checks the provided argument against the expected parameter type and converts it accordingly.

    Parameters

    • argument: any

      The argument to be converted, which can be of various types. If the argument is already CallArgument returned from TransactionComposer it would be returned immediately.

    • functionName: string

      The name of the function for which the argument is being converted.

    • functionAbi: FunctionABI

      The ABI (Application Binary Interface) of the function, which defines its parameters.

    • position: number

      The index of the argument in the function's parameter list.

    • genericTypeParams: TypeTag[]

      An array of type tags for any generic type parameters.

    Returns CallArgument