Versions in this module Expand all Collapse all v0 v0.1.0 Oct 7, 2023 Changes in this version + const COINBASE_TX_TYPE + const COINBASE_TX_VERSION + const EXTRANONCE1_SIZE + const EXTRANONCE2_SIZE + const GENESISNBITS + const TRANSACTION_COINBASE + const TRANSACTION_NORMAL + const TRANSACTION_PROVIDER_REGISTER + const TRANSACTION_PROVIDER_UPDATE_REGISTRAR + const TRANSACTION_PROVIDER_UPDATE_REVOKE + const TRANSACTION_PROVIDER_UPDATE_SERVICE + const TRANSACTION_QUORUM_COMMITMENT + func GetCoinBaseScript(wallet string) ([]byte, error) + func GetCoinBaseScriptByAddress(address string) ([]byte, error) + func GetCoinBaseScriptByPubKey(pubKeyHex string) ([]byte, error) + func GetCoinBaseScriptHex(wallet string) (string, error) + func GetDiffWork(diff float64) (float64, error) + func GetGenesisTargetWork() (float64, error) + func GetHashRateByDiff(diff float64, secs int64, unit string) (float64, error) + func GetHashRateByNBits(nBits uint32, secs int64, unit string) (float64, error) + func GetHashRateByWork(work float64, secs int64, unit string) float64 + func GetNBitsDiff(nBits uint32) float64 + func GetTargetDiff(target *big.Int) (float64, error) + func GetTargetWork(target *big.Int) (float64, error) + func NBits2Target(nBits uint32) *big.Int + func PackNumber(num int64) []byte + func PackString(str string) ([]byte, error) + type Block struct + Header BlockHeader + Vtx []DashTransaction + func (b *Block) UnPack(reader io.Reader) error + func (b *Block) UnPackFromHex(hexStr string) error + func (b Block) Pack(writer io.Writer) error + func (b Block) PackToHex() (string, error) + type BlockHeader struct + Bits uint32 + HashMerkleRoot bigint.Uint256 + HashPrevBlock bigint.Uint256 + Nonce uint32 + Time uint32 + Version int32 + func (b *BlockHeader) UnPack(reader io.Reader) error + func (b BlockHeader) Pack(writer io.Writer) error + type DashCoinBaseTransaction struct + BlockHeight uint32 + BlockTime uint32 + CBAuxFlag []byte + CBExtras string + CoinBaseTx1 []byte + CoinBaseTx2 []byte + ExtraPayload []byte + MasterNodeVouts []MasterNodeVout + RewardValue int64 + VinScript1 []byte + VinScript2 []byte + VoutScript []byte + func (t *DashCoinBaseTransaction) Initialize(cbWallet string, bTime uint32, height uint32, value int64, flags string, ...) error + func (t *DashCoinBaseTransaction) RecoverToDashTransaction(extraNonce1Hex string, extraNonce2Hex string) (DashTransaction, error) + type DashTransaction struct + ExtraPayload script.Script + LockTime uint32 + Type16 int16 + Version int32 + Version16 int16 + Vin []TxIn + Vout []TxOut + func (t *DashTransaction) GetTrxPrintAble() TrxPrintAble + func (t *DashTransaction) UnPack(reader io.Reader) error + func (t *DashTransaction) UnPackFromHex(hexStr string) error + func (t DashTransaction) CalcTrxId() (bigint.Uint256, error) + func (t DashTransaction) Pack(writer io.Writer) error + func (t DashTransaction) PackToHex() (string, error) + type MasterNodeVout struct + Amount int64 + VoutScript []byte + type OutPoint struct + Hash bigint.Uint256 + N uint32 + func (o *OutPoint) UnPack(reader io.Reader) error + func (o OutPoint) Pack(writer io.Writer) error + type OutPointPrintAble struct + Hash string + N uint32 + type TrxPrintAble struct + ExtraPayload string + LockTime uint32 + Type16 int16 + Version int32 + Version16 int16 + Vin []TxInPrintAble + Vout []TxOutPrintAble + type TxIn struct + PrevOut OutPoint + ScriptSig script.Script + Sequence uint32 + func (t *TxIn) UnPack(reader io.Reader) error + func (t TxIn) Pack(writer io.Writer) error + type TxInPrintAble struct + PrevOut OutPointPrintAble + ScriptSig string + Sequence uint32 + type TxOut struct + ScriptPubKey script.Script + Value int64 + func (t *TxOut) UnPack(reader io.Reader) error + func (t TxOut) Pack(writer io.Writer) error + type TxOutPrintAble struct + Address string + ScriptPubKey string + ScriptType string + Value int64