1#define COMPLETEWTHD_SIGNATURE name coopname, checksum256 withdraw_hash
2#define DECLINEWTHD_SIGNATURE name coopname, checksum256 withdraw_hash, std::string reason
30 eosio::time_point_sec created_at = current_time_point();
34 checksum256
by_hash()
const {
return deposit_hash; }
36 uint64_t
by_created()
const {
return created_at.sec_since_epoch(); }
39 typedef eosio::multi_index<
40 "deposits"_n, deposit,
41 eosio::indexed_by<
"byhash"_n, eosio::const_mem_fun<deposit, checksum256, &deposit::by_hash>>,
42 eosio::indexed_by<
"byusername"_n, eosio::const_mem_fun<deposit, uint64_t, &deposit::by_username>>,
43 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<deposit, uint64_t, &deposit::by_status>>,
44 eosio::indexed_by<
"bycreated"_n, eosio::const_mem_fun<deposit, uint64_t, &deposit::by_created>>
64 eosio::time_point_sec created_at = current_time_point();
67 checksum256
by_hash()
const {
return withdraw_hash; }
70 uint64_t
by_created()
const {
return created_at.sec_since_epoch(); }
74 typedef eosio::multi_index<
75 "withdraws"_n, withdraw,
76 eosio::indexed_by<
"byusername"_n, eosio::const_mem_fun<withdraw, uint64_t, &withdraw::by_username>>,
77 eosio::indexed_by<
"byhash"_n, const_mem_fun<withdraw, checksum256, &withdraw::by_hash>>,
78 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<withdraw, uint64_t, &withdraw::by_status>>,
79 eosio::indexed_by<
"bycreated"_n, eosio::const_mem_fun<withdraw, uint64_t, &withdraw::by_created>>
90 check(
amount.is_valid(),
"Неверный актив");
91 check(
amount.amount >= 0,
"Сумма должна быть неотрицательной");
168 static void block_funds(eosio::name
contract, eosio::name coopname, eosio::name username, eosio::asset
amount, eosio::name program_type, std::string memo){
182 static void unblock_funds(eosio::name
contract, eosio::name coopname, eosio::name username, eosio::asset
amount, eosio::name program_type, std::string memo){
224 static std::optional<deposit>
get_deposit(eosio::name coopname,
const checksum256 &hash) {
226 auto secondary_index = primary_index.get_index<
"byhash"_n>();
228 auto itr = secondary_index.find(hash);
229 if (itr == secondary_index.end()) {
243 static std::optional<withdraw>
get_withdraw(eosio::name coopname,
const checksum256 &hash) {
245 auto secondary_index = primary_index.get_index<
"byhash"_n>();
247 auto itr = secondary_index.find(hash);
248 if (itr == secondary_index.end()) {
Definition: shared_wallet.hpp:15
eosio::multi_index< "deposits"_n, deposit, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< deposit, checksum256, &deposit::by_hash > >, eosio::indexed_by<"byusername"_n, eosio::const_mem_fun< deposit, uint64_t, &deposit::by_username > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< deposit, uint64_t, &deposit::by_status > >, eosio::indexed_by<"bycreated"_n, eosio::const_mem_fun< deposit, uint64_t, &deposit::by_created > > > deposits_index
Definition: shared_wallet.hpp:45
static void validate_asset(const eosio::asset &amount)
Definition: shared_wallet.hpp:88
static eosio::name get_valid_wallet_action(const eosio::name &action)
Definition: shared_wallet.hpp:83
eosio::multi_index< "withdraws"_n, withdraw, eosio::indexed_by<"byusername"_n, eosio::const_mem_fun< withdraw, uint64_t, &withdraw::by_username > >, eosio::indexed_by<"byhash"_n, const_mem_fun< withdraw, checksum256, &withdraw::by_hash > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< withdraw, uint64_t, &withdraw::by_status > >, eosio::indexed_by<"bycreated"_n, eosio::const_mem_fun< withdraw, uint64_t, &withdraw::by_created > > > withdraws_index
Definition: shared_wallet.hpp:80
static void add_blocked_funds(eosio::name contract, eosio::name coopname, eosio::name username, eosio::asset amount, eosio::name program_type, std::string memo)
Добавляет заблокированные средства в баланс кошелька пользователя
Definition: shared_wallet.hpp:126
static void unpay_membership_fee(name contract, name coopname, name username, eosio::asset amount, uint64_t program_id, std::string memo)
Отменяет оплату членского взноса с кошелька пользователя
Definition: shared_wallet.hpp:211
static std::optional< withdraw > get_withdraw(eosio::name coopname, const checksum256 &hash)
Получает возврат из кошелька по хэшу.
Definition: shared_wallet.hpp:243
static void unblock_funds(eosio::name contract, eosio::name coopname, eosio::name username, eosio::asset amount, eosio::name program_type, std::string memo)
Разблокирует средства на кошельке пользователя
Definition: shared_wallet.hpp:182
static void sub_available_funds(eosio::name contract, eosio::name coopname, eosio::name username, eosio::asset amount, eosio::name program_type, std::string memo)
Уменьшает доступные средства на кошельке пользователя
Definition: shared_wallet.hpp:112
static void add_available_funds(eosio::name contract, eosio::name coopname, eosio::name username, eosio::asset amount, eosio::name program_type, std::string memo)
Добавляет доступные средства на кошелёк пользователя
Definition: shared_wallet.hpp:97
static std::optional< deposit > get_deposit(eosio::name coopname, const checksum256 &hash)
Definition: shared_wallet.hpp:224
static void block_funds(eosio::name contract, eosio::name coopname, eosio::name username, eosio::asset amount, eosio::name program_type, std::string memo)
Блокирует средства на кошельке пользователя
Definition: shared_wallet.hpp:168
static void pay_membership_fee(name contract, name coopname, name username, eosio::asset amount, uint64_t program_id, std::string memo)
Оплачивает членский взнос с кошелька пользователя
Definition: shared_wallet.hpp:196
static void sub_blocked_funds(eosio::name contract, eosio::name coopname, eosio::name username, eosio::asset amount, eosio::name program_type, std::string memo)
Уменьшает заблокированные средства кошелька пользователя
Definition: shared_wallet.hpp:147
static constexpr eosio::symbol _root_govern_symbol
Definition: consts.hpp:210
static constexpr eosio::name _wallet
Definition: consts.hpp:153
static constexpr eosio::name _soviet
Definition: consts.hpp:156
contract
Definition: eosio.msig_tests.cpp:977
permission_level
Definition: eosio.msig_tests.cpp:896
share_type amount
Definition: eosio.token_tests.cpp:174
void send(name contract, name action_name, name actor, Args &&... args)
Definition: shared_actions.hpp:10
Definition: eosio.msig.hpp:34
program get_program_or_fail(eosio::name coopname, uint64_t program_id)
Definition: programs.hpp:57
uint64_t get_program_id(const eosio::name &type)
Definition: programs.hpp:142
action(permission_level{ _gateway, "active"_n}, _gateway, "adduser"_n, std::make_tuple(coopname, deposit->username, to_spread, to_circulation, eosio::current_time_point(), true)).send()
#define COMPLETEWTHD_SIGNATURE
Definition: shared_wallet.hpp:1
void(COMPLETEWTHD_SIGNATURE) completewthd_interface
Definition: shared_wallet.hpp:4
static const std::set< eosio::name > wallet_callback_actions
Definition: shared_wallet.hpp:7
#define DECLINEWTHD_SIGNATURE
Definition: shared_wallet.hpp:2
void(DECLINEWTHD_SIGNATURE) declinewthd_interface
Definition: shared_wallet.hpp:5
Таблица deposits отслеживает депозиты в контракте WALLET.
Definition: shared_wallet.hpp:21
eosio::name username
Definition: shared_wallet.hpp:24
uint64_t id
Definition: shared_wallet.hpp:22
eosio::name coopname
Definition: shared_wallet.hpp:23
uint64_t by_created() const
Definition: shared_wallet.hpp:36
uint64_t primary_key() const
Definition: shared_wallet.hpp:32
uint64_t by_status() const
Definition: shared_wallet.hpp:35
checksum256 deposit_hash
Хэш входящего платежа
Definition: shared_wallet.hpp:25
eosio::name status
Definition: shared_wallet.hpp:28
eosio::asset quantity
Definition: shared_wallet.hpp:27
checksum256 by_hash() const
Definition: shared_wallet.hpp:34
uint64_t by_username() const
Definition: shared_wallet.hpp:33
Таблица withdraws отслеживает операции вывода средств в контракте WALLET.
Definition: shared_wallet.hpp:52
document2 statement
Definition: shared_wallet.hpp:60
checksum256 withdraw_hash
Definition: shared_wallet.hpp:56
uint64_t by_created() const
Definition: shared_wallet.hpp:70
eosio::name username
Definition: shared_wallet.hpp:54
checksum256 by_hash() const
Индекс по хэшу задачи.
Definition: shared_wallet.hpp:67
document2 authorization
Definition: shared_wallet.hpp:62
uint64_t by_status() const
Definition: shared_wallet.hpp:69
eosio::name coopname
Definition: shared_wallet.hpp:55
eosio::name status
Definition: shared_wallet.hpp:57
document2 approved_statement
Definition: shared_wallet.hpp:61
uint64_t primary_key() const
Definition: shared_wallet.hpp:66
eosio::asset quantity
Definition: shared_wallet.hpp:59
uint64_t by_username() const
Definition: shared_wallet.hpp:68
uint64_t id
Definition: shared_wallet.hpp:53
Definition: drafts.hpp:28
Таблица программ кооператива
Definition: programs.hpp:14
uint64_t id
Уникальный идентификатор программы
Definition: programs.hpp:15