Representation of a EntryFunction that can serialized and deserialized

Constructors

  • Contains the payload to run a function within a module.

    Parameters

    • module_name: ModuleId

      Fully qualified module name in format "account_address::module_name" e.g. "0x1::coin"

    • function_name: Identifier

      The function name. e.g "transfer"

    • type_args: TypeTag[]

      Type arguments that move function requires.

    • args: EntryFunctionArgument[]

      arguments to the move function.

    Returns EntryFunction

    Example

    A coin transfer function has one type argument "CoinType".

    public entry fun transfer<CoinType>(from: &signer, to: address, amount: u64)
    

    Example

    A coin transfer function has three arguments "from", "to" and "amount".

    public entry fun transfer<CoinType>(from: &signer, to: address, amount: u64)
    

Properties

function_name: Identifier
module_name: ModuleId
type_args: TypeTag[]

Methods

  • A helper function to build a EntryFunction payload from raw primitive values

    Parameters

    • module_id: `${string}::${string}`

      Fully qualified module name in format "AccountAddress::module_id" e.g. "0x1::coin"

    • function_name: string

      Function name

    • type_args: TypeTag[]

      Type arguments that move function requires.

    • args: EntryFunctionArgument[]

      Arguments to the move function.

    Returns EntryFunction

    EntryFunction

    Example

    A coin transfer function has one type argument "CoinType".

    public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64,)
    

    Example

    A coin transfer function has three arguments "from", "to" and "amount".

    public(script) fun transfer<CoinType>(from: &signer, to: address, amount: u64,)
    
  • Deserializes an entry function payload with the arguments represented as EntryFunctionBytes instances.

    Parameters

    Returns EntryFunction

    A deserialized EntryFunction payload for a transaction.

    See

    EntryFunctionBytes

    NOTE: When you deserialize an EntryFunction payload with this method, the entry function arguments are populated into the deserialized instance as type-agnostic, raw fixed bytes in the form of the EntryFunctionBytes class.

    In order to correctly deserialize these arguments as their actual type representations, you must know the types of the arguments beforehand and deserialize them yourself individually.

    One way you could achieve this is by using the ABIs for an entry function and deserializing each argument as its given, corresponding type.

Generated using TypeDoc