Documentation ¶
Index ¶
- type Client
- func (c *Client) BroadcastTx(txOut stypes.TxOutItem, payload []byte) (string, error)
- func (c *Client) ConfirmationCountReady(txIn types.TxIn) bool
- func (c *Client) FetchMemPool(height int64) (types.TxIn, error)
- func (c *Client) FetchTxs(height, chainHeight int64) (types.TxIn, error)
- func (c *Client) GetAccount(pubkey common.PubKey, height *big.Int) (common.Account, error)
- func (c *Client) GetAccountByAddress(address string, height *big.Int) (common.Account, error)
- func (c *Client) GetAddress(pubkey common.PubKey) string
- func (c *Client) GetBlockScannerHeight() (int64, error)
- func (c *Client) GetChain() common.Chain
- func (c *Client) GetConfig() config.BifrostChainConfiguration
- func (c *Client) GetConfirmationCount(txIn types.TxIn) int64
- func (c *Client) GetHeight() (int64, error)
- func (c *Client) GetLatestTxForVault(vault string) (string, string, error)
- func (c *Client) IsBlockScannerHealthy() bool
- func (c *Client) OnObservedTxIn(txIn types.TxInItem, blockHeight int64)
- func (c *Client) RegisterPublicKey(pubkey common.PubKey) error
- func (c *Client) ReportSolvency(height int64) error
- func (c *Client) ShouldReportSolvency(height int64) bool
- func (c *Client) SignTx(tx stypes.TxOutItem, thorchainHeight int64) ([]byte, []byte, *stypes.TxInItem, error)
- func (c *Client) Start(globalTxsQueue chan types.TxIn, globalErrataQueue chan types.ErrataBlock, ...)
- func (c *Client) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines a generic UTXO client. Since there are differences in addresses, RPCs, and txscript between chains, chain additions should audit switches on chain type and extend where appropriate.
func NewClient ¶
func NewClient( thorKeys *thorclient.Keys, cfg config.BifrostChainConfiguration, server *gotss.TssServer, bridge thorclient.ThorchainBridge, m *metrics.Metrics, ) (*Client, error)
NewClient generates a new Client
func (*Client) BroadcastTx ¶
BroadcastTx will broadcast the given payload.
func (*Client) ConfirmationCountReady ¶
ConfirmationCountReady will be called by the observer before sending the txIn to Thorchain. It will return true if the scanner height is greater than or equal to the observed block height + confirmation required. https://medium.com/coinmonks/1confvalue-a-simple-pow-confirmation-rule-of-thumb-a8d9c6c483dd
func (*Client) FetchMemPool ¶
FetchMemPool retrieves txs from mempool
func (*Client) FetchTxs ¶
FetchTxs retrieves txs for a block height. The first argument is the block height to fetch, the second argument is the current chain tip.
func (*Client) GetAccount ¶
GetAccount returns the account details for the given public key.
func (*Client) GetAccountByAddress ¶
GetAccountByAddress is unimplemented for UTXO chains.
func (*Client) GetAddress ¶
GetAddress returns chain address for the given public key.
func (*Client) GetBlockScannerHeight ¶
GetBlockScannerHeight returns blockscanner height
func (*Client) GetConfig ¶
func (c *Client) GetConfig() config.BifrostChainConfiguration
GetConfig returns the chain configuration.
func (*Client) GetConfirmationCount ¶
GetConfirmationCount returns the number of blocks required before processing in Thorchain.
func (*Client) GetLatestTxForVault ¶
func (*Client) IsBlockScannerHealthy ¶
IsBlockScannerHealthy returns true if the block scanner is healthy.
func (*Client) OnObservedTxIn ¶
OnObservedTxIn is called by the observer when a transaction is observed.
func (*Client) RegisterPublicKey ¶
RegisterPublicKey imports the provided public key in the chain daemon.
func (*Client) ReportSolvency ¶
ReportSolvency reports solvency for all asgard vaults.
func (*Client) ShouldReportSolvency ¶
ShouldReportSolvency returns true if solvency should be reported at the given height.
func (*Client) SignTx ¶
func (c *Client) SignTx(tx stypes.TxOutItem, thorchainHeight int64) ([]byte, []byte, *stypes.TxInItem, error)
SignTx builds and signs the outbound transaction. Returns the signed transaction, a serialized checkpoint on error, and an error.