txcache

package
v0.0.0-...-4fc266b Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigStorageEmpty = errors.New("config storage is empty")
	ErrUnknownTransaction = errors.New("unknown transaction")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug                 bool `json:"debug"`
	Confirmations         int  `json:"confirmations"`
	RegisterConfirmations int  `json:"registerConfirmations"`
	StoreIncomingTx       bool `json:"storeIncomingTx"`
	StoreOutgoingTx       bool `json:"storeOutgoingTx"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (*Config) Load

func (c *Config) Load() (err error)

func (*Config) Save

func (c *Config) Save() (err error)

type Manager

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

func NewManager

func NewManager(options ...ManagerOption) (*Manager, error)

func (*Manager) BlockEvent

func (m *Manager) BlockEvent(blockNum int64, blockId string)

func (*Manager) DumpDb

func (m *Manager) DumpDb()

func (*Manager) GetTransferInfo

func (m *Manager) GetTransferInfo(txHash string) (tx *types.TransferInfo, err error)

func (*Manager) GetTransfersByAddress

func (m *Manager) GetTransfersByAddress(address string) (txs []*types.TransferInfo, err error)

func (*Manager) TransactionEvent

func (m *Manager) TransactionEvent(transactionInfo *types.TransferInfo)

type ManagerOption

type ManagerOption func(*Manager) error

func WithConfigStorage

func WithConfigStorage(storage storage.BinStorage) ManagerOption

func WithTxStorage

func WithTxStorage(storage *storage.BadgerHoldStorage) ManagerOption

type TransferInfoCachedRecord

type TransferInfoCachedRecord struct {
	TxID              string   `json:"txId" badgerhold:"key"`
	Timestamp         int64    `json:"timestamp"`
	BlockNum          int      `json:"blockNum"`
	Success           bool     `json:"success"`
	Transfer          bool     `json:"transfer"`
	NativeCoin        bool     `json:"nativeCoin,omitempty"`
	Symbol            string   `json:"symbol,omitempty"`
	SmartContract     bool     `json:"smartContract,omitempty"`
	From              string   `json:"from" storm:"index"`
	To                string   `json:"to" storm:"index"`
	Fee               *big.Int `json:"fee"`
	Amount            *big.Int `json:"amount"`
	Token             string   `json:"token,omitempty"`
	TokenSymbol       string   `json:"tokenSymbol,omitempty"`
	InPool            bool     `json:"inPool"`
	Confirmed         bool     `json:"confirmed"`
	Confirmations     int      `json:"confirmations"`
	Decimals          int      `json:"decimals"`
	ChainSpecificData []byte   `json:"chainSpecificData,omitempty"`
}

Jump to

Keyboard shortcuts

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