Documentation
¶
Index ¶
- func GetCandidateList(epochNum uint64) (*iotextypes.CandidateListV2, error)
- func GetProbationListByEpoch(epochNum uint64) (*iotextypes.ProbationCandidateList, error)
- func LoadAccountContractFlags(addrs []string) (map[string]bool, error)
- type AccountActionCountType
- type AccountMeta
- type AccountReward
- type ActionType
- type AirdripAddAsset
- type AirdripClaim
- type AirdripDrip
- type AirdripExchange
- type AirdripRedemption
- type AirdripRegistration
- type AirdripTerm
- type Authorization
- type Block
- type BlockAction
- type BlockActionPartition
- type BlockFooter
- type BlockMeta
- type BlockMetaV2
- type BlockReceipt
- type BlockReceiptLog
- type BlockReceiptTransaction
- type BlockReward
- type BlockSupply
- type Candidate
- func (m *Candidate) FetchByCandidateIDWithHeight(candidateID string, height uint64, tx *gorm.DB) error
- func (m *Candidate) FetchByName(name string) (*Candidate, error)
- func (m *Candidate) FetchByNameWithHeight(name string, height uint64) error
- func (m *Candidate) FetchByOperatorAddressWithHeight(operator string, height uint64, tx *gorm.DB) error
- func (m *Candidate) FetchByOwnerAddressWithHeight(owner string, height uint64, tx *gorm.DB) error
- func (m *Candidate) FetchByOwnerOrOperatorWithHeight(addr string, height uint64, tx *gorm.DB) error
- func (Candidate) TableName() string
- type CandidateExitQueue
- type CandidateList
- type CandidateSelfStake
- type Candidates
- type Delegate
- type DelegateRecord
- type DelegateRewardConfig
- type DelegateRewards
- type Erc20Approval
- type Erc20Holder
- type Erc20Meta
- type Erc20Transfer
- type Erc721Approval
- type Erc721ApprovalForAll
- type Erc721Holder
- type Erc721Transfer
- type Erc1155ApprovalForAll
- type Erc1155TransferBatch
- type Erc1155TransferSingle
- type Erc1155URI
- type Erc1967Proxy
- type Erc1155721Holder
- type Erc1155721Meta
- type HermesAccountReward
- type HermesAggregateVoting
- type HermesBucketVoting
- type HermesDistribute
- type HermesVotingMeta
- type HermesVotingResult
- type IllegalAction
- type Inscription
- type InscriptionHolder
- type InscriptionRaw
- type InscriptionToken
- type InscriptionTokenHolder
- type InscriptionTokenTransaction
- type InscriptionTransfer
- type Probation
- type RewardHistory
- type Slash
- type StakingActions
- type StakingActionsShadow
- type StakingBucket
- type StakingBucketShadow
- type SystemStakingBucketRecord
- type SystemStakingBucketRecordBase
- type SystemStakingBucketV2Record
- type SystemStakingBucketV3Record
- type VoterRewardDestination
- type VoterRewardDistribution
- type VoterRewardEra
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCandidateList ¶ added in v1.4.0
func GetCandidateList(epochNum uint64) (*iotextypes.CandidateListV2, error)
func GetProbationListByEpoch ¶ added in v1.4.0
func GetProbationListByEpoch(epochNum uint64) (*iotextypes.ProbationCandidateList, error)
GetProbationListByEpoch returns the probation list of an epoch.
Types ¶
type AccountActionCountType ¶ added in v1.4.2
type AccountActionCountType int
const ( AccountActionCountErc20 AccountActionCountType = iota AccountActionCountErc721 AccountActionCountAction AccountActionCountInner )
func (AccountActionCountType) String ¶ added in v1.4.2
func (self AccountActionCountType) String() string
type AccountMeta ¶ added in v1.4.0
type AccountMeta struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
Address string `gorm:"size:42;not null;default:'';uniqueIndex"`
IsContract bool `gorm:"type:bool;not null;default:false"`
ContractByteCode []byte
}
func (*AccountMeta) ByAddress ¶ added in v1.4.0
func (m *AccountMeta) ByAddress(addr string) error
func (AccountMeta) TableName ¶ added in v1.4.0
func (AccountMeta) TableName() string
type AccountReward ¶ added in v1.4.0
type AccountReward struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
CandidateName string `gorm:"size:42;index;not null"`
BlockReward decimal.Decimal `gorm:"type:decimal(60,0);not null"`
EpochReward decimal.Decimal `gorm:"type:decimal(60,0);not null"`
FoundationBonus decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (AccountReward) TableName ¶ added in v1.4.0
func (AccountReward) TableName() string
type ActionType ¶ added in v1.15.1
type ActionType struct {
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
Hash string `gorm:"primary_key;size:64;not null;index:,type:hash"`
Type uint `gorm:"type:int4;unsigned;not null;default:0"`
// accesslist tx
AccessList datatypes.JSON `gorm:"type:jsonb"`
// dynamic fee tx
GasTipCap decimal.Decimal `gorm:"type:decimal(42,0)"`
GasFeeCap decimal.Decimal `gorm:"type:decimal(42,0)"`
// blob tx
BlobGas uint64 `gorm:"type:int8;unsigned"`
BlobFeeCap decimal.Decimal `gorm:"type:decimal(42,0)"`
BlobHashes pq.StringArray `gorm:"type:text[]"`
BlobGasPrice decimal.Decimal `gorm:"type:decimal(42,0)"`
// setcode tx (EIP-7702)
AuthList datatypes.JSON `gorm:"type:jsonb"`
}
func (ActionType) TableName ¶ added in v1.15.1
func (ActionType) TableName() string
type AirdripAddAsset ¶ added in v1.3.1
type AirdripAddAsset struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
Provider string `gorm:"size:42;index"`
Asset string `gorm:"size:42;index"`
Amount decimal.Decimal `gorm:"type:decimal(60,0);not null"`
EndBlock uint64 `gorm:"unsigned;index"`
Konstante uint64 `gorm:"unsigned"`
}
func (AirdripAddAsset) TableName ¶ added in v1.3.1
func (AirdripAddAsset) TableName() string
type AirdripClaim ¶ added in v1.3.1
type AirdripClaim struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
User string `gorm:"size:42;not null"`
Amount decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (AirdripClaim) TableName ¶ added in v1.3.1
func (AirdripClaim) TableName() string
type AirdripDrip ¶ added in v1.3.1
type AirdripDrip struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
Asset string `gorm:"size:42;index"`
Volume decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (AirdripDrip) TableName ¶ added in v1.3.1
func (AirdripDrip) TableName() string
type AirdripExchange ¶ added in v1.3.1
type AirdripExchange struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
User string `gorm:"size:42;index;not null"`
Amount decimal.Decimal `gorm:"type:decimal(60,0);not null"`
Rate uint64 `gorm:"unsigned"`
}
func (AirdripExchange) TableName ¶ added in v1.3.1
func (AirdripExchange) TableName() string
type AirdripRedemption ¶ added in v1.3.1
type AirdripRedemption struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
User string `gorm:"size:42;index"`
Asset string `gorm:"size:42;index"`
Amount decimal.Decimal `gorm:"type:decimal(60,0);not null"`
Points decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (AirdripRedemption) TableName ¶ added in v1.3.1
func (AirdripRedemption) TableName() string
type AirdripRegistration ¶ added in v1.3.1
type AirdripRegistration struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
User string `gorm:"size:42;not null"`
ExpireAt uint64 `gorm:"unsigned;index" sql:"type:bigint"`
}
func (AirdripRegistration) TableName ¶ added in v1.3.1
func (AirdripRegistration) TableName() string
type AirdripTerm ¶ added in v1.3.1
type AirdripTerm struct {
ID uint64 `gorm:"primary_key"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
Number uint64 `gorm:"unsigned;index" sql:"type:bigint"`
Height uint64 `gorm:"unsigned;index" sql:"type:bigint"`
}
func (AirdripTerm) TableName ¶ added in v1.3.1
func (AirdripTerm) TableName() string
type Authorization ¶ added in v1.18.2
type Authorization struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;uniqueIndex:idx_authorization_action_hash_index,priority:1"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
Index int `gorm:"type:int4;not null;default:0;uniqueIndex:idx_authorization_action_hash_index,priority:2"`
ChainID string `gorm:"size:66;not null;default:''"`
Address string `gorm:"size:42;not null;default:'';index:,type:hash"` // delegate contract
Nonce string `gorm:"size:66;not null;default:''"`
YParity string `gorm:"size:66;not null;default:''"`
R string `gorm:"size:66;not null;default:''"`
S string `gorm:"size:66;not null;default:''"`
Authority string `gorm:"size:42;not null;default:'';index:,type:hash"` // recovered signer
// Valid is populated by kernel.ComputeAuthorizationValidity at index/backfill
// time. nil means "not yet evaluated" (e.g. archive RPC was unavailable).
Valid *bool `gorm:"default:null"`
}
Authorization stores one entry from an EIP-7702 SetCodeTx's auth list. (ActionHash, Index) is the natural composite unique key — Index is the position within the tx's auth list — and is enforced via uniqueIndex so idempotent backfills (clause.OnConflict{...DoNothing:true}) actually work.
func (Authorization) TableName ¶ added in v1.18.2
func (Authorization) TableName() string
type Block ¶ added in v1.3.1
type Block struct {
BlockHeight uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHash string `gorm:"size:64;not null;uniqueIndex"`
ProducerAddress string `gorm:"size:42;not null;index:,length:9"`
NumActions int `gorm:"type:int2;unsigned;not null;default:0"`
Timestamp time.Time `gorm:"type:timestamp;index:,expression:(timestamp::date)"`
Year int `gorm:"type:int2; unsigned;not null;default:0;index:idx_ymd"`
Month int `gorm:"type:int2; unsigned;not null;default:0;index:idx_ymd"`
Day int `gorm:"type:int2; unsigned;not null;default:0;index:idx_ymd"`
}
type BlockAction ¶
type BlockAction struct {
ID uint64 `gorm:"primary_key;index:idx_r_at_id,priority:3;" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,type:hash"`
ActionType string `` /* 149-byte string literal not displayed */
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
Sender string `gorm:"size:42;not null;default:'';index:,type:hash;index:idx_s_at,priority:1;"`
Recipient string `gorm:"size:42;not null;default:'';index:,type:hash;index:idx_r_at,priority:1;index:idx_r_at_id,priority:1;"`
GasPrice decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
GasLimit uint64 `gorm:"type:int4;unsigned;not null;default:0"`
Nonce uint64 `gorm:"type:int8;unsigned;not null;default:0"`
Amount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
GasConsumed uint64 `gorm:"type:int4;unsigned;not null;default:0"`
ChainID uint32 `gorm:"type:int4;unsigned;not null;default:0"`
Encoding uint32 `gorm:"type:int4;unsigned;not null;default:0"`
Version uint32 `gorm:"type:int4;unsigned;not null;default:0"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,type:hash;index:idx_ca_at,priority:1;"`
Status uint64 `gorm:"type:int2;unsigned;not null;default:0"`
ExecutionRevertMsg string `gorm:"size:255;not null;default:''"`
Payload []byte
Timestamp time.Time `gorm:"type:timestamp;index:,expression:(timestamp::date)"`
}
func (BlockAction) TableName ¶
func (BlockAction) TableName() string
type BlockActionPartition ¶ added in v1.17.42
type BlockActionPartition struct {
ID uint64 `gorm:"column:id" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null"`
ActionType string `gorm:"size:32;not null"`
BlockHeight uint64 `gorm:"unsigned" sql:"type:bigint"`
Sender string `gorm:"size:42;not null;default:''"`
Recipient string `gorm:"size:42;not null;default:''"`
GasPrice decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
GasLimit uint64 `gorm:"type:int4;unsigned;not null;default:0"`
Nonce uint64 `gorm:"type:int8;unsigned;not null;default:0"`
Amount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
GasConsumed uint64 `gorm:"type:int4;unsigned;not null;default:0"`
ChainID uint32 `gorm:"type:int4;unsigned;not null;default:0"`
Encoding uint32 `gorm:"type:int4;unsigned;not null;default:0"`
Version uint32 `gorm:"type:int4;unsigned;not null;default:0"`
ContractAddress string `gorm:"size:42;not null;default:''"`
Status uint64 `gorm:"type:int2;unsigned;not null;default:0"`
ExecutionRevertMsg string `gorm:"size:255;not null;default:''"`
Payload []byte
Timestamp time.Time `gorm:"type:timestamp"`
}
BlockActionPartition is a standalone model for the partitioned table. It intentionally avoids index tags that are unsuitable for partitioned parents.
func (BlockActionPartition) TableName ¶ added in v1.17.42
func (BlockActionPartition) TableName() string
type BlockFooter ¶ added in v1.6.10
type BlockFooter struct {
}
func (BlockFooter) TableName ¶ added in v1.6.10
func (BlockFooter) TableName() string
type BlockMeta ¶ added in v1.3.1
type BlockMeta struct {
BlockHeight uint64 `gorm:"primary_key;" sql:"type:bigint;"`
GasConsumed uint64 `gorm:"type:int4;unsigned;not null;default:0"`
ProducerName string `gorm:"size:42;not null;default:'';"`
ProducerAddress string `gorm:"size:42;not null;default:'';"`
ExpectedProducerName string `gorm:"size:42;not null;default:'';"`
ExpectedProducerAddress string `gorm:"size:42;not null;default:'';"`
BlockReward decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
EpochReward decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
FoundationBonus decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
PriorityBonus decimal.Decimal `gorm:"type:decimal(42,0);"`
EpochNum uint64 `gorm:"unsigned;index"`
EpochHeight uint64 `gorm:"unsigned;index"`
BlockSize uint64 `gorm:"unsigned;not null;default:0;"`
BaseFee decimal.Decimal `gorm:"type:decimal(42,0);"`
BlobGasUsed uint64 `gorm:"type:int8;unsigned;"`
ExcessBlobGas uint64 `gorm:"type:int8;unsigned;"`
}
type BlockMetaV2 ¶ added in v1.8.59
type BlockMetaV2 struct {
BlockHeight uint64 `gorm:"primary_key;" sql:"type:bigint;"`
GasConsumed uint64 `gorm:"type:int4;unsigned;not null;default:0"`
ProducerName string `gorm:"size:42;not null;default:'';"`
ProducerAddress string `gorm:"size:42;not null;default:'';"` //store owner_address, because operator_address may be changed
ExpectedProducerName string `gorm:"size:42;not null;default:'';"`
ExpectedProducerAddress string `gorm:"size:42;not null;default:'';"`
BlockReward decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
EpochReward decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
FoundationBonus decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
EpochNum uint64 `gorm:"unsigned;index"`
EpochHeight uint64 `gorm:"unsigned;index"`
BlockSize uint64 `gorm:"unsigned;not null;default:0;"`
}
func (BlockMetaV2) TableName ¶ added in v1.8.59
func (BlockMetaV2) TableName() string
type BlockReceipt ¶ added in v1.4.0
type BlockReceipt struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
GasConsumed uint64 `gorm:"type:int4;unsigned;not null;default:0"`
ContractAddress string `gorm:"size:42;not null;default:'';"`
Status uint64 `gorm:"type:int2;unsigned;not null;default:0"`
ExecutionRevertMsg string `gorm:"size:255;not null;default:''"`
}
func (BlockReceipt) TableName ¶ added in v1.4.0
func (BlockReceipt) TableName() string
type BlockReceiptLog ¶ added in v1.4.0
type BlockReceiptLog struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
Address string `gorm:"size:64;not null;default:'';index:,length:9"`
Topic0 string `gorm:"size:64;not null;default:'';index:,length:9"`
Topic1 string `gorm:"size:64;not null;default:'';index:,length:9"`
Topic2 string `gorm:"size:64;not null;default:'';index:,length:9"`
Topic3 string `gorm:"size:64;not null;default:'';index:,length:9"`
Data []byte `gorm:"not null;"`
Index uint `gorm:"type:int2;unsigned;not null;default:0"`
TxIndex uint `gorm:"type:int2;unsigned;not null;default:0"`
NotFixTopicCopyBug bool `gorm:"type:bool;not null;default:false"`
}
func (BlockReceiptLog) TableName ¶ added in v1.4.0
func (BlockReceiptLog) TableName() string
type BlockReceiptTransaction ¶ added in v1.4.0
type BlockReceiptTransaction struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
Type string `gorm:"size:32;not null;default:'';"`
Amount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
}
func (BlockReceiptTransaction) TableName ¶ added in v1.4.0
func (BlockReceiptTransaction) TableName() string
type BlockReward ¶ added in v1.4.0
type BlockReward struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
RewardAddress string `gorm:"size:42;index;not null"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
CandidateName string `gorm:"size:42;index;not null"`
BlockReward decimal.Decimal `gorm:"type:decimal(60,0);not null"`
EpochReward decimal.Decimal `gorm:"type:decimal(60,0);not null"`
FoundationBonus decimal.Decimal `gorm:"type:decimal(60,0);not null"`
PriorityBonus decimal.Decimal `gorm:"type:decimal(60,0)"`
}
func (BlockReward) TableName ¶ added in v1.4.0
func (BlockReward) TableName() string
type BlockSupply ¶ added in v1.6.0
type BlockSupply struct {
BlockHeight uint64 `gorm:"primary_key;" sql:"type:bigint;"`
TotalSupply string
TotalCirculatingSupply string
}
func (BlockSupply) TableName ¶ added in v1.6.0
func (BlockSupply) TableName() string
type Candidate ¶
type Candidate struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
Name string `gorm:"size:42;not null;default:'';index"`
OperatorAddress string `gorm:"size:42;not null;default:'';"`
RewardAddress string `gorm:"size:42;not null;default:'';"`
OwnerAddress string `gorm:"size:42;not null;default:'';"`
CandidateID string `gorm:"size:42;not null;default:'';"`
Amount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
Duration uint32 `gorm:"not null;" sql:"type:bigint"`
ActType string
AutoStake bool
Payload []byte
}
func (*Candidate) FetchByCandidateIDWithHeight ¶ added in v1.14.24
func (*Candidate) FetchByNameWithHeight ¶
func (*Candidate) FetchByOperatorAddressWithHeight ¶ added in v1.17.28
func (*Candidate) FetchByOwnerAddressWithHeight ¶ added in v1.14.24
func (*Candidate) FetchByOwnerOrOperatorWithHeight ¶ added in v1.18.2
FetchByOwnerOrOperatorWithHeight finds the latest candidate row whose `owner_address` OR `operator_address` matches the supplied address. CandidateUpdate / CandidateTransferOwnership are accepted by the chain when signed by either the owner or the (current) operator, so the plugin must look up the candidate via either field.
type CandidateExitQueue ¶ added in v1.18.2
type CandidateExitQueue struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
CandidateName string `gorm:"size:42;not null;default:'';index"`
CandidateIdentity string `gorm:"size:42;not null;default:'';index"`
Status string `gorm:"size:30;not null;default:''"`
RequestHeight uint64
RequestHash string `gorm:"size:64"`
ScheduleHeight uint64
ScheduleHash string `gorm:"size:64"`
ConfirmHeight uint64
ConfirmHash string `gorm:"size:64"`
ScheduledAt uint64
}
func (CandidateExitQueue) TableName ¶ added in v1.18.2
func (CandidateExitQueue) TableName() string
type CandidateList ¶ added in v1.4.0
type CandidateList struct {
EpochNumber uint64 `gorm:"primary_key;" sql:"type:bigint"`
CandidateList []byte
}
func (CandidateList) TableName ¶ added in v1.4.0
func (CandidateList) TableName() string
type CandidateSelfStake ¶ added in v1.17.27
type CandidateSelfStake struct {
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9;uniqueIndex:idx_candidate_action"`
TxIndex int `gorm:"not null;unsigned"`
CandidateID string `gorm:"size:42;not null;index;uniqueIndex:idx_candidate_action"`
BucketID uint64 `gorm:"unsigned;index;type:numeric(20,0)"`
}
func (*CandidateSelfStake) FetchByCandidateIDWithHeight ¶ added in v1.17.28
func (CandidateSelfStake) TableName ¶ added in v1.17.27
func (CandidateSelfStake) TableName() string
type Candidates ¶
type Candidates []Candidate
func GetAllCandidates ¶
func GetAllCandidates() (Candidates, error)
func (Candidates) ByCandidateID ¶ added in v1.14.31
func (m Candidates) ByCandidateID(addr string) (Candidate, error)
func (Candidates) ByOwnerAddress ¶
func (m Candidates) ByOwnerAddress(addr string) (Candidate, error)
type Delegate ¶
type Delegate struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
OperatorAddress string `gorm:"size:42;not null;default:'';"`
RewardAddress string `gorm:"size:42;not null;default:'';"`
OwnerAddress string `gorm:"size:42;not null;default:'';uniqueIndex"`
Candidate string `gorm:"size:42;not null;default:'';"`
Active bool `gorm:"type:bool;not null;default:false"`
Name string `gorm:"size:42;not null;default:'';"`
Productivity int `gorm:"type:int2;unsigned;not null;default:0"`
StakeAmount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
VoteWeight decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
Probated bool `gorm:"type:bool;not null;default:false"`
SelfStake bool
}
type DelegateRecord ¶ added in v1.14.35
type DelegateRecord struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
OperatorAddress string `gorm:"size:42;not null;default:'';"`
RewardAddress string `gorm:"size:42;not null;default:'';"`
OwnerAddress string `gorm:"size:42;not null;default:'';"`
Candidate string `gorm:"size:42;not null;default:'';"`
Active bool `gorm:"type:bool;not null;default:false"`
Name string `gorm:"size:42;not null;default:'';"`
Productivity int `gorm:"type:int2;unsigned;not null;default:0"`
StakeAmount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
VoteWeight decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
Probated bool `gorm:"type:bool;not null;default:false"`
SelfStake bool
Timestamp time.Time `gorm:"type:timestamp;index:,expression:(timestamp::date);default:timezone('UTC', now())"`
}
func (DelegateRecord) TableName ¶ added in v1.14.35
func (DelegateRecord) TableName() string
type DelegateRewardConfig ¶ added in v1.19.0
type DelegateRewardConfig struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
DelegateID string `gorm:"size:42;not null;default:'';uniqueIndex:idx_delegate_era,priority:1"`
Era uint64 `gorm:"unsigned;not null;default:0;uniqueIndex:idx_delegate_era,priority:2"`
BlockHeight uint64 `gorm:"unsigned;not null;default:0;index"`
DelegateName string `gorm:"size:42;not null;default:'';index"`
OptedIn bool `gorm:"type:bool;not null;default:false;index"`
// OptInSource distinguishes the two routes above: "action" or "migration".
// Empty while the delegate has not opted in.
OptInSource string `gorm:"size:16;not null;default:''"`
OptInHeight uint64 `gorm:"unsigned;not null;default:0"`
FreezeHeight uint64 `gorm:"unsigned;not null;default:0"`
// Commission is expressed the way the protocol stores it: basis points
// retained by the delegate, so 10000 means the voters get nothing.
BlockCommissionBps uint64 `gorm:"unsigned;not null;default:0"`
EpochCommissionBps uint64 `gorm:"unsigned;not null;default:0"`
// CommissionConfigured is false when the delegate never set its portions
// in the DelegateProfile contract. The protocol then freezes it at 100%
// commission, so its voters receive nothing even though it opted in —
// the single most confusing state a delegate can be in, and worth
// surfacing rather than rendering as a zero.
CommissionConfigured bool `gorm:"type:bool;not null;default:false"`
TotalWeight decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0"`
// VoterAmountFrozen is this delegate's slice of the settlement: the pool
// the era froze for its voters. Kept per delegate rather than only as an
// era total because "delegate X froze N and has paid M of it" is the
// progress a delegate actually asks about.
VoterAmountFrozen decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0"`
// PayoutAddress is where the delegate's own commission goes. Opting in
// moves it from the candidate's reward address to its owner address.
PayoutAddress string `gorm:"size:42;not null;default:''"`
}
DelegateRewardConfig records, per delegate, whether IIP-59 routes its voter rewards on chain and what commission the settlement froze.
Opt-in is a one-way transition but arrives by two different routes: an explicit SetVoterRewardOptIn action, which emits VoterRewardOptInSet, and the one-shot Hermes migration at the fork block, which emits nothing at all and has to be reconciled from state.
func (DelegateRewardConfig) TableName ¶ added in v1.19.0
func (DelegateRewardConfig) TableName() string
type DelegateRewards ¶ added in v1.18.16
type DelegateRewards struct {
Candidate string `gorm:"size:42;primaryKey;not null"`
BlockReward decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0;"`
EpochReward decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0;"`
FoundationBonus decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0;"`
BurnReward decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0;"`
}
DelegateRewards is the per-candidate cumulative rewards rollup consumed by iotex-kit's getDelegateRewards() (hub "All Time" view). It mirrors the legacy iotex-analytics `delegate_rewards` table maintained by the sync_delegate_rewards() proc; the plugin now rebuilds it on a 24h ticker.
func (DelegateRewards) TableName ¶ added in v1.18.16
func (DelegateRewards) TableName() string
type Erc20Approval ¶ added in v1.4.0
type Erc20Approval struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Amount decimal.Decimal `gorm:"type:decimal(128,0);not null;default:0;"`
Owner string `gorm:"size:42;not null;default:'';index:,length:9"`
Spender string `gorm:"size:42;not null;default:'';index:,length:9"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc20Approval) TableName ¶ added in v1.4.0
func (Erc20Approval) TableName() string
type Erc20Holder ¶ added in v1.4.0
type Erc20Holder struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Holder string `gorm:"size:42;not null;default:'';index:,length:9"`
}
func (Erc20Holder) TableName ¶ added in v1.4.0
func (Erc20Holder) TableName() string
type Erc20Meta ¶ added in v1.13.12
type Erc20Transfer ¶ added in v1.4.0
type Erc20Transfer struct {
ID uint64 `` /* 140-byte string literal not displayed */
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `` /* 154-byte string literal not displayed */
Amount decimal.Decimal `gorm:"type:decimal(128,0);not null;default:0;"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9;uniqueIndex:idx_ca_s_id,priority:4;"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9;uniqueIndex:idx_ca_r_id,priority:4;"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc20Transfer) TableName ¶ added in v1.4.0
func (Erc20Transfer) TableName() string
type Erc721Approval ¶ added in v1.4.3
type Erc721Approval struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Owner string `gorm:"size:42;not null;default:'';index:,length:9"`
Approved string `gorm:"size:42;not null;default:'';index:,length:9"`
TokenId decimal.Decimal `gorm:"type:decimal(128,0);not null;default:0;"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc721Approval) TableName ¶ added in v1.4.3
func (Erc721Approval) TableName() string
type Erc721ApprovalForAll ¶ added in v1.4.3
type Erc721ApprovalForAll struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Owner string `gorm:"size:42;not null;default:'';index:,length:9"`
Operator string `gorm:"size:42;not null;default:'';index:,length:9"`
Approved bool `gorm:"type:bool;not null;default:false"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc721ApprovalForAll) TableName ¶ added in v1.4.3
func (Erc721ApprovalForAll) TableName() string
type Erc721Holder ¶ added in v1.4.3
type Erc721Holder struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Holder string `gorm:"size:42;not null;default:'';index:,length:9"`
}
func (Erc721Holder) TableName ¶ added in v1.4.3
func (Erc721Holder) TableName() string
type Erc721Transfer ¶ added in v1.4.3
type Erc721Transfer struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
TokenId decimal.Decimal `gorm:"type:decimal(128,0);not null;default:0;"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc721Transfer) TableName ¶ added in v1.4.3
func (Erc721Transfer) TableName() string
type Erc1155ApprovalForAll ¶ added in v1.7.1
type Erc1155ApprovalForAll struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Account string `gorm:"size:42;not null;default:'';index:,length:9"`
Operator string `gorm:"size:42;not null;default:'';index:,length:9"`
Approved bool `gorm:"type:bool;not null;default:false"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc1155ApprovalForAll) TableName ¶ added in v1.7.1
func (Erc1155ApprovalForAll) TableName() string
type Erc1155TransferBatch ¶ added in v1.7.1
type Erc1155TransferBatch struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Operator string `gorm:"size:42;not null;default:'';index:,length:9"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
IDs []byte
Values []byte
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc1155TransferBatch) TableName ¶ added in v1.7.1
func (Erc1155TransferBatch) TableName() string
type Erc1155TransferSingle ¶ added in v1.7.1
type Erc1155TransferSingle struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Operator string `gorm:"size:42;not null;default:'';index:,length:9"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
SID decimal.Decimal `gorm:"column:_id;type:decimal(128,0);not null;default:'0';"`
Value decimal.Decimal `gorm:"type:decimal(128,0);not null;default:'0';"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc1155TransferSingle) TableName ¶ added in v1.7.1
func (Erc1155TransferSingle) TableName() string
type Erc1155URI ¶ added in v1.7.1
type Erc1155URI struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Value string `gorm:"size:128;not null;default:'';"`
SID decimal.Decimal `gorm:"column:_id;type:decimal(128,0);not null;default:'0';"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (Erc1155URI) TableName ¶ added in v1.7.1
func (Erc1155URI) TableName() string
type Erc1967Proxy ¶ added in v1.4.0
type Erc1967Proxy struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
ProxyAddress string `gorm:"size:42;index;not null"`
OriginAddress string `gorm:"size:42;index;not null"`
}
func (Erc1967Proxy) TableName ¶ added in v1.4.0
func (Erc1967Proxy) TableName() string
type Erc1155721Holder ¶ added in v1.8.2
type Erc1155721Holder struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
ContractAddress string `gorm:"size:42;not null;default:'';index:,length:9;uniqueIndex:idx_contract_address_holder_token_id"`
Holder string `gorm:"size:42;not null;default:'';index:,length:9;uniqueIndex:idx_contract_address_holder_token_id"`
ErcType uint16 `gorm:"index;default:0;"` // 1155 or 721
TokenID decimal.Decimal `gorm:"type:decimal(128,0);not null;default:0;uniqueIndex:idx_contract_address_holder_token_id"`
TokenValue decimal.Decimal `gorm:"type:decimal(128,0);not null;default:0;"`
}
func (Erc1155721Holder) TableName ¶ added in v1.8.2
func (Erc1155721Holder) TableName() string
type Erc1155721Meta ¶ added in v1.8.4
type Erc1155721Meta struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
ContractAddress string `gorm:"size:42;not null;default:'';uniqueIndex:,"`
ErcType uint16 `gorm:"index;default:0;"`
IsSBT bool `gorm:"type:bool;not null;default:false"`
}
func (Erc1155721Meta) TableName ¶ added in v1.8.4
func (Erc1155721Meta) TableName() string
type HermesAccountReward ¶ added in v1.4.0
type HermesAccountReward struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
CandidateName string `gorm:"size:42;index;not null"`
BlockReward decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
EpochReward decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
FoundationBonus decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
}
func (HermesAccountReward) TableName ¶ added in v1.4.0
func (HermesAccountReward) TableName() string
type HermesAggregateVoting ¶ added in v1.4.0
type HermesAggregateVoting struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
CandidateName string `gorm:"size:42;index;not null"`
VoterAddress string `gorm:"size:42;index;not null"`
NativeFlag bool `gorm:"type:bool;not null;default:false"`
AggregateVotes decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (HermesAggregateVoting) TableName ¶ added in v1.4.0
func (HermesAggregateVoting) TableName() string
type HermesBucketVoting ¶ added in v1.14.30
type HermesBucketVoting struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
CandidateName string `gorm:"size:42;index;not null"`
VoterAddress string `gorm:"size:42;index;not null"`
NativeFlag bool `gorm:"type:bool;not null;default:false"`
BucketID uint64 `gorm:"unsigned;index"`
Votes decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (HermesBucketVoting) TableName ¶ added in v1.14.30
func (HermesBucketVoting) TableName() string
type HermesDistribute ¶ added in v1.4.0
type HermesDistribute struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
StartEpoch uint64 `gorm:"unsigned;index" sql:"type:bigint"`
EndEpoch uint64 `gorm:"unsigned;index" sql:"type:bigint"`
DelegateName string `gorm:"size:42;index;not null"`
NumOfRecipients uint64 `gorm:"unsigned"`
TotalAmount decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (HermesDistribute) TableName ¶ added in v1.4.0
func (HermesDistribute) TableName() string
type HermesVotingMeta ¶ added in v1.5.4
type HermesVotingMeta struct {
EpochNumber uint64 `gorm:"unsigned;uniqueIndex" sql:"type:bigint"`
VotedToken decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
DelegateCount int `gorm:"type:int;not null;default:0;"`
TotalWeightedVotes decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (HermesVotingMeta) TableName ¶ added in v1.5.4
func (HermesVotingMeta) TableName() string
type HermesVotingResult ¶ added in v1.4.0
type HermesVotingResult struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
DelegateName string `gorm:"size:42;index;not null"`
OperatorAddress string `gorm:"size:42;index;not null"`
RewardAddress string `gorm:"size:42;index;not null"`
StakingAddress string `gorm:"size:42;index;not null"`
TotalWeightedVotes decimal.Decimal `gorm:"type:decimal(60,0);not null"`
SelfStaking decimal.Decimal `gorm:"type:decimal(60,0);not null"`
BlockRewardPercentage decimal.Decimal `gorm:"type:decimal(5,2);not null"`
EpochRewardPercentage decimal.Decimal `gorm:"type:decimal(5,2);not null"`
FoundationBonusPercentage decimal.Decimal `gorm:"type:decimal(5,2);not null"`
}
func (HermesVotingResult) TableName ¶ added in v1.4.0
func (HermesVotingResult) TableName() string
type IllegalAction ¶ added in v1.4.0
type IllegalAction struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
Sender string
Recipient string
}
func (IllegalAction) TableName ¶ added in v1.4.0
func (IllegalAction) TableName() string
type Inscription ¶ added in v1.8.59
type Inscription struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
TransactionIndex uint64 `gorm:"unsigned" sql:"type:bigint"`
MIMEType string `gorm:"type:text;not null;default:'';"`
Parameters string `gorm:"type:text;not null;default:'';"`
Extension string `gorm:"type:text;not null;default:'';"`
Data string `gorm:"type:text;not null;default:'';"`
}
Inscription inscription protocol
func (Inscription) TableName ¶ added in v1.8.60
func (Inscription) TableName() string
type InscriptionHolder ¶ added in v1.8.60
type InscriptionHolder struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
Owner string `gorm:"size:42;not null;index:,default:'';"`
InscriptionHash string `gorm:"size:64;not null;index:,length:9"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
InscriptionHolder inscription holder
func (InscriptionHolder) TableName ¶ added in v1.8.60
func (InscriptionHolder) TableName() string
type InscriptionRaw ¶ added in v1.8.52
type InscriptionRaw struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
TransactionIndex uint64 `gorm:"unsigned" sql:"type:bigint"`
Sender string `gorm:"size:42;not null;default:'';index"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
Timestamp time.Time `gorm:"type:timestamp;"`
RawData string `gorm:"type:text;not null;default:'';"`
}
InscriptionRaw all actions that can convert 'input_data' into UTF-8
func (InscriptionRaw) TableName ¶ added in v1.8.60
func (InscriptionRaw) TableName() string
type InscriptionToken ¶ added in v1.8.60
type InscriptionToken struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;index;not null;,length:9"`
Owner string `gorm:"size:42;index;not null;default:'';"`
Protocol string `gorm:"size:255;index;not null;default:'';"`
Tick string `gorm:"size:255;index;not null;default:'';"`
Op string `gorm:"size:255;not null;default:'';"`
Max uint64 `gorm:"unsigned" sql:"type:bigint"`
Limit uint64 `gorm:"unsigned" sql:"type:bigint"`
Mint uint64 `gorm:"unsigned" sql:"type:bigint"`
Description string `gorm:"size:255;not null;default:'';"`
Verified bool `gorm:"type:bool;not null;default:true"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
InscriptionToken token deploy
func (InscriptionToken) TableName ¶ added in v1.8.60
func (InscriptionToken) TableName() string
type InscriptionTokenHolder ¶ added in v1.8.60
type InscriptionTokenHolder struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
Owner string `gorm:"size:42;index;not null;default:'';"`
Protocol string `gorm:"size:255;index;not null;default:'';"`
Tick string `gorm:"size:255;index;not null;default:'';"`
Amount uint64 `gorm:"unsigned" sql:"type:bigint"`
Timestamp time.Time `gorm:"type:timestamp;"`
}
func (InscriptionTokenHolder) TableName ¶ added in v1.8.60
func (InscriptionTokenHolder) TableName() string
type InscriptionTokenTransaction ¶ added in v1.8.60
type InscriptionTokenTransaction struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
TransactionIndex uint64 `gorm:"unsigned" sql:"type:bigint"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
Timestamp time.Time `gorm:"type:timestamp;"`
Method string `gorm:"size:42;not null;default:'';"`
}
InscriptionTokenTransaction filter io-20 protocol from Inscription
func (InscriptionTokenTransaction) TableName ¶ added in v1.8.60
func (InscriptionTokenTransaction) TableName() string
type InscriptionTransfer ¶ added in v1.8.59
type InscriptionTransfer struct {
ID uint64 `gorm:"primary_key" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
TransactionIndex uint64 `gorm:"unsigned" sql:"type:bigint"`
Sender string `gorm:"size:42;not null;default:'';index"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
Timestamp time.Time `gorm:"type:timestamp;"`
InscriptionHash string `gorm:"size:64;not null;index:,length:9"`
}
InscriptionTransfer EOA transfer & Contract transfer
func (InscriptionTransfer) TableName ¶ added in v1.8.60
func (InscriptionTransfer) TableName() string
type Probation ¶
type Probation struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
EpochNumber uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
Address string `gorm:"size:42;not null;default:'';"`
IntensityRate uint32 `gorm:"type:int;not null;default:0;"`
Count uint64 `gorm:"not null;" sql:"type:bigint"`
}
func (Probation) GetCountByEpochNum ¶
GetCountByEpochNum returns the count of a probation candidate.
type RewardHistory ¶ added in v1.4.0
type RewardHistory struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
RewardAddress string `gorm:"size:42;index;not null"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
CandidateName string `gorm:"size:42;index;not null"`
// PayoutAddrKind is "reward" or "owner" — which candidate role
// RewardAddress played when this payout was made. Since Zanzibar an
// IIP-59 delegate is paid its commission at its owner address while a
// legacy delegate is paid the full amount at its reward address, so this
// is the cheap discriminator between a commission row and a full-reward
// row. Empty for rows indexed before this column existed, and ambiguous
// (always "reward") when a candidate uses one address for both roles.
PayoutAddrKind string `gorm:"size:8;not null;default:''"`
BlockReward decimal.Decimal `gorm:"type:decimal(60,0);not null"`
EpochReward decimal.Decimal `gorm:"type:decimal(60,0);not null"`
FoundationBonus decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func (RewardHistory) TableName ¶ added in v1.4.0
func (RewardHistory) TableName() string
type Slash ¶ added in v1.17.25
type Slash struct {
BlockHeight uint64 `gorm:"not null;unsigned;index;uniqueIndex:idx_block_operator" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
OperatorAddress string `gorm:"size:42;index;not null;uniqueIndex:idx_block_operator"`
CandidateID string `gorm:"size:42;not null;index"`
BucketID uint64 `gorm:"unsigned;index;type:numeric(20,0)"`
Amount decimal.Decimal `gorm:"type:decimal(60,0);not null"`
}
func FetchSlashByActionHash ¶ added in v1.17.32
type StakingActions ¶ added in v1.3.1
type StakingActions struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
BucketID uint64 `gorm:"unsigned;index"`
OwnerAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Candidate string `gorm:"size:42;not null;default:'';index:,length:9"`
Amount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
ActType string `gorm:"size:42;not null;default:'';index"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
ActHash string
AutoStake bool
Duration uint32
}
func (StakingActions) TableName ¶ added in v1.3.1
func (StakingActions) TableName() string
type StakingActionsShadow ¶ added in v1.17.32
type StakingActionsShadow struct {
*StakingActions
}
func (StakingActionsShadow) TableName ¶ added in v1.17.32
func (StakingActionsShadow) TableName() string
type StakingBucket ¶ added in v1.4.0
type StakingBucket struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BucketID uint64 `gorm:"unsigned;index"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
CreateTime int64 `gorm:"type:int4;unsigned;not null;default:0"`
StakeStartTime int64 `gorm:"type:int4;unsigned;not null;default:0"`
UnstakeStartTime int64 `gorm:"type:int4;unsigned;not null;default:0"`
StakedAmount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
VotingPower decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
OwnerAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Candidate string `gorm:"size:42;not null;default:'';index:,length:9"`
Amount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
ActType string `gorm:"size:42;not null;default:'';index"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
EndorsementExpireHeight uint64 `gorm:"type:numeric;not null;default:0"`
Timestamp int64 `gorm:"type:int4;unsigned;not null;default:0"`
AutoStake bool
Duration uint32
}
func (StakingBucket) TableName ¶ added in v1.4.0
func (StakingBucket) TableName() string
type StakingBucketShadow ¶ added in v1.17.32
type StakingBucketShadow struct {
*StakingBucket
}
func (StakingBucketShadow) TableName ¶ added in v1.17.32
func (StakingBucketShadow) TableName() string
type SystemStakingBucketRecord ¶ added in v1.14.35
type SystemStakingBucketRecord struct {
SystemStakingBucketRecordBase
}
func (SystemStakingBucketRecord) TableName ¶ added in v1.14.35
func (SystemStakingBucketRecord) TableName() string
type SystemStakingBucketRecordBase ¶ added in v1.17.8
type SystemStakingBucketRecordBase struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;index" sql:"type:bigint"`
BucketID uint64 `gorm:"unsigned;index"`
CreateTime int64 `gorm:"type:int4;unsigned;not null;default:0"`
StakeStartTime int64 `gorm:"type:int4;unsigned;not null;default:0"`
UnstakeStartTime int64 `gorm:"type:int4;unsigned;not null;default:0"`
StakedAmount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
VotingPower decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
OwnerAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
DelegateOwnerAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Amount decimal.Decimal `gorm:"type:decimal(42,0);not null;default:0;"`
EventType string `gorm:"size:42;not null;default:'';index"`
Sender string `gorm:"size:42;not null;default:'';index:,length:9"`
Recipient string `gorm:"size:42;not null;default:'';index:,length:9"`
Timestamp int64 `gorm:"type:int4;unsigned;not null;default:0"`
ActHash string
AutoStake bool
Duration uint32 // days or seconds depending on DurationType
Final bool `gorm:"type:bool;not null;default:false"`
Muted bool `gorm:"type:bool;not null;default:false"`
DurationType uint8 // 0: 5s per block in days; 1: 2.5s per block in seconds; 2: seconds in seconds
}
type SystemStakingBucketV2Record ¶ added in v1.14.35
type SystemStakingBucketV2Record struct {
SystemStakingBucketRecordBase
}
func (SystemStakingBucketV2Record) TableName ¶ added in v1.14.35
func (SystemStakingBucketV2Record) TableName() string
type SystemStakingBucketV3Record ¶ added in v1.17.8
type SystemStakingBucketV3Record struct {
SystemStakingBucketRecordBase
}
func (SystemStakingBucketV3Record) TableName ¶ added in v1.17.8
func (SystemStakingBucketV3Record) TableName() string
type VoterRewardDestination ¶ added in v1.19.0
type VoterRewardDestination struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"unsigned;not null;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9"`
VoterAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
OldRecipient string `gorm:"size:42;not null;default:''"`
NewRecipient string `gorm:"size:42;not null;default:''"`
}
VoterRewardDestination is the account a voter's direct (non-compounded) IIP-59 payouts are sent to. This is the on-chain replacement for registering a forwarding address with the off-chain Hermes service.
Every change is kept rather than upserted: the old recipient travels in the event, and a payout has to be interpreted against the destination that was in force at its height, not the current one.
func (VoterRewardDestination) TableName ¶ added in v1.19.0
func (VoterRewardDestination) TableName() string
type VoterRewardDistribution ¶ added in v1.19.0
type VoterRewardDistribution struct {
ID uint64 `gorm:"primary_key;" sql:"type:bigint"`
BlockHeight uint64 `gorm:"not null;unsigned;index" sql:"type:bigint"`
// EpochNumber is the epoch the paying block sits in — the settlement's
// continuation chunks span several epochs' worth of blocks in principle,
// so this is the payment time, not the accrual period.
EpochNumber uint64 `gorm:"unsigned;index" sql:"type:bigint"`
// Era is the settlement this payment belongs to, i.e. the accrual period.
// It comes from the log's first indexed topic, which the event ABI calls
// `epoch` but the protocol fills with the target era (see
// rewarding.packDelegateChunkLog). Era, not EpochNumber, is what a user
// means by "which payout was this".
Era uint64 `gorm:"unsigned;index" sql:"type:bigint"`
ActionHash string `gorm:"size:64;not null;index:,length:9;uniqueIndex:idx_vrd_row,priority:1"`
// LogIndex plus RowIndex identify the row inside the block: one chunk can
// emit several logs (one per delegate) and each log carries many voters.
//
// The three columns carry a unique index so a replayed block cannot double
// the ledger. Note this protects the per-payout rows only — voter_reward_era
// accumulates its running totals, so re-running an already-indexed range
// still inflates them. AutoMigrate drops and rebuilds these tables at index
// height 0, which is the supported way to re-index.
LogIndex uint32 `gorm:"not null;default:0;uniqueIndex:idx_vrd_row,priority:2"`
RowIndex uint32 `gorm:"not null;default:0;uniqueIndex:idx_vrd_row,priority:3"`
DelegateID string `gorm:"size:42;not null;default:'';index:,length:9"`
DelegateName string `gorm:"size:42;not null;default:'';index"`
VoterAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
// RecipientAddress is where the money actually landed. It differs from
// VoterAddress when the voter set a reward destination, and equals it for
// a compounded payout.
RecipientAddress string `gorm:"size:42;not null;default:'';index:,length:9"`
Amount decimal.Decimal `gorm:"type:decimal(60,0);not null"`
// Compounded is the only valid test for "was this share redeposited".
// CompoundBucketID == 0 is not that test: native bucket index 0 is a real
// bucket, which is exactly why the event carries a parallel bool array.
Compounded bool `gorm:"type:bool;not null;default:false"`
CompoundBucketID uint64 `gorm:"unsigned;not null;default:0"`
}
VoterRewardDistribution is one voter's share of one delegate's frozen pool, paid by one IIP-59 settlement chunk.
The chain emits this as a single DelegateVoterRewardsDistributed log per (delegate, chunk) carrying parallel arrays; a row here is one index of those arrays. Flattening at index time is what makes "what did this voter earn" and "what did this delegate pay out" both answerable with an ordinary index scan instead of a JSON array unnest.
func (VoterRewardDistribution) TableName ¶ added in v1.19.0
func (VoterRewardDistribution) TableName() string
type VoterRewardEra ¶ added in v1.19.0
type VoterRewardEra struct {
Era uint64 `gorm:"primary_key;unsigned" sql:"type:bigint"`
// FreezeHeight is the height every vote weight in this settlement was
// evaluated at. It precedes InitHeight by roughly 1.5 epochs, so a UI that
// shows a voter their current stake next to this payout is comparing two
// different points in time; surface it.
FreezeHeight uint64 `gorm:"unsigned;not null;default:0"`
// FirstChunkAt is the earliest block observed paying out this settlement.
//
// It is deliberately not called "init height": the block that opens a
// settlement is the era-boundary epoch's last block, and it emits nothing
// this indexer can key on — the first thing observable is the first
// continuation chunk, one block later. Naming it after the opening block
// would have the UI point users at a height the settlement did not start
// at.
FirstChunkAt uint64 `gorm:"unsigned;not null;default:0;index"`
// CompletedHeight is 0 while the drain is still running.
CompletedHeight uint64 `gorm:"unsigned;not null;default:0"`
// ScanPhase mirrors the protocol's cursor: 0 scans [startVoter, max],
// 1 scans [min, startVoter), 2 is complete.
ScanPhase uint32 `gorm:"not null;default:0"`
ResumeVoter string `gorm:"size:42;not null;default:''"`
DelegateCount uint32 `gorm:"not null;default:0"`
VoterCount uint64 `gorm:"unsigned;not null;default:0"`
TotalFrozen decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0"`
TotalDistributed decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0"`
// OverrunResidue is what an EPOCH_DRAIN_OVERRUN log reported: the pool
// left unpaid when a later era boundary arrived before this settlement
// finished. The money is not lost — it rolls into the next settlement —
// but a non-zero value here means the drain could not keep up.
OverrunResidue decimal.Decimal `gorm:"type:decimal(60,0);not null;default:0"`
LastChunkAt uint64 `gorm:"unsigned;not null;default:0"`
}
VoterRewardEra summarises one settlement so that "how much was paid for era N" and "how far has the current settlement got" do not require scanning the per-voter table.
A settlement is initialised in one block and drained across many, so this row is created once and then updated in place as chunks land.
func (VoterRewardEra) TableName ¶ added in v1.19.0
func (VoterRewardEra) TableName() string
Source Files
¶
- account_meta.go
- airdrip.go
- authorization.go
- block_action.go
- block_action_partition.go
- block_footer.go
- block_meta.go
- block_receipt.go
- block_reward.go
- block_supply.go
- candidate.go
- candidate_exit_queue.go
- candidate_self_stake.go
- candidatelist.go
- delegate.go
- delegate_rewards.go
- erc1155.go
- erc1967_proxy.go
- erc20.go
- erc721.go
- hermes.go
- illegal_action.go
- inscription.go
- model.go
- probation.go
- reward_history.go
- slash.go
- staking_action.go
- staking_bucket.go
- voter_reward.go