model

package
v0.0.0-...-e69715a Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UTXOStatusUnspent = 1
	UTXOStatusSpent   = 2
)
View Source
const (
	ChainBTC  string = "btc"
	ChainAVAX string = "avalanche"
)
View Source
const (
	TransferTypeHash    = 1
	TransferTypeBalance = 2
)
View Source
const (
	MintStatusProcessing uint32 = 1
	MintStatusAllMinted  uint32 = 2
)
View Source
const (
	TransactionScannedStatusInit = 0
	TransactionScannedStatusDone = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressTransaction

type AddressTransaction struct {
	ID        uint64          `gorm:"primaryKey" json:"id"`
	Event     int8            `json:"event" gorm:"column:event"`
	TxHash    []byte          `json:"tx_hash" gorm:"column:tx_hash"`
	Address   string          `json:"address" gorm:"column:address"`
	From      string          `json:"from" gorm:"column:from"`
	To        string          `json:"to" gorm:"column:to"`
	Amount    decimal.Decimal `json:"amount" gorm:"column:amount;type:decimal(36,18)"`
	Tick      string          `json:"tick" gorm:"column:tick"`
	Protocol  string          `json:"protocol" gorm:"column:protocol"`
	Operate   string          `json:"operate" gorm:"column:operate"`
	Chain     string          `json:"chain" gorm:"column:chain"`
	Status    int8            `json:"status" gorm:"column:status"` // tx status
	CreatedAt time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt time.Time       `json:"updated_at" gorm:"column:updated_at"`
}

type AddressTxs

type AddressTxs struct {
	ID             uint64          `gorm:"primaryKey" json:"id"`
	Event          TxEvent         `json:"event" gorm:"column:event"`
	TxHash         []byte          `json:"tx_hash" gorm:"column:tx_hash"`
	Address        string          `json:"address" gorm:"column:address"`
	RelatedAddress string          `json:"related_address" gorm:"column:related_address"`
	Amount         decimal.Decimal `json:"amount" gorm:"column:amount;type:decimal(38,18)"`
	Tick           string          `json:"tick" gorm:"column:tick"`
	Protocol       string          `json:"protocol" gorm:"column:protocol"`
	Operate        string          `json:"operate" gorm:"column:operate"`
	Chain          string          `json:"chain" gorm:"column:chain"`
	CreatedAt      time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt      time.Time       `json:"updated_at" gorm:"column:updated_at"`
}

func (AddressTxs) TableName

func (AddressTxs) TableName() string

type AllChain

type AllChain struct {
	Chain string `json:"chain"`
	Count uint32 `json:"count"`
}

func (AllChain) TableName

func (AllChain) TableName() string

type BalanceChain

type BalanceChain struct {
	Chain   string          `json:"chain"`
	Address string          `json:"address"`
	Balance decimal.Decimal `json:"balance"`
}

func (BalanceChain) TableName

func (BalanceChain) TableName() string

type BalanceInscription

type BalanceInscription struct {
	Chain        string          `json:"chain"`
	Protocol     string          `json:"protocol"`
	Tick         string          `json:"tick"`
	Address      string          `json:"address"`
	Balance      decimal.Decimal `json:"balance"`
	DeployHash   string          `json:"deploy_hash"`
	TransferType int8            `json:"transfer_type"`
}

type BalanceTxn

type BalanceTxn struct {
	ID        uint64          `gorm:"primaryKey" json:"id"`
	Chain     string          `json:"chain" gorm:"column:chain"`
	Protocol  string          `json:"protocol" gorm:"column:protocol"`
	Event     TxEvent         `json:"event" gorm:"column:event"`
	Address   string          `json:"address" gorm:"column:address"`
	Tick      string          `json:"tick" gorm:"column:tick"`
	Amount    decimal.Decimal `json:"amount" gorm:"column:amount;type:decimal(38,18)"`
	Available decimal.Decimal `json:"available" gorm:"column:available;type:decimal(38,18)"`
	Balance   decimal.Decimal `json:"balance" gorm:"column:balance;type:decimal(38,18)"`
	TxHash    []byte          `json:"tx_hash" gorm:"column:tx_hash"`
	CreatedAt time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt time.Time       `json:"updated_at" gorm:"column:updated_at"`
}

func (BalanceTxn) TableName

func (BalanceTxn) TableName() string

type Balances

type Balances struct {
	ID        uint64          `gorm:"primaryKey" json:"id"`
	SID       uint64          `json:"sid"  gorm:"column:sid"`
	Chain     string          `json:"chain" gorm:"column:chain"`
	Protocol  string          `json:"protocol" gorm:"column:protocol"`
	Address   string          `json:"address" gorm:"column:address"`
	Tick      string          `json:"tick" gorm:"column:tick"`
	Available decimal.Decimal `json:"available" gorm:"column:available;type:decimal(38,18)"` // available balance = overall balance - transferable balance
	Balance   decimal.Decimal `json:"balance" gorm:"column:balance;type:decimal(38,18)"`     // overall balance
	CreatedAt time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt time.Time       `json:"updated_at" gorm:"column:updated_at"`
}

func (Balances) TableName

func (Balances) TableName() string

type Block

type Block struct {
	ChainId     int64     `json:"chain_id" gorm:"column:chain_id"`
	Chain       string    `json:"chain" gorm:"column:chain"`
	BlockHash   string    `json:"block_hash" gorm:"column:block_hash"`
	BlockNumber string    `json:"block_number" gorm:"column:block_number"`
	BlockTime   time.Time `json:"block_time" gorm:"column:block_time"`
	UpdatedAt   time.Time `json:"updated_at" gorm:"column:updated_at"`
}

func (Block) TableName

func (Block) TableName() string

type BlockStatus

type BlockStatus struct {
	ChainId     int64     `json:"chain_id" gorm:"column:chain_id"`
	Chain       string    `json:"chain" gorm:"column:chain"`               // chain name
	BlockHash   string    `json:"block_hash" gorm:"column:block_hash"`     // block hash
	BlockNumber uint64    `json:"block_number" gorm:"column:block_number"` // block height
	BlockTime   time.Time `json:"block_time" gorm:"column:block_time"`     // block time
}

func (BlockStatus) TableName

func (BlockStatus) TableName() string

type Chain24HourStat

type Chain24HourStat struct {
	ChainId           int64           `json:"chain_id"`
	Chain             string          `json:"chain"`
	Name              string          `json:"name"`
	Address24h        uint32          `json:"address_24h"`
	Address24hPercent uint32          `json:"address_24h_percent"`
	Tick24h           uint32          `json:"tick_24h"`
	Tick24hPercent    uint32          `json:"tick_24h_percent"`
	Balance24h        decimal.Decimal `json:"balance_24h"`
	Balance24hPercent uint32          `json:"balance_24h_percent"`
}

type ChainBlockStat

type ChainBlockStat struct {
	BlockHeight      uint64    `json:"block_height" gorm:"column:block_height"`
	TickCount        uint32    `json:"tick_count" gorm:"column:tick_count"`
	TransactionCount uint32    `json:"transaction_count" gorm:"column:transaction_count"`
	CreatedAt        time.Time `json:"created_at" gorm:"column:created_at"`
}

func (ChainBlockStat) TableName

func (ChainBlockStat) TableName() string

type ChainGroup

type ChainGroup string
const (
	EvmChainGroup ChainGroup = "evm"
	BtcChainGroup ChainGroup = "btc"
)

type ChainInfo

type ChainInfo struct {
	ID         int64     `gorm:"primaryKey" json:"id"`
	ChainId    int64     `json:"chain_id" gorm:"column:chain_id"`
	Chain      string    `json:"chain" gorm:"column:chain"`
	OuterChain string    `json:"outer_chain" gorm:"column:outer_chain"`
	Name       string    `json:"name" gorm:"column:name"`
	NetworkId  int64     `json:"network_id" gorm:"column:network_id"`
	Ext        string    `json:"ext" gorm:"column:ext"`
	CreatedAt  time.Time `json:"created_at" gorm:"column:created_at"`
	UpdatedAt  time.Time `json:"updated_at" gorm:"column:updated_at"`
}

func (ChainInfo) TableName

func (ChainInfo) TableName() string

type ChainInfoExt

type ChainInfoExt struct {
	TickCount    int64 `json:"tick_count"`
	AddressCount int64 `json:"address_count"`
	DeployCount  int64 `json:"deploy_count"`
	MintCount    int64 `json:"mint_count"`
	ChainInfo
}

type ChainStatHour

type ChainStatHour struct {
	ID                uint64          `gorm:"primaryKey" json:"id"`
	Chain             string          `json:"chain" gorm:"column:chain"`
	DateHour          uint32          `json:"date_hour" gorm:"column:date_hour"`
	AddressCount      uint32          `json:"address_count" gorm:"column:address_count"`
	AddressLastId     uint64          `json:"address_last_id" gorm:"column:address_last_id"`
	InscriptionsCount uint32          `json:"inscriptions_count" gorm:"column:inscriptions_count"`
	BalanceSum        decimal.Decimal `json:"balance_sum" gorm:"column:balance_sum;type:decimal(38,18)"`
	BalanceLastId     uint64          `json:"balance_last_id" gorm:"column:balance_last_id"`
	CreatedAt         time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt         time.Time       `json:"updated_at" gorm:"column:updated_at"`
}

func (ChainStatHour) TableName

func (ChainStatHour) TableName() string

type GroupChainStatHour

type GroupChainStatHour struct {
	Chain             string          `json:"chain" gorm:"column:chain"`
	AddressCount      uint32          `json:"address_count" gorm:"column:address_count"`
	InscriptionsCount uint32          `json:"inscriptions_count" gorm:"column:inscriptions_count"`
	BalanceSum        decimal.Decimal `json:"balance_amount_sum" gorm:"column:balance_amount_sum;type:decimal(38,18)"`
}

func (GroupChainStatHour) TableName

func (GroupChainStatHour) TableName() string

type InscriptionBrief

type InscriptionBrief struct {
	Chain         string `json:"chain"`
	Protocol      string `json:"protocol"`
	Tick          string `json:"tick"`
	DeployBy      string `json:"deploy_by"`
	DeployHash    string `json:"deploy_hash"`
	DeployTime    uint32 `json:"deploy_time"`
	TotalSupply   string `json:"total_supply"`
	MintedPercent string `json:"minted_percent"`
	LimitPerMint  string `json:"limit_per_mint"`
	Holders       uint64 `json:"holders"`
	TransferType  int8   `json:"transfer_type"`
	Status        uint32 `json:"status"`
	Minted        string `json:"minted"`
	TxCnt         uint64 `json:"tx_cnt"`
	CreatedAt     uint32 `json:"created_at"`
}

type InscriptionOverView

type InscriptionOverView struct {
	ID           uint32          `gorm:"primaryKey" json:"id"`
	Chain        string          `json:"chain" gorm:"column:chain"`
	Protocol     string          `json:"protocol" gorm:"column:protocol"`
	Tick         string          `json:"tick" gorm:"column:tick"`
	Name         string          `json:"name" gorm:"column:name"`
	LimitPerMint decimal.Decimal `gorm:"column:limit_per_mint;type:decimal(38,18)" json:"limit_per_mint"`
	DeployBy     string          `json:"deploy_by" gorm:"column:deploy_by"`
	TotalSupply  decimal.Decimal `gorm:"column:total_supply;type:decimal(38,18)" json:"total_supply"`
	DeployHash   string          `json:"deploy_hash" gorm:"column:deploy_hash"`
	DeployTime   time.Time       `json:"deploy_time" gorm:"column:deploy_time"`
	TransferType int8            `json:"transfer_type" gorm:"column:transfer_type"`
	CreatedAt    time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt    time.Time       `json:"updated_at" gorm:"column:updated_at"`
	Decimals     int8            `json:"decimals" gorm:"column:decimals"`
	Holders      uint64          `json:"holders" gorm:"column:holders"`
	Minted       decimal.Decimal `gorm:"column:minted;type:decimal(38,18)" json:"minted"`
	TxCnt        uint64          `gorm:"column:tx_cnt" json:"tx_cnt"`
	Progress     decimal.Decimal `gorm:"column:progress;type:decimal(36,18)" json:"progress"` // mint进度
}

type Inscriptions

type Inscriptions struct {
	ID           uint32          `gorm:"primaryKey" json:"id"` // ID
	SID          uint32          `json:"sid"  gorm:"column:sid"`
	Chain        string          `json:"chain" gorm:"column:chain"`
	Protocol     string          `json:"protocol" gorm:"column:protocol"`
	Tick         string          `json:"tick" gorm:"column:tick"`
	Name         string          `json:"name" gorm:"column:name"`
	LimitPerMint decimal.Decimal `gorm:"column:limit_per_mint;type:decimal(38,18)" json:"limit_per_mint"`
	DeployBy     string          `json:"deploy_by" gorm:"column:deploy_by"`
	TotalSupply  decimal.Decimal `gorm:"column:total_supply;type:decimal(38,18)" json:"total_supply"`
	DeployHash   string          `json:"deploy_hash" gorm:"column:deploy_hash"`
	DeployTime   time.Time       `json:"deploy_time" gorm:"column:deploy_time"`
	TransferType int8            `json:"transfer_type" gorm:"column:transfer_type"`
	CreatedAt    time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt    time.Time       `json:"updated_at" gorm:"column:updated_at"`
	Decimals     int8            `json:"decimals" gorm:"column:decimals"`
}

func (Inscriptions) TableName

func (Inscriptions) TableName() string

type InscriptionsStats

type InscriptionsStats struct {
	ID                uint32          `gorm:"primaryKey" json:"id"`
	SID               uint32          `json:"sid"  gorm:"column:sid"`
	Chain             string          `json:"chain" gorm:"column:chain"`
	Protocol          string          `json:"protocol" gorm:"column:protocol"`
	Tick              string          `json:"tick" gorm:"column:tick"`
	Minted            decimal.Decimal `gorm:"column:minted;type:decimal(38,18)" json:"minted"`
	MintCompletedTime *time.Time      `gorm:"column:mint_completed_time" json:"mint_completed_time"`
	MintFirstBlock    uint64          `gorm:"column:mint_first_block" json:"mint_first_block"`
	MintLastBlock     uint64          `gorm:"column:mint_last_block" json:"mint_last_block"`
	LastSN            uint64          `gorm:"column:last_sn" json:"last_sn"`
	Holders           uint64          `gorm:"column:holders" json:"holders"`
	TxCnt             uint64          `gorm:"column:tx_cnt" json:"tx_cnt"`
	CreatedAt         time.Time       `gorm:"column:created_at" json:"created_at"`
	UpdatedAt         time.Time       `gorm:"column:updated_at" json:"updated_at"`
}

InscriptionsStats inscriptions statistics

func (InscriptionsStats) TableName

func (InscriptionsStats) TableName() string

type Transaction

type Transaction struct {
	ID              uint64          `gorm:"primaryKey" json:"id"`
	ChainId         int64           `json:"chain_id" gorm:"-:all"`
	Protocol        string          `json:"protocol" gorm:"column:protocol"`                   // protocol name
	Chain           string          `json:"chain" gorm:"column:chain"`                         // chain name
	BlockHeight     uint64          `json:"block_height" gorm:"column:block_height"`           // block height
	PositionInBlock uint64          `json:"position_in_block" gorm:"column:position_in_block"` // Position in Block
	BlockTime       time.Time       `json:"block_time" gorm:"column:block_time"`               // block time
	TxHash          []byte          `json:"tx_hash" gorm:"column:tx_hash"`                     // tx hash
	From            string          `json:"from" gorm:"column:from"`                           // from address
	To              string          `json:"to" gorm:"column:to"`                               // to address
	Op              string          `json:"op" gorm:"column:op"`                               // op code
	Tick            string          `json:"tick" gorm:"column:tick"`                           // inscription code
	Amount          decimal.Decimal `json:"amt" gorm:"column:amt;type:decimal(38,18)"`         // balance
	Gas             int64           `json:"gas" gorm:"column:gas"`                             // gas
	GasPrice        int64           `json:"gas_price" gorm:"column:gas_price"`                 // gas price
	Status          int8            `json:"status" gorm:"column:status"`                       // tx status
	CreatedAt       time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt       time.Time       `json:"updated_at" gorm:"column:updated_at"`
}

func (Transaction) TableName

func (Transaction) TableName() string

type TransactionRaw

type TransactionRaw struct {
	ChainInfo
	Id              string
	Hash            string
	From            string
	To              string
	BlockHeight     uint64
	PositionInBlock uint32
	BlockTime       uint64
	Data            string
	OP              string
	Tick            string
	Amt             uint64
	Idx             uint32
	Timestamp       uint64
	Input           string
	Gas             uint64
	Status          uint32
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

type TxEvent

type TxEvent int8
const (
	TransactionEventDeploy   TxEvent = 1
	TransactionEventMint     TxEvent = 2
	TransactionEventTransfer TxEvent = 3
	TransactionEventList     TxEvent = 4
	TransactionEventDelist   TxEvent = 5
	TransactionEventExchange TxEvent = 6
)

type UTXO

type UTXO struct {
	ID        uint64          `gorm:"primaryKey" json:"id"`
	Sn        string          `json:"sn" gorm:"column:sn"`
	Chain     string          `json:"chain" gorm:"column:chain"`
	Protocol  string          `json:"protocol" gorm:"column:protocol"`
	Address   string          `json:"address" gorm:"column:address"`
	Tick      string          `json:"tick" gorm:"column:tick"`
	Amount    decimal.Decimal `json:"amount" gorm:"column:amount;type:decimal(38,18)"` // amount
	RootHash  string          `json:"root_hash" gorm:"column:root_hash"`
	TxHash    string          `json:"tx_hash" gorm:"column:tx_hash"`
	Status    int8            `json:"status" gorm:"column:status"` // tx status
	CreatedAt time.Time       `json:"created_at" gorm:"column:created_at"`
	UpdatedAt time.Time       `json:"updated_at" gorm:"column:updated_at"`
}

func (UTXO) TableName

func (UTXO) TableName() string

type UserInscription

type UserInscription struct {
	Chain         string `json:"chain"`
	Protocol      string `json:"protocol"`
	Tick          string `json:"tick"`
	TotalSupply   string `json:"total_supply"`
	MintedPercent string `json:"minted_percent"`
	LimitPerMint  string `json:"limit_per_mint"`
	Holders       uint64 `json:"holders"`
	Status        uint32 `json:"status"`
	Minted        string `json:"minted"`
	CreatedAt     uint32 `json:"created_at"`
	Address       string `json:"address"`
}

Jump to

Keyboard shortcuts

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