listener

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinanceCallBackJob

type BinanceCallBackJob struct {
	*EthCallbackJob
}

type BinanceListener

type BinanceListener struct {
	*EthereumListener
	// contains filtered or unexported fields
}

func NewBinanceListener

func NewBinanceListener(ctx context.Context, cfg *bridgeCore.LsConfig, helpers utils.Utils, store bridgeCoreStores.MainStore) (*BinanceListener, error)

func (*BinanceListener) NewJobFromDB

func (*BinanceListener) WithdrewDone2SlackCallback

func (l *BinanceListener) WithdrewDone2SlackCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

WithdrewDone2SlackCallback send the withdrew event rto slack channel through slack hook

type CrossbellCallBackJob

type CrossbellCallBackJob struct {
	*EthCallbackJob
}

type CrossbellListener

type CrossbellListener struct {
	*EthereumListener
	// contains filtered or unexported fields
}

func NewCrossbellListener

func NewCrossbellListener(ctx context.Context, cfg *bridgeCore.LsConfig, helpers utils.Utils, store bridgeCoreStores.MainStore) (*CrossbellListener, error)

func (*CrossbellListener) DepositRequestedCallback

func (l *CrossbellListener) DepositRequestedCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*CrossbellListener) IsUpTodate

func (l *CrossbellListener) IsUpTodate() bool

func (*CrossbellListener) NewJobFromDB

func (*CrossbellListener) ProvideReceiptSignatureCallback

func (l *CrossbellListener) ProvideReceiptSignatureCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*CrossbellListener) RequestDepositedDoneCallback

func (l *CrossbellListener) RequestDepositedDoneCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

set requestDeposit as done

func (*CrossbellListener) RequestWithdrewDoneCallback

func (l *CrossbellListener) RequestWithdrewDoneCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

StoreMainchainWithdrawCallback stores the receipt to own database for future check from ProvideReceiptSignatureCallback

func (*CrossbellListener) StoreBatchSubmitWithdrawalSignatures

func (l *CrossbellListener) StoreBatchSubmitWithdrawalSignatures(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*CrossbellListener) StoreCrossbellDepositedCallback

func (l *CrossbellListener) StoreCrossbellDepositedCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

store Deposited event

func (*CrossbellListener) StoreDepositAck

