Documentation ¶
Index ¶
- type EVMClient
- func (c *EVMClient) AddSignedTxItem(hash string, height int64, vaultPubKey string, toi *stypes.TxOutItem) error
- func (c *EVMClient) BroadcastTx(txOutItem stypes.TxOutItem, hexTx []byte) (string, error)
- func (c *EVMClient) ConfirmationCountReady(txIn stypes.TxIn) bool
- func (c *EVMClient) GetAccount(pk common.PubKey, height *big.Int) (common.Account, error)
- func (c *EVMClient) GetAccountByAddress(address string, height *big.Int) (common.Account, error)
- func (c *EVMClient) GetAddress(poolPubKey common.PubKey) string
- func (c *EVMClient) GetBalance(addr, token string, height *big.Int) (*big.Int, error)
- func (c *EVMClient) GetBalances(addr string, height *big.Int) (common.Coins, error)
- func (c *EVMClient) GetBlockScannerHeight() (int64, error)
- func (c *EVMClient) GetChain() common.Chain
- func (c *EVMClient) GetConfig() config.BifrostChainConfiguration
- func (c *EVMClient) GetConfirmationCount(txIn stypes.TxIn) int64
- func (c *EVMClient) GetGasFee(gas uint64) common.Gas
- func (c *EVMClient) GetGasPrice() *big.Int
- func (c *EVMClient) GetHeight() (int64, error)
- func (c *EVMClient) GetLatestTxForVault(vault string) (string, string, error)
- func (c *EVMClient) IsBlockScannerHealthy() bool
- func (c *EVMClient) OnObservedTxIn(txIn stypes.TxInItem, blockHeight int64)
- func (c *EVMClient) ReportSolvency(height int64) error
- func (c *EVMClient) ShouldReportSolvency(height int64) bool
- func (c *EVMClient) SignTx(tx stypes.TxOutItem, height int64) ([]byte, []byte, *stypes.TxInItem, error)
- func (c *EVMClient) Start(globalTxsQueue chan stypes.TxIn, globalErrataQueue chan stypes.ErrataBlock, ...)
- func (c *EVMClient) Stop()
- type EVMScanner
- func (e *EVMScanner) FetchMemPool(_ int64) (stypes.TxIn, error)
- func (e *EVMScanner) FetchTxs(height, chainHeight int64) (stypes.TxIn, error)
- func (e *EVMScanner) GetGasPrice() *big.Int
- func (e *EVMScanner) GetHeight() (int64, error)
- func (e *EVMScanner) GetNonce(addr string) (uint64, error)
- func (e *EVMScanner) GetNonceFinalized(addr string) (uint64, error)
- func (e *EVMScanner) GetTokens() ([]*evmtypes.TokenMeta, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EVMClient ¶
type EVMClient struct {
// contains filtered or unexported fields
}
EVMClient is a generic client for interacting with EVM chains.
func NewEVMClient ¶
func NewEVMClient( thorKeys *thorclient.Keys, cfg config.BifrostChainConfiguration, server *tssp.TssServer, bridge thorclient.ThorchainBridge, m *metrics.Metrics, pubkeyMgr pubkeymanager.PubKeyValidator, poolMgr thorclient.PoolManager, ) (*EVMClient, error)
NewEVMClient creates a new EVMClient.
func (*EVMClient) AddSignedTxItem ¶
func (c *EVMClient) AddSignedTxItem(hash string, height int64, vaultPubKey string, toi *stypes.TxOutItem) error
AddSignedTxItem add the transaction to key value store
func (*EVMClient) BroadcastTx ¶
BroadcastTx broadcasts the transaction and returns the transaction hash.
func (*EVMClient) ConfirmationCountReady ¶
ConfirmationCountReady returns true if the confirmation count is ready.
func (*EVMClient) GetAccount ¶
GetAccount returns the account for the given public key.
func (*EVMClient) GetAccountByAddress ¶
GetAccountByAddress returns the account for the given address.
func (*EVMClient) GetAddress ¶
GetAddress returns the address for the given public key.
func (*EVMClient) GetBalance ¶
GetBalance returns the balance of the provided address.
func (*EVMClient) GetBalances ¶
GetBalances returns the balances of the provided address.
func (*EVMClient) GetBlockScannerHeight ¶ added in v1.125.0
GetBlockScannerHeight returns blockscanner height
func (*EVMClient) GetConfig ¶
func (c *EVMClient) GetConfig() config.BifrostChainConfiguration
GetConfig returns the chain configuration.
func (*EVMClient) GetConfirmationCount ¶
GetConfirmationCount returns the confirmation count for the given tx.
func (*EVMClient) GetGasPrice ¶
GetGasPrice returns the current gas price.
func (*EVMClient) GetLatestTxForVault ¶ added in v1.125.0
func (*EVMClient) IsBlockScannerHealthy ¶
IsBlockScannerHealthy returns true if the block scanner is healthy.
func (*EVMClient) OnObservedTxIn ¶
OnObservedTxIn is called when a new observed tx is received.
func (*EVMClient) ReportSolvency ¶
ReportSolvency reports solvency once per configured solvency blocks.
func (*EVMClient) ShouldReportSolvency ¶
ShouldReportSolvency returns true if the given height is a solvency report height.
func (*EVMClient) SignTx ¶
func (c *EVMClient) SignTx(tx stypes.TxOutItem, height int64) ([]byte, []byte, *stypes.TxInItem, error)
SignTx returns the signed transaction.
type EVMScanner ¶
type EVMScanner struct {
// contains filtered or unexported fields
}
func NewEVMScanner ¶
func NewEVMScanner(cfg config.BifrostBlockScannerConfiguration, storage blockscanner.ScannerStorage, chainID *big.Int, ethClient *ethclient.Client, ethRpc *evm.EthRPC, bridge thorclient.ThorchainBridge, m *metrics.Metrics, pubkeyMgr pubkeymanager.PubKeyValidator, solvencyReporter SolvencyReporter, signerCacheManager *signercache.CacheManager, ) (*EVMScanner, error)
NewEVMScanner create a new instance of EVMScanner.
func (*EVMScanner) FetchMemPool ¶
func (e *EVMScanner) FetchMemPool(_ int64) (stypes.TxIn, error)
FetchMemPool returns all transactions in the mempool.
func (*EVMScanner) FetchTxs ¶
func (e *EVMScanner) FetchTxs(height, chainHeight int64) (stypes.TxIn, error)
FetchTxs extracts all relevant transactions from the block at the provided height.
func (*EVMScanner) GetGasPrice ¶
func (e *EVMScanner) GetGasPrice() *big.Int
GetGasPrice returns the current gas price.
func (*EVMScanner) GetHeight ¶
func (e *EVMScanner) GetHeight() (int64, error)
GetHeight returns the current block height.
func (*EVMScanner) GetNonce ¶
func (e *EVMScanner) GetNonce(addr string) (uint64, error)
GetNonce returns the nonce (including pending) for the given address.
func (*EVMScanner) GetNonceFinalized ¶ added in v1.126.0
func (e *EVMScanner) GetNonceFinalized(addr string) (uint64, error)
GetNonceFinalized returns the nonce for the given address.