namespace eosio

Class List > eosio

Classes

Type Name
struct action
Packed representation of an action.
struct action_wrapper
struct asset
class binary_extension
container to hold a binary payload for an extension
class block_timestamp
struct blockchain_parameters
struct const_mem_fun
class contract
Base class for EOSIO contract.
class datastream
class datastream< size_t >
Specialization of datastream used to help determine the final size of a serialized value. Specialization of datastream used to help determine the final size of a serialized value.
struct extended_asset
class extended_symbol
class fixed_bytes
Fixed size array of bytes sorted lexicographically.
class fixed_key
struct fixed_point128
struct fixed_point32
32 bits representation of Fixed Point class.
struct fixed_point64
struct ignore
Tells the datastream to ignore this type, but allows the abi generator to add the correct type.
struct ignore_wrapper
struct indexed_by
The indexed_by struct is used to instantiate the indices for the Multi-Index table. In EOSIO, up to 16 secondary indices can be specified.
struct inline_dispatcher
struct inline_dispatcher< void(T::*)(Args...), Name >
class iostream
class microseconds
class multi_index
struct name
struct onerror
Contains and sender id and packed transaction.
struct permission_level
Packed representation of a permission level (Authorization)
struct producer_key
Maps producer with its signing key.
struct producer_schedule
struct public_key
EOSIO Public Key.
struct signature
EOSIO Signature.
class singleton
class symbol
class symbol_code
class time_point
class time_point_sec
class transaction
Contains the actions, context_free_actions and extensions type for a transaction.
class transaction_header
Contains details about the transaction.
struct variant_action_wrapper

Typedefs

Type Name
typedef fixed_bytes< 20 > checksum160
typedef fixed_bytes< 32 > checksum256
typedef fixed_bytes< 64 > checksum512
typedef fixed_key< 32 > key256
typedef block_timestamp block_timestamp_type
typedef std::tuple< uint16_t, std::vector< char > > extension
typedef std::vector< extension > extensions_type

Variables

Type Name
static constexpr name same_payer
static iostream cout

Functions

