Skip to main content

libraries/eosiolib/capi/eosio/action.h

More...

Functions

Name
attribute((eosio_wasm_import) )
Copy current action data to the specified location.

Attributes

Name
uint32_tlen
capi_namepermission
size_tsize

Detailed Description

Copyright: defined in eos/LICENSE

Functions Documentation

function attribute

__attribute__(
(eosio_wasm_import)
)

Copy 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
  • name - name of the account to be verified
  • name - name of the account to be verified
  • name - name of the account to be verified
  • name - name of the account to be verified
  • permission - permission level to be verified
  • name - name of the account to check
  • serialized_action - serialized action
  • size - size of serialized action in bytes
  • serialized_action - serialized action
  • size - size of serialized action in bytes
  • return_value - serialized return value
  • size - size of serialized return value in bytes
  • data - Data you want to hash
  • length - Data length
  • hash - capi_checksum160* hash to compare to
  • data - Data you want to hash
  • length - Data length
  • hash - capi_checksum512* hash to compare to
  • data - Data you want to hash
  • length - Data length
  • hash - capi_checksum160* hash to compare to
  • data - Data you want to hash
  • length - Data length
  • hash - Hash pointer
  • data - Data you want to hash
  • length - Data length
  • hash - Hash pointer
  • data - Data you want to hash
  • length - Data length
  • hash - Hash pointer
  • data - Data you want to hash
  • data_len - Data length
  • hash - Hash pointer
  • digest - Hash used to create a message
  • sig - Signature
  • siglen - Signature length
  • pub - Public key
  • publen - Public key length
  • digest - What the key will be generated from
  • sig - Signature
  • siglen - Signature length
  • pub - Public key
  • publen - Public key length
  • data - data you want to hash
  • data_len - size of data
  • hash - hash result
  • hash_len - size of hash result
  • keccak - whether to use keccak or NIST variant; keccak = 1 and NIST == 0
  • rounds - the number of rounds
  • state - state vector
  • state_len - size of state vector
  • msg - message block vector
  • msg_len - size of message block vector
  • t0_offset - offset counters
  • t0_len - size of t0_offset
  • t1_offset - offset counters
  • t1_len - size of t1_offset
  • final - final block flag
  • result - the result of the compression
  • result_len - size of result
  • op1 - operand 1
  • op1_len - size of operand 1
  • op2 - operand 2
  • op2_len - size of operand 2
  • result - result of the addition operation
  • result_len - size of result
  • g1 - G1 point
  • g1_len - size of G1 point
  • scalar - scalar factor
  • scalar_len - size of scalar
  • result - result of the scalar multiplication operation
  • result_len - size of result
  • pairs - g1 and g2 pairs
  • pairs_len - size of pairs
  • result - result of the addition operation
  • base - base of the exponentiation (BASE)
  • base_len - size of base
  • exp - exponent to raise to that power (EXP)
  • exp_len - size of exp
  • mod - modulus (MOD)
  • mod_len - size of mod
  • result - result of the modular exponentiation
  • result_len - size of result
  • iterator - Iterator to the table row containing the record to update
  • payer - The account that pays for the storage costs (use 0 to continue using current payer)
  • data - New updated record
  • len - Size of data
  • iterator - Iterator to the table row to remove
  • iterator - The iterator to the table row containing the record to retrieve
  • data - Pointer to the buffer which will be filled with the retrieved record
  • len - Size of the buffer
  • iterator - The iterator to the referenced table row
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the next table row
  • iterator - The iterator to the referenced table row
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the previous table row
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • id - The primary key of the table row to look up
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • id - The primary key used to determine the lowerbound
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • id - The primary key used to determine the upperbound
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • scope - The scope where the table resides (implied to be within the code of the current receiver)
  • table - The table name
  • payer - The account that pays for the storage costs
  • id - The primary key to which to associate the secondary key
  • secondary - Pointer to the secondary key
  • iterator - The iterator to the table row containing the secondary key association to update
  • payer - The account that pays for the storage costs (use 0 to continue using current payer)
  • secondary - Pointer to the new secondary key that will replace the existing one of the association
  • iterator - Iterator to the table row to remove
  • iterator - The iterator to the referenced table row
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the next table row
  • iterator - The iterator to the referenced table row
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the previous table row
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to a uint64_t variable which will have its value set to the secondary key of the found table row
  • primary - The primary key of the table row to look up
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to secondary key used to lookup the table row
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the found table row
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to secondary key first used to determine the lowerbound and which is then replaced with the secondary key of the found table row
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the found table row
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to secondary key first used to determine the upperbound and which is then replaced with the secondary key of the found table row
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the found table row
  • scope - The scope where the table resides (implied to be within the code of the current receiver)
  • table - The table name
  • payer - The account that pays for the storage costs
  • id - The primary key to which to associate the secondary key
  • secondary - Pointer to the secondary key
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to a uint128_t variable which will have its value set to the secondary key of the found table row
  • primary - The primary key of the table row to look up
  • scope - The scope where the table resides (implied to be within the code of the current receiver)
  • table - The table name
  • payer - The account that pays for the storage costs
  • id - The primary key to which to associate the secondary key
  • data - Pointer to the secondary key data stored as an array of 2 uint128_t integers
  • data_len - Must be set to 2
  • iterator - The iterator to the table row containing the secondary key association to update
  • payer - The account that pays for the storage costs (use 0 to continue using current payer)
  • data - Pointer to the new secondary key data (which is stored as an array of 2 uint128_t integers) that will replace the existing one of the association
  • data_len - Must be set to 2
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • data - Pointer to the an array of 2 uint128_t integers which will act as the buffer to hold the retrieved secondary key of the found table row
  • data_len - Must be set to 2
  • primary - The primary key of the table row to look up
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • data - Pointer to the secondary key data (which is stored as an array of 2 uint128_t integers) used to lookup the table row
  • data_len - Must be set to 2
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the found table row
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • data - Pointer to the secondary key data (which is stored as an array of 2 uint128_t integers) first used to determine the lowerbound and which is then replaced with the secondary key of the found table row
  • data_len - Must be set to 2
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the found table row
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • data - Pointer to the secondary key data (which is stored as an array of 2 uint128_t integers) first used to determine the upperbound and which is then replaced with the secondary key of the found table row
  • data_len - Must be set to 2
  • primary - Pointer to a uint64_t variable which will have its value set to the primary key of the found table row
  • scope - The scope where the table resides (implied to be within the code of the current receiver)
  • table - The table name
  • payer - The account that pays for the storage costs
  • id - The primary key to which to associate the secondary key
  • secondary - Pointer to the secondary key
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to a double variable which will have its value set to the secondary key of the found table row
  • primary - The primary key of the table row to look up
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to secondary key used to lookup the table row
  • primary - Pointer to a double variable which will have its value set to the primary key of the found table row
  • scope - The scope where the table resides (implied to be within the code of the current receiver)
  • table - The table name
  • payer - The account that pays for the storage costs
  • id - The primary key to which to associate the secondary key
  • secondary - Pointer to the secondary key
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to a long double variable which will have its value set to the secondary key of the found table row
  • primary - The primary key of the table row to look up
  • code - The name of the owner of the table
  • scope - The scope where the table resides
  • table - The table name
  • secondary - Pointer to secondary key used to lookup the table row
  • primary - Pointer to a long double variable which will have its value set to the primary key of the found table row
  • account - the account owner of the permission
  • permission - the name of the permission to check for authorization
  • pubkeys_data - pointer to the start of the serialized vector of provided public keys
  • pubkeys_size - size (in bytes) of serialized vector of provided public keys (can be 0 if no public keys are to be provided)
  • perms_data - pointer to the start of the serialized vector of provided permissions (empty permission name acts as wildcard)
  • perms_size - size (in bytes) of the serialized vector of provided permissions
  • delay_us - the provided delay in microseconds (cannot exceed INT64_MAX)
  • account - the account owner of the permission
  • permission - the name of the permission
  • account - the account
  • cstr - pointer to string
  • len - len of string to be printed
  • value of 64 bit signed integer to be printed
  • value of 64 bit unsigned integer to be printed
  • value is a pointer to the 128 bit signed integer to be printed
  • value is a pointer to the 128 bit unsigned integer to be printed
  • value of float to be printed
  • value of double to be printed
  • value is a pointer to the long double to be printed
  • name - 64 bit name to be printed
  • data to be printed
  • datalen length of the data to be printed
  • account - name of the account whose resource limit to be set
  • ram_bytes - ram limit in absolute bytes
  • net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts)
  • cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts)
  • producer_data - packed data of produce_keys in the appropriate producer schedule order
  • producer_data_size - size of the data buffer
  • producer_data_format - format of the producer data blob
  • producer_data - packed data of representing the producer schedule in the format indicated.
  • producer_data_size - size of the data buffer
  • account - name of the account to be checked
  • account - name of the account whose privileged account to be set
  • is_priv - privileged status
  • data - pointer to blockchain parameters packed as bytes
  • datalen - size of the packed blockchain parameters
  • data - output buffer of the blockchain parameters, only retrieved if sufficent size to hold packed data.
  • datalen - size of the data buffer, 0 to report required size.
  • data - pointer to KV parameters packed as bytes
  • datalen - size of the packed KV parameters
  • feature_digest - digest of the protocol feature to pre-activate
  • data - the buffer containing the packed participants.
  • datalen - size of the packed participants
  • data - the buffer containing the packed participants.
  • datalen - size of the packed participants
  • data - the output buffer containing the packed security group.
  • datalen - size of the data buffer
  • test - 0 to abort, 1 to ignore
  • msg - a pointer to the start of string explaining the reason for failure
  • msg_len - length of the string
  • test - 0 to abort, 1 to ignore
  • code - the error code
  • feature_digest - digest of the protocol feature
  • sender_id - The id of the sender
  • buffer - a buffer to write the current transaction to
  • size - the size of the buffer, 0 to return required size
  • type - 0 for context free action, 1 for action
  • index - the index of the requested action
  • buff - output packed buff of the action
  • size - amount of buff read, pass 0 to have size returned
  • index - the index of the context_free_data entry to retrieve
  • buff - output buff of the context_free_data entry
  • size - amount of context_free_data[index] to retrieve into buff, 0 to report required size

