devents

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperateDeploy   string = "deploy"
	OperateMint     string = "mint"
	OperateTransfer string = "transfer"
	OperateList     string = "list"
	OperateDelist   string = "delist"
	OperateExchange string = "exchange"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressTxEvent

type AddressTxEvent struct {
	Address        string
	RelatedAddress string
	Amount         decimal.Decimal
}

type BalanceTxEvent

type BalanceTxEvent struct {
	Action           DBAction
	SID              uint64
	Address          string
	Amount           decimal.Decimal
	AvailableBalance decimal.Decimal
	OverallBalance   decimal.Decimal
}

type DBAction

type DBAction string
const (
	DBActionCreate DBAction = "create"
	DBActionUpdate DBAction = "update"
)

type DBModelEvent

type DBModelEvent struct {
	Tx               *model.Transaction
	Inscriptions     map[DBAction]*model.Inscriptions
	InscriptionStats map[DBAction]*model.InscriptionsStats
	Balances         map[DBAction][]*model.Balances
	AddressTxs       []*model.AddressTxs
	BalanceTxs       []*model.BalanceTxn
}

type DBModels

type DBModels struct {
	Inscriptions     map[DBAction]map[uint32]*model.Inscriptions
	InscriptionStats map[DBAction]map[uint32]*model.InscriptionsStats
	Balances         map[DBAction]map[uint64]*model.Balances
	Txs              map[string]*model.Transaction
	AddressTxs       []*model.AddressTxs
	BalanceTxs       []*model.BalanceTxn
}

type DBModelsFattened

type DBModelsFattened struct {
	Inscriptions     map[DBAction][]*model.Inscriptions
	InscriptionStats map[DBAction][]*model.InscriptionsStats
	Balances         map[DBAction][]*model.Balances
	Txs              []*model.Transaction
	AddressTxs       []*model.AddressTxs
	BalanceTxs       []*model.BalanceTxn
	BlockStatus      *model.BlockStatus
}

func BuildDBUpdateModel

func BuildDBUpdateModel(blocksEvents []*Event) (dmf *DBModelsFattened)

type DEvent

type DEvent struct {
	// contains filtered or unexported fields
}

func NewDEvents

func NewDEvents(ctx context.Context, db *storage.DBClient) *DEvent

func (*DEvent) Flush

func (h *DEvent) Flush()

func (*DEvent) Read

func (h *DEvent) Read(num int) (items []*Event)

func (*DEvent) Sink

func (h *DEvent) Sink(db *storage.DBClient) bool

func (*DEvent) WriteDBAsync

func (h *DEvent) WriteDBAsync(e *Event)

type Deploy

type Deploy struct {
	Name      string
	MaxSupply decimal.Decimal
	MintLimit decimal.Decimal
	Decimal   int8
}

type Event

type Event struct {
	Chain     string
	ChainId   int64
	BlockNum  uint64
	BlockTime uint64
	BlockHash string
	Items     []*DBModelEvent
}

type MetaData

type MetaData struct {
	Chain    string
	Protocol string `json:"p"`
	Operate  string `json:"op"`
	Tick     string `json:"tick"`
	Data     string
}

func (*MetaData) Copy

func (original *MetaData) Copy() *MetaData

type Mint

type Mint struct {
	Minter string
	Amount decimal.Decimal
	Init   bool
}

type Receive

type Receive struct {
	Address string
	Amount  decimal.Decimal
	Init    bool
}

type Transfer

type Transfer struct {
	Sender   string
	Receives []*Receive
}

type TxResult

type TxResult struct {
	MD       *MetaData
	Block    *xycommon.RpcBlock
	Tx       *xycommon.RpcTransaction
	Mint     *Mint
	Deploy   *Deploy
	Transfer *Transfer
}

type TxResultHandler

type TxResultHandler struct {
	// contains filtered or unexported fields
}

func NewTxResultHandler

func NewTxResultHandler(cache *dcache.Manager) *TxResultHandler

func (*TxResultHandler) BuildAddressTxEvents

func (tc *TxResultHandler) BuildAddressTxEvents(e *TxResult) []*AddressTxEvent

func (*TxResultHandler) BuildAddressTxs

func (tc *TxResultHandler) BuildAddressTxs(e *TxResult) (txs []*model.AddressTxs)

func (*TxResultHandler) BuildBalance

func (tc *TxResultHandler) BuildBalance(e *TxResult) (txns []*model.BalanceTxn, balances map[DBAction][]*model.Balances)

func (*TxResultHandler) BuildBalanceTxEvents

func (tc *TxResultHandler) BuildBalanceTxEvents(e *TxResult) []BalanceTxEvent

func (*TxResultHandler) BuildInscription

func (tc *TxResultHandler) BuildInscription(e *TxResult) map[DBAction]*model.Inscriptions

func (*TxResultHandler) BuildInscriptionStat

func (tc *TxResultHandler) BuildInscriptionStat(e *TxResult) map[DBAction]*model.InscriptionsStats

func (*TxResultHandler) BuildModel

func (tc *TxResultHandler) BuildModel(r *TxResult) *DBModelEvent

func (*TxResultHandler) BuildTx

func (tc *TxResultHandler) BuildTx(e *TxResult) *model.Transaction

func (*TxResultHandler) UpdateCache

func (tc *TxResultHandler) UpdateCache(r *TxResult)

Jump to

Keyboard shortcuts

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