@ledgerhq/device-transport-kit-react-native-hid 0.0.0-rn-hid-improvements-20250522101701 → 0.0.0-rn-hid-improvements-20250522140114

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.
@@ -22,6 +22,7 @@ import com.ledger.devicesdk.shared.internal.connection.InternalConnectedDevice
22
22
  import com.ledger.devicesdk.shared.internal.connection.InternalConnectionResult
23
23
  import com.ledger.devicesdk.shared.internal.event.SdkEventDispatcher
24
24
  import com.ledger.devicesdk.shared.internal.service.logger.LoggerService
25
+ import com.ledger.devicesdk.shared.internal.service.logger.buildSimpleDebugLogInfo
25
26
  import com.ledger.devicesdk.shared.internal.transport.TransportEvent
26
27
  import kotlinx.coroutines.CoroutineScope
27
28
  import kotlinx.coroutines.Dispatchers
@@ -49,7 +50,7 @@ class TransportHidModule(
49
50
  private val loggerService: LoggerService =
50
51
  LoggerService { info ->
51
52
  Timber.tag("LDMKTransportHIDModule " + info.tag).d(info.message)
52
- sendEvent(reactContext, BridgeEvents.TransportLog(info))
53
+ // sendEvent(reactContext, BridgeEvents.TransportLog(info))
53
54
  }
54
55
 
55
56
  private val transport: AndroidUsbTransport? by lazy {
@@ -214,6 +215,22 @@ class TransportHidModule(
214
215
  abortTimeout: Int,
215
216
  promise: Promise
216
217
  ) {
218
+ // Log PERF: "Timestamp of the start of the function"
219
+ loggerService.log(
220
+ buildSimpleDebugLogInfo(
221
+ "AndroidUsbTransport",
222
+ "PERF: [@ReactMethod sendApdu] called at ${System.currentTimeMillis()}",
223
+ )
224
+ )
225
+ fun logEnd() = run {
226
+ loggerService.log(
227
+ buildSimpleDebugLogInfo(
228
+ "AndroidUsbTransport",
229
+ "PERF: [@ReactMethod sendApdu] finished at ${System.currentTimeMillis()}",
230
+ )
231
+ )
232
+ }
233
+
217
234
  try {
218
235
  val device = connectedDevices.firstOrNull() { it.id == sessionId }
219
236
  if (device == null) {
@@ -226,14 +243,17 @@ class TransportHidModule(
226
243
  val abortTimeoutDuration = if (abortTimeout <= 0) Duration.INFINITE else abortTimeout.milliseconds
227
244
  val res =
228
245
  device.sendApduFn(apdu, triggersDisconnection, abortTimeoutDuration)
246
+ logEnd()
229
247
  promise.resolve(res.toWritableMap())
230
248
  } catch (e: Exception) {
231
249
  Timber.i("$e, ${e.cause}")
250
+ logEnd()
232
251
  promise.reject(e)
233
252
  }
234
253
  }
235
254
  } catch (e: Exception) {
236
255
  Timber.i("$e, ${e.cause}")
256
+ logEnd()
237
257
  promise.reject(e)
238
258
  }
239
259
  }
@@ -18,6 +18,7 @@ import com.ledger.devicesdk.shared.androidMainInternal.transport.deviceconnectio
18
18
  import com.ledger.devicesdk.shared.api.apdu.SendApduFailureReason
19
19
  import com.ledger.devicesdk.shared.api.apdu.SendApduResult
20
20
  import com.ledger.devicesdk.shared.internal.service.logger.LoggerService
21
+ import com.ledger.devicesdk.shared.internal.service.logger.buildSimpleDebugLogInfo
21
22
  import com.ledger.devicesdk.shared.internal.service.logger.buildSimpleErrorLogInfo
22
23
  import com.ledger.devicesdk.shared.internal.transport.framer.FramerService
23
24
  import com.ledger.devicesdk.shared.internal.transport.framer.to2BytesArray
@@ -61,8 +62,9 @@ internal class AndroidUsbApduSender(
61
62
  usbConnection.close()
62
63
  }
63
64
 
64
- override suspend fun send(apdu: ByteArray, abortTimeoutDuration: Duration): SendApduResult =
65
- try {
65
+ override suspend fun send(apdu: ByteArray, abortTimeoutDuration: Duration): SendApduResult {
66
+ val t1 = System.currentTimeMillis()
67
+ return try {
66
68
  withContext(context = ioDispatcher) {
67
69
 
68
70
  val timeoutJob = launch {
@@ -108,13 +110,18 @@ internal class AndroidUsbApduSender(
108
110
  } catch (e: Exception) {
109
111
  loggerService.log(buildSimpleErrorLogInfo("AndroidUsbApduSender", "error in send: $e"))
110
112
  SendApduResult.Failure(reason = SendApduFailureReason.Unknown)
113
+ } finally {
114
+ val t2 = System.currentTimeMillis()
115
+ loggerService.log(buildSimpleDebugLogInfo("AndroidUsbApduSender", "PERF: [native sendApdu total]: ${t2 - t1}"))
111
116
  }
117
+ }
112
118
 
113
119
  private fun transmitApdu(
114
120
  usbConnection: UsbDeviceConnection,
115
121
  androidToUsbEndpoint: UsbEndpoint,
116
122
  rawApdu: ByteArray,
117
123
  ) {
124
+ val t1 = System.currentTimeMillis()
118
125
  framerService.serialize(mtu = USB_MTU, channelId = generateChannelId(), rawApdu = rawApdu)
119
126
  .forEach { apduFrame ->
120
127
  val buffer = apduFrame.toByteArray()
@@ -125,6 +132,8 @@ internal class AndroidUsbApduSender(
125
132
  USB_TIMEOUT
126
133
  )
127
134
  }
135
+ val t2 = System.currentTimeMillis()
136
+ loggerService.log(buildSimpleDebugLogInfo("AndroidUsbApduSender", "PERF: [transmitApdu]: ${t2 - t1}"))
128
137
  }
129
138
 
130
139
  private fun receiveApdu(
@@ -135,6 +144,7 @@ internal class AndroidUsbApduSender(
135
144
  request.close()
136
145
  byteArrayOf()
137
146
  } else {
147
+ val t1 = System.currentTimeMillis()
138
148
  val frames = framerService.createApduFrames(mtu = USB_MTU, isUsbTransport = true) {
139
149
  val buffer = ByteArray(USB_MTU)
140
150
  val responseBuffer = ByteBuffer.allocate(USB_MTU)
@@ -150,7 +160,10 @@ internal class AndroidUsbApduSender(
150
160
  buffer
151
161
  }
152
162
  }
153
- framerService.deserialize(mtu = USB_MTU, frames)
163
+ val result = framerService.deserialize(mtu = USB_MTU, frames)
164
+ val t2 = System.currentTimeMillis()
165
+ loggerService.log(buildSimpleDebugLogInfo("AndroidUsbApduSender", "PERF: [receiveApdu]: ${t2 - t1}"))
166
+ result
154
167
  }
155
168
  }
156
169
 
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var m=(i,e)=>{for(var n in e)d(i,n,{get:e[n],enumerable:!0})},E=(i,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!D.call(i,t)&&t!==n&&d(i,t,{get:()=>e[t],enumerable:!(o=l(e,t))||o.enumerable});return i};var y=i=>E(d({},"__esModule",{value:!0}),i);var T={};m(T,{DefaultNativeModuleWrapper:()=>M});module.exports=y(T);var c=require("react-native"),v=require("rxjs"),u=require("../helpers/base64Utils"),r=require("./mapper"),a=require("./types");class M{_nativeModule;_deviceModelDataSource;constructor(e){this._nativeModule=e.nativeModule,this._deviceModelDataSource=e.deviceModelDataSource}startScan(){return this._nativeModule.startScan()}stopScan(){return this._nativeModule.stopScan()}subscribeToDiscoveredDevicesEvents(){return new v.Observable(e=>{const o=new c.NativeEventEmitter(this._nativeModule).addListener(a.DISCOVERED_DEVICES_EVENT,t=>{e.next(t.map(s=>(0,r.mapNativeDiscoveryDeviceToTransportDiscoveredDevice)(s,this._deviceModelDataSource)).filter(s=>s!==null))});return()=>{o.remove()}})}subscribeToDeviceDisconnectedEvents(){return new v.Observable(e=>{const o=new c.NativeEventEmitter(this._nativeModule).addListener(a.DEVICE_DISCONNECTED_EVENT,t=>{e.next((0,r.mapNativeDeviceConnectionLostToDeviceDisconnected)(t))});return()=>{o.remove()}})}subscribeToTransportLogs(){return new v.Observable(e=>{const o=new c.NativeEventEmitter(this._nativeModule).addListener(a.TRANSPORT_LOG_EVENT,t=>{e.next((0,r.mapNativeTransportLogToLog)(t))});return()=>{o.remove()}})}async connectDevice(e){const n=await this._nativeModule.connectDevice(e);return(0,r.mapNativeConnectionResultToConnectionResult)(n,this._deviceModelDataSource)}async disconnectDevice(e){return this._nativeModule.disconnectDevice(e)}async sendApdu(e,n,o,t){const s=await this._nativeModule.sendApdu(e,(0,u.uint8ArrayToBase64)(n),o,t);return(0,r.mapNativeSendApduResultToSendApduResult)(s)}}0&&(module.exports={DefaultNativeModuleWrapper});
1
+ "use strict";var v=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var S=(i,e)=>{for(var o in e)v(i,o,{get:e[o],enumerable:!0})},A=(i,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of T(e))!y.call(i,t)&&t!==o&&v(i,t,{get:()=>e[t],enumerable:!(n=M(e,t))||n.enumerable});return i};var N=i=>A(v({},"__esModule",{value:!0}),i);var P={};S(P,{DefaultNativeModuleWrapper:()=>R});module.exports=N(P);var c=require("react-native"),d=require("rxjs"),D=require("../helpers/base64Utils"),r=require("./mapper"),s=require("./types");class R{_nativeModule;_deviceModelDataSource;constructor(e){this._nativeModule=e.nativeModule,this._deviceModelDataSource=e.deviceModelDataSource}startScan(){return this._nativeModule.startScan()}stopScan(){return this._nativeModule.stopScan()}subscribeToDiscoveredDevicesEvents(){return new d.Observable(e=>{const n=new c.NativeEventEmitter(this._nativeModule).addListener(s.DISCOVERED_DEVICES_EVENT,t=>{e.next(t.map(a=>(0,r.mapNativeDiscoveryDeviceToTransportDiscoveredDevice)(a,this._deviceModelDataSource)).filter(a=>a!==null))});return()=>{n.remove()}})}subscribeToDeviceDisconnectedEvents(){return new d.Observable(e=>{const n=new c.NativeEventEmitter(this._nativeModule).addListener(s.DEVICE_DISCONNECTED_EVENT,t=>{e.next((0,r.mapNativeDeviceConnectionLostToDeviceDisconnected)(t))});return()=>{n.remove()}})}subscribeToTransportLogs(){return new d.Observable(e=>{const n=new c.NativeEventEmitter(this._nativeModule).addListener(s.TRANSPORT_LOG_EVENT,t=>{e.next((0,r.mapNativeTransportLogToLog)(t))});return()=>{n.remove()}})}async connectDevice(e){const o=await this._nativeModule.connectDevice(e);return(0,r.mapNativeConnectionResultToConnectionResult)(o,this._deviceModelDataSource)}async disconnectDevice(e){return this._nativeModule.disconnectDevice(e)}async sendApdu(e,o,n,t){console.log("______ PERF: _____ SEND APDU CALLED _____"),console.log("PERF: sendApdu START at ",Date.now());const a=performance.now(),m=(0,D.uint8ArrayToBase64)(o),l=performance.now();console.log("PERF: sendApdu serialization",l-a,"ms"),console.log("PERF: sendApdu call to nativeModule at",l);const E=await this._nativeModule.sendApdu(e,m,n,t),u=performance.now();console.log("PERF: sendApdu result from nativeModule at",u);const _=(0,r.mapNativeSendApduResultToSendApduResult)(E),p=performance.now();return console.log("PERF: sendApdu deserialization",p-u,"ms"),console.log("PERF: TS sendApdu total",p-a,"ms"),console.log("PERF: sendApdu END at ",Date.now()),_}}0&&(module.exports={DefaultNativeModuleWrapper});
2
2
  //# sourceMappingURL=DefaultNativeModuleWrapper.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/bridge/DefaultNativeModuleWrapper.ts"],
4
- "sourcesContent": ["import { NativeEventEmitter } from \"react-native\";\nimport {\n type DeviceModelDataSource,\n type LogParams,\n type SendApduResult,\n type TransportDiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\nimport { Observable } from \"rxjs\";\n\nimport { uint8ArrayToBase64 } from \"@api/helpers/base64Utils\";\nimport { type NativeModuleWrapper } from \"@api/transport/NativeModuleWrapper\";\nimport {\n type InternalConnectionResult,\n type InternalDeviceDisconnected,\n} from \"@api/transport/types\";\n\nimport {\n mapNativeConnectionResultToConnectionResult,\n mapNativeDeviceConnectionLostToDeviceDisconnected,\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice,\n mapNativeSendApduResultToSendApduResult,\n mapNativeTransportLogToLog,\n} from \"./mapper\";\nimport {\n DEVICE_DISCONNECTED_EVENT,\n type DeviceDisconnectedEventPayload,\n DISCOVERED_DEVICES_EVENT,\n type DiscoveredDevicesEventPayload,\n type NativeLog,\n TRANSPORT_LOG_EVENT,\n} from \"./types\";\nimport { type NativeTransportModuleType } from \"./types\";\n\nexport class DefaultNativeModuleWrapper implements NativeModuleWrapper {\n private readonly _nativeModule: NativeTransportModuleType;\n private readonly _deviceModelDataSource: DeviceModelDataSource;\n\n constructor(args: {\n nativeModule: NativeTransportModuleType;\n deviceModelDataSource: DeviceModelDataSource;\n }) {\n this._nativeModule = args.nativeModule;\n this._deviceModelDataSource = args.deviceModelDataSource;\n }\n\n startScan() {\n return this._nativeModule.startScan();\n }\n\n stopScan() {\n return this._nativeModule.stopScan();\n }\n\n subscribeToDiscoveredDevicesEvents(): Observable<\n Array<TransportDiscoveredDevice>\n > {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DISCOVERED_DEVICES_EVENT,\n (discoveredDevices: DiscoveredDevicesEventPayload) => {\n subscriber.next(\n discoveredDevices\n .map((device) =>\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice(\n device,\n this._deviceModelDataSource,\n ),\n )\n .filter((d) => d !== null),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToDeviceDisconnectedEvents(): Observable<InternalDeviceDisconnected> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DEVICE_DISCONNECTED_EVENT,\n (device: DeviceDisconnectedEventPayload) => {\n subscriber.next(\n mapNativeDeviceConnectionLostToDeviceDisconnected(device),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToTransportLogs(): Observable<LogParams> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n TRANSPORT_LOG_EVENT,\n (logParams: NativeLog) => {\n subscriber.next(mapNativeTransportLogToLog(logParams));\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n async connectDevice(uid: string): Promise<InternalConnectionResult> {\n const nConnectionResult = await this._nativeModule.connectDevice(uid);\n return mapNativeConnectionResultToConnectionResult(\n nConnectionResult,\n this._deviceModelDataSource,\n );\n }\n\n async disconnectDevice(sessionId: string): Promise<void> {\n return this._nativeModule.disconnectDevice(sessionId);\n }\n\n async sendApdu(\n sessionId: string,\n apdu: Uint8Array,\n triggersDisconnection: boolean,\n abortTimeout: number,\n ): Promise<SendApduResult> {\n const nSendApduResult = await this._nativeModule.sendApdu(\n sessionId,\n uint8ArrayToBase64(apdu),\n triggersDisconnection,\n abortTimeout,\n );\n return mapNativeSendApduResultToSendApduResult(nSendApduResult);\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,wBAOnCC,EAA2B,gBAE3BC,EAAmC,oCAOnCC,EAMO,oBACPC,EAOO,mBAGA,MAAMN,CAA0D,CACpD,cACA,uBAEjB,YAAYO,EAGT,CACD,KAAK,cAAgBA,EAAK,aAC1B,KAAK,uBAAyBA,EAAK,qBACrC,CAEA,WAAY,CACV,OAAO,KAAK,cAAc,UAAU,CACtC,CAEA,UAAW,CACT,OAAO,KAAK,cAAc,SAAS,CACrC,CAEA,oCAEE,CACA,OAAO,IAAI,aAAYC,GAAe,CAEpC,MAAMC,EADe,IAAI,qBAAmB,KAAK,aAAa,EAC3B,YACjC,2BACCC,GAAqD,CACpDF,EAAW,KACTE,EACG,IAAKC,MACJ,uDACEA,EACA,KAAK,sBACP,CACF,EACC,OAAQC,GAAMA,IAAM,IAAI,CAC7B,CACF,CACF,EAEA,MAAO,IAAM,CACXH,EAAc,OAAO,CACvB,CACF,CAAC,CACH,CAEA,qCAA8E,CAC5E,OAAO,IAAI,aAAYD,GAAe,CAEpC,MAAMC,EADe,IAAI,qBAAmB,KAAK,aAAa,EAC3B,YACjC,4BACCE,GAA2C,CAC1CH,EAAW,QACT,qDAAkDG,CAAM,CAC1D,CACF,CACF,EAEA,MAAO,IAAM,CACXF,EAAc,OAAO,CACvB,CACF,CAAC,CACH,CAEA,0BAAkD,CAChD,OAAO,IAAI,aAAYD,GAAe,CAEpC,MAAMC,EADe,IAAI,qBAAmB,KAAK,aAAa,EAC3B,YACjC,sBACCI,GAAyB,CACxBL,EAAW,QAAK,8BAA2BK,CAAS,CAAC,CACvD,CACF,EAEA,MAAO,IAAM,CACXJ,EAAc,OAAO,CACvB,CACF,CAAC,CACH,CAEA,MAAM,cAAcK,EAAgD,CAClE,MAAMC,EAAoB,MAAM,KAAK,cAAc,cAAcD,CAAG,EACpE,SAAO,+CACLC,EACA,KAAK,sBACP,CACF,CAEA,MAAM,iBAAiBC,EAAkC,CACvD,OAAO,KAAK,cAAc,iBAAiBA,CAAS,CACtD,CAEA,MAAM,SACJA,EACAC,EACAC,EACAC,EACyB,CACzB,MAAMC,EAAkB,MAAM,KAAK,cAAc,SAC/CJ,KACA,sBAAmBC,CAAI,EACvBC,EACAC,CACF,EACA,SAAO,2CAAwCC,CAAe,CAChE,CACF",
6
- "names": ["DefaultNativeModuleWrapper_exports", "__export", "DefaultNativeModuleWrapper", "__toCommonJS", "import_react_native", "import_rxjs", "import_base64Utils", "import_mapper", "import_types", "args", "subscriber", "eventListener", "discoveredDevices", "device", "d", "logParams", "uid", "nConnectionResult", "sessionId", "apdu", "triggersDisconnection", "abortTimeout", "nSendApduResult"]
4
+ "sourcesContent": ["import { NativeEventEmitter } from \"react-native\";\nimport {\n type DeviceModelDataSource,\n type LogParams,\n type SendApduResult,\n type TransportDiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\nimport { Observable } from \"rxjs\";\n\nimport { uint8ArrayToBase64 } from \"@api/helpers/base64Utils\";\nimport { type NativeModuleWrapper } from \"@api/transport/NativeModuleWrapper\";\nimport {\n type InternalConnectionResult,\n type InternalDeviceDisconnected,\n} from \"@api/transport/types\";\n\nimport {\n mapNativeConnectionResultToConnectionResult,\n mapNativeDeviceConnectionLostToDeviceDisconnected,\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice,\n mapNativeSendApduResultToSendApduResult,\n mapNativeTransportLogToLog,\n} from \"./mapper\";\nimport {\n DEVICE_DISCONNECTED_EVENT,\n type DeviceDisconnectedEventPayload,\n DISCOVERED_DEVICES_EVENT,\n type DiscoveredDevicesEventPayload,\n type NativeLog,\n TRANSPORT_LOG_EVENT,\n} from \"./types\";\nimport { type NativeTransportModuleType } from \"./types\";\n\nexport class DefaultNativeModuleWrapper implements NativeModuleWrapper {\n private readonly _nativeModule: NativeTransportModuleType;\n private readonly _deviceModelDataSource: DeviceModelDataSource;\n\n constructor(args: {\n nativeModule: NativeTransportModuleType;\n deviceModelDataSource: DeviceModelDataSource;\n }) {\n this._nativeModule = args.nativeModule;\n this._deviceModelDataSource = args.deviceModelDataSource;\n }\n\n startScan() {\n return this._nativeModule.startScan();\n }\n\n stopScan() {\n return this._nativeModule.stopScan();\n }\n\n subscribeToDiscoveredDevicesEvents(): Observable<\n Array<TransportDiscoveredDevice>\n > {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DISCOVERED_DEVICES_EVENT,\n (discoveredDevices: DiscoveredDevicesEventPayload) => {\n subscriber.next(\n discoveredDevices\n .map((device) =>\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice(\n device,\n this._deviceModelDataSource,\n ),\n )\n .filter((d) => d !== null),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToDeviceDisconnectedEvents(): Observable<InternalDeviceDisconnected> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DEVICE_DISCONNECTED_EVENT,\n (device: DeviceDisconnectedEventPayload) => {\n subscriber.next(\n mapNativeDeviceConnectionLostToDeviceDisconnected(device),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToTransportLogs(): Observable<LogParams> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n TRANSPORT_LOG_EVENT,\n (logParams: NativeLog) => {\n subscriber.next(mapNativeTransportLogToLog(logParams));\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n async connectDevice(uid: string): Promise<InternalConnectionResult> {\n const nConnectionResult = await this._nativeModule.connectDevice(uid);\n return mapNativeConnectionResultToConnectionResult(\n nConnectionResult,\n this._deviceModelDataSource,\n );\n }\n\n async disconnectDevice(sessionId: string): Promise<void> {\n return this._nativeModule.disconnectDevice(sessionId);\n }\n\n async sendApdu(\n sessionId: string,\n apdu: Uint8Array,\n triggersDisconnection: boolean,\n abortTimeout: number,\n ): Promise<SendApduResult> {\n console.log(\"______ PERF: _____ SEND APDU CALLED _____\");\n console.log(\"PERF: sendApdu START at \", Date.now());\n const t0 = performance.now();\n const serializedApdu = uint8ArrayToBase64(apdu);\n const t1 = performance.now();\n console.log(\"PERF: sendApdu serialization\", t1 - t0, \"ms\");\n console.log(\"PERF: sendApdu call to nativeModule at\", t1);\n const nSendApduResult = await this._nativeModule.sendApdu(\n sessionId,\n serializedApdu,\n triggersDisconnection,\n abortTimeout,\n );\n const t2 = performance.now();\n console.log(\"PERF: sendApdu result from nativeModule at\", t2);\n const result = mapNativeSendApduResultToSendApduResult(nSendApduResult)\n const t3 = performance.now();\n console.log(\"PERF: sendApdu deserialization\", t3 - t2, \"ms\");\n console.log(\"PERF: TS sendApdu total\", t3 - t0, \"ms\");\n console.log(\"PERF: sendApdu END at \", Date.now());\n return result;\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,wBAOnCC,EAA2B,gBAE3BC,EAAmC,oCAOnCC,EAMO,oBACPC,EAOO,mBAGA,MAAMN,CAA0D,CACpD,cACA,uBAEjB,YAAYO,EAGT,CACD,KAAK,cAAgBA,EAAK,aAC1B,KAAK,uBAAyBA,EAAK,qBACrC,CAEA,WAAY,CACV,OAAO,KAAK,cAAc,UAAU,CACtC,CAEA,UAAW,CACT,OAAO,KAAK,cAAc,SAAS,CACrC,CAEA,oCAEE,CACA,OAAO,IAAI,aAAYC,GAAe,CAEpC,MAAMC,EADe,IAAI,qBAAmB,KAAK,aAAa,EAC3B,YACjC,2BACCC,GAAqD,CACpDF,EAAW,KACTE,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AAMC,KAAS,2CAAwCF,CAAe,EAChEG,EAAK,YAAY,IAAI,EAC3B,eAAQ,IAAI,iCAAkCA,EAAKF,EAAI,IAAI,EAC3D,QAAQ,IAAI,0BAA2BE,EAAKN,EAAI,IAAI,EACpD,QAAQ,IAAI,2BAA4B,KAAK,IAAI,CAAC,EAC3CK,CACT,CACF",
6
+ "names": ["DefaultNativeModuleWrapper_exports", "__export", "DefaultNativeModuleWrapper", "__toCommonJS", "import_react_native", "import_rxjs", "import_base64Utils", "import_mapper", "import_types", "args", "subscriber", "eventListener", "discoveredDevices", "device", "d", "logParams", "uid", "nConnectionResult", "sessionId", "apdu", "triggersDisconnection", "abortTimeout", "t0", "serializedApdu", "t1", "nSendApduResult", "t2", "result", "t3"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{NativeEventEmitter as i}from"react-native";import{Observable as a}from"rxjs";import{uint8ArrayToBase64 as s}from"../helpers/base64Utils";import{mapNativeConnectionResultToConnectionResult as c,mapNativeDeviceConnectionLostToDeviceDisconnected as v,mapNativeDiscoveryDeviceToTransportDiscoveredDevice as d,mapNativeSendApduResultToSendApduResult as u,mapNativeTransportLogToLog as l}from"./mapper";import{DEVICE_DISCONNECTED_EVENT as p,DISCOVERED_DEVICES_EVENT as D,TRANSPORT_LOG_EVENT as m}from"./types";class _{_nativeModule;_deviceModelDataSource;constructor(e){this._nativeModule=e.nativeModule,this._deviceModelDataSource=e.deviceModelDataSource}startScan(){return this._nativeModule.startScan()}stopScan(){return this._nativeModule.stopScan()}subscribeToDiscoveredDevicesEvents(){return new a(e=>{const t=new i(this._nativeModule).addListener(D,n=>{e.next(n.map(r=>d(r,this._deviceModelDataSource)).filter(r=>r!==null))});return()=>{t.remove()}})}subscribeToDeviceDisconnectedEvents(){return new a(e=>{const t=new i(this._nativeModule).addListener(p,n=>{e.next(v(n))});return()=>{t.remove()}})}subscribeToTransportLogs(){return new a(e=>{const t=new i(this._nativeModule).addListener(m,n=>{e.next(l(n))});return()=>{t.remove()}})}async connectDevice(e){const o=await this._nativeModule.connectDevice(e);return c(o,this._deviceModelDataSource)}async disconnectDevice(e){return this._nativeModule.disconnectDevice(e)}async sendApdu(e,o,t,n){const r=await this._nativeModule.sendApdu(e,s(o),t,n);return u(r)}}export{_ as DefaultNativeModuleWrapper};
1
+ import{NativeEventEmitter as i}from"react-native";import{Observable as a}from"rxjs";import{uint8ArrayToBase64 as p}from"../helpers/base64Utils";import{mapNativeConnectionResultToConnectionResult as D,mapNativeDeviceConnectionLostToDeviceDisconnected as m,mapNativeDiscoveryDeviceToTransportDiscoveredDevice as E,mapNativeSendApduResultToSendApduResult as _,mapNativeTransportLogToLog as M}from"./mapper";import{DEVICE_DISCONNECTED_EVENT as T,DISCOVERED_DEVICES_EVENT as y,TRANSPORT_LOG_EVENT as S}from"./types";class b{_nativeModule;_deviceModelDataSource;constructor(e){this._nativeModule=e.nativeModule,this._deviceModelDataSource=e.deviceModelDataSource}startScan(){return this._nativeModule.startScan()}stopScan(){return this._nativeModule.stopScan()}subscribeToDiscoveredDevicesEvents(){return new a(e=>{const t=new i(this._nativeModule).addListener(y,o=>{e.next(o.map(r=>E(r,this._deviceModelDataSource)).filter(r=>r!==null))});return()=>{t.remove()}})}subscribeToDeviceDisconnectedEvents(){return new a(e=>{const t=new i(this._nativeModule).addListener(T,o=>{e.next(m(o))});return()=>{t.remove()}})}subscribeToTransportLogs(){return new a(e=>{const t=new i(this._nativeModule).addListener(S,o=>{e.next(M(o))});return()=>{t.remove()}})}async connectDevice(e){const n=await this._nativeModule.connectDevice(e);return D(n,this._deviceModelDataSource)}async disconnectDevice(e){return this._nativeModule.disconnectDevice(e)}async sendApdu(e,n,t,o){console.log("______ PERF: _____ SEND APDU CALLED _____"),console.log("PERF: sendApdu START at ",Date.now());const r=performance.now(),v=p(n),s=performance.now();console.log("PERF: sendApdu serialization",s-r,"ms"),console.log("PERF: sendApdu call to nativeModule at",s);const l=await this._nativeModule.sendApdu(e,v,t,o),c=performance.now();console.log("PERF: sendApdu result from nativeModule at",c);const u=_(l),d=performance.now();return console.log("PERF: sendApdu deserialization",d-c,"ms"),console.log("PERF: TS sendApdu total",d-r,"ms"),console.log("PERF: sendApdu END at ",Date.now()),u}}export{b as DefaultNativeModuleWrapper};
2
2
  //# sourceMappingURL=DefaultNativeModuleWrapper.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/bridge/DefaultNativeModuleWrapper.ts"],
4
- "sourcesContent": ["import { NativeEventEmitter } from \"react-native\";\nimport {\n type DeviceModelDataSource,\n type LogParams,\n type SendApduResult,\n type TransportDiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\nimport { Observable } from \"rxjs\";\n\nimport { uint8ArrayToBase64 } from \"@api/helpers/base64Utils\";\nimport { type NativeModuleWrapper } from \"@api/transport/NativeModuleWrapper\";\nimport {\n type InternalConnectionResult,\n type InternalDeviceDisconnected,\n} from \"@api/transport/types\";\n\nimport {\n mapNativeConnectionResultToConnectionResult,\n mapNativeDeviceConnectionLostToDeviceDisconnected,\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice,\n mapNativeSendApduResultToSendApduResult,\n mapNativeTransportLogToLog,\n} from \"./mapper\";\nimport {\n DEVICE_DISCONNECTED_EVENT,\n type DeviceDisconnectedEventPayload,\n DISCOVERED_DEVICES_EVENT,\n type DiscoveredDevicesEventPayload,\n type NativeLog,\n TRANSPORT_LOG_EVENT,\n} from \"./types\";\nimport { type NativeTransportModuleType } from \"./types\";\n\nexport class DefaultNativeModuleWrapper implements NativeModuleWrapper {\n private readonly _nativeModule: NativeTransportModuleType;\n private readonly _deviceModelDataSource: DeviceModelDataSource;\n\n constructor(args: {\n nativeModule: NativeTransportModuleType;\n deviceModelDataSource: DeviceModelDataSource;\n }) {\n this._nativeModule = args.nativeModule;\n this._deviceModelDataSource = args.deviceModelDataSource;\n }\n\n startScan() {\n return this._nativeModule.startScan();\n }\n\n stopScan() {\n return this._nativeModule.stopScan();\n }\n\n subscribeToDiscoveredDevicesEvents(): Observable<\n Array<TransportDiscoveredDevice>\n > {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DISCOVERED_DEVICES_EVENT,\n (discoveredDevices: DiscoveredDevicesEventPayload) => {\n subscriber.next(\n discoveredDevices\n .map((device) =>\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice(\n device,\n this._deviceModelDataSource,\n ),\n )\n .filter((d) => d !== null),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToDeviceDisconnectedEvents(): Observable<InternalDeviceDisconnected> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DEVICE_DISCONNECTED_EVENT,\n (device: DeviceDisconnectedEventPayload) => {\n subscriber.next(\n mapNativeDeviceConnectionLostToDeviceDisconnected(device),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToTransportLogs(): Observable<LogParams> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n TRANSPORT_LOG_EVENT,\n (logParams: NativeLog) => {\n subscriber.next(mapNativeTransportLogToLog(logParams));\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n async connectDevice(uid: string): Promise<InternalConnectionResult> {\n const nConnectionResult = await this._nativeModule.connectDevice(uid);\n return mapNativeConnectionResultToConnectionResult(\n nConnectionResult,\n this._deviceModelDataSource,\n );\n }\n\n async disconnectDevice(sessionId: string): Promise<void> {\n return this._nativeModule.disconnectDevice(sessionId);\n }\n\n async sendApdu(\n sessionId: string,\n apdu: Uint8Array,\n triggersDisconnection: boolean,\n abortTimeout: number,\n ): Promise<SendApduResult> {\n const nSendApduResult = await this._nativeModule.sendApdu(\n sessionId,\n uint8ArrayToBase64(apdu),\n triggersDisconnection,\n abortTimeout,\n );\n return map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A,MAAM,cAAcK,EAAgD,CAClE,MAAMC,EAAoB,MAAM,KAAK,cAAc,cAAcD,CAAG,EACpE,OAAOhB,EACLiB,EACA,KAAK,sBACP,CACF,CAEA,MAAM,iBAAiBC,EAAkC,CACvD,OAAO,KAAK,cAAc,iBAAiBA,CAAS,CACtD,CAEA,MAAM,SACJA,EACAC,EACAC,EACAC,EACyB,CACzB,MAAMC,EAAkB,MAAM,KAAK,cAAc,SAC/CJ,EACAnB,EAAmBoB,CAAI,EACvBC,EACAC,CACF,EACA,OAAOlB,EAAwCmB,CAAe,CAChE,CACF",
6
- "names": ["NativeEventEmitter", "Observable", "uint8ArrayToBase64", "mapNativeConnectionResultToConnectionResult", "mapNativeDeviceConnectionLostToDeviceDisconnected", "mapNativeDiscoveryDeviceToTransportDiscoveredDevice", "mapNativeSendApduResultToSendApduResult", "mapNativeTransportLogToLog", "DEVICE_DISCONNECTED_EVENT", "DISCOVERED_DEVICES_EVENT", "TRANSPORT_LOG_EVENT", "DefaultNativeModuleWrapper", "args", "subscriber", "eventListener", "discoveredDevices", "device", "d", "logParams", "uid", "nConnectionResult", "sessionId", "apdu", "triggersDisconnection", "abortTimeout", "nSendApduResult"]
4
+ "sourcesContent": ["import { NativeEventEmitter } from \"react-native\";\nimport {\n type DeviceModelDataSource,\n type LogParams,\n type SendApduResult,\n type TransportDiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\nimport { Observable } from \"rxjs\";\n\nimport { uint8ArrayToBase64 } from \"@api/helpers/base64Utils\";\nimport { type NativeModuleWrapper } from \"@api/transport/NativeModuleWrapper\";\nimport {\n type InternalConnectionResult,\n type InternalDeviceDisconnected,\n} from \"@api/transport/types\";\n\nimport {\n mapNativeConnectionResultToConnectionResult,\n mapNativeDeviceConnectionLostToDeviceDisconnected,\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice,\n mapNativeSendApduResultToSendApduResult,\n mapNativeTransportLogToLog,\n} from \"./mapper\";\nimport {\n DEVICE_DISCONNECTED_EVENT,\n type DeviceDisconnectedEventPayload,\n DISCOVERED_DEVICES_EVENT,\n type DiscoveredDevicesEventPayload,\n type NativeLog,\n TRANSPORT_LOG_EVENT,\n} from \"./types\";\nimport { type NativeTransportModuleType } from \"./types\";\n\nexport class DefaultNativeModuleWrapper implements NativeModuleWrapper {\n private readonly _nativeModule: NativeTransportModuleType;\n private readonly _deviceModelDataSource: DeviceModelDataSource;\n\n constructor(args: {\n nativeModule: NativeTransportModuleType;\n deviceModelDataSource: DeviceModelDataSource;\n }) {\n this._nativeModule = args.nativeModule;\n this._deviceModelDataSource = args.deviceModelDataSource;\n }\n\n startScan() {\n return this._nativeModule.startScan();\n }\n\n stopScan() {\n return this._nativeModule.stopScan();\n }\n\n subscribeToDiscoveredDevicesEvents(): Observable<\n Array<TransportDiscoveredDevice>\n > {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DISCOVERED_DEVICES_EVENT,\n (discoveredDevices: DiscoveredDevicesEventPayload) => {\n subscriber.next(\n discoveredDevices\n .map((device) =>\n mapNativeDiscoveryDeviceToTransportDiscoveredDevice(\n device,\n this._deviceModelDataSource,\n ),\n )\n .filter((d) => d !== null),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToDeviceDisconnectedEvents(): Observable<InternalDeviceDisconnected> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n DEVICE_DISCONNECTED_EVENT,\n (device: DeviceDisconnectedEventPayload) => {\n subscriber.next(\n mapNativeDeviceConnectionLostToDeviceDisconnected(device),\n );\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n subscribeToTransportLogs(): Observable<LogParams> {\n return new Observable((subscriber) => {\n const eventEmitter = new NativeEventEmitter(this._nativeModule);\n const eventListener = eventEmitter.addListener(\n TRANSPORT_LOG_EVENT,\n (logParams: NativeLog) => {\n subscriber.next(mapNativeTransportLogToLog(logParams));\n },\n );\n\n return () => {\n eventListener.remove();\n };\n });\n }\n\n async connectDevice(uid: string): Promise<InternalConnectionResult> {\n const nConnectionResult = await this._nativeModule.connectDevice(uid);\n return mapNativeConnectionResultToConnectionResult(\n nConnectionResult,\n this._deviceModelDataSource,\n );\n }\n\n async disconnectDevice(sessionId: string): Promise<void> {\n return this._nativeModule.disconnectDevice(sessionId);\n }\n\n async sendApdu(\n sessionId: string,\n apdu: Uint8Array,\n triggersDisconnection: boolean,\n abortTimeout: number,\n ): Promise<SendApduResult> {\n console.log(\"______ PERF: _____ SEND APDU CALLED _____\");\n console.log(\"PERF: sendApdu START at \", Date.now());\n const t0 = performance.now();\n const serializedApdu = uint8ArrayToBase64(apdu);\n const t1 = performance.now();\n console.log(\"PERF: sendApdu serialization\", t1 - t0, \"ms\");\n console.log(\"PERF: sendApdu call to nativeModule at\", t1);\n const nSendApduResult = await this._nativeModule.sendApdu(\n sessionId,\n serializedApdu,\n triggersDisconnection,\n abortTimeout,\n );\n const t2 = performance.now();\n console.log(\"PERF: sendApdu result from nativeModule at\", t2);\n const result = mapNativeSendApduResultToSendApduResult(nSendApduResult)\n const t3 = performance.now();\n console.log(\"PERF: sendApdu deserialization\", t3 - t2, \"ms\");\n console.log(\"PERF: TS sendApdu total\", t3 - t0, \"ms\");\n console.log(\"PERF: sendApdu END at \", Date.now());\n return result;\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,sBAAAA,MAA0B,eAOnC,OAAS,cAAAC,MAAkB,OAE3B,OAAS,sBAAAC,MAA0B,2BAOnC,OACE,+CAAAC,EACA,qDAAAC,EACA,uDAAAC,EACA,2CAAAC,EACA,8BAAAC,MACK,WACP,OACE,6BAAAC,EAEA,4BAAAC,EAGA,uBAAAC,MACK,UAGA,MAAMC,CAA0D,CACpD,cACA,uBAEjB,YAAYC,EAGT,CACD,KAAK,cAAgBA,EAAK,aAC1B,KAAK,uBAAyBA,EAAK,qBACrC,CAEA,WAAY,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,EAC3B,QAAQ,IAAI,+BAAgCA,EAAKF,EAAI,IAAI,EACzD,QAAQ,IAAI,yCAA0CE,CAAE,EACxD,MAAMC,EAAkB,MAAM,KAAK,cAAc,SAC/CP,EACAK,EACAH,EACAC,CACF,EACMK,EAAK,YAAY,IAAI,EAC3B,QAAQ,IAAI,6CAA8CA,CAAE,EAC5D,MAAMC,EAASxB,EAAwCsB,CAAe,EAChEG,EAAK,YAAY,IAAI,EAC3B,eAAQ,IAAI,iCAAkCA,EAAKF,EAAI,IAAI,EAC3D,QAAQ,IAAI,0BAA2BE,EAAKN,EAAI,IAAI,EACpD,QAAQ,IAAI,2BAA4B,KAAK,IAAI,CAAC,EAC3CK,CACT,CACF",
6
+ "names": ["NativeEventEmitter", "Observable", "uint8ArrayToBase64", "mapNativeConnectionResultToConnectionResult", "mapNativeDeviceConnectionLostToDeviceDisconnected", "mapNativeDiscoveryDeviceToTransportDiscoveredDevice", "mapNativeSendApduResultToSendApduResult", "mapNativeTransportLogToLog", "DEVICE_DISCONNECTED_EVENT", "DISCOVERED_DEVICES_EVENT", "TRANSPORT_LOG_EVENT", "DefaultNativeModuleWrapper", "args", "subscriber", "eventListener", "discoveredDevices", "device", "d", "logParams", "uid", "nConnectionResult", "sessionId", "apdu", "triggersDisconnection", "abortTimeout", "t0", "serializedApdu", "t1", "nSendApduResult", "t2", "result", "t3"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultNativeModuleWrapper.d.ts","sourceRoot":"","sources":["../../../../src/api/bridge/DefaultNativeModuleWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC/B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,KAAK,wBAAwB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