29 #include <boost/multi_index/composite_key.hpp> 31 namespace graphene {
namespace chain {
46 protocol_ids, withdraw_permission_object_type>
56 uint32_t withdrawal_period_sec = 0;
83 if( current_time >= period_start_time + withdrawal_period_sec )
84 return withdrawal_limit;
85 return asset( ( withdrawal_limit.
amount > claimed_this_period ) ?
86 ( withdrawal_limit.
amount - claimed_this_period ) : 0,
98 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
99 ordered_unique< tag<by_from>,
100 composite_key< withdraw_permission_object,
101 member< withdraw_permission_object, account_id_type,
103 member< object, object_id_type, &object::id >
106 ordered_unique< tag<by_authorized>,
107 composite_key< withdraw_permission_object,
108 member< withdraw_permission_object, account_id_type, &withdraw_permission_object::authorized_account >,
109 member< object, object_id_type, &object::id >
112 ordered_unique< tag<by_expiration>,
113 composite_key< withdraw_permission_object,
114 member< withdraw_permission_object, time_point_sec, &withdraw_permission_object::expiration >,
115 member< object, object_id_type, &object::id >
account_id_type authorized_account
The account authorized to make withdrawals from withdraw_from_account.
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
time_point_sec period_start_time
FC_REFLECT_TYPENAME(fc::log_message)
Grants another account authority to withdraw a limited amount of funds per interval.
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
time_point_sec expiration
The time at which this withdraw permission expires.
asset withdrawal_limit
The maximum amount which may be withdrawn per period. All withdrawals must be of this asset type...
share_type claimed_this_period
asset available_this_period(fc::time_point_sec current_time) const
account_id_type withdraw_from_account
The account authorizing authorized_account to withdraw from it.
multi_index_container< withdraw_permission_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_from >, composite_key< withdraw_permission_object, member< withdraw_permission_object, account_id_type, &withdraw_permission_object::withdraw_from_account >, member< object, object_id_type, &object::id > > >, ordered_unique< tag< by_authorized >, composite_key< withdraw_permission_object, member< withdraw_permission_object, account_id_type, &withdraw_permission_object::authorized_account >, member< object, object_id_type, &object::id > > >, ordered_unique< tag< by_expiration >, composite_key< withdraw_permission_object, member< withdraw_permission_object, time_point_sec, &withdraw_permission_object::expiration >, member< object, object_id_type, &object::id > > > > > withdraw_permission_obj_mlt_idx