Documentation
¶
Index ¶
Constants ¶
const ( // MainnetPrefix is the prefix added to the human readable address of mainnet MainnetPrefix = "io" // TestnetPrefix is the prefix added to the human readable address of testnet TestnetPrefix = "it" )
const ( // ZeroAddress is the IoTeX address whose hash160 is all zero ZeroAddress = "io1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqd39ym7" // StakingBucketPoolAddr is the staking bucket pool address StakingBucketPoolAddr = "io000000000000000000000000stakingprotocol" // RewardingPoolAddr is the rewarding pool address RewardingPoolAddr = "io0000000000000000000000rewardingprotocol" // StakingProtocolAddr is the staking protocol address StakingProtocolAddr = "io1qnpz47hx5q6r3w876axtrn6yz95d70cjl35r53" // RewardingProtocol is the rewarding protocol address RewardingProtocol = "io154mvzs09vkgn0hw6gg3ayzw5w39jzp47f8py9v" )
const V1AddressStringLength = 41
V1AddressStringLength is the length of v1 address string
Variables ¶
var ( StakingProtocolAddrHash = hash160b([]byte("staking")) RewardingProtocolAddrHash = hash160b([]byte("rewarding")) )
20-byte protocol address hash
var ErrInvalidAddr = errors.New("invalid address")
ErrInvalidAddr indicates the invalid address error
Functions ¶
func IsAddrV1Special ¶ added in v0.2.6
IsAddrV1Special returns true for special address
Types ¶
type AddrV1 ¶
type AddrV1 struct {
// contains filtered or unexported fields
}
AddrV1 is V1 address format to be used on IoTeX blockchain and subchains It is composed of a 20-byte hash derived from the the public key
type AddrV1Special ¶ added in v0.2.6
type AddrV1Special struct {
// contains filtered or unexported fields
}
AddrV1Special is address that consists of special text it is NOT a valid bech32 encoding of the 20-bytes hash
func (*AddrV1Special) Bytes ¶ added in v0.2.6
func (addr *AddrV1Special) Bytes() []byte
Bytes panics since it is NOT a valid bech32 encoding
func (*AddrV1Special) Hex ¶ added in v0.2.6
func (addr *AddrV1Special) Hex() string
Hex panics since it is NOT a valid bech32 encoding
func (*AddrV1Special) String ¶ added in v0.2.6
func (addr *AddrV1Special) String() string
String returns the special-text address
type Address ¶
type Address interface { // String encodes the address into a string using bech32 encoding String() string // Bytes returns the underlying 20-byte public key hash Bytes() []byte // Hex is the hex-encoding of Bytes, prefixed with "0x" Hex() string }
Address defines the interface of the blockchain address
func FromString ¶
FromString decodes an encoded address string into an address struct
func FromStringLegacy ¶ added in v0.2.8
FromStringLegacy decodes an encoded address string into an address struct
Directories
¶
Path | Synopsis |
---|---|
Package bech32 includes a Bech32 string which is at most 90 characters long and consists of: The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader.
|
Package bech32 includes a Bech32 string which is at most 90 characters long and consists of: The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader. |