COOPENOMICS  v1
Кооперативная Экономика
table_wallet_deposits.hpp
См. документацию.
1#pragma once
2
3#include <eosio/asset.hpp>
4#include <eosio/crypto.hpp>
5#include <eosio/eosio.hpp>
6
7#include "../consts.hpp"
8
9namespace WalletTables {
10
11using namespace eosio;
12
17struct [[eosio::table, eosio::contract(WALLET)]] deposit {
18 uint64_t id;
21 checksum256 deposit_hash;
22
23 asset quantity;
24 name status;
25
26 time_point_sec created_at = current_time_point();
27
28 uint64_t primary_key() const { return id; }
29 uint64_t by_username() const { return username.value; }
30 checksum256 by_hash() const { return deposit_hash; }
31 uint64_t by_status() const { return status.value; }
32 uint64_t by_created() const { return created_at.sec_since_epoch(); }
33};
34
35typedef multi_index<
36 "deposits"_n, deposit,
37 indexed_by<"byhash"_n, const_mem_fun<deposit, checksum256, &deposit::by_hash>>,
38 indexed_by<"byusername"_n, const_mem_fun<deposit, uint64_t, &deposit::by_username>>,
39 indexed_by<"bystatus"_n, const_mem_fun<deposit, uint64_t, &deposit::by_status>>,
40 indexed_by<"bycreated"_n, const_mem_fun<deposit, uint64_t, &deposit::by_created>>>
42
43} // namespace WalletTables
contract
Definition: eosio.msig_tests.cpp:977
Definition: table_wallet_deposits.hpp:9
multi_index< "deposits"_n, deposit, indexed_by<"byhash"_n, const_mem_fun< deposit, checksum256, &deposit::by_hash > >, indexed_by<"byusername"_n, const_mem_fun< deposit, uint64_t, &deposit::by_username > >, indexed_by<"bystatus"_n, const_mem_fun< deposit, uint64_t, &deposit::by_status > >, indexed_by<"bycreated"_n, const_mem_fun< deposit, uint64_t, &deposit::by_created > > > deposits_index
Definition: table_wallet_deposits.hpp:41
Definition: eosio.msig.hpp:34
Definition: table_wallet_deposits.hpp:17
name coopname
Definition: table_wallet_deposits.hpp:19
uint64_t primary_key() const
Definition: table_wallet_deposits.hpp:28
name username
Definition: table_wallet_deposits.hpp:20
uint64_t by_created() const
Definition: table_wallet_deposits.hpp:32
uint64_t by_username() const
Definition: table_wallet_deposits.hpp:29
uint64_t id
Definition: table_wallet_deposits.hpp:18
checksum256 deposit_hash
Definition: table_wallet_deposits.hpp:21
checksum256 by_hash() const
Definition: table_wallet_deposits.hpp:30
uint64_t by_status() const
Definition: table_wallet_deposits.hpp:31
asset quantity
Definition: table_wallet_deposits.hpp:23
name status
Definition: table_wallet_deposits.hpp:24