Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeCheckAddress(addr string) error
- func GenerateAssetId(assetKey string) crypto.Hash
- func VerifyAddress(address string) error
- func VerifyAssetKey(assetKey string) error
- func VerifyTransactionHash(hash string) error
- type UnsupportedWitnessProgLenError
- type UnsupportedWitnessVerError
Constants ¶
View Source
const ( BitcoinChainAssetKey = "c6d0c728-2624-429b-8e0d-d9d19b6592fa" BitcoinOmniUSDTAssetKey = "815b0b1a-2764-3736-8faa-42d694fa620a" )
Variables ¶
View Source
var ( // ErrChecksumMismatch describes an error where decoding failed due // to a bad checksum. ErrChecksumMismatch = errors.New("checksum mismatch") // ErrUnknownAddressType describes an error where an address can not // decoded as a specific address type due to the string encoding // beginning with an identifier byte unknown to any standard or // registered (via chaincfg.Register) network. ErrUnknownAddressType = errors.New("unknown address type") // ErrAddressCollision describes an error where an address can not // be uniquely determined as either a pay-to-pubkey-hash or // pay-to-script-hash address since the leading identifier is used for // describing both address kinds, but for different networks. Rather // than assuming or defaulting to one or the other, this error is // returned and the caller must decide how to decode the address. ErrAddressCollision = errors.New("address collision") )
View Source
var ( BitcoinChainId crypto.Hash BitcoinOmniUSDTId crypto.Hash )
Functions ¶
func DecodeCheckAddress ¶ added in v0.13.16
DecodeAddress decodes the string encoding of an address and returns the Address if addr is a valid encoding for a known address type.
The bitcoin network the address is associated with is extracted if possible. When the address does not encode the network, such as in the case of a raw public key, the address will be associated with the passed defaultNet.
func GenerateAssetId ¶
func VerifyAddress ¶
func VerifyAssetKey ¶
func VerifyTransactionHash ¶
Types ¶
type UnsupportedWitnessProgLenError ¶ added in v0.13.16
type UnsupportedWitnessProgLenError int
UnsupportedWitnessProgLenError describes an error where a segwit address being decoded has an unsupported witness program length.
func (UnsupportedWitnessProgLenError) Error ¶ added in v0.13.16
func (e UnsupportedWitnessProgLenError) Error() string
type UnsupportedWitnessVerError ¶ added in v0.13.16
type UnsupportedWitnessVerError byte
UnsupportedWitnessVerError describes an error where a segwit address being decoded has an unsupported witness version.
func (UnsupportedWitnessVerError) Error ¶ added in v0.13.16
func (e UnsupportedWitnessVerError) Error() string
Click to show internal directories.
Click to hide internal directories.