Type Name
T unpack_action_data ()
Interpret the action body as type T.
void require_recipient (name notify_account)
Add the specified account to set of accounts to be notified.
void require_recipient (name notify_account, accounts... remaining_accounts)
Notify an account for this action.
void require_auth (name n)
Verify specified account exists in the set of provided auths.
void require_auth (const permission_level & level)
Require the specified authorization for this action.
bool has_auth (name n)
Verifies that n has auth.
bool is_account (name n)
Verifies that n is an existing account.
void dispatch_inline (name code, name act, std::vector< permission_level > perms, std::tuple< Args... > args)
void assert_sha256 (const char * data, uint32_t length, const eosio::checksum256 & hash)
Tests if the sha256 hash generated from data matches the provided digest.
void assert_sha1 (const char * data, uint32_t length, const eosio::checksum160 & hash)
Tests if the sha1 hash generated from data matches the provided digest.
void assert_sha512 (const char * data, uint32_t length, const eosio::checksum512 & hash)
Tests if the sha512 hash generated from data matches the provided digest.
void assert_ripemd160 (const char * data, uint32_t length, const eosio::checksum160 & hash)
Tests if the ripemd160 hash generated from data matches the provided digest.
eosio::checksum256 sha256 (const char * data, uint32_t length)
Hashes data using SHA256.
eosio::checksum160 sha1 (const char * data, uint32_t length)
Hashes data using SHA1.
eosio::checksum512 sha512 (const char * data, uint32_t length)
Hashes data using SHA512.
eosio::checksum160 ripemd160 (const char * data, uint32_t length)
Hashes data using RIPEMD160.
eosio::public_key recover_key (const eosio::checksum256 & digest, const eosio::signature & sig)
Calculates the public key used for a given signature on a given digest.
void assert_recover_key (const eosio::checksum256 & digest, const eosio::signature & sig, const eosio::public_key & pubkey)
Tests a given public key with the recovered public key from digest and signature.
datastream< Stream > & operator<< (datastream< Stream > & ds, const std::list< T > & l)
Serialize an std::list.
datastream< Stream > & operator>> (datastream< Stream > & ds, std::list< T > & l)
Deserialize an std::list.
datastream< Stream > & operator<< (datastream< Stream > & ds, const std::deque< T > & d)
Serialize an std::queue.
datastream< Stream > & operator>> (datastream< Stream > & ds, std::deque< T > & d)
Deserialize an std::deque.
datastream< Stream > & operator<< (datastream< Stream > & ds, const eosio::binary_extension< T > & be)
Serialize a binary_extension.
datastream< Stream > & operator>> (datastream< Stream > & ds, eosio::binary_extension< T > & be)
Deserialize a binary_extension.
datastream< Stream > & operator<< (datastream< Stream > & ds, const std::variant< Ts... > & var)
Serialize an std::variant.
void deserialize (datastream< Stream > & ds, std::variant< Ts... > & var, int i)
datastream< Stream > & operator>> (datastream< Stream > & ds, std::variant< Ts... > & var)
Deserialize an std::variant.
DataStream & operator<< (DataStream & ds, const std::pair< T1, T2 > & t)
Serialize an std::pair.
DataStream & operator>> (DataStream & ds, std::pair< T1, T2 > & t)
Deserialize an std::pair.
datastream< Stream > & operator<< (datastream< Stream > & ds, const std::optional< T > & opt)
Serialize an optional.
datastream< Stream > & operator>> (datastream< Stream > & ds, std::optional< T > & opt)
Deserialize an optional.
datastream< Stream > & operator<< (datastream< Stream > & ds, const eosio::symbol_code sym_code)
Serialize a symbol_code.
datastream< Stream > & operator>> (datastream< Stream > & ds, eosio::symbol_code & sym_code)
Deserialize a symbol_code.
datastream< Stream > & operator<< (datastream< Stream > & ds, const eosio::symbol sym)
Serialize a symbol.
datastream< Stream > & operator>> (datastream< Stream > & ds, eosio::symbol & sym)
Deserialize a symbol.
datastream< Stream > & operator<< (datastream< Stream > & ds, const ::eosio::ignore_wrapper< T > & val)
Serialize ignored_wrapper's T value.
datastream< Stream > & operator<< (datastream< Stream > & ds, const ::eosio::ignore< T > & val)
Serialize an ignored type.
datastream< Stream > & operator>> (datastream< Stream > & ds, ::eosio::ignore< T >)
Deserialize an ignored type.
datastream< Stream > & operator<< (datastream< Stream > & ds, const capi_public_key & pubkey)
Serialize a public_key.
datastream< Stream > & operator>> (datastream< Stream > & ds, capi_public_key & pubkey)
Deserialize a public_key.
datastream< Stream > & operator<< (datastream< Stream > & ds, const eosio::public_key & pubkey)
Serialize an eosio::public_key.
datastream< Stream > & operator>> (datastream< Stream > & ds, eosio::public_key & pubkey)
Deserialize an eosio::public_key.
datastream< Stream > & operator<< (datastream< Stream > & ds, const eosio::signature & sig)
Serialize an eosio::signature.
datastream< Stream > & operator>> (datastream< Stream > & ds, eosio::signature & sig)
Deserialize an eosio::signature.
datastream< Stream > & operator<< (datastream< Stream > & ds, const key256 & d)
Serialize a key256.
datastream< Stream > & operator>> (datastream< Stream > & ds, key256 & d)
Deserialize a key256.
datastream< Stream > & operator<< (datastream< Stream > & ds, const fixed_bytes< Size > & d)
Serialize a fixed_bytes.
datastream< Stream > & operator>> (datastream< Stream > & ds, fixed_bytes< Size > & d)
Deserialize a fixed_bytes.
datastream< Stream > & operator<< (datastream< Stream > & ds, const bool & d)
Serialize a bool into a stream.
datastream< Stream > & operator>> (datastream< Stream > & ds, bool & d)
Deserialize a bool.
datastream< Stream > & operator<< (datastream< Stream > & ds, const capi_checksum256 & d)
Serialize a checksum256.
datastream< Stream > & operator>> (datastream< Stream > & ds, capi_checksum256 & d)
Deserialize a checksum256.
DataStream & operator<< (DataStream & ds, const std::string & v)
Serialize a string.
DataStream & operator>> (DataStream & ds, std::string & v)
Deserialize a string.
DataStream & operator<< (DataStream & ds, const std::array< T, N > & v)
Serialize a fixed size std::array.
DataStream & operator>> (DataStream & ds, std::array< T, N > & v)
Deserialize a fixed size std::array.
DataStream & operator>> (DataStream & ds, T)
Deserialize a a pointer.
DataStream & operator<< (DataStream & ds, const T(&) v)
Serialize a fixed size C array of non-primitive and non-pointer type.
DataStream & operator>> (DataStream & ds, T(&) v)
Deserialize a fixed size C array of non-primitive and non-pointer type.
DataStream & operator<< (DataStream & ds, const std::vector< char > & v)
Serialize a vector of char.
DataStream & operator<< (DataStream & ds, const std::vector< T > & v)
Serialize a vector.
DataStream & operator>> (DataStream & ds, std::vector< char > & v)
Deserialize a vector of char.
DataStream & operator>> (DataStream & ds, std::vector< T > & v)
Deserialize a vector.
DataStream & operator<< (DataStream & ds, const std::set< T > & s)
Serialize a set.
DataStream & operator>> (DataStream & ds, std::set< T > & s)
Deserialize a set.
DataStream & operator<< (DataStream & ds, const std::map< K, V > & m)
Serialize a map.
DataStream & operator>> (DataStream & ds, std::map< K, V > & m)
Deserialize a map.
DataStream & operator<< (DataStream & ds, const boost::container::flat_set< T > & s)
Serialize a flat_set.
DataStream & operator>> (DataStream & ds, boost::container::flat_set< T > & s)
Deserialize a flat_set.
DataStream & operator<< (DataStream & ds, const boost::container::flat_map< K, V > & m)
Serialize a flat map.
DataStream & operator>> (DataStream & ds, boost::container::flat_map< K, V > & m)
Deserialize a flat map.
DataStream & operator<< (DataStream & ds, const std::tuple< Args... > & t)
Serialize a tuple.
DataStream & operator>> (DataStream & ds, std::tuple< Args... > & t)
Deserialize a tuple.
DataStream & operator<< (DataStream & ds, const T & v)
Serialize a class.
DataStream & operator>> (DataStream & ds, T & v)
Deserialize a class.
T unpack (const char * buffer, size_t len)
Unpack data inside a fixed size buffer as T.
T unpack (const std::vector< char > & bytes)
Unpack data inside a variable size buffer as T.
size_t pack_size (const T & value)
Get the size of the packed data.
std::vector< char > pack (const T & value)
Get packed data.
datastream< Stream > & operator<< (datastream< Stream > & ds, const capi_checksum160 & cs)
Serializea capi_checksum160 type.
datastream< Stream > & operator>> (datastream< Stream > & ds, capi_checksum160 & cs)
Deserialize a capi_checksum160 type.
datastream< Stream > & operator<< (datastream< Stream > & ds, const capi_checksum512 & cs)
Serialize a capi_checksum512 type.
datastream< Stream > & operator>> (datastream< Stream > & ds, capi_checksum512 & cs)
Deserialize a capi_checksum512 type.
bool dispatch (uint64_t code, uint64_t act)
bool dispatch (uint64_t code, uint64_t act)
bool execute_action (name self, name code, void(T::*)(Args...) func)
bool operator== (const fixed_bytes< Size > & c1, const fixed_bytes< Size > & c2)
Compares two fixed_bytes variables c1 and c2.
bool operator!= (const fixed_bytes< Size > & c1, const fixed_bytes< Size > & c2)
Compares two fixed_bytes variables c1 and c2.
bool operator> (const fixed_bytes< Size > & c1, const fixed_bytes< Size > & c2)
Compares two fixed_bytes variables c1 and c2.
bool operator< (const fixed_bytes< Size > & c1, const fixed_bytes< Size > & c2)
Compares two fixed_bytes variables c1 and c2.
bool operator>= (const fixed_bytes< Size > & c1, const fixed_bytes< Size > & c2)
Compares two fixed_bytes variables c1 and c2.
bool operator<= (const fixed_bytes< Size > & c1, const fixed_bytes< Size > & c2)
Compares two fixed_bytes variables c1 and c2.
bool operator== (const fixed_key< Size > & c1, const fixed_key< Size > & c2)
bool operator!= (const fixed_key< Size > & c1, const fixed_key< Size > & c2)
bool operator> (const fixed_key< Size > & c1, const fixed_key< Size > & c2)
bool operator< (const fixed_key< Size > & c1, const fixed_key< Size > & c2)
bool operator>= (const fixed_key< Size > & c1, const fixed_key< Size > & c2)
bool operator<= (const fixed_key< Size > & c1, const fixed_key< Size > & c2)
class deprecated ("Replaced by fixed_bytes")
T assignHelper (T rhs_val, uint8_t q, uint8_t qr)
fixed_point64< Q > fixed_divide (uint32_t lhs, uint32_t rhs)
Wrapper function for dividing two unit64 variable and stores result in fixed_point64.
fixed_point128< Q > fixed_divide (uint64_t lhs, uint64_t rhs)
bool check_transaction_authorization (const transaction & trx, const std::set< permission_level > & provided_permissions, const std::set< public_key > & provided_keys = std::set< public_key >())
bool check_permission_authorization (name account, name permission, const std::set< public_key > & provided_keys, const std::set< permission_level > & provided_permissions = std::set< permission_level >(), uint64_t provided_delay_us = static_cast< uint64_t >(std::numeric_limits< int64_t >::max()))
void print (const char * ptr)
void print (T num)
void print (float num)
void print (double num)
void print (long double num)
void print (const fixed_bytes< Size > & val)
Prints fixed_bytes as a hexidecimal string.
void print (fixed_bytes< Size > & val)
Prints fixed_bytes as a hexidecimal string.
void print (name name)
void print (eosio::symbol_code sym_code)
void print (T && t)
void print_f (const char * s)
void print_f (const char * s, Arg val, Args... rest)
void print (Arg && a, Args &&... args)
iostream & operator<< (iostream & out, const T & v)
void set_blockchain_parameters (const eosio::blockchain_parameters & params)
Set the blockchain parameters Set the blockchain parameters.
void get_blockchain_parameters (eosio::blockchain_parameters & params)
Retrieve the blolckchain parameters Retrieve the blolckchain parameters.
void check (bool pred, const char * msg)
Assert if the predicate fails and use the supplied message.
void check (bool pred, const std::string & msg)
Assert if the predicate fails and use the supplied message.
void check (bool pred, std::string && msg)
Assert if the predicate fails and use the supplied message.
void check (bool pred, const char * msg, size_t n)
Assert if the predicate fails and use a subset of the supplied message.
void check (bool pred, const std::string & msg, size_t n)
Assert if the predicate fails and use a subset of the supplied message.
void check (bool pred, uint64_t code)
Assert if the predicate fails and use the supplied error code.
microseconds seconds (int64_t s)
microseconds milliseconds (int64_t s)
microseconds minutes (int64_t m)
microseconds hours (int64_t h)
microseconds days (int64_t d)
action get_action (uint32_t type, uint32_t index)

