@onekeyfe/hd-core 1.1.21 → 1.1.22-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.
@@ -1,5 +1,5 @@
1
- import type { AllNetworkAddress } from '../../types/api/allNetworkGetAddress';
2
1
  import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
2
+ import type { AllNetworkAddress } from '../../types/api/allNetworkGetAddress';
3
3
  export default class AllNetworkGetAddress extends AllNetworkGetAddressBase {
4
4
  getAllNetworkAddress(rootFingerprint: number): Promise<AllNetworkAddress[]>;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AllNetworkGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/allnetwork/AllNetworkGetAddress.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AASlE,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,wBAAwB;IAClE,oBAAoB,CAAC,eAAe,EAAE,MAAM;CAkEnD"}
1
+ {"version":3,"file":"AllNetworkGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/allnetwork/AllNetworkGetAddress.ts"],"names":[],"mappings":"AAIA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAGlE,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,sCAAsC,CAAC;AAS9C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,wBAAwB;IAClE,oBAAoB,CAAC,eAAe,EAAE,MAAM;CAkEnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"AllNetworkGetAddressBase.d.ts","sourceRoot":"","sources":["../../../src/api/allnetwork/AllNetworkGetAddressBase.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAe3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,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GetAddressByLoop.d.ts","sourceRoot":"","sources":["../../../src/api/allnetwork/AllNetworkGetAddressByLoop.ts"],"names":[],"mappings":"AAaA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,wBAAwB;IACxE,oBAAoB,CAAC,eAAe,EAAE,MAAM;YA6BpC,4BAA4B;IAiF1C,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,gBAAgB;CAazB"}
1
+ {"version":3,"file":"AllNetworkGetAddressByLoop.d.ts","sourceRoot":"","sources":["../../../src/api/allnetwork/AllNetworkGetAddressByLoop.ts"],"names":[],"mappings":"AASA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAQlE,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,wBAAwB;IACxE,oBAAoB,CAAC,eAAe,EAAE,MAAM;YA6BpC,4BAA4B;IAiF1C,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,gBAAgB;CAazB"}
@@ -1,6 +1,6 @@
1
- import { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport';
2
1
  import { BaseMethod } from '../BaseMethod';
3
- import { StellarAddress } from '../../types';
2
+ import type { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport';
3
+ import type { StellarAddress } from '../../types';
4
4
  export default class StellarGetAddress extends BaseMethod<HardwareStellarGetAddress[]> {
5
5
  hasBundle: boolean;
6
6
  init(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"StellarGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAA2B,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CA2BV"}
1
+ {"version":3,"file":"StellarGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,aAAa,CAAC;AAE3E,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CA2BV"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
- import { StellarSignedTx, StellarSignTx as HardwareStellarSignTx } from '@onekeyfe/hd-transport';
3
2
  import { BaseMethod } from '../BaseMethod';
4
- import { StellarOperation } from '../../types';
3
+ import type { StellarSignTx as HardwareStellarSignTx, StellarSignedTx } from '@onekeyfe/hd-transport';
4
+ import type { StellarOperation } from '../../types';
5
5
  export default class StellarSignTransaction extends BaseMethod<HardwareStellarSignTx> {
6
6
  operations: any[];
7
7
  parseOperation: (op: StellarOperation) => {
@@ -1 +1 @@
1
- {"version":3,"file":"StellarSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarSignTransaction.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,eAAe,EACf,aAAa,IAAI,qBAAqB,EACvC,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAgC,MAAM,aAAa,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU,CAAC,qBAAqB,CAAC;IACnF,UAAU,EAAE,GAAG,EAAE,CAAM;IAEvB,c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8BAoBvC,CAAC;AAEF,eAAO,MAAM,eAAe;SAKrB,eAAe,CAAC,KAAK,CAAC;eAChB,GAAG;;UASf,CAAC"}
@@ -1,12 +1,14 @@
1
1
  /// <reference types="node" />
2
2
  import EventEmitter from 'events';
3
- import { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
4
- import { Deferred } from '@onekeyfe/hd-shared';
3
+ import { DeviceCommands } from './DeviceCommands';
4
+ import { type DeviceFirmwareRange, type Device as DeviceTyped, EOneKeyDeviceMode, type Features, type UnavailableCapabilities } from '../types';
5
+ import { DEVICE } from '../events';
6
+ import type { PROTO } from '../constants';
7
+ import type { DeviceButtonRequestPayload, DeviceFeaturesPayload, PassphraseRequestPayload } from '../events';
8
+ import type { PassphrasePromptResponse } from './DeviceCommands';
9
+ import type { Deferred } from '@onekeyfe/hd-shared';
10
+ import type { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
5
11
  import type DeviceConnector from './DeviceConnector';
6
- import { DeviceCommands, PassphrasePromptResponse } from './DeviceCommands';
7
- import { type DeviceFirmwareRange, EOneKeyDeviceMode, type Device as DeviceTyped, type Features, type UnavailableCapabilities } from '../types';
8
- import { DEVICE, DeviceButtonRequestPayload, DeviceFeaturesPayload, PassphraseRequestPayload } from '../events';
9
- import { PROTO } from '../constants';
10
12
  export type InitOptions = {
11
13
  initSession?: boolean;
12
14
  deviceId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../src/device/Device.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAmB,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAEL,QAAQ,EAKT,MAAM,qBAAqB,CAAC;AAkB7B,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CA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vB,oBAAoB;IAW1B,mBAAmB,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC;IAW/D,qBAAqB;IAIrB,OAAO;IAoBP,kBAAkB;IAKlB,qBAAqB;IAKrB,MAAM;IAIN,gBAAgB;IAQhB,UAAU;IAQV,eAAe,IAAI,OAAO;IAI1B,YAAY;IAIZ,aAAa;IAIb,UAAU;IAIV,YAAY,IAAI,OAAO;IAIvB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;IAsBpD,gBAAgB;IAShB,aAAa,CAAC,QAAQ,EAAE,MAAM;IAOxB,UAAU;IAKhB,yBAAyB,IAAI,mBAAmB;IAQ1C,YAAY;IAgDZ,0BAA0B,CAC9B,eAAe,CAAC,EAAE,MAAM,EACxB,kBAAkB,CAAC,EAAE,OAAO,EAC5B,mBAAmB,CAAC,EAAE,OAAO;CA2ChC;AAED,eAAe,MAAM,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="w3c-web-usb" />
2
2
  /// <reference types="web-bluetooth" />
3
- import { Transport, OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
4
- import { DeviceDescriptorDiff } from './DevicePool';
3
+ import type { DeviceDescriptorDiff } from './DevicePool';
4
+ import type { OneKeyDeviceInfo as DeviceDescriptor, Transport } from '@onekeyfe/hd-transport';
5
5
  export default class DeviceConnector {
6
6
  transport: Transport;
7
7
  listenTimestamp: number;
@@ -14,6 +14,7 @@ export default class DeviceConnector {
14
14
  stop(): void;
15
15
  acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean): Promise<string | undefined>;
16
16
  release(session: string, onclose: boolean): Promise<void>;
17
+ disconnect(session: string | undefined | null): Promise<void>;
17
18
  promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
18
19
  _reportDevicesChange(): void;
19
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceConnector.d.ts","sourceRoot":"","sources":["../../src/device/DeviceConnector.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAIzF,OAAO,EAAc,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMhE,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,SAAS,EAAE,SAAS,CAAC;IAErB,eAAe,SAAK;IAEpB,OAAO,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAQ;IAE1C,QAAQ,EAAE,gBAAgB,EAAE,CAAM;IAElC,SAAS,UAAS;;IAQZ,SAAS;IAWT,MAAM;IAiCZ,IAAI;IAIE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,oBAAoB,CAAC,EAAE,OAAO;IAiB7E,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAS/C,kBAAkB,IAAI,OAAO,CAAC,SAAS,GAAG,eAAe,GAAG,IAAI,CAAC;IAOjE,oBAAoB;CAGrB"}
1
+ {"version":3,"file":"DeviceConnector.d.ts","sourceRoot":"","sources":["../../src/device/DeviceConnector.ts"],"names":[],"mappings":";;AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI9F,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,SAAS,EAAE,SAAS,CAAC;IAErB,eAAe,SAAK;IAEpB,OAAO,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAQ;IAE1C,QAAQ,EAAE,gBAAgB,EAAE,CAAM;IAElC,SAAS,UAAS;;IAQZ,SAAS;IAWT,MAAM;IAiCZ,IAAI;IAIE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,oBAAoB,CAAC,EAAE,OAAO;IAiB7E,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IASzC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAUnD,kBAAkB,IAAI,OAAO,CAAC,SAAS,GAAG,eAAe,GAAG,IAAI,CAAC;IAOjE,oBAAoB;CAGrB"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import EventEmitter$1, { EventEmitter } from 'events';
2
2
  import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
3
- import { OneKeyDeviceCommType, Messages, LowlevelTransportSharedPlugin, Features as Features$1, Success as Success$1, RecoveryDeviceType, SafetyCheckLevel, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, OneKeyDeviceInfo, Transport, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
3
+ import { OneKeyDeviceCommType, Messages, LowlevelTransportSharedPlugin, Features as Features$1, Success as Success$1, RecoveryDeviceType, SafetyCheckLevel, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, Transport, OneKeyDeviceInfo, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
4
4
  export { Messages as PROTO } from '@onekeyfe/hd-transport';
5
5
  import { EDeviceType, EFirmwareType, Deferred } from '@onekeyfe/hd-shared';
6
6
 
@@ -679,7 +679,7 @@ interface CardanoSignedTxData {
679
679
  auxiliaryDataSupplement?: CardanoAuxiliaryDataSupplement;
680
680
  }
681
681
 
682
- type INetwork = 'evm' | 'btc' | 'tbtc' | 'doge' | 'neurai' | 'ltc' | 'bch' | 'sol' | 'algo' | 'near' | 'stc' | 'cfx' | 'tron' | 'aptos' | 'xrp' | 'cosmos' | 'ada' | 'sui' | 'fil' | 'dot' | 'kaspa' | 'nexa' | 'dynex' | 'nervos' | 'scdo' | 'ton' | 'alph' | 'nostr' | 'benfen' | 'neo';
682
+ type INetwork = 'evm' | 'btc' | 'tbtc' | 'doge' | 'neurai' | 'ltc' | 'bch' | 'sol' | 'algo' | 'near' | 'stc' | 'cfx' | 'tron' | 'aptos' | 'xrp' | 'cosmos' | 'ada' | 'sui' | 'fil' | 'dot' | 'kaspa' | 'nexa' | 'dynex' | 'nervos' | 'scdo' | 'ton' | 'alph' | 'nostr' | 'benfen' | 'neo' | 'stellar';
683
683
  type AllNetworkAddressParams = {
684
684
  path: string | number[];
685
685
  network: INetwork;
@@ -2913,35 +2913,6 @@ declare const createErrorMessage: (error: Error & {
2913
2913
  code?: string | number;
2914
2914
  }) => Unsuccessful;
2915
2915
 
2916
- type DeviceDescriptorDiff = {
2917
- didUpdate: boolean;
2918
- connected: OneKeyDeviceInfo[];
2919
- disconnected: OneKeyDeviceInfo[];
2920
- changedSessions: OneKeyDeviceInfo[];
2921
- changedDebugSessions: OneKeyDeviceInfo[];
2922
- acquired: OneKeyDeviceInfo[];
2923
- debugAcquired: OneKeyDeviceInfo[];
2924
- released: OneKeyDeviceInfo[];
2925
- debugReleased: OneKeyDeviceInfo[];
2926
- descriptors: OneKeyDeviceInfo[];
2927
- };
2928
-
2929
- declare class DeviceConnector {
2930
- transport: Transport;
2931
- listenTimestamp: number;
2932
- current: OneKeyDeviceInfo[] | null;
2933
- upcoming: OneKeyDeviceInfo[];
2934
- listening: boolean;
2935
- constructor();
2936
- enumerate(): Promise<DeviceDescriptorDiff | undefined>;
2937
- listen(): Promise<void>;
2938
- stop(): void;
2939
- acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean): Promise<string | undefined>;
2940
- release(session: string, onclose: boolean): Promise<void>;
2941
- promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
2942
- _reportDevicesChange(): void;
2943
- }
2944
-
2945
2916
  type PassphrasePromptResponse = {
2946
2917
  passphrase?: string;
2947
2918
  passphraseOnDevice?: boolean;
@@ -3017,6 +2988,36 @@ declare class DeviceCommands {
3017
2988
  _promptPassphrase(options: PassphraseRequestPayload): Promise<PassphrasePromptResponse>;
3018
2989
  }
3019
2990
 
2991
+ type DeviceDescriptorDiff = {
2992
+ didUpdate: boolean;
2993
+ connected: OneKeyDeviceInfo[];
2994
+ disconnected: OneKeyDeviceInfo[];
2995
+ changedSessions: OneKeyDeviceInfo[];
2996
+ changedDebugSessions: OneKeyDeviceInfo[];
2997
+ acquired: OneKeyDeviceInfo[];
2998
+ debugAcquired: OneKeyDeviceInfo[];
2999
+ released: OneKeyDeviceInfo[];
3000
+ debugReleased: OneKeyDeviceInfo[];
3001
+ descriptors: OneKeyDeviceInfo[];
3002
+ };
3003
+
3004
+ declare class DeviceConnector {
3005
+ transport: Transport;
3006
+ listenTimestamp: number;
3007
+ current: OneKeyDeviceInfo[] | null;
3008
+ upcoming: OneKeyDeviceInfo[];
3009
+ listening: boolean;
3010
+ constructor();
3011
+ enumerate(): Promise<DeviceDescriptorDiff | undefined>;
3012
+ listen(): Promise<void>;
3013
+ stop(): void;
3014
+ acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean): Promise<string | undefined>;
3015
+ release(session: string, onclose: boolean): Promise<void>;
3016
+ disconnect(session: string | undefined | null): Promise<void>;
3017
+ promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
3018
+ _reportDevicesChange(): void;
3019
+ }
3020
+
3020
3021
  type InitOptions = {
3021
3022
  initSession?: boolean;
3022
3023
  deviceId?: string;
package/dist/index.js CHANGED
@@ -27405,6 +27405,7 @@ class Device extends events.exports {
27405
27405
  });
27406
27406
  }
27407
27407
  _runInner(fn, options) {
27408
+ var _a;
27408
27409
  return __awaiter(this, void 0, void 0, function* () {
27409
27410
  if (!this.isUsedHere() || this.commands.disposed) {
27410
27411
  const env = DataManager.getSettings('env');
@@ -27447,14 +27448,10 @@ class Device extends events.exports {
27447
27448
  this.runPromise.reject(e);
27448
27449
  }
27449
27450
  if (e instanceof hdShared.HardwareError &&
27450
- (e.errorCode === hdShared.HardwareErrorCode.DeviceInitializeFailed ||
27451
- e.errorCode === hdShared.HardwareErrorCode.DeviceInterruptedFromOutside ||
27452
- e.errorCode === hdShared.HardwareErrorCode.DeviceInterruptedFromUser ||
27453
- e.errorCode === hdShared.HardwareErrorCode.DeviceCheckPassphraseStateError ||
27454
- e.errorCode === hdShared.HardwareErrorCode.ResponseUnexpectTypeError ||
27455
- e.errorCode === hdShared.HardwareErrorCode.PinInvalid ||
27456
- e.errorCode === hdShared.HardwareErrorCode.PinCancelled ||
27457
- e.errorCode === hdShared.HardwareErrorCode.UnexpectPassphrase)) {
27451
+ hdShared.ERROR_CODES_REQUIRE_RELEASE.includes(e.errorCode)) {
27452
+ if (hdShared.ERROR_CODES_REQUIRE_DISCONNECT.includes(e.errorCode)) {
27453
+ yield ((_a = this.deviceConnector) === null || _a === void 0 ? void 0 : _a.disconnect(this.mainId));
27454
+ }
27458
27455
  yield this.release();
27459
27456
  Log$a.debug(`error code ${e.errorCode} release device, mainId: ${this.mainId}`);
27460
27457
  }
@@ -30974,6 +30971,9 @@ const networkConfigMap = {
30974
30971
  neo: {
30975
30972
  methodName: 'neoGetAddress',
30976
30973
  },
30974
+ stellar: {
30975
+ methodName: 'stellarGetAddress',
30976
+ },
30977
30977
  };
30978
30978
  class AllNetworkGetAddressBase extends BaseMethod {
30979
30979
  constructor() {
@@ -39631,6 +39631,18 @@ class DeviceConnector {
39631
39631
  }
39632
39632
  });
39633
39633
  }
39634
+ disconnect(session) {
39635
+ return __awaiter(this, void 0, void 0, function* () {
39636
+ try {
39637
+ if (this.transport.disconnect && !!session) {
39638
+ yield this.transport.disconnect(session);
39639
+ }
39640
+ }
39641
+ catch (error) {
39642
+ safeThrowError(error);
39643
+ }
39644
+ });
39645
+ }
39634
39646
  promptDeviceAccess() {
39635
39647
  if (!this.transport.promptDeviceAccess) {
39636
39648
  return Promise.resolve(null);
@@ -40073,6 +40085,10 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
40073
40085
  messageResponse = createResponseMessage(method.responseID, false, { error });
40074
40086
  requestQueue.resolveRequest(method.responseID, messageResponse);
40075
40087
  completeMethodRequestContext(method, error);
40088
+ if (error instanceof hdShared.HardwareError &&
40089
+ hdShared.ERROR_CODES_REQUIRE_RELEASE.includes(error.errorCode)) {
40090
+ throw error;
40091
+ }
40076
40092
  }
40077
40093
  });
40078
40094
  Log.debug('Call API - Device Run: ', device.mainId);
@@ -1,6 +1,6 @@
1
1
  import type { CommonParams, Response, Unsuccessful } from '../params';
2
2
  import type { CardanoAddressParameters } from './cardano';
3
- export type INetwork = 'evm' | 'btc' | 'tbtc' | 'doge' | 'neurai' | 'ltc' | 'bch' | 'sol' | 'algo' | 'near' | 'stc' | 'cfx' | 'tron' | 'aptos' | 'xrp' | 'cosmos' | 'ada' | 'sui' | 'fil' | 'dot' | 'kaspa' | 'nexa' | 'dynex' | 'nervos' | 'scdo' | 'ton' | 'alph' | 'nostr' | 'benfen' | 'neo';
3
+ export type INetwork = 'evm' | 'btc' | 'tbtc' | 'doge' | 'neurai' | 'ltc' | 'bch' | 'sol' | 'algo' | 'near' | 'stc' | 'cfx' | 'tron' | 'aptos' | 'xrp' | 'cosmos' | 'ada' | 'sui' | 'fil' | 'dot' | 'kaspa' | 'nexa' | 'dynex' | 'nervos' | 'scdo' | 'ton' | 'alph' | 'nostr' | 'benfen' | 'neo' | 'stellar';
4
4
  export type CommonResponseParams = {
5
5
  path: string;
6
6
  network: INetwork;
@@ -1 +1 @@
1
- {"version":3,"file":"allNetworkGetAddress.d.ts","sourceRoot":"","sources":["../../../src/types/api/allNetworkGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,MAAM,QAAQ,GAChB,KAAK,GAEL,KAAK,GACL,MAAM,GACN,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GAEL,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,GACL,QAAQ,GACR,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,OAAO,GACP,MAAM,GACN,OAAO,GACP,QAAQ,GACR,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,QAAQ,GACR,KAAK,CAAC;AAEV,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE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AC1C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,0BAA0B,GAChD,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAChD,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,gCAAgC,GAEtD,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "1.1.21",
3
+ "version": "1.1.22-alpha.2",
4
4
  "description": "Core processes and APIs for communicating with OneKey hardware devices.",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-shared": "1.1.21",
29
- "@onekeyfe/hd-transport": "1.1.21",
28
+ "@onekeyfe/hd-shared": "1.1.22-alpha.2",
29
+ "@onekeyfe/hd-transport": "1.1.22-alpha.2",
30
30
  "axios": "1.12.2",
31
31
  "bignumber.js": "^9.0.2",
32
32
  "bytebuffer": "^5.0.1",
@@ -44,5 +44,5 @@
44
44
  "@types/w3c-web-usb": "^1.0.10",
45
45
  "@types/web-bluetooth": "^0.0.21"
46
46
  },
47
- "gitHead": "2c691aee96693b102a0edeca7e7768448090b4d1"
47
+ "gitHead": "a619ea24331a5c59b2d9b4b251c95a56a420739a"
48
48
  }
@@ -1,14 +1,15 @@
1
1
  import { HardwareErrorCode, HardwareErrorCodeMessage } from '@onekeyfe/hd-shared';
2
- import { CoreApi } from '../../types';
3
2
 
3
+ import { createUiMessage } from '../../events';
4
+ import { UI_REQUEST } from '../../constants/ui-request';
5
+ import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
6
+
7
+ import type { CoreApi } from '../../types';
4
8
  import type {
5
9
  AllNetworkAddress,
6
10
  AllNetworkAddressParams,
7
11
  AllNetworkGetAddressParams,
8
12
  } from '../../types/api/allNetworkGetAddress';
9
- import { createUiMessage } from '../../events';
10
- import { UI_REQUEST } from '../../constants/ui-request';
11
- import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
12
13
 
13
14
  type MethodParams = {
14
15
  methodName: keyof CoreApi;
@@ -240,6 +240,9 @@ const networkConfigMap: NetworkConfigMap = {
240
240
  neo: {
241
241
  methodName: 'neoGetAddress',
242
242
  },
243
+ stellar: {
244
+ methodName: 'stellarGetAddress',
245
+ },
243
246
  };
244
247
 
245
248
  type MethodParams = {
@@ -1,19 +1,20 @@
1
1
  import {
2
- createDeferred,
3
2
  ERRORS,
4
3
  HardwareError,
5
4
  HardwareErrorCode,
6
5
  HardwareErrorCodeMessage,
6
+ createDeferred,
7
7
  } from '@onekeyfe/hd-shared';
8
+
9
+ import { IFRAME } from '../../events';
10
+ import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
11
+
12
+ import type { Unsuccessful } from '../../types';
8
13
  import type {
9
14
  AllNetworkAddress,
10
15
  AllNetworkGetAddressParamsByLoop,
11
16
  } from '../../types/api/allNetworkGetAddress';
12
17
 
13
- import { IFRAME } from '../../events';
14
- import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
15
- import { Unsuccessful } from '../../types';
16
-
17
18
  export default class AllNetworkGetAddressByLoop extends AllNetworkGetAddressBase {
18
19
  async getAllNetworkAddress(rootFingerprint: number) {
19
20
  const { callbackId, callbackIdFinish } = this.payload as AllNetworkGetAddressParamsByLoop;
@@ -1,9 +1,10 @@
1
- import { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport';
2
1
  import { UI_REQUEST } from '../../constants/ui-request';
3
2
  import { serializedPath, validatePath } from '../helpers/pathUtils';
4
3
  import { BaseMethod } from '../BaseMethod';
5
4
  import { validateParams, validateResult } from '../helpers/paramsValidator';
6
- import { StellarGetAddressParams, StellarAddress } from '../../types';
5
+
6
+ import type { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport';
7
+ import type { StellarAddress, StellarGetAddressParams } from '../../types';
7
8
 
8
9
  export default class StellarGetAddress extends BaseMethod<HardwareStellarGetAddress[]> {
9
10
  hasBundle = false;
@@ -1,14 +1,16 @@
1
- import {
2
- StellarMemoType,
3
- StellarSignedTx,
4
- StellarSignTx as HardwareStellarSignTx,
5
- } from '@onekeyfe/hd-transport';
1
+ import { StellarMemoType } from '@onekeyfe/hd-transport';
6
2
  import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
3
+
7
4
  import { UI_REQUEST } from '../../constants/ui-request';
8
5
  import { validatePath } from '../helpers/pathUtils';
9
6
  import { BaseMethod } from '../BaseMethod';
10
7
  import { validateParams } from '../helpers/paramsValidator';
11
- import { StellarOperation, StellarSignTransactionParams } from '../../types';
8
+
9
+ import type {
10
+ StellarSignTx as HardwareStellarSignTx,
11
+ StellarSignedTx,
12
+ } from '@onekeyfe/hd-transport';
13
+ import type { StellarOperation, StellarSignTransactionParams } from '../../types';
12
14
 
13
15
  export default class StellarSignTransaction extends BaseMethod<HardwareStellarSignTx> {
14
16
  operations: any[] = [];
package/src/core/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import semver from 'semver';
2
2
  import EventEmitter from 'events';
3
3
  import {
4
+ ERROR_CODES_REQUIRE_RELEASE,
4
5
  ERRORS,
5
6
  HardwareError,
6
7
  HardwareErrorCode,
@@ -533,6 +534,14 @@ const onCallDevice = async (
533
534
  messageResponse = createResponseMessage(method.responseID, false, { error });
534
535
  requestQueue.resolveRequest(method.responseID, messageResponse);
535
536
  completeMethodRequestContext(method, error);
537
+
538
+ // Re-throw errors that need to trigger device release/disconnect in Device._runInner
539
+ if (
540
+ error instanceof HardwareError &&
541
+ ERROR_CODES_REQUIRE_RELEASE.includes(error.errorCode as any)
542
+ ) {
543
+ throw error;
544
+ }
536
545
  }
537
546
  };
538
547
  Log.debug('Call API - Device Run: ', device.mainId);
@@ -1,15 +1,18 @@
1
1
  import EventEmitter from 'events';
2
2
  import semver from 'semver';
3
- import { OneKeyDeviceInfo as DeviceDescriptor, Enum_Capability } from '@onekeyfe/hd-transport';
3
+ import { Enum_Capability } from '@onekeyfe/hd-transport';
4
4
  import {
5
- createDeferred,
6
- Deferred,
7
5
  EDeviceType,
6
+ ERROR_CODES_REQUIRE_DISCONNECT,
7
+ ERROR_CODES_REQUIRE_RELEASE,
8
8
  ERRORS,
9
9
  HardwareError,
10
10
  HardwareErrorCode,
11
+ createDeferred,
11
12
  } from '@onekeyfe/hd-shared';
13
+
12
14
  import {
15
+ LoggerNames,
13
16
  getDeviceBLEFirmwareVersion,
14
17
  getDeviceBleName,
15
18
  getDeviceFirmwareVersion,
@@ -18,7 +21,6 @@ import {
18
21
  getDeviceUUID,
19
22
  getLogger,
20
23
  getMethodVersionRange,
21
- LoggerNames,
22
24
  } from '../utils';
23
25
  import {
24
26
  fixFeaturesFirmwareVersion,
@@ -26,30 +28,32 @@ import {
26
28
  } from '../utils/deviceFeaturesUtils';
27
29
  import { generateInstanceId } from '../utils/tracing';
28
30
 
29
- import type DeviceConnector from './DeviceConnector';
30
31
  // eslint-disable-next-line import/no-cycle
31
- import { DeviceCommands, PassphrasePromptResponse } from './DeviceCommands';
32
-
32
+ import { DeviceCommands } from './DeviceCommands';
33
33
  import {
34
34
  type DeviceFirmwareRange,
35
- EOneKeyDeviceMode,
36
35
  type Device as DeviceTyped,
36
+ EOneKeyDeviceMode,
37
37
  type Features,
38
38
  type UnavailableCapabilities,
39
39
  } from '../types';
40
- import {
41
- DEVICE,
42
- DeviceButtonRequestPayload,
43
- DeviceFeaturesPayload,
44
- PassphraseRequestPayload,
45
- UI_REQUEST,
46
- } from '../events';
47
- import { PROTO } from '../constants';
40
+ import { DEVICE, UI_REQUEST } from '../events';
48
41
  import { DataManager } from '../data-manager';
49
42
  import TransportManager from '../data-manager/TransportManager';
50
43
  import { toHardened } from '../api/helpers/pathUtils';
51
44
  import { existCapability } from '../utils/capabilitieUtils';
52
45
 
46
+ import type { PROTO } from '../constants';
47
+ import type {
48
+ DeviceButtonRequestPayload,
49
+ DeviceFeaturesPayload,
50
+ PassphraseRequestPayload,
51
+ } from '../events';
52
+ import type { PassphrasePromptResponse } from './DeviceCommands';
53
+ import type { Deferred } from '@onekeyfe/hd-shared';
54
+ import type { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
55
+ import type DeviceConnector from './DeviceConnector';
56
+
53
57
  export type InitOptions = {
54
58
  initSession?: boolean;
55
59
  deviceId?: string;
@@ -595,15 +599,11 @@ export class Device extends EventEmitter {
595
599
 
596
600
  if (
597
601
  e instanceof HardwareError &&
598
- (e.errorCode === HardwareErrorCode.DeviceInitializeFailed ||
599
- e.errorCode === HardwareErrorCode.DeviceInterruptedFromOutside ||
600
- e.errorCode === HardwareErrorCode.DeviceInterruptedFromUser ||
601
- e.errorCode === HardwareErrorCode.DeviceCheckPassphraseStateError ||
602
- e.errorCode === HardwareErrorCode.ResponseUnexpectTypeError ||
603
- e.errorCode === HardwareErrorCode.PinInvalid ||
604
- e.errorCode === HardwareErrorCode.PinCancelled ||
605
- e.errorCode === HardwareErrorCode.UnexpectPassphrase)
602
+ ERROR_CODES_REQUIRE_RELEASE.includes(e.errorCode as any)
606
603
  ) {
604
+ if (ERROR_CODES_REQUIRE_DISCONNECT.includes(e.errorCode as any)) {
605
+ await this.deviceConnector?.disconnect(this.mainId);
606
+ }
607
607
  await this.release();
608
608
  Log.debug(`error code ${e.errorCode} release device, mainId: ${this.mainId}`);
609
609
  }
@@ -1,10 +1,12 @@
1
- import { Transport, OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
2
1
  import { safeThrowError } from '../constants';
3
2
  import { DataManager } from '../data-manager';
4
3
  import TransportManager from '../data-manager/TransportManager';
5
- import { DevicePool, DeviceDescriptorDiff } from './DevicePool';
4
+ import { DevicePool } from './DevicePool';
6
5
  import { resolveAfter } from '../utils/promiseUtils';
7
- import { getLogger, LoggerNames } from '../utils';
6
+ import { LoggerNames, getLogger } from '../utils';
7
+
8
+ import type { DeviceDescriptorDiff } from './DevicePool';
9
+ import type { OneKeyDeviceInfo as DeviceDescriptor, Transport } from '@onekeyfe/hd-transport';
8
10
 
9
11
  const Log = getLogger(LoggerNames.DeviceConnector);
10
12
 
@@ -99,6 +101,16 @@ export default class DeviceConnector {
99
101
  }
100
102
  }
101
103
 
104
+ async disconnect(session: string | undefined | null) {
105
+ try {
106
+ if (this.transport.disconnect && !!session) {
107
+ await this.transport.disconnect(session);
108
+ }
109
+ } catch (error) {
110
+ safeThrowError(error);
111
+ }
112
+ }
113
+
102
114
  promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null> {
103
115
  if (!this.transport.promptDeviceAccess) {
104
116
  return Promise.resolve(null);
@@ -33,7 +33,8 @@ export type INetwork =
33
33
  | 'alph'
34
34
  | 'nostr'
35
35
  | 'benfen'
36
- | 'neo';
36
+ | 'neo'
37
+ | 'stellar';
37
38
 
38
39
  export type CommonResponseParams = {
39
40
  path: string;