BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
withdraw_permission.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
28 
29 namespace graphene { namespace protocol {
30 
51  {
53 
56  account_id_type withdraw_from_account;
58  account_id_type authorized_account;
62  uint32_t withdrawal_period_sec = 0;
67 
68  account_id_type fee_payer()const { return withdraw_from_account; }
69  void validate()const;
70  };
71 
84  {
86 
89  account_id_type withdraw_from_account;
91  account_id_type authorized_account;
93  withdraw_permission_id_type permission_to_update;
97  uint32_t withdrawal_period_sec = 0;
102 
103  account_id_type fee_payer()const { return withdraw_from_account; }
104  void validate()const;
105  };
106 
121  {
122  struct fee_params_t {
124  uint32_t price_per_kbyte = 10;
125  };
126 
130  withdraw_permission_id_type withdraw_permission;
132  account_id_type withdraw_from_account;
134  account_id_type withdraw_to_account;
139 
140  account_id_type fee_payer()const { return withdraw_to_account; }
141  void validate()const;
142  share_type calculate_fee(const fee_params_t& k)const;
143  };
144 
154  {
155  struct fee_params_t { uint64_t fee = 0; };
156 
159  account_id_type withdraw_from_account;
161  account_id_type authorized_account;
163  withdraw_permission_id_type withdrawal_permission;
164 
165  account_id_type fee_payer()const { return withdraw_from_account; }
166  void validate()const;
167  };
168 
169 } } // graphene::protocol
170 
175 
177  (fee)(withdraw_from_account)(authorized_account)
178  (withdrawal_limit)(withdrawal_period_sec)(periods_until_expiration)(period_start_time) )
180  (fee)(withdraw_from_account)(authorized_account)
181  (permission_to_update)(withdrawal_limit)(withdrawal_period_sec)
182  (period_start_time)(periods_until_expiration) )
184  (fee)(withdraw_permission)(withdraw_from_account)(withdraw_to_account)(amount_to_withdraw)(memo) )
186  (fee)(withdraw_from_account)(authorized_account)
187  (withdrawal_permission) )
188 
graphene::protocol::withdraw_permission_create_operation::withdrawal_period_sec
uint32_t withdrawal_period_sec
Length of the withdrawal period in seconds.
Definition: withdraw_permission.hpp:62
graphene::protocol::withdraw_permission_claim_operation::memo
optional< memo_data > memo
Memo for withdraw_from_account. Should generally be encrypted with withdraw_from_account->memo_key.
Definition: withdraw_permission.hpp:138
graphene::protocol::withdraw_permission_update_operation
Update an existing withdraw permission.
Definition: withdraw_permission.hpp:83
graphene::protocol::withdraw_permission_create_operation::fee
asset fee
Definition: withdraw_permission.hpp:54
graphene::protocol::withdraw_permission_create_operation::periods_until_expiration
uint32_t periods_until_expiration
The number of withdrawal periods this permission is valid for.
Definition: withdraw_permission.hpp:64
graphene::protocol::withdraw_permission_claim_operation::withdraw_from_account
account_id_type withdraw_from_account
Must match withdraw_permission->withdraw_from_account.
Definition: withdraw_permission.hpp:132
graphene::protocol::withdraw_permission_create_operation::fee_params_t::fee
uint64_t fee
Definition: withdraw_permission.hpp:52
graphene::protocol::withdraw_permission_delete_operation::fee
asset fee
Definition: withdraw_permission.hpp:157
graphene::protocol::withdraw_permission_claim_operation::amount_to_withdraw
asset amount_to_withdraw
Amount to withdraw. Must not exceed withdraw_permission->withdrawal_limit.
Definition: withdraw_permission.hpp:136
graphene::protocol::withdraw_permission_update_operation::validate
void validate() const
Definition: withdraw_permission.cpp:30
graphene::protocol::withdraw_permission_claim_operation::fee_params_t::price_per_kbyte
uint32_t price_per_kbyte
Definition: withdraw_permission.hpp:124
graphene::protocol::withdraw_permission_delete_operation::withdraw_from_account
account_id_type withdraw_from_account
Must match withdrawal_permission->withdraw_from_account. This account pays the fee.
Definition: withdraw_permission.hpp:159
graphene::protocol::withdraw_permission_create_operation::validate
void validate() const
Definition: withdraw_permission.cpp:54
graphene::protocol::withdraw_permission_claim_operation::withdraw_permission
withdraw_permission_id_type withdraw_permission
ID of the permission authorizing this withdrawal.
Definition: withdraw_permission.hpp:130
graphene::protocol::base_operation
Definition: base.hpp:124
graphene::protocol::withdraw_permission_delete_operation::fee_payer
account_id_type fee_payer() const
Definition: withdraw_permission.hpp:165
graphene::protocol::withdraw_permission_delete_operation::authorized_account
account_id_type authorized_account
The account previously authorized to make withdrawals. Must match withdrawal_permission->authorized_a...
Definition: withdraw_permission.hpp:161
graphene::protocol::withdraw_permission_create_operation::fee_payer
account_id_type fee_payer() const
Definition: withdraw_permission.hpp:68
graphene::protocol::withdraw_permission_claim_operation::withdraw_to_account
account_id_type withdraw_to_account
Must match withdraw_permision->authorized_account.
Definition: withdraw_permission.hpp:134
graphene::protocol::withdraw_permission_claim_operation::fee_params_t
Definition: withdraw_permission.hpp:122
graphene::protocol::withdraw_permission_claim_operation
Withdraw from an account which has published a withdrawal permission.
Definition: withdraw_permission.hpp:120
graphene::protocol::withdraw_permission_claim_operation::validate
void validate() const
Definition: withdraw_permission.cpp:39
graphene::protocol::withdraw_permission_update_operation::authorized_account
account_id_type authorized_account
The account authorized to make withdrawals. Must match permission_to_update->authorized_account.
Definition: withdraw_permission.hpp:91
graphene::protocol::withdraw_permission_update_operation::fee_params_t
Definition: withdraw_permission.hpp:85
memo.hpp
GRAPHENE_BLOCKCHAIN_PRECISION
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
graphene::protocol::withdraw_permission_create_operation
Create a new withdrawal permission.
Definition: withdraw_permission.hpp:50
graphene::protocol::withdraw_permission_update_operation::fee
asset fee
Definition: withdraw_permission.hpp:87
graphene::protocol::withdraw_permission_claim_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: withdraw_permission.cpp:46
graphene::protocol::withdraw_permission_create_operation::authorized_account
account_id_type authorized_account
The account authorized to make withdrawals from withdraw_from_account.
Definition: withdraw_permission.hpp:58
fc::time_point_sec
Definition: time.hpp:74
graphene::protocol::withdraw_permission_update_operation::withdrawal_limit
asset withdrawal_limit
New maximum amount the withdrawer is allowed to charge per withdrawal period.
Definition: withdraw_permission.hpp:95
graphene::protocol::withdraw_permission_delete_operation::withdrawal_permission
withdraw_permission_id_type withdrawal_permission
ID of the permission to be revoked.
Definition: withdraw_permission.hpp:163
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:85
graphene::protocol::withdraw_permission_create_operation::fee_params_t
Definition: withdraw_permission.hpp:52
graphene::protocol::withdraw_permission_delete_operation
Delete an existing withdrawal permission.
Definition: withdraw_permission.hpp:153
graphene::protocol::withdraw_permission_update_operation::fee_params_t::fee
uint64_t fee
Definition: withdraw_permission.hpp:85
graphene::protocol::withdraw_permission_update_operation::fee_payer
account_id_type fee_payer() const
Definition: withdraw_permission.hpp:103
graphene::protocol::withdraw_permission_delete_operation::fee_params_t::fee
uint64_t fee
Definition: withdraw_permission.hpp:155
graphene::protocol::withdraw_permission_delete_operation::validate
void validate() const
Definition: withdraw_permission.cpp:64
base.hpp
graphene::protocol::withdraw_permission_claim_operation::fee
asset fee
Paid by withdraw_to_account.
Definition: withdraw_permission.hpp:128
graphene::protocol::withdraw_permission_update_operation::periods_until_expiration
uint32_t periods_until_expiration
The new number of withdrawal periods for which this permission will be valid.
Definition: withdraw_permission.hpp:101
graphene::protocol::withdraw_permission_update_operation::withdrawal_period_sec
uint32_t withdrawal_period_sec
New length of the period between withdrawals.
Definition: withdraw_permission.hpp:97
graphene::protocol::withdraw_permission_update_operation::period_start_time
time_point_sec period_start_time
New beginning of the next withdrawal period; must be in the future.
Definition: withdraw_permission.hpp:99
graphene::protocol::withdraw_permission_update_operation::permission_to_update
withdraw_permission_id_type permission_to_update
ID of the permission which is being updated.
Definition: withdraw_permission.hpp:93
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::protocol::withdraw_permission_delete_operation::fee_params_t
Definition: withdraw_permission.hpp:155
graphene::protocol::withdraw_permission_claim_operation::fee_payer
account_id_type fee_payer() const
Definition: withdraw_permission.hpp:140
graphene::protocol::withdraw_permission_claim_operation::fee_params_t::fee
uint64_t fee
Definition: withdraw_permission.hpp:123
graphene::protocol::asset
Definition: asset.hpp:31
graphene::protocol::withdraw_permission_update_operation::withdraw_from_account
account_id_type withdraw_from_account
This account pays the fee. Must match permission_to_update->withdraw_from_account.
Definition: withdraw_permission.hpp:89
asset.hpp
graphene::protocol::withdraw_permission_create_operation::period_start_time
time_point_sec period_start_time
Time at which the first withdrawal period begins; must be in the future.
Definition: withdraw_permission.hpp:66
graphene::protocol::withdraw_permission_create_operation::withdrawal_limit
asset withdrawal_limit
The maximum amount authorized_account is allowed to withdraw in a given withdrawal period.
Definition: withdraw_permission.hpp:60
graphene
Definition: api.cpp:48
fc::safe
Definition: safe.hpp:26
graphene::protocol::withdraw_permission_create_operation::withdraw_from_account
account_id_type withdraw_from_account
The account authorizing withdrawals from its balances.
Definition: withdraw_permission.hpp:56