accounts

package
v0.0.0-...-5d85a61 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0, 0}
View Source
var DefaultLedgerBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0}
View Source
var DefaultRootDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0}
View Source
var ErrInvalidPassphrase = errors.New("invalid passphrase")
View Source
var ErrNotSupported = errors.New("not supported")
View Source
var ErrUnknownAccount = errors.New("unknown account")
View Source
var ErrUnknownWallet = errors.New("unknown wallet")
View Source
var ErrWalletAlreadyOpen = errors.New("wallet already open")
View Source
var ErrWalletClosed = errors.New("wallet closed")

Functions

func NewAuthNeededError

func NewAuthNeededError(needed string) error

Types

type Account

type Account struct {
	Address common.Address `json:"address"`
	URL     URL            `json:"url"`
}

type AuthNeededError

type AuthNeededError struct {
	Needed string
}

func (*AuthNeededError) Error

func (err *AuthNeededError) Error() string

type Backend

type Backend interface {
	Wallets() []Wallet

	Subscribe(sink chan<- WalletEvent) event.Subscription
}

type DerivationPath

type DerivationPath []uint32

func ParseDerivationPath

func ParseDerivationPath(path string) (DerivationPath, error)

func (DerivationPath) String

func (path DerivationPath) String() string

type Manager

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

func NewManager

func NewManager(backends ...Backend) *Manager

func (*Manager) Backends

func (am *Manager) Backends(kind reflect.Type) []Backend

func (*Manager) Close

func (am *Manager) Close() error

func (*Manager) Find

func (am *Manager) Find(account Account) (Wallet, error)

func (*Manager) Subscribe

func (am *Manager) Subscribe(sink chan<- WalletEvent) event.Subscription

func (*Manager) Wallet

func (am *Manager) Wallet(url string) (Wallet, error)

func (*Manager) Wallets

func (am *Manager) Wallets() []Wallet

type URL

type URL struct {
	Scheme string
	Path   string
}

func (URL) Cmp

func (u URL) Cmp(url URL) int

func (URL) MarshalJSON

func (u URL) MarshalJSON() ([]byte, error)

func (URL) String

func (u URL) String() string

func (URL) TerminalString

func (u URL) TerminalString() string

type Wallet

type Wallet interface {
	URL() URL

	Status() (string, error)

	Open(passphrase string) error

	Close() error

	Accounts() []Account

	Contains(account Account) bool

	Derive(path DerivationPath, pin bool) (Account, error)

	SelfDerive(base DerivationPath, chain ligochain.ChainStateReader)

	SignHash(account Account, hash []byte) ([]byte, error)

	SignTx(account Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)

	SignTxWithAddress(account Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)

	SignHashWithPassphrase(account Account, passphrase string, hash []byte) ([]byte, error)

	SignTxWithPassphrase(account Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
}

type WalletEvent

type WalletEvent struct {
	Wallet Wallet
	Kind   WalletEventType
}

type WalletEventType

type WalletEventType int
const (
	WalletArrived WalletEventType = iota

	WalletOpened

	WalletDropped
)

Directories

Path Synopsis
abi
Package usbwallet implements support for USB hardware wallets.
Package usbwallet implements support for USB hardware wallets.
internal/trezor
Package trezor contains the wire protocol wrapper in Go.
Package trezor contains the wire protocol wrapper in Go.

Jump to

Keyboard shortcuts

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