Return:

  • the number of bytes copied to msg, or number of bytes that can be copied if len==0 passed
  • the length of the current action's data field
  • the time in microseconds from 1970 of the publication_time
  • the account which specifies the current receiver of the action
  • int - number of bytes written to pub
  • -1 if there is an error otherwise 0
  • -1 if there is an error otherwise 0
  • -1 if there is an error otherwise 0
  • -1 if there is an error, 1 if false and 0 if true and successful
  • -1 if there is an error otherwise 0
  • size of the data copied into the buffer if len > 0, or size of the retrieved record if len == 0.
  • iterator to the table row following the referenced table row (or the end iterator of the table if the referenced table row is the last one in the table)
  • iterator to the table row preceding the referenced table row assuming one exists (it will return -1 if the referenced table row is the first one in the table)
  • iterator to the table row with a primary key equal to id or the end iterator of the table if the table row could not be found
  • iterator to the found table row or the end iterator of the table if the table row could not be found
  • iterator to the found table row or the end iterator of the table if the table row could not be found
  • end iterator of the table
  • iterator to the newly created table row
  • iterator to the table row following the referenced table row (or the end iterator of the table if the referenced table row is the last one in the table)
  • iterator to the table row preceding the referenced table row assuming one exists (it will return -1 if the referenced table row is the first one in the table)
  • iterator to the table row with a primary key equal to id or the end iterator of the table if the table row could not be found
  • iterator to the first table row with a secondary key equal to *secondary or the end iterator of the table if the table row could not be found
  • iterator to the found table row or the end iterator of the table if the table row could not be found
  • iterator to the found table row or the end iterator of the table if the table row could not be found
  • iterator to the newly created table row
  • iterator to the table row with a primary key equal to id or the end iterator of the table if the table row could not be found
  • iterator to the newly created table row
  • iterator to the table row with a primary key equal to id or the end iterator of the table if the table row could not be found
  • iterator to the first table row with a secondary key equal to the specified secondary key or the end iterator of the table if the table row could not be found
  • iterator to the found table row or the end iterator of the table if the table row could not be found
  • iterator to the found table row or the end iterator of the table if the table row could not be found
  • iterator to the newly created table row
  • iterator to the table row with a primary key equal to id or the end iterator of the table if the table row could not be found
  • iterator to the first table row with a secondary key equal to *secondary or the end iterator of the table if the table row could not be found
  • iterator to the newly created table row
  • iterator to the table row with a primary key equal to id or the end iterator of the table if the table row could not be found
  • iterator to the first table row with a secondary key equal to *secondary or the end iterator of the table if the table row could not be found
  • 1 if the permission is authorized, 0 otherwise
  • the last used time (in microseconds since Unix epoch) of the permission
  • the creation time (in microseconds since Unix epoch) of the account
  • -1 if proposing a new producer schedule was unsuccessful, otherwise returns the version of the new proposed schedule
  • -1 if proposing a new producer schedule was unsuccessful, otherwise returns the version of the new proposed schedule
  • true if the account is privileged
  • false if the account is not privileged
  • size of the blockchain parameters
  • -1 if proposing a new security group was unsuccessful, otherwise returns 0.
  • Returns true if the specified accounts are all in the active security group.
  • Returns the size required in the buffer (if the buffer is too small, nothing is written).
  • time in microseconds from 1970 of the current block
  • current block number
  • true if the specified protocol feature has been activated, false otherwise
  • name of account that sent the current inline action (empty name if not called from inline action)
  • 1 if transaction was canceled, 0 if transaction was not found
  • the size of the transaction written to the buffer, or number of bytes that can be copied if size==0 passed
  • size of the currently executing transaction
  • block number used for TAPOS on the currently executing transaction Example:
