Documentation ¶
Index ¶
- func Decode(encoding Encoding, str string) ([]byte, error)
- func EncodeWithChecksum(encoding Encoding, bytes []byte) (string, error)
- func EncodeWithoutChecksum(encoding Encoding, bytes []byte) (string, error)
- func FormatAddress(chainIDAlias string, hrp string, addr []byte) (string, error)
- func FormatBech32(hrp string, payload []byte) (string, error)
- func IntFormat(maxValue int) string
- func ParseAddress(addrStr string) (string, string, []byte, error)
- func ParseBech32(addrStr string) (string, []byte, error)
- type CustomStringer
- type DumpBytes
- type Encoding
- type PrefixedStringer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode [str] to bytes using the given encoding If [str] is the empty string, returns a nil byte slice and nil error
func EncodeWithChecksum ¶
EncodeWithChecksum bytes to a string using the given encoding format bytes may be nil, in which case it will be treated the same as an empty slice. This function includes a checksum in the encoded string.
func EncodeWithoutChecksum ¶
EncodeWithoutChecksum bytes to a string using the given encoding format bytes may be nil, in which case it will be treated the same as an empty slice. Unlike EncodeWithChecksum, this function does not include a checksum in the encoded string.
func FormatAddress ¶
FormatAddress takes in a chain prefix, HRP, and byte slice to produce a string for an address.
func FormatBech32 ¶
FormatBech32 takes an address's bytes as input and returns a bech32 address
func ParseAddress ¶
ParseAddress takes in an address string and splits returns the corresponding parts. This returns the chain ID alias, bech32 HRP, address bytes, and an error if it occurs.
Types ¶
type CustomStringer ¶
type CustomStringer struct{ Stringer func() string }
func (CustomStringer) String ¶
func (cs CustomStringer) String() string
type Encoding ¶
type Encoding uint8
Encoding defines how bytes are converted to a string and vice versa