Documentation ¶
Index ¶
- Constants
- Variables
- func PromptPINFromStdin() string
- func ReadPassword(fd int) ([]byte, error)
- type Bridge
- type CallMode
- type TrezorDriver
- type TrezorSigner
- type TrezorState
- type Trezoreum
- func (self *Trezoreum) Derive(path accounts.DerivationPath) (common.Address, error)
- func (self *Trezoreum) GetDevice() ([]usb.DeviceInfo, error)
- func (self *Trezoreum) Init() (trezor.Features, TrezorState, error)
- func (self *Trezoreum) Sign(path accounts.DerivationPath, tx *types.Transaction, chainId *big.Int) (common.Address, *types.Transaction, error)
- func (self *Trezoreum) SignDynamicFeeTx(path accounts.DerivationPath, tx *types.Transaction, chainId *big.Int) (common.Address, *types.Transaction, error)
- func (self *Trezoreum) SignLegacyTx(path accounts.DerivationPath, tx *types.Transaction, chainId *big.Int) (common.Address, *types.Transaction, error)
- func (self *Trezoreum) Unlock() error
- func (self *Trezoreum) UnlockByPassphrase(passphrase string) (TrezorState, error)
- func (self *Trezoreum) UnlockByPin(pin string, results ...proto.Message) (int, error)
Constants ¶
Variables ¶
View Source
var ( ProductIDsWithHID []uint16 = []uint16{0x0001} ProductIDsWithWebUSB []uint16 = []uint16{0x53c1} )
View Source
var ErrTrezorPINNeeded = errors.New("trezor: pin needed")
ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In this case, the calling application should display a pinpad and send back the encoded passphrase.
View Source
var ErrTrezorPassphraseNeeded = errors.New("trezor: passphrase needed")
ErrTrezorPassphraseNeeded is returned if opening the trezor requires a passphrase
Functions ¶
func PromptPINFromStdin ¶
func PromptPINFromStdin() string
func ReadPassword ¶
Types ¶
type Bridge ¶
type Bridge interface { // init the connection to trezor via libusb and return the status // of the device as well as indication to next step to unlock the // device. Init() (info trezor.Features, state TrezorState, err error) Unlock() error Derive(path accounts.DerivationPath) (common.Address, error) Sign( path accounts.DerivationPath, tx *types.Transaction, chainID *big.Int, ) (common.Address, *types.Transaction, error) }
type TrezorDriver ¶
type TrezorDriver struct {
// contains filtered or unexported fields
}
trezorDriver implements the communication with a Trezor hardware wallet.
func NewTrezorDriver ¶
func NewTrezorDriver() *TrezorDriver
newTrezorDriver creates a new instance of a Trezor USB protocol driver.
func (*TrezorDriver) SetDevice ¶
func (self *TrezorDriver) SetDevice(device io.ReadWriter)
type TrezorSigner ¶
type TrezorSigner struct {
// contains filtered or unexported fields
}
func NewTrezorSigner ¶
func NewTrezorSigner(path string, address string) (*TrezorSigner, error)
func (*TrezorSigner) SignTx ¶
func (self *TrezorSigner) SignTx( tx *types.Transaction, chainId *big.Int, ) (*types.Transaction, error)
type TrezorState ¶
type TrezorState int
const ( Ready TrezorState = iota // Already unlocked and ready to sign data WaitingForPin // Expecting PIN in order to unlock the trezor WaitingForPassphrase // Expecting passphrase in order to unlock the trezor Unexpected )
type Trezoreum ¶
type Trezoreum struct {
// contains filtered or unexported fields
}
func NewTrezoreum ¶
func (*Trezoreum) Sign ¶
func (self *Trezoreum) Sign( path accounts.DerivationPath, tx *types.Transaction, chainId *big.Int, ) (common.Address, *types.Transaction, error)
func (*Trezoreum) SignDynamicFeeTx ¶ added in v0.0.30
func (self *Trezoreum) SignDynamicFeeTx( path accounts.DerivationPath, tx *types.Transaction, chainId *big.Int, ) (common.Address, *types.Transaction, error)
func (*Trezoreum) SignLegacyTx ¶ added in v0.0.30
func (self *Trezoreum) SignLegacyTx( path accounts.DerivationPath, tx *types.Transaction, chainId *big.Int, ) (common.Address, *types.Transaction, error)
func (*Trezoreum) UnlockByPassphrase ¶
func (self *Trezoreum) UnlockByPassphrase(passphrase string) (TrezorState, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.