func (l *CrossbellListener) StoreDepositAck(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

func (*CrossbellListener) StoreRequestDeposit

func (l *CrossbellListener) StoreRequestDeposit(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

store deposit request from mainchain

func (*CrossbellListener) StoreRequestWithdrawal

func (l *CrossbellListener) StoreRequestWithdrawal(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

type EmptyTransaction

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

func NewEmptyTransaction

func NewEmptyTransaction(chainId *big.Int, tx common.Hash, data []byte, from, to *common.Address) *EmptyTransaction

func (*EmptyTransaction) GetData

func (b *EmptyTransaction) GetData() []byte

func (*EmptyTransaction) GetFromAddress

func (b *EmptyTransaction) GetFromAddress() string

func (*EmptyTransaction) GetHash

func (b *EmptyTransaction) GetHash() common.Hash

func (*EmptyTransaction) GetToAddress

func (b *EmptyTransaction) GetToAddress() string

func (*EmptyTransaction) GetValue

func (b *EmptyTransaction) GetValue() *big.Int

type EthBlock

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

func NewEthBlock

func NewEthBlock(client utils.EthClient, chainId *big.Int, block *ethtypes.Block, getLogs bool) (*EthBlock, error)

func (*EthBlock) GetHash

func (b *EthBlock) GetHash() common.Hash

func (*EthBlock) GetHeight

func (b *EthBlock) GetHeight() uint64

func (*EthBlock) GetLogs

func (b *EthBlock) GetLogs() []bridgeCore.Log

func (*EthBlock) GetTimestamp

func (b *EthBlock) GetTimestamp() uint64

func (*EthBlock) GetTransactions

func (b *EthBlock) GetTransactions() []bridgeCore.Transaction

type EthCallbackJob

type EthCallbackJob struct {
	*bridgeCore.BaseJob
	// contains filtered or unexported fields
}

func NewEthCallbackJob

func NewEthCallbackJob(listener bridgeCore.Listener, method string, tx bridgeCore.Transaction, data []byte, fromChainID *big.Int, helpers utils.Utils) *EthCallbackJob

func (*EthCallbackJob) Process

func (e *EthCallbackJob) Process() ([]byte, error)

func (*EthCallbackJob) Save

func (e *EthCallbackJob) Save() error

func (*EthCallbackJob) Update

func (e *EthCallbackJob) Update(status string) error

type EthListenJob

type EthListenJob struct {
	*bridgeCore.BaseJob
}

func NewEthListenJob

func NewEthListenJob(jobType int, listener bridgeCore.Listener, subscriptionName string, tx bridgeCore.Transaction, data []byte) *EthListenJob

type EthLog

type EthLog ethtypes.Log

func (*EthLog) GetContractAddress

func (e *EthLog) GetContractAddress() string

func (*EthLog) GetData

func (e *EthLog) GetData() []byte

func (*EthLog) GetIndex

func (e *EthLog) GetIndex() uint

func (*EthLog) GetTopics

func (e *EthLog) GetTopics() (topics []string)

func (*EthLog) GetTransactionHash

func (e *EthLog) GetTransactionHash() string

func (*EthLog) GetTxIndex

func (e *EthLog) GetTxIndex() uint

type EthTransaction

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

func NewEthTransaction

func NewEthTransaction(chainId *big.Int, tx *ethtypes.Transaction) (*EthTransaction, error)

func NewEthTransactionWithoutError

func NewEthTransactionWithoutError(chainId *big.Int, tx *ethtypes.Transaction) *EthTransaction

func (*EthTransaction) GetData

func (b *EthTransaction) GetData() []byte

func (*EthTransaction) GetFromAddress

func (b *EthTransaction) GetFromAddress() string

func (*EthTransaction) GetHash

func (b *EthTransaction) GetHash() common.Hash

func (*EthTransaction) GetToAddress

func (b *EthTransaction) GetToAddress() string

func (*EthTransaction) GetValue

func (b *EthTransaction) GetValue() *big.Int

type EthereumListener

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

func NewEthereumListener

func NewEthereumListener(ctx context.Context, cfg *bridgeCore.LsConfig, helpers utils.Utils, store stores.MainStore) (*EthereumListener, error)

func (*EthereumListener) AddListeners

func (e *EthereumListener) AddListeners(m map[string]bridgeCore.Listener)

func (*EthereumListener) AddTask

func (e *EthereumListener) AddTask(task bridgeCore.TaskHandler)

func (*EthereumListener) Close

func (e *EthereumListener) Close()

func (*EthereumListener) Config

func (e *EthereumListener) Config() *bridgeCore.LsConfig

func (*EthereumListener) Context

func (e *EthereumListener) Context() context.Context

func (*EthereumListener) GetBlock

func (e *EthereumListener) GetBlock(height uint64) (bridgeCore.Block, error)

func (*EthereumListener) GetBlockWithLogs

func (e *EthereumListener) GetBlockWithLogs(height uint64) (bridgeCore.Block, error)

func (*EthereumListener) GetChainID

func (e *EthereumListener) GetChainID() (*big.Int, error)

func (*EthereumListener) GetCurrentBlock

func (e *EthereumListener) GetCurrentBlock() bridgeCore.Block

func (*EthereumListener) GetDecimals

func (e *EthereumListener) GetDecimals() map[uint64]uint64

func (*EthereumListener) GetDomainSeparators

func (e *EthereumListener) GetDomainSeparators() map[uint64]string

func (*EthereumListener) GetEthClient

func (e *EthereumListener) GetEthClient() utils.EthClient

func (*EthereumListener) GetInitHeight

func (e *EthereumListener) GetInitHeight() uint64

func (*EthereumListener) GetLatestBlock

func (e *EthereumListener) GetLatestBlock() (bridgeCore.Block, error)

func (*EthereumListener) GetLatestBlockHeight

func (e *EthereumListener) GetLatestBlockHeight() (uint64, error)

func (*EthereumListener) GetListenHandleJob

func (e *EthereumListener) GetListenHandleJob(subscriptionName string, tx bridgeCore.Transaction, eventId string, data []byte) bridgeCore.JobHandler

func (*EthereumListener) GetListener

func (e *EthereumListener) GetListener(s string) bridgeCore.Listener

func (*EthereumListener) GetName

func (e *EthereumListener) GetName() string

func (*EthereumListener) GetPreventOmissionRange

func (e *EthereumListener) GetPreventOmissionRange() uint64

func (*EthereumListener) GetProcessedBlock

func (e *EthereumListener) GetProcessedBlock() (bridgeCore.Block, error)

func (*EthereumListener) GetReceipt

func (e *EthereumListener) GetReceipt(txHash common.Hash) (*ethtypes.Receipt, error)

func (*EthereumListener) GetSafeBlockRange

func (e *EthereumListener) GetSafeBlockRange() uint64

func (*EthereumListener) GetScanUrls added in v0.0.10

func (e *EthereumListener) GetScanUrls() map[uint64]string

func (*EthereumListener) GetStore

func (e *EthereumListener) GetStore() stores.MainStore

func (*EthereumListener) GetSubscriptions

func (e *EthereumListener) GetSubscriptions() map[string]*bridgeCore.Subscribe

func (*EthereumListener) GetTask

func (e *EthereumListener) GetTask(index int) bridgeCore.TaskHandler

func (*EthereumListener) GetTasks

func (e *EthereumListener) GetTasks() []bridgeCore.TaskHandler

func (*EthereumListener) GetValidatorSign

func (e *EthereumListener) GetValidatorSign() bridgeCoreUtils.ISign

func (*EthereumListener) IsDisabled

func (e *EthereumListener) IsDisabled() bool

func (*EthereumListener) IsUpTodate

func (e *EthereumListener) IsUpTodate() bool

func (*EthereumListener) NewJobFromDB

func (*EthereumListener) Period

func (e *EthereumListener) Period() time.Duration

func (*EthereumListener) SaveCurrentBlockToDB

func (e *EthereumListener) SaveCurrentBlockToDB() error

func (*EthereumListener) SaveTransactionsToDB

func (e *EthereumListener) SaveTransactionsToDB(txs []bridgeCore.Transaction) error

func (*EthereumListener) SendCallbackJobs

func (e *EthereumListener) SendCallbackJobs(listeners map[string]bridgeCore.Listener, subscriptionName string, tx bridgeCore.Transaction, inputData []byte)

func (*EthereumListener) SetInitHeight

func (e *EthereumListener) SetInitHeight(height uint64)

func (*EthereumListener) SetPrepareJobChan

func (e *EthereumListener) SetPrepareJobChan(jobChan chan bridgeCore.JobHandler)

func (*EthereumListener) Start

func (e *EthereumListener) Start()

func (*EthereumListener) UpdateCurrentBlock

func (e *EthereumListener) UpdateCurrentBlock(block bridgeCore.Block) error

func (*EthereumListener) WithdrewDone2SlackCallback

func (l *EthereumListener) WithdrewDone2SlackCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

WithdrewDone2SlackCallback send the withdrew event rto slack channel through slack hook

type PolygonCallBackJob

type PolygonCallBackJob struct {
	*EthCallbackJob
}

type PolygonListener

type PolygonListener struct {
	*EthereumListener
	// contains filtered or unexported fields
}

func NewPolygonListener

func NewPolygonListener(ctx context.Context, cfg *bridgeCore.LsConfig, helpers utils.Utils, store bridgeCoreStores.MainStore) (*PolygonListener, error)

func (*PolygonListener) NewJobFromDB

func (*PolygonListener) WithdrewDone2SlackCallback

func (l *PolygonListener) WithdrewDone2SlackCallback(fromChainId *big.Int, tx bridgeCore.Transaction, data []byte) error

WithdrewDone2SlackCallback send the withdrew event rto slack channel through slack hook

Jump to

Keyboard shortcuts

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