Documentation
¶
Index ¶
- Constants
- Variables
- type Attrs
- type Contract
- func (c *Contract) Close() error
- func (c *Contract) DoneSignal() <-chan struct{}
- func (c *Contract) GetContractDesc(programId string) (ContractDesc, error)
- func (c *Contract) GetProcessedTxSignature() solana.Signature
- func (c *Contract) HandleEvent(client *rpcclient.SolClient, event Event, txInfo TxInfo) error
- func (c *Contract) Init(attrs Attrs)
- func (c *Contract) RegisterEventHook(event Event, f func(client *rpcclient.SolClient, txInfo TxInfo) error) error
- func (c *Contract) Scan(client *rpcclient.SolClient) error
- func (c *Contract) UpdateProcessedTxSignature(txSig solana.Signature) error
- type ContractDesc
- type Event
- type IContract
- type TxInfo
Constants ¶
View Source
const DefaultWatchLimit = 1000
Variables ¶
View Source
var NotFoundProgramDataErr = errors.New("program data not found")
Functions ¶
This section is empty.
Types ¶
type Attrs ¶
type Attrs struct {
ChainId uint64
Chain string
DeployedSlot uint64 // contract deployment slot
// has been processed on tx signature
// can set the earliest transaction signature to start
ProcessedTxSignature solana.Signature
WatchBlockLimit int // Limit the number of blocks scanned each time, default is 1000
ContractToDesc map[string]ContractDesc // key is programId
}
type Contract ¶
type Contract struct {
Attrs
ProgramId solana.PublicKey
IsRunning atomic.Bool
IsClose atomic.Bool
// contains filtered or unexported fields
}
func (*Contract) DoneSignal ¶
func (c *Contract) DoneSignal() <-chan struct{}
func (*Contract) GetContractDesc ¶
func (c *Contract) GetContractDesc(programId string) (ContractDesc, error)
func (*Contract) GetProcessedTxSignature ¶
GetProcessedTxSignature ...
func (*Contract) HandleEvent ¶
HandleEvent method call Hook
type ContractDesc ¶
type IContract ¶
type IContract interface {
Init(attrs Attrs)
Close() error
DoneSignal() <-chan struct{}
RegisterEventHook(event Event, f func(client *rpcclient.SolClient, txInfo TxInfo) error) error
HandleEvent(client *rpcclient.SolClient, event Event, txInfo TxInfo) error
UpdateProcessedTxSignature(txSig solana.Signature) error
GetProcessedBlockNumber() solana.Signature
Scan(client *rpcclient.SolClient) error
GetContractDesc(programId string) (ContractDesc, error)
}
Click to show internal directories.
Click to hide internal directories.