int tbn = tapos_block_num();
  • block prefix used for TAPOS on the currently executing transaction Example:
int tbp = tapos_block_prefix();
  • expiration of the currently executing transaction in seconds since Unix epoch Example:
uint32_t tm = expiration();
eosio_print(tm);
  • the size of the action, -1 on failure
  • size copied, or context_free_data[index].size() if 0 passed for size, or -1 if index not valid

Note:

  • This method is optimized to a NO-OP when in fast evaluation mode.
  • This method is optimized to a NO-OP when in fast evaluation mode.
  • Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"
  • Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"

Precondition:

  • msg is a valid pointer to a range of memory at least len bytes long
  • serialized_action is a valid pointer to an array at least size bytes long
  • serialized_action is a valid pointer to an array at least size bytes long
  • return_value is a valid pointer to an array at least size bytes long
  • sha1 hash of data equals provided hash parameter.
  • assert512 hash of data equals provided hash parameter.
  • assert160 hash of data equals provided hash parameter.
  • assert recovery key of pub equals the key generated from the digest parameter
  • data is a valid pointer to a range of memory at least len bytes long
  • *((uint64_t*)data) stores the primary key
  • iterator points to an existing table row in the table
  • iterator points to an existing table row in the table
  • iterator points to an existing table row in the table
  • data is a valid pointer to a range of memory at least len bytes long
  • iterator points to an existing table row in the table
  • iterator points to an existing table row in the table or it is the end iterator of the table
  • iterator points to an existing table row in the table
  • iterator points to an existing table row in the table
  • iterator points to an existing table row in the table
  • iterator points to an existing table row in the table or it is the end iterator of the table
  • iterator points to an existing table row in the table
  • data is a valid pointer to a range of memory at least datalen bytes long that contains packed blockchain params data
  • data is a valid pointer to a range of memory at least datalen bytes long
  • data is a valid pointer to a range of memory at least datalen bytes long that contains packed KV params data
  • data is a valid pointer to a range of memory at least datalen bytes long that contains packed participants data
  • The deferred transaction ID exists.
  • The deferred transaction ID has not yet been published.

