account

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecrypt = errors.New("could not decrypt key with given passphrase")
)

Functions

This section is empty.

Types

type CryptoJSON

type CryptoJSON struct {
	Cipher       string                 `json:"cipher"`
	CipherText   string                 `json:"ciphertext"`
	CipherParams cipherparamsJSON       `json:"cipherparams"`
	KDF          string                 `json:"kdf"`
	KDFParams    map[string]interface{} `json:"kdfparams"`
	MAC          string                 `json:"mac"`
}

type EncryptedKeyJSON

type EncryptedKeyJSON struct {
	Address string     `json:"address"`
	Crypto  CryptoJSON `json:"crypto"`
	Id      string     `json:"id"`
	Version int        `json:"version"`
}

type PlainKeyJSON

type PlainKeyJSON struct {
	Address    string `json:"address"`
	PrivateKey string `json:"privatekey"`
	Id         string `json:"id"`
	Version    int    `json:"version"`
}

type Wallet

type Wallet interface {
	GetPrivKey() crypto.PrivKey
	GetPubAddress() crypto.Address
	ExportAsMnemonic() (string, error)
	ExportAsPrivateKey() (string, error)
}

func NewWallet

func NewWallet() (Wallet, error)

func NewWalletFromKeyStore

func NewWalletFromKeyStore(file string, password string) (Wallet, error)

func NewWalletFromMnemonic

func NewWalletFromMnemonic(mnemonic string) (Wallet, error)

func NewWalletFromPrivateKey

func NewWalletFromPrivateKey(priKey string) (Wallet, error)

Jump to

Keyboard shortcuts

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