github.com/aquanetwork/aquachain@v1.7.8/aqua/accounts/usbwallet/dummy.go (about)

     1  // +build !usb
     2  
     3  package usbwallet
     4  
     5  import (
     6  	"errors"
     7  	"gitlab.com/aquachain/aquachain/aqua/accounts"
     8  	"gitlab.com/aquachain/aquachain/aqua/event"
     9  )
    10  
    11  // Hub is a accounts.Backend that can find and handle generic USB hardware wallets.
    12  type Hub struct{}
    13  
    14  // NewLedgerHub creates a new hardware wallet manager for Ledger devices.
    15  func NewLedgerHub() (*Hub, error) {
    16  	return nil, accounts.ErrNotSupported
    17  }
    18  
    19  // ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In
    20  // this case, the calling application should display a pinpad and send back the
    21  // encoded passphrase.
    22  var ErrTrezorPINNeeded = errors.New("trezor: pin needed")
    23  
    24  // NewTrezorHub creates a new hardware wallet manager for Trezor devices.
    25  func NewTrezorHub() (*Hub, error) {
    26  	return nil, accounts.ErrNotSupported
    27  }
    28  
    29  // Wallets implements accounts.Backend, returning all the currently tracked USB
    30  // devices that appear to be hardware wallets.
    31  func (hub *Hub) Wallets() []accounts.Wallet {
    32  	return nil
    33  }
    34  
    35  // Subscribe implements accounts.Backend, creating an async subscription to
    36  // receive notifications on the addition or removal of USB wallets.
    37  func (hub *Hub) Subscribe(sink chan<- accounts.WalletEvent) event.Subscription {
    38  	return nil
    39  }