file action.h

Functions

Type Name
uint32_t read_action_data (void * msg, uint32_t len)
Copy current action data to the specified location.
uint32_t action_data_size (void)
Get the length of current action's data field.
void require_recipient (capi_name name)
Add the specified account to set of accounts to be notified.
void require_auth (capi_name name)
Verify specified account exists in the set of provided auths.
bool has_auth (capi_name name)
Verifies that name has auth.
void require_auth2 (capi_name name, capi_name permission)
Verify specified account exists in the set of provided auths.
bool is_account (capi_name name)
Verifies that Name is an existing account.
void send_inline (char * serialized_action, size_t size)
void send_context_free_inline (char * serialized_action, size_t size)
uint64_t publication_time (void)
Get the publication time.
capi_name current_receiver (void)
Get the current receiver of the action.
void set_action_return_value (void * return_value, size_t size)
Set the action return value.

Detailed Description

Copyright

defined in eos/LICENSE

Functions Documentation

function read_action_data

uint32_t read_action_data(
    void * msg,
    uint32_t len
)

Copy current action data to the specified location.

Copy up to length bytes of current action data to the specified location

Parameters:

  • msg - a pointer where up to length bytes of the current action data will be copied
  • len - len of the current action data to be copied, 0 to report required size

Returns:

the number of bytes copied to msg, or number of bytes that can be copied if len==0 passed

Precondition:

msg is a valid pointer to a range of memory at least len bytes long

Post

msg is filled with packed action data

function action_data_size

uint32_t action_data_size(
    void 
)

Get the length of current action's data field.

Get the length of the current action's data field. This method is useful for dynamically sized actions

Returns:

the length of the current action's data field

function require_recipient

void require_recipient(
    capi_name name
)

Add the specified account to set of accounts to be notified.

Add the specified account to set of accounts to be notified

Parameters:

  • name - name of the account to be verified

function require_auth

void require_auth(
    capi_name name
)

Verify specified account exists in the set of provided auths.

Verifies that name exists in the set of provided auths on a action. Throws if not found.

Parameters:

  • name - name of the account to be verified

function has_auth

bool has_auth(
    capi_name name
)

Verifies that name has auth.

Verifies that name has auth.

Parameters:

  • name - name of the account to be verified

function require_auth2

void require_auth2(
    capi_name name,
    capi_name permission
)

Verify specified account exists in the set of provided auths.

Verifies that name exists in the set of provided auths on a action. Throws if not found.

Parameters:

  • name - name of the account to be verified
  • permission - permission level to be verified

function is_account

bool is_account(
    capi_name name
)

Verifies that Name is an existing account.

Verifies that Name is an existing account.

Parameters:

  • name - name of the account to check

function send_inline

void send_inline(
    char * serialized_action,
    size_t size
)

Send an inline action in the context of this action's parent transaction

Parameters:

  • serialized_action - serialized action
  • size - size of serialized action in bytes

Precondition:

serialized_action is a valid pointer to an array at least size bytes long

function send_context_free_inline

void send_context_free_inline(
    char * serialized_action,
    size_t size
)

/function Send an inline context free action in the context of this action's parent transaction

Parameters:

  • serialized_action - serialized action
  • size - size of serialized action in bytes

Precondition:

serialized_action is a valid pointer to an array at least size bytes long

function publication_time

uint64_t publication_time(
    void 
)

Get the publication time.

Returns the time in microseconds from 1970 of the publication_time

Returns:

the time in microseconds from 1970 of the publication_time

function current_receiver

capi_name current_receiver(
    void 
)

Get the current receiver of the action.

Get the current receiver of the action

Returns:

the account which specifies the current receiver of the action

function set_action_return_value

void set_action_return_value(
    void * return_value,
    size_t size
)

Set the action return value.

Set the action return value which will be included in the action_receipt

Parameters:

  • return_value - serialized return value
  • size - size of serialized return value in bytes

Precondition:

return_value is a valid pointer to an array at least size bytes long


The documentation for this class was generated from the following file: libraries/eosiolib/capi/eosio/action.h