Documentation ¶
Index ¶
- type BalanceUpdateKind
- type CreationInfoKind
- type CycleStatistics
- type DelegateCycleStatistics
- type DelegatedBalances
- type DelegationState
- func (d *DelegationState) AddBalance(address tezos.Address, balanceInfo DelegationStateBalanceInfo)
- func (d *DelegationState) Delegate(delegator tezos.Address, delegate tezos.Address) error
- func (d *DelegationState) GetBakerStakedBalance() int64
- func (d *DelegationState) GetBakingPower() int64
- func (d *DelegationState) GetDelegatedBalance() int64
- func (d *DelegationState) GetDelegatorAndBakerBalances() DelegatedBalances
- func (d *DelegationState) GetDelegatorBalanceInfos() DelegationStateBalances
- func (d *DelegationState) GetStakersStakedBalance() int64
- func (d *DelegationState) HasContractBalanceInfo(address tezos.Address) bool
- func (d *DelegationState) UpdateBalance(address tezos.Address, kind string, change int64) error
- type DelegationStateBalanceInfo
- type DelegationStateBalances
- type DelegationStateCreationInfo
- type DelegatorBalances
- type FinalizableUnstakeRequest
- type StakingParameters
- type UnfinalizableUnstakeRequests
- type UnstakeRequests
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalanceUpdateKind ¶
type BalanceUpdateKind string
const ( KindBalanceUpdateFrozenDeposits BalanceUpdateKind = "frozen_deposits" KindBalanceUpdateUnfrozenDeposits BalanceUpdateKind = "unfrozen_deposits" OVERSTAKE_PRECISION = 1_000_000 )
type CreationInfoKind ¶
type CreationInfoKind string
TODO: find better name for this
const ( CreatedAtBlockBeginning CreationInfoKind = "block-beginning" CreatedAtBlockMetadata CreationInfoKind = "block-metadata" CreatedAtTransactionMetadata CreationInfoKind = "transaction-metadata" CreatedAtTransactionResult CreationInfoKind = "transaction-result" CreatedAtTransactionInternalResult CreationInfoKind = "transaction-internal-result" // special case for delegation CreatedOnDelegation CreationInfoKind = "delegation" )
type CycleStatistics ¶
type CycleStatistics struct { Cycle int64 `json:"cycle"` Delegates map[tezos.Address]DelegateCycleStatistics `json:"delegates"` }
type DelegateCycleStatistics ¶
type DelegatedBalances ¶
type DelegatedBalances map[tezos.Address]DelegatorBalances
type DelegationState ¶
type DelegationState struct { Baker tezos.Address `json:"baker"` Cycle int64 `json:"cycle"` LastBlockLevel rpc.BlockID `json:"last_block_level"` Parameters *StakingParameters `json:"staking_parameters"` CreatedAt DelegationStateCreationInfo `json:"created_at"` // contains filtered or unexported fields }
func NewDelegationState ¶
func (*DelegationState) AddBalance ¶
func (d *DelegationState) AddBalance(address tezos.Address, balanceInfo DelegationStateBalanceInfo)
func (*DelegationState) GetBakerStakedBalance ¶
func (d *DelegationState) GetBakerStakedBalance() int64
func (*DelegationState) GetBakingPower ¶
func (d *DelegationState) GetBakingPower() int64
func (*DelegationState) GetDelegatedBalance ¶
func (d *DelegationState) GetDelegatedBalance() int64
func (*DelegationState) GetDelegatorAndBakerBalances ¶
func (d *DelegationState) GetDelegatorAndBakerBalances() DelegatedBalances
includes baker own balance contributing to the total delegated balance
func (*DelegationState) GetDelegatorBalanceInfos ¶
func (d *DelegationState) GetDelegatorBalanceInfos() DelegationStateBalances
func (*DelegationState) GetStakersStakedBalance ¶
func (d *DelegationState) GetStakersStakedBalance() int64
func (*DelegationState) HasContractBalanceInfo ¶
func (d *DelegationState) HasContractBalanceInfo(address tezos.Address) bool
func (*DelegationState) UpdateBalance ¶
type DelegationStateBalanceInfo ¶
type DelegationStateBalanceInfo struct { Balance int64 `json:"balance"` StakedBalance int64 `json:"frozen_deposits"` UnstakedBalance int64 `json:"unfrozen_deposits"` Baker tezos.Address `json:"delegate"` // baker we stake with, can differ in case of delegation change StakeBaker tezos.Address `json:"stake_baker"` }
type DelegationStateBalances ¶
type DelegationStateBalances map[tezos.Address]DelegationStateBalanceInfo
type DelegatorBalances ¶
type StakingParameters ¶
type UnstakeRequests ¶
type UnstakeRequests struct { Finalizable []FinalizableUnstakeRequest `json:"finalizable"` Unfinalizable UnfinalizableUnstakeRequests `json:"unfinalizable"` }
func (*UnstakeRequests) GetUnstakedTotal ¶
func (u *UnstakeRequests) GetUnstakedTotal() int64
func (*UnstakeRequests) GetUnstakedTotalForBaker ¶
func (u *UnstakeRequests) GetUnstakedTotalForBaker(baker tezos.Address) int64
Click to show internal directories.
Click to hide internal directories.