Documentation
¶
Index ¶
- Variables
- func AddressToPKHash(addr string) (hash.PKHash, error)
- func CreateContractAddress(ownerAddr string, chainID []byte, nonce uint64) (string, error)
- func CreateID(rawAddress string) []uint8
- func GetPubkeyHash(address string) ([]byte, error)
- func IsValidHrp(hrp string) bool
- func IsValidVersion(version byte) bool
- type Address
- type DKGAddress
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidVersion is returned when invalid version has been detected. ErrInvalidVersion = errors.New("invalid version") // ErrInvalidChainID is returned when invalid chain ID has been detected. ErrInvalidChainID = errors.New("invalid chain ID") // ErrInvalidHRP is returned when invalid human readable prefix has been detected. ErrInvalidHRP = errors.New("invalid human readable prefix") // IsTestnet is used to get address IsTestnet = false )
Functions ¶
func AddressToPKHash ¶
AddressToPKHash returns public key hash from account address
func CreateContractAddress ¶
CreateContractAddress returns the contract address given owner address and nonce
func GetPubkeyHash ¶
GetPubkeyHash extracts public key hash from address
func IsValidVersion ¶
IsValidVersion returns if version is valid or not
Types ¶
type Address ¶
type Address struct {
PrivateKey keypair.PrivateKey
PublicKey keypair.PublicKey
RawAddress string
}
Address contains a pair of key and a string address
func GetAddressByHash ¶
GetAddressByHash returns the address given a 20-byte hash
func GetAddressByPubkey ¶
GetAddressByPubkey returns the address given a public key and necessary params.
type DKGAddress ¶
DKGAddress contains a pair of DKGkey and a DKGID
Click to show internal directories.
Click to hide internal directories.