Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateKey(random io.Reader) (PublicKey, PrivateKey)
- func GenerateKeyFromSecret(secret string) (PublicKey, PrivateKey)
- func Sha3(data ...[]byte) []byte
- type Address
- func AccountAddress(bs []byte) (Address, error)
- func AddressFromRawBytes(bs []byte) (Address, error)
- func AddressFromString(text string) (Address, error)
- func ContractAddress(bs []byte) (Address, error)
- func DeriveContractAddress(addr Address, sequence uint64) Address
- func ValidatorAddress(bs []byte) (Address, error)
- func (addr *Address) EnsureValid() error
- func (addr Address) EqualsTo(right Address) bool
- func (addr *Address) IsAccountAddress() bool
- func (addr *Address) IsContractAddress() bool
- func (addr *Address) IsValidatorAddress() bool
- func (addr *Address) Marshal() ([]byte, error)
- func (addr Address) MarshalAmino() ([]byte, error)
- func (addr Address) MarshalText() ([]byte, error)
- func (addr *Address) MarshalTo(data []byte) (int, error)
- func (addr Address) RawBytes() []byte
- func (addr *Address) Size() int
- func (addr Address) String() string
- func (addr *Address) Unmarshal(bs []byte) error
- func (addr *Address) UnmarshalAmino(bs []byte) error
- func (addr *Address) UnmarshalText(text []byte) error
- func (addr Address) Verify(pb PublicKey) bool
- type PrivateKey
- func (pv *PrivateKey) EnsureValid() error
- func (pv PrivateKey) MarshalAmino() ([]byte, error)
- func (pv PrivateKey) MarshalText() ([]byte, error)
- func (pv PrivateKey) PublicKey() PublicKey
- func (pv PrivateKey) RawBytes() []byte
- func (pv PrivateKey) Sign(msg []byte) (Signature, error)
- func (pv PrivateKey) SignWithoutHash(msg []byte) (Signature, error)
- func (pv PrivateKey) String() string
- func (pv *PrivateKey) UnmarshalAmino(bs []byte) error
- func (pv *PrivateKey) UnmarshalText(text []byte) error
- type PublicKey
- func (pb PublicKey) ABCIPubKey() tmABCI.PubKey
- func (pb PublicKey) AccountAddress() Address
- func (pb *PublicKey) Encode() ([]byte, error)
- func (pb *PublicKey) EnsureValid() error
- func (pb *PublicKey) Marshal() ([]byte, error)
- func (pb PublicKey) MarshalAmino() ([]byte, error)
- func (pb PublicKey) MarshalText() ([]byte, error)
- func (pb *PublicKey) MarshalTo(data []byte) (int, error)
- func (pb PublicKey) RawBytes() []byte
- func (pb *PublicKey) Size() int
- func (pb PublicKey) String() string
- func (pb PublicKey) TMPubKey() tmCrypto.PubKey
- func (pb *PublicKey) Unmarshal(bs []byte) error
- func (pb *PublicKey) UnmarshalAmino(bs []byte) error
- func (pb *PublicKey) UnmarshalText(text []byte) error
- func (pb PublicKey) ValidatorAddress() Address
- func (pb PublicKey) Verify(msg []byte, signature Signature) bool
- type Signatory
- type Signature
- func (sig *Signature) EnsureValid() error
- func (sig Signature) MarshalAmino() ([]byte, error)
- func (sig Signature) MarshalText() ([]byte, error)
- func (sig Signature) RawBytes() []byte
- func (sig Signature) String() string
- func (sig *Signature) UnmarshalAmino(bs []byte) error
- func (sig *Signature) UnmarshalText(text []byte) error
- type Signer
Constants ¶
View Source
const AddressSize = 26
Variables ¶
View Source
var GlobalAddress, _ = AddressFromString("gbnDyGpPVijzB74qUhiEAvgdZYMdK2Uvdkh")
Functions ¶
func GenerateKey ¶
func GenerateKey(random io.Reader) (PublicKey, PrivateKey)
func GenerateKeyFromSecret ¶
func GenerateKeyFromSecret(secret string) (PublicKey, PrivateKey)
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func AccountAddress ¶
func AddressFromRawBytes ¶
func AddressFromString ¶
func ContractAddress ¶
func DeriveContractAddress ¶
func ValidatorAddress ¶
func (*Address) EnsureValid ¶
func (*Address) IsAccountAddress ¶
func (*Address) IsContractAddress ¶
func (*Address) IsValidatorAddress ¶
func (Address) MarshalAmino ¶
func (Address) MarshalText ¶
func (*Address) UnmarshalAmino ¶
func (*Address) UnmarshalText ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func PrivateKeyFromRawBytes ¶
func PrivateKeyFromRawBytes(bs []byte) (PrivateKey, error)
PrivateKeyFromRawBytes constructs a private key from ed25519 raw bytes.
func PrivateKeyFromString ¶
func PrivateKeyFromString(text string) (PrivateKey, error)
PrivateKeyFromString constructs a private key from base58 encoding text and check the prefix and checksum
func (*PrivateKey) EnsureValid ¶
func (pv *PrivateKey) EnsureValid() error
func (PrivateKey) MarshalAmino ¶
func (pv PrivateKey) MarshalAmino() ([]byte, error)
func (PrivateKey) MarshalText ¶
func (pv PrivateKey) MarshalText() ([]byte, error)
func (PrivateKey) PublicKey ¶
func (pv PrivateKey) PublicKey() PublicKey
func (PrivateKey) RawBytes ¶
func (pv PrivateKey) RawBytes() []byte
/ ------- / CASTING RawBytes returns the ed25519 raw bytes of the private key
func (PrivateKey) SignWithoutHash ¶ added in v0.3.0
func (pv PrivateKey) SignWithoutHash(msg []byte) (Signature, error)
func (PrivateKey) String ¶
func (pv PrivateKey) String() string
String return the base58 encoding text of the private key with the prefix and checksum
func (*PrivateKey) UnmarshalAmino ¶
func (pv *PrivateKey) UnmarshalAmino(bs []byte) error
func (*PrivateKey) UnmarshalText ¶
func (pv *PrivateKey) UnmarshalText(text []byte) error
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey
func PublicKeyFromRawBytes ¶
PublicKeyFromRawBytes reads the raw bytes and returns an ed25519 public key.
func PublicKeyFromString ¶
PrivateKeyFromString constructs a private key from base58 encoding text and check the prefix and checksum
func (PublicKey) ABCIPubKey ¶
func (PublicKey) AccountAddress ¶
func (*PublicKey) EnsureValid ¶
func (PublicKey) MarshalAmino ¶
func (PublicKey) MarshalText ¶
func (PublicKey) String ¶
String return the base58 encoding text of the public key with the prefix and checksum
func (*PublicKey) UnmarshalAmino ¶
func (*PublicKey) UnmarshalText ¶
func (PublicKey) ValidatorAddress ¶
type Signatory ¶
type Signatory struct { PublicKey PublicKey `json:"publicKey"` Signature Signature `json:"signature"` }
Signatory contains signature and PublicKey to identify the signer
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
func SignatureFromRawBytes ¶
func SignatureFromString ¶
func (*Signature) EnsureValid ¶
func (Signature) MarshalAmino ¶
func (Signature) MarshalText ¶
func (*Signature) UnmarshalAmino ¶
func (*Signature) UnmarshalText ¶
type Signer ¶
type Signer interface { Address() Address PublicKey() PublicKey Sign(msg []byte) (Signature, error) SignWithoutHash(msg []byte) (Signature, error) // Sign the message without hashing it }
func NewAccountSigner ¶
func NewAccountSigner(pv PrivateKey) Signer
func NewValidatorSigner ¶
func NewValidatorSigner(pv PrivateKey) Signer
Click to show internal directories.
Click to hide internal directories.