keystore

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const KeyStoreScheme = "keystores"

Variables

View Source
var DefaultKeyStoreHome = defaultKeyStoreHome()
View Source
var (
	ErrNoMatch = errors.New("no key for given address or file")
)

Functions

func BuildSignMsg

func BuildSignMsg(txbuilder authtxb.TxBuilder, msgs []sdk.Msg) (authtxb.StdSignMsg, error)

Types

type DefaultKeyStorePath

type DefaultKeyStorePath func() string

type Key

type Key struct {
	Address string `json:"address"`
	PubKey  string `json:"pubkey"`
	PrivKey string `json:"privkey"`
}

func (Key) Sign

func (k Key) Sign(auth string, msg []byte) (sig []byte, pub crypto.PubKey, err error)

type KeyStore

type KeyStore struct {
	// contains filtered or unexported fields
}

func NewKeyStore

func NewKeyStore(path string) *KeyStore

func (*KeyStore) Key

func (ks *KeyStore) Key() *Key

func (*KeyStore) NewKey

func (ks *KeyStore) NewKey(passphrase string) (string, error)

func (*KeyStore) RecoverKey

func (ks *KeyStore) RecoverKey(strPrivKey string, passPhrase string) error

func (*KeyStore) RecoverKeyByMnemonic

func (ks *KeyStore) RecoverKeyByMnemonic(mnemonic string, bip39Passphrase string, passPhrase string, account, index uint32) error

type KeyStoreWallet

type KeyStoreWallet struct {
	// contains filtered or unexported fields
}

func NewKeyStoreWallet

func NewKeyStoreWallet(path string) *KeyStoreWallet

func (*KeyStoreWallet) Accounts

func (ksw *KeyStoreWallet) Accounts() ([]accounts.Account, error)

func (*KeyStoreWallet) BuildAndSign

func (ksw *KeyStoreWallet) BuildAndSign(txbuilder authtxb.TxBuilder, addr string, passphrase string, msgs []sdk.Msg) ([]byte, error)

func (*KeyStoreWallet) Drop

func (ksw *KeyStoreWallet) Drop(addr string) error

func (*KeyStoreWallet) GetPrivKey

func (ksw *KeyStoreWallet) GetPrivKey(addr string) (string, error)

func (*KeyStoreWallet) Sign

func (ksw *KeyStoreWallet) Sign(txbuilder authtxb.TxBuilder, addr string, passphrase string, msg authtxb.StdSignMsg) ([]byte, error)

func (*KeyStoreWallet) SignStdTx

func (ksw *KeyStoreWallet) SignStdTx(txbuilder authtxb.TxBuilder, stdTx auth.StdTx, addr string, passphrase string) (signedStdTx auth.StdTx, err error)

func (*KeyStoreWallet) Update

func (ksw *KeyStoreWallet) Update(addr string, passphrase, newPassphrase string) error

type Seed

type Seed struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL