model

package
v0.0.98 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	TotalTransactions    int64
	FirstTransactionDate time.Time
	TotalReceived        DecCoin
	TotalSpent           DecCoin
}

type AggregatedInfo

type AggregatedInfo struct {
	UpdatedAt    time.Time         `json:"updated_at"`
	Blocks       TotalBlocks       `json:"blocks"`
	Transactions TotalTransactions `json:"transactions"`
	Wallets      TotalWallets      `json:"wallets"`
}

type AuthInfo added in v0.0.91

type AuthInfo struct {
	ID          uint `gorm:"primarykey"`
	FeeID       uint
	Fee         AuthInfoFee `gorm:"foreignKey:FeeID"`
	TipID       uint
	Tip         Tip           `gorm:"foreignKey:TipID"`
	SignerInfos []*SignerInfo `gorm:"many2many:tx_signer_infos;"`
}

func (AuthInfo) TableName added in v0.0.91

func (AuthInfo) TableName() string

type AuthInfoFee added in v0.0.91

type AuthInfoFee struct {
	ID       uint
	GasLimit uint64
	Payer    string
	Granter  string
}

func (AuthInfoFee) TableName added in v0.0.91

func (AuthInfoFee) TableName() string

type BlockInfo

type BlockInfo struct {
	BlockHeight              int64
	ProposedValidatorAddress string
	GenerationTime           time.Time
	TimeElapsed              int64
	TotalFees                decimal.Decimal
	TotalTx                  int64
	BlockHash                string
	GasUsed                  decimal.Decimal
	GasWanted                decimal.Decimal
	BlockRewards             decimal.Decimal
}

type BlockSigned

type BlockSigned struct {
	BlockHeight int64
	Signed      bool
}

type BlockSigners

type BlockSigners struct {
	BlockHeight int64
	Validator   string
	Time        time.Time
	Rank        int64
}

type DecCoin

type DecCoin struct {
	Denom  string
	Amount decimal.Decimal
}

type Denom

type Denom struct {
	Denom  string
	Amount string
}

type FailedMessage added in v0.0.91

type FailedMessage struct {
	ID           uint
	MessageIndex int
	TxID         uint
	Tx           Tx
}

type FailedTx added in v0.0.91

type FailedTx struct {
	ID      uint
	Hash    string `gorm:"uniqueIndex"`
	BlockID uint
	Block   models.Block
}

type Fee added in v0.0.91

type Fee struct {
	ID             uint            `gorm:"primaryKey"`
	TxID           uint            `gorm:"uniqueIndex:txDenomFee"`
	Amount         decimal.Decimal `gorm:"type:decimal(78,0);"`
	DenominationID uint            `gorm:"uniqueIndex:txDenomFee"`
	Denomination   models.Denom    `gorm:"foreignKey:DenominationID"`
	PayerAddressID uint            `gorm:"index:idx_payer_addr"`
	PayerAddress   models.Address  `gorm:"foreignKey:PayerAddressID"`
}

func (*Fee) BeforeCreate added in v0.0.91

func (b *Fee) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate This lifecycle function ensures the on conflict statement is added for Fees which are associated to Txes by the Gorm slice association method for has_many

type InfoFeeAmount added in v0.0.91

type InfoFeeAmount struct {
	ID     uint            `gorm:"primaryKey"`
	Amount decimal.Decimal `gorm:"type:decimal(78,0);"`
	Denom  string
}

func (InfoFeeAmount) TableName added in v0.0.91

func (InfoFeeAmount) TableName() string

type Message added in v0.0.91

type Message struct {
	ID            uint
	TxID          uint `gorm:"uniqueIndex:messageIndex,priority:1"`
	Tx            Tx
	MessageTypeID uint `gorm:"foreignKey:MessageTypeID,index:idx_txid_typeid"`
	MessageType   MessageType
	MessageIndex  int `gorm:"uniqueIndex:messageIndex,priority:2"`
	MessageBytes  []byte
}

type MessageEvent added in v0.0.91

type MessageEvent struct {
	ID uint
	// These fields uniquely identify every message event
	// Index refers to the position of the event in the message event array
	Index              uint64 `gorm:"uniqueIndex:messageEventIndex,priority:2"`
	MessageID          uint   `gorm:"uniqueIndex:messageEventIndex,priority:1"`
	Message            Message
	MessageEventTypeID uint
	MessageEventType   MessageEventType
}

