models

package
v1.8.64 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 AccountActionCount added in v1.4.2

type AccountActionCount struct {
	ID          uint64 `gorm:"primary_key;" sql:"type:bigint"`
	Address     string `gorm:"size:42;not null;default:'';uniqueIndex"`
	Erc20Count  uint64 `gorm:"type:int8;not null;default:0"` // count of erc20 token
	Erc721Count uint64 `gorm:"type:int8;not null;default:0"` // count of erc721 token
	ActionCount uint64 `gorm:"type:int8;not null;default:0"` // count of actions
	InnerCount  uint64 `gorm:"type:int8;not null;default:0"` // count of inner actions
}

AccountActionCount is the count of actions of an account.

func (*AccountActionCount) AddCount added in v1.4.2

func (m *AccountActionCount) AddCount(tx *gorm.DB, count uint64, typ AccountActionCountType) error

AddCount adds the count of actions of an account.

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 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 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"`
}

func (Block) TableName added in v1.3.1

func (Block) TableName() string

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 BlockFooter added in v1.6.10

type BlockFooter struct {
	BlockHeight uint64 `gorm:"primary_key;" sql:"type:bigint;"`
	Endorser    string `gorm:"primary_key;size:42;not null;default:'';index"`
}

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;"`
	EpochNum                uint64          `gorm:"unsigned;index"`
	EpochHeight             uint64          `gorm:"unsigned;index"`
	BlockSize               uint64          `gorm:"unsigned;not null;default:0;"`
}

func (BlockMeta) TableName added in v1.3.1

func (BlockMeta) TableName() string

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"`
}

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:'';"`
	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) FetchByName

func (m *Candidate) FetchByName(name string) (*Candidate, error)

func (*Candidate) FetchByNameWithHeight

func (m *Candidate) FetchByNameWithHeight(name string, height uint64) error

func (Candidate) TableName

func (Candidate) 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 Candidates

type Candidates []Candidate

func GetAllCandidates

func GetAllCandidates() (Candidates, 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
}

func (Delegate) TableName

func (Delegate) 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 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 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:42;index;not null;default:'';"`
	Tick        string    `gorm:"size:42;index;not null;default:'';"`
	Op          string    `gorm:"size:42;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:42;index;not null;default:'';"`
	Tick      string    `gorm:"size:42;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

func (m Probation) GetCountByEpochNum(epochNum uint64) (uint64, error)

GetCountByEpochNum returns the count of a probation candidate.

func (Probation) TableName

func (Probation) TableName() string

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"`
	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 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 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"`
	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 SystemStakingBucket added in v1.8.15

type SystemStakingBucket 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 //means block number
}

func (SystemStakingBucket) TableName added in v1.8.15

func (SystemStakingBucket) TableName() string

type TokenErc20 added in v1.3.1

type TokenErc20 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;"`
	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;"`
}

type TokenErc20Holder added in v1.3.1

type TokenErc20Holder 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"`
}

type TokenErc721 added in v1.3.1

type TokenErc721 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;"`
	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;"`
}

type TokenErc721Holder added in v1.3.1

type TokenErc721Holder 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"`
}

Jump to

Keyboard shortcuts

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