Postcondition:

  • msg is filled with packed action data
  • Executes next statement. If was not true, hard return.
  • Executes next statement. If was not true, hard return.
  • Executes next statement. If was not true, hard return.
  • Executes next statement. If was not true, hard return.
  • the record contained in the table row pointed to by iterator is replaced with the new updated record
  • the table row pointed to by iterator is removed and the associated storage costs are refunded to the payer
  • data will be filled with the retrieved record (truncated to the first len bytes if necessary)
  • *primary will be replaced with the primary key of the table row following the referenced table row if it exists, otherwise *primary will be left untouched
  • *primary will be replaced with the primary key of the table row preceding the referenced table row if it exists, otherwise *primary will be left untouched
  • new secondary key association between primary key id and secondary key *secondary is created in the secondary 64-bit integer index table
  • the secondary key of the table row pointed to by iterator is replaced by *secondary
  • the table row pointed to by iterator is removed and the associated storage costs are refunded to the payer
  • *primary will be replaced with the primary key of the table row following the referenced table row if it exists, otherwise *primary will be left untouched
  • *primary will be replaced with the primary key of the table row preceding the referenced table row if it exists, otherwise *primary will be left untouched
  • If and only if the table row is found, *secondary will be replaced with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • If and only if the table row is found, *secondary will be replaced with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • If and only if the table row is found, *secondary will be replaced with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • new secondary key association between primary key id and secondary key *secondary is created in the secondary 128-bit integer index table
  • If and only if the table row is found, *secondary will be replaced with the secondary key of the found table row
  • new secondary key association between primary key id and the specified secondary key is created in the secondary 256-bit index table
  • the secondary key of the table row pointed to by iterator is replaced by the specified secondary key
  • If and only if the table row is found, the buffer pointed to by data will be filled with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • If and only if the table row is found, the buffer pointed to by data will be filled with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • If and only if the table row is found, the buffer pointed to by data will be filled with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • new secondary key association between primary key id and secondary key *secondary is created in the secondary double-precision floating-point index table
  • If and only if the table row is found, *secondary will be replaced with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • new secondary key association between primary key id and secondary key *secondary is created in the secondary quadruple-precision floating-point index table
  • If and only if the table row is found, *secondary will be replaced with the secondary key of the found table row
  • If and only if the table row is found, *primary will be replaced with the primary key of the found table row
  • data is filled with packed blockchain parameters
  • Deferred transaction canceled.

