Documentation ¶
Index ¶
- Constants
- func DecodeType(address string) (int, error)
- func GetScriptType(script []byte) int
- func IsConfidential(address string) (bool, error)
- func NetworkForAddress(address string) (*network.Network, error)
- func ToBase58(b *Base58) string
- func ToBase58Confidential(b *Base58Confidential) string
- func ToBech32(bc *Bech32) (string, error)
- func ToBlech32(bl *Blech32) (string, error)
- func ToConfidential(ca *ConfidentialAddress) (string, error)
- func ToOutputScript(address string) ([]byte, error)
- type Address
- type Base58
- type Base58Confidential
- type Bech32
- type Blech32
- type ConfidentialAddress
Constants ¶
const ( P2Pkh = iota P2Sh ConfidentialP2Pkh ConfidentialP2Sh P2Wpkh P2Wsh ConfidentialP2Wpkh ConfidentialP2Wsh P2PkhScript = 1 P2ShScript = 2 P2MultiSigScript = 3 P2WpkhScript = 4 P2WshScript = 5 )
Variables ¶
This section is empty.
Functions ¶
func DecodeType ¶ added in v0.0.3
DecodeType returns address type
func GetScriptType ¶ added in v0.0.4
GetScriptType returns the type of the given script (p2pkh, p2sh, etc.)
func IsConfidential ¶ added in v0.1.0
IsConfidential checks whether the given address is confidential
func NetworkForAddress ¶ added in v0.0.4
NetworkForAddress returns the network based on the prefix of the given address
func ToBase58Confidential ¶ added in v0.0.4
func ToBase58Confidential(b *Base58Confidential) string
ToBase58Confidential prepends a version byte and appends a four byte checksum.
func ToBech32 ¶
ToBech32 encodes a byte slice into a bech32 string with the human-readable part hrb. Note that the bytes must each encode 5 bits
func ToConfidential ¶ added in v0.0.4
func ToConfidential(ca *ConfidentialAddress) (string, error)
ToConfidential returns the confidential address formed by the given unconfidential address and blinding public key
func ToOutputScript ¶ added in v0.0.3
ToOutputScript creates a new script to pay a transaction output to a the specified address
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
Address defines the address as string
type Base58 ¶
Base58 type defines the structure of a legacy or wrapped segwit address
func FromBase58 ¶
FromBase58 decodes a string that was base58 encoded and verifies the checksum.
type Base58Confidential ¶ added in v0.0.4
Base58Confidential type defines the structure of a legacy or wrapped segwit confidential address
func FromBase58Confidential ¶ added in v0.0.4
func FromBase58Confidential(address string) (*Base58Confidential, error)
FromBase58Confidential decodes a confidenail address that was base58 encoded
and verifies the checksum.
type Bech32 ¶
Bech32 defines the structure of an address native segwit
func FromBech32 ¶
FromBech32 decodes a bech32 encoded string, returning the human-readable part and the data part excluding the checksum.
type Blech32 ¶
Blech32 defines the structure of a confidential address native segwit
func FromBlech32 ¶ added in v0.0.2
FromBlech32 decodes a blech32 encoded string, returning the human-readable part and the data part excluding the checksum.
type ConfidentialAddress ¶ added in v0.0.4
ConfidentialAddress defines the structure of a generic confidential address
func FromConfidential ¶ added in v0.0.4
func FromConfidential(address string) (*ConfidentialAddress, error)
FromConfidential returns the unconfidential address and the blinding public key that form the confidential address