Typedefs Documentation

typedef checksum160

using eosio::checksum160 = typedef fixed_bytes<20>;

typedef checksum256

using eosio::checksum256 = typedef fixed_bytes<32>;

typedef checksum512

using eosio::checksum512 = typedef fixed_bytes<64>;

typedef key256

typedef fixed_key<32> eosio::key256;

typedef block_timestamp_type

typedef block_timestamp eosio::block_timestamp_type;

typedef extension

typedef std::tuple<uint16_t, std::vector<char> > eosio::extension;

typedef extensions_type

typedef std::vector<extension> eosio::extensions_type;

Variables Documentation

variable same_payer

constexpr name eosio::same_payer;

variable cout

iostream eosio::cout;

Functions Documentation

function unpack_action_data

template<typename T>
T eosio::unpack_action_data()

Interpret the action body as type T.

Returns:

Unpacked action data casted as T.

Example:

struct dummy_action {
  char a; //1
  unsigned long long b; //8
  int  c; //4

  EOSLIB_SERIALIZE( dummy_action, (a)(b)(c) )
};
dummy_action msg = unpack_action_data<dummy_action>();

function require_recipient (1/2)

void eosio::require_recipient(
    name notify_account
)

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

Add the specified account to set of accounts to be notified

Parameters:

  • notify_account - name of the account to be verified

function require_recipient (2/2)

template<typename... accounts>
void eosio::require_recipient(
    name notify_account,
    accounts... remaining_accounts
)

Notify an account for this action.

All of the listed accounts will be added to the set of accounts to be notified This helper method enables you to add multiple accounts to accounts to be notified list with a single call rather than having to call the similar C API multiple times.

Note:

action.code is also considered as part of the set of notified accounts

Parameters:

  • notify_account account to be notified
  • remaining_accounts accounts to be notified

Example:

require_recipient("Account1"_n, "Account2"_n, "Account3"_n); // throws exception if any of them not in set.

function require_auth (1/2)

void eosio::require_auth(
    name n
)

Verify specified account exists in the set of provided auths.

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

Parameters:

  • name - name of the account to be verified

function require_auth (2/2)

void eosio::require_auth(
    const permission_level & level
)

Require the specified authorization for this action.

Require the specified authorization for this action. If this action doesn't contain the specified auth, it will fail.

Parameters:

  • level - Authorization to be required

function has_auth

bool eosio::has_auth(
    name n
)

Verifies that n has auth.

Verifies that n has auth.

Parameters:

  • n - name of the account to be verified

function is_account

bool eosio::is_account(
    name n
)

Verifies that n is an existing account.

Verifies that n is an existing account.

Parameters:

  • n - name of the account to check

function dispatch_inline

template<typename... Args>
void eosio::dispatch_inline(
    name code,
    name act,
    std::vector< permission_level > perms,
    std::tuple< Args... > args
)

function assert_sha256

void eosio::assert_sha256(
    const char * data,
    uint32_t length,
    const eosio::checksum256 & hash
)

Tests if the sha256 hash generated from data matches the provided digest.

Tests if the SHA256 hash generated from data matches the provided digest. This method is optimized to a NO-OP when in fast evaluation mode.

Parameters:

  • data - Data you want to hash
  • length - Data length
  • hash - digest to compare to

function assert_sha1

void eosio::assert_sha1(
    const char * data,
    uint32_t length,
    const eosio::checksum160 & hash
)

Tests if the sha1 hash generated from data matches the provided digest.

Tests if the SHA1 hash generated from data matches the provided digest. This method is optimized to a NO-OP when in fast evaluation mode.

Parameters:

  • data - Data you want to hash
  • length - Data length
  • hash - digest to compare to

function assert_sha512

void eosio::assert_sha512(
    const char * data,
    uint32_t length,
    const eosio::checksum512 & hash
)

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

