watcher

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Transaction status
	TxStatusSuccess      = "0x1"
	TxStatusFailReverted = "0x0"
)
View Source
const (
	MethodDepositTokens   = "deposit_tokens"
	MethodWithdrawTokens  = "withdraw_tokens"
	MethodRegisterAsset   = "register_asset"
	MethodContractUpgrade = "contract_upgrade"
	MethodCompleteWrapped = "complete_transfer_wrapped"
	MethodCompleteNative  = "complete_transfer_native"
	MethodCompleteTerra   = "complete_transfer_terra_native"
	MethodReplyHandler    = "reply_handler"
)

Terra action methods.

View Source
const CompleteTransferMethod = "complete_transfer::submit_vaa_and_register_entry"

Variables

View Source
var (
	ErrTxfailedCannotBeUpdated = errors.New("tx with status failed can not be updated because exists a confirmed tx for the same vaa ID")
	ErrTxUnknowCannotBeUpdated = errors.New("tx with status unknown can not be updated because exists a tx (confirmed|failed) for the same vaa ID")
	ErrInvalidTxStatus         = errors.New("invalid tx status")
)

Functions

This section is empty.

Types

type AptosParams

type AptosParams struct {
	Blockchain      string
	ContractAddress string
	SizeBlocks      uint8
	WaitSeconds     uint16
	InitialBlock    int64
}

type AptosWatcher

type AptosWatcher struct {
	// contains filtered or unexported fields
}

func NewAptosWatcher

func NewAptosWatcher(client *aptos.AptosSDK, params AptosParams, repo *storage.Repository, metrics metrics.Metrics, logger *zap.Logger) *AptosWatcher

func (*AptosWatcher) Backfill

func (w *AptosWatcher) Backfill(ctx context.Context, fromBlock uint64, toBlock uint64, pageSize uint64, persistBlock bool)

func (*AptosWatcher) Close

func (w *AptosWatcher) Close()

func (*AptosWatcher) Start

func (w *AptosWatcher) Start(ctx context.Context) error

type ContractWatcher

type ContractWatcher interface {
	Start(ctx context.Context) error
	Close()
	Backfill(ctx context.Context, fromBlock uint64, toBlock uint64, pageSize uint64, persistBlock bool)
}

ContractTracker is an interface for tracking contracts It Tracks contract operations and persist the tx data Backfill is used to backfill the contract data from the past

type EVMAddressesParams

type EVMAddressesParams struct {
	ChainID      vaa.ChainID
	Blockchain   string
	SizeBlocks   uint8
	WaitSeconds  uint16
	InitialBlock int64
}

type EVMParams

type EVMParams struct {
	ChainID          vaa.ChainID
	Blockchain       string
	SizeBlocks       uint8
	WaitSeconds      uint16
	InitialBlock     int64
	MethodsByAddress map[string][]config.BlockchainMethod
}

type EVMWatcher

type EVMWatcher struct {
	// contains filtered or unexported fields
}

func NewEVMWatcher

func NewEVMWatcher(client *ankr.AnkrSDK, repo *storage.Repository, params EVMParams, metrics metrics.Metrics, logger *zap.Logger) *EVMWatcher

func (*EVMWatcher) Backfill

func (w *EVMWatcher) Backfill(ctx context.Context, fromBlock uint64, toBlock uint64, pageSize uint64, persistBlock bool)

func (*EVMWatcher) Close

func (w *EVMWatcher) Close()

func (*EVMWatcher) Start

func (w *EVMWatcher) Start(ctx context.Context) error

type EvmGetStatusFunc

type EvmGetStatusFunc func() (string, error)

type EvmStandardWatcher

type EvmStandardWatcher struct {
	// contains filtered or unexported fields
}

func NewEvmStandardWatcher

func NewEvmStandardWatcher(client *evm.EvmSDK, params EVMParams, repo *storage.Repository, metrics metrics.Metrics, logger *zap.Logger) *EvmStandardWatcher

func (*EvmStandardWatcher) Backfill

func (w *EvmStandardWatcher) Backfill(ctx context.Context, fromBlock uint64, toBlock uint64, pageSize uint64, persistBlock bool)

func (*EvmStandardWatcher) Close

func (w *EvmStandardWatcher) Close()

func (*EvmStandardWatcher) Start

func (w *EvmStandardWatcher) Start(ctx context.Context) error

type EvmTransaction

type EvmTransaction struct {
	Hash           string
	From           string
	To             string
	Status         EvmGetStatusFunc
	BlockNumber    string
	BlockTimestamp string
	Input          string
}

type FuncGetGlobalTransactionById

type FuncGetGlobalTransactionById func(ctx context.Context, id string) (storage.TransactionUpdate, error)

type SolanaParams

type SolanaParams struct {
	Blockchain      string
	ContractAddress solana_types.PublicKey
	SizeBlocks      uint8
	WaitSeconds     uint16
	InitialBlock    int64
}

type SolanaWatcher

type SolanaWatcher struct {
	// contains filtered or unexported fields
}

func NewSolanaWatcher

func NewSolanaWatcher(client *solana.SolanaSDK, repo *storage.Repository, params SolanaParams, metrics metrics.Metrics, logger *zap.Logger) *SolanaWatcher

func (*SolanaWatcher) Backfill

func (w *SolanaWatcher) Backfill(ctx context.Context, fromBlock uint64, toBlock uint64, pageSize uint64, persistBlock bool)

func (*SolanaWatcher) Close

func (w *SolanaWatcher) Close()

func (*SolanaWatcher) Start

func (w *SolanaWatcher) Start(ctx context.Context) error

type TerraParams

type TerraParams struct {
	ChainID         vaa.ChainID
	Blockchain      string
	ContractAddress string
	WaitSeconds     uint16
	InitialBlock    int64
}

TerraParams are the params for the terra watcher.

type TerraWatcher

type TerraWatcher struct {
	// contains filtered or unexported fields
}

Terrawatcher is a watcher for the terra chain.

func NewTerraWatcher

func NewTerraWatcher(terraSDK *terra.TerraSDK, params TerraParams, repository *storage.Repository, metrics metrics.Metrics, logger *zap.Logger) *TerraWatcher

NewTerraWatcher creates a new terra watcher.

func (*TerraWatcher) Backfill

func (w *TerraWatcher) Backfill(ctx context.Context, fromBlock uint64, toBlock uint64, pageSize uint64, persistBlock bool)

func (*TerraWatcher) Close

func (w *TerraWatcher) Close()

func (*TerraWatcher) Start

func (w *TerraWatcher) Start(ctx context.Context) error

Start starts the terra watcher.

Jump to

Keyboard shortcuts

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