Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateTestKeyPair() (Address, PublicKey, PrivateKey)
- func Hash160(data []byte) []byte
- func Hash256(data []byte) []byte
- func RandomKeyPair() (Address, PublicKey, PrivateKey)
- func VerifyAggregated(aggregated Signature, pubs []PublicKey, msg []byte) bool
- type Address
- func (addr Address) EqualsTo(right Address) bool
- func (addr Address) Fingerprint() string
- func (addr Address) MarshalCBOR() ([]byte, error)
- func (addr Address) MarshalJSON() ([]byte, error)
- func (addr Address) MarshalText() ([]byte, error)
- func (addr Address) RawBytes() []byte
- func (addr *Address) SanityCheck() error
- func (addr Address) String() string
- func (addr *Address) UnmarshalCBOR(bs []byte) error
- func (addr *Address) UnmarshalJSON(bz []byte) error
- func (addr *Address) UnmarshalText(text []byte) error
- func (addr Address) Verify(pb PublicKey) bool
- type Hash
- func (h Hash) EqualsTo(r Hash) bool
- func (h Hash) Fingerprint() string
- func (h Hash) IsUndef() bool
- func (h Hash) MarshalCBOR() ([]byte, error)
- func (h Hash) MarshalJSON() ([]byte, error)
- func (h Hash) MarshalText() ([]byte, error)
- func (h Hash) RawBytes() []byte
- func (h Hash) SanityCheck() error
- func (h Hash) String() string
- func (h *Hash) UnmarshalCBOR(bs []byte) error
- func (h *Hash) UnmarshalJSON(bz []byte) error
- func (h *Hash) UnmarshalText(text []byte) error
- type PrivateKey
- func (pv *PrivateKey) EqualsTo(right PrivateKey) bool
- func (pv PrivateKey) MarshalCBOR() ([]byte, error)
- func (pv PrivateKey) MarshalJSON() ([]byte, error)
- func (pv PrivateKey) MarshalText() ([]byte, error)
- func (pv *PrivateKey) PublicKey() PublicKey
- func (pv PrivateKey) RawBytes() []byte
- func (pv *PrivateKey) SanityCheck() error
- func (pv *PrivateKey) Sign(msg []byte) Signature
- func (pv PrivateKey) String() string
- func (pv *PrivateKey) UnmarshalCBOR(bs []byte) error
- func (pv *PrivateKey) UnmarshalJSON(bz []byte) error
- func (pv *PrivateKey) UnmarshalText(text []byte) error
- type PublicKey
- func (pb PublicKey) Address() Address
- func (pb *PublicKey) EqualsTo(right PublicKey) bool
- func (pb PublicKey) MarshalCBOR() ([]byte, error)
- func (pb PublicKey) MarshalJSON() ([]byte, error)
- func (pb PublicKey) MarshalText() ([]byte, error)
- func (pb PublicKey) RawBytes() []byte
- func (pb *PublicKey) SanityCheck() error
- func (pb PublicKey) String() string
- func (pb *PublicKey) UnmarshalCBOR(bs []byte) error
- func (pb *PublicKey) UnmarshalJSON(bz []byte) error
- func (pb *PublicKey) UnmarshalText(text []byte) error
- func (pb *PublicKey) Verify(msg []byte, sig Signature) bool
- type SignableMsg
- type Signature
- func (sig Signature) EqualsTo(right Signature) bool
- func (sig Signature) Fingerprint() string
- func (sig Signature) MarshalCBOR() ([]byte, error)
- func (sig Signature) MarshalJSON() ([]byte, error)
- func (sig Signature) MarshalText() ([]byte, error)
- func (sig Signature) RawBytes() []byte
- func (sig Signature) SanityCheck() error
- func (sig Signature) String() string
- func (sig *Signature) UnmarshalCBOR(bs []byte) error
- func (sig *Signature) UnmarshalJSON(bz []byte) error
- func (sig *Signature) UnmarshalText(text []byte) error
- type Signer
Constants ¶
View Source
const HashSize = 32
View Source
const PrivateKeySize = 32
View Source
const PublicKeySize = 96
View Source
const SignatureSize = 48
Variables ¶
View Source
var TreasuryAddress = Address{ // contains filtered or unexported fields }
View Source
var UndefHash = Hash{/* contains filtered or unexported fields */}
Functions ¶
func GenerateTestKeyPair ¶ added in v1.0.0
func GenerateTestKeyPair() (Address, PublicKey, PrivateKey)
--------- For tests
func RandomKeyPair ¶ added in v1.0.0
func RandomKeyPair() (Address, PublicKey, PrivateKey)
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func AddressFromRawBytes ¶
func AddressFromString ¶
func (Address) Fingerprint ¶
func (Address) MarshalCBOR ¶
func (Address) MarshalJSON ¶
func (Address) MarshalText ¶
func (*Address) SanityCheck ¶
func (*Address) UnmarshalCBOR ¶
func (*Address) UnmarshalJSON ¶
func (*Address) UnmarshalText ¶
type Hash ¶ added in v1.0.0
type Hash struct {
// contains filtered or unexported fields
}
func HashFromRawBytes ¶ added in v1.0.0
func HashFromString ¶ added in v1.0.0
func (Hash) Fingerprint ¶ added in v1.0.0
func (Hash) MarshalCBOR ¶ added in v1.0.0
func (Hash) MarshalJSON ¶ added in v1.0.0
func (Hash) MarshalText ¶ added in v1.0.0
func (Hash) SanityCheck ¶ added in v1.0.0
func (*Hash) UnmarshalCBOR ¶ added in v1.0.0
func (*Hash) UnmarshalJSON ¶ added in v1.0.0
func (*Hash) UnmarshalText ¶ added in v1.0.0
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func PrivateKeyFromRawBytes ¶ added in v1.0.0
func PrivateKeyFromRawBytes(data []byte) (PrivateKey, error)
func PrivateKeyFromSeed ¶ added in v1.0.0
func PrivateKeyFromSeed(seed []byte) (PrivateKey, error)
func PrivateKeyFromString ¶ added in v1.0.0
func PrivateKeyFromString(text string) (PrivateKey, error)
func (*PrivateKey) EqualsTo ¶
func (pv *PrivateKey) EqualsTo(right PrivateKey) bool
func (PrivateKey) MarshalCBOR ¶
func (pv PrivateKey) MarshalCBOR() ([]byte, error)
func (PrivateKey) MarshalJSON ¶
func (pv PrivateKey) MarshalJSON() ([]byte, error)
func (PrivateKey) MarshalText ¶ added in v1.0.0
func (pv PrivateKey) MarshalText() ([]byte, error)
func (*PrivateKey) PublicKey ¶
func (pv *PrivateKey) PublicKey() PublicKey
func (PrivateKey) RawBytes ¶
func (pv PrivateKey) RawBytes() []byte
func (*PrivateKey) SanityCheck ¶
func (pv *PrivateKey) SanityCheck() error
func (*PrivateKey) Sign ¶
func (pv *PrivateKey) Sign(msg []byte) Signature
func (PrivateKey) String ¶
func (pv PrivateKey) String() string
func (*PrivateKey) UnmarshalCBOR ¶ added in v1.0.0
func (pv *PrivateKey) UnmarshalCBOR(bs []byte) error
func (*PrivateKey) UnmarshalJSON ¶ added in v1.0.0
func (pv *PrivateKey) UnmarshalJSON(bz []byte) error
func (*PrivateKey) UnmarshalText ¶ added in v1.0.0
func (pv *PrivateKey) UnmarshalText(text []byte) error
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func PublicKeyFromRawBytes ¶ added in v1.0.0
func PublicKeyFromString ¶ added in v1.0.0
func (PublicKey) MarshalCBOR ¶
func (PublicKey) MarshalJSON ¶
func (PublicKey) MarshalText ¶ added in v1.0.0
func (*PublicKey) SanityCheck ¶
func (*PublicKey) UnmarshalCBOR ¶ added in v0.9.1
func (*PublicKey) UnmarshalJSON ¶ added in v1.0.0
func (*PublicKey) UnmarshalText ¶ added in v1.0.0
type SignableMsg ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
func SignatureFromRawBytes ¶ added in v1.0.0
func SignatureFromString ¶ added in v1.0.0
func (Signature) Fingerprint ¶ added in v1.0.0
func (Signature) MarshalCBOR ¶
func (Signature) MarshalJSON ¶
func (Signature) MarshalText ¶ added in v1.0.0
func (Signature) SanityCheck ¶
func (*Signature) UnmarshalCBOR ¶ added in v0.9.1
func (*Signature) UnmarshalJSON ¶ added in v1.0.0
func (*Signature) UnmarshalText ¶ added in v1.0.0
Click to show internal directories.
Click to hide internal directories.