Versions in this module Expand all Collapse all v0 v0.47.0 Aug 13, 2022 Changes in this version + const BackendFile + const BackendKWallet + const BackendMemory + const BackendOS + const BackendPass + const BackendTest + const DefaultBIP39Passphrase + var ErrIntOverflowRecord = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthRecord = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrPrivKeyExtr = errors.New("private key extraction works only for Local") + var ErrUnexpectedEndOfGroupRecord = fmt.Errorf("proto: unexpected end of group") + var ErrUnsupportedLanguage = errors.New("unsupported language: only english is supported") + var ErrUnsupportedSigningAlgo = errors.New("unsupported signing algo") + func MarshalInfo(i LegacyInfo) []byte + func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) + func SignWithLedger(k *Record, msg []byte) (sig []byte, pub types.PubKey, err error) + type DeriveKeyFunc func(mnemonic string, bip39Passphrase, hdPath string, algo hd.PubKeyType) ([]byte, error) + type Exporter interface + ExportPrivKeyArmor func(uid, encryptPassphrase string) (armor string, err error) + ExportPrivKeyArmorByAddress func(address sdk.Address, encryptPassphrase string) (armor string, err error) + ExportPubKeyArmor func(uid string) (string, error) + ExportPubKeyArmorByAddress func(address sdk.Address) (string, error) + type Importer interface + ImportPrivKey func(uid, armor, passphrase string) error + ImportPubKey func(uid string, armor string) error + type KeyOutput struct + Address string + Mnemonic string + Name string + PubKey string + Type string + func MkAccKeyOutput(k *Record) (KeyOutput, error) + func MkAccKeysOutput(records []*Record) ([]KeyOutput, error) + func MkConsKeyOutput(k *Record) (KeyOutput, error) + func MkValKeyOutput(k *Record) (KeyOutput, error) + func NewKeyOutput(name string, keyType KeyType, a sdk.Address, pk cryptotypes.PubKey) (KeyOutput, error) + type KeyType uint + const TypeLedger + const TypeLocal + const TypeMulti + const TypeOffline + func (kt KeyType) String() string + type Keyring interface + Backend func() string + Delete func(uid string) error + DeleteByAddress func(address sdk.Address) error + Key func(uid string) (*Record, error) + KeyByAddress func(address sdk.Address) (*Record, error) + List func() ([]*Record, error) + NewAccount func(uid, mnemonic, bip39Passphrase, hdPath string, algo SignatureAlgo) (*Record, error) + NewMnemonic func(uid string, language Language, hdPath, bip39Passphrase string, ...) (*Record, string, error) + Rename func(from string, to string) error + SaveLedgerKey func(uid string, algo SignatureAlgo, hrp string, coinType, account, index uint32) (*Record, error) + SaveMultisig func(uid string, pubkey types.PubKey) (*Record, error) + SaveOfflineKey func(uid string, pubkey types.PubKey) (*Record, error) + SupportedAlgorithms func() (SigningAlgoList, SigningAlgoList) + func New(appName, backend, rootDir string, userInput io.Reader, cdc codec.Codec, ...) (Keyring, error) + func NewInMemory(cdc codec.Codec, opts ...Option) Keyring + func NewInMemoryWithKeyring(kr keyring.Keyring, cdc codec.Codec, opts ...Option) Keyring + type Language int + const ChineseSimplified + const ChineseTraditional + const English + const French + const Italian + const Japanese + const Korean + const Spanish + type LegacyInfo interface + GetAddress func() sdk.AccAddress + GetAlgo func() hd.PubKeyType + GetName func() string + GetPath func() (*hd.BIP44Params, error) + GetPubKey func() cryptotypes.PubKey + GetType func() KeyType + func NewLegacyMultiInfo(name string, pub cryptotypes.PubKey) (LegacyInfo, error) + type LegacyMultiInfo struct + Name string + PubKey cryptotypes.PubKey + PubKeys []multisigPubKeyInfo + Threshold uint + func (i LegacyMultiInfo) GetAddress() sdk.AccAddress + func (i LegacyMultiInfo) GetAlgo() hd.PubKeyType + func (i LegacyMultiInfo) GetName() string + func (i LegacyMultiInfo) GetPath() (*hd.BIP44Params, error) + func (i LegacyMultiInfo) GetPubKey() cryptotypes.PubKey + func (i LegacyMultiInfo) GetType() KeyType + func (i LegacyMultiInfo) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error + type Migrator interface + MigrateAll func() error + type Option func(options *Options) + type Options struct + SupportedAlgos SigningAlgoList + SupportedAlgosLedger SigningAlgoList + type PrivKeyGenFunc func(bz []byte, algo hd.PubKeyType) (cryptotypes.PrivKey, error) + type Record struct + Item isRecord_Item + Name string + PubKey *types.Any + func NewLedgerRecord(name string, pk cryptotypes.PubKey, path *hd.BIP44Params) (*Record, error) + func NewLocalRecord(name string, priv cryptotypes.PrivKey, pk cryptotypes.PubKey) (*Record, error) + func NewMultiRecord(name string, pk cryptotypes.PubKey) (*Record, error) + func NewOfflineRecord(name string, pk cryptotypes.PubKey) (*Record, error) + func (*Record) Descriptor() ([]byte, []int) + func (*Record) ProtoMessage() + func (*Record) XXX_OneofWrappers() []interface{} + func (k *Record) GetPubKey() (cryptotypes.PubKey, error) + func (k *Record) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error + func (k Record) GetAddress() (types.AccAddress, error) + func (k Record) GetType() KeyType + func (m *Record) GetItem() isRecord_Item + func (m *Record) GetLedger() *Record_Ledger + func (m *Record) GetLocal() *Record_Local + func (m *Record) GetMulti() *Record_Multi + func (m *Record) GetOffline() *Record_Offline + func (m *Record) Marshal() (dAtA []byte, err error) + func (m *Record) MarshalTo(dAtA []byte) (int, error) + func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record) Reset() + func (m *Record) Size() (n int) + func (m *Record) String() string + func (m *Record) Unmarshal(dAtA []byte) error + func (m *Record) XXX_DiscardUnknown() + func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Record) XXX_Merge(src proto.Message) + func (m *Record) XXX_Size() int + func (m *Record) XXX_Unmarshal(b []byte) error + type Record_Ledger struct + Path *hd.BIP44Params + func (*Record_Ledger) Descriptor() ([]byte, []int) + func (*Record_Ledger) ProtoMessage() + func (m *Record_Ledger) Marshal() (dAtA []byte, err error) + func (m *Record_Ledger) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Ledger) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Ledger) Reset() + func (m *Record_Ledger) Size() (n int) + func (m *Record_Ledger) String() string + func (m *Record_Ledger) Unmarshal(dAtA []byte) error + func (m *Record_Ledger) XXX_DiscardUnknown() + func (m *Record_Ledger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Record_Ledger) XXX_Merge(src proto.Message) + func (m *Record_Ledger) XXX_Size() int + func (m *Record_Ledger) XXX_Unmarshal(b []byte) error + func (rl *Record_Ledger) GetPath() *hd.BIP44Params + type Record_Ledger_ struct + Ledger *Record_Ledger + func (m *Record_Ledger_) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Ledger_) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Ledger_) Size() (n int) + type Record_Local struct + PrivKey *types.Any + func (*Record_Local) Descriptor() ([]byte, []int) + func (*Record_Local) ProtoMessage() + func (m *Record_Local) Marshal() (dAtA []byte, err error) + func (m *Record_Local) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Local) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Local) Reset() + func (m *Record_Local) Size() (n int) + func (m *Record_Local) String() string + func (m *Record_Local) Unmarshal(dAtA []byte) error + func (m *Record_Local) XXX_DiscardUnknown() + func (m *Record_Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Record_Local) XXX_Merge(src proto.Message) + func (m *Record_Local) XXX_Size() int + func (m *Record_Local) XXX_Unmarshal(b []byte) error + type Record_Local_ struct + Local *Record_Local + func (m *Record_Local_) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Local_) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Local_) Size() (n int) + type Record_Multi struct + func (*Record_Multi) Descriptor() ([]byte, []int) + func (*Record_Multi) ProtoMessage() + func (m *Record_Multi) Marshal() (dAtA []byte, err error) + func (m *Record_Multi) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Multi) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Multi) Reset() + func (m *Record_Multi) Size() (n int) + func (m *Record_Multi) String() string + func (m *Record_Multi) Unmarshal(dAtA []byte) error + func (m *Record_Multi) XXX_DiscardUnknown() + func (m *Record_Multi) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Record_Multi) XXX_Merge(src proto.Message) + func (m *Record_Multi) XXX_Size() int + func (m *Record_Multi) XXX_Unmarshal(b []byte) error + type Record_Multi_ struct + Multi *Record_Multi + func (m *Record_Multi_) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Multi_) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Multi_) Size() (n int) + type Record_Offline struct + func (*Record_Offline) Descriptor() ([]byte, []int) + func (*Record_Offline) ProtoMessage() + func (m *Record_Offline) Marshal() (dAtA []byte, err error) + func (m *Record_Offline) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Offline) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Offline) Reset() + func (m *Record_Offline) Size() (n int) + func (m *Record_Offline) String() string + func (m *Record_Offline) Unmarshal(dAtA []byte) error + func (m *Record_Offline) XXX_DiscardUnknown() + func (m *Record_Offline) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Record_Offline) XXX_Merge(src proto.Message) + func (m *Record_Offline) XXX_Size() int + func (m *Record_Offline) XXX_Unmarshal(b []byte) error + type Record_Offline_ struct + Offline *Record_Offline + func (m *Record_Offline_) MarshalTo(dAtA []byte) (int, error) + func (m *Record_Offline_) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Record_Offline_) Size() (n int) + type SignatureAlgo interface + Derive func() hd.DeriveFn + Generate func() hd.GenerateFn + Name func() hd.PubKeyType + func NewSigningAlgoFromString(str string, algoList SigningAlgoList) (SignatureAlgo, error) + type Signer interface + Sign func(uid string, msg []byte) ([]byte, types.PubKey, error) + SignByAddress func(address sdk.Address, msg []byte) ([]byte, types.PubKey, error) + type SigningAlgoList []SignatureAlgo + func (sal SigningAlgoList) Contains(algo SignatureAlgo) bool + func (sal SigningAlgoList) String() string