Function convertArgument

  • Converts a non-BCS encoded argument into BCS encoded, if necessary. This function checks the provided argument against the expected parameter type and converts it accordingly.

    Parameters

    • functionName: string

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

    • functionAbiOrModuleAbi: FunctionABI | MoveModule

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

    • arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes

      The argument to be converted, which can be of various types.

    • 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.

    • Optionaloptions: {
          allowUnknownStructs?: boolean;
      }

      Options for the conversion process.

      • OptionalallowUnknownStructs?: boolean

        If true, unknown structs will be allowed and converted to a FixedBytes.

    Returns EntryFunctionArgumentTypes