@onekeyfe/hd-core 0.2.55 → 0.3.0

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 +1 @@
1
- {"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,WAAW,EAA4D,MAAM,WAAW,CAAC;AAMlG,8BAAsB,UAAU,CAAC,MAAM,GAAG,SAAS;IACjD,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAOf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAK5B,SAAS,EAAE,OAAO,CAAC;IAKnB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAK7B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAK5B,qBAAqB,UAAQ;IAK7B,aAAa,UAAS;IAKtB,wBAAwB,UAAQ;IAMhC,oBAAoB,UAAS;IAG7B,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;gBAEhC,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE;IAYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eAAe,IAAI,mBAAmB;IAItC,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,oBAAoB;IAkBpB,yBAAyB;IAiBnB,yBAAyB;IAkB/B,OAAO;IAGP,0BAA0B,SAAU;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,UAOrE;CACH"}
1
+ {"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,WAAW,EAA4D,MAAM,WAAW,CAAC;AAMlG,8BAAsB,UAAU,CAAC,MAAM,GAAG,SAAS;IACjD,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAOf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAK5B,SAAS,EAAE,OAAO,CAAC;IAKnB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAK7B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAK5B,qBAAqB,UAAQ;IAK7B,aAAa,UAAS;IAKtB,wBAAwB,UAAQ;IAMhC,oBAAoB,UAAS;IAG7B,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;gBAEhC,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE;IAYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eAAe,IAAI,mBAAmB;IAItC,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,oBAAoB;IAkBpB,yBAAyB;IAiBnB,yBAAyB;IAgB/B,OAAO;IAGP,0BAA0B,SAAU;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,UAOrE;CACH"}
@@ -135,7 +135,7 @@ export default class StellarSignTransaction extends BaseMethod<HardwareStellarSi
135
135
  value?: undefined;
136
136
  bump_to?: undefined;
