device

package
v4.7.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Apache-2.0 Imports: 2 Imported by: 9

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

	// 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