コード例 #1
0
 protected TrezorManagerBrokerBase(EnterPinArgs enterPinArgs, EnterPinArgs enterPassphraseArgs, int?pollInterval, ICoinUtility coinUtility)
 {
     EnterPinArgs        = enterPinArgs;
     EnterPassphraseArgs = enterPassphraseArgs;
     CoinUtility         = coinUtility;
     PollInterval        = pollInterval;
 }
コード例 #2
0
 protected TrezorManagerBase(EnterPinArgs enterPinCallback, EnterPinArgs enterPassphraseCallback, IDevice device, ICoinUtility coinUtility)
 {
     CoinUtility              = coinUtility;
     _EnterPinCallback        = enterPinCallback;
     _EnterPassphraseCallback = enterPassphraseCallback;
     Device = device ?? throw new ArgumentNullException(nameof(device));
 }
コード例 #3
0
    public static TrezorManager GetWindowsConnectedTrezor(EnterPinArgs enterPinCallback)
    {
        List <HidDevice> devices = new List <HidDevice>();

        devices.AddRange(HidDevices.Enumerate(TrezorManager.TrezorVendorId, TrezorManager.TrezorProductId));

        var device = devices.Find(d => d.Capabilities.UsagePage == USAGE_PAGE && d.Capabilities.Usage == USAGE);

        return(device == null ? null : new TrezorManager(enterPinCallback, new UnityHIDDevice(device)));
    }
コード例 #4
0
        protected TrezorManagerBase(EnterPinArgs enterPinCallback, IHidDevice hidDevice)
        {
            if (hidDevice == null)
            {
                throw new ArgumentNullException(nameof(hidDevice));
            }

            hidDevice.Connected += HidDevice_Connected;

            _EnterPinCallback = enterPinCallback;
            _HidDevice        = hidDevice;
        }
コード例 #5
0
 protected TrezorManagerBase(
     EnterPinArgs enterPinCallback,
     EnterPinArgs enterPassphraseCallback,
     IDevice device,
     ILogger <TrezorManagerBase <TMessageType> > logger = null,
     ICoinUtility coinUtility = null)
 {
     CoinUtility              = coinUtility ?? DefaultCoinUtility.Instance;
     _EnterPinCallback        = enterPinCallback;
     _EnterPassphraseCallback = enterPassphraseCallback;
     Device = device ?? throw new ArgumentNullException(nameof(device));
     Logger = (ILogger)logger ?? NullLogger.Instance;
 }
コード例 #6
0
ファイル: TrezorManager.cs プロジェクト: Raystonn/Trezor.Net
 public TrezorManager(
     EnterPinArgs enterPinCallback,
     EnterPinArgs enterPassphraseCallback,
     IDevice trezorDevice,
     ILogger <TrezorManager> logger = null,
     ICoinUtility coinUtility       = null) : base(
         enterPinCallback,
         enterPassphraseCallback,
         trezorDevice,
         logger,
         coinUtility)
 {
 }
コード例 #7
0
 public TrezorManagerBroker(
     EnterPinArgs enterPinArgs,
     EnterPinArgs enterPassphraseArgs,
     int?pollInterval,
     IDeviceFactory deviceFactory,
     ICoinUtility coinUtility     = null,
     ILoggerFactory loggerFactory = null
     ) : base(
         enterPinArgs,
         enterPassphraseArgs,
         pollInterval,
         deviceFactory,
         coinUtility,
         loggerFactory)
 {
 }
コード例 #8
0
        protected TrezorManagerBrokerBase(
            EnterPinArgs enterPinArgs,
            EnterPinArgs enterPassphraseArgs,
            int?pollInterval,
            IDeviceFactory deviceFactory,
            ICoinUtility coinUtility     = null,
            ILoggerFactory loggerFactory = null)
        {
            EnterPinArgs        = enterPinArgs;
            EnterPassphraseArgs = enterPassphraseArgs;
            CoinUtility         = coinUtility ?? new DefaultCoinUtility();
            PollInterval        = pollInterval;
            LoggerFactory       = loggerFactory;


            _DeviceListener = new DeviceListener(deviceFactory, PollInterval, loggerFactory);
            _DeviceListener.DeviceDisconnected += DevicePoller_DeviceDisconnected;
            _DeviceListener.DeviceInitialized  += DevicePoller_DeviceInitialized;
        }
コード例 #9
0
 public TrezorManager(EnterPinArgs enterPinCallback, EnterPinArgs enterPassphraseCallback, IDevice trezorDevice) : this(enterPinCallback, enterPassphraseCallback, trezorDevice, new DefaultCoinUtility())
 {
 }
コード例 #10
0
        public static async Task <TrezorManager> GetWindowsConnectedLedgerManagerAsync(EnterPinArgs enterPinCallback)
        {
            var trezorHidDevice = await GetWindowsConnectedLedgerHidDeviceAsync().ConfigureAwait(false);

            return(new TrezorManager(enterPinCallback, trezorHidDevice));
        }
コード例 #11
0
 protected TrezorManagerBase(EnterPinArgs enterPinCallback, IHidDevice hidDevice) : this(enterPinCallback, hidDevice, null)
 {
 }
コード例 #12
0
 public TrezorManager(EnterPinArgs enterPinCallback, IHidDevice trezorHidDevice) : base(enterPinCallback, trezorHidDevice)
 {
 }
コード例 #13
0
 public TrezorManagerBroker(EnterPinArgs enterPinArgs, EnterPinArgs enterPassphraseArgs, int?pollInterval, ICoinUtility coinUtility) : base(enterPinArgs, enterPassphraseArgs, pollInterval, coinUtility)
 {
 }
コード例 #14
0
 public KeepKeyManager(EnterPinArgs enterPinCallback, IHidDevice keepKeyDevice) : base(enterPinCallback, keepKeyDevice)
 {
 }
コード例 #15
0
 public TrezorManager(EnterPinArgs enterPinCallback, EnterPinArgs enterPassphraseCallback, IDevice trezorDevice, ICoinUtility coinUtility) : base(enterPinCallback, enterPassphraseCallback, trezorDevice, coinUtility)
 {
 }
コード例 #16
0
 public TrezorManager(EnterPinArgs enterPinCallback, IDevice trezorHidDevice, ICoinUtility coinUtility) : base(enterPinCallback, trezorHidDevice, coinUtility)
 {
 }
コード例 #17
0
 public TrezorManager(EnterPinArgs enterPinCallback, IDevice trezorHidDevice) : this(enterPinCallback, trezorHidDevice, null)
 {
 }
コード例 #18
0
 public KeepKeyManager(EnterPinArgs enterPinCallback, EnterPinArgs enterPassphraseCallback, IDevice keepKeyDevice) : base(enterPinCallback, enterPassphraseCallback, keepKeyDevice)
 {
 }
コード例 #19
0
 public KeepKeyManagerBroker(EnterPinArgs enterPinArgs, EnterPinArgs enterPassphraseArgs, int?pollInterval) : base(enterPinArgs, enterPassphraseArgs, pollInterval, null)
 {
 }
コード例 #20
0
 protected TrezorManagerBase(EnterPinArgs enterPinCallback, EnterPinArgs enterPassphraseCallback, IDevice device) : this(enterPinCallback, enterPassphraseCallback, device, null)
 {
 }