BitShares-Core  6.1.0
BitShares blockchain implementation and command-line interface 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  {
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;
143  };
144 
154  {
155  struct fee_parameters_type { 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 
181  (permission_to_update)(withdrawal_limit)(withdrawal_period_sec)
184  (fee)(withdraw_permission)(withdraw_from_account)(withdraw_to_account)(amount_to_withdraw)(memo) )
187  (withdrawal_permission) )
188 
optional< memo_data > memo
Memo for withdraw_from_account. Should generally be encrypted with withdraw_from_account->memo_key.
account_id_type withdraw_from_account
Must match withdraw_permission->withdraw_from_account.
account_id_type withdraw_to_account
Must match withdraw_permision->authorized_account.
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
account_id_type authorized_account
The account authorized to make withdrawals from withdraw_from_account.
asset withdrawal_limit
New maximum amount the withdrawer is allowed to charge per withdrawal period.
asset withdrawal_limit
The maximum amount authorized_account is allowed to withdraw in a given withdrawal period...
Definition: api.cpp:48
Delete an existing withdrawal permissionThis operation cancels a withdrawal permission, thus preventing any future withdrawals using that permission.
account_id_type withdraw_from_account
The account authorizing withdrawals from its balances.
asset amount_to_withdraw
Amount to withdraw. Must not exceed withdraw_permission->withdrawal_limit.
uint32_t withdrawal_period_sec
Length of the withdrawal period in seconds.
time_point_sec period_start_time
Time at which the first withdrawal period begins; must be in the future.
uint32_t periods_until_expiration
The number of withdrawal periods this permission is valid for.
Withdraw from an account which has published a withdrawal permissionThis operation is used to withdra...
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
account_id_type authorized_account
The account authorized to make withdrawals. Must match permission_to_update->authorized_account.
account_id_type withdraw_from_account
Must match withdrawal_permission->withdraw_from_account. This account pays the fee.
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:85
share_type calculate_fee(const T &params) const
Definition: base.hpp:128
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
account_id_type withdraw_from_account
This account pays the fee. Must match permission_to_update->withdraw_from_account.
withdraw_permission_id_type withdraw_permission
ID of the permission authorizing this withdrawal.
withdraw_permission_id_type withdrawal_permission
ID of the permission to be revoked.
withdraw_permission_id_type permission_to_update
ID of the permission which is being updated.
Update an existing withdraw permissionThis oeration is used to update the settings for an existing wi...
account_id_type authorized_account
The account previously authorized to make withdrawals. Must match withdrawal_permission->authorized_a...
Create a new withdrawal permissionThis operation creates a withdrawal permission, which allows some a...
time_point_sec period_start_time
New beginning of the next withdrawal period; must be in the future.