Documentation ¶
Overview ¶
Package models defines models used by an algod rest client// IF YOU MODIFY THIS FILE: IMPORTANT In practice, this is straight up copied from /v1/models/model.go. It is duplicated from internal model code, to maintain the internal/external client encapsulation. It does flatten some embedded structs, however. No client should depend on any package in v1.
Index ¶
- type Account
- type AccountList
- type AssetHolding
- type AssetParams
- type Blacklisted
- type Block
- type Bytes
- type MetaData
- type NodeStatus
- type PaymentTransactionType
- type PendingTransactions
- type ReviewTransactionType
- type Supply
- type Transaction
- type TransactionFee
- type TransactionID
- type TransactionList
- type TransactionParams
- type UpgradeState
- type UpgradeVote
- type Version
- type VersionsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { // Round indicates the round for which this information is relevant // // required: true Round uint64 `json:"round"` // Address indicates the account public key // // required: true Address string `json:"address"` // Amount indicates the total number of MicroAlgos in the account // // required: true Amount uint64 `json:"amount"` // Reputation value // required: true Reputation uint64 `json:"reputation"` // Blacklisted indicates the blacklisted data (blacklist feature) // // required: true Blacklisted Blacklisted `json:"blacklisted"` // MetaData indicates the metadata (gender, organization, national origin etc) for this account (metadata feature) // // required: true MetaData MetaData `json:"meta"` // NumberReviews indicates the number of reviews for this account // // required: true NumberReviews uint64 `json:"numreviews"` // LastReviewTime indicates the timestamp of the last review for this account // // required: true LastReviewTime []byte `json:"lastreview"` // PendingRewards specifies the amount of MicroAlgos of pending // rewards in this account. // // required: true PendingRewards uint64 `json:"pendingrewards"` // AmountWithoutPendingRewards specifies the amount of MicroAlgos in // the account, without the pending rewards. // // required: true AmountWithoutPendingRewards uint64 `json:"amountwithoutpendingrewards"` // Rewards indicates the total rewards of MicroAlgos the account has recieved // // required: true Rewards uint64 `json:"rewards"` // Status indicates the delegation status of the account's MicroAlgos // Offline - indicates that the associated account is delegated. // Online - indicates that the associated account used as part of the delegation pool. // NotParticipating - indicates that the associated account is neither a delegator nor a delegate. // // required: true Status string `json:"status"` // AssetParams specifies the parameters of assets created by this account. // // required: false AssetParams map[uint64]AssetParams `json:"thisassettotal,omitempty"` // Assets specifies the holdings of assets by this account, // indexed by the asset ID. // // required: false Assets map[uint64]AssetHolding `json:"assets,omitempty"` }
Account Description swagger:model Account
type AccountList ¶
type AccountList struct { // Accounts is a list of accounts // // required: true Accounts []Account `json:"accounts,omitempty"` // TotalAccts is number of accounts // // required: true TotalAccts uint64 `json:"totalAccts"` }
AccountList contains a list of accounts swagger:model AccountList
type AssetHolding ¶
type AssetHolding struct { // Creator specifies the address that created this asset. // This is the address where the parameters for this asset // can be found, and also the address where unwanted asset // units can be sent in the worst case. // // required: true Creator string `json:"creator"` // Amount specifies the number of units held. // // required: true Amount uint64 `json:"amount"` // Frozen specifies whether this holding is frozen. // // required: false Frozen bool `json:"frozen"` }
AssetHolding specifies the holdings of a particular asset. swagger:model AssetHolding
type AssetParams ¶
type AssetParams struct { // Creator specifies the address that created this asset. // This is the address where the parameters for this asset // can be found, and also the address where unwanted asset // units can be sent in the worst case. // // required: true Creator string `json:"creator"` // Total specifies the total number of units of this asset. // // required: true Total uint64 `json:"total"` // DefaultFrozen specifies whether holdings in this asset // are frozen by default. // // required: false DefaultFrozen bool `json:"defaultfrozen"` // UnitName specifies the name of a unit of this asset, // as supplied by the creator. // // required: false UnitName string `json:"unitname"` // AssetName specifies the name of this asset, // as supplied by the creator. // // required: false AssetName string `json:"assetname"` // ManagerAddr specifies the address used to manage the keys of this // asset and to destroy it. // // required: false ManagerAddr string `json:"managerkey"` // ReserveAddr specifies the address holding reserve (non-minted) // units of this asset. // // required: false ReserveAddr string `json:"reserveaddr"` // FreezeAddr specifies the address used to freeze holdings of // this asset. If empty, freezing is not permitted. // // required: false FreezeAddr string `json:"freezeaddr"` // ClawbackAddr specifies the address used to clawback holdings of // this asset. If empty, clawback is not permitted. // // required: false ClawbackAddr string `json:"clawbackaddr"` }
AssetParams specifies the parameters for an asset. swagger:model AssetParams
type Blacklisted ¶
type Blacklisted struct { // Currently indicates whether this account is blacklisted currently for this round // // required: false Currently uint64 // 0 = false (good guy), 1 = true (bad guy) // BlacklistedRound indicates which round this account is blacklisted until // // required: false BlacklistedRound uint64 // Round // Raw Round // BlacklistedCount indicates the number of times this account has been blacklisted // // required: false BlacklistedCount uint64 }
Stores the blacklist data for an account (blacklist feature)
type Block ¶
type Block struct { // Hash is the current block hash // // required: true Hash string `json:"hash"` // PreviousBlockHash is the previous block hash // // required: true PreviousBlockHash string `json:"previousBlockHash"` // Seed is the sortition seed // // required: true Seed string `json:"seed"` // Proposer is the address of this block proposer // // required: true Proposer string `json:"proposer"` // Round is the current round on which this block was appended to the chain // // required: true Round uint64 `json:"round"` // Period is the period on which the block was confirmed // // required: true Period uint64 `json:"period"` // TransactionsRoot authenticates the set of transactions appearing in the block. // More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. // For the empty block, it's 0. // Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. // Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot. // // required: true TransactionsRoot string `json:"txnRoot"` // RewardsLevel specifies how many rewards, in MicroAlgos, // have been distributed to each config.Protocol.RewardUnit // of MicroAlgos since genesis. RewardsLevel uint64 `json:"reward"` // The number of new MicroAlgos added to the participation stake from rewards at the next round. RewardsRate uint64 `json:"rate"` // The number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits // MicroAlgos for every reward unit in the next round. RewardsResidue uint64 `json:"frac"` // Transactions is the list of transactions in this block Transactions TransactionList `json:"txns"` // TimeStamp in seconds since epoch // // required: true Timestamp int64 `json:"timestamp"` UpgradeState UpgradeVote }
Block contains a block information swagger:model Block
type Bytes ¶
type Bytes = []byte // note that we need to make this its own object to get the strfmt annotation to work properly. Otherwise swagger generates []uint8 instead of type binary
Bytes is a byte array swagger:strfmt binary
type MetaData ¶
type MetaData struct { // ReviewCountPer500Rounds indicates the number of reviews over the last 500 rounds for this account // // required: false ReviewCountPer500Rounds uint64 // Institution indicates the timestamp of the last review for this account // // required: false // swagger:strfmt byte Institution []byte // Organization indicates the timestamp of the last review for this account // // required: false // swagger:strfmt byte Organization []byte // CountryOfOrigin indicates the timestamp of the last review for this account // // required: false // swagger:strfmt byte CountryOfOrigin []byte // GroupAssociation indicates the timestamp of the last review for this account // // required: false // swagger:strfmt byte GroupAssociation []byte // Gender indicates the metadata age of the user for this account // // required: false // swagger:strfmt byte Gender []byte // Age indicates the metadata age of the user for this account // // required: false Age uint64 }
Stores meta data to detect bias (metadata feature)
type NodeStatus ¶
type NodeStatus struct { // LastRound indicates the last round seen // // required: true LastRound uint64 `json:"lastRound"` // LastVersion indicates the last consensus version supported // // required: true LastVersion string `json:"lastConsensusVersion"` // NextVersion of consensus protocol to use // // required: true NextVersion string `json:"nextConsensusVersion"` // NextVersionRound is the round at which the next consensus version will apply // // required: true NextVersionRound uint64 `json:"nextConsensusVersionRound"` // NextVersionSupported indicates whether the next consensus version is supported by this node // // required: true NextVersionSupported bool `json:"nextConsensusVersionSupported"` // TimeSinceLastRound in nanoseconds // // required: true TimeSinceLastRound int64 `json:"timeSinceLastRound"` // CatchupTime in nanoseconds // // required: true CatchupTime int64 `json:"catchupTime"` }
NodeStatus contains the information about a node status swagger:model NodeStatus
type PaymentTransactionType ¶
type PaymentTransactionType struct { // To is the receiver's address // // required: true To string `json:"to"` // CloseRemainderTo is the address the sender closed to // // required: false CloseRemainderTo string `json:"close,omitempty"` // CloseAmount is the amount sent to CloseRemainderTo, for committed transaction // // required: false CloseAmount uint64 `json:"closeamount,omitempty"` // Amount is the amount of MicroAlgos intended to be transferred // // required: true Amount uint64 `json:"amount"` // ToRewards is the amount of pending rewards applied to the To account // as part of this transaction. // // required: false ToRewards uint64 `json:"torewards,omitempty"` // CloseRewards is the amount of pending rewards applied to the CloseRemainderTo // account as part of this transaction. // // required: false CloseRewards uint64 `json:"closerewards,omitempty"` }
PaymentTransactionType contains the additional fields for a payment Transaction swagger:model PaymentTransactionType
type PendingTransactions ¶
type PendingTransactions struct { // TruncatedTxns // required: true TruncatedTxns TransactionList `json:"truncatedTxns"` // TotalTxns // required: true TotalTxns uint64 `json:"totalTxns"` }
PendingTransactions represents a potentially truncated list of transactions currently in the node's transaction pool. swagger:model PendingTransactions
type ReviewTransactionType ¶
type ReviewTransactionType struct { // To is the receiver's address // // required: true To string `json:"to"` // CloseRemainderTo is the address the sender closed to // // required: false CloseRemainderTo string `json:"close,omitempty"` // CloseAmount is the amount sent to CloseRemainderTo, for committed transaction // // required: false CloseAmount uint64 `json:"closeamount,omitempty"` // Amount is the amount of MicroAlgos intended to be transferred // // required: true Amount uint64 `json:"amount"` // ToRewards is the amount of pending rewards applied to the To account // as part of this transaction. // // required: false ToRewards uint64 `json:"torewards,omitempty"` // CloseRewards is the amount of pending rewards applied to the CloseRemainderTo // account as part of this transaction. // // required: false CloseRewards uint64 `json:"closerewards,omitempty"` }
type Supply ¶
type Supply struct { // Round // // required: true Round uint64 `json:"round"` // TotalMoney // // required: true TotalMoney uint64 `json:"totalMoney"` // OnlineMoney // // required: true OnlineMoney uint64 `json:"onlineMoney"` }
Supply represents the current supply of MicroAlgos in the system swagger:model Supply
type Transaction ¶
type Transaction struct { // Type is the transaction type // // required: true Type types.TxType `json:"type"` // TxID is the transaction ID // // required: true TxID string `json:"tx"` // From is the sender's address // // required: true From string `json:"from"` // Fee is the transaction fee // // required: true Fee uint64 `json:"fee"` // FirstRound indicates the first valid round for this transaction // // required: true FirstRound uint64 `json:"first-round"` // LastRound indicates the last valid round for this transaction // // required: true LastRound uint64 `json:"last-round"` // Note is a free form data // // required: false Note Bytes `json:"noteb64,omitempty"` // ReviewNote is a free form data // // required: false ReviewNote Bytes `json:"reviewnoteb64,omitempty"` ReviewRate uint64 `json:"reviewrate,omitempty"` ReviewEval uint64 `json:"revieweval,omitempty"` RepAdjust int64 `json:"repadjust,omitempty"` // ConfirmedRound indicates the block number this transaction appeared in // // required: false ConfirmedRound uint64 `json:"round,omitempty"` // PoolError indicates the transaction was evicted from this node's transaction // pool (if non-empty). A non-empty PoolError does not guarantee that the // transaction will never be committed; other nodes may not have evicted the // transaction and may attempt to commit it in the future. // // required: false PoolError string `json:"poolerror,omitempty"` // This is a list of all supported transactions. // To add another one, create a struct with XXXTransactionType and embed it here. // To prevent extraneous fields, all must have the "omitempty" tag. Payment *PaymentTransactionType `json:"payment,omitempty"` Review *ReviewTransactionType `json:"review,omitempty"` // FromRewards is the amount of pending rewards applied to the From // account as part of this transaction. // // required: false FromRewards uint64 `json:"fromrewards,omitempty"` // Genesis ID // // required: true GenesisID string `json:"genesisID"` // Genesis hash // // required: true GenesisHash Bytes `json:"genesishashb64"` }
Transaction contains all fields common to all transactions and serves as an envelope to all transactions type swagger:model Transaction
type TransactionFee ¶
type TransactionFee struct { // Fee is transaction fee // Fee is in units of micro-Algos per byte. // Fee may fall to zero but transactions must still have a fee of // at least MinTxnFee for the current network protocol. // // required: true Fee uint64 `json:"fee"` }
TransactionFee contains the suggested fee swagger:model TransactionFee
type TransactionID ¶
type TransactionID struct { // TxId is the string encoding of the transaction hash // // required: true TxID string `json:"txId"` }
TransactionID Description swagger:model transactionID
type TransactionList ¶
type TransactionList struct { // TransactionList is a list of transactions // // required: true Transactions []Transaction `json:"transactions,omitempty"` }
TransactionList contains a list of transactions swagger:model TransactionList
type TransactionParams ¶
type TransactionParams struct { // Fee is the suggested transaction fee // Fee is in units of micro-Algos per byte. // Fee may fall to zero but transactions must still have a fee of // at least MinTxnFee for the current network protocol. // // required: true Fee uint64 `json:"fee"` // Genesis ID // // required: true GenesisID string `json:"genesisID"` // Genesis hash // // required: true GenesisHash Bytes `json:"genesishashb64"` // LastRound indicates the last round seen // // required: true LastRound uint64 `json:"lastRound"` // ConsensusVersion indicates the consensus protocol version // as of LastRound. // // required: true ConsensusVersion string `json:"consensusVersion"` }
TransactionParams contains the parameters that help a client construct a new transaction. swagger:model TransactionParams
type UpgradeState ¶
type UpgradeState struct { // CurrentProtocol is a string that represents the current protocol // // required: true CurrentProtocol string `json:"currentProtocol"` // NextProtocol is a string that represents the next proposed protocol // // required: true NextProtocol string `json:"nextProtocol"` // NextProtocolApprovals is the number of blocks which approved the protocol upgrade // // required: true NextProtocolApprovals uint64 `json:"nextProtocolApprovals"` // NextProtocolVoteBefore is the deadline round for this protocol upgrade (No votes will be consider after this round) // // required: true NextProtocolVoteBefore uint64 `json:"nextProtocolVoteBefore"` // NextProtocolSwitchOn is the round on which the protocol upgrade will take effect // // required: true NextProtocolSwitchOn uint64 `json:"nextProtocolSwitchOn"` }
UpgradeState contains the information about a current state of an upgrade swagger:model UpgradeState
type UpgradeVote ¶
type UpgradeVote struct { // UpgradePropose indicates a proposed upgrade // // required: true UpgradePropose string `json:"upgradePropose"` // UpgradeApprove indicates a yes vote for the current proposal // // required: true UpgradeApprove bool `json:"upgradeApprove"` }
UpgradeVote represents the vote of the block proposer with respect to protocol upgrades. swagger:model UpgradeVote
type Version ¶
type Version struct { // required: true Versions []string `json:"versions"` // required: true GenesisID string `json:"genesis_id"` // required: true GenesisHash Bytes `json:"genesis_hash_b64"` }
Version contains the current algod version.
Note that we annotate this as a model so that legacy clients can directly import a swagger generated Version model. swagger:model Version
type VersionsResponse ¶
type VersionsResponse struct { // in: body Body Version }
VersionsResponse is the response to 'GET /versions'
swagger:response VersionsResponse