@onekeyfe/hwk-ledger-adapter 1.2.3-alpha.1 → 1.2.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +14 -12
- package/dist/index.d.ts +14 -12
- package/dist/index.js +684 -559
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +679 -554
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _onekeyfe_hwk_adapter_core from '@onekeyfe/hwk-adapter-core';
|
|
2
|
-
import { IHardwareWallet, IConnector, TransportType, UiResponseEvent, SearchDevicesOptions, DeviceInfo, DeviceSearchTarget, ConnectionTarget, Response,
|
|
2
|
+
import { IHardwareWallet, IConnector, TransportType, UiResponseEvent, SearchDevicesOptions, DeviceInfo, DeviceSearchTarget, ConnectionTarget, Response, BindBleDeviceParams, IHardwareConnectionContext, NullableCallArg, IHardwareCallParams, EvmGetAddressParams, EvmAddress, EvmSignTxLedgerParams, EvmSignedTx, EvmSignMsgParams, EvmSignature, EvmSignTypedDataParams, BtcGetAddressParams, BtcAddress, BtcGetPublicKeyParams, BtcPublicKey, BtcSignTxParams, BtcSignedTx, BtcSignPsbtParams, BtcSignedPsbt, BtcSignMsgParams, BtcSignature, IHardwareCommonCallParams, SolGetAddressParams, SolAddress, SolSignTxParams, SolSignedTx, SolSignMsgParams, SolSignature, TronGetAddressParams, TronAddress, TronSignTxParams, TronSignedTx, TronSignMsgParams, TronSignature, ZcashGetFullViewingKeyParams, ZcashFullViewingKey, ZcashGetShieldedAddressParams, ZcashShieldedAddress, DeviceAuthenticityParams, DeviceAuthenticityResult, HardwareEventMap, DeviceEventListener, ChainForFingerprint, DeviceDescriptor, DeviceChangeEvent, ConnectionType, ConnectorDevice, ConnectorSession, ConnectorCallResult, ConnectorEventType, ConnectorEventMap, ConnectorConfig, Failure, HardwareErrorCode, HwkErrorOrigin, HwkRecoveryHint } from '@onekeyfe/hwk-adapter-core';
|
|
3
3
|
import { DeviceActionState as DeviceActionState$1, DiscoveredDevice, ExecuteDeviceActionReturnType, DeviceManagementKit } from '@ledgerhq/device-management-kit';
|
|
4
4
|
import { Address, Signature, SignerEth as SignerEth$1, TypedData } from '@ledgerhq/device-signer-kit-ethereum';
|
|
5
5
|
import { ContextModule } from '@ledgerhq/context-module';
|
|
@@ -98,10 +98,10 @@ declare class LedgerAdapter implements IHardwareWallet {
|
|
|
98
98
|
readonly vendor: "ledger";
|
|
99
99
|
private readonly connector;
|
|
100
100
|
private readonly emitter;
|
|
101
|
-
private readonly
|
|
101
|
+
private readonly _operations;
|
|
102
102
|
private _discoveredDevices;
|
|
103
103
|
private _sessions;
|
|
104
|
-
private readonly
|
|
104
|
+
private readonly _pendingOperationBindings;
|
|
105
105
|
private readonly _verifiedBleReconnectTargets;
|
|
106
106
|
private readonly _uiRegistry;
|
|
107
107
|
private _btcHighIndexConfirmedThisSession;
|
|
@@ -144,21 +144,21 @@ declare class LedgerAdapter implements IHardwareWallet {
|
|
|
144
144
|
private static readonly STUCK_APP_RETRY_DELAY_MS;
|
|
145
145
|
private static readonly MAX_DOCONNECT_CONFIRMS;
|
|
146
146
|
private _lastCancelReason;
|
|
147
|
-
private readonly
|
|
148
|
-
private readonly
|
|
147
|
+
private readonly _activeOperationJobs;
|
|
148
|
+
private readonly _pendingOperationDisconnects;
|
|
149
149
|
private static readonly APP_INSTALL_PROGRESS_MIN_DELTA;
|
|
150
150
|
private _installProgressLastEmittedValue;
|
|
151
151
|
private _installProgressLastKey;
|
|
152
152
|
private static _createDeviceBusyError;
|
|
153
153
|
connectDevice(searchTargetId: string): Promise<Response<string>>;
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
bindBleDevice(params: BindBleDeviceParams): Promise<Response<string>>;
|
|
155
|
+
acquireOperation(connectId: string, context: IHardwareConnectionContext): Promise<Response<string>>;
|
|
156
|
+
private _createOperation;
|
|
156
157
|
private _connectTarget;
|
|
157
|
-
|
|
158
|
-
private
|
|
159
|
-
private
|
|
160
|
-
getDeviceInfo(
|
|
161
|
-
getSupportedChains(): ChainCapability[];
|
|
158
|
+
releaseOperation(operationId: string): Promise<void>;
|
|
159
|
+
private _releaseOperationConnection;
|
|
160
|
+
private _releaseLostOperationConnection;
|
|
161
|
+
getDeviceInfo(connectIdOrOperationId: string, deviceId: string): Promise<Response<DeviceInfo>>;
|
|
162
162
|
allNetworkGetAddress: (connectId: string, _deviceId: string, params: _onekeyfe_hwk_adapter_core.AllNetworkGetAddressParams) => Promise<Response<_onekeyfe_hwk_adapter_core.AllNetworkAddressResponse[]>>;
|
|
163
163
|
private callChain;
|
|
164
164
|
private static normalizeCallArgs;
|
|
@@ -286,6 +286,8 @@ declare class LedgerAdapter implements IHardwareWallet {
|
|
|
286
286
|
* Race a promise against an abort signal. On abort, rejects with
|
|
287
287
|
* signal.reason → instance _lastCancelReason → generic Error('Aborted').
|
|
288
288
|
*/
|
|
289
|
+
/** Hermes/RN polyfills don't always populate signal.reason; fall back. */
|
|
290
|
+
private _abortReason;
|
|
289
291
|
private _abortable;
|
|
290
292
|
/** Throw an AbortError if signal is already aborted. */
|
|
291
293
|
private static _throwIfAborted;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _onekeyfe_hwk_adapter_core from '@onekeyfe/hwk-adapter-core';
|
|
2
|
-
import { IHardwareWallet, IConnector, TransportType, UiResponseEvent, SearchDevicesOptions, DeviceInfo, DeviceSearchTarget, ConnectionTarget, Response,
|
|
2
|
+
import { IHardwareWallet, IConnector, TransportType, UiResponseEvent, SearchDevicesOptions, DeviceInfo, DeviceSearchTarget, ConnectionTarget, Response, BindBleDeviceParams, IHardwareConnectionContext, NullableCallArg, IHardwareCallParams, EvmGetAddressParams, EvmAddress, EvmSignTxLedgerParams, EvmSignedTx, EvmSignMsgParams, EvmSignature, EvmSignTypedDataParams, BtcGetAddressParams, BtcAddress, BtcGetPublicKeyParams, BtcPublicKey, BtcSignTxParams, BtcSignedTx, BtcSignPsbtParams, BtcSignedPsbt, BtcSignMsgParams, BtcSignature, IHardwareCommonCallParams, SolGetAddressParams, SolAddress, SolSignTxParams, SolSignedTx, SolSignMsgParams, SolSignature, TronGetAddressParams, TronAddress, TronSignTxParams, TronSignedTx, TronSignMsgParams, TronSignature, ZcashGetFullViewingKeyParams, ZcashFullViewingKey, ZcashGetShieldedAddressParams, ZcashShieldedAddress, DeviceAuthenticityParams, DeviceAuthenticityResult, HardwareEventMap, DeviceEventListener, ChainForFingerprint, DeviceDescriptor, DeviceChangeEvent, ConnectionType, ConnectorDevice, ConnectorSession, ConnectorCallResult, ConnectorEventType, ConnectorEventMap, ConnectorConfig, Failure, HardwareErrorCode, HwkErrorOrigin, HwkRecoveryHint } from '@onekeyfe/hwk-adapter-core';
|
|
3
3
|
import { DeviceActionState as DeviceActionState$1, DiscoveredDevice, ExecuteDeviceActionReturnType, DeviceManagementKit } from '@ledgerhq/device-management-kit';
|
|
4
4
|
import { Address, Signature, SignerEth as SignerEth$1, TypedData } from '@ledgerhq/device-signer-kit-ethereum';
|
|
5
5
|
import { ContextModule } from '@ledgerhq/context-module';
|
|
@@ -98,10 +98,10 @@ declare class LedgerAdapter implements IHardwareWallet {
|
|
|
98
98
|
readonly vendor: "ledger";
|
|
99
99
|
private readonly connector;
|
|
100
100
|
private readonly emitter;
|
|
101
|
-
private readonly
|
|
101
|
+
private readonly _operations;
|
|
102
102
|
private _discoveredDevices;
|
|
103
103
|
private _sessions;
|
|
104
|
-
private readonly
|
|
104
|
+
private readonly _pendingOperationBindings;
|
|
105
105
|
private readonly _verifiedBleReconnectTargets;
|
|
106
106
|
private readonly _uiRegistry;
|
|
107
107
|
private _btcHighIndexConfirmedThisSession;
|
|
@@ -144,21 +144,21 @@ declare class LedgerAdapter implements IHardwareWallet {
|
|
|
144
144
|
private static readonly STUCK_APP_RETRY_DELAY_MS;
|
|
145
145
|
private static readonly MAX_DOCONNECT_CONFIRMS;
|
|
146
146
|
private _lastCancelReason;
|
|
147
|
-
private readonly
|
|
148
|
-
private readonly
|
|
147
|
+
private readonly _activeOperationJobs;
|
|
148
|
+
private readonly _pendingOperationDisconnects;
|
|
149
149
|
private static readonly APP_INSTALL_PROGRESS_MIN_DELTA;
|
|
150
150
|
private _installProgressLastEmittedValue;
|
|
151
151
|
private _installProgressLastKey;
|
|
152
152
|
private static _createDeviceBusyError;
|
|
153
153
|
connectDevice(searchTargetId: string): Promise<Response<string>>;
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
bindBleDevice(params: BindBleDeviceParams): Promise<Response<string>>;
|
|
155
|
+
acquireOperation(connectId: string, context: IHardwareConnectionContext): Promise<Response<string>>;
|
|
156
|
+
private _createOperation;
|
|
156
157
|
private _connectTarget;
|
|
157
|
-
|
|
158
|
-
private
|
|
159
|
-
private
|
|
160
|
-
getDeviceInfo(
|
|
161
|
-
getSupportedChains(): ChainCapability[];
|
|
158
|
+
releaseOperation(operationId: string): Promise<void>;
|
|
159
|
+
private _releaseOperationConnection;
|
|
160
|
+
private _releaseLostOperationConnection;
|
|
161
|
+
getDeviceInfo(connectIdOrOperationId: string, deviceId: string): Promise<Response<DeviceInfo>>;
|
|
162
162
|
allNetworkGetAddress: (connectId: string, _deviceId: string, params: _onekeyfe_hwk_adapter_core.AllNetworkGetAddressParams) => Promise<Response<_onekeyfe_hwk_adapter_core.AllNetworkAddressResponse[]>>;
|
|
163
163
|
private callChain;
|
|
164
164
|
private static normalizeCallArgs;
|
|
@@ -286,6 +286,8 @@ declare class LedgerAdapter implements IHardwareWallet {
|
|
|
286
286
|
* Race a promise against an abort signal. On abort, rejects with
|
|
287
287
|
* signal.reason → instance _lastCancelReason → generic Error('Aborted').
|
|
288
288
|
*/
|
|
289
|
+
/** Hermes/RN polyfills don't always populate signal.reason; fall back. */
|
|
290
|
+
private _abortReason;
|
|
289
291
|
private _abortable;
|
|
290
292
|
/** Throw an AbortError if signal is already aborted. */
|
|
291
293
|
private static _throwIfAborted;
|