Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockchainSource ¶
type BlockchainSource struct {
// contains filtered or unexported fields
}
BlockchainSource notifies about transactions in the TON blockchain.
func NewBlockchainSource ¶
func NewBlockchainSource(logger *zap.Logger, servers []config.LiteServer) (*BlockchainSource, error)
func (*BlockchainSource) Run ¶
func (b *BlockchainSource) Run(ctx context.Context) chan indexer.IDandBlock
func (*BlockchainSource) SubscribeToTransactions ¶
func (b *BlockchainSource) SubscribeToTransactions(ctx context.Context, deliverFn DeliveryFn, opts SubscribeToTransactionsOptions) CancelFn
type DeliveryFn ¶
type DeliveryFn func(eventData []byte)
DeliveryFn describes a callback that will be triggered once an event happens.
type MemPool ¶
type MemPool struct {
// contains filtered or unexported fields
}
MemPool implements "MemPoolSource" interface and provides a method to subscribe to pending inbound messages.
func NewMemPool ¶
func (*MemPool) Run ¶
Run runs a goroutine with a fan-out event-loop that resends an incoming payload to all subscribers.
func (*MemPool) SubscribeToMessages ¶
type MemPoolSource ¶
type MemPoolSource interface {
SubscribeToMessages(ctx context.Context, deliveryFn DeliveryFn) (CancelFn, error)
}
MemPoolSource provides a method to subscribe to notifications about pending inbound messages.
type MessageEventData ¶
type MessageEventData struct {
BOC []byte `json:"boc"`
}
MessageEventData represents a notification about a new pending inbound message. This is part of our API contract with subscribers.
type TransactionDispatcher ¶
type TransactionDispatcher struct {
// contains filtered or unexported fields
}
TransactionDispatcher implements the fan-out pattern reading a TransactionEvent from a single channel and delivering it to multiple subscribers.
func NewTransactionDispatcher ¶
func NewTransactionDispatcher(logger *zap.Logger) *TransactionDispatcher
func (*TransactionDispatcher) RegisterSubscriber ¶
func (disp *TransactionDispatcher) RegisterSubscriber(fn DeliveryFn, options SubscribeToTransactionsOptions) CancelFn
func (*TransactionDispatcher) Run ¶
func (disp *TransactionDispatcher) Run(ctx context.Context) chan TransactionEvent
Run runs a dispatching loop in a dedicated goroutine and returns a channel to be used to communicate with this dispatcher.
type TransactionEvent ¶
TransactionEvent is a notification event about a new transaction between a TransactionSource instance and a dispatcher.
type TransactionEventData ¶
type TransactionEventData struct {
AccountID tongo.AccountID `json:"account_id"`
Lt uint64 `json:"lt"`
TxHash string `json:"tx_hash"`
}
TransactionEventData represents a notification about a new transaction. This is part of our API contract with subscribers.
type TransactionSource ¶
type TransactionSource interface {
SubscribeToTransactions(ctx context.Context, deliveryFn DeliveryFn, opts SubscribeToTransactionsOptions) CancelFn
}
TransactionSource provides a method to subscribe to notifications about new transactions from the blockchain.