1#define CREATEOUTPAY_SIGNATURE name coopname, name username, checksum256 outcome_hash, asset quantity, name callback_contract, name confirm_callback, name decline_callback
59 eosio::time_point_sec created_at = current_time_point();
63 checksum256
by_hash()
const {
return income_hash; }
67 typedef eosio::multi_index<
69 eosio::indexed_by<
"byhash"_n, eosio::const_mem_fun<income, checksum256, &income::by_hash>>,
70 eosio::indexed_by<
"byusername"_n, eosio::const_mem_fun<income, uint64_t, &income::by_username>>,
71 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<income, uint64_t, &income::by_status>>
81 inline std::optional<income>
get_income(eosio::name coopname,
const checksum256 &hash) {
83 auto secondary_index = primary_index.get_index<
"byhash"_n>();
85 auto itr = secondary_index.find(hash);
86 if (itr == secondary_index.end()) {
115 eosio::time_point_sec created_at = current_time_point();
119 checksum256
by_hash()
const {
return outcome_hash; }
123 typedef eosio::multi_index<
124 "outcomes"_n, outcome,
125 eosio::indexed_by<
"byhash"_n, eosio::const_mem_fun<outcome, checksum256, &outcome::by_hash>>,
126 eosio::indexed_by<
"byusername"_n, eosio::const_mem_fun<outcome, uint64_t, &outcome::by_username>>,
127 eosio::indexed_by<
"bystatus"_n, eosio::const_mem_fun<outcome, uint64_t, &outcome::by_status>>
131 inline std::optional<outcome>
get_outcome(eosio::name coopname,
const checksum256 &hash) {
133 auto secondary_index = primary_index.get_index<
"byhash"_n>();
135 auto itr = secondary_index.find(hash);
136 if (itr == secondary_index.end()) {
144 name calling_contract,
147 Action::send<createoutpay_interface>(
static constexpr eosio::name _gateway
Definition: consts.hpp:152
contract
Definition: eosio.msig_tests.cpp:977
static const std::set< eosio::name > gateway_income_actions
Допустимые действия для входящих платежей
Definition: shared_gateway.hpp:13
static const std::set< eosio::name > gateway_outcome_actions
Допустимые действия для исходящих платежей
Definition: shared_gateway.hpp:23
Definition: shared_gateway.hpp:5
void create_outcome(name calling_contract, CREATEOUTPAY_SIGNATURE)
Definition: shared_gateway.hpp:143
eosio::name get_valid_outcome_action(const eosio::name &action)
Definition: shared_gateway.hpp:33
std::optional< outcome > get_outcome(eosio::name coopname, const checksum256 &hash)
Definition: shared_gateway.hpp:131
eosio::name get_valid_income_action(const eosio::name &action)
Definition: shared_gateway.hpp:28
std::optional< income > get_income(eosio::name coopname, const checksum256 &hash)
Получает возврат из кошелька по хэшу.
Definition: shared_gateway.hpp:81
eosio::multi_index< "outcomes"_n, outcome, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< outcome, checksum256, &outcome::by_hash > >, eosio::indexed_by<"byusername"_n, eosio::const_mem_fun< outcome, uint64_t, &outcome::by_username > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< outcome, uint64_t, &outcome::by_status > > > outcomes_index
Definition: shared_gateway.hpp:128
eosio::multi_index< "incomes"_n, income, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< income, checksum256, &income::by_hash > >, eosio::indexed_by<"byusername"_n, eosio::const_mem_fun< income, uint64_t, &income::by_username > >, eosio::indexed_by<"bystatus"_n, eosio::const_mem_fun< income, uint64_t, &income::by_status > > > incomes_index
Definition: shared_gateway.hpp:72
constexpr eosio::name CREATE_OUTPAY
Definition: shared_names.hpp:79
Definition: eosio.msig.hpp:34
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 CREATEOUTPAY_SIGNATURE
Definition: shared_gateway.hpp:1
void(CREATEOUTPAY_SIGNATURE) createoutpay_interface
Definition: shared_gateway.hpp:3
Таблица входящих платежей хранит информацию о входящих платежах в кооператив.
Definition: shared_gateway.hpp:46
eosio::name coopname
Имя аккаунта кооператива, в контексте которого совершается платеж
Definition: shared_gateway.hpp:48
checksum256 income_hash
Хэш входящего платежа
Definition: shared_gateway.hpp:51
name confirm_callback
Действие успеха
Definition: shared_gateway.hpp:53
uint64_t by_username() const
Индекс по имени пользователя (2)
Definition: shared_gateway.hpp:62
eosio::asset quantity
Количество средств во внутренней валюте
Definition: shared_gateway.hpp:56
checksum256 by_hash() const
Индекс по хэшу платежа (3)
Definition: shared_gateway.hpp:63
uint64_t by_status() const
Индекс по статусу платежа (4)
Definition: shared_gateway.hpp:64
uint64_t primary_key() const
Первичный ключ (1)
Definition: shared_gateway.hpp:61
eosio::name status
Статус платежа
Definition: shared_gateway.hpp:57
eosio::name username
Имя аккаунта пользователя, совершившего платеж
Definition: shared_gateway.hpp:49
uint64_t id
Уникальный идентификатор записи входящего платежа
Definition: shared_gateway.hpp:47
eosio::name type
Тип платежа
Definition: shared_gateway.hpp:50
name decline_callback
Действие отклонения
Definition: shared_gateway.hpp:54
name callback_contract
Контракт для вызова коллбэков
Definition: shared_gateway.hpp:52
Таблица исходящих платежей хранит информацию об исходящих платежах из кооператива.
Definition: shared_gateway.hpp:102
checksum256 outcome_hash
Хэш исходящего платежа
Definition: shared_gateway.hpp:107
eosio::name status
Статус платежа
Definition: shared_gateway.hpp:113
eosio::name type
Тип платежа
Definition: shared_gateway.hpp:106
eosio::name username
Имя аккаунта пользователя, совершившего платеж
Definition: shared_gateway.hpp:105
uint64_t id
Уникальный идентификатор записи исходящего платежа
Definition: shared_gateway.hpp:103
eosio::name coopname
Имя аккаунта кооператива, в контексте которого совершается платеж
Definition: shared_gateway.hpp:104
uint64_t primary_key() const
Первичный ключ (1)
Definition: shared_gateway.hpp:117
eosio::asset quantity
Количество средств во внутренней валюте
Definition: shared_gateway.hpp:112
name callback_contract
Контракт для вызова коллбэков
Definition: shared_gateway.hpp:108
name confirm_callback
Действие успеха
Definition: shared_gateway.hpp:109
uint64_t by_status() const
Индекс по статусу платежа (4)
Definition: shared_gateway.hpp:120
name decline_callback
Действие отклонения
Definition: shared_gateway.hpp:110
uint64_t by_username() const
Индекс по имени пользователя (2)
Definition: shared_gateway.hpp:118
checksum256 by_hash() const
Индекс по хэшу платежа (3)
Definition: shared_gateway.hpp:119