Documentation ¶
Index ¶
Constants ¶
View Source
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" )
View Source
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" )
Variables ¶
View Source
var ( StakingProtocolAddrHash = hash160b([]byte("staking")) RewardingProtocolAddrHash = hash160b([]byte("rewarding")) StakingCreateAddrHash = bytesToHash160([]byte("stakingCreate")) StakingAddDepositAddrHash = bytesToHash160([]byte("stakingAddDeposit")) StakingChangeCandAddrHash = bytesToHash160([]byte("stakingChangeCand")) StakingUnstakeAddrHash = bytesToHash160([]byte("stakingUnstake")) StakingWithdrawAddrHash = bytesToHash160([]byte("stakingWithdraw")) StakingRestakeAddrHash = bytesToHash160([]byte("stakingRestake")) StakingTransferAddrHash = bytesToHash160([]byte("stakingTransfer")) StakingRegisterCandAddrHash = bytesToHash160([]byte("stakingRegisterCand")) StakingUpdateCandAddrHash = bytesToHash160([]byte("stakingUpdateCand")) )
20-byte protocol address hash
View Source
var ErrInvalidAddr = errors.New("invalid address")
ErrInvalidAddr indicates the invalid address error
Functions ¶
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 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
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. |
Click to show internal directories.
Click to hide internal directories.