@ledgerhq/swift-bridge-hw-transport-ble 1.2.4 → 1.2.5-next.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +7 -0
- package/lib/TransportBLESwift.d.ts +1 -0
- package/lib/TransportBLESwift.d.ts.map +1 -1
- package/lib/TransportBLESwift.js +7 -14
- package/lib/TransportBLESwift.js.map +1 -1
- package/lib-es/TransportBLESwift.d.ts +1 -0
- package/lib-es/TransportBLESwift.d.ts.map +1 -1
- package/lib-es/TransportBLESwift.js +7 -14
- package/lib-es/TransportBLESwift.js.map +1 -1
- package/package.json +5 -4
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransportBLESwift.d.ts","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransportBLESwift.d.ts","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":";;AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS;IACtD;;OAEG;IACH,OAAO,CAAC,SAAS,CAAqB;;IAOtC;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM7C,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAY3C,aAAa,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM;CAG7C;AAED,KAAK,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAEzE,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,QAAQ,CAAC;IAClC,MAAM,EAAE,MAAM,kBAAkB,CAAC;CAClC,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,cAAc,EAAE,kBAAkB,CAAC;CAC1C"}
|
package/lib/TransportBLESwift.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -17,6 +8,10 @@ const hw_transport_1 = __importDefault(require("@ledgerhq/hw-transport"));
|
|
|
17
8
|
* iOS Bluetooth Transport implementation
|
|
18
9
|
*/
|
|
19
10
|
class TransportBLESwift extends hw_transport_1.default {
|
|
11
|
+
/**
|
|
12
|
+
* SwiftTransport lives in the `global` scope and gets injected by the Swift Native Module
|
|
13
|
+
*/
|
|
14
|
+
transport;
|
|
20
15
|
constructor() {
|
|
21
16
|
super();
|
|
22
17
|
this.transport = SwiftTransport.create();
|
|
@@ -24,11 +19,9 @@ class TransportBLESwift extends hw_transport_1.default {
|
|
|
24
19
|
/**
|
|
25
20
|
* communicate with a BLE transport
|
|
26
21
|
*/
|
|
27
|
-
exchange(apdu) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return Buffer.from(response);
|
|
31
|
-
});
|
|
22
|
+
async exchange(apdu) {
|
|
23
|
+
const response = await this.promisify(this.transport.exchange(apdu));
|
|
24
|
+
return Buffer.from(response);
|
|
32
25
|
}
|
|
33
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
27
|
promisify(callback) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransportBLESwift.js","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransportBLESwift.js","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":";;;;;AAAA,0EAA+C;AAE/C;;GAEG;AACH,MAAqB,iBAAkB,SAAQ,sBAAS;IACtD;;OAEG;IACK,SAAS,CAAqB;IAEtC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED,8DAA8D;IAC9D,SAAS,CAAC,QAAkB;QAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,QAAQ,CAAC,UAAU,QAAQ,EAAE,KAAK;gBAChC,IAAI,QAAQ,EAAE,CAAC;oBACb,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACpB,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,SAAqB;QACjC,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;CACF;AAnCD,oCAmCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransportBLESwift.d.ts","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransportBLESwift.d.ts","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":";;AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS;IACtD;;OAEG;IACH,OAAO,CAAC,SAAS,CAAqB;;IAOtC;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM7C,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAY3C,aAAa,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM;CAG7C;AAED,KAAK,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAEzE,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,QAAQ,CAAC;IAClC,MAAM,EAAE,MAAM,kBAAkB,CAAC;CAClC,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,cAAc,EAAE,kBAAkB,CAAC;CAC1C"}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import Transport from "@ledgerhq/hw-transport";
|
|
11
2
|
/**
|
|
12
3
|
* iOS Bluetooth Transport implementation
|
|
13
4
|
*/
|
|
14
5
|
export default class TransportBLESwift extends Transport {
|
|
6
|
+
/**
|
|
7
|
+
* SwiftTransport lives in the `global` scope and gets injected by the Swift Native Module
|
|
8
|
+
*/
|
|
9
|
+
transport;
|
|
15
10
|
constructor() {
|
|
16
11
|
super();
|
|
17
12
|
this.transport = SwiftTransport.create();
|
|
@@ -19,11 +14,9 @@ export default class TransportBLESwift extends Transport {
|
|
|
19
14
|
/**
|
|
20
15
|
* communicate with a BLE transport
|
|
21
16
|
*/
|
|
22
|
-
exchange(apdu) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return Buffer.from(response);
|
|
26
|
-
});
|
|
17
|
+
async exchange(apdu) {
|
|
18
|
+
const response = await this.promisify(this.transport.exchange(apdu));
|
|
19
|
+
return Buffer.from(response);
|
|
27
20
|
}
|
|
28
21
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
22
|
promisify(callback) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransportBLESwift.js","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransportBLESwift.js","sourceRoot":"","sources":["../src/TransportBLESwift.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS;IACtD;;OAEG;IACK,SAAS,CAAqB;IAEtC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED,8DAA8D;IAC9D,SAAS,CAAC,QAAkB;QAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,QAAQ,CAAC,UAAU,QAAQ,EAAE,KAAK;gBAChC,IAAI,QAAQ,EAAE,CAAC;oBACb,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACpB,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,SAAqB;QACjC,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/swift-bridge-hw-transport-ble",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5-next.0",
|
|
4
4
|
"description": "Package to expose the Swift BLE transport to JS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"types": "lib/TransportBLESwift.d.ts",
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ledgerhq/hw-transport": "^6.31.
|
|
31
|
+
"@ledgerhq/hw-transport": "^6.31.5-next.0"
|
|
32
32
|
},
|
|
33
33
|
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "^29.5.10",
|
|
36
|
-
"@types/node": "^
|
|
36
|
+
"@types/node": "^22.10.10",
|
|
37
37
|
"documentation": "14.0.2",
|
|
38
38
|
"jest": "^29.7.0",
|
|
39
39
|
"rimraf": "^4.4.1",
|
|
@@ -43,9 +43,10 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"clean": "rimraf lib lib-es",
|
|
46
|
-
"build": "tsc && tsc -m
|
|
46
|
+
"build": "tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es",
|
|
47
47
|
"prewatch": "pnpm build",
|
|
48
48
|
"watch": "tsc --watch",
|
|
49
|
+
"watch:es": "tsc --watch -m esnext --moduleResolution bundler --outDir lib-es",
|
|
49
50
|
"doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts",
|
|
50
51
|
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
|
|
51
52
|
"lint:fix": "pnpm lint --fix",
|