Tests if the SHA512 hash generated from data matches the provided digest. This method is optimized to a NO-OP when in fast evaluation mode.

Parameters:

  • data - Data you want to hash
  • length - Data length
  • hash - digest to compare to

function assert_ripemd160

void eosio::assert_ripemd160(
    const char * data,
    uint32_t length,
    const eosio::checksum160 & hash
)

Tests if the ripemd160 hash generated from data matches the provided digest.

Tests if the RIPEMD160 hash generated from data matches the provided digest.

Parameters:

  • data - Data you want to hash
  • length - Data length
  • hash - digest to compare to

function sha256

eosio::checksum256 eosio::sha256(
    const char * data,
    uint32_t length
)

Hashes data using SHA256.

Hashes data using SHA256.

Parameters:

  • data - Data you want to hash
  • length - Data length

Returns:

eosio::checksum256 - Computed digest

function sha1

eosio::checksum160 eosio::sha1(
    const char * data,
    uint32_t length
)

Hashes data using SHA1.

Hashes data using SHA1.

Parameters:

  • data - Data you want to hash
  • length - Data length

Returns:

eosio::checksum160 - Computed digest

function sha512

eosio::checksum512 eosio::sha512(
    const char * data,
    uint32_t length
)

Hashes data using SHA512.

Hashes data using SHA512.

Parameters:

  • data - Data you want to hash
  • length - Data length

Returns:

eosio::checksum512 - Computed digest

function ripemd160

eosio::checksum160 eosio::ripemd160(
    const char * data,
    uint32_t length
)

Hashes data using RIPEMD160.

Hashes data using RIPEMD160.

Parameters:

  • data - Data you want to hash
  • length - Data length

Returns:

eosio::checksum160 - Computed digest

function recover_key

eosio::public_key eosio::recover_key(
    const eosio::checksum256 & digest,
    const eosio::signature & sig
)

Calculates the public key used for a given signature on a given digest.

Calculates the public key used for a given signature on a given digest.

Parameters:

  • digest - Digest of the message that was signed
  • sig - Signature

Returns:

eosio::public_key - Recovered public key

function assert_recover_key

void eosio::assert_recover_key(
    const eosio::checksum256 & digest,
    const eosio::signature & sig,
    const eosio::public_key & pubkey
)

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

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

Parameters:

  • digest - Digest of the message that was signed
  • sig - Signature
  • pubkey - Public key

function operator<< (1/31)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const std::list< T > & l
)

Serialize an std::list.

Serialize an std::list into a stream

Parameters:

  • ds - The stream to write
  • opt - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (1/30)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    std::list< T > & l
)

Deserialize an std::list.

Deserialize an std::list from a stream

Parameters:

  • ds - The stream to read
  • opt - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (2/31)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const std::deque< T > & d
)

Serialize an std::queue.

Serialize an std::deque into a stream

Parameters:

  • ds - The stream to write
  • opt - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (2/30)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    std::deque< T > & d
)

Deserialize an std::deque.

Deserialize an std::deque from a stream

Parameters:

  • ds - The stream to read
  • opt - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (3/31)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const eosio::binary_extension< T > & be
)

Serialize a binary_extension.

Serialize a binary_extension into a stream

Parameters:

  • ds - The stream to write
  • opt - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (3/30)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    eosio::binary_extension< T > & be
)

Deserialize a binary_extension.

Deserialize a binary_extension from a stream

Parameters:

  • ds - The stream to read
  • opt - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (4/31)

template<typename Stream, typename... Ts>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const std::variant< Ts... > & var
)

Serialize an std::variant.

Serialize an std::variant into a stream

Parameters:

  • ds - The stream to write
  • opt - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function deserialize

template<int I, typename Stream, typename... Ts>
void eosio::deserialize(
    datastream< Stream > & ds,
    std::variant< Ts... > & var,
    int i
)

function operator>> (4/30)

template<typename Stream, typename... Ts>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    std::variant< Ts... > & var
)

Deserialize an std::variant.

Deserialize an std::variant from a stream

Parameters:

  • ds - The stream to read
  • opt - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (5/31)

template<typename DataStream, typename T1, typename T2>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::pair< T1, T2 > & t
)

Serialize an std::pair.

Serialize an std::pair

Parameters:

  • ds - The stream to write
  • t - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • Args - Type of the objects contained in the tuple

Returns:

DataStream& - Reference to the datastream

function operator>> (5/30)

template<typename DataStream, typename T1, typename T2>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::pair< T1, T2 > & t
)

Deserialize an std::pair.

Deserialize an std::pair

Parameters:

  • ds - The stream to read
  • t - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • Args - Type of the objects contained in the tuple

Returns:

DataStream& - Reference to the datastream

function operator<< (6/31)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const std::optional< T > & opt
)

Serialize an optional.

Serialize an optional into a stream

Parameters:

  • ds - The stream to write
  • opt - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (6/30)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    std::optional< T > & opt
)

Deserialize an optional.

Deserialize an optional from a stream

Parameters:

  • ds - The stream to read
  • opt - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (7/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const eosio::symbol_code sym_code
)

Serialize a symbol_code.

Serialize a symbol_code into a stream

Parameters:

  • ds - The stream to write
  • sym - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (7/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    eosio::symbol_code & sym_code
)

Deserialize a symbol_code.

Deserialize a symbol_code from a stream

Parameters:

  • ds - The stream to read
  • symbol - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (8/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const eosio::symbol sym
)

Serialize a symbol.

Serialize a symbol into a stream

Parameters:

  • ds - The stream to write
  • sym - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (8/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    eosio::symbol & sym
)

Deserialize a symbol.

Deserialize a symbol from a stream

Parameters:

  • ds - The stream to read
  • symbol - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (9/31)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const ::eosio::ignore_wrapper< T > & val
)

Serialize ignored_wrapper's T value.

Serialize an ignored_wrapper type into a stream

Parameters:

  • ds - The stream to write
  • val - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (10/31)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const ::eosio::ignore< T > & val
)

Serialize an ignored type.

Serialize an ignored type into a stream

Parameters:

  • ds - The stream to write
  • ignore - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (9/30)

template<typename Stream, typename T>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    ::eosio::ignore< T > 
)

Deserialize an ignored type.

Deserialize an ignored type from a stream

Parameters:

  • ds - The stream to read
  • ignored - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (11/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const capi_public_key & pubkey
)

Serialize a public_key.

