Documentation
¶
Index ¶
- type Event
- type EventCriteria
- type EventFilter
- type LogDB
- func (db *LogDB) Close() error
- func (db *LogDB) FilterEvents(ctx context.Context, filter *EventFilter) ([]*Event, error)
- func (db *LogDB) FilterTransfers(ctx context.Context, filter *TransferFilter) ([]*Transfer, error)
- func (db *LogDB) HasBlockID(id luckyshare.Bytes32) (bool, error)
- func (db *LogDB) Log(f func(*Writer) error) error
- func (db *LogDB) NewestBlockID() (luckyshare.Bytes32, error)
- func (db *LogDB) Path() string
- type Options
- type Order
- type Range
- type Transfer
- type TransferCriteria
- type TransferFilter
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
BlockNumber uint32
Index uint32
BlockID luckyshare.Bytes32
BlockTime uint64
TxID luckyshare.Bytes32
TxOrigin luckyshare.Address //contract caller
ClauseIndex uint32
Address luckyshare.Address // always a contract address
Topics [5]*luckyshare.Bytes32
Data []byte
}
Event represents tx.Event that can be stored in db.
type EventCriteria ¶
type EventCriteria struct {
Address *luckyshare.Address // always a contract address
Topics [5]*luckyshare.Bytes32
}
type EventFilter ¶
type EventFilter struct {
CriteriaSet []*EventCriteria
Range *Range
Options *Options
Order Order //default asc
}
EventFilter filter
type LogDB ¶
type LogDB struct {
// contains filtered or unexported fields
}
func (*LogDB) FilterEvents ¶
func (*LogDB) FilterTransfers ¶
func (*LogDB) HasBlockID ¶
func (db *LogDB) HasBlockID(id luckyshare.Bytes32) (bool, error)
HasBlockID query whether given block id related logs were written.
func (*LogDB) NewestBlockID ¶
func (db *LogDB) NewestBlockID() (luckyshare.Bytes32, error)
NewestBlockID query newest written block id.
type Transfer ¶
type Transfer struct {
BlockNumber uint32
Index uint32
BlockID luckyshare.Bytes32
BlockTime uint64
TxID luckyshare.Bytes32
TxOrigin luckyshare.Address
ClauseIndex uint32
Sender luckyshare.Address
Recipient luckyshare.Address
Amount *big.Int
}
Transfer represents tx.Transfer that can be stored in db.
type TransferCriteria ¶
type TransferCriteria struct {
TxOrigin *luckyshare.Address //who send transaction
Sender *luckyshare.Address //who transferred tokens
Recipient *luckyshare.Address //who recieved tokens
}
type TransferFilter ¶
type TransferFilter struct {
CriteriaSet []*TransferCriteria
Range *Range
Options *Options
Order Order //default asc
}
Click to show internal directories.
Click to hide internal directories.