137
137
  } | {
138
- signer_type?: 0 | 2 | 1 | undefined;
138
+ signer_type?: 0 | 1 | 2 | undefined;
139
139
  signer_key?: string | Buffer | undefined;
140
140
  signer_weight?: number | undefined;
141
141
  type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAqBlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AA4BxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAiRjD,CAAC;AAqMF,eAAO,MAAM,MAAM,0CAkBlB,CAAC;AAoJF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA8CxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAIzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAqBlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AA4BxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAgRjD,CAAC;AAqMF,eAAO,MAAM,MAAM,0CAkBlB,CAAC;AAoJF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA8CxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAIzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
1
+ import EventEmitter$1, { EventEmitter } from 'events';
2
2
  import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
3
3
  import { Messages, Success as Success$1, RecoveryDeviceType, SafetyCheckLevel, ResourceType, CipheredKeyValue as CipheredKeyValue$1, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, 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, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, UintType, 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, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, OneKeyDeviceInfo, Transport, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
4
4
  export { Messages as PROTO } from '@onekeyfe/hd-transport';
@@ -36,6 +36,20 @@ declare const removeAllListeners: (type: any) => void;
36
36
 
37
37
  declare function uiResponse(response: UiResponseEvent): void;
38
38
 
39
+ declare type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
40
+ interface LowLevelInjectApi {
41
+ call: CallMethod;
42
+ eventEmitter: EventEmitter;
43
+ init: CoreApi['init'];
44
+ dispose: CoreApi['dispose'];
45
+ uiResponse: CoreApi['uiResponse'];
46
+ cancel: CoreApi['cancel'];
47
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
48
+ }
49
+ declare type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
50
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
51
+ };
52
+
39
53
  declare const safeThrowError: (error: any) => never;
40
54
 
41
55
  declare type DeviceStatus = 'available' | 'occupied' | 'used';
@@ -201,7 +215,7 @@ declare type RemoteConfigResponse = {
201
215
  bridge: AssetsMap['bridge'];
202
216
  } & DeviceTypeMap;
203
217
 
204
- declare function init$1(settings: Partial<ConnectSettings>): Promise<boolean>;
218
+ declare function init$1(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi): Promise<boolean>;
205
219
 
206
220
  declare function getLogs(): Response<string[]>;
207
221
 
@@ -1575,6 +1589,7 @@ declare type CoreApi = {
1575
1589
  init: typeof init$1;
1576
1590
  on: typeof on;
1577
1591
  off: typeof off;
1592
+ emit: (event: string, ...args: any[]) => void;
1578
1593
  removeAllListeners: typeof removeAllListeners;
1579
1594
  dispose: () => void;
1580
1595
  call: (params: any) => Promise<any>;
@@ -2057,7 +2072,7 @@ interface Device {
2057
2072
  off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
2058
2073
  emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
2059
2074
  }
2060
- declare class Device extends EventEmitter {
2075
+ declare class Device extends EventEmitter$1 {
2061
2076
  originalDescriptor: OneKeyDeviceInfo;
2062
2077
  mainId?: string | null;
2063
2078
  deviceConnector?: DeviceConnector | null;
@@ -2119,14 +2134,19 @@ declare type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<U
2119
2134
 
2120
2135
  interface InjectApi {
2121
2136
  call: CallMethod;
2122
- eventEmitter: EventEmitter$1;
2137
+ eventEmitter: EventEmitter;
2123
2138
  init: CoreApi['init'];
2124
2139
  dispose: CoreApi['dispose'];
2125
2140
  uiResponse: CoreApi['uiResponse'];
2126
2141
  cancel: CoreApi['cancel'];
2127
2142
  }
2128
2143
 
2129
- declare class Core extends EventEmitter {
2144
+ interface TopLevelInjectApi {
2145
+ init: CoreApi['init'];
2146
+ call: CoreApi['call'];
2147
+ }
2148
+
2149
+ declare class Core extends EventEmitter$1 {
2130
2150
  handleMessage(message: CoreMessage): Promise<any>;
2131
2151
  dispose(): void;
2132
2152
  }
@@ -2245,5 +2265,7 @@ declare class DataManager {
2245
2265
  }
2246
2266
 
2247
2267
  declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, }: InjectApi) => CoreApi;
2268
+ declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, }: LowLevelInjectApi) => LowLevelCoreApi;
2269
+ declare const HardwareTopLevelSdk: () => CoreApi;
2248
2270
 
2249
- export { AccountAddress, AccountAddresses, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceUploadResourceParams, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProgress, FirmwareRange, FirmwareRelease$1 as FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, Params, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TransactionOptions, TransportReleaseStatus, TronAddress, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getFirmwareUpdateField, getHDPath, getHomeScreenHex, getLog, getLogger, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, versionCompare, versionSplit, wait };
2271
+ export { AccountAddress, AccountAddresses, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceUploadResourceParams, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProgress, FirmwareRange, FirmwareRelease$1 as FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, Params, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getFirmwareUpdateField, getHDPath, getHomeScreenHex, getLog, getLogger, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, versionCompare, versionSplit, wait };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE3D,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,QAAA,MAAM,WAAW,+DAOd,SAAS,KAAG,OAQX,CAAC;AAEL,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAkB,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE3D,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,QAAA,MAAM,WAAW,+DAOd,SAAS,KAAG,OAQX,CAAC;AAEL,QAAA,MAAM,mBAAmB,+FAQtB,iBAAiB,KAAG,eASnB,CAAC;AAEL,QAAA,MAAM,mBAAmB,QAAO,OAA2B,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAEpD,eAAe,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -26,165 +26,116 @@ var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
26
26
  var JSZip__default = /*#__PURE__*/_interopDefaultLegacy(JSZip);
27
27
 
28
28
  const inject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, }) => {
29
- const api = {
30
- on: (type, fn) => {
29
+ const api = Object.assign({ on: (type, fn) => {
31
30
  eventEmitter.on(type, fn);
32
- },
33
- off: (type, fn) => {
31
+ }, emit: () => { }, off: (type, fn) => {
34
32
  eventEmitter.removeListener(type, fn);
35
- },
36
- removeAllListeners: type => {
33
+ }, removeAllListeners: type => {
37
34
  eventEmitter.removeAllListeners(type);
38
- },
39
- init,
35
+ }, init,
40
36
  call,
41
37
  dispose,
42
38
  uiResponse,
43
- cancel,
44
- getLogs: () => call({ method: 'getLogs' }),
45
- searchDevices: () => call({ method: 'searchDevices' }),
46
- getFeatures: connectId => call({ connectId, method: 'getFeatures' }),
47
- checkFirmwareRelease: connectId => call({ connectId, method: 'checkFirmwareRelease' }),
48
- checkBLEFirmwareRelease: connectId => call({ connectId, method: 'checkBLEFirmwareRelease' }),
49
- checkTransportRelease: () => call({ method: 'checkTransportRelease' }),
50
- checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
51
- checkBootloaderRelease: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'checkBootloaderRelease' })),
52
- cipherKeyValue: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cipherKeyValue' })),
53
- deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
54
- deviceChangePin: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceChangePin' })),
55
- deviceFlags: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceFlags' })),
56
- deviceRebootToBoardloader: connectId => call({ connectId, method: 'deviceRebootToBoardloader' }),
57
- deviceRebootToBootloader: connectId => call({ connectId, method: 'deviceRebootToBootloader' }),
58
- deviceRecovery: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceRecovery' })),
59
- deviceReset: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceReset' })),
60
- deviceSettings: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceSettings' })),
61
- deviceUpdateReboot: connectId => call({ connectId, method: 'deviceUpdateReboot' }),
62
- deviceUploadResource: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceUploadResource' })),
63
- deviceSupportFeatures: connectId => call({ connectId, method: 'deviceSupportFeatures' }),
64
- deviceVerify: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceVerify' })),
65
- deviceWipe: connectId => call({ connectId, method: 'deviceWipe' }),
66
- deviceFullyUploadResource: connectId => call({ connectId, method: 'deviceFullyUploadResource' }),
67
- deviceUpdateBootloader: connectId => call({ connectId, method: 'deviceUpdateBootloader' }),
68
- getPassphraseState: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'getPassphraseState' })),
69
- evmGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmGetAddress' })),
70
- evmGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmGetPublicKey' })),
71
- evmSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignMessage' })),
72
- evmSignMessageEIP712: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignMessageEIP712' })),
73
- evmSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignTransaction' })),
74
- evmSignTypedData: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignTypedData' })),
75
- evmVerifyMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmVerifyMessage' })),
76
- btcGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcGetAddress' })),
77
- btcGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcGetPublicKey' })),
78
- btcSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcSignMessage' })),
79
- btcSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcSignTransaction' })),
80
- btcVerifyMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcVerifyMessage' })),
81
- starcoinGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinGetAddress' })),
82
- starcoinGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinGetPublicKey' })),
83
- starcoinSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinSignMessage' })),
84
- starcoinSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinSignTransaction' })),
85
- starcoinVerifyMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinVerifyMessage' })),
86
- nemGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nemGetAddress' })),
87
- nemSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nemSignTransaction' })),
88
- solGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'solGetAddress' })),
89
- solSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'solSignTransaction' })),
90
- stellarGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'stellarGetAddress' })),
91
- stellarSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'stellarSignTransaction' })),
92
- firmwareUpdate: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'firmwareUpdate' })),
93
- firmwareUpdateV2: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'firmwareUpdateV2' })),
94
- requestWebUsbDevice: () => call({ method: 'requestWebUsbDevice' }),
95
- tronGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'tronGetAddress' })),
96
- tronSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'tronSignMessage' })),
97
- tronSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'tronSignTransaction' })),
98
- confluxGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxGetAddress' })),
99
- confluxSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxSignMessage' })),
100
- confluxSignMessageCIP23: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxSignMessageCIP23' })),
101
- confluxSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxSignTransaction' })),
102
- nearGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nearGetAddress' })),
103
- nearSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nearSignTransaction' })),
104
- aptosGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosGetAddress' })),
105
- aptosGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosGetPublicKey' })),
106
- aptosSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosSignMessage' })),
107
- aptosSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosSignTransaction' })),
108
- algoGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'algoGetAddress' })),
109
- algoSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'algoSignTransaction' })),
110
- cosmosGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cosmosGetAddress' })),
111
- cosmosGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cosmosGetPublicKey' })),
112
- cosmosSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cosmosSignTransaction' })),
113
- xrpGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'xrpGetAddress' })),
114
- xrpSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'xrpSignTransaction' })),
115
- suiGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'suiGetAddress' })),
116
- suiGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'suiGetPublicKey' })),
117
- suiSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'suiSignTransaction' })),
118
- cardanoGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetAddress' })),
119
- cardanoGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetPublicKey' })),
120
- cardanoSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoSignTransaction' })),
121
- cardanoSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoSignMessage' })),
122
- filecoinGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'filecoinGetAddress' })),
123
- filecoinSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'filecoinSignTransaction' })),
124
- polkadotGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'polkadotGetAddress' })),
125
- polkadotSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'polkadotSignTransaction' })),
126
- kaspaGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'kaspaGetAddress' })),
127
- kaspaSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'kaspaSignTransaction' })),
128
- };
39
+ cancel }, createCoreApi(call));
129
40
  return api;
130
41
  };
42
+ const createCoreApi = (call) => ({
43
+ getLogs: () => call({ method: 'getLogs' }),
44
+ searchDevices: () => call({ method: 'searchDevices' }),
45
+ getFeatures: connectId => call({ connectId, method: 'getFeatures' }),
46
+ checkFirmwareRelease: connectId => call({ connectId, method: 'checkFirmwareRelease' }),
47
+ checkBLEFirmwareRelease: connectId => call({ connectId, method: 'checkBLEFirmwareRelease' }),
48
+ checkTransportRelease: () => call({ method: 'checkTransportRelease' }),
49
+ checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
50
+ checkBootloaderRelease: connectId => call({ connectId, method: 'checkBootloaderRelease' }),
51
+ cipherKeyValue: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cipherKeyValue' })),
52
+ deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
53
+ deviceChangePin: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceChangePin' })),
54
+ deviceFlags: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceFlags' })),
55
+ deviceRebootToBoardloader: connectId => call({ connectId, method: 'deviceRebootToBoardloader' }),
56
+ deviceRebootToBootloader: connectId => call({ connectId, method: 'deviceRebootToBootloader' }),
57
+ deviceRecovery: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceRecovery' })),
58
+ deviceReset: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceReset' })),
59
+ deviceSettings: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceSettings' })),
60
+ deviceUpdateReboot: connectId => call({ connectId, method: 'deviceUpdateReboot' }),
61
+ deviceUploadResource: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceUploadResource' })),
62
+ deviceSupportFeatures: connectId => call({ connectId, method: 'deviceSupportFeatures' }),
63
+ deviceVerify: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceVerify' })),
64
+ deviceWipe: connectId => call({ connectId, method: 'deviceWipe' }),
65
+ deviceFullyUploadResource: connectId => call({ connectId, method: 'deviceFullyUploadResource' }),
66
+ deviceUpdateBootloader: connectId => call({ connectId, method: 'deviceUpdateBootloader' }),
67
+ getPassphraseState: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'getPassphraseState' })),
68
+ evmGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmGetAddress' })),
69
+ evmGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmGetPublicKey' })),
70
+ evmSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignMessage' })),
71
+ evmSignMessageEIP712: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignMessageEIP712' })),
72
+ evmSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignTransaction' })),
73
+ evmSignTypedData: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmSignTypedData' })),
74
+ evmVerifyMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'evmVerifyMessage' })),
75
+ btcGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcGetAddress' })),
76
+ btcGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcGetPublicKey' })),
77
+ btcSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcSignMessage' })),
78
+ btcSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcSignTransaction' })),
79
+ btcVerifyMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'btcVerifyMessage' })),
80
+ starcoinGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinGetAddress' })),
81
+ starcoinGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinGetPublicKey' })),
82
+ starcoinSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinSignMessage' })),
83
+ starcoinSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinSignTransaction' })),
84
+ starcoinVerifyMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'starcoinVerifyMessage' })),
85
+ nemGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nemGetAddress' })),
86
+ nemSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nemSignTransaction' })),
87
+ solGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'solGetAddress' })),
88
+ solSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'solSignTransaction' })),
89
+ stellarGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'stellarGetAddress' })),
90
+ stellarSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'stellarSignTransaction' })),
91
+ firmwareUpdate: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'firmwareUpdate' })),
92
+ firmwareUpdateV2: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'firmwareUpdateV2' })),
93
+ requestWebUsbDevice: () => call({ method: 'requestWebUsbDevice' }),
94
+ tronGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'tronGetAddress' })),
95
+ tronSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'tronSignMessage' })),
96
+ tronSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'tronSignTransaction' })),
97
+ confluxGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxGetAddress' })),
98
+ confluxSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxSignMessage' })),
99
+ confluxSignMessageCIP23: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxSignMessageCIP23' })),
100
+ confluxSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'confluxSignTransaction' })),
101
+ nearGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nearGetAddress' })),
102
+ nearSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'nearSignTransaction' })),
103
+ aptosGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosGetAddress' })),
104
+ aptosGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosGetPublicKey' })),
105
+ aptosSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosSignMessage' })),
106
+ aptosSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'aptosSignTransaction' })),
107
+ algoGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'algoGetAddress' })),
108
+ algoSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'algoSignTransaction' })),
109
+ cosmosGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cosmosGetAddress' })),
110
+ cosmosGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cosmosGetPublicKey' })),
111
+ cosmosSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cosmosSignTransaction' })),
112
+ xrpGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'xrpGetAddress' })),
113
+ xrpSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'xrpSignTransaction' })),
114
+ suiGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'suiGetAddress' })),
115
+ suiGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'suiGetPublicKey' })),
116
+ suiSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'suiSignTransaction' })),
117
+ cardanoGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetAddress' })),
118
+ cardanoGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetPublicKey' })),
119
+ cardanoSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoSignTransaction' })),
120
+ cardanoSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoSignMessage' })),
121
+ filecoinGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'filecoinGetAddress' })),
122
+ filecoinSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'filecoinSignTransaction' })),
123
+ polkadotGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'polkadotGetAddress' })),
124
+ polkadotSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'polkadotSignTransaction' })),
125
+ kaspaGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'kaspaGetAddress' })),
126
+ kaspaSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'kaspaSignTransaction' })),
127
+ });
131
128
 
132
- /******************************************************************************
133
- Copyright (c) Microsoft Corporation.
134
-
135
- Permission to use, copy, modify, and/or distribute this software for any
136
- purpose with or without fee is hereby granted.
137
-
138
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
139
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
140
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
141
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
142
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
143
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
144
- PERFORMANCE OF THIS SOFTWARE.
145
- ***************************************************************************** */
146
-
147
- function __rest(s, e) {
148
- var t = {};
149
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
150
- t[p] = s[p];
151
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
152
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
153
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
154
- t[p[i]] = s[p[i]];
155
- }
156
- return t;
157
- }
158
-
159
- function __awaiter(thisArg, _arguments, P, generator) {
160
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
161
- return new (P || (P = Promise))(function (resolve, reject) {
162
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
163
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
164
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
165
- step((generator = generator.apply(thisArg, _arguments || [])).next());
166
- });
167
- }
168
-
169
- function __values(o) {
170
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
171
- if (m) return m.call(o);
172
- if (o && typeof o.length === "number") return {
173
- next: function () {
174
- if (o && i >= o.length) o = void 0;
175
- return { value: o && o[i++], done: !o };
176
- }
177
- };
178
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
179
- }
180
-
181
- function __asyncValues(o) {
182
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
183
- var m = o[Symbol.asyncIterator], i;
184
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
185
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
186
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
187
- }
129
+ const lowLevelInject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, addHardwareGlobalEventListener, }) => {
130
+ const api = Object.assign({ addHardwareGlobalEventListener, removeAllListeners: type => {
131
+ eventEmitter.removeAllListeners(type);
132
+ }, init,
133
+ call,
134
+ dispose,
135
+ uiResponse,
136
+ cancel, emit: () => { } }, createCoreApi(call));
137
+ return api;
138
+ };
188
139
 
189
140
  var events = {exports: {}};
190
141
 
@@ -662,6 +613,88 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
662
613
  }
663
614
  }
664
615
 
616
+ const eventEmitter = new events.exports();
617
+ const topLevelInject = () => {
618
+ let lowLevelApi;
619
+ const call = (params) => {
620
+ if (!lowLevelApi)
621
+ return Promise.resolve(undefined);
622
+ return lowLevelApi.call(params);
623
+ };
624
+ const api = Object.assign(Object.assign({ on: (type, fn) => {
625
+ eventEmitter.on(type, fn);
626
+ }, emit: (eventName, ...args) => {
627
+ eventEmitter.emit(eventName, ...args);
628
+ }, off: (type, fn) => {
629
+ eventEmitter.emit(type, fn);
630
+ }, init: (settings, hardwareLowLeverApi) => {
631
+ var _a;
632
+ lowLevelApi = hardwareLowLeverApi;
633
+ return (_a = lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.init(settings)) !== null && _a !== void 0 ? _a : Promise.resolve(false);
634
+ }, call }, createCoreApi(call)), { removeAllListeners: type => {
635
+ eventEmitter.removeAllListeners(type);
636
+ lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.removeAllListeners(type);
637
+ }, dispose: () => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.dispose(), uiResponse: response => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.uiResponse(response), cancel: (connectId) => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.cancel(connectId) });
638
+ return api;
639
+ };
640
+
641
+ /******************************************************************************
642
+ Copyright (c) Microsoft Corporation.
643
+
644
+ Permission to use, copy, modify, and/or distribute this software for any
645
+ purpose with or without fee is hereby granted.
646
+
647
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
648
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
649
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
650
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
651
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
652
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
653
+ PERFORMANCE OF THIS SOFTWARE.
654
+ ***************************************************************************** */
655
+
656
+ function __rest(s, e) {
657
+ var t = {};
658
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
659
+ t[p] = s[p];
660
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
661
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
662
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
663
+ t[p[i]] = s[p[i]];
664
+ }
665
+ return t;
666
+ }
667
+
668
+ function __awaiter(thisArg, _arguments, P, generator) {
669
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
670
+ return new (P || (P = Promise))(function (resolve, reject) {
671
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
672
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
673
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
674
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
675
+ });
676
+ }
677
+
678
+ function __values(o) {
679
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
680
+ if (m) return m.call(o);
681
+ if (o && typeof o.length === "number") return {
682
+ next: function () {
683
+ if (o && i >= o.length) o = void 0;
684
+ return { value: o && o[i++], done: !o };
685
+ }
686
+ };
687
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
688
+ }
689
+
690
+ function __asyncValues(o) {
691
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
692
+ var m = o[Symbol.asyncIterator], i;
693
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
694
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
695
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
696
+ }
697
+
665
698
  const HD_HARDENED = 0x80000000;
