wallet

package
v0.0.0-...-76c1feb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateWalletID

func GenerateWalletID() ([]byte, error)

GenerateWalletID generates a random hex wallet ID

Types

type Metadata

type Metadata struct {
	ID                    []byte
	Name                  []byte
	DriverName            string
	DriverVersion         uint32
	SupportsMnemonicUX    bool
	SupportsMasterKey     bool
	SupportedTransactions []protocol.TxType
}

Metadata represents high-level information about a wallet, like its name, id and what operations it supports

type Wallet

type Wallet interface {
	Init(pw []byte) error
	CheckPassword(pw []byte) error
	ExportMasterDerivationKey(pw []byte) (crypto.MasterDerivationKey, error)

	Metadata() (Metadata, error)

	ListKeys() ([]crypto.Digest, error)

	ImportKey(sk crypto.PrivateKey) (crypto.Digest, error)
	ExportKey(pk crypto.Digest, pw []byte) (crypto.PrivateKey, error)
	GenerateKey(displayMnemonic bool) (crypto.Digest, error)
	DeleteKey(pk crypto.Digest, pw []byte) error

	ImportMultisigAddr(version, threshold uint8, pks []crypto.PublicKey) (crypto.Digest, error)
	LookupMultisigPreimage(crypto.Digest) (version, threshold uint8, pks []crypto.PublicKey, err error)
	ListMultisigAddrs() (addrs []crypto.Digest, err error)
	DeleteMultisigAddr(addr crypto.Digest, pw []byte) error

	SignTransaction(tx transactions.Transaction, pk crypto.PublicKey, pw []byte) ([]byte, error)

	MultisigSignTransaction(tx transactions.Transaction, pk crypto.PublicKey, partial crypto.MultisigSig, pw []byte, signer crypto.Digest) (crypto.MultisigSig, error)

	SignProgram(program []byte, src crypto.Digest, pw []byte) ([]byte, error)
	MultisigSignProgram(program []byte, src crypto.Digest, pk crypto.PublicKey, partial crypto.MultisigSig, pw []byte) (crypto.MultisigSig, error)
}

Wallet represents the interface that any wallet technology must satisfy in order to be used with KMD. Wallets start in a locked state until they are initialized with Init.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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