Documentation ¶
Index ¶
- func IsETH(token string) bool
- func LatestAggregatorContracts() []common.Address
- type Client
- func (c *Client) AddSignedTxItem(hash string, height int64, vaultPubKey string, toi *stypes.TxOutItem) error
- func (c *Client) BroadcastTx(txOutItem stypes.TxOutItem, hexTx []byte) (string, error)
- func (c *Client) ConfirmationCountReady(txIn stypes.TxIn) bool
- func (c *Client) GetAccount(pk common.PubKey, height *big.Int) (common.Account, error)
- func (c *Client) GetAccountByAddress(address string, height *big.Int) (common.Account, error)
- func (c *Client) GetAddress(poolPubKey common.PubKey) string
- func (c *Client) GetBalance(addr, token string, height *big.Int) (*big.Int, error)
- func (c *Client) GetBalances(addr string, height *big.Int) (common.Coins, error)
- func (c *Client) GetBlockScannerHeight() (int64, error)
- func (c *Client) GetChain() common.Chain
- func (c *Client) GetConfig() config.BifrostChainConfiguration
- func (c *Client) GetConfirmationCount(txIn stypes.TxIn) int64
- func (c *Client) GetGasFee(gas uint64) common.Gas
- func (c *Client) GetGasPrice() *big.Int
- func (c *Client) GetHeight() (int64, error)
- func (c *Client) GetLatestTxForVault(vault string) (string, string, error)
- func (c *Client) GetNonce(addr string) (uint64, error)
- func (c *Client) GetNonceFinalized(addr string) (uint64, error)
- func (c *Client) IsBlockScannerHealthy() bool
- func (c *Client) OnObservedTxIn(txIn stypes.TxInItem, blockHeight int64)
- func (c *Client) ReportSolvency(ethBlockHeight int64) error
- func (c *Client) ShouldReportSolvency(height int64) bool
- func (c *Client) SignTx(tx stypes.TxOutItem, height int64) ([]byte, []byte, *stypes.TxInItem, error)
- func (c *Client) Start(globalTxsQueue chan stypes.TxIn, globalErrataQueue chan stypes.ErrataBlock, ...)
- func (c *Client) Stop()
- type ETHScanner
- type SolvencyReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LatestAggregatorContracts ¶ added in v1.93.0
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a structure to sign and broadcast tx to Ethereum chain used by signer mostly
func NewClient ¶
func NewClient(thorKeys *thorclient.Keys, cfg config.BifrostChainConfiguration, server *tssp.TssServer, bridge thorclient.ThorchainBridge, m *metrics.Metrics, pubkeyMgr pubkeymanager.PubKeyValidator, poolMgr thorclient.PoolManager, ) (*Client, error)
NewClient create new instance of Ethereum client
func (*Client) AddSignedTxItem ¶ added in v0.54.0
func (c *Client) AddSignedTxItem(hash string, height int64, vaultPubKey string, toi *stypes.TxOutItem) error
AddSignedTxItem add the transaction to key value store
func (*Client) BroadcastTx ¶
BroadcastTx decodes tx using rlp and broadcasts too Ethereum chain
func (*Client) ConfirmationCountReady ¶ added in v0.41.0
ConfirmationCountReady check whether the given txIn is ready to be send to THORChain
func (*Client) GetAccount ¶
GetAccount gets account by address in eth client
func (*Client) GetAccountByAddress ¶
GetAccountByAddress return account information
func (*Client) GetAddress ¶
GetAddress return current signer address, it will be bech32 encoded address
func (*Client) GetBalance ¶ added in v0.41.0
GetBalance call smart contract to find out the balance of the given address and token
func (*Client) GetBalances ¶ added in v0.41.0
GetBalances gets all the balances of the given address
func (*Client) GetBlockScannerHeight ¶ added in v1.125.0
GetBlockScannerHeight returns blockscanner height
func (*Client) GetConfig ¶
func (c *Client) GetConfig() config.BifrostChainConfiguration
GetConfig return the configurations used by ETH chain
func (*Client) GetConfirmationCount ¶ added in v0.41.0
GetConfirmationCount decide the given txIn how many confirmation it requires
func (*Client) GetGasPrice ¶
GetGasPrice gets gas price from eth scanner
func (*Client) GetLatestTxForVault ¶ added in v1.125.0
func (*Client) GetNonceFinalized ¶ added in v1.127.1
GetNonceFinalized returns the nonce for the given address.
func (*Client) IsBlockScannerHealthy ¶ added in v0.41.0
func (*Client) OnObservedTxIn ¶ added in v0.41.0
OnObservedTxIn gets called from observer when we have a valid observation
func (*Client) ReportSolvency ¶ added in v0.79.0
func (*Client) ShouldReportSolvency ¶ added in v0.79.0
ShouldReportSolvency with given block height , should chain client report Solvency to THORNode?
func (*Client) SignTx ¶
func (c *Client) SignTx(tx stypes.TxOutItem, height int64) ([]byte, []byte, *stypes.TxInItem, error)
SignTx sign the the given TxArrayItem
type ETHScanner ¶ added in v0.41.0
type ETHScanner struct {
// contains filtered or unexported fields
}
ETHScanner is a scanner that understand how to interact with ETH chain ,and scan block , parse smart contract etc
func NewETHScanner ¶ added in v0.41.0
func NewETHScanner(cfg config.BifrostBlockScannerConfiguration, storage blockscanner.ScannerStorage, chainID *big.Int, client *ethclient.Client, bridge thorclient.ThorchainBridge, m *metrics.Metrics, pubkeyMgr pubkeymanager.PubKeyValidator, solvencyReporter SolvencyReporter, signerCacheManager *signercache.CacheManager, ) (*ETHScanner, error)
NewETHScanner create a new instance of ETHScanner
func (*ETHScanner) FetchMemPool ¶ added in v0.41.0
func (e *ETHScanner) FetchMemPool(_ int64) (stypes.TxIn, error)
FetchMemPool get tx from mempool
func (*ETHScanner) FetchTxs ¶ added in v0.41.0
func (e *ETHScanner) FetchTxs(height, chainHeight int64) (stypes.TxIn, error)
FetchTxs query the ETH chain to get txs in the given block height
func (*ETHScanner) GetGasPrice ¶ added in v0.41.0
func (e *ETHScanner) GetGasPrice() *big.Int
GetGasPrice returns current gas price
func (*ETHScanner) GetHeight ¶ added in v0.41.0
func (e *ETHScanner) GetHeight() (int64, error)
GetHeight return latest block height
type SolvencyReporter ¶ added in v0.63.0
SolvencyReporter is to report solvency info to THORNode