Remark: This function does not allow changing the primary key of a table row. The serialized data that is stored in the table row of a primary table may include a primary key and that primary key value could be changed by the contract calling the db_update_i64 intrinsic; but that does not change the actual primary key of the table row.

Retrieve the signed_transaction.context_free_data[index].

Retrieves the indicated action from the active transaction.

Gets the expiration of the currently executing transaction.

Gets the block prefix used for TAPOS on the currently executing transaction.

Gets the block number used for TAPOS on the currently executing transaction.

Gets the size of the currently executing transaction.

Access a copy of the currently executing transaction.

Cancels a deferred transaction.

Aborts processing of this action and unwinds all pending changes.

Prints hexidecimal data of length datalen.

Prints value as a 64 bit signed integer.

Get an end iterator representing just-past-the-end of the last table row of a secondary quadruple-precision floating-point index table.

Find the table row in a secondary quadruple-precision floating-point index table that matches the upperbound condition for a given secondary key.

Find the table row in a secondary quadruple-precision floating-point index table that matches the lowerbound condition for a given secondary key.

Find a table row in a secondary quadruple-precision floating-point index table by secondary key.

Find a table row in a secondary quadruple-precision floating-point index table by primary key.

Find the table row preceding the referenced table row in a secondary quadruple-precision floating-point index table.

Find the table row following the referenced table row in a secondary quadruple-precision floating-point index table.

Remove a table row from a secondary quadruple-precision floating-point index table.

Update an association for a quadruple-precision floating-point secondary key to a primary key in a secondary quadruple-precision floating-point index table.

Store an association of a quadruple-precision floating-point secondary key to a primary key in a secondary quadruple-precision floating-point index table.

Get an end iterator representing just-past-the-end of the last table row of a secondary double-precision floating-point index table.

