Represents an entry function that can be serialized and deserialized. This class encapsulates the details required to invoke a function within a module, including the module name, function name, type arguments, and function arguments.

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

The name of the function (e.g., "transfer").

Type arguments required by the Move function.

Arguments to the Move function.

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

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

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

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

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

Methods

  • Build an EntryFunction payload from raw primitive values.

    Parameters

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

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

    • function_name: string

      The name of the function to be called.

    • type_args: TypeTag[]

      Type arguments that the Move function requires.

    • args: EntryFunctionArgument[]

      Arguments to the Move function.

    Returns EntryFunction

    EntryFunction

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

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

    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.

    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.

Properties

function_name: Identifier
module_name: ModuleId
type_args: TypeTag[]