dash

package
v1.109.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaximumConfirmation   = 99999999
	MaxAsgardAddresses    = 100
	EstimateAverageTxSize = 451 // assuming 2 vins and 3 vouts (2 standard, 1 memo)
)
View Source
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 (*Client) BroadcastTx

func (c *Client) BroadcastTx(txOut stypes.TxOutItem, payload []byte) (string, error)

BroadcastTx will broadcast the given payload to DASH chain

func (*Client) ConfirmationCountReady

func (c *Client) ConfirmationCountReady(_ types.TxIn) bool

func (*Client) FetchMemPool

func (c *Client) FetchMemPool(_ int64) (types.TxIn, error)

FetchMemPool retrieves txs from mempool

func (*Client) FetchTxs

func (c *Client) FetchTxs(height, chainHeight int64) (types.TxIn, error)

FetchTxs retrieves txs for a block height

func (*Client) GetAccount

func (c *Client) GetAccount(pkey common.PubKey, height *big.Int) (common.Account, error)

func (*Client) GetAccountByAddress

func (c *Client) GetAccountByAddress(string, *big.Int) (common.Account, error)

func (*Client) GetAddress

func (c *Client) GetAddress(poolPubKey common.PubKey) string

func (*Client) GetBlockScannerHeight added in v1.109.0

func (c *Client) GetBlockScannerHeight() (int64, error)

GetBlockScannerHeight returns blockscanner height

func (*Client) GetChain

func (c *Client) GetChain() common.Chain

func (*Client) GetConfig

func (c *Client) GetConfig() config.BifrostChainConfiguration

func (*Client) GetConfirmationCount

func (c *Client) GetConfirmationCount(txIn types.TxIn) int64

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

func (c *Client) GetHeight() (height int64, err error)

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 (c *Client) GetLatestTxForVault(vault string) (string, string, error)

func (*Client) IsBlockScannerHealthy

func (c *Client) IsBlockScannerHealthy() bool

func (*Client) OnObservedTxIn

func (c *Client) OnObservedTxIn(txIn types.TxInItem, blockHeight int64)

func (*Client) RegisterPublicKey

func (c *Client) RegisterPublicKey(pkey common.PubKey) error

RegisterPublicKey register the given pubkey to dash wallet

func (*Client) ReportSolvency

func (c *Client) ReportSolvency(dashBlockHeight int64) error

func (*Client) ShouldReportSolvency

func (c *Client) ShouldReportSolvency(height int64) bool

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, error)

SignTx builds and signs the outbound transaction. Returns the signed transaction, a serialized checkpoint on error, and an error.

func (*Client) Start

func (c *Client) Start(globalTxsQueue chan types.TxIn, globalErrataQueue chan types.ErrataBlock, globalSolvencyQueue chan types.Solvency)

func (*Client) Stop

func (c *Client) Stop()

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

func (*TssSignable) Sign

func (ts *TssSignable) Sign(payload []byte) (*btcec.Signature, error)

Sign the given payload

Jump to

Keyboard shortcuts

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