Find the table row in a secondary double-precision floating-point index table that matches the upperbound condition for a given secondary key.

Find the table row in a secondary double-precision floating-point index table that matches the lowerbound condition for a given secondary key.

Find a table row in a secondary double-precision floating-point index table by secondary key.

Find a table row in a secondary double-precision floating-point index table by primary key.

Find the table row preceding the referenced table row in a secondary double-precision floating-point index table.

Find the table row following the referenced table row in a secondary double-precision floating-point index table.

Remove a table row from a secondary double-precision floating-point index table.

Update an association for a double-precision floating-point secondary key to a primary key in a secondary double-precision floating-point index table.

Store an association of a double-precision floating-point secondary key to a primary key in a secondary double-precision floating-point index table.

Get an end iterator representing just-past-the-end of the last table row of a secondary 256-bit index table.

Find the table row in a secondary 256-bit index table that matches the upperbound condition for a given secondary key.

Find the table row in a secondary 256-bit index table that matches the lowerbound condition for a given secondary key.

Find a table row in a secondary 256-bit index table by secondary key.

Find the table row preceding the referenced table row in a secondary 256-bit index table.

Find the table row following the referenced table row in a secondary 256-bit index table.

Remove a table row from a secondary 256-bit index table.

Update an association for a 256-bit secondary key to a primary key in a secondary 256-bit index table.

Store an association of a 256-bit secondary key to a primary key in a secondary 256-bit index table.

Get an end iterator representing just-past-the-end of the last table row of a secondary 128-bit integer index table.

Find the table row in a secondary 128-bit integer index table that matches the upperbound condition for a given secondary key.

Find the table row in a secondary 128-bit integer index table that matches the lowerbound condition for a given secondary key.

Find a table row in a secondary 128-bit integer index table by secondary key.

Find a table row in a secondary 128-bit integer index table by primary key.

Find the table row preceding the referenced table row in a secondary 128-bit integer index table.

Find the table row following the referenced table row in a secondary 128-bit integer index table.

Remove a table row from a secondary 128-bit integer index table.

Update an association for a 128-bit integer secondary key to a primary key in a secondary 128-bit integer index table.

Store an association of a 128-bit integer secondary key to a primary key in a secondary 128-bit integer index table.

Get an end iterator representing just-past-the-end of the last table row of a secondary 64-bit integer index table.

Find the table row in a secondary 64-bit integer index table that matches the upperbound condition for a given secondary key.

Find the table row in a secondary 64-bit integer index table that matches the lowerbound condition for a given secondary key.

Find a table row in a secondary 64-bit integer index table by secondary key.

Find a table row in a secondary 64-bit integer index table by primary key.

Find the table row preceding the referenced table row in a secondary 64-bit integer index table.

Find the table row following the referenced table row in a secondary 64-bit integer index table.

Remove a table row from a secondary 64-bit integer index table.

Update an association for a 64-bit integer secondary key to a primary key in a secondary 64-bit integer index table.

Store an association of a 64-bit integer secondary key to a primary key in a secondary 64-bit integer index table.

Get an iterator representing just-past-the-end of the last table row of a primary 64-bit integer index table.

Find the table row in a primary 64-bit integer index table that matches the upperbound condition for a given primary key.

Find the table row in a primary 64-bit integer index table that matches the lowerbound condition for a given primary key.

Find a table row in a primary 64-bit integer index table by primary key.

Find the table row preceding the referenced table row in a primary 64-bit integer index table.

Find the table row following the referenced table row in a primary 64-bit integer index table.

Get a record in a primary 64-bit integer index table.

Remove a record from a primary 64-bit integer index table.

Update a record in a primary 64-bit integer index table.

Set the action return value.

Get the current receiver of the action.

Get the publication time.

Verifies that Name is an existing account.

Verifies that name has auth.

Verify specified account exists in the set of provided auths.

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

Get the length of current action's data field.

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

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

Add the specified account to set of accounts to be notified

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

Verifies that name has auth.

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

Verifies that Name is an existing account.

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

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

Returns the time in microseconds from 1970 of the publication_time Get the current receiver of the action Set the action return value which will be included in the action_receipt Tests if the sha1 hash generated from data matches the provided checksum.

