Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteAvmAssetAggregationState(ctx context.Context, sess *dbr.Session, id uint64) (sql.Result, error)
- func InsertAvmAssetAggregation(ctx context.Context, sess *dbr.Session, avmAggregate AvmAggregate) (sql.Result, error)
- func InsertAvmAssetAggregationCount(ctx context.Context, sess *dbr.Session, avmAggregate AvmAggregateCount) (sql.Result, error)
- func InsertAvmAssetAggregationState(ctx context.Context, sess dbr.SessionRunner, ...) (sql.Result, error)
- func PurgeOldAvmAssetAggregation(ctx context.Context, sess *dbr.Session, time time.Time) (sql.Result, error)
- func SetBech32HRP(networkID uint32)
- func UpdateAvmAssetAggregation(ctx context.Context, sess *dbr.Session, avmAggregate AvmAggregate) (sql.Result, error)
- func UpdateAvmAssetAggregationCount(ctx context.Context, sess *dbr.Session, avmAggregate AvmAggregateCount) (sql.Result, error)
- func UpdateAvmAssetAggregationLiveStateTimestamp(ctx context.Context, sess dbr.SessionRunner, time time.Time) (sql.Result, error)
- func UpdateAvmAssetAggregationState(ctx context.Context, sess *dbr.Session, ...) (sql.Result, error)
- type Address
- type AddressChainInfo
- type AddressChains
- type AddressInfo
- type AddressList
- type Aggregates
- type AggregatesHistogram
- type Asset
- type AssetInfo
- type AssetList
- type AssetTokenCounts
- type AvmAggregate
- type AvmAggregateCount
- type AvmAssetAggregateState
- type Block
- type BlockList
- type BlockType
- type Chain
- type ChainInfo
- type ChainList
- type ControlKey
- type ControlSignature
- type Input
- type InputCredentials
- type ListMetadata
- type Output
- type OutputAddress
- type OutputList
- type OutputType
- type SearchResult
- type SearchResultSet
- type SearchResultType
- type SearchResults
- type StringID
- type StringShortID
- type Subnet
- type SubnetList
- type TokenAmount
- type Transaction
- type TransactionList
- type TransactionType
- type Validator
- type ValidatorList
Constants ¶
const ( StateLiveID = 1 StateBackupID = 2 )
Variables ¶
var ( OutputTypesSECP2556K1Transfer OutputType = 7 OutputTypesSECP2556K1Mint OutputType = 6 OutputTypesNFTMint OutputType = 10 OutputTypesNFTTransfer OutputType = 11 BlockTypeProposal BlockType = 0x0 BlockTypeAbort BlockType = 0x1 BlockTypeCommit BlockType = 0x2 BlockTypeStandard BlockType = 0x3 BlockTypeAtomic BlockType = 0x4 TransactionTypeBase TransactionType = 0x0 TransactionTypeCreateAsset TransactionType = 0x1 TransactionTypeOperation TransactionType = 0x2 TransactionTypeAVMImport TransactionType = 0x3 TransactionTypeAVMExport TransactionType = 0x4 TransactionTypeAddValidator TransactionType = 0xc TransactionTypeAddSubnetValidator TransactionType = 0xd TransactionTypeAddDelegator TransactionType = 0xe TransactionTypeCreateChain TransactionType = 0xf TransactionTypeCreateSubnet TransactionType = 0x10 TransactionTypePVMImport TransactionType = 0x11 TransactionTypePVMExport TransactionType = 0x12 TransactionTypeAdvanceTime TransactionType = 0x13 TransactionTypeRewardValidator TransactionType = 0x14 ResultTypeTransaction SearchResultType = "transaction" ResultTypeAsset SearchResultType = "asset" ResultTypeAddress SearchResultType = "address" ResultTypeOutput SearchResultType = "output" )
Functions ¶
func DeleteAvmAssetAggregationState ¶ added in v1.1.1
func InsertAvmAssetAggregation ¶ added in v1.1.1
func InsertAvmAssetAggregationCount ¶ added in v1.1.1
func InsertAvmAssetAggregationState ¶ added in v1.1.1
func PurgeOldAvmAssetAggregation ¶ added in v1.1.1
func SetBech32HRP ¶
func SetBech32HRP(networkID uint32)
SetBech32HRP sets the package-wide beck32HRP to use for Address marshaling.
func UpdateAvmAssetAggregation ¶ added in v1.1.1
func UpdateAvmAssetAggregationCount ¶ added in v1.1.1
func UpdateAvmAssetAggregationLiveStateTimestamp ¶ added in v1.1.1
func UpdateAvmAssetAggregationState ¶ added in v1.1.1
Types ¶
type Address ¶
type Address StringShortID
Address represents an address; a short ID that is shown to users as bech32.
func (Address) MarshalJSON ¶
MarshalJSON encodes an Address to JSON by converting it to bech32.
func (Address) MarshalString ¶ added in v1.1.1
type AddressChainInfo ¶ added in v1.1.1
type AddressChains ¶ added in v1.1.1
type AddressInfo ¶ added in v1.1.0
type AddressList ¶ added in v1.1.0
type AddressList struct { ListMetadata Addresses []*AddressInfo `json:"addresses"` }
type Aggregates ¶ added in v1.1.0
type Aggregates struct { // Idx is used internally when creating a histogram of Aggregates. // It is exported only so it can be written to by dbr. Idx int `json:"-"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` TransactionVolume TokenAmount `json:"transactionVolume"` TransactionCount uint64 `json:"transactionCount"` AddressCount uint64 `json:"addressCount"` OutputCount uint64 `json:"outputCount"` AssetCount uint64 `json:"assetCount"` }
type AggregatesHistogram ¶ added in v1.1.0
type AggregatesHistogram struct { Aggregates Aggregates `json:"aggregates"` IntervalSize time.Duration `json:"intervalSize,omitempty"` Intervals []Aggregates `json:"intervals,omitempty"` // the calculated start time rounded to the nearest TransactionRoundDuration. StartTime time.Time `json:"startTime"` // the calculated end time rounded to the nearest TransactionRoundDuration. EndTime time.Time `json:"endTime"` }
type Asset ¶ added in v1.1.0
type Asset struct { ID StringID `json:"id"` ChainID StringID `json:"chainID"` Name string `json:"name"` Symbol string `json:"symbol"` Alias string `json:"alias"` Denomination uint8 `json:"denomination"` CurrentSupply TokenAmount `json:"currentSupply"` CreatedAt time.Time `json:"timestamp"` VariableCap uint8 `json:"variableCap"` Score uint64 `json:"-"` }
type AssetInfo ¶ added in v1.1.0
type AssetInfo struct { AssetID StringID `json:"id"` TransactionCount uint64 `json:"transactionCount"` UTXOCount uint64 `json:"utxoCount"` Balance TokenAmount `json:"balance"` TotalReceived TokenAmount `json:"totalReceived"` TotalSent TokenAmount `json:"totalSent"` }
type AssetList ¶ added in v1.1.0
type AssetList struct { ListMetadata Assets []*Asset `json:"assets"` }
type AssetTokenCounts ¶ added in v1.1.0
type AssetTokenCounts map[StringID]TokenAmount
AssetTokenCounts maps asset IDs to a TokenAmount for that asset.
type AvmAggregate ¶ added in v1.1.1
type AvmAggregate struct { AggregateTS time.Time `json:"aggregateTS"` AssetID string `json:"assetId"` TransactionVolume string `json:"transactionVolume"` TransactionCount uint64 `json:"transactionCount"` AddressCount uint64 `json:"addresCount"` AssetCount uint64 `json:"assetCount"` OutputCount uint64 `json:"outputCount"` }
func SelectAvmAssetAggregations ¶ added in v1.1.1
func SelectAvmAssetAggregations(ctx context.Context, sess *dbr.Session) ([]*AvmAggregate, error)
type AvmAggregateCount ¶ added in v1.1.1
type AvmAggregateCount struct { Address string AssetID string TransactionCount uint64 TotalReceived string TotalSent string Balance string UtxoCount uint64 }
func SelectAvmAssetAggregationCounts ¶ added in v1.1.1
func SelectAvmAssetAggregationCounts(ctx context.Context, sess *dbr.Session) ([]*AvmAggregateCount, error)
type AvmAssetAggregateState ¶ added in v1.1.1
type AvmAssetAggregateState struct { ID uint64 `json:"id"` CreatedAt time.Time `json:"createdAt"` CurrentCreatedAt time.Time `json:"currentCreatedAt"` }
func SelectAvmAssetAggregationState ¶ added in v1.1.1
func SelectAvmAssetAggregationState(ctx context.Context, sess dbr.SessionRunner, id uint64) (AvmAssetAggregateState, error)
type BlockList ¶ added in v1.1.0
type BlockList struct { ListMetadata Blocks []*Block `json:"blocks"` }
type ChainInfo ¶
type ChainInfo struct { ID StringID `json:"chainID"` Alias string `json:"chainAlias"` VM string `json:"vm"` AVAXAssetID StringID `json:"avaxAssetID"` NetworkID uint32 `json:"networkID"` }
ChainInfo represents an overview of data about a given chain
type ChainList ¶ added in v1.1.0
type ChainList struct { ListMetadata Chains []*Chain `json:"chains"` }
type ControlKey ¶ added in v1.1.0
type ControlKey struct { Address StringShortID `json:"address"` PublicKey []byte `json:"publicKey"` }
type ControlSignature ¶ added in v1.1.0
type ControlSignature []byte
type Input ¶ added in v1.1.0
type Input struct { Output *Output `json:"output"` Creds []InputCredentials `json:"credentials"` }
type InputCredentials ¶ added in v1.1.0
type ListMetadata ¶ added in v1.1.0
type ListMetadata struct {
Count uint64 `json:"count"`
}
type Output ¶ added in v1.1.0
type Output struct { ID StringID `json:"id"` TransactionID StringID `json:"transactionID"` OutputIndex uint64 `json:"outputIndex"` AssetID StringID `json:"assetID"` OutputType OutputType `json:"outputType"` Amount TokenAmount `json:"amount"` Locktime uint64 `json:"locktime"` Threshold uint64 `json:"threshold"` Addresses []Address `json:"addresses"` CreatedAt time.Time `json:"timestamp"` RedeemingTransactionID StringID `json:"redeemingTransactionID"` Score uint64 `json:"-"` }
type OutputAddress ¶ added in v1.1.0
type OutputList ¶ added in v1.1.0
type OutputList struct { ListMetadata Outputs []*Output `json:"outputs"` }
type OutputType ¶ added in v1.1.0
type OutputType uint32
OutputType represents a sub class of Output.
func (OutputType) String ¶ added in v1.1.0
func (t OutputType) String() string
type SearchResult ¶ added in v1.1.0
type SearchResult struct { // SearchResultType is the type of object found SearchResultType `json:"type"` // Data is the object itself Data interface{} `json:"data"` // Score is a rank of how well this result matches the query Score uint64 `json:"score"` }
SearchResult represents a single item matching a search query.
type SearchResultSet ¶ added in v1.1.0
type SearchResultSet []SearchResult
func (SearchResultSet) Len ¶ added in v1.1.0
func (s SearchResultSet) Len() int
func (SearchResultSet) Less ¶ added in v1.1.0
func (s SearchResultSet) Less(i, j int) bool
func (SearchResultSet) Swap ¶ added in v1.1.0
func (s SearchResultSet) Swap(i, j int)
type SearchResultType ¶ added in v1.1.0
type SearchResultType string
SearchResultType is the type for an object found from a search query.
type SearchResults ¶ added in v1.1.0
type SearchResults struct { // Count is the total number of matching results Count uint64 `json:"count"` // Results is a list of SearchResult Results SearchResultSet `json:"results"` }
SearchResults represents a set of items returned for a search query.
type StringID ¶
type StringID string
StringID represents a 256bit hash encoded as a base58 string.
func ToStringID ¶
ToStringID converts an ids.ID into a StringID.
type StringShortID ¶
type StringShortID string
StringShortID represents a 160bit hash encoded as a base58 string.
func ToShortStringID ¶
func ToShortStringID(id ids.ShortID) StringShortID
ToShortStringID converts an ids.ShortID into a StringShortID.
func (StringShortID) Equals ¶
func (rid StringShortID) Equals(oRID StringShortID) bool
Equals returns true if and only if the two stringShortIDs represent the same ID.
type Subnet ¶ added in v1.1.0
type Subnet struct { ID StringID `json:"id"` Threshold uint64 `json:"threshold"` ControlKeys []ControlKey `json:"controlKeys"` CreatedAt time.Time `json:"createdAt"` }
type SubnetList ¶ added in v1.1.0
type SubnetList struct { ListMetadata Subnets []*Subnet `json:"subnets"` }
type TokenAmount ¶ added in v1.1.0
type TokenAmount string
TokenAmount represents some number of tokens as a string.
func TokenAmountForUint64 ¶ added in v1.1.0
func TokenAmountForUint64(i uint64) TokenAmount
TokenAmountForUint64 returns an TokenAmount for the given uint64.
type Transaction ¶ added in v1.1.0
type Transaction struct { ID StringID `json:"id"` ChainID StringID `json:"chainID"` Type string `json:"type"` Inputs []*Input `json:"inputs"` Outputs []*Output `json:"outputs"` Memo []byte `json:"memo"` InputTotals AssetTokenCounts `json:"inputTotals"` OutputTotals AssetTokenCounts `json:"outputTotals"` ReusedAddressTotals AssetTokenCounts `json:"reusedAddressTotals"` CanonicalSerialization []byte `json:"canonicalSerialization,omitempty"` CreatedAt time.Time `json:"timestamp"` Txfee uint64 `json:"txFee"` Genesis bool `json:"genesis"` Score uint64 `json:"-"` }
type TransactionList ¶ added in v1.1.0
type TransactionList struct { ListMetadata Transactions []*Transaction `json:"transactions"` // the calculated start time rounded to the nearest TransactionRoundDuration. StartTime time.Time `json:"startTime"` // the calculated end time rounded to the nearest TransactionRoundDuration. EndTime time.Time `json:"endTime"` }
type TransactionType ¶ added in v1.1.0
type TransactionType uint16
TransactionType represents a sub class of Transaction.
func (TransactionType) String ¶ added in v1.1.0
func (t TransactionType) String() string
type Validator ¶ added in v1.1.0
type Validator struct { TransactionID StringID `json:"transactionID"` NodeID StringShortID `json:"nodeID"` Weight string `json:"weight"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` Destination StringShortID `json:"destination"` SubnetID StringID `json:"subnetID"` }
type ValidatorList ¶ added in v1.1.0
type ValidatorList struct { ListMetadata Validators []*Validator `json:"validators"` }