wallet

package
v1.20.0-concurrency-co... Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0, MIT Imports: 19 Imported by: 30

Documentation

Index

Constants

View Source
const (
	KNamePrefix  = "wallet-"
	KTrashPrefix = "trash-"
	KDefault     = "default"
)

Variables

View Source
var NilDefault nilDefault

Functions

This section is empty.

Types

type Default added in v0.9.1

type Default interface {
	GetDefault() (address.Address, error)
	SetDefault(a address.Address) error
}

type LocalWallet added in v0.9.1

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

func KeyWallet

func KeyWallet(keys ...*key.Key) *LocalWallet

func NewWallet

func NewWallet(keystore types.KeyStore) (*LocalWallet, error)

func (*LocalWallet) Get added in v0.10.1

func (w *LocalWallet) Get() api.Wallet

func (*LocalWallet) GetDefault added in v0.9.1

func (w *LocalWallet) GetDefault() (address.Address, error)

func (*LocalWallet) SetDefault added in v0.9.1

func (w *LocalWallet) SetDefault(a address.Address) error

func (*LocalWallet) WalletDelete added in v0.9.1

func (w *LocalWallet) WalletDelete(ctx context.Context, addr address.Address) error

func (*LocalWallet) WalletExport added in v0.9.1

func (w *LocalWallet) WalletExport(ctx context.Context, addr address.Address) (*types.KeyInfo, error)

func (*LocalWallet) WalletHas added in v0.9.1

func (w *LocalWallet) WalletHas(ctx context.Context, addr address.Address) (bool, error)

func (*LocalWallet) WalletImport added in v0.9.1

func (w *LocalWallet) WalletImport(ctx context.Context, ki *types.KeyInfo) (address.Address, error)

func (*LocalWallet) WalletList added in v0.9.1

func (w *LocalWallet) WalletList(ctx context.Context) ([]address.Address, error)

func (*LocalWallet) WalletNew added in v0.9.1

func (w *LocalWallet) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error)

func (*LocalWallet) WalletSign added in v0.9.1

func (w *LocalWallet) WalletSign(ctx context.Context, addr address.Address, msg []byte, meta api.MsgMeta) (*crypto.Signature, error)

type MemKeyStore

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

func NewMemKeyStore

func NewMemKeyStore() *MemKeyStore

func (*MemKeyStore) Delete

func (mks *MemKeyStore) Delete(k string) error

Delete removes a key from keystore

func (*MemKeyStore) Get

func (mks *MemKeyStore) Get(k string) (types.KeyInfo, error)

Get gets a key out of keystore and returns KeyInfo corresponding to named key

func (*MemKeyStore) List

func (mks *MemKeyStore) List() ([]string, error)

List lists all the keys stored in the KeyStore

func (*MemKeyStore) Put

func (mks *MemKeyStore) Put(k string, ki types.KeyInfo) error

Put saves a key info under given name

type MultiWallet added in v0.10.1

type MultiWallet struct {
	fx.In // "constructed" with fx.In instead of normal constructor

	Local  *LocalWallet               `optional:"true"`
	Remote *remotewallet.RemoteWallet `optional:"true"`
	Ledger *ledgerwallet.LedgerWallet `optional:"true"`
}

func (MultiWallet) WalletDelete added in v0.10.1

func (m MultiWallet) WalletDelete(ctx context.Context, address address.Address) error

func (MultiWallet) WalletExport added in v0.10.1

func (m MultiWallet) WalletExport(ctx context.Context, addr address.Address) (*types.KeyInfo, error)

func (MultiWallet) WalletHas added in v0.10.1

func (m MultiWallet) WalletHas(ctx context.Context, address address.Address) (bool, error)

func (MultiWallet) WalletImport added in v0.10.1

func (m MultiWallet) WalletImport(ctx context.Context, info *types.KeyInfo) (address.Address, error)

func (MultiWallet) WalletList added in v0.10.1

func (m MultiWallet) WalletList(ctx context.Context) ([]address.Address, error)

func (MultiWallet) WalletNew added in v0.10.1

func (m MultiWallet) WalletNew(ctx context.Context, keyType types.KeyType) (address.Address, error)

func (MultiWallet) WalletSign added in v0.10.1

func (m MultiWallet) WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta api.MsgMeta) (*crypto.Signature, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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