gwatch

package module
v0.0.0-...-5068620 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 7 Imported by: 0

README

gwatch-chain

gwatch-chain

Go Version License

gwatch-chain is a Golang SDK for blockchain scanning.


watch transaction events on the blockchain

区块扫描,合约事件扫描

supports

  • evm
    • erc20
    • erc721
    • other...
    • 支持topics过滤方式,过滤erc20类的from地址或to地址
  • tvm
  • solana
    • 仅支持base64 decode
    • 仅支持新项目的扫描任务(官方rpc限制,推荐在已产生交易数量仅在几百条内使用)

通过注册Hook function的方式,处理合约事件

简单用例请查看gwatch_test.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IWatch

type IWatch interface {
	Watch() error

	Close() error
	DoneSignal() <-chan struct{}
	RegisterWatchEvent(events ...abs.Event) error
	RegisterWatchTopics(topicsIndex int, topics ...common.Hash) error
	RegisterEventHook(event abs.Event, f func(client *rpcclient.EvmClient, log types.Log) error) error
	UpdateProcessedBlockNumber(num uint64) error
	GetProcessedBlockNumber() uint64
	GetContractDesc(addr string) (abs.ContractDesc, error)
}

func NewGeneralWatch

func NewGeneralWatch(rawurls []string, addrs []common.Address, ops *Options) (IWatch, error)

func NewLoadBalanceGeneralWatch

func NewLoadBalanceGeneralWatch(lb loadbalance.LoadBalance[*rpcclient.EvmClient], addrs []common.Address, ops *Options) (IWatch, error)

type Options

type Options struct {
	abs.Attrs
}

Jump to

Keyboard shortcuts

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