Documentation ¶
Index ¶
- Constants
- func GetBech32AccountPubKey(key *dashec.PrivateKey) (common.PubKey, error)
- func RawTxInSignatureUsingSignable(tx *wire.MsgTx, idx int, subScript []byte, hashType dashtxscript.SigHashType, ...) ([]byte, error)
- type Client
- func (c *Client) BroadcastTx(txOut stypes.TxOutItem, payload []byte) (string, error)
- func (c *Client) ConfirmationCountReady(_ types.TxIn) bool
- func (c *Client) FetchMemPool(_ int64) (types.TxIn, error)
- func (c *Client) FetchTxs(height, chainHeight int64) (types.TxIn, error)
- func (c *Client) GetAccount(pkey common.PubKey, height *big.Int) (common.Account, error)
- func (c *Client) GetAccountByAddress(string, *big.Int) (common.Account, error)
- func (c *Client) GetAddress(poolPubKey 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() (height int64, err 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(pkey common.PubKey) error
- func (c *Client) ReportSolvency(dashBlockHeight int64) error
- func (c *Client) ShouldReportSolvency(height int64) bool
- func (c *Client) SignTx(tx stypes.TxOutItem, mayachainHeight int64) ([]byte, []byte, *stypes.TxInItem, error)
- func (c *Client) Start(globalTxsQueue chan types.TxIn, globalErrataQueue chan types.ErrataBlock, ...)
- func (c *Client) Stop()
- type KeySignWrapper
- type TssSignable
Constants ¶
const ( MaximumConfirmation = 99999999 MaxAsgardAddresses = 100 EstimateAverageTxSize = 451 // assuming 2 vins and 3 vouts (2 standard, 1 memo) )
const ( EstimatedDashGasRate = 8 // MinUTXOConfirmation UTXO that has less confirmation then this will not be spent , unless it is yggdrasil MinUTXOConfirmation = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetBech32AccountPubKey ¶
func GetBech32AccountPubKey(key *dashec.PrivateKey) (common.PubKey, error)
GetBech32AccountPubKey convert the given private key to
func RawTxInSignatureUsingSignable ¶
func RawTxInSignatureUsingSignable( tx *wire.MsgTx, idx int, subScript []byte, hashType dashtxscript.SigHashType, signable bifrosttxscript.Signable, ) ([]byte, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the bifrost ChainClient for Dash.
Dash is based on Bitcoin and is compatible with many key components of the Bitcoin ecosystem. The difference with Dash is the second layer of network participants, called masternodes, which form long-lived quorums (LLMQs) which facilitate instant transaction confirmation, double spend protection and are the foundation on which the decentralised autonomous organisation (DAO) self-governs.
Significant differences:
- Transactions can be considered instant (i.e. 0 confirmations required) if they are part of a block which has the Chainlock flag set to true.
- Block reorganisations are not possible.
- Replace By Fee has not been implemented.
func NewClient ¶
func NewClient( thorKeys *mayaclient.Keys, cfg config.BifrostChainConfiguration, server *tssp.TssServer, bridge mayaclient.MayachainBridge, m *metrics.Metrics, ) (*Client, error)
func (*Client) BroadcastTx ¶
BroadcastTx will broadcast the given payload to DASH chain
func (*Client) FetchMemPool ¶
FetchMemPool retrieves txs from mempool
func (*Client) GetAccount ¶
func (*Client) GetAccountByAddress ¶
func (*Client) GetBlockScannerHeight ¶ added in v1.109.0
GetBlockScannerHeight returns blockscanner height
func (*Client) GetConfig ¶
func (c *Client) GetConfig() config.BifrostChainConfiguration
func (*Client) GetConfirmationCount ¶
GetConfirmationCount Dash blocks which have been chainlocked can be considered instantly confirmed, all other blocks are ignored. Therefore, this check doesn't apply to Dash.
func (*Client) GetHeight ¶
GetHeight returns the height of the most permanent block the node has reached so far. When Dash blocks are chainlocked, they are immutable and therefore completely reliable. We only want to recognise transactions from chainlocked blocks.
func (*Client) GetLatestTxForVault ¶ added in v1.109.0
func (*Client) IsBlockScannerHealthy ¶
func (*Client) OnObservedTxIn ¶
func (*Client) RegisterPublicKey ¶
RegisterPublicKey register the given pubkey to dash wallet
func (*Client) ReportSolvency ¶
func (*Client) ShouldReportSolvency ¶
ShouldReportSolvency based on the given block height , should the client report solvency to THORNode
func (*Client) SignTx ¶
func (c *Client) SignTx(tx stypes.TxOutItem, mayachainHeight 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.
type KeySignWrapper ¶
type KeySignWrapper struct {
// contains filtered or unexported fields
}
KeySignWrapper is a wrap of private key and also tss instance it also implement the txscript.Signable interface, and will decide which method to use based on the pubkey
func NewKeySignWrapper ¶
func NewKeySignWrapper(privateKey *dashec.PrivateKey, tssKeyManager tss.ThorchainKeyManager) (*KeySignWrapper, error)
NewKeySignWrapper create a new instance of Keysign Wrapper
func (*KeySignWrapper) GetSignable ¶
func (w *KeySignWrapper) GetSignable(poolPubKey common.PubKey) txscript.Signable
GetSignable based on the given poolPubKey
type TssSignable ¶
type TssSignable struct {
// contains filtered or unexported fields
}
TssSignable is a signable implementation backed by tss
func NewTssSignable ¶
func NewTssSignable(pubKey common.PubKey, manager tss.ThorchainKeyManager) (*TssSignable, error)
NewTssSignable create a new instance of TssSignable
func (*TssSignable) GetPubKey ¶
func (ts *TssSignable) GetPubKey() *btcec.PublicKey