Versions in this module Expand all Collapse all v0 v0.32.0 Mar 4, 2024 Changes in this version + const ChainExternal + const ChainInternal + const MaxInt32 + const ScriptHashType + const ScriptMetanet + const ScriptTypeMultiSig + const ScriptTypeNonStandard + const ScriptTypeNullData + const ScriptTypePubKey + const ScriptTypePubKeyHash + const ScriptTypeTokenSensible + const ScriptTypeTokenStas + const XpubKeyLength + var ErrCouldNotDetermineDestinationOutput = errors.New("could not determine token output destination") + var ErrDeriveFailed = errors.New("derive addresses failed, missing addresses") + var ErrHDKeyNil = errors.New("hd key is nil") + var ErrXpubInvalidLength = errors.New("xpub is an invalid length") + var ErrXpubNoMatch = errors.New("xpub key does not match raw key") + var HashPuzzleRegexp = `^a914[\da-f]{40}8876a9[\da-f]{40}88ac` + var HashPuzzleRegexpString = `a914[\da-f]{40}8876a9[\da-f]{40}88ac` + var MetanetRegexp = regexp.Compile("^006a046d65746142") + var MetanetSubstringRegexp = regexp.Compile("006a046d65746142") + var OpReturnRegexp = regexp.Compile("^006a") + var OpReturnSubstringRegexp = regexp.Compile("006a") + var P2PKHRegexp = regexp.Compile(`^` + P2PKHRegexpString + `$`) + var P2PKHRegexpString = `76a914[\da-f]{40}88ac` + var P2PKHSubstringRegexp = regexp.Compile(P2PKHRegexpString) + var P2SHRegexp = regexp.Compile(`^a914[\da-f]{40}87$`) + var P2SHSubstringRegexp = regexp.Compile(`a914[\da-f]{40}87`) + var RunRegexp = `^006a0372756e` + var RunRegexpString = `006a0372756e` + var SensibleRegexp = regexp.Compile("73656e7369626c65") + var SensibleSubstringRegexp = regexp.Compile("73656e7369626c65") + var StasRegexp = regexp.Compile(...) + var StasSubstringRegexp = regexp.Compile(...) + func Decrypt(encryptionKey, data string) (string, error) + func DeriveAddress(hdKey *bip32.ExtendedKey, chain uint32, num uint32) (address string, err error) + func DeriveAddresses(hdKey *bip32.ExtendedKey, num uint32) (external, internal string, err error) + func DeriveChildKeyFromHex(hdKey *bip32.ExtendedKey, hexHash string) (*bip32.ExtendedKey, error) + func DerivePrivateKeyFromHex(hdKey *bip32.ExtendedKey, hexString string) (*bec.PrivateKey, error) + func DerivePublicKey(hdKey *bip32.ExtendedKey, chain uint32, num uint32) (*bec.PublicKey, error) + func DerivePublicKeyFromHex(hdKey *bip32.ExtendedKey, hexString string) (*bec.PublicKey, error) + func Encrypt(encryptionKey, encryptValue string) (string, error) + func GetAddressFromScript(lockingScript string) (address string) + func GetChildNumsFromHex(hexHash string) ([]uint32, error) + func GetDestinationLockingScript(lockingScript string) string + func GetDestinationType(lockingScript string) string + func GetDestinationTypeRegex(destType string) *regexp.Regexp + func GetInputSizeForType(inputType string) uint64 + func GetLockingScriptFromSTASLockingScript(lockingScript string) (string, error) + func GetOutputSize(lockingScript string) uint64 + func GetTransactionIDFromHex(hex string) (string, error) + func GetUnlockingScript(tx *bt.Tx, inputIndex uint32, privateKey *bec.PrivateKey) (*bscript.Script, error) + func Hash(data string) string + func HashAdler32(input string) (string, error) + func IsMetanet(lockingScript string) bool + func IsMultiSig(lockingScript string) bool + func IsOpReturn(lockingScript string) bool + func IsP2PK(lockingScript string) bool + func IsP2PKH(lockingScript string) bool + func IsP2SH(lockingScript string) bool + func IsRunJS(lockingScript string) bool + func IsSensible(lockingScript string) bool + func IsStas(lockingScript string) bool + func LittleEndianBytes64(value uint64, resultLength uint32) []byte + func RandomHex(n int) (string, error) + func SafeAssign[T any](dest *T, src *T) + func SplitOutputValues(satoshis uint64, nrOfOutputs int) ([]uint64, error) + func StrOrBytesToString(value interface{}) (string, error) + func StringInSlice(a string, list []string) bool + func ToByteArray(value interface{}) ([]byte, error) + func ValidateXPub(rawKey string) (*bip32.ExtendedKey, error) + type FeeUnit bt.FeeUnit + func LowestFee(feeUnits []FeeUnit, defaultValue *FeeUnit) *FeeUnit + func ValidFees(feeUnits []FeeUnit) []FeeUnit + func (f *FeeUnit) IsLowerThan(other *FeeUnit) bool + func (f *FeeUnit) IsValid() bool + func (f *FeeUnit) IsZero() bool + func (f *FeeUnit) String() string + type HTTPInterface interface + Do func(req *http.Request) (*http.Response, error)