BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | Public Attributes | List of all members
graphene::chain::vesting_balance_object Class Reference

#include <vesting_balance_object.hpp>

Inheritance diagram for graphene::chain::vesting_balance_object:
graphene::db::abstract_object< vesting_balance_object, protocol_ids, vesting_balance_object_type > graphene::db::base_abstract_object< vesting_balance_object > graphene::db::object graphene::wallet::vesting_balance_object_with_info

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< objectclone () 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< objectclone () 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ vesting_balance_object()

graphene::chain::vesting_balance_object::vesting_balance_object ( )
inline

Definition at line 165 of file vesting_balance_object.hpp.

Member Function Documentation

◆ deposit()

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.

◆ deposit_vested()

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.

◆ get_allowed_withdraw()

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.

◆ is_deposit_allowed()

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.

◆ is_deposit_vested_allowed()

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.

◆ is_withdraw_allowed()

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.

◆ withdraw()

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.

Member Data Documentation

◆ balance

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.

◆ balance_type

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.

◆ owner

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.

◆ policy

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.


The documentation for this class was generated from the following files: