Skip to content

Commit ac848b1

Browse files
committed
refactor(server)!: remove RxJS dependency and simplify architecture [LIVE-21906]
BREAKING CHANGE: Major API changes to WalletAPIServer - Remove RxJS dependency from server package - Remove observable-based state management (accounts$, currencies$, etc.) - Simplify WalletHandlers interface to accept accountId strings instead of Account objects - Remove setAccounts() and setCurrencies() methods from WalletAPIServer - Update all internal handlers to delegate data fetching to wallet implementations - Convert permissions from observables to simple Set data structure - Add new wallet handlers: account.list and currency.list - Update React hook to remove accounts and currencies props - Simplify WalletContext by removing observable properties - Update exchange handlers to accept accountId instead of Account objects Migration guide: - Wallet integrations must now implement account.list and currency.list handlers - Replace account parameter with accountId in all wallet handlers - Remove direct calls to setAccounts() and setCurrencies() - Update useWalletAPIServer hook usage to remove accounts/currencies props Adapt simulator to new server architecture without RxJS: - Remove RxJS dependency from simulator package - Update account.request handler to filter accounts directly instead of using observables - Remove observable subscriptions from profile application logic - Modify SimulatorProfile type to restore accounts and currencies arrays - Add support for method handlers as either object or function accepting accounts/currencies - Implement inline account.list and currency.list handlers in standard profile - Remove currencyIds from permissions (now handled at request-handler level) - Simplify test expectations (use array access instead of .at()) - Remove test for duplicate currency filtering in manifest (no longer applicable) - Update helper to invoke methods function when provided
1 parent 4396168 commit ac848b1

File tree

31 files changed

+576
-562
lines changed

31 files changed

+576
-562
lines changed

.changeset/dry-schools-film.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@ledgerhq/wallet-api-simulator": major
3+
---
4+
5+
refactor(simulator): adapt to new server architecture without RxJS
6+
7+
- Remove RxJS dependency from simulator package
8+
- Update SimulatorProfile type to remove accounts and currencies arrays
9+
- Implement account.list and currency.list handlers in standard profile
10+
- Update account.request handler to filter accounts directly instead of using observables
11+
- Remove observable subscriptions from profile application logic
12+
- Simplify helper functions by removing setAccounts and setCurrencies calls

.changeset/polite-colts-sell.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@ledgerhq/wallet-api-manifest-validator-cli": patch
3+
"@ledgerhq/wallet-api-manifest-validator": patch
4+
"@ledgerhq/client-nextjs": patch
5+
"@ledgerhq/wallet-api-tools": patch
6+
"@ledgerhq/wallet-api-client-react": patch
7+
"@ledgerhq/wallet-api-client": patch
8+
"@ledgerhq/wallet-api-core": patch
9+
"@ledgerhq/wallet-api-docs": patch
10+
---
11+
12+
chore: update some dependencies

.changeset/rare-feet-applaud.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
"@ledgerhq/wallet-api-server": major
3+
---
4+
5+
refactor(server)!: remove RxJS dependency and simplify architecture
6+
7+
BREAKING CHANGE: Major API changes to WalletAPIServer
8+
9+
- Remove RxJS dependency from server package
10+
- Remove observable-based state management (accounts$, currencies$, etc.)
11+
- Simplify WalletHandlers interface to accept accountId strings instead of Account objects
12+
- Remove setAccounts() and setCurrencies() methods from WalletAPIServer
13+
- Update all internal handlers to delegate data fetching to wallet implementations
14+
- Convert permissions from observables to simple Set data structure
15+
- Add new wallet handlers: account.list and currency.list
16+
- Update React hook to remove accounts and currencies props
17+
- Simplify WalletContext by removing observable properties
18+
- Update exchange handlers to accept accountId instead of Account objects
19+
20+
Migration guide:
21+
22+
- Wallet integrations must now implement account.list and currency.list handlers
23+
- Replace account parameter with accountId in all wallet handlers
24+
- Remove direct calls to setAccounts() and setCurrencies()
25+
- Update useWalletAPIServer hook usage to remove accounts/currencies props

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"tailwindcss": "^3.4.1"
2525
},
2626
"devDependencies": {
27-
"@types/node": "^20.11.19",
27+
"@types/node": "^24.10.0",
2828
"typescript": "^5.3.3"
2929
}
3030
}

apps/docs/pages/docs/discover/wallet-api/server/extras/rxjs.mdx

Lines changed: 0 additions & 72 deletions
This file was deleted.

apps/docs/pages/docs/discover/wallet-api/server/wallet-api-server/index.mdx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,6 @@ permissions.methodIds$ = [
137137

138138
### walletContext
139139

140-
#### walletContext.currencies$
141-
142-
The allowed currencies:
143-
144-
[allCurrencies](./wallet-api-server#allcurrencies) filtered against the currencies listed in [permissions.currencyIds](./wallet-api-server#permissionscurrencyids)
145-
146-
| Created via | name | note |
147-
| ------------ | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
148-
| _observable_ | | set in constructor, updates anytime `allAccounts` or `allowedCurrencies` changes, more info on how it does this using rxjs [here](./extras/rxjs#combinelatest) |
149-
150-
#### walletContext.accounts$
151-
152-
The allowed accounts:
153-
154-
[allAccounts](./wallet-api-server#allaccounts) filtered against the allowedCurrencies computed above
155-
156-
| Created via | name | note |
157-
| ------------ | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
158-
| _observable_ | | set in constructor, updates anytime `allAccounts` or `walletContext.allowedCurrencies` changes, more info on how it does this using rxjs [here](./extras/rxjs#combinelatest) |
159-
160140
#### walletContext.config
161141

162142
An object of this form

apps/wallet-api-tools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@radix-ui/react-dropdown-menu": "^2.0.6",
1717
"@radix-ui/react-icons": "^1.3.0",
1818
"@tailwindcss/typography": "^0.5.10",
19-
"@types/node": "20.11.19",
19+
"@types/node": "24.10.0",
2020
"@types/react": "18.2.57",
2121
"@types/react-dom": "18.2.19",
2222
"@uiw/codemirror-extensions-langs": "^4.21.22",

examples/client-nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@testing-library/react": "^14.2.1",
2323
"@testing-library/user-event": "^14.5.2",
2424
"@types/jest": "^29.5.12",
25-
"@types/node": "^20.11.19",
25+
"@types/node": "^24.10.0",
2626
"@types/react": "^18.2.57",
2727
"@types/react-dom": "^18.2.19",
2828
"autoprefixer": "^10.4.17",

packages/client-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"devDependencies": {
2626
"@ledgerhq/jest-shared-config": "workspace:*",
2727
"@types/jest": "^29.5.12",
28-
"@types/node": "^20.11.19",
28+
"@types/node": "^24.10.0",
2929
"@types/react": "^18.2.57",
3030
"eslint": "^8.56.0",
3131
"jest": "^29.7.0",

packages/client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"test": "jest"
2121
},
2222
"dependencies": {
23-
"@ledgerhq/hw-transport": "^6.30.4",
23+
"@ledgerhq/hw-transport": "^6.31.13",
2424
"@ledgerhq/wallet-api-core": "workspace:*",
2525
"bignumber.js": "^9.1.2"
2626
},
2727
"devDependencies": {
2828
"@ledgerhq/jest-shared-config": "workspace:*",
2929
"@types/jest": "^29.5.12",
30-
"@types/node": "^20.11.19",
30+
"@types/node": "^24.10.0",
3131
"eslint": "^8.56.0",
3232
"jest": "^29.7.0",
3333
"jest-environment-jsdom": "^29.7.0",

0 commit comments

Comments
 (0)