@ledgerhq/hw-app-polkadot 6.32.0 → 6.33.0-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/.unimportedrc.json +2 -1
- package/CHANGELOG.md +6 -0
- package/jest.config.ts +17 -0
- package/lib/Polkadot.d.ts +1 -0
- package/lib/Polkadot.d.ts.map +1 -1
- package/lib/Polkadot.js +27 -39
- package/lib/Polkadot.js.map +1 -1
- package/lib-es/Polkadot.d.ts +1 -0
- package/lib-es/Polkadot.d.ts.map +1 -1
- package/lib-es/Polkadot.js +27 -39
- package/lib-es/Polkadot.js.map +1 -1
- package/package.json +6 -3
package/.turbo/turbo-build.log
CHANGED
package/.unimportedrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ledgerhq/hw-app-polkadot
|
|
2
2
|
|
|
3
|
+
## 6.33.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#9298](https://github.com/LedgerHQ/ledger-live/pull/9298) [`2785d49`](https://github.com/LedgerHQ/ledger-live/commit/2785d49ac320498f98ed39b4eccc48310ad35fe1) Thanks [@Canestin](https://github.com/Canestin)! - config coin-integration env for sonarqube
|
|
8
|
+
|
|
3
9
|
## 6.32.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/jest.config.ts
CHANGED
|
@@ -3,4 +3,21 @@ import baseConfig from "../../jest.config";
|
|
|
3
3
|
export default {
|
|
4
4
|
...baseConfig,
|
|
5
5
|
rootDir: __dirname,
|
|
6
|
+
collectCoverageFrom: [
|
|
7
|
+
"src/**/*.ts",
|
|
8
|
+
"!src/**/*.test.{ts,tsx}",
|
|
9
|
+
"!src/**/*.spec.{ts,tsx}",
|
|
10
|
+
"!src/**/__tests__/**",
|
|
11
|
+
"!tests/**",
|
|
12
|
+
],
|
|
13
|
+
coverageReporters: ["json", ["lcov", { projectRoot: "../" }], "json-summary", "text"],
|
|
14
|
+
reporters: [
|
|
15
|
+
[
|
|
16
|
+
"jest-sonar",
|
|
17
|
+
{
|
|
18
|
+
outputName: "hw-app-polkadot-sonar-executionTests-report.xml",
|
|
19
|
+
reportedFilePath: "absolute",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
],
|
|
6
23
|
};
|
package/lib/Polkadot.d.ts
CHANGED
package/lib/Polkadot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polkadot.d.ts","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Polkadot.d.ts","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AAapD;;;;;;GAMG;AAEH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,SAAS,EAAE,SAAS,CAAC;gBAET,SAAS,EAAE,SAAS;IAKhC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAczD;;;;OAIG;IACG,UAAU,CACd,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,MAAU,EACtB,gBAAgB,UAAQ,GACvB,OAAO,CAAC;QACT,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IAsBF,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IActF;;;;;OAKG;IACG,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CAcH"}
|
package/lib/Polkadot.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
|
};
|
|
@@ -30,6 +21,7 @@ const SW_CANCEL = 0x6986;
|
|
|
30
21
|
* const polkadot = new Polkadot(transport)
|
|
31
22
|
*/
|
|
32
23
|
class Polkadot {
|
|
24
|
+
transport;
|
|
33
25
|
constructor(transport) {
|
|
34
26
|
this.transport = transport;
|
|
35
27
|
transport.decorateAppAPIMethods(this, ["getAddress", "sign"], "DOT");
|
|
@@ -52,25 +44,23 @@ class Polkadot {
|
|
|
52
44
|
* @param {number} ss58prefix
|
|
53
45
|
* @param {boolean} showAddrInDevice - if true, user must valid if the address is correct on the device
|
|
54
46
|
*/
|
|
55
|
-
getAddress(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
});
|
|
47
|
+
async getAddress(path, ss58prefix = 0, showAddrInDevice = false) {
|
|
48
|
+
const CLA = 0xf9;
|
|
49
|
+
const bipPath = bip32_path_1.default.fromString(path).toPathArray();
|
|
50
|
+
const bip44Path = this.serializePath(bipPath, ss58prefix);
|
|
51
|
+
return this.transport
|
|
52
|
+
.send(CLA, INS.GET_ADDR_ED25519, showAddrInDevice ? 1 : 0, 0, bip44Path, [SW_OK, SW_CANCEL])
|
|
53
|
+
.then(response => {
|
|
54
|
+
const errorCodeData = response.slice(-2);
|
|
55
|
+
const returnCode = errorCodeData[0] * 256 + errorCodeData[1];
|
|
56
|
+
if (returnCode === SW_CANCEL) {
|
|
57
|
+
throw new errors_1.UserRefusedAddress();
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
pubKey: response.slice(0, 32).toString("hex"),
|
|
61
|
+
address: response.slice(32, response.length - 2).toString("ascii"),
|
|
62
|
+
return_code: returnCode,
|
|
63
|
+
};
|
|
74
64
|
});
|
|
75
65
|
}
|
|
76
66
|
foreach(arr, callback) {
|
|
@@ -92,17 +82,15 @@ class Polkadot {
|
|
|
92
82
|
* @param {string} message - payload
|
|
93
83
|
* @returns {string} - signed payload to be broadcasted
|
|
94
84
|
*/
|
|
95
|
-
sign(path, message, metadata) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
105
|
-
});
|
|
85
|
+
async sign(path, message, metadata) {
|
|
86
|
+
const app = new ledger_substrate_1.PolkadotGenericApp(this.transport);
|
|
87
|
+
const signatureRequest = await app.signWithMetadata("m/" + path, Buffer.from(message), Buffer.from(metadata.slice(2), "hex"));
|
|
88
|
+
// we need to cast the signature to Buffer explicitly. In react native, the signature from signWithMetadata is not necessarily a Buffer
|
|
89
|
+
signatureRequest.signature = Buffer.from(signatureRequest.signature);
|
|
90
|
+
return {
|
|
91
|
+
signature: signatureRequest.signature.toString("hex"),
|
|
92
|
+
return_code: SW_OK,
|
|
93
|
+
};
|
|
106
94
|
}
|
|
107
95
|
}
|
|
108
96
|
exports.default = Polkadot;
|
package/lib/Polkadot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polkadot.js","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Polkadot.js","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":";;;;;AAiBA,4DAAiC;AACjC,6CAAsD;AACtD,+DAA8D;AAE9D,MAAM,GAAG,GAAG;IACV,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,IAAI;CACnB,CAAC;AACF,MAAM,KAAK,GAAG,MAAM,CAAC;AACrB,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;;;GAMG;AAEH,MAAqB,QAAQ;IAC3B,SAAS,CAAY;IAErB,YAAY,SAAoB;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;IAED,aAAa,CAAC,IAAmB,EAAE,IAAa;QAC9C,MAAM,YAAY,GAAG,IAAI,KAAK,SAAS,CAAC;QACxC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACjD,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9B,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CA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ACF,uIAAuI;QACvI,gBAAgB,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACrE,OAAO;YACL,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;YACrD,WAAW,EAAE,KAAK;SACnB,CAAC;IACJ,CAAC;CACF;AAlGD,2BAkGC"}
|
package/lib-es/Polkadot.d.ts
CHANGED
package/lib-es/Polkadot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polkadot.d.ts","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Polkadot.d.ts","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AAapD;;;;;;GAMG;AAEH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,SAAS,EAAE,SAAS,CAAC;gBAET,SAAS,EAAE,SAAS;IAKhC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAczD;;;;OAIG;IACG,UAAU,CACd,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,MAAU,EACtB,gBAAgB,UAAQ,GACvB,OAAO,CAAC;QACT,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IAsBF,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IActF;;;;;OAKG;IACG,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CAcH"}
|
package/lib-es/Polkadot.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
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 BIPPath from "bip32-path";
|
|
11
2
|
import { UserRefusedAddress } from "@ledgerhq/errors";
|
|
12
3
|
import { PolkadotGenericApp } from "@zondax/ledger-substrate";
|
|
@@ -25,6 +16,7 @@ const SW_CANCEL = 0x6986;
|
|
|
25
16
|
* const polkadot = new Polkadot(transport)
|
|
26
17
|
*/
|
|
27
18
|
export default class Polkadot {
|
|
19
|
+
transport;
|
|
28
20
|
constructor(transport) {
|
|
29
21
|
this.transport = transport;
|
|
30
22
|
transport.decorateAppAPIMethods(this, ["getAddress", "sign"], "DOT");
|
|
@@ -47,25 +39,23 @@ export default class Polkadot {
|
|
|
47
39
|
* @param {number} ss58prefix
|
|
48
40
|
* @param {boolean} showAddrInDevice - if true, user must valid if the address is correct on the device
|
|
49
41
|
*/
|
|
50
|
-
getAddress(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
68
|
-
});
|
|
42
|
+
async getAddress(path, ss58prefix = 0, showAddrInDevice = false) {
|
|
43
|
+
const CLA = 0xf9;
|
|
44
|
+
const bipPath = BIPPath.fromString(path).toPathArray();
|
|
45
|
+
const bip44Path = this.serializePath(bipPath, ss58prefix);
|
|
46
|
+
return this.transport
|
|
47
|
+
.send(CLA, INS.GET_ADDR_ED25519, showAddrInDevice ? 1 : 0, 0, bip44Path, [SW_OK, SW_CANCEL])
|
|
48
|
+
.then(response => {
|
|
49
|
+
const errorCodeData = response.slice(-2);
|
|
50
|
+
const returnCode = errorCodeData[0] * 256 + errorCodeData[1];
|
|
51
|
+
if (returnCode === SW_CANCEL) {
|
|
52
|
+
throw new UserRefusedAddress();
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
pubKey: response.slice(0, 32).toString("hex"),
|
|
56
|
+
address: response.slice(32, response.length - 2).toString("ascii"),
|
|
57
|
+
return_code: returnCode,
|
|
58
|
+
};
|
|
69
59
|
});
|
|
70
60
|
}
|
|
71
61
|
foreach(arr, callback) {
|
|
@@ -87,17 +77,15 @@ export default class Polkadot {
|
|
|
87
77
|
* @param {string} message - payload
|
|
88
78
|
* @returns {string} - signed payload to be broadcasted
|
|
89
79
|
*/
|
|
90
|
-
sign(path, message, metadata) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
});
|
|
80
|
+
async sign(path, message, metadata) {
|
|
81
|
+
const app = new PolkadotGenericApp(this.transport);
|
|
82
|
+
const signatureRequest = await app.signWithMetadata("m/" + path, Buffer.from(message), Buffer.from(metadata.slice(2), "hex"));
|
|
83
|
+
// we need to cast the signature to Buffer explicitly. In react native, the signature from signWithMetadata is not necessarily a Buffer
|
|
84
|
+
signatureRequest.signature = Buffer.from(signatureRequest.signature);
|
|
85
|
+
return {
|
|
86
|
+
signature: signatureRequest.signature.toString("hex"),
|
|
87
|
+
return_code: SW_OK,
|
|
88
|
+
};
|
|
101
89
|
}
|
|
102
90
|
}
|
|
103
91
|
//# sourceMappingURL=Polkadot.js.map
|
package/lib-es/Polkadot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polkadot.js","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Polkadot.js","sourceRoot":"","sources":["../src/Polkadot.ts"],"names":[],"mappings":"AAiBA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,GAAG,GAAG;IACV,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,IAAI;CACnB,CAAC;AACF,MAAM,KAAK,GAAG,MAAM,CAAC;AACrB,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;;;GAMG;AAEH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,SAAS,CAAY;IAErB,YAAY,SAAoB;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;IAED,aAAa,CAAC,IAAmB,EAAE,IAAa;QAC9C,MAAM,YAAY,GAAG,IAAI,KAAK,SAAS,CAAC;QACxC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACjD,GAAG,CAAC,aAAa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,IAAI,CAAC,OAAO,CAAC,EACpB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CACtC,CAAC;QACF,uIAAuI;QACvI,gBAAgB,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACrE,OAAO;YACL,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;YACrD,WAAW,EAAE,KAAK;SACnB,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-app-polkadot",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.33.0-next.0",
|
|
4
4
|
"description": "Ledger Hardware Wallet Polkadot Application API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -34,21 +34,24 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/jest": "^29.5.10",
|
|
37
|
-
"@types/node": "^
|
|
37
|
+
"@types/node": "^22.10.10",
|
|
38
38
|
"documentation": "14.0.2",
|
|
39
39
|
"jest": "^29.7.0",
|
|
40
40
|
"rimraf": "^4.4.1",
|
|
41
41
|
"source-map-support": "^0.5.21",
|
|
42
42
|
"ts-jest": "^29.1.1",
|
|
43
43
|
"ts-node": "^10.4.0",
|
|
44
|
+
"jest-sonar": "0.2.16",
|
|
44
45
|
"@ledgerhq/hw-transport-mocker": "^6.29.4"
|
|
45
46
|
},
|
|
46
47
|
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec",
|
|
47
48
|
"scripts": {
|
|
48
49
|
"clean": "rimraf lib lib-es",
|
|
49
|
-
"build": "tsc && tsc -m
|
|
50
|
+
"build": "tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es",
|
|
51
|
+
"coverage": "jest --coverage --passWithNoTests && mv coverage/coverage-final.json coverage/coverage-hw-app-polkadot.json && mv coverage/lcov.info coverage/hw-app-polkadot-lcov.info",
|
|
50
52
|
"prewatch": "pnpm build",
|
|
51
53
|
"watch": "tsc --watch",
|
|
54
|
+
"watch:es": "tsc --watch -m esnext --moduleResolution bundler --outDir lib-es",
|
|
52
55
|
"doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts",
|
|
53
56
|
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
|
|
54
57
|
"lint:fix": "pnpm lint --fix",
|