Documentation ¶
Index ¶
- type HashAddressConverter
- func (hac *HashAddressConverter) AddressLen() int
- func (hac *HashAddressConverter) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (hac *HashAddressConverter) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (hac *HashAddressConverter) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (hac *HashAddressConverter) IsInterfaceNil() bool
- func (hac *HashAddressConverter) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
- type PlainAddressConverter
- func (pac *PlainAddressConverter) AddressLen() int
- func (pac *PlainAddressConverter) ConvertToBech32(addressContainer state.AddressContainer) (string, error)
- func (pac *PlainAddressConverter) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (pac *PlainAddressConverter) CreateAddressFromBech32(bech32Address string) (state.AddressContainer, error)
- func (pac *PlainAddressConverter) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (pac *PlainAddressConverter) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (pac *PlainAddressConverter) IsInterfaceNil() bool
- func (pac *PlainAddressConverter) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashAddressConverter ¶
type HashAddressConverter struct {
// contains filtered or unexported fields
}
HashAddressConverter is used to convert the address from/to different structures
func NewHashAddressConverter ¶
func NewHashAddressConverter(hasher hashing.Hasher, addressLen int, prefix string) (*HashAddressConverter, error)
NewHashAddressConverter creates a new instance of HashAddressConverter
func (*HashAddressConverter) AddressLen ¶
func (hac *HashAddressConverter) AddressLen() int
AddressLen returns the address length
func (*HashAddressConverter) ConvertToHex ¶
func (hac *HashAddressConverter) ConvertToHex(addressContainer state.AddressContainer) (string, error)
ConvertToHex returns the hex string representation of the address.
func (*HashAddressConverter) CreateAddressFromHex ¶
func (hac *HashAddressConverter) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
CreateAddressFromHex creates the address from hex string
func (*HashAddressConverter) CreateAddressFromPublicKeyBytes ¶
func (hac *HashAddressConverter) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
CreateAddressFromPublicKeyBytes hashes the bytes received as parameters, trimming if necessary and outputs a new AddressContainer obj
func (*HashAddressConverter) IsInterfaceNil ¶
func (hac *HashAddressConverter) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HashAddressConverter) PrepareAddressBytes ¶
func (hac *HashAddressConverter) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
PrepareAddressBytes checks and returns the slice compatible to the address format
type PlainAddressConverter ¶
type PlainAddressConverter struct {
// contains filtered or unexported fields
}
PlainAddressConverter is used to convert the address from/to different structures
func NewPlainAddressConverter ¶
func NewPlainAddressConverter(addressLen int, prefix string) (*PlainAddressConverter, error)
NewPlainAddressConverter creates a new instance of HashAddressConverter
func (*PlainAddressConverter) AddressLen ¶
func (pac *PlainAddressConverter) AddressLen() int
AddressLen returns the address length
func (*PlainAddressConverter) ConvertToBech32 ¶
func (pac *PlainAddressConverter) ConvertToBech32(addressContainer state.AddressContainer) (string, error)
ConvertToBech32 returns the address in bech32 format
func (*PlainAddressConverter) ConvertToHex ¶
func (pac *PlainAddressConverter) ConvertToHex(addressContainer state.AddressContainer) (string, error)
ConvertToHex returns the hex string representation of the address.
func (*PlainAddressConverter) CreateAddressFromBech32 ¶
func (pac *PlainAddressConverter) CreateAddressFromBech32(bech32Address string) (state.AddressContainer, error)
CreateAddressFromBech32 creates the address from bech32 string
func (*PlainAddressConverter) CreateAddressFromHex ¶
func (pac *PlainAddressConverter) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
CreateAddressFromHex creates the address from hex string
func (*PlainAddressConverter) CreateAddressFromPublicKeyBytes ¶
func (pac *PlainAddressConverter) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
CreateAddressFromPublicKeyBytes returns the bytes received as parameters, trimming if necessary and outputs a new AddressContainer obj
func (*PlainAddressConverter) IsInterfaceNil ¶
func (pac *PlainAddressConverter) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PlainAddressConverter) PrepareAddressBytes ¶
func (pac *PlainAddressConverter) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
PrepareAddressBytes checks and returns the slice compatible to the address format