types

package
v0.0.0-...-b6c1db7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address                    Address       `json:"address"`
	Height                     Height        `json:"height"`
	GoldTokenBalance           Amount        `json:"availableGoldBalance"`
	TotalLockedGoldBalance     Amount        `json:"totalLockedGoldBalance"`
	NonVotingLockedGoldBalance Amount        `json:"nonVotingLockedGoldBalance"`
	VotingLockedGoldBalance    Amount        `json:"votingLockedGoldBalance"`
	PendingWithdrawalBalance   Amount        `json:"pendingWithdrawalBalance"`
	CeloUSDValue               Amount        `json:"celoUSDValue"`
	Delegations                []*Delegation `json:"delegations"`
}

Account is a type that contains all the relevant information that Anthem seeks for an account

func NewAccount

func NewAccount(address string) *Account

NewAccount is a constructor for Account

type Address

type Address = string

Address is an alias of string

type Amount

type Amount = string

Amount is any balance or vote - an abstraction over Celo quantification

type Date

type Date = string

Date is an alias for string (for now)

type DatedAccount

type DatedAccount struct {
	SnapshotDate       Date    `json:"snapshotDate"`
	Address            Address `json:"address"`
	Height             Height  `json:"height"`
	SnapshotReward     Amount  `json:"snapshotReward"`
	SnapshotCommission Amount  `json:"snapshotCommission"`

	GoldTokenBalance           Amount `json:"availableGoldBalance"`
	TotalLockedGoldBalance     Amount `json:"totalLockedGoldBalance"`
	NonVotingLockedGoldBalance Amount `json:"nonVotingLockedGoldBalance"`
	VotingLockedGoldBalance    Amount `json:"votingLockedGoldBalance"`
	PendingWithdrawalBalance   Amount `json:"pendingWithdrawalBalance"`
	CeloUSDValue               Amount `json:"celoUSDValue"`

	Delegations []*Delegation `json:"delegations"`
}

DatedAccount represents an account and its details extracted from a daily snapshot

func NewDatedAccount

func NewDatedAccount(date string, address string) *DatedAccount

NewDatedAccount is a constructor for DatedAccount

type Delegation

type Delegation struct {
	Group        Address `json:"group"`
	TotalVotes   Amount  `json:"totalVotes"`
	ActiveVotes  Amount  `json:"activeVotes" `
	PendingVotes Amount  `json:"pendingVotes"`
}

Delegation represents what Celo calls votes Locked gold from an account bound to a group in the form of votes

type Handler

type Handler = func(w http.ResponseWriter, r *http.Request)

Handler is a small type that helps to make returning closures in the functions below less verbose.

type Height

type Height = string

Height of the chain is a simple integer.

type System

type System struct {
	Height                     Height `json:"height"`
	GoldTokenSupply            Amount `json:"goldTokenSupply"`
	TotalLockedGoldBalance     Amount `json:"totalLockedGoldBalance"`
	NonVotingLockedGoldBalance Amount `json:"nonVotingLockedGoldBalance"`
	TotalCeloUSDValue          Amount `json:"totalCeloUSDValue"`
}

System stores the supply details of the blockchain at a particular block height

func NewSystem

func NewSystem(blockNumber string) *System

NewSystem is a constructor for System

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL