Documentation
¶
Index ¶
- Constants
- func AddrsToSlices(addrs []Addr) [][]byte
- func ConvertFloatSatoshisToBch(satoshis float64) float64
- func ConvertSatoshisToBch(satoshis uint64) float64
- func DecodeTx(txHex string) (*wire.MsgTx, error)
- func EncodeTx(tx *wire.MsgTx) string
- func GetAddressListPkHashes(addresses []Address) [][]byte
- func GetAddressStringFromPkScript(pkScript []byte) string
- func GetBip44CoinPath(coinType uint) string
- func GetBip44Path(coinType, index uint, change bool) string
- func GetChainNameFromFull(full string) string
- func GetChainNameFullFromFull(full string) string
- func GetMainNetParams() *chaincfg.Params
- func GetSLPPath() string
- func GetSatoshiPath() string
- func IsAddressQuantityError(err error) bool
- func IsDataOpCode(code byte) bool
- func IsNoAddressesError(err error) bool
- func IsParsingMnemonicError(err error) bool
- func IsTooManyAddressesError(err error) bool
- type Addr
- func GetAddrFromBytes(b []byte) *Addr
- func GetAddrFromLockScript(lockScript []byte) (*Addr, error)
- func GetAddrFromPkHash(pkHash []byte) *Addr
- func GetAddrFromString(addrString string) (*Addr, error)
- func GetAddrFromUnlockScript(unlockScript []byte) (*Addr, error)
- func GetP2pkhAddrFromLockScript(lockScript []byte) (*Addr, error)
- func GetP2pkhAddrFromUnlockScript(unlockScript []byte) (*Addr, error)
- func GetP2shAddrFromLockScript(lockScript []byte) (*Addr, error)
- func GetP2shAddrFromUnlockScript(unlockScript []byte) (*Addr, error)
- type Address
- func GetAddress(pubKey []byte) Address
- func GetAddressFromPkHash(pkHash []byte) Address
- func GetAddressFromPkHashNew(pkHash []byte) (Address, error)
- func GetAddressFromPkScript(pkScript []byte) (*Address, error)
- func GetAddressFromRedeemScript(redeemScript []byte) (*Address, error)
- func GetAddressFromScriptHash(scriptHash []byte) Address
- func GetAddressFromScriptHashNew(scriptHash []byte) (*Address, error)
- func GetAddressFromSignatureScript(unlockScript []byte) (*Address, error)
- func GetAddressFromString(addressString string) Address
- func GetAddressFromStringErr(addressString string) (*Address, error)
- func GetAddressesForPkHashes(pkHashes [][]byte) ([]Address, error)
- func (a Address) GetAddr() Addr
- func (a Address) GetAddress() btcutil.Address
- func (a Address) GetCashAddrString() string
- func (a Address) GetEncoded() string
- func (a Address) GetPkHash() []byte
- func (a Address) GetSlpAddrString() string
- func (a Address) IsP2PK() bool
- func (a Address) IsP2PKH() bool
- func (a Address) IsP2SH() bool
- func (a Address) IsSame(b Address) bool
- func (a Address) IsSet() bool
- func (a Address) ScriptAddress() []byte
- type Block
- type Change
- type KeyRing
- type Mnemonic
- type OpCode
- type OpCodes
- type PrivateKey
- func (k PrivateKey) GetAddr() Addr
- func (k PrivateKey) GetAddress() Address
- func (k PrivateKey) GetBase58() string
- func (k PrivateKey) GetBase58Compressed() string
- func (k PrivateKey) GetBinaryString() string
- func (k PrivateKey) GetBtcEcPrivateKey() *btcec.PrivateKey
- func (k PrivateKey) GetHex() string
- func (k PrivateKey) GetHexCompressed() string
- func (k PrivateKey) GetPkHash() []byte
- func (k PrivateKey) GetPublicKey() PublicKey
- func (k PrivateKey) IsSet() bool
- type PublicKey
- type Wallet
Constants ¶
View Source
const ( AddrVersionP2PKH = 0 AddrVersionP2SH = 5 )
View Source
const ( BitcoinPrefix = "bitcoin" CashAddrPrefix = "bitcoincash" SlpAddrPrefix = "simpleledger" UnknownAddressTypeErrorMessage = "unknown address type" )
View Source
const ( TooManyAddressesErrorMsg = "error too many addresses in pk script" NoAddressesErrorMsg = "error unable to find any addresses" )
View Source
const ( Bip44CoinTypeBTC = 0 Bip44CoinTypeBCH = 145 Bip44CoinTypeBSV = 236 Bip44CoinTypeSLP = 245 )
View Source
const ( ChainNameABC = "abc" ChainNameSV = "sv" ChainNameFullBCH = "bch" ChainNameFullBSV = "bsv" ChainNameFullBCHA = "bcha" )
View Source
const SigHashForkID txscript.SigHashType = 0x40
Variables ¶
This section is empty.
Functions ¶
func AddrsToSlices ¶
func ConvertSatoshisToBch ¶
func GetAddressListPkHashes ¶
func GetBip44CoinPath ¶
func GetBip44Path ¶
func GetChainNameFromFull ¶
func GetMainNetParams ¶
func GetSLPPath ¶
func GetSLPPath() string
func GetSatoshiPath ¶
func GetSatoshiPath() string
func IsAddressQuantityError ¶
func IsDataOpCode ¶
func IsNoAddressesError ¶
func IsParsingMnemonicError ¶
func IsTooManyAddressesError ¶
Types ¶
type Addr ¶
type Addr [25]byte
func GetAddrFromBytes ¶
func GetAddrFromLockScript ¶
func GetAddrFromPkHash ¶
func GetAddrFromString ¶
func GetAddrFromUnlockScript ¶
func (Addr) OldAddress ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func GetAddress ¶
func GetAddressFromPkHash ¶
func GetAddressFromPkHashNew ¶
func GetAddressFromPkScript ¶
func GetAddressFromString ¶
func GetAddressFromStringErr ¶
func GetAddressesForPkHashes ¶
func (Address) GetAddress ¶
func (Address) GetCashAddrString ¶
func (Address) GetEncoded ¶
func (Address) GetSlpAddrString ¶
func (Address) ScriptAddress ¶
type Block ¶
func GetFirstBlock ¶
func GetFirstBlock() Block
func GetGenesisBlock ¶
func GetGenesisBlock() Block
type KeyRing ¶
type KeyRing struct {
Keys []PrivateKey
}
func GetSingleKeyRing ¶
func GetSingleKeyRing(privateKey PrivateKey) KeyRing
func (KeyRing) GetKey ¶
func (k KeyRing) GetKey(pkHash []byte) PrivateKey
type Mnemonic ¶
func GenerateMnemonic ¶
func GetMnemonic ¶
func GetMnemonicFromString ¶
func GetNewMnemonic ¶
func (*Mnemonic) GetPathExtended ¶
func (m *Mnemonic) GetPathExtended(path string) (*hdkeychain.ExtendedKey, error)
BIP32 / BIP44
type PrivateKey ¶
type PrivateKey struct {
Secret []byte
}
func GeneratePrivateKey ¶
func GeneratePrivateKey() PrivateKey
func GetPrivateKey ¶
func GetPrivateKey(secretHex string) PrivateKey
func ImportPrivateKey ¶
func ImportPrivateKey(wifString string) (PrivateKey, error)
func ImportPrivateKeyNew ¶
func ImportPrivateKeyNew(wifString string) PrivateKey
func (PrivateKey) GetAddr ¶
func (k PrivateKey) GetAddr() Addr
func (PrivateKey) GetAddress ¶
func (k PrivateKey) GetAddress() Address
func (PrivateKey) GetBase58 ¶
func (k PrivateKey) GetBase58() string
func (PrivateKey) GetBase58Compressed ¶
func (k PrivateKey) GetBase58Compressed() string
func (PrivateKey) GetBinaryString ¶
func (k PrivateKey) GetBinaryString() string
func (PrivateKey) GetBtcEcPrivateKey ¶
func (k PrivateKey) GetBtcEcPrivateKey() *btcec.PrivateKey
func (PrivateKey) GetHex ¶
func (k PrivateKey) GetHex() string
func (PrivateKey) GetHexCompressed ¶
func (k PrivateKey) GetHexCompressed() string
func (PrivateKey) GetPkHash ¶
func (k PrivateKey) GetPkHash() []byte
func (PrivateKey) GetPublicKey ¶
func (k PrivateKey) GetPublicKey() PublicKey
func (PrivateKey) IsSet ¶
func (k PrivateKey) IsSet() bool
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func GetPublicKey ¶
func (PublicKey) GetAddress ¶
func (PublicKey) GetBtcEcPubKey ¶
func (PublicKey) GetSerialized ¶
func (PublicKey) GetSerializedString ¶
Click to show internal directories.
Click to hide internal directories.