Documentation
¶
Index ¶
- Variables
- func GetActiveVoteUnitsForGroup(groupAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func GetActiveVoteUnitsForGroupByAccount(groupAddressHex string, accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func GetDequeue(atBlockNumber *big.Int) ([]*big.Int, error)
- func GetMetadataURL(accountAddressHex string, atBlockNumber *big.Int) (string, error)
- func GetName(accountAddressHex string, atBlockNumber *big.Int) (string, error)
- func GetNumVotesReceivable(groupAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func GetProposalStage(proposalID *big.Int, atBlockNumber *big.Int) (uint8, error)
- func GetQueue(atBlockNumber *big.Int) ([]*big.Int, []*big.Int, error)
- func GetReferendumProposals(atBlockNumber *big.Int) ([]*big.Int, error)
- func GetRegisteredValidatorGroups(atBlockNumber *big.Int) ([]common.Address, error)
- func GetRegisteredValidators(atBlockNumber *big.Int) ([]common.Address, error)
- func GetTotalVotes(atBlockNumber *big.Int) (*big.Int, error)
- func GetValidatorGroup(groupAddressHex string, atBlockNumber *big.Int) ([]common.Address, *big.Int, *big.Int, *big.Int, []*big.Int, *big.Int, *big.Int, ...)
- func GetValidatorScore(valAddress common.Address, atBlockNumber *big.Int) (*big.Int, error)
- func GoldTokenBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func InitAccountsContractInstance()
- func InitClientAndContracts()
- func InitElectionContractInstance()
- func InitGTContractInstance()
- func InitGovernanceContractInstance()
- func InitLGContractInstance()
- func InitStableTokenContractInstance()
- func InitValidatorsContractInstance()
- func NonVotingLockedGoldBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func PendingWithdrawals(accountAddressHex string, atBlockNumber *big.Int) ([]*big.Int, []*big.Int, error)
- func StableTokenBalanceValue(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func SystemGoldTokenSupply(atBlockNumber *big.Int) (*big.Int, error)
- func SystemNonVotingLockedGoldBalance(atBlockNumber *big.Int) (*big.Int, error)
- func SystemStableTokenSupplyValue(atBlockNumber *big.Int) (*big.Int, error)
- func SystemTotalLockedGoldBalance(atBlockNumber *big.Int) (*big.Int, error)
- func TotalLockedGoldBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func TotalPendingWithdrawalGoldBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- func TotalVotesByAccount(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
- type AccountVotesDistribution
- type AssortedProposals
- type DetailedExpiredProposal
- type DetailedProposal
- type DetailedQueuedProposal
- type Group
- type IndexMap
- type UpvotesMap
- type ValidatorDetails
- type ValidatorGroup
- type VoteSplit
Constants ¶
This section is empty.
Variables ¶
var StageMapping = map[uint8]string{ // contains filtered or unexported fields }
Functions ¶
func GetMetadataURL ¶
func GetNumVotesReceivable ¶
func GetProposalStage ¶
func GetReferendumProposals ¶
func GetRegisteredValidatorGroups ¶
GetRegisteredValidatorGroups returns the registered validator groups at the given block height
func GetRegisteredValidators ¶
GetRegisteredValidators returns the registered validators at the given block height
func GetValidatorGroup ¶
func GetValidatorScore ¶
func GoldTokenBalance ¶
func InitAccountsContractInstance ¶
func InitAccountsContractInstance()
func InitClientAndContracts ¶
func InitClientAndContracts()
func InitElectionContractInstance ¶
func InitElectionContractInstance()
func InitGTContractInstance ¶
func InitGTContractInstance()
func InitGovernanceContractInstance ¶
func InitGovernanceContractInstance()
func InitLGContractInstance ¶
func InitLGContractInstance()
func InitStableTokenContractInstance ¶
func InitStableTokenContractInstance()
func InitValidatorsContractInstance ¶
func InitValidatorsContractInstance()
func NonVotingLockedGoldBalance ¶
NonVotingLockedGoldBalance returns the total amount of non-voting locked gold for an account at the given block height
func PendingWithdrawals ¶
func StableTokenBalanceValue ¶
func TotalLockedGoldBalance ¶
TotalLockedGoldBalance returns the total amount of locked gold for an account at the given block height
func TotalPendingWithdrawalGoldBalance ¶
func TotalPendingWithdrawalGoldBalance(accountAddressHex string, atBlockNumber *big.Int) (*big.Int, error)
TotalPendingWithdrawalGoldBalance returns the total pending withdrawal gold for an account at the given block height Note : This function is not available in the LockedGold contract deployed on Alfajores
Types ¶
type AccountVotesDistribution ¶
func GetAccountVotesDistribution ¶
func GetAccountVotesDistribution(accountAddressHex string, atBlockNumber *big.Int) (*AccountVotesDistribution, error)
type AssortedProposals ¶
type AssortedProposals struct {
QueuedProposals []*DetailedQueuedProposal `json:"queuedProposals"`
ApprovalProposals []*DetailedProposal `json:"approvalProposals"`
ReferendumProposals []*DetailedProposal `json:"referendumProposals"`
ExecutionProposals []*DetailedProposal `json:"executionProposals"`
ExpiredProposals []*DetailedExpiredProposal `json:"expiredProposals"`
}
AssortedProposals is a collection of proposals across stages
func GetAllProposalsUptoBlockNumber ¶
func GetAllProposalsUptoBlockNumber(atBlockNumber *big.Int) (*AssortedProposals, error)
GetAllProposalsUptoBlockNumber returns all proposals on Celo blockchain upto block height with details as-on-block-height
type DetailedExpiredProposal ¶
type DetailedExpiredProposal struct {
ProposalID *big.Int `json:"proposalID"`
BlockNumber *big.Int `json:"currentBlockNumber"`
Stage string `json:"stage"`
Proposer common.Address `json:"proposer"`
Executed bool `json:"executed"`
QueuedAtBlockNumber *big.Int `json:"queuedAtBlockNumber"`
Deposit *big.Int `json:"deposit"`
QueuedTimestamp *big.Int `json:"queuedAtTimestamp"`
Description string `json:"description"`
}
DetailedExpiredProposal represents a detailed expired proposal (Proposal in Expiration Stage)
type DetailedProposal ¶
type DetailedProposal struct {
ProposalID *big.Int `json:"proposalID"`
Index *big.Int `json:"index"`
BlockNumber *big.Int `json:"currentBlockNumber"`
Stage string `json:"stage"`
Proposer common.Address `json:"proposer"`
YesVotes *big.Int `json:"yesVotes,omitempty"`
NoVotes *big.Int `json:"noVotes,omitempty"`
AbstainVotes *big.Int `json:"abstainVotes,omitempty"`
Description string `json:"description"`
ProposalEpoch *big.Int `json:"proposalEpoch"`
ReferendumEpoch *big.Int `json:"referendumEpoch"`
ExecutionEpoch *big.Int `json:"executionEpoch"`
ExpirationEpoch *big.Int `json:"expirationEpoch"`
QueuedAtBlockNumber *big.Int `json:"queuedAtBlockNumber,omitempty"`
Deposit *big.Int `json:"deposit"`
QueuedTimestamp *big.Int `json:"queuedAtTimestamp,omitempty"`
}
func GetDetailedReferendumProposals ¶
func GetDetailedReferendumProposals(atBlockNumber *big.Int) ([]*DetailedProposal, error)
GetDetailedReferendumProposals returns list of all referendum proposals (with their respective details) at the provided block height
type DetailedQueuedProposal ¶
type DetailedQueuedProposal struct {
ProposalID *big.Int `json:"proposalID"`
Index *big.Int `json:"index"`
BlockNumber *big.Int `json:"currentBlockNumber"`
Stage string `json:"stage"`
Proposer common.Address `json:"proposer"`
Upvotes *big.Int `json:"upvotes"`
Description string `json:"description"`
ProposalEpoch *big.Int `json:"proposalEpoch"`
ReferendumEpoch *big.Int `json:"referendumEpoch"`
ExecutionEpoch *big.Int `json:"executionEpoch"`
ExpirationEpoch *big.Int `json:"expirationEpoch"`
QueuedAtBlockNumber *big.Int `json:"queuedAtBlockNumber,omitempty"`
Deposit *big.Int `json:"deposit"`
QueuedTimestamp *big.Int `json:"queuedAtTimestamp,omitempty"`
}
func GetDetailedQueuedProposals ¶
func GetDetailedQueuedProposals(atBlockNumber *big.Int) ([]*DetailedQueuedProposal, error)
GetDetailedQueuedProposals returns list of all queued proposals (with their respective details) at the provided block height
type UpvotesMap ¶
type ValidatorDetails ¶
type ValidatorGroup ¶
type ValidatorGroup struct {
Address common.Address `json:"group"`
Name string `json:"name"`
Metadata string `json:"metadataURL"`
BlockNumber *big.Int `json:"blockNumber"`
VotingPower *big.Int `json:"votingPower"`
VotingPowerFraction *big.Float `json:"votingPowerFraction"`
CapacityAvailable *big.Int `json:"capacityAvailable"`
TotalCapacity *big.Int `json:"totalCapacity"`
Multiplier *big.Int `json:"multiplier"`
ValidatorAddresses []common.Address `json:"validatorAddresses"`
ValidatorDetails []*ValidatorDetails `json:"validatorDetails"`
GroupScore *big.Int `json:"groupScore"`
}