跳到主要内容

eosio::action

Module: Contracts API / Action

More...

#include <action.hpp>

Public Functions

Name
action() =default
template <typename T >
action(const permission_level & auth, struct name a, struct name n, T && value)
template <typename T >
action(std::vector< permission_level > auths, struct name a, struct name n, T && value)
voidsend() const
voidsend_context_free() const
template <typename T >
T
data_as()

Public Attributes

Name
nameaccount
namename
std::vector< permission_level >authorization
std::vector< char >data

Detailed Description

struct eosio::action;

This is the packed representation of an action along with meta-data about the authorization levels.

Public Functions Documentation

function action

action() =default

Default Constructor

function action

template <typename T >
inline action(
const permission_level & auth,
struct name a,
struct name n,
T && value
)

Parameters:

  • auth - The permissions that authorizes this action
  • a - The name of the account this action is intended for (action receiver)
  • n - The name of the action
  • value - The action struct that will be serialized via pack into data

Template Parameters:

  • T - Type of action struct, must be serializable by pack(...)

Construct a new action object with the given permission, action receiver, action name, action struct

function action

template <typename T >
inline action(
std::vector< permission_level > auths,
struct name a,
struct name n,
T && value
)

Parameters:

  • auths - The list of permissions that authorize this action
  • a - The name of the account this action is intended for (action receiver)
  • n - The name of the action
  • value - The action struct that will be serialized via pack into data

Template Parameters:

  • T - Type of action struct, must be serializable by pack(...)

Construct a new action object with the given list of permissions, action receiver, action name, action struct

function send

inline void send() const

Send the action as inline action

function send_context_free

inline void send_context_free() const

Precondition: This action should not contain any authorizations

Send the action as inline context free action

function data_as

template <typename T >
inline T data_as()

Template Parameters:

  • T expected type of data

Return: the action data

Retrieve the unpacked data as T

Public Attributes Documentation

variable account

name account;

Name of the account the action is intended for

variable name

name name;

Name of the action

variable authorization

std::vector< permission_level > authorization;

List of permissions that authorize this action

variable data

std::vector< char > data;

Payload data


Updated on 2022-12-05 at 15:38:07 +0000