Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- type Asset
- type Block
- type Chain
- type Credential
- type Delegation
- type DelegatorSeq
- type Event
- type EvmLog
- type EvmReceipt
- type EvmTrace
- type NetworkMetric
- type NetworkStat
- type Output
- type RawMessage
- type RawMessageTopic
- type Reward
- type RewardsOwner
- type RewardsOwnerAddress
- type RewardsOwnerOutput
- type SyncStatus
- type Transaction
- type TransactionInput
- type TransactionTypeCount
- type Validator
- type ValidatorReward
- type ValidatorSeq
- type ValidatorStat
Constants ¶
View Source
const ( // Asset types AssetTypeFixed = "fixed_cap" AssetTypeVariable = "variable_cap" AssetTypeNFT = "nft" // PVM block types BlockTypeProposal = "proposal" BlockTypeStandard = "standard" BlockTypeAtomic = "atomic" BlockTypeCommit = "commit" BlockTypeAbort = "abort" BlockTypeEvm = "evm" // Transaction statuses TxStatusAccepted = "accepted" TxStatusRejected = "rejected" TxStatusReverted = "reverted" // PVM transaction types TxTypeCreateChain = "p_create_chain" TxTypeCreateSubnet = "p_create_subnet" TxTypeAddSubnetValidator = "p_add_subnet_validator" TxTypeAdvanceTime = "p_advance_time" TxTypeRewardValidator = "p_reward_validator" TxTypeAddValidator = "p_add_validator" TxTypeAddDelegator = "p_add_delegator" TxTypePImport = "p_import" TxTypePExport = "p_export" // AVM transaction types TxTypeBase = "x_base" TxTypeXImport = "x_import" TxTypeXExport = "x_export" TxTypeCreateAsset = "x_create_asset" TxTypeOperation = "x_operation" // EMV transaction types TxTypeAtomicExport = "c_atomic_export" TxTypeAtomicImport = "c_atomic_import" TxTypeEvm = "c_evm" // Output types OutTypeTransfer = "transfer" OutTypeStakeableLock = "stakeable_lock" OutTypeReward = "reward" OutTypeMint = "mint" OutTypeNftMint = "nft_mint" OutTypeNftTransfer = "nft_transfer" // Reward types RewardTypeValidator = "validator" RewardTypeDelegator = "delegator" // Event scopes EventScopeStaking = "staking" EventScopeRewards = "rewards" EventScopeNetwork = "network" // Event Item Types EventItemTypeValidator = "validator" EventItemTypeDelegator = "delegator" // Event types EventTypeValidatorAdded = "validator_added" EventTypeValidatorFinished = "validator_finished" EventTypeValidatorCommissionChanged = "validator_commission_changed" EventTypeDelegatorAdded = "delegator_added" EventTypeDelegatorFinished = "delegator_finished" EventTypeSubnetValidatorAdded = "subnet_validator_added" )
Variables ¶
View Source
var ( TransactionTypes = []string{ TxTypeCreateChain, TxTypeCreateSubnet, TxTypeAddSubnetValidator, TxTypeAdvanceTime, TxTypeRewardValidator, TxTypeAddValidator, TxTypeAddDelegator, TxTypePImport, TxTypePExport, TxTypeBase, TxTypeXImport, TxTypeXExport, TxTypeCreateAsset, TxTypeOperation, TxTypeAtomicExport, TxTypeAtomicImport, TxTypeEvm, } )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { ID int `json:"id"` Chain string `json:"chain"` Value string `json:"value"` Balance uint64 `json:"balance"` UnlockedBalance uint64 `json:"unlocked_balance"` LockedStakeable uint64 `json:"locked_stakeable"` LockedNotStakeable uint64 `json:"locked_not_stakeable"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type Asset ¶ added in v0.3.0
type Block ¶ added in v0.3.0
type Chain ¶ added in v0.3.0
type Credential ¶ added in v0.3.0
type Delegation ¶
type Delegation struct { ID int `json:"-"` ReferenceID string `json:"id"` NodeID string `json:"node_id"` StakeAmount types.Amount `json:"stake_amount"` PotentialReward types.Amount `json:"potential_reward"` RewardAddress string `json:"reward_address"` Active bool `json:"active"` ActiveStartTime time.Time `json:"active_start_time"` ActiveEndTime time.Time `json:"active_end_time"` FirstHeight int64 `json:"first_height"` LastHeight int64 `json:"last_height"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (Delegation) TableName ¶
func (Delegation) TableName() string
type DelegatorSeq ¶
type DelegatorSeq struct { ID int NodeID string StakeAmount int64 PotentialReward int64 ActiveStartTime time.Time ActiveEndTime time.Time CreatedAt time.Time }
func (DelegatorSeq) TableName ¶
func (DelegatorSeq) TableName() string
type Event ¶
type Event struct { ID string `json:"id"` Type string `json:"type"` Scope string `json:"scope,omitempty"` Chain string `json:"chain,omitempty"` BlockHash string `json:"block"` BlockHeight uint64 `json:"block_height"` TxHash string `json:"tx_hash"` ItemID string `json:"item_id"` ItemType string `json:"item_type"` Timestamp time.Time `json:"timestamp"` Data types.Map `json:"data,omitempty" gorm:"type:text"` }
type EvmReceipt ¶ added in v0.6.0
type EvmReceipt struct { ID string `json:"id"` Type int `json:"type"` Status int `json:"status"` ContractAddress string `json:"contract_address"` Logs string `json:"-"` }
func (EvmReceipt) TableName ¶ added in v0.6.0
func (EvmReceipt) TableName() string
type EvmTrace ¶ added in v0.6.0
type NetworkMetric ¶
type NetworkMetric struct { ID int `json:"-"` Time time.Time `json:"time"` Height int64 `json:"height"` PeersCount int `json:"peers_count"` BlockchainsCount int `json:"blockchains_count"` ActiveValidatorsCount int `json:"active_validators_count"` PendingValidatorsCount int `json:"pending_validators_count"` ActiveDelegationsCount int `json:"active_delegations_count"` PendingDelegationsCount int `json:"pending_delegations_count"` MinValidatorStake int64 `json:"min_validator_stake"` MinDelegationStake int64 `json:"min_delegation_stake"` TxFee int `json:"tx_fee"` CreationTxFee int `json:"creation_tx_fee"` Uptime float64 `json:"uptime"` DelegationFee float64 `json:"delegation_fee"` TotalStaked types.Amount `json:"total_staked"` TotalDelegated types.Amount `json:"total_delegated"` }
func (NetworkMetric) TableName ¶
func (NetworkMetric) TableName() string
type NetworkStat ¶
type NetworkStat struct { ID int `json:"-"` Time time.Time `json:"time"` Bucket string `json:"bucket"` HeightChange int `json:"height_change"` Peers int `json:"peers"` Blockchains int `json:"blockchains"` ActiveValidators int `json:"active_validators"` PendingValidators int `json:"pending_validators"` ValidatorUptime float64 `json:"validator_uptime"` ActiveDelegations int `json:"active_delegations"` PendingDelegations int `json:"pending_delegations"` MinValidatorStake int64 `json:"min_validator_stake"` MinDelegationStake int64 `json:"min_delegator_stake"` TxFee int64 `json:"tx_fee"` CreateTxFee int64 `json:"create_tx_fee"` TotalStaked types.Amount `json:"total_staked"` TotalDelegated types.Amount `json:"total_delegated"` }
func (NetworkStat) TableName ¶
func (NetworkStat) TableName() string
type Output ¶ added in v0.3.0
type Output struct { ID string `json:"id"` TxID string `json:"tx_id"` Chain string `json:"chain"` Asset string `json:"asset"` Type string `json:"type"` Index uint64 `json:"index"` Locktime uint64 `json:"locktime"` Threshold uint32 `json:"threshold"` Amount uint64 `json:"amount"` Group uint32 `json:"group"` Addresses pq.StringArray `json:"addresses" gorm:"type:text[]"` Stake bool `json:"stake"` Reward bool `json:"reward"` Spent bool `json:"spent"` SpentTxID *string `json:"spent_in_tx"` Payload *string `json:"payload,omitempty"` }
type RawMessage ¶ added in v0.3.0
type RawMessage struct { ID int `json:"id"` TopicID int `json:"topic_id"` IndexID int `json:"index_id"` Data string `json:"data"` Hash string `json:"hash"` CreatedAt time.Time `json:"created_at"` ProcessedAt *time.Time `json:"-"` }
func (RawMessage) DataBytes ¶ added in v0.3.0
func (msg RawMessage) DataBytes() ([]byte, error)
type RawMessageTopic ¶ added in v0.3.0
type RewardsOwner ¶ added in v0.3.0
type RewardsOwner struct { ID string `json:"id"` Locktime uint64 `json:"locktime"` Threshold uint32 `json:"threshold"` Addresses []RewardsOwnerAddress `json:"-" gorm:"-"` Outputs []RewardsOwnerOutput `json:"-" gorm:"-"` }
type RewardsOwnerAddress ¶ added in v0.3.0
type RewardsOwnerOutput ¶ added in v0.3.0
type SyncStatus ¶ added in v0.3.0
type SyncStatus struct { ID string `json:"id"` IndexID int64 `json:"index_id"` IndexTime time.Time `json:"index_time"` TipID int64 `json:"tip_id"` TipTime time.Time `json:"tip_time"` }
func (SyncStatus) AtTip ¶ added in v0.3.0
func (s SyncStatus) AtTip() bool
func (SyncStatus) Lag ¶ added in v0.3.0
func (s SyncStatus) Lag() int64
func (SyncStatus) NextID ¶ added in v0.3.0
func (s SyncStatus) NextID() int64
func (SyncStatus) TableName ¶ added in v0.3.0
func (SyncStatus) TableName() string
type Transaction ¶ added in v0.3.0
type Transaction struct { ID string `json:"id"` ReferenceTxID *string `json:"reference_tx_id,omitempty"` Chain string `json:"chain"` Type string `json:"type"` Block *string `json:"block,omitempty"` BlockHeight *uint64 `json:"block_height,omitempty"` Timestamp time.Time `json:"timestamp"` Status string `json:"status,omitempty"` Memo *string `json:"memo,omitempty"` MemoText *string `json:"memo_text,omitempty"` Nonce *uint64 `json:"nonce,omitempty"` Fee uint64 `json:"fee"` SourceChain *string `json:"source_chain,omitempty"` DestinationChain *string `json:"destination_chain,omitempty"` Metadata types.Map `json:"metadata,omitempty" gorm:"type:text"` Inputs []Output `json:"inputs,omitempty" sql:"-" gorm:"-"` InputAmounts map[string]uint64 `json:"input_amounts,omitempty" sql:"-" gorm:"-"` Outputs []Output `json:"outputs,omitempty" sql:"-" gorm:"-"` OutputAmounts map[string]uint64 `json:"output_amounts,omitempty" sql:"-" gorm:"-"` }
func (*Transaction) SetRawMemo ¶ added in v0.3.0
func (tx *Transaction) SetRawMemo(data []byte)
func (*Transaction) SetReferenceID ¶ added in v0.3.0
func (tx *Transaction) SetReferenceID(value string)
func (Transaction) TableName ¶ added in v0.3.0
func (Transaction) TableName() string
func (*Transaction) UpdateAmounts ¶ added in v0.3.0
func (tx *Transaction) UpdateAmounts()
func (*Transaction) UsesUTXOs ¶ added in v0.3.0
func (tx *Transaction) UsesUTXOs() bool
type TransactionInput ¶ added in v0.3.0
func (TransactionInput) TableName ¶ added in v0.3.0
func (TransactionInput) TableName() string
type TransactionTypeCount ¶ added in v0.3.0
type Validator ¶
type Validator struct { ID int `json:"-"` NodeID string `json:"node_id"` StakeAmount types.Amount `json:"stake_amount"` StakePercent float64 `json:"stake_percent"` PotentialReward types.Amount `json:"potential_reward"` RewardAddress string `json:"reward_address"` Active bool `json:"active"` ActiveStartTime time.Time `json:"active_start_time"` ActiveEndTime time.Time `json:"active_end_time"` ActiveProgressPercent float64 `json:"active_progress_percent"` Uptime float64 `json:"uptime"` DelegationsCount int `json:"delegations_count"` DelegationsPercent float64 `json:"delegations_percent"` DelegatedAmount types.Amount `json:"delegated_amount"` DelegatedAmountPercent float64 `json:"delegated_amount_percent"` DelegationFee float64 `json:"delegation_fee"` Capacity types.Amount `json:"capacity"` CapacityPercent float64 `json:"capacity_percent"` FirstHeight int64 `json:"first_height"` LastHeight int64 `json:"last_height"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type ValidatorReward ¶ added in v0.3.0
type ValidatorSeq ¶
type ValidatorSeq struct { ID int Time time.Time Height int64 NodeID string StakeAmount types.Amount StakePercent float64 PotentialReward types.Amount RewardAddress string Active bool ActiveStartTime time.Time ActiveEndTime time.Time ActiveProgressPercent float64 DelegationsCount int DelegationsPercent float64 DelegatedAmount types.Amount DelegatedAmountPercent float64 DelegationFee float64 Uptime float64 }
func (ValidatorSeq) TableName ¶
func (ValidatorSeq) TableName() string
type ValidatorStat ¶
type ValidatorStat struct { ID int `json:"-"` Time time.Time `json:"time"` Bucket string `json:"bucket"` NodeID string `json:"-"` UptimeMin float64 `json:"uptime_min"` UptimeMax float64 `json:"uptime_max"` UptimeAvg float64 `json:"uptime_avg"` StakeAmount int64 `json:"stake_amount"` StakePercent float64 `json:"stake_percent"` DelegationsCount int `json:"delegations_count"` DelegationsPercent float64 `json:"delegations_percent"` DelegatedAmount int64 `json:"delegated_amount"` DelegatedAmountPercent float64 `json:"delegated_amount_percent"` }
func (ValidatorStat) TableName ¶
func (ValidatorStat) TableName() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.