type MessageEventAttribute added in v0.0.91

type MessageEventAttribute struct {
	ID             uint
	MessageEvent   MessageEvent
	MessageEventID uint `gorm:"uniqueIndex:messageAttributeIndex,priority:1"`
	Value          string
	Index          uint64 `gorm:"uniqueIndex:messageAttributeIndex,priority:2"`
	// Keys are limited to a smallish subset of string values set by the Cosmos SDK and external modules
	// Save DB space by storing the key as a foreign key
	MessageEventAttributeKeyID uint
	MessageEventAttributeKey   MessageEventAttributeKey
}

type MessageEventAttributeKey added in v0.0.91

type MessageEventAttributeKey struct {
	ID  uint
	Key string `gorm:"uniqueIndex"`
}

type MessageEventType added in v0.0.91

type MessageEventType struct {
	ID   uint
	Type string `gorm:"uniqueIndex"`
}

type MessageType added in v0.0.91

type MessageType struct {
	ID          uint   `gorm:"primaryKey"`
	MessageType string `gorm:"uniqueIndex;not null"`
}

type ProposalDeposit added in v0.0.71

type ProposalDeposit struct {
	Address string
	TxHash  string
	TxTime  time.Time
	Amount  DecCoin
}

type SearchResult

type SearchResult struct {
	TxHash      string `bson:"tx_hash"`
	Type        string `bson:"type"`
	BlockHeight string `bson:"block_height"`
}

type SignerInfo added in v0.0.91

type SignerInfo struct {
	ID        uint
	AddressID uint
	Address   *models.Address `gorm:"foreignKey:AddressID"`
	ModeInfo  string
	Sequence  uint64
}

func (SignerInfo) TableName added in v0.0.91

func (SignerInfo) TableName() string

type SortBy added in v0.0.70

type SortBy struct {
	By        string
	Direction string
}

type Tip added in v0.0.91

type Tip struct {
	ID     uint
	Tipper string
	Amount []TipAmount `gorm:"foreignKey:ID"`
}

func (Tip) TableName added in v0.0.91

func (Tip) TableName() string

type TipAmount added in v0.0.91

type TipAmount struct {
	ID     uint            `gorm:"primaryKey"`
	Amount decimal.Decimal `gorm:"type:decimal(78,0);"`
	Denom  string
}

func (TipAmount) TableName added in v0.0.91

func (TipAmount) TableName() string

type TotalBlocks

type TotalBlocks struct {
	BlockHeight int64           `json:"block_height"`
	Count24H    int64           `json:"count_24h"`
	Count48H    int64           `json:"count_48h"`
	BlockTime   int64           `json:"block_time"`
	TotalFee24H decimal.Decimal `json:"total_fee_24h"`
}

type TotalTransactions

type TotalTransactions struct {
	Total     int64           `json:"total"`
	Total24H  int64           `json:"total_24h"`
	Total48H  int64           `json:"total_48h"`
	Total30D  int64           `json:"total_30d"`
	Volume24H decimal.Decimal `json:"volume_24h"`
	Volume30D decimal.Decimal `json:"volume_30d"`
}

type TotalWallets

type TotalWallets struct {
	Total    int64 `json:"total"`
	Count24H int64 `json:"count_24h"`
	Count48H int64 `json:"count_48h"`
	Count30D int64 `json:"count_30d"`
}

type Transaction added in v0.0.91

type Transaction struct {
	Messages []string
	Memo     string
	AuthInfo TxAuthInfo
}

type Tx

