Versions in this module Expand all Collapse all v3 deprecated v3.0.1 Jun 10, 2023 v3.0.0 Sep 25, 2020 Changes in this version + const AtomsPerCent + const AtomsPerCoin + const BlockHeightUnknown + const BlockValid + const Flag01 + const Flag02 + const Flag03 + const Flag04 + const Flag05 + const Flag06 + const Flag07 + const Flag08 + const Flag09 + const Flag10 + const Flag11 + const Flag12 + const Flag13 + const Flag14 + const Flag15 + const FlagNone + const MaxAmount + const TxIndexUnknown + var ErrChecksumMismatch = errors.New("checksum mismatch") + var ErrInvalidPubKeyFormat = errors.New("invalid pubkey format") + var ErrMalformedPrivateKey = errors.New("malformed private key") + var ErrUnknownAddressType = errors.New("unknown address type") + func AppDataDir(appName string, roaming bool) string + func Hash160(buf []byte) []byte + func IsFlagSet16(flags uint16, flag uint16) bool + func SetFlag16(flags *uint16, flag uint16, b bool) + func VerifyMessage(address string, signature string, message string, params AddressParams) error + type Address interface + Address func() string + Hash160 func() *[ripemd160.Size]byte + ScriptAddress func() []byte + String func() string + func DecodeAddress(addr string, net AddressParams) (Address, error) + func NewAddressPubKey(decoded []byte, net AddressParams) (Address, error) + type AddressEdwardsPubKey struct + func NewAddressEdwardsPubKey(serializedPubKey []byte, net AddressParams) (*AddressEdwardsPubKey, error) + func (a *AddressEdwardsPubKey) Address() string + func (a *AddressEdwardsPubKey) AddressPubKeyHash() *AddressPubKeyHash + func (a *AddressEdwardsPubKey) DSA() dcrec.SignatureType + func (a *AddressEdwardsPubKey) Hash160() *[ripemd160.Size]byte + func (a *AddressEdwardsPubKey) PubKey() *edwards.PublicKey + func (a *AddressEdwardsPubKey) ScriptAddress() []byte + func (a *AddressEdwardsPubKey) String() string + type AddressParams interface + AddrIDPubKeyHashECDSAV0 func() [2]byte + AddrIDPubKeyHashEd25519V0 func() [2]byte + AddrIDPubKeyHashSchnorrV0 func() [2]byte + AddrIDPubKeyV0 func() [2]byte + AddrIDScriptHashV0 func() [2]byte + type AddressPubKeyHash struct + func NewAddressPubKeyHash(pkHash []byte, net AddressParams, algo dcrec.SignatureType) (*AddressPubKeyHash, error) + func (a *AddressPubKeyHash) Address() string + func (a *AddressPubKeyHash) DSA() dcrec.SignatureType + func (a *AddressPubKeyHash) Hash160() *[ripemd160.Size]byte + func (a *AddressPubKeyHash) ScriptAddress() []byte + func (a *AddressPubKeyHash) String() string + type AddressScriptHash struct + func NewAddressScriptHash(serializedScript []byte, net AddressParams) (*AddressScriptHash, error) + func NewAddressScriptHashFromHash(scriptHash []byte, net AddressParams) (*AddressScriptHash, error) + func (a *AddressScriptHash) Address() string + func (a *AddressScriptHash) Hash160() *[ripemd160.Size]byte + func (a *AddressScriptHash) ScriptAddress() []byte + func (a *AddressScriptHash) String() string + type AddressSecSchnorrPubKey struct + func NewAddressSecSchnorrPubKey(serializedPubKey []byte, net AddressParams) (*AddressSecSchnorrPubKey, error) + func (a *AddressSecSchnorrPubKey) Address() string + func (a *AddressSecSchnorrPubKey) AddressPubKeyHash() *AddressPubKeyHash + func (a *AddressSecSchnorrPubKey) DSA() dcrec.SignatureType + func (a *AddressSecSchnorrPubKey) Hash160() *[ripemd160.Size]byte + func (a *AddressSecSchnorrPubKey) ScriptAddress() []byte + func (a *AddressSecSchnorrPubKey) String() string + type AddressSecpPubKey struct + func NewAddressSecpPubKey(serializedPubKey []byte, net AddressParams) (*AddressSecpPubKey, error) + func NewAddressSecpPubKeyCompressed(pubkey *secp256k1.PublicKey, params AddressParams) (*AddressSecpPubKey, error) + func (a *AddressSecpPubKey) Address() string + func (a *AddressSecpPubKey) AddressPubKeyHash() *AddressPubKeyHash + func (a *AddressSecpPubKey) DSA() dcrec.SignatureType + func (a *AddressSecpPubKey) Format() PubKeyFormat + func (a *AddressSecpPubKey) Hash160() *[ripemd160.Size]byte + func (a *AddressSecpPubKey) PubKey() *secp256k1.PublicKey + func (a *AddressSecpPubKey) ScriptAddress() []byte + func (a *AddressSecpPubKey) String() string + type Amount int64 + func NewAmount(f float64) (Amount, error) + func (a Amount) Format(u AmountUnit) string + func (a Amount) MulF64(f float64) Amount + func (a Amount) String() string + func (a Amount) ToCoin() float64 + func (a Amount) ToUnit(u AmountUnit) float64 + type AmountSorter []Amount + func (s AmountSorter) Len() int + func (s AmountSorter) Less(i, j int) bool + func (s AmountSorter) Swap(i, j int) + type AmountUnit int + const AmountAtom + const AmountCoin + const AmountKiloCoin + const AmountMegaCoin + const AmountMicroCoin + const AmountMilliCoin + func (u AmountUnit) String() string + type Block struct + func NewBlock(msgBlock *wire.MsgBlock) *Block + func NewBlockDeepCopy(msgBlock *wire.MsgBlock) *Block + func NewBlockDeepCopyCoinbase(msgBlock *wire.MsgBlock) *Block + func NewBlockFromBlockAndBytes(msgBlock *wire.MsgBlock, serializedBlock []byte) *Block + func NewBlockFromBytes(serializedBlock []byte) (*Block, error) + func NewBlockFromReader(r io.Reader) (*Block, error) + func (b *Block) BlockHeaderBytes() ([]byte, error) + func (b *Block) Bytes() ([]byte, error) + func (b *Block) Hash() *chainhash.Hash + func (b *Block) Height() int64 + func (b *Block) MsgBlock() *wire.MsgBlock + func (b *Block) STransactions() []*Tx + func (b *Block) STx(txNum int) (*Tx, error) + func (b *Block) STxHash(txNum int) (*chainhash.Hash, error) + func (b *Block) Transactions() []*Tx + func (b *Block) Tx(txNum int) (*Tx, error) + func (b *Block) TxHash(txNum int) (*chainhash.Hash, error) + func (b *Block) TxLoc() ([]wire.TxLoc, []wire.TxLoc, error) + type BoolArray16 [16]bool + func GenerateBoolArray16(flags uint16) BoolArray16 + type ErrWrongWIFNetwork [2]byte + func (e ErrWrongWIFNetwork) Error() string + type Flags16 uint16 + type OutOfRangeError string + func (e OutOfRangeError) Error() string + type PubKeyFormat int + const PKFCompressed + const PKFUncompressed + type Tx struct + func NewTx(msgTx *wire.MsgTx) *Tx + func NewTxDeep(msgTx *wire.MsgTx) *Tx + func NewTxDeepTxIns(msgTx *wire.MsgTx) *Tx + func NewTxFromBytes(serializedTx []byte) (*Tx, error) + func NewTxFromReader(r io.Reader) (*Tx, error) + func (t *Tx) Hash() *chainhash.Hash + func (t *Tx) Index() int + func (t *Tx) MsgTx() *wire.MsgTx + func (t *Tx) SetIndex(index int) + func (t *Tx) SetTree(tree int8) + func (t *Tx) SetVersion(version uint16) + func (t *Tx) Tree() int8 + func (t *Tx) Version() uint16 + type WIF struct + func DecodeWIF(wif string, net [2]byte) (*WIF, error) + func NewWIF(privKey []byte, net [2]byte, scheme dcrec.SignatureType) (*WIF, error) + func (w *WIF) DSA() dcrec.SignatureType + func (w *WIF) PrivKey() []byte + func (w *WIF) PubKey() []byte + func (w *WIF) String() string Other modules containing this package github.com/decred/dcrd/dcrutil github.com/decred/dcrd/dcrutil/v2 github.com/decred/dcrd/dcrutil/v4