@ledgerhq/ledger-key-ring-protocol 0.24.0 → 1.0.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @ledgerhq/ledger-key-ring-protocol
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#136](https://github.com/LedgerHQ/ts-libs/pull/136) [`34e071c`](https://github.com/LedgerHQ/ts-libs/commit/34e071cded156e78fa8994b58248656512e920e9) Thanks [@gre-ledger](https://github.com/gre-ledger)! - Upgrade @noble/curves, @noble/hashes and @noble/ciphers to v2 (ESM-only, `.js` subpath imports).
|
|
8
|
+
|
|
9
|
+
Breaking: the CJS entry now `require`s ESM-only packages. Consumers need Node >= 20.19 / 22.12 (or a bundler), and their Jest configs must transform `@noble`:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
+ transform: { "^.+\\.(ts|tsx|js)$": ["@swc/jest", { jsc: { target: "es2022" } }] },
|
|
13
|
+
+ transformIgnorePatterns: ["/node_modules/(?!(\\.pnpm/)?@noble)"],
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#134](https://github.com/LedgerHQ/ts-libs/pull/134) [`a9d3f3e`](https://github.com/LedgerHQ/ts-libs/commit/a9d3f3e1b90a4cca9842d87a107a16b1de3afd3c) Thanks [@gre-ledger](https://github.com/gre-ledger)! - Remove unused @reduxjs/toolkit and axios devDependencies
|
|
19
|
+
- Updated dependencies [[`640e199`](https://github.com/LedgerHQ/ts-libs/commit/640e19985efe86aaa2014145fdec930d6e7c2d72), [`34e071c`](https://github.com/LedgerHQ/ts-libs/commit/34e071cded156e78fa8994b58248656512e920e9)]:
|
|
20
|
+
- @ledgerhq/hw-ledger-key-ring-protocol@1.0.0
|
|
21
|
+
|
|
3
22
|
## 0.24.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/ledger-key-ring-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Ledger Key Ring Protocol layer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger"
|
|
@@ -78,36 +78,34 @@
|
|
|
78
78
|
"base64-js": "1",
|
|
79
79
|
"isomorphic-ws": "5.0.0",
|
|
80
80
|
"rxjs": "7.8.2",
|
|
81
|
-
"ws": "8.
|
|
81
|
+
"ws": "8.22.0",
|
|
82
82
|
"zod": "4.4.3",
|
|
83
|
-
"@ledgerhq/hw-ledger-key-ring-protocol": "0.14.0",
|
|
84
83
|
"@ledgerhq/hw-transport": "6.36.0",
|
|
85
84
|
"@ledgerhq/auth": "0.1.0",
|
|
86
85
|
"@ledgerhq/live-network": "3.2.0",
|
|
87
|
-
"@ledgerhq/logs": "6.19.0"
|
|
86
|
+
"@ledgerhq/logs": "6.19.0",
|
|
87
|
+
"@ledgerhq/hw-ledger-key-ring-protocol": "1.0.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@ledgerhq/device-management-kit": "1.
|
|
90
|
+
"@ledgerhq/device-management-kit": "1.10.0",
|
|
91
91
|
"@ledgerhq/device-transport-kit-speculos": "1.2.1",
|
|
92
92
|
"@ledgerhq/speculos-device-controller": "0.3.0",
|
|
93
|
-
"@
|
|
94
|
-
"@swc/core": "1.16.2",
|
|
93
|
+
"@swc/core": "1.16.13",
|
|
95
94
|
"@swc/jest": "0.2.39",
|
|
96
95
|
"@types/jest": "30.0.0",
|
|
97
|
-
"@types/node": "26.6.
|
|
96
|
+
"@types/node": "26.6.4",
|
|
98
97
|
"@types/ws": "^8.5.10",
|
|
99
|
-
"axios": "1.20.0",
|
|
100
98
|
"bip39": "^3.0.4",
|
|
101
|
-
"expect": "30.5.
|
|
99
|
+
"expect": "30.5.2",
|
|
102
100
|
"fetch-cookie": "3.2.0",
|
|
103
101
|
"jest": "30.5.2",
|
|
104
102
|
"jest-sonar": "0.2.16",
|
|
105
103
|
"msw": "2.7.3",
|
|
106
|
-
"oxlint": "1.
|
|
104
|
+
"oxlint": "1.86.0",
|
|
107
105
|
"ts-node": "^10.9.2",
|
|
108
106
|
"typescript": "7.0.2",
|
|
109
|
-
"@ledgerhq/
|
|
110
|
-
"@ledgerhq/
|
|
107
|
+
"@ledgerhq/hw-transport-mocker": "6.35.0",
|
|
108
|
+
"@ledgerhq/devices": "8.18.0"
|
|
111
109
|
},
|
|
112
110
|
"files": [
|
|
113
111
|
"lib",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { crypto } from "@ledgerhq/hw-ledger-key-ring-protocol";
|
|
2
2
|
import { AuthSDK } from "@ledgerhq/auth";
|
|
3
|
-
import { configureStore } from "@reduxjs/toolkit";
|
|
4
3
|
import { HttpResponse, http } from "msw";
|
|
5
4
|
import { setupServer } from "msw/node";
|
|
6
5
|
import type { Challenge as ChallengeJson, WeakChallengeSignature } from "../api";
|
|
7
6
|
import { LkrpIdentityProvider } from "../LKRPIdentityProvider";
|
|
8
|
-
import { getInitialStore
|
|
7
|
+
import { getInitialStore } from "../store";
|
|
9
8
|
import type { MemberCredentials } from "../types";
|
|
10
9
|
import { credentialForPubKey, initMemberCredentials, liveAuthentication } from "../utils";
|
|
11
10
|
import { CHALLENGE } from "../__mocks__/challenge";
|
|
@@ -70,30 +69,20 @@ describe("LkrpIdentityProvider (integration, MSW)", () => {
|
|
|
70
69
|
HttpResponse.json({ access_token: KEYCLOAK_JWT, token_type: "Bearer" }),
|
|
71
70
|
);
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
trustchain: (
|
|
76
|
-
state = getInitialStore(),
|
|
77
|
-
action: { type: string; payload?: { trustchain?: TrustchainStore } },
|
|
78
|
-
) => action.payload?.trustchain ?? state,
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
const lkrpIdentityProvider = new LkrpIdentityProvider(() => store.getState().trustchain);
|
|
72
|
+
let trustchainStore = getInitialStore();
|
|
73
|
+
const lkrpIdentityProvider = new LkrpIdentityProvider(() => trustchainStore);
|
|
82
74
|
const request = {
|
|
83
75
|
challenge: { tlv: CHALLENGE.tlv, json: CHALLENGE.json },
|
|
84
76
|
clientId: CLIENT_ID,
|
|
85
77
|
redirectUri: REDIRECT_URI,
|
|
86
78
|
};
|
|
87
79
|
|
|
88
|
-
store.dispatch({ type: "unrelated/action" });
|
|
89
80
|
await expect(lkrpIdentityProvider.authenticate(request)).rejects.toMatchObject({
|
|
90
81
|
name: "WalletAuthNoCredentialsError",
|
|
91
82
|
});
|
|
92
83
|
expect(endpoints.lkrpAuth).not.toHaveBeenCalled();
|
|
93
84
|
|
|
94
|
-
|
|
95
|
-
importTrustchainStoreState({ trustchain: null, memberCredentials: MEMBER_CREDENTIALS }),
|
|
96
|
-
);
|
|
85
|
+
trustchainStore = { trustchain: null, memberCredentials: MEMBER_CREDENTIALS };
|
|
97
86
|
await lkrpIdentityProvider.authenticate(request);
|
|
98
87
|
expect(await endpoints.lkrpAuth.mock.calls[0][0].request.json()).toHaveProperty(
|
|
99
88
|
"signature.credential.publicKey",
|
|
@@ -101,9 +90,7 @@ describe("LkrpIdentityProvider (integration, MSW)", () => {
|
|
|
101
90
|
);
|
|
102
91
|
|
|
103
92
|
const updatedMemberCredentials = initMemberCredentials();
|
|
104
|
-
|
|
105
|
-
importTrustchainStoreState({ trustchain: null, memberCredentials: updatedMemberCredentials }),
|
|
106
|
-
);
|
|
93
|
+
trustchainStore = { trustchain: null, memberCredentials: updatedMemberCredentials };
|
|
107
94
|
await lkrpIdentityProvider.authenticate(request);
|
|
108
95
|
expect(await endpoints.lkrpAuth.mock.calls[1][0].request.json()).toHaveProperty(
|
|
109
96
|
"signature.credential.publicKey",
|