@alephium/ledger-app 0.1.4 → 0.1.5
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/dist/src/index.js +3 -0
- package/dist/test/speculos.test.js +1 -4
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/test/speculos.test.ts +1 -4
package/dist/src/index.js
CHANGED
|
@@ -52,6 +52,9 @@ class AlephiumApp {
|
|
|
52
52
|
if ((targetGroup ?? 0) >= exports.GROUP_NUM) {
|
|
53
53
|
throw Error(`Invalid targetGroup: ${targetGroup}`);
|
|
54
54
|
}
|
|
55
|
+
if (keyType === "bip340-schnorr") {
|
|
56
|
+
throw Error("BIP340-Schnorr is not supported yet");
|
|
57
|
+
}
|
|
55
58
|
const p1 = targetGroup === undefined ? 0x00 : exports.GROUP_NUM;
|
|
56
59
|
const p2 = targetGroup === undefined ? 0x00 : targetGroup;
|
|
57
60
|
const response = await this.transport.send(exports.CLA, INS.GET_PUBLIC_KEY, p1, p2, serde.serializePath(startPath));
|
|
@@ -84,10 +84,7 @@ describe('sdk', () => {
|
|
|
84
84
|
const transport = await hw_transport_node_speculos_1.default.open({ apduPort });
|
|
85
85
|
const app = new src_1.default(transport);
|
|
86
86
|
Array(src_1.GROUP_NUM).forEach(async (_, group) => {
|
|
87
|
-
|
|
88
|
-
expect(hdIndex >= pathIndex).toBe(true);
|
|
89
|
-
expect((0, web3_1.groupOfAddress)(account.address)).toBe(group);
|
|
90
|
-
expect(account.keyType).toBe('bip340-schnorr');
|
|
87
|
+
expect(app.getAccount(path, group, 'bip340-schnorr')).rejects.toThrow('BIP340-Schnorr is not supported yet');
|
|
91
88
|
});
|
|
92
89
|
await transport.close();
|
|
93
90
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alephium/ledger-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"license": "GPL",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"lint": "eslint . --ext ts",
|
|
14
14
|
"lint:fix": "eslint . --fix --ext ts",
|
|
15
15
|
"test": "jest -i --config ./jest-config.json",
|
|
16
|
-
"
|
|
16
|
+
"pub": "npm run build && npm publish --access public"
|
|
17
17
|
},
|
|
18
18
|
"prettier": {
|
|
19
19
|
"printWidth": 120,
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,10 @@ export default class AlephiumApp {
|
|
|
34
34
|
throw Error(`Invalid targetGroup: ${targetGroup}`)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
if (keyType === "bip340-schnorr") {
|
|
38
|
+
throw Error("BIP340-Schnorr is not supported yet")
|
|
39
|
+
}
|
|
40
|
+
|
|
37
41
|
const p1 = targetGroup === undefined ? 0x00 : GROUP_NUM
|
|
38
42
|
const p2 = targetGroup === undefined ? 0x00 : targetGroup
|
|
39
43
|
const response = await this.transport.send(CLA, INS.GET_PUBLIC_KEY, p1, p2, serde.serializePath(startPath))
|
package/test/speculos.test.ts
CHANGED
|
@@ -65,10 +65,7 @@ describe('sdk', () => {
|
|
|
65
65
|
const transport = await SpeculosTransport.open({ apduPort })
|
|
66
66
|
const app = new AlephiumApp(transport)
|
|
67
67
|
Array(GROUP_NUM).forEach(async (_, group) => {
|
|
68
|
-
|
|
69
|
-
expect(hdIndex >= pathIndex).toBe(true)
|
|
70
|
-
expect(groupOfAddress(account.address)).toBe(group)
|
|
71
|
-
expect(account.keyType).toBe('bip340-schnorr')
|
|
68
|
+
expect(app.getAccount(path, group, 'bip340-schnorr')).rejects.toThrow('BIP340-Schnorr is not supported yet')
|
|
72
69
|
})
|
|
73
70
|
await transport.close()
|
|
74
71
|
})
|