models

package
v0.0.0-...-d9430aa Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressToken

type AddressToken struct {
	Id        uint64 `gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	AddressId uint64 `json:"address_id"`
	TokenId   uint64 `json:"token_id"`
	HoldValue string `gorm:"type:varchar(256)" json:"hold_value"`
	HoldNum   uint64 `json:"hold_num"`
	*gorm.Model
}

func (*AddressToken) SelfInsert

func (at *AddressToken) SelfInsert(db *gorm.DB) error

func (*AddressToken) SelfUpdate

func (at *AddressToken) SelfUpdate(db *gorm.DB) error

func (*AddressToken) TableName

func (at *AddressToken) TableName() string

type Addresses

type Addresses struct {
	Id      uint64 `json:"id" gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	Address string `gorm:"type:char(42)" json:"address"`
	Label   string `gorm:"type:char(64)" json:"label"`
	Balance string `gorm:"type:varchar(256)"  json:"balance"`
	*gorm.Model
}

func (*Addresses) ExistAddress

func (ad *Addresses) ExistAddress(db *gorm.DB) bool

func (*Addresses) SelfInsert

func (ad *Addresses) SelfInsert(db *gorm.DB) error

func (*Addresses) SelfUpdate

func (ad *Addresses) SelfUpdate(db *gorm.DB) error

func (*Addresses) TableName

func (ad *Addresses) TableName() string

type Blocks

type Blocks struct {
	Id                int64  `json:"id" gorm:"primary_key;AUTO_INCREMENT"`
	BlockHeight       uint64 `json:"block_height" gorm:"column:block_height;default: 0;"`
	BlockHash         string `json:"block_hash" gorm:"column:block_hash;default: '';"`
	ParentHash        string `json:"parent_hash" gorm:"column:parent_hash;default: '';"`
	LatestBlockHeight uint64 `json:"latest_block_height" gorm:"column:latest_block_height;default: 0;"`
	*gorm.Model
}

func (*Blocks) ExistBlock

func (b *Blocks) ExistBlock(db *gorm.DB) bool

func (*Blocks) GetFirstColumn

func (b *Blocks) GetFirstColumn(db *gorm.DB) (*Blocks, error)

func (*Blocks) SelfInsert

func (b *Blocks) SelfInsert(db *gorm.DB) error

func (*Blocks) SelfUpdate

func (b *Blocks) SelfUpdate(db *gorm.DB) error

func (*Blocks) TableName

func (b *Blocks) TableName() string

type Events

type Events struct {
	Id          uint64 `json:"id" gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	Address     string `gorm:"type:char(42)" json:"address"`
	Data        string `gorm:"type:varchar(1024)" json:"data"`
	BlockNumber uint64 `json:"block_number"`
	TxHash      string `gorm:"type:char(66)" json:"tx_hash"`
	TxIndex     uint   `json:"tx_index"`
	BlockHash   string `json:"block_hash"`
	LogIndex    uint   `json:"log_index"`
	Removed     bool   `json:"removed"`
	*gorm.Model
}

func (*Events) GetEventByTxHash

func (e *Events) GetEventByTxHash(db *gorm.DB) (*Events, error)

func (*Events) SelfInsert

func (e *Events) SelfInsert(db *gorm.DB) error

func (*Events) SelfUpdate

func (e *Events) SelfUpdate(db *gorm.DB) error

func (*Events) TableName

func (e *Events) TableName() string

type Token

type Token struct {
	Id                uint64 `gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	Address           string `gorm:"type:char(42)" json:"address"`
	Name              string `gorm:"type:char(64)" json:"name"`
	Symbol            string `gorm:"type:char(64)" json:"symbol"`
	Type              string `gorm:"type:varchar(30);" json:"type"` // erc20:erc20; nft:nft(erc721/erc1155); other:other
	TotalSupply       string `gorm:"type:varchar(256)" json:"total_supply"`
	Collections       uint64 `json:"collections"`
	TotalNft          uint64 `json:"total_nft"`
	TotalTransactions uint64 `json:"total_transactions"`
	TotalHolders      uint64 `json:"total_holders"`
	*gorm.Model
}

func (*Token) ExistToken

func (t *Token) ExistToken(db *gorm.DB) bool

func (*Token) SelfInsert

func (t *Token) SelfInsert(db *gorm.DB) error

func (*Token) SelfUpdate

func (t *Token) SelfUpdate(db *gorm.DB) error

func (*Token) TableName

func (t *Token) TableName() string

type Topics

type Topics struct {
	Id      uint64 `json:"id" gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	EventId uint64 `json:"event_id"`
	Topic   string `gorm:"type:longtext" json:"topic"`
	*gorm.Model
}

func (*Topics) SelfInsert

func (tc *Topics) SelfInsert(db *gorm.DB) error

func (*Topics) SelfUpdate

func (tc *Topics) SelfUpdate(db *gorm.DB) error

func (*Topics) TableName

func (tc *Topics) TableName() string

type Transaction

type Transaction struct {
	Id          uint64    `json:"id" gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	BlockNumber uint64    `json:"block_number"`
	TxHash      string    `gorm:"type:char(66)" json:"tx_hash"`
	From        string    `gorm:"type:char(42)" json:"from"`
	To          string    `gorm:"type:char(42)" json:"to"`
	Value       string    `gorm:"type:varchar(256)" json:"value"`
	Contract    string    `gorm:"type:char(42)" json:"contract"`
	Status      uint64    `json:"status"`
	Timestamp   time.Time `json:"timestamp"`
	InputData   []byte    `gorm:"-" json:"input_data"`
	*gorm.Model
}

func (*Transaction) GetFirstColumn

func (tx *Transaction) GetFirstColumn(db *gorm.DB) (*Transaction, error)

func (*Transaction) GetTransactionByAddress

func (tx *Transaction) GetTransactionByAddress(db *gorm.DB) (*Transaction, error)

func (*Transaction) SelfInsert

func (tx *Transaction) SelfInsert(db *gorm.DB) error

func (*Transaction) SelfUpdate

func (tx *Transaction) SelfUpdate(db *gorm.DB) error

func (*Transaction) TableName

func (tx *Transaction) TableName() string

Jump to

Keyboard shortcuts

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