wallets

package
v0.78.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: AGPL-3.0 Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWalletDoesNotExists = errors.New("wallet does not exist")

Functions

func InitialiseStore

func InitialiseStore(vegaHome string, withFileWatcher bool) (*wstorev1.FileStore, error)

InitialiseStore builds a wallet Store specifically for users wallets.

func InitialiseStoreFromPaths

func InitialiseStoreFromPaths(vegaPaths paths.Paths, withFileWatcher bool) (*wstorev1.FileStore, error)

InitialiseStoreFromPaths builds a wallet Store specifically for users wallets.

Types

type Handler

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

func NewHandler

func NewHandler(store Store) *Handler

func (*Handler) CreateWallet

func (h *Handler) CreateWallet(name, passphrase string) (string, error)

func (*Handler) GenerateKeyPair

func (h *Handler) GenerateKeyPair(name, passphrase string, meta []wallet.Metadata) (wallet.KeyPair, error)

func (*Handler) GetPublicKey

func (h *Handler) GetPublicKey(name, pubKey string) (wallet.PublicKey, error)

func (*Handler) GetWalletPath

func (h *Handler) GetWalletPath(name string) (string, error)

func (*Handler) ImportWallet

func (h *Handler) ImportWallet(name, passphrase, recoveryPhrase string, keyDerivationVersion uint32) error

func (*Handler) ListKeyPairs

func (h *Handler) ListKeyPairs(name string) ([]wallet.KeyPair, error)

func (*Handler) ListPublicKeys

func (h *Handler) ListPublicKeys(name string) ([]wallet.PublicKey, error)

func (*Handler) ListWallets

func (h *Handler) ListWallets() ([]string, error)

func (*Handler) LoginWallet

func (h *Handler) LoginWallet(name, passphrase string) error

func (*Handler) SecureGenerateKeyPair

func (h *Handler) SecureGenerateKeyPair(name, passphrase string, meta []wallet.Metadata) (string, error)

func (*Handler) SignAny

func (h *Handler) SignAny(name string, inputData []byte, pubKey string) ([]byte, error)

func (*Handler) SignTx

func (h *Handler) SignTx(name string, req *walletpb.SubmitTransactionRequest, height uint64, chainID string) (*commandspb.Transaction, error)

func (*Handler) TaintKey

func (h *Handler) TaintKey(name, pubKey, passphrase string) error

func (*Handler) UntaintKey

func (h *Handler) UntaintKey(name string, pubKey string, passphrase string) error

func (*Handler) UpdateMeta

func (h *Handler) UpdateMeta(name, pubKey, passphrase string, meta []wallet.Metadata) error

func (*Handler) VerifyAny

func (h *Handler) VerifyAny(inputData, sig []byte, pubKey string) (bool, error)

func (*Handler) WalletExists

func (h *Handler) WalletExists(name string) bool

type Store

type Store interface {
	UnlockWallet(ctx context.Context, name, passphrase string) error
	WalletExists(ctx context.Context, name string) (bool, error)
	CreateWallet(ctx context.Context, w wallet.Wallet, passphrase string) error
	UpdateWallet(ctx context.Context, w wallet.Wallet) error
	GetWallet(ctx context.Context, name string) (wallet.Wallet, error)
	GetWalletPath(name string) string
	ListWallets(ctx context.Context) ([]string, error)
}

Store abstracts the underlying storage for wallet data.

Jump to

Keyboard shortcuts

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