Example:

checksum hash;
char data;
uint32_t length;
assert_sha1( data, length, hash )
//If the sha1 hash generated from data does not equal provided hash, anything below will never fire.
eosio::print("sha1 hash generated from data equals provided hash");

Tests if the sha512 hash generated from data matches the provided checksum.

Example:

checksum hash;
char data;
uint32_t length;
assert_sha512( data, length, hash )
//If the sha512 hash generated from data does not equal provided hash, anything below will never fire.
eosio::print("sha512 hash generated from data equals provided hash");

Tests if the ripemod160 hash generated from data matches the provided checksum.

Example:

checksum hash;
char data;
uint32_t length;
assert_ripemod160( data, length, hash )
//If the ripemod160 hash generated from data does not equal provided hash, anything below will never fire.
eosio::print("ripemod160 hash generated from data equals provided hash");

Hashes data using sha256 and stores result in memory pointed to by hash.

Example:

checksum calc_hash;
sha256( data, length, &calc_hash );
eos_assert( calc_hash == hash, "invalid hash" );

Hashes data using sha1 and stores result in memory pointed to by hash.

Example:

checksum calc_hash;
sha1( data, length, &calc_hash );
eos_assert( calc_hash == hash, "invalid hash" );

Hashes data using sha512 and stores result in memory pointed to by hash.

Example:

checksum calc_hash;
sha512( data, length, &calc_hash );
eos_assert( calc_hash == hash, "invalid hash" );

Hashes data using ripemod160 and stores result in memory pointed to by hash.

Example:

checksum calc_hash;
ripemod160( data, length, &calc_hash );
eos_assert( calc_hash == hash, "invalid hash" );

Calculates the public key used for a given signature and hash used to create a message.

Example:


Tests a given public key with the generated key from digest and the signature.

Example:

checksum digest;
char sig;
size_t siglen;
char pub;
size_t publen;
assert_recover_key( digest, sig, siglen, pub, publen )
// If the given public key does not match with the generated key from digest and the signature, anything below will never fire.
eosio::print("pub key matches the pub key generated from digest");

Hashes data using sha3 and stores result in memory pointed to by hash.

BLAKE2 compression function "F" https://eips.ethereum.org/EIPS/eip-152

Addition operation on the elliptic curve alt_bn128

Scalar multiplication operation on the elliptic curve alt_bn128

Optimal-Ate pairing check elliptic curve alt_bn128

Big integer modular exponentiation returns an output ( BASE^EXP ) % MOD

Example:

int32_t itr = db_find_i64(receiver, receiver, table1, "alice"_n);
eosio_assert(itr >= 0, "Alice cannot be removed since she was already not found in the table");
db_remove_i64(itr);

Example:

char value[50];
auto len = db_get_i64(itr, value, 0);
eosio_assert(len <= 50, "buffer to small to store retrieved record");
db_get_i64(itr, value, len);

Example:

int32_t charlie_itr = db_find_i64(receiver, receiver, table1, "charlie"_n);
// expect nothing after charlie
uint64_t prim = 0
int32_t end_itr = db_next_i64(charlie_itr, &prim);
eosio_assert(end_itr < -1, "Charlie was not the last entry in the table");

Example:

uint64_t prim = 0;
int32_t itr_prev = db_previous_i64(itr, &prim);

Example:

int itr = db_find_i64(receiver, receiver, table1, "charlie"_n);

The table row that matches the lowerbound condition is the first table row in the table with the lowest primary key that is >= the given key The table row that matches the upperbound condition is the first table row in the table with the lowest primary key that is > the given key The table row that matches the lowerbound condition is the first table row in the table with the lowest secondary key that is >= the given key The table row that matches the upperbound condition is the first table row in the table with the lowest secondary key that is > the given key The table row that matches the lowerbound condition is the first table row in the table with the lowest secondary key that is >= the given key (uses lexicographical ordering on the 256-bit keys) The table row that matches the upperbound condition is the first table row in the table with the lowest secondary key that is > the given key (uses lexicographical ordering on the 256-bit keys) Checks if a permission is authorized by a provided delay and a provided set of keys and permissions

