BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
#include <vesting_balance_object.hpp>
Public Member Functions | |
vesting_balance_object () | |
void | deposit (const fc::time_point_sec &now, const asset &amount) |
Deposit amount into vesting balance, requiring it to vest before withdrawal. More... | |
bool | is_deposit_allowed (const fc::time_point_sec &now, const asset &amount) const |
void | deposit_vested (const fc::time_point_sec &now, const asset &amount) |
Deposit amount into vesting balance, making the new funds vest immediately. More... | |
bool | is_deposit_vested_allowed (const fc::time_point_sec &now, const asset &amount) const |
void | withdraw (const fc::time_point_sec &now, const asset &amount) |
bool | is_withdraw_allowed (const fc::time_point_sec &now, const asset &amount) const |
asset | get_allowed_withdraw (const time_point_sec &now) const |
Public Member Functions inherited from graphene::db::abstract_object< vesting_balance_object, protocol_ids, vesting_balance_object_type > | |
abstract_object () | |
object_id< SpaceID, TypeID > | get_id () const |
Public Member Functions inherited from graphene::db::base_abstract_object< vesting_balance_object > | |
std::unique_ptr< object > | clone () const override |
void | move_from (object &obj) override |
fc::variant | to_variant () const override |
std::vector< char > | pack () const override |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
Public Member Functions inherited from graphene::db::object | |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
virtual | ~object ()=default |
virtual std::unique_ptr< object > | clone () const =0 |
virtual fc::variant | to_variant () const =0 |
virtual std::vector< char > | pack () const =0 |
Public Attributes | |
account_id_type | owner |
Account which owns and may withdraw from this vesting balance. More... | |
asset | balance |
vesting_policy | policy |
The vesting policy stores details on when funds vest, and controls when they may be withdrawn. More... | |
vesting_balance_type | balance_type = vesting_balance_type::unspecified |
type of the vesting balance More... | |
Public Attributes inherited from graphene::db::object | |
object_id_type | id |
Additional Inherited Members | |
Static Public Attributes inherited from graphene::db::abstract_object< vesting_balance_object, protocol_ids, vesting_balance_object_type > | |
static constexpr uint8_t | space_id |
static constexpr uint8_t | type_id |
Vesting balance object is a balance that is locked by the blockchain for a period of time.
Definition at line 151 of file vesting_balance_object.hpp.
|
inline |
Definition at line 165 of file vesting_balance_object.hpp.
void graphene::chain::vesting_balance_object::deposit | ( | const fc::time_point_sec & | now, |
const asset & | amount | ||
) |
Deposit amount into vesting balance, requiring it to vest before withdrawal.
Definition at line 240 of file vesting_balance_object.cpp.
void graphene::chain::vesting_balance_object::deposit_vested | ( | const fc::time_point_sec & | now, |
const asset & | amount | ||
) |
Deposit amount into vesting balance, making the new funds vest immediately.
Definition at line 247 of file vesting_balance_object.cpp.
asset graphene::chain::vesting_balance_object::get_allowed_withdraw | ( | const time_point_sec & | now | ) | const |
Get amount of allowed withdrawal.
Definition at line 267 of file vesting_balance_object.cpp.
bool graphene::chain::vesting_balance_object::is_deposit_allowed | ( | const fc::time_point_sec & | now, |
const asset & | amount | ||
) | const |
Definition at line 226 of file vesting_balance_object.cpp.
bool graphene::chain::vesting_balance_object::is_deposit_vested_allowed | ( | const fc::time_point_sec & | now, |
const asset & | amount | ||
) | const |
Definition at line 254 of file vesting_balance_object.cpp.
bool graphene::chain::vesting_balance_object::is_withdraw_allowed | ( | const fc::time_point_sec & | now, |
const asset & | amount | ||
) | const |
Definition at line 231 of file vesting_balance_object.cpp.
void graphene::chain::vesting_balance_object::withdraw | ( | const fc::time_point_sec & | now, |
const asset & | amount | ||
) |
Used to remove a vesting balance from the VBO. As well as the balance field, coin_seconds_earned and coin_seconds_earned_last_update fields are updated.
The money doesn't "go" anywhere; the caller is responsible for crediting it to the proper account.
Definition at line 259 of file vesting_balance_object.cpp.
asset graphene::chain::vesting_balance_object::balance |
Total amount remaining in this vesting balance Includes the unvested funds, and the vested funds which have not yet been withdrawn
Definition at line 159 of file vesting_balance_object.hpp.
vesting_balance_type graphene::chain::vesting_balance_object::balance_type = vesting_balance_type::unspecified |
type of the vesting balance
Definition at line 163 of file vesting_balance_object.hpp.
account_id_type graphene::chain::vesting_balance_object::owner |
Account which owns and may withdraw from this vesting balance.
Definition at line 156 of file vesting_balance_object.hpp.
vesting_policy graphene::chain::vesting_balance_object::policy |
The vesting policy stores details on when funds vest, and controls when they may be withdrawn.
Definition at line 161 of file vesting_balance_object.hpp.