Versions in this module Expand all Collapse all v1 v1.0.1 Nov 9, 2020 v1.0.0 Nov 9, 2020 Changes in this version + const MiniSecretKeyLength + const SecretKeyLength + var ErrDecodingSecretHex = errors.New("Error decoding secret hex phrase") + var ErrEmptyPhrase = errors.New("The parsed Secret URI has an empty phrase") + var ErrInvalidByteLength = errors.New("An invalid number of bytes has been given") + var ErrInvalidSURIFormat = errors.New("Secret URI format is invalid") + var ErrInvalidWordCount = errors.New("An invalid WordCount was given, valid values are 12, 15, 18, 21, or 24") + var ErrNonMnemonic = errors.New("Error KeyRing was generated from non mnemonic source") + var ErrSeedNotAvailable = errors.New("Unable to get seed from public address data") + var ErrUnknownPhraseType = errors.New("SURI phrase type is unknown or not set") + func DecodeHex(str string, prefix HexPrefix) (seed []byte, ok bool) + func DecodeSS58Address(addr string, net Network, ctype ChecksumType) ([32]byte, error) + func EncodeHex(raw []byte, prefix HexPrefix) string + func SS58Address(addr [32]byte, net Network, ctype ChecksumType) (string, error) + type ChecksumType int + const AccountID + const SS58Checksum + type DerivablePrivateKey bool + type HexPrefix string + type KeyRing struct + func FromPublic(b [32]byte, net Network) (*KeyRing, error) + func FromURI(str string, net Network) (*KeyRing, error) + func Generate(words int, net Network) (*KeyRing, error) + func (k *KeyRing) Mnemonic() (string, error) + func (k *KeyRing) Public() [32]byte + func (k *KeyRing) PublicHex() string + func (k *KeyRing) SS58Address() (string, error) + func (k *KeyRing) Secret() [32]byte + func (k *KeyRing) SecretHex() string + func (k *KeyRing) Seed() ([32]byte, error) + func (k *KeyRing) SeedHex() (string, error) + func (k *KeyRing) Sign(t *merlin.Transcript) (signature [64]byte, err error) + func (k *KeyRing) SigningContext(msg []byte) *merlin.Transcript + func (k *KeyRing) Verify(t *merlin.Transcript, signature [64]byte) bool + func (k *KeyRing) VrfSign(t *merlin.Transcript) (output [32]byte, proof [64]byte, err error) + func (k *KeyRing) VrfVerify(t *merlin.Transcript, output [32]byte, proof [64]byte) (bool, error) + type NetSubstrate struct + func (n NetSubstrate) AddressPrefix() HexPrefix + func (n NetSubstrate) ChecksumEnd() int + func (n NetSubstrate) ChecksumStart() int + func (n NetSubstrate) Name() string + func (n NetSubstrate) Version() uint8 + type Network interface + AddressPrefix func() HexPrefix + ChecksumEnd func() int + ChecksumStart func() int + Name func() string + Version func() uint8 + type PhraseType int + const Mnemonic + const RawPublicKey + const SS58Public + const SecretHex + type SecretURI struct + Network Network + Password string + Path string + Phrase string + Type PhraseType + func NewSecretURI(suri string, net Network) (*SecretURI, error) + func (s *SecretURI) DerivableKey() (sr25519.DerivableKey, DerivablePrivateKey, error) + func (s *SecretURI) GetJunctions() ([]*junction, error) + type WordCount int