wallet

package
v0.0.0-...-93ae5c1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportMode

type ExportMode uint8
const (
	ExportModeSeedPhrase ExportMode = iota
	ExportModePrivateKey
)

type ImportMode

type ImportMode uint8
const (
	ImportModeSeedPhrase ImportMode = iota
	ImportModePrivateKey
)

type WalletError

type WalletError uint
const (
	Unknown WalletError = common.ErrorDomainWallet + iota
	FileSystemAccess
	AccountNotFound
	UnauthorizedAccess
	InvalidPrivateKey
	InvalidSeedPhrase
	SigningFailed
)

func (WalletError) Error

func (e WalletError) Error() string

type WalletKeeper

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

func NewWalletKeeper

func NewWalletKeeper(ui WalletUI, autoUnlock bool) (*WalletKeeper, error)

func (*WalletKeeper) CreateWallet

func (wk *WalletKeeper) CreateWallet(passphrase string) error

func (*WalletKeeper) DeleteWallet

func (wk *WalletKeeper) DeleteWallet(index int, passphrase string) error

func (*WalletKeeper) ExportWallet

func (wk *WalletKeeper) ExportWallet(index int, mode ExportMode, passphrase string) ([]byte, error)

func (*WalletKeeper) ImportWallet

func (wk *WalletKeeper) ImportWallet(mode ImportMode, input []byte, passphrase string) error

func (*WalletKeeper) NumberOfAccounts

func (wk *WalletKeeper) NumberOfAccounts() int

func (*WalletKeeper) PublicKey

func (wk *WalletKeeper) PublicKey(index int) (string, error)

func (*WalletKeeper) SignTransaction

func (wk *WalletKeeper) SignTransaction(
	chainId *big.Int,
	tx *types.Transaction,
	signer gethcommon.Address,
	autosign bool,
) (*types.Transaction, error)

func (*WalletKeeper) Unlock

func (wk *WalletKeeper) Unlock(index int, passphrase string) error

type WalletUI

type WalletUI interface {
	EnterPassphrase() (string, error)
}

Jump to

Keyboard shortcuts

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