device

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event string

Event instances are sent to the onEvent callback.

const (
	// EventKeystoreAvailable is fired when the device's keystore becomes available (e.g. after
	// unlocking it).
	EventKeystoreAvailable Event = "keystoreAvailable"
	// EventKeystoreGone is fired when the device's keystore becomes unavailable, e.g. after a
	// reset. NOTE: It is not fired when the keystore is replaced. In that case, only
	// EventKeystoreAvailable is fired.
	EventKeystoreGone Event = "keystoreGone"
)

type Interface

type Interface interface {
	Init(testing bool)
	// ProductName returns the product name of the device in lowercase.
	ProductName() string

	// Identifier returns the hash of the type and the serial number.
	Identifier() string

	// ExtendedPublicKey returns the extended public key at the given absolute keypath.
	ExtendedPublicKey(signing.AbsoluteKeypath) (*hdkeychain.ExtendedKey, error)

	// Keystore returns the keystore provided by the device (or an nil if not seeded).
	KeystoreForConfiguration(configuration *signing.Configuration, cosignerIndex int) keystore.Keystore

	// SetOnEvent installs a callback which is called for various events.
	SetOnEvent(func(Event, interface{}))

	// Close tells the device to close all connections.
	Close()
}

Interface represents a hardware wallet device.

Jump to

Keyboard shortcuts

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