Serialize a public_key into a stream

Parameters:

  • ds - The stream to write
  • pubkey - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (10/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    capi_public_key & pubkey
)

Deserialize a public_key.

Deserialize a public_key from a stream

Parameters:

  • ds - The stream to read
  • pubkey - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (12/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const eosio::public_key & pubkey
)

Serialize an eosio::public_key.

Serialize an eosio::public_key into a stream

Parameters:

  • ds - The stream to write
  • pubkey - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (11/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    eosio::public_key & pubkey
)

Deserialize an eosio::public_key.

Deserialize an eosio::public_key from a stream

Parameters:

  • ds - The stream to read
  • pubkey - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (13/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const eosio::signature & sig
)

Serialize an eosio::signature.

Serialize an eosio::signature into a stream

Parameters:

  • ds - The stream to write
  • sig - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (12/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    eosio::signature & sig
)

Deserialize an eosio::signature.

Deserialize an eosio::signature from a stream

Parameters:

  • ds - The stream to read
  • sig - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (14/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const key256 & d
)

Serialize a key256.

Serialize a key256 into a stream

Parameters:

  • ds - The stream to write
  • d - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (13/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    key256 & d
)

Deserialize a key256.

Deserialize a key256 from a stream

Parameters:

  • ds - The stream to read
  • d - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (15/31)

template<typename Stream, size_t Size>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const fixed_bytes< Size > & d
)

Serialize a fixed_bytes.

Serialize a fixed_bytes into a stream

Parameters:

  • ds - The stream to write
  • d - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (14/30)

template<typename Stream, size_t Size>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    fixed_bytes< Size > & d
)

Deserialize a fixed_bytes.

Deserialize a fixed_bytes from a stream

Parameters:

  • ds - The stream to read
  • d - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (16/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const bool & d
)

Serialize a bool into a stream.

Serialize a bool into a stream

Parameters:

  • ds - The stream to read
  • d - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (15/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    bool & d
)

Deserialize a bool.

Deserialize a bool from a stream

Parameters:

  • ds - The stream to read
  • d - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (17/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const capi_checksum256 & d
)

Serialize a checksum256.

Serialize a checksum256 into a stream

Parameters:

  • ds - The stream to write
  • d - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (16/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    capi_checksum256 & d
)

Deserialize a checksum256.

Deserialize a checksum256 from a stream

Parameters:

  • ds - The stream to read
  • d - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (18/31)

template<typename DataStream>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::string & v
)

Serialize a string.

Serialize a string into a stream

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream

function operator>> (17/30)

template<typename DataStream>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::string & v
)

Deserialize a string.

Deserialize a string from a stream

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream

function operator<< (19/31)

template<typename DataStream, typename T, std::size_t N>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::array< T, N > & v
)

Serialize a fixed size std::array.

Serialize a fixed size std::array

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the object contained in the array
  • N - Size of the array

Returns:

DataStream& - Reference to the datastream

function operator>> (18/30)

template<typename DataStream, typename T, std::size_t N>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::array< T, N > & v
)

Deserialize a fixed size std::array.

Deserialize a fixed size std::array

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the object contained in the array
  • N - Size of the array

Returns:

DataStream& - Reference to the datastream

function operator>> (19/30)

template<typename DataStream, typename T, std::enable_if_t< _datastream_detail::is_pointer< T >()> *>
DataStream& eosio::operator>>(
    DataStream & ds,
    T 
)

Deserialize a a pointer.

Pointer should not be serialized, so this function will always throws an error

Parameters:

  • ds - The stream to read

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the pointer

Returns:

DataStream& - Reference to the datastream

Post

Throw an exception if it is a pointer

function operator<< (20/31)

template<typename DataStream, typename T, std::size_t N, std::enable_if_t<!_datastream_detail::is_primitive< T >() &&!_datastream_detail::is_pointer< T >()> *>
DataStream & eosio::operator<<(
    DataStream & ds,
    const T(&) v
)

Serialize a fixed size C array of non-primitive and non-pointer type.

Serialize a fixed size C array of primitive type. Serialize a fixed size C array of non-primitive and non-pointer type

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the pointer

Returns:

DataStream& - Reference to the datastream

Serialize a fixed size C array of primitive type

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the pointer

Returns:

DataStream& - Reference to the datastream

function operator>> (20/30)

template<typename DataStream, typename T, std::size_t N, std::enable_if_t<!_datastream_detail::is_primitive< T >() &&!_datastream_detail::is_pointer< T >()> *>
DataStream & eosio::operator>>(
    DataStream & ds,
    T(&) v
)

Deserialize a fixed size C array of non-primitive and non-pointer type.

Deserialize a fixed size C array of primitive type. Deserialize a fixed size C array of non-primitive and non-pointer type

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • T - Type of the object contained in the array
  • N - Size of the array
  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream

Deserialize a fixed size C array of primitive type

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • T - Type of the object contained in the array
  • N - Size of the array
  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream

function operator<< (21/31)

template<typename DataStream>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::vector< char > & v
)

Serialize a vector of char.

Serialize a vector of char

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream

function operator<< (22/31)

template<typename DataStream, typename T>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::vector< T > & v
)

Serialize a vector.

Serialize a vector

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the object contained in the vector

Returns:

DataStream& - Reference to the datastream

function operator>> (21/30)

template<typename DataStream>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::vector< char > & v
)

Deserialize a vector of char.

Deserialize a vector of char

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream

function operator>> (22/30)

template<typename DataStream, typename T>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::vector< T > & v
)

Deserialize a vector.

Deserialize a vector

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the object contained in the vector

Returns:

DataStream& - Reference to the datastream

function operator<< (23/31)

template<typename DataStream, typename T>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::set< T > & s
)

Serialize a set.

Serialize a set

Parameters:

  • ds - The stream to write
  • s - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the object contained in the set

Returns:

DataStream& - Reference to the datastream

function operator>> (23/30)

template<typename DataStream, typename T>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::set< T > & s
)

Deserialize a set.

Deserialize a set

Parameters:

  • ds - The stream to read
  • s - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the object contained in the set

Returns:

DataStream& - Reference to the datastream

function operator<< (24/31)

template<typename DataStream, typename K, typename V>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::map< K, V > & m
)

Serialize a map.

Serialize a map

Parameters:

  • ds - The stream to write
  • m - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • K - Type of the key contained in the map
  • V - Type of the value contained in the map

Returns:

