Documentation
¶
Index ¶
- type LiteClient
- type Observer
- func (ob *Observer) CheckRPCStatus(ctx context.Context) error
- func (ob *Observer) ObserveInbound(ctx context.Context) error
- func (ob *Observer) PostGasPrice(ctx context.Context) error
- func (ob *Observer) ProcessInboundTrackers(ctx context.Context) error
- func (ob *Observer) ProcessOutboundTrackers(ctx context.Context) error
- func (ob *Observer) VoteOutboundIfConfirmed(ctx context.Context, cctx *cc.CrossChainTx) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LiteClient ¶
type LiteClient interface { config.Getter GetMasterchainInfo(ctx context.Context) (liteclient.LiteServerMasterchainInfoC, error) GetBlockHeader(ctx context.Context, blockID ton.BlockIDExt, mode uint32) (tlb.BlockInfo, error) GetTransactionsSince(ctx context.Context, acc ton.AccountID, lt uint64, hash ton.Bits256) ([]ton.Transaction, error) GetFirstTransaction(ctx context.Context, acc ton.AccountID) (*ton.Transaction, int, error) GetTransaction(ctx context.Context, acc ton.AccountID, lt uint64, hash ton.Bits256) (ton.Transaction, error) }
LiteClient represents a TON client see https://github.com/ton-blockchain/ton/blob/master/tl/generate/scheme/tonlib_api.tl
type Observer ¶
Observer is a TON observer.
func New ¶
func New(bo *base.Observer, client LiteClient, gateway *toncontracts.Gateway) (*Observer, error)
New constructor for TON Observer.
func (*Observer) CheckRPCStatus ¶
CheckRPCStatus checks TON RPC status and alerts if necessary.
func (*Observer) ObserveInbound ¶
ObserveInbound observes Gateway's account for new transactions [INBOUND AND OUTBOUND]
Due to TON's architecture we have to scan for all net-new transactions. The main purpose is to observe inbounds from TON. Note that we might also have *outbounds* here (if a signer broadcasts a tx, it will be observed here).
The name `ObserveInbound` is used for consistency with other chains.
func (*Observer) PostGasPrice ¶
PostGasPrice fetches on-chain gas config and reports it to Zetacore.
func (*Observer) ProcessInboundTrackers ¶
ProcessInboundTrackers handles adhoc trackers that were somehow missed by
func (*Observer) ProcessOutboundTrackers ¶
ProcessOutboundTrackers pulls outbounds trackers from zetacore, fetches txs from TON and stores them in memory for further use.
func (*Observer) VoteOutboundIfConfirmed ¶
func (ob *Observer) VoteOutboundIfConfirmed(ctx context.Context, cctx *cc.CrossChainTx) (bool, error)
VoteOutboundIfConfirmed checks outbound status and returns (continueKeysign, error)