type Tx struct {
	ID                          uint
	Hash                        string `gorm:"uniqueIndex"`
	Code                        uint32
	BlockID                     uint
	Block                       models.Block
	SignerAddresses             []models.Address `gorm:"many2many:tx_signer_addresses;"`
	Fees                        []Fee
	Signatures                  pq.ByteaArray `gorm:"type:bytea[]" json:"signatures"`
	Timestamp                   time.Time
	Memo                        string
	TimeoutHeight               uint64
	ExtensionOptions            pq.StringArray `gorm:"type:text[]" json:"extension_options"`
	NonCriticalExtensionOptions pq.StringArray `gorm:"type:text[]" json:"non_critical_options"`
	AuthInfoID                  uint
	AuthInfo                    AuthInfo `gorm:"foreignKey:AuthInfoID;belongsTo"`
	TxResponseID                uint
	TxResponse                  TxResponse        `gorm:"foreignKey:TxResponseID;belongsTo"`
	SenderReceiver              *TxSenderReceiver `gorm:"-" json:"sender_receiver"`
	Events                      []*TxEvents       `gorm:"-" json:"events"`
}

type TxAuthInfo

type TxAuthInfo struct {
	PublicKeys []string
	Fee        TxFee
	Signatures []string
}

type TxByHourWithCount

type TxByHourWithCount struct {
	Points   []*TxsByHour
	Total24H int64
	Total48H int64
}

type TxDelegateAggregated added in v0.0.91

type TxDelegateAggregated struct {
	ID          uint
	Hash        string `gorm:"uniqueIndex"`
	TxType      string
	Timestamp   time.Time
	Validator   string
	BlockHeight int64
	Amount      decimal.Decimal `gorm:"type:decimal(78,0);"`
	Denom       string
	Sender      string
}

type TxEvents

type TxEvents struct {
	MessageType string `json:"message_type,omitempty"`
	EventIndex  int    `json:"event_index"`
	Type        string `json:"type,omitempty"`
	Index       int    `json:"index,omitempty"`
	Value       string `json:"value,omitempty"`
	Key         string `json:"key,omitempty"`
}

type TxEventsAggregated added in v0.0.91

type TxEventsAggregated struct {
	ID                    uint
	TxHash                string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageType           string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageTypeIndex      int    `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageEventType      string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageEventAttrIndex int    `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageEventAttrValue string
	MessageEventAttrKey   string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
}

type TxEventsValsAggregated added in v0.0.91

type TxEventsValsAggregated struct {
	ID          uint
	EvAttrValue string `gorm:"uniqueIndex:txEventsValsAggregatedIndex"`
	MsgType     string `gorm:"uniqueIndex:txEventsValsAggregatedIndex"`
	TxHash      string `gorm:"uniqueIndex:txEventsValsAggregatedIndex"`
	TxTimestamp time.Time
}

type TxFee

type TxFee struct {
	Amount   Denom
	GasLimit string
	Payer    string
	Granter  string
}

type TxResponse added in v0.0.91

type TxResponse struct {
	ID        uint
	TxHash    string `gorm:"uniqueIndex"`
	Height    string
	TimeStamp string
	Code      uint32
	RawLog    []byte `gorm:"type:bytea"`
	// Log       []LogMessage
	GasUsed   int64
	GasWanted int64
	Codespace string
	Data      string
	Info      string
}

func (TxResponse) TableName added in v0.0.91

func (TxResponse) TableName() string

type TxSenderReceiver

type TxSenderReceiver struct {
	MessageType string `json:"message_type,omitempty"`
	Sender      string `json:"sender,omitempty"`
	Receiver    string `json:"receiver,omitempty"`
	Amount      string `json:"amount,omitempty"`
	Denom       string `json:"denom,omitempty"`
}

type TxVolumeByHour

type TxVolumeByHour struct {
	TxVolume decimal.Decimal
	Hour     time.Time
}

type TxsByDay

type TxsByDay struct {
	TxNum int32
	Day   time.Time
}

type TxsByHour

type TxsByHour struct {
	TxNum int32
	Hour  time.Time
}

type Validators

type Validators struct {
	Address string
}

type VotesTransaction

type VotesTransaction struct {
	BlockHeight int64     `json:"block_height"`
	Timestamp   time.Time `json:"timestamp"`
	TxHash      string    `json:"tx_hash"`
	ProposalID  int       `json:"proposal_id"`
	Voter       string    `json:"voter"`
	Option      string    `json:"option"`
	Weight      string    `json:"weight"`
	Tx          *Tx       `json:"tx"`
}

type WalletWithTxs

type WalletWithTxs struct {
	Account string `json:"account"`
	TxCount int64  `json:"tx_count"`
}

Jump to

Keyboard shortcuts

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