DataStream& - Reference to the datastream

function operator>> (24/30)

template<typename DataStream, typename K, typename V>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::map< K, V > & m
)

Deserialize a map.

Deserialize a map

Parameters:

  • ds - The stream to read
  • m - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • K - Type of the key contained in the map
  • V - Type of the value contained in the map

Returns:

DataStream& - Reference to the datastream

function operator<< (25/31)

template<typename DataStream, typename T>
DataStream& eosio::operator<<(
    DataStream & ds,
    const boost::container::flat_set< T > & s
)

Serialize a flat_set.

Serialize a flat_set

Parameters:

  • ds - The stream to write
  • s - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the value contained in the flat_set

Returns:

DataStream& - Reference to the datastream

function operator>> (25/30)

template<typename DataStream, typename T>
DataStream& eosio::operator>>(
    DataStream & ds,
    boost::container::flat_set< T > & s
)

Deserialize a flat_set.

Deserialize a flat_set

Parameters:

  • ds - The stream to read
  • s - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the value contained in the flat_set

Returns:

DataStream& - Reference to the datastream

function operator<< (26/31)

template<typename DataStream, typename K, typename V>
DataStream& eosio::operator<<(
    DataStream & ds,
    const boost::container::flat_map< K, V > & m
)

Serialize a flat map.

Serialize a flat map

Parameters:

  • ds - The stream to write
  • m - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • K - Type of the key contained in the flat map
  • V - Type of the value contained in the flat map

Returns:

DataStream& - Reference to the datastream

function operator>> (26/30)

template<typename DataStream, typename K, typename V>
DataStream& eosio::operator>>(
    DataStream & ds,
    boost::container::flat_map< K, V > & m
)

Deserialize a flat map.

Deserialize a flat map

Parameters:

  • ds - The stream to read
  • m - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • K - Type of the key contained in the flat map
  • V - Type of the value contained in the flat map

Returns:

DataStream& - Reference to the datastream

function operator<< (27/31)

template<typename DataStream, typename... Args>
DataStream& eosio::operator<<(
    DataStream & ds,
    const std::tuple< Args... > & t
)

Serialize a tuple.

Serialize a tuple

Parameters:

  • ds - The stream to write
  • t - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • Args - Type of the objects contained in the tuple

Returns:

DataStream& - Reference to the datastream

function operator>> (27/30)

template<typename DataStream, typename... Args>
DataStream& eosio::operator>>(
    DataStream & ds,
    std::tuple< Args... > & t
)

Deserialize a tuple.

Deserialize a tuple

Parameters:

  • ds - The stream to read
  • t - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • Args - Type of the objects contained in the tuple

Returns:

DataStream& - Reference to the datastream

function operator<< (28/31)

template<typename DataStream, typename T, std::enable_if_t< std::is_class< T >::value > *>
DataStream & eosio::operator<<(
    DataStream & ds,
    const T & v
)

Serialize a class.

Serialize a primitive type. Serialize a class

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of class

Returns:

DataStream& - Reference to the datastream

Serialize a primitive type

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the primitive type

Returns:

DataStream& - Reference to the datastream

function operator>> (28/30)

template<typename DataStream, typename T, std::enable_if_t< std::is_class< T >::value > *>
DataStream & eosio::operator>>(
    DataStream & ds,
    T & v
)

Deserialize a class.

Deserialize a primitive type. Deserialize a class

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • T - Type of class

Returns:

DataStream& - Reference to the datastream

Deserialize a primitive type

Parameters:

  • ds - The stream to read
  • v - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream
  • T - Type of the primitive type

Returns:

DataStream& - Reference to the datastream

function unpack (1/2)

template<typename T>
T eosio::unpack(
    const char * buffer,
    size_t len
)

Unpack data inside a fixed size buffer as T.

Unpack data inside a fixed size buffer as T

Template parameters:

  • T - Type of the unpacked data

Parameters:

  • buffer - Pointer to the buffer
  • len - Length of the buffer

Returns:

T - The unpacked data

function unpack (2/2)

template<typename T>
T eosio::unpack(
    const std::vector< char > & bytes
)

Unpack data inside a variable size buffer as T.

Unpack data inside a variable size buffer as T

Template parameters:

  • T - Type of the unpacked data

Parameters:

  • bytes - Buffer

Returns:

T - The unpacked data

function pack_size

template<typename T>
size_t eosio::pack_size(
    const T & value
)

Get the size of the packed data.

Get the size of the packed data

Template parameters:

  • T - Type of the data to be packed

Parameters:

  • value - Data to be packed

Returns:

size_t - Size of the packed data

function pack

template<typename T>
std::vector<char> eosio::pack(
    const T & value
)

Get packed data.

Get packed data

Template parameters:

  • T - Type of the data to be packed

Parameters:

  • value - Data to be packed

Returns:

bytes - The packed data

function operator<< (29/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const capi_checksum160 & cs
)

Serializea capi_checksum160 type.

Serialize a capi_checksum160 type

Parameters:

  • ds - The stream to write
  • cs - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (29/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    capi_checksum160 & cs
)

Deserialize a capi_checksum160 type.

Deserialize a capi_checksum160 type

Parameters:

  • ds - The stream to read
  • cs - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator<< (30/31)

template<typename Stream>
datastream<Stream>& eosio::operator<<(
    datastream< Stream > & ds,
    const capi_checksum512 & cs
)

Serialize a capi_checksum512 type.

Serialize a capi_checksum512 type

Parameters:

  • ds - The stream to write
  • cs - The value to serialize

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function operator>> (30/30)

template<typename Stream>
datastream<Stream>& eosio::operator>>(
    datastream< Stream > & ds,
    capi_checksum512 & cs
)

Deserialize a capi_checksum512 type.

Deserialize a capi_checksum512 type

Parameters:

  • ds - The stream to read
  • cs - The destination for deserialized value

Template parameters:

  • Stream - Type of datastream buffer

Returns:

datastream& - Reference to the datastream

function dispatch (1/2)

template<typename Contract, typename FirstAction>
bool eosio::dispatch(
    uint64_t code,
    uint64_t act
)

function dispatch (2/2)

template<typename Contract, typename FirstAction, typename SecondAction, typename... Actions>
bool eosio::dispatch(
    uint64_t code,
    uint64_t act
)

This method will dynamically dispatch an incoming set of actions to

static Contract::on( ActionType )

For this to work the Actions must be derived from eosio::contract

function execute_action