Returns the last used time of a permission

Returns the creation time of an account

Prints string up to given length

Example:

prints_l("Hello World!", 5); // Output: Hello

Prints value as a 64 bit signed integer

Example:

printi(-1e+18); // Output: -1000000000000000000

Prints value as a 64 bit unsigned integer

Example:

printui(1e+18); // Output: 1000000000000000000

Prints value as a 128 bit signed integer

Example:

int128_t large_int(-87654323456);
printi128(&large_int); // Output: -87654323456

Prints value as a 128 bit unsigned integer

Example:

uint128_t large_int(87654323456);
printui128(&large_int); // Output: 87654323456

Prints value as single-precision floating point number

Example:

float value = 5.0 / 10.0;
printsf(value); // Output: 0.5

Prints value as double-precision floating point number

Example:

double value = 5.0 / 10.0;
printdf(value); // Output: 0.5

Prints value as quadruple-precision floating point number

Example:

long double value = 5.0 / 10.0;
printqf(value); // Output: 0.5

Prints a 64 bit names as base32 encoded string

Example:

printn("abcde"_n); // Output: abcde

Prints hexidecimal data of length datalen

Example

unsigned char rawData[9] = {0x49 0x20 0x6C 0x6F 0x76 0x65 0x20 0x62 0x6D};
printhex(&rawData, 9);

Set the resource limits of an account

Proposes a schedule change

This is exactly equivalent to calling set_proposed_producers_ex(0, producer_data, producer_data_size)

Proposes a schedule change with extended features

Valid formats: 0 : serialized array of producer_key's. using this format is exactly equivalent to set_proposed_producers(producer_data, producer_data_size) 1 : serialized array of producer_authority's

Check if an account is privileged

Set the privileged status of an account

Set the blockchain parameters

Retrieve the blolckchain parameters

Set the KV parameters

Pre-activate protocol feature

Propose to remove participants from the security group.

Check if the specified accounts are all in the active security group.

Gets the active security group

Aborts processing of this action and unwinds all pending changes if the test condition is true

Aborts processing of this action and unwinds all pending changes if the test condition is true

Returns the time in microseconds from 1970 of the current block

Returns the current block number

Check if specified protocol feature has been activated

Return name of account that sent current inline action

Cancels a deferred transaction.

Example:

id = 0xffffffffffffffff
cancel_deferred( id );

Access a copy of the currently executing transaction.

Gets the size of the currently executing transaction.

Gets the block number used for TAPOS on the currently executing transaction.

Gets the block prefix used for TAPOS on the currently executing transaction.

Gets the expiration of the currently executing transaction.

Retrieves the indicated action from the active transaction.

Retrieve the signed_transaction.context_free_data[index].

Attributes Documentation

variable len

uint32_t len;

variable permission

capi_name permission;

variable size

size_t size;

Source code


#pragma once
#include "types.h"

#ifdef __cplusplus
extern "C" {
#endif

__attribute__((eosio_wasm_import))
uint32_t read_action_data( void* msg, uint32_t len );

__attribute__((eosio_wasm_import))
uint32_t action_data_size( void );

__attribute__((eosio_wasm_import))
void require_recipient( capi_name name );

__attribute__((eosio_wasm_import))
void require_auth( capi_name name );

__attribute__((eosio_wasm_import))
bool has_auth( capi_name name );

__attribute__((eosio_wasm_import))
void require_auth2( capi_name name, capi_name permission );

__attribute__((eosio_wasm_import))
bool is_account( capi_name name );

__attribute__((eosio_wasm_import))
void send_inline(char *serialized_action, size_t size);

__attribute__((eosio_wasm_import))
void send_context_free_inline(char *serialized_action, size_t size);

__attribute__((eosio_wasm_import))
uint64_t publication_time( void );

__attribute__((eosio_wasm_import))
capi_name current_receiver( void );

__attribute__((eosio_wasm_import))
void set_action_return_value(void *return_value, size_t size);

#ifdef __cplusplus
}
#endif

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