Enum stacks_rpc_client::clarity::vm::database::STXBalance
pub enum STXBalance {
Unlocked {
amount: u128,
},
LockedPoxOne {
amount_unlocked: u128,
amount_locked: u128,
unlock_height: u64,
},
LockedPoxTwo {
amount_unlocked: u128,
amount_locked: u128,
unlock_height: u64,
},
LockedPoxThree {
amount_unlocked: u128,
amount_locked: u128,
unlock_height: u64,
},
}
Variants§
Implementations§
§impl STXBalance
impl STXBalance
pub const unlocked_and_v1_size: usize = 40usize
pub const v2_and_v3_size: usize = 41usize
pub const pox_2_version: u8 = 0u8
pub const pox_3_version: u8 = 1u8
pub fn zero() -> STXBalance
pub fn initial(amount: u128) -> STXBalance
pub fn unlock_height(&self) -> u64
pub fn unlock_height(&self) -> u64
This method returns the datastructure’s lazy view of the unlock_height: this may be updated by a canonicalized view of the account
pub fn effective_unlock_height(
&self,
v1_unlock_height: u32,
v2_unlock_height: u32
) -> u64
pub fn effective_unlock_height( &self, v1_unlock_height: u32, v2_unlock_height: u32 ) -> u64
This method returns the datastructure’s lazy view of the unlock_height while factoring in the PoX 2 early unlock for PoX 1 and PoX 3 early unlock for PoX 2. This value is still lazy: this unlock height may be less than the current burn block height, if so it will be updated in a canonicalized view.
pub fn amount_locked(&self) -> u128
pub fn amount_locked(&self) -> u128
This method returns the datastructure’s lazy view of the amount locked: this may be updated by a canonicalized view of the account
pub fn amount_unlocked(&self) -> u128
pub fn amount_unlocked(&self) -> u128
This method returns the datastructure’s lazy view of the amount unlocked: this may be updated by a canonicalized view of the account
pub fn canonical_repr_at_block(
&self,
burn_block_height: u64,
v1_unlock_height: u32,
v2_unlock_height: u32
) -> (STXBalance, u128)
pub fn canonical_repr_at_block( &self, burn_block_height: u64, v1_unlock_height: u32, v2_unlock_height: u32 ) -> (STXBalance, u128)
Returns a canonicalized STXBalance at a given burn_block_height (i.e., if burn_block_height >= unlock_height, then return struct where amount_unlocked = 0, unlock_height = 0), and the amount of tokens which are “unlocked” by the canonicalization
pub fn get_available_balance_at_burn_block( &self, burn_block_height: u64, v1_unlock_height: u32, v2_unlock_height: u32 ) -> u128
pub fn get_locked_balance_at_burn_block( &self, burn_block_height: u64, v1_unlock_height: u32, v2_unlock_height: u32 ) -> (u128, u64)
pub fn get_total_balance(&self) -> u128
pub fn was_locked_by_v1(&self) -> bool
pub fn was_locked_by_v2(&self) -> bool
pub fn was_locked_by_v3(&self) -> bool
pub fn has_locked_tokens_at_burn_block( &self, burn_block_height: u64, v1_unlock_height: u32, v2_unlock_height: u32 ) -> bool
pub fn has_unlockable_tokens_at_burn_block( &self, burn_block_height: u64, v1_unlock_height: u32, v2_unlock_height: u32 ) -> bool
pub fn can_transfer_at_burn_block( &self, amount: u128, burn_block_height: u64, v1_unlock_height: u32, v2_unlock_height: u32 ) -> bool
Trait Implementations§
§impl ClarityDeserializable<STXBalance> for STXBalance
impl ClarityDeserializable<STXBalance> for STXBalance
fn deserialize(input: &str) -> STXBalance
§impl ClaritySerializable for STXBalance
impl ClaritySerializable for STXBalance
§impl Clone for STXBalance
impl Clone for STXBalance
§fn clone(&self) -> STXBalance
fn clone(&self) -> STXBalance
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for STXBalance
impl Debug for STXBalance
§impl<'de> Deserialize<'de> for STXBalance
impl<'de> Deserialize<'de> for STXBalance
§fn deserialize<__D>(
__deserializer: __D
) -> Result<STXBalance, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<STXBalance, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl PartialEq for STXBalance
impl PartialEq for STXBalance
§fn eq(&self, other: &STXBalance) -> bool
fn eq(&self, other: &STXBalance) -> bool
self
and other
values to be equal, and is used
by ==
.