template<typename T, typename... Args>
bool eosio::execute_action(
    name self,
    name code,
    void(T::*)(Args...) func
)

Unpack the received action and execute the correponding action handler

Template parameters:

  • T - The contract class that has the correponding action handler, this contract should be derived from eosio::contract
  • Q - The namespace of the action handler function
  • Args - The arguments that the action handler accepts, i.e. members of the action

Parameters:

  • obj - The contract object that has the correponding action handler
  • func - The action handler

Returns:

true

function operator==

template<size_t Size>
bool eosio::operator==(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 == c2, return true, otherwise false

function operator!=

template<size_t Size>
bool eosio::operator!=(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 != c2, return true, otherwise false

function operator>

template<size_t Size>
bool eosio::operator>(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 > c2, return true, otherwise false

function operator<

template<size_t Size>
bool eosio::operator<(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 < c2, return true, otherwise false

function operator>=

template<size_t Size>
bool eosio::operator>=(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 >= c2, return true, otherwise false

function operator<=

template<size_t Size>
bool eosio::operator<=(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 <= c2, return true, otherwise false

function operator==

template<size_t Size>
bool eosio::operator==(
    const fixed_key< Size > & c1,
    const fixed_key< Size > & c2
)

Lexicographically compares two fixed_key variables c1 and c2

Parameters:

Returns:

if c1 == c2, return true, otherwise false

function operator!=

template<size_t Size>
bool eosio::operator!=(
    const fixed_key< Size > & c1,
    const fixed_key< Size > & c2
)

Lexicographically compares two fixed_key variables c1 and c2

Parameters:

Returns:

if c1 != c2, return true, otherwise false

function operator>

template<size_t Size>
bool eosio::operator>(
    const fixed_key< Size > & c1,
    const fixed_key< Size > & c2
)

Lexicographically compares two fixed_key variables c1 and c2

Parameters:

Returns:

if c1 > c2, return true, otherwise false

function operator<

template<size_t Size>
bool eosio::operator<(
    const fixed_key< Size > & c1,
    const fixed_key< Size > & c2
)

Lexicographically compares two fixed_key variables c1 and c2

Parameters:

Returns:

if c1 < c2, return true, otherwise false

function operator>=

template<size_t Size>
bool eosio::operator>=(
    const fixed_key< Size > & c1,
    const fixed_key< Size > & c2
)

Compares two fixed_key variables c1 and c2 Lexicographically compares two fixed_key variables c1 and c2

Parameters:

Returns:

if c1 >= c2, return true, otherwise false

function operator<=

template<size_t Size>
bool eosio::operator<=(
    const fixed_key< Size > & c1,
    const fixed_key< Size > & c2
)

Compares two fixed_key variables c1 and c2 Lexicographically compares two fixed_key variables c1 and c2

Parameters:

Returns:

if c1 <= c2, return true, otherwise false

function deprecated

template<size_t Size>
class eosio::deprecated(
    "Replaced by fixed_bytes" 
)

Fixed size key sorted lexicographically for Multi Index Table

Template parameters:

Get number of words contained in this fixed_key object. A word is defined to be 16 bytes in size

Get number of padded bytes contained in this fixed_key object. Padded bytes are the remaining bytes inside the fixed_key object after all the words are allocated

constructor to fixed_key object

Constructor to fixed_key object from std::array of num_words() words

Parameters:

  • arr data

Constructor to fixed_key object from std::array of num_words() words

Parameters:

  • arr - Source data

Constructor to fixed_key object from fixed-sized C array of Word types smaller in size than word_t

Constructor to fixed_key object from fixed-sized C array of Word types smaller in size than word_t

Parameters:

  • arr - Source data

Create a new fixed_key object from a sequence of words

Template parameters:

  • FirstWord - The type of the first word in the sequence
  • Rest - The type of the remaining words in the sequence

Parameters:

  • first_word - The first word in the sequence
  • rest - The remaining words in the sequence

Get the contained std::array

Get the underlying data of the contained std::array

Get the underlying data of the contained std::array

Get the size of the contained std::array

Extract the contained data as an array of bytes

Returns:

  • the extracted data as array of bytes

function assignHelper

template<typename T>
T eosio::assignHelper(
    T rhs_val,
    uint8_t q,
    uint8_t qr
)

function fixed_divide (1/2)

template<uint8_t Q>
fixed_point64<Q> eosio::fixed_divide(
    uint32_t lhs,
    uint32_t rhs
)

Wrapper function for dividing two unit64 variable and stores result in fixed_point64.

Wrapper function for dividing two unit32 variable and stores result in fixed_point64 Example:

fixed_point64<33> result = fixed_divide(131313, 2323)

function fixed_divide (2/2)

template<uint8_t Q>
fixed_point128<Q> eosio::fixed_divide(
    uint64_t lhs,
    uint64_t rhs
)

Wrapper function for dividing two unit64 variable and stores result in fixed_point128 Example:

fixed_point128<33> result = fixed_divide(131313, 2323)

function check_transaction_authorization

bool eosio::check_transaction_authorization(
    const transaction & trx,
    const std::set< permission_level > & provided_permissions,
    const std::set< public_key > & provided_keys = std::set< public_key >()
)

Checks if a transaction is authorized by a provided set of keys and permissions

Parameters:

  • trx - the transaction for which to check authorizations
  • provided_permissions - the set of permissions which have authorized the transaction (empty permission name acts as wildcard)
  • provided_keys - the set of public keys which have authorized the transaction

Returns:

whether the transaction was authorized by provided keys and permissions

function check_permission_authorization

bool eosio::check_permission_authorization(
    name account,
    name permission,
    const std::set< public_key > & provided_keys,
    const std::set< permission_level > & provided_permissions = std::set< permission_level >(),
    uint64_t provided_delay_us = static_cast< uint64_t >(std::numeric_limits< int64_t >::max())
)

Checks if a permission is authorized by a provided delay and a provided set of keys and permissions

Parameters:

  • account - the account owner of the permission
  • permission - the permission name to check for authorization
  • provided_keys - the set of public keys which have authorized the transaction
  • provided_permissions - the set of permissions which have authorized the transaction (empty permission name acts as wildcard)
  • provided_delay_us - the provided delay in microseconds (cannot exceed INT64_MAX)

Returns:

whether the permission was authorized by provided delay, keys, and permissions

function print (1/11)

void eosio::print(
    const char * ptr
)

Prints string

Parameters:

  • ptr - a null terminated string

function print (2/11)

template<typename T, std::enable_if_t< std::is_integral< std::decay_t< T >>::value &&std::is_signed< std::decay_t< T >>::value, int >>
void eosio::print(
    T num
)

Prints 8-128 bit signed integer

Parameters:

  • num to be printed

Prints 8-128 bit unsigned integer

Parameters:

  • num to be printed

function print (3/11)

void eosio::print(
    float num
)

Prints single-precision floating point number (i.e. float)

Parameters:

  • num to be printed

function print (4/11)

void eosio::print(
    double num
)

Prints double-precision floating point number (i.e. double)

Parameters:

  • num to be printed

function print (5/11)

void eosio::print(
    long double num
)

Prints quadruple-precision floating point number (i.e. long double)

Parameters:

  • num to be printed

function print (6/11)

template<size_t Size>
void eosio::print(
    const fixed_bytes< Size > & val
)

Prints fixed_bytes as a hexidecimal string.

Prints fixed_bytes as a hexidecimal string

Parameters:

  • val to be printed

function print (7/11)

template<size_t Size>
void eosio::print(
    fixed_bytes< Size > & val
)

Prints fixed_bytes as a hexidecimal string.

Prints fixed_bytes as a hexidecimal string

Parameters:

  • val to be printed

function print (8/11)

void eosio::print(
    name name
)

Prints a 64 bit names as base32 encoded string

Parameters:

  • name 64 bit name to be printed

function print (9/11)

void eosio::print(
    eosio::symbol_code sym_code
)

Prints a symbol_code

Parameters:

  • sym_code symbol code to be printed

function print (10/11)

template<typename T, std::enable_if_t<!std::is_integral< std::decay_t< T >>::value, int >>
void eosio::print(
    T && t
)

Prints class object

Parameters:

  • t to be printed

Precondition:

T must implements print() function

function print_f (1/2)

void eosio::print_f(
    const char * s
)

Prints null terminated string

Parameters:

  • s null terminated string to be printed

function print_f (2/2)

template<typename Arg, typename... Args>
void eosio::print_f(
    const char * s,
    Arg val,
    Args... rest
)

Prints formatted string. It behaves similar to C printf/

Template parameters:

  • Arg - Type of the value used to replace the format specifier
  • Args - Type of the value used to replace the format specifier

Parameters:

  • s - Null terminated string with to be printed (it can contains format specifier)
  • val - The value used to replace the format specifier
  • rest - The values used to replace the format specifier

Example:

print_f("Number of apples: %", 10);

function print (11/11)

template<typename Arg, typename... Args>
void eosio::print(
    Arg && a,
    Args &&... args
)

Print out value / list of values

Template parameters:

  • Arg - Type of the value used to replace the format specifier
  • Args - Type of the value used to replace the format specifier

Parameters:

  • a - The value to be printed
  • args - The other values to be printed

Example:

const char *s = "Hello World!";
uint64_t unsigned_64_bit_int = 1e+18;
uint128_t unsigned_128_bit_int (87654323456);
uint64_t string_as_unsigned_64_bit = "abcde"_n;
print(s , unsigned_64_bit_int, unsigned_128_bit_int, string_as_unsigned_64_bit);
// Ouput: Hello World!100000000000000000087654323456abcde

function operator<< (31/31)

template<typename T>
iostream& eosio::operator<<(
    iostream & out,
    const T & v
)

Overload c++ iostream

Template parameters:

  • Arg - Type of the value used to replace the format specifier
  • Args - Type of the value used to replace the format specifier

Parameters:

  • out - Output strem
  • v - The value to be printed

Returns:

iostream& - Reference to the input output stream

Example:

const char *s = "Hello World!";
uint64_t unsigned_64_bit_int = 1e+18;
uint128_t unsigned_128_bit_int (87654323456);
uint64_t string_as_unsigned_64_bit = "abcde"_n;
std::out << s << " " << unsigned_64_bit_int << " "  << unsigned_128_bit_int << " " << string_as_unsigned_64_bit;
// Output: Hello World! 1000000000000000000 87654323456 abcde

function set_blockchain_parameters

void eosio::set_blockchain_parameters(
    const eosio::blockchain_parameters & params
)

Set the blockchain parameters Set the blockchain parameters.

Parameters:

  • params - New blockchain parameters to set

function get_blockchain_parameters

void eosio::get_blockchain_parameters(
    eosio::blockchain_parameters & params
)

Retrieve the blolckchain parameters Retrieve the blolckchain parameters.

Parameters:

  • params - It will be replaced with the retrieved blockchain params

function check (1/6)

void eosio::check(
    bool pred,
    const char * msg
)

Assert if the predicate fails and use the supplied message.

Example:

eosio::check(a == b, "a does not equal b");

function check (2/6)

void eosio::check(
    bool pred,
    const std::string & msg
)

Assert if the predicate fails and use the supplied message.

Example:

eosio::check(a == b, "a does not equal b");

function check (3/6)

void eosio::check(
    bool pred,
    std::string && msg
)

Assert if the predicate fails and use the supplied message.

Example:

eosio::check(a == b, "a does not equal b");

function check (4/6)

void eosio::check(
    bool pred,
    const char * msg,
    size_t n
)

Assert if the predicate fails and use a subset of the supplied message.

Example:

const char* msg = "a does not equal b b does not equal a";
eosio::check(a == b, "a does not equal b", 18);

function check (5/6)

void eosio::check(
    bool pred,
    const std::string & msg,
    size_t n
)

Assert if the predicate fails and use a subset of the supplied message.

Example:

std::string msg = "a does not equal b b does not equal a";
eosio::check(a == b, msg, 18);

function check (6/6)

void eosio::check(
    bool pred,
    uint64_t code
)

Assert if the predicate fails and use the supplied error code.

Example:

eosio::check(a == b, 13);

function seconds

microseconds eosio::seconds(
    int64_t s
)

function milliseconds

microseconds eosio::milliseconds(
    int64_t s
)

function minutes

microseconds eosio::minutes(
    int64_t m
)

function hours

microseconds eosio::hours(
    int64_t h
)

function days

microseconds eosio::days(
    int64_t d
)

function get_action

action eosio::get_action(
    uint32_t type,
    uint32_t index
)

Retrieve the indicated action from the active transaction.

Parameters:

  • type - 0 for context free action, 1 for action
  • index - the index of the requested action

Returns:

the indicated action


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