666
699
  const toHardened = (n) => (n | HD_HARDENED) >>> 0;
667
700
  const fromHardened = (n) => (n & ~HD_HARDENED) >>> 0;
@@ -11372,6 +11405,10 @@ const getT1Data = () => ({
11372
11405
  },
11373
11406
  decred: {
11374
11407
  name: 'decred',
11408
+ hex: '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001fffc0007ffffe0000000000000000000fffe0003fffffc0000000000000000007fff0001ffffff0000000000000000003fffc000ffffff8000000000000000001fffe0007fffffc0000000000000000007fff0001ffffff0000000000000000003fff8000ffffff0000000000000000001fffc0007fffff8000000000000000000fffe0003fffffc0000000000000000007fff8001fffffe0000000000000000003fffc000007ffe0000000000000000003fffe000001fff000000000000000000fffff000000fff000000000000000001fffff8000007ff800000000000000003fffffc000003ff80000000000000000ffffffe000001ff80000000000000001fffffff800001ffc0000000000000001fffffffc00000ffc0000000000000003fffffffe00000ffc0000000000000007ffffffff00000ffc0000000000000007ffe0000000000ffc000000000000000fff80000000000ffc000000000000000fff00000000000ffc000000000000001ffe00000000000ffc000000000000001ffc00000000000ffc000000000000001ff800000000001ffc000000000000003ff800000000001ff8000000000000003ff000000000003ff8000000000000003ff000000000007ff8000000000000003ff00000000000fff0000000000000003ff00000000001fff0000000000000003ff00000000007ffe0000000000000003ff00000ffffffffe0000000000000003ff000007fffffffc0000000000000003ff000003fffffff80000000000000003ff800001fffffff80000000000000001ff8000007ffffff00000000000000001ffc000003fffffc00000000000000001ffe000001fffff800000000000000000fff000000fffff000000000000000000fff8000007fffc0000000000000000007ffe000003fffc0000000000000000007fffff8001fffe0000000000000000003fffffc0007fff0000000000000000001fffffe0003fff8000000000000000000ffffff0001fffc000000000000000000ffffff8000fffe0000000000000000003fffffe0007fff8000000000000000001ffffff0003fffc000000000000000000ffffff8000fffe0000000000000000003fffffc0007fff00000000000000000007ffffe0003fff80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
11409
+ },
11410
+ multibit: {
11411
+ name: 'multibit',
11375
11412
  hex: '0ffc07f8e01c7ffe07ff0000000000001ff80ff9e03c7fff83ff8000000000003ff03ff9e03c7fffc0ffc000000000007fe07ff9e03c7fffe0ffc000000000007fc0fff9e03c7ffff07fe00000000000ffc1fff9e03c7ffff83ff00000000000ff83ff81e03c7ffffc1ff00000000000ff07e001e03c17fffe0ff80000000000fe0f0001e03c03ffff0ffc0000000000fe1f0001e03c00ffff87fc0000000000fc1f1fffffff803fff83fe0000000000f83f1ffffffffc0fffc3fe0000000000f87f1fffffffff07ffe1fe0000000000f07f1fffffffffc3ffe1ff0000000000f0ff00fff87fffe3fff0ff0000000000e0ff003fe001fff1fff0ff8000000000e0ff801fe0007ff1fff87f8000000000e1fffe1fe0003ff9fff87f8000000000c3ffff1fe0f81ff8fff87f8000000000c3ffff1fe1fc0ff8fffc3fc000000000c3ffff1fe1fe0ff8fffc3fc00000000087ffff1fe1fe0ff8fffc1fc00000000087ffff1fe1ff0ff8fffe1fc00000000087ffff1fe1fe0ff8fffe1fe00000000087ffff1fe0fc0ff1fffe1fe0000000008fffff1fe0f01ff1fffe1fe0000000000fffff1fe0003fe3fffe1fe0000000000fffff1fe0007fc3ffff0fe0000000000fffff1fe001ff87ffff0fe0000000000fffff1ffffffe07ffff0fe0000000000fffff1ffffffe03ffff0fe0000000000fffff1fffffffe0ffff0fe0000000000fffff1ffffffff87fff0fe0000000000fffff1e3f8c03fc7fff0fe0000000000fffff1e3f0c00fe3fff0fe0000000000fffff1e3f8c007f3fff0fe0000000000fffff1e3f8c003f1fff0fe0000000000fffff1e3f8c7c3f1fff0fe0000000000fffff1e3f8c7e1f9ffe1fe00000000087ffff1e000c7e1f9ffe1fe00000000087ffff1e000c7e1f9ffe1fe00000000087ffff1e000c7e1f9ffe1fc00000000087ffff1e1f0c7e1f9ffe1fc000000000c3ffff1e3f8c7e1f1ffc3fc000000000c3ffff1e3f8c7e1f1ffc3fc000000000c3ffff1e3f8c7c3f1ff83fc000000000e1ffe01e3f8c003f3ff87f8000000000e1ffc01e3f08007e3ff07f8000000000e0ffc03e3f0801fc7ff07f8000000000f0ff8ffffffffffc7ff0ff0000000000f0ff8ffffffffff0ffe0ff0000000000f87f8fffffffffe1ffe1ff0000000000f83f8fffffffff83ffc3fe0000000000fc3f8fffffffe007ff83fe0000000000fe1f8001e03c001fff87fc0000000000fe0f8001e03c007fff07fc0000000000ff07c001e03c07fffe0ff80000000000ff83fff9e03c7ffffc1ff80000000000ff83fff9e03c7ffff83ff000000000007fc1fff9e03c7ffff03fe000000000007fe07ff9e03c7fffe07fe000000000003ff03ff9e03c7fffc0ffc000000000001ff81ff9e03c7fff81ff8000000000000ffc0ff9e03c7ffe03ff000000000000',
11376
11413
  },
11377
11414
  reddit: {
@@ -12792,9 +12829,6 @@ class BaseMethod {
12792
12829
  checkSafetyLevelOnTestNet() {
12793
12830
  var _a, _b, _c;
12794
12831
  return __awaiter(this, void 0, void 0, function* () {
12795
- const deviceType = getDeviceType(this.device.features);
12796
- if (deviceType !== 'touch')
12797
- return;
12798
12832
  let checkFlag = false;
12799
12833
  if (this.name === 'evmSignTransaction' &&
12800
12834
  [3, 4, 5, 42].includes(Number((_b = (_a = this.payload) === null || _a === void 0 ? void 0 : _a.transaction) === null || _b === void 0 ? void 0 : _b.chainId))) {
@@ -19654,7 +19688,7 @@ const cleanup = () => {
19654
19688
  };
19655
19689
  const removeDeviceListener = (device) => {
19656
19690
  device.removeAllListeners();
19657
- DevicePool.emitter.removeListener(DEVICE.CONNECT, onDeviceConnectHandler);
19691
+ DevicePool.emitter.removeAllListeners(DEVICE.CONNECT);
19658
19692
  };
19659
19693
  const closePopup = () => {
19660
19694
  postMessage(createUiMessage(UI_REQUEST$1.CLOSE_UI_WINDOW));
@@ -19812,6 +19846,16 @@ const HardwareSdk = ({ init, call, dispose, eventEmitter, uiResponse, cancel, })
19812
19846
  uiResponse,
19813
19847
  cancel,
19814
19848
  });
19849
+ const HardwareSDKLowLevel = ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, }) => lowLevelInject({
19850
+ init,
19851
+ call,
19852
+ dispose,
19853
+ eventEmitter,
19854
+ addHardwareGlobalEventListener,
19855
+ uiResponse,
19856
+ cancel,
19857
+ });
19858
+ const HardwareTopLevelSdk = () => topLevelInject();
19815
19859
 
19816
19860
  Object.defineProperty(exports, 'PROTO', {
19817
19861
  enumerable: true,
@@ -19825,6 +19869,8 @@ exports.DEVICE_EVENT = DEVICE_EVENT;
19825
19869
  exports.DataManager = DataManager;
19826
19870
  exports.FIRMWARE = FIRMWARE;
19827
19871
  exports.FIRMWARE_EVENT = FIRMWARE_EVENT;
19872
+ exports.HardwareSDKLowLevel = HardwareSDKLowLevel;
19873
+ exports.HardwareTopLevelSdk = HardwareTopLevelSdk;
19828
19874
  exports.IFRAME = IFRAME;
19829
19875
  exports.LOG = LOG;
19830
19876
  exports.LOG_EVENT = LOG_EVENT;
package/dist/inject.d.ts CHANGED
@@ -11,4 +11,5 @@ export interface InjectApi {
11
11
  cancel: CoreApi['cancel'];
12
12
  }
13
13
  export declare const inject: ({ call, cancel, dispose, eventEmitter, init, uiResponse, }: InjectApi) => CoreApi;
14
+ export declare const createCoreApi: (call: CoreApi['call']) => Omit<CoreApi, 'on' | 'off' | 'emit' | 'removeAllListeners' | 'init' | 'call' | 'dispose' | 'uiResponse' | 'cancel'>;
14
15
  //# sourceMappingURL=inject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,+DAOhB,SAAS,KAAG,OA2Nd,CAAC"}
1
+ {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,+DAOhB,SAAS,KAAG,OA6Bd,CAAC;AAEF,eAAO,MAAM,aAAa,SAClB,OAAO,CAAC,MAAM,CAAC,KACpB,KACD,OAAO,EACL,IAAI,GACJ,KAAK,GACL,MAAM,GACN,oBAAoB,GACpB,MAAM,GACN,MAAM,GACN,SAAS,GACT,YAAY,GACZ,QAAQ,CA+LV,CAAC"}
@@ -0,0 +1,20 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import { CallMethod, CoreMessage } from './events';
4
+ import { CoreApi } from './types/api';
5
+ declare type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
6
+ export interface LowLevelInjectApi {
7
+ call: CallMethod;
8
+ eventEmitter: EventEmitter;
9
+ init: CoreApi['init'];
10
+ dispose: CoreApi['dispose'];
11
+ uiResponse: CoreApi['uiResponse'];
12
+ cancel: CoreApi['cancel'];
13
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
14
+ }
15
+ export declare type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
16
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
17
+ };
18
+ export declare const lowLevelInject: ({ call, cancel, dispose, eventEmitter, init, uiResponse, addHardwareGlobalEventListener, }: LowLevelInjectApi) => LowLevelCoreApi;
19
+ export {};
20
+ //# sourceMappingURL=lowLevelInject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lowLevelInject.d.ts","sourceRoot":"","sources":["../src/lowLevelInject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,aAAK,+BAA+B,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,8BAA8B,EAAE,CAAC,QAAQ,EAAE,+BAA+B,KAAK,IAAI,CAAC;CACrF;AAED,oBAAY,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,KAAK,CAAC,GAAG;IAC1D,8BAA8B,EAAE,CAAC,QAAQ,EAAE,+BAA+B,KAAK,IAAI,CAAC;CACrF,CAAC;AAEF,eAAO,MAAM,cAAc,+FAQxB,iBAAiB,KAAG,eAsBtB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { CoreApi } from './types/api';
2
+ export interface TopLevelInjectApi {
3
+ init: CoreApi['init'];
4
+ call: CoreApi['call'];
5
+ }
6
+ export declare const topLevelInject: () => CoreApi;
7
+ //# sourceMappingURL=topLevelInject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topLevelInject.d.ts","sourceRoot":"","sources":["../src/topLevelInject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACvB;AAID,eAAO,MAAM,cAAc,eAyC1B,CAAC"}