@ledgerhq/ledger-wallet-framework 2.1.0 → 2.2.0-nightly.20260613030736
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 +17 -0
- package/lib/account/support.d.ts.map +1 -1
- package/lib/account/support.js +0 -7
- package/lib/account/support.js.map +1 -1
- package/lib/currencies/index.d.ts +0 -1
- package/lib/currencies/index.d.ts.map +1 -1
- package/lib/currencies/index.js +1 -5
- package/lib/currencies/index.js.map +1 -1
- package/lib-es/account/support.d.ts.map +1 -1
- package/lib-es/account/support.js +1 -8
- package/lib-es/account/support.js.map +1 -1
- package/lib-es/currencies/index.d.ts +0 -1
- package/lib-es/currencies/index.d.ts.map +1 -1
- package/lib-es/currencies/index.js +0 -1
- package/lib-es/currencies/index.js.map +1 -1
- package/package.json +8 -8
- package/src/account/index.test.ts +0 -3
- package/src/account/support.ts +1 -9
- package/src/currencies/index.ts +0 -1
- package/lib/currencies/support.d.ts +0 -5
- package/lib/currencies/support.d.ts.map +0 -1
- package/lib/currencies/support.js +0 -31
- package/lib/currencies/support.js.map +0 -1
- package/lib-es/currencies/support.d.ts +0 -5
- package/lib-es/currencies/support.d.ts.map +0 -1
- package/lib-es/currencies/support.js +0 -26
- package/lib-es/currencies/support.js.map +0 -1
- package/src/currencies/support.ts +0 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @ledgerhq/ledger-wallet-framework
|
|
2
2
|
|
|
3
|
+
## 2.2.0-nightly.20260613030736
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#18256](https://github.com/LedgerHQ/ledger-live/pull/18256) [`eb1dae8`](https://github.com/LedgerHQ/ledger-live/commit/eb1dae8fc14ff8e0bc1e1ce040712492a0328451) Thanks [@gre-ledger](https://github.com/gre-ledger)! - Derive "supported currencies" from the coin-modules registry instead of `setSupportedCurrencies`.
|
|
8
|
+
|
|
9
|
+
Each `CoinModuleLoader` now declares a `supportedCoins: CryptoCurrencyId[]` field, and a currency is supported when it appears in a registered loader's `supportedCoins`. The framework `setSupportedCurrencies` / `listSupportedCurrencies` / `isCurrencySupported` and the `EXPERIMENTAL_CURRENCIES` env are removed; `listSupportedCurrencies` / `isCurrencySupported` are now exported from `@ledgerhq/live-common/currencies` backed by the registry. Apps no longer maintain a supported-currencies list — registering the coin modules is what makes their currencies supported.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`81ceb34`](https://github.com/LedgerHQ/ledger-live/commit/81ceb347c0b2167358c601a9922e2c7fa14a845b), [`9ddf006`](https://github.com/LedgerHQ/ledger-live/commit/9ddf006bc2897a2393f1a9595b3c6a43d0c35bf7), [`da1c0c8`](https://github.com/LedgerHQ/ledger-live/commit/da1c0c87b3d2540eff9e51c665df8192b4486855), [`9ab3a61`](https://github.com/LedgerHQ/ledger-live/commit/9ab3a6157abb3a382c3157eb292ce9d9d2c6df93), [`e6c617b`](https://github.com/LedgerHQ/ledger-live/commit/e6c617b91062f82f70d020212189a806d2452166), [`04e3349`](https://github.com/LedgerHQ/ledger-live/commit/04e33498ffd5d7a81ad86436a75b1562ca263356), [`eb1dae8`](https://github.com/LedgerHQ/ledger-live/commit/eb1dae8fc14ff8e0bc1e1ce040712492a0328451)]:
|
|
14
|
+
- @ledgerhq/live-env@2.39.0-nightly.20260613030736
|
|
15
|
+
- @ledgerhq/types-live@6.112.0-nightly.20260613030736
|
|
16
|
+
- @ledgerhq/cryptoassets@13.51.1-nightly.20260613030736
|
|
17
|
+
- @ledgerhq/live-currency-format@0.9.3-nightly.20260613030736
|
|
18
|
+
- @ledgerhq/live-network@2.6.5-nightly.20260613030736
|
|
19
|
+
|
|
3
20
|
## 2.1.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEjF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,cAAc,EACxB,gBAAgB,cAAc,KAC7B,OAkBF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,UAAU,WAAW,EACrB,gBAAgB,OAAO,GAAG,IAAI,GAAG,SAAS,KACzC,KAAK,GAAG,SAEV,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAMhF"}
|
package/lib/account/support.js
CHANGED
|
@@ -5,7 +5,6 @@ exports.checkAccountSupported = checkAccountSupported;
|
|
|
5
5
|
const errors_1 = require("@ledgerhq/errors");
|
|
6
6
|
const live_env_1 = require("@ledgerhq/live-env");
|
|
7
7
|
const derivation_1 = require("../derivation");
|
|
8
|
-
const currencies_1 = require("../currencies");
|
|
9
8
|
const shouldShowNewAccount = (currency, derivationMode) => {
|
|
10
9
|
const modes = (0, derivation_1.getDerivationModesForCurrency)(currency);
|
|
11
10
|
// last mode is always creatable by convention
|
|
@@ -33,11 +32,5 @@ function checkAccountSupported(account) {
|
|
|
33
32
|
reason: account.derivationMode,
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
|
-
if (!(0, currencies_1.isCurrencySupported)(account.currency)) {
|
|
37
|
-
const currencyId = account.currency.id;
|
|
38
|
-
return new errors_1.CurrencyNotSupported("currency not supported: " + currencyId, {
|
|
39
|
-
currencyName: currencyId,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
35
|
}
|
|
43
36
|
//# sourceMappingURL=support.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":";;;AAoCA,sDAMC;AA1CD,6CAAuD;AACvD,iDAA4C;AAC5C,8CAAqF;AAI9E,MAAM,oBAAoB,GAAG,CAClC,QAAwB,EACxB,cAA8B,EACrB,EAAE;IACX,MAAM,KAAK,GAAG,IAAA,0CAA6B,EAAC,QAAQ,CAAC,CAAC;IACtD,8CAA8C;IAC9C,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IAC5D,6DAA6D;IAC7D,IACE,cAAc,KAAK,EAAE;QACrB,CAAC,CAAC,CAAC,IAAA,iBAAM,EAAC,yBAAyB,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC;QAEtE,OAAO,IAAI,CAAC;IACd,4FAA4F;IAC5F,IACE,cAAc,KAAK,QAAQ;QAC3B,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS;YAC5B,CAAC,cAAc,KAAK,eAAe,IAAI,cAAc,KAAK,SAAS,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC;IACd,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AArBW,QAAA,oBAAoB,wBAqB/B;AAEK,MAAM,mBAAmB,GAAG,CACjC,QAAqB,EACrB,cAA0C,EACvB,EAAE;IACrB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AALW,QAAA,mBAAmB,uBAK9B;AAEF,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,IAAI,CAAC,IAAA,kCAAqB,GAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAgC,CAAC,EAAE,CAAC;QAChF,OAAO,IAAI,4BAAmB,CAAC,2BAA2B,GAAG,OAAO,CAAC,cAAc,EAAE;YACnF,MAAM,EAAE,OAAO,CAAC,cAAc;SAC/B,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { encodeURIScheme, decodeURIScheme } from "./CurrencyURIScheme";
|
|
2
2
|
export { sanitizeValueString } from "./sanitizeValueString";
|
|
3
3
|
export { toLocaleString } from "./BigNumberToLocaleString";
|
|
4
|
-
export { isCurrencySupported, listSupportedCurrencies, setSupportedCurrencies } from "./support";
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
package/lib/currencies/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toLocaleString = exports.sanitizeValueString = exports.decodeURIScheme = exports.encodeURIScheme = void 0;
|
|
4
4
|
var CurrencyURIScheme_1 = require("./CurrencyURIScheme");
|
|
5
5
|
Object.defineProperty(exports, "encodeURIScheme", { enumerable: true, get: function () { return CurrencyURIScheme_1.encodeURIScheme; } });
|
|
6
6
|
Object.defineProperty(exports, "decodeURIScheme", { enumerable: true, get: function () { return CurrencyURIScheme_1.decodeURIScheme; } });
|
|
@@ -8,8 +8,4 @@ var sanitizeValueString_1 = require("./sanitizeValueString");
|
|
|
8
8
|
Object.defineProperty(exports, "sanitizeValueString", { enumerable: true, get: function () { return sanitizeValueString_1.sanitizeValueString; } });
|
|
9
9
|
var BigNumberToLocaleString_1 = require("./BigNumberToLocaleString");
|
|
10
10
|
Object.defineProperty(exports, "toLocaleString", { enumerable: true, get: function () { return BigNumberToLocaleString_1.toLocaleString; } });
|
|
11
|
-
var support_1 = require("./support");
|
|
12
|
-
Object.defineProperty(exports, "isCurrencySupported", { enumerable: true, get: function () { return support_1.isCurrencySupported; } });
|
|
13
|
-
Object.defineProperty(exports, "listSupportedCurrencies", { enumerable: true, get: function () { return support_1.listSupportedCurrencies; } });
|
|
14
|
-
Object.defineProperty(exports, "setSupportedCurrencies", { enumerable: true, get: function () { return support_1.setSupportedCurrencies; } });
|
|
15
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AAA9D,oHAAA,eAAe,OAAA;AAAE,oHAAA,eAAe,OAAA;AACzC,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,qEAA2D;AAAlD,yHAAA,cAAc,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AAA9D,oHAAA,eAAe,OAAA;AAAE,oHAAA,eAAe,OAAA;AACzC,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,qEAA2D;AAAlD,yHAAA,cAAc,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEjF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,cAAc,EACxB,gBAAgB,cAAc,KAC7B,OAkBF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,UAAU,WAAW,EACrB,gBAAgB,OAAO,GAAG,IAAI,GAAG,SAAS,KACzC,KAAK,GAAG,SAEV,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAMhF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AccountNotSupported
|
|
1
|
+
import { AccountNotSupported } from "@ledgerhq/errors";
|
|
2
2
|
import { getEnv } from "@ledgerhq/live-env";
|
|
3
3
|
import { getAllDerivationModes, getDerivationModesForCurrency } from "../derivation";
|
|
4
|
-
import { isCurrencySupported } from "../currencies";
|
|
5
4
|
export const shouldShowNewAccount = (currency, derivationMode) => {
|
|
6
5
|
const modes = getDerivationModesForCurrency(currency);
|
|
7
6
|
// last mode is always creatable by convention
|
|
@@ -27,11 +26,5 @@ export function checkAccountSupported(account) {
|
|
|
27
26
|
reason: account.derivationMode,
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
|
-
if (!isCurrencySupported(account.currency)) {
|
|
31
|
-
const currencyId = account.currency.id;
|
|
32
|
-
return new CurrencyNotSupported("currency not supported: " + currencyId, {
|
|
33
|
-
currencyName: currencyId,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
29
|
}
|
|
37
30
|
//# sourceMappingURL=support.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/account/support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAIrF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,QAAwB,EACxB,cAA8B,EACrB,EAAE;IACX,MAAM,KAAK,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACtD,8CAA8C;IAC9C,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IAC5D,6DAA6D;IAC7D,IACE,cAAc,KAAK,EAAE;QACrB,CAAC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC;QAEtE,OAAO,IAAI,CAAC;IACd,4FAA4F;IAC5F,IACE,cAAc,KAAK,QAAQ;QAC3B,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS;YAC5B,CAAC,cAAc,KAAK,eAAe,IAAI,cAAc,KAAK,SAAS,CAAC,CAAC;QAEvE,OAAO,IAAI,CAAC;IACd,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAAqB,EACrB,cAA0C,EACvB,EAAE;IACrB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,IAAI,CAAC,qBAAqB,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAgC,CAAC,EAAE,CAAC;QAChF,OAAO,IAAI,mBAAmB,CAAC,2BAA2B,GAAG,OAAO,CAAC,cAAc,EAAE;YACnF,MAAM,EAAE,OAAO,CAAC,cAAc;SAC/B,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { encodeURIScheme, decodeURIScheme } from "./CurrencyURIScheme";
|
|
2
2
|
export { sanitizeValueString } from "./sanitizeValueString";
|
|
3
3
|
export { toLocaleString } from "./BigNumberToLocaleString";
|
|
4
|
-
export { isCurrencySupported, listSupportedCurrencies, setSupportedCurrencies } from "./support";
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { encodeURIScheme, decodeURIScheme } from "./CurrencyURIScheme";
|
|
2
2
|
export { sanitizeValueString } from "./sanitizeValueString";
|
|
3
3
|
export { toLocaleString } from "./BigNumberToLocaleString";
|
|
4
|
-
export { isCurrencySupported, listSupportedCurrencies, setSupportedCurrencies } from "./support";
|
|
5
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/ledger-wallet-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-nightly.20260613030736",
|
|
4
4
|
"description": "Framework for Ledger Wallet",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"license": "Apache-2.0",
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@ledgerhq/coin-module-framework": "3.
|
|
91
|
+
"@ledgerhq/coin-module-framework": "3.5.1",
|
|
92
92
|
"axios": "1.13.5",
|
|
93
93
|
"bignumber.js": "^9.1.2",
|
|
94
94
|
"bip32-path": "^0.4.2",
|
|
@@ -100,16 +100,16 @@
|
|
|
100
100
|
"prando": "^6.0.1",
|
|
101
101
|
"rxjs": "7.8.2",
|
|
102
102
|
"uuid": "11.1.0",
|
|
103
|
-
"@ledgerhq/cryptoassets": "^13.51.
|
|
103
|
+
"@ledgerhq/cryptoassets": "^13.51.1-nightly.20260613030736",
|
|
104
104
|
"@ledgerhq/devices": "8.15.1",
|
|
105
105
|
"@ledgerhq/errors": "^6.36.0",
|
|
106
106
|
"@ledgerhq/live-config": "^3.8.0",
|
|
107
|
-
"@ledgerhq/live-
|
|
107
|
+
"@ledgerhq/live-env": "^2.39.0-nightly.20260613030736",
|
|
108
|
+
"@ledgerhq/live-currency-format": "^0.9.3-nightly.20260613030736",
|
|
109
|
+
"@ledgerhq/live-network": "^2.6.5-nightly.20260613030736",
|
|
108
110
|
"@ledgerhq/logs": "^6.17.0",
|
|
109
111
|
"@ledgerhq/types-cryptoassets": "^7.37.0",
|
|
110
|
-
"@ledgerhq/live
|
|
111
|
-
"@ledgerhq/types-live": "^6.111.0",
|
|
112
|
-
"@ledgerhq/live-env": "^2.38.0"
|
|
112
|
+
"@ledgerhq/types-live": "^6.112.0-nightly.20260613030736"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@types/imurmurhash": "^0.1.4",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"@swc/jest": "0.2.39",
|
|
127
127
|
"@swc/core": "1.15.11",
|
|
128
128
|
"@ledgerhq/hw-transport-node-speculos": "^6.34.4",
|
|
129
|
-
"@ledgerhq/live-dmk-speculos": "^0.9.
|
|
129
|
+
"@ledgerhq/live-dmk-speculos": "^0.9.2-nightly.20260613030736"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"clean": "rm -rf lib lib-es",
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
groupAccountsOperationsByDay,
|
|
9
9
|
shortAddressPreview,
|
|
10
10
|
} from ".";
|
|
11
|
-
import { setSupportedCurrencies } from "../currencies";
|
|
12
11
|
import { genAccount } from "../mocks/account";
|
|
13
12
|
import "../test-helpers/staticTime";
|
|
14
13
|
import tokenData from "./__fixtures__/ethereum-erc20-0x_project.json";
|
|
@@ -21,8 +20,6 @@ setupMockCryptoAssetsStore();
|
|
|
21
20
|
// oxlint-disable-next-line typescript/consistent-type-assertions
|
|
22
21
|
const TOKEN = tokenData as TokenCurrency;
|
|
23
22
|
|
|
24
|
-
setSupportedCurrencies(["ethereum", "ethereum_classic", "tron"]);
|
|
25
|
-
|
|
26
23
|
describe("groupAccountOperationsByDay", () => {
|
|
27
24
|
test("basic", () => {
|
|
28
25
|
const account = genAccount("seed_7", {
|
package/src/account/support.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AccountNotSupported
|
|
1
|
+
import { AccountNotSupported } from "@ledgerhq/errors";
|
|
2
2
|
import { getEnv } from "@ledgerhq/live-env";
|
|
3
3
|
import { getAllDerivationModes, getDerivationModesForCurrency } from "../derivation";
|
|
4
|
-
import { isCurrencySupported } from "../currencies";
|
|
5
4
|
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
6
5
|
import type { Account, AccountLike, DerivationMode } from "@ledgerhq/types-live";
|
|
7
6
|
|
|
@@ -41,11 +40,4 @@ export function checkAccountSupported(account: Account): Error | null | undefine
|
|
|
41
40
|
reason: account.derivationMode,
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
if (!isCurrencySupported(account.currency)) {
|
|
46
|
-
const currencyId = account.currency.id;
|
|
47
|
-
return new CurrencyNotSupported("currency not supported: " + currencyId, {
|
|
48
|
-
currencyName: currencyId,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
43
|
}
|
package/src/currencies/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { encodeURIScheme, decodeURIScheme } from "./CurrencyURIScheme";
|
|
2
2
|
export { sanitizeValueString } from "./sanitizeValueString";
|
|
3
3
|
export { toLocaleString } from "./BigNumberToLocaleString";
|
|
4
|
-
export { isCurrencySupported, listSupportedCurrencies, setSupportedCurrencies } from "./support";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CryptoCurrency, CryptoCurrencyId } from "@ledgerhq/types-cryptoassets";
|
|
2
|
-
export declare function setSupportedCurrencies(ids: CryptoCurrencyId[]): void;
|
|
3
|
-
export declare function listSupportedCurrencies(): CryptoCurrency[];
|
|
4
|
-
export declare function isCurrencySupported(currency: CryptoCurrency): boolean;
|
|
5
|
-
//# sourceMappingURL=support.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/currencies/support.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,EAAE,QAG7D;AAWD,wBAAgB,uBAAuB,IAAI,cAAc,EAAE,CAK1D;AAID,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAErE"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSupportedCurrencies = setSupportedCurrencies;
|
|
4
|
-
exports.listSupportedCurrencies = listSupportedCurrencies;
|
|
5
|
-
exports.isCurrencySupported = isCurrencySupported;
|
|
6
|
-
const cryptoassets_1 = require("@ledgerhq/cryptoassets");
|
|
7
|
-
const live_env_1 = require("@ledgerhq/live-env");
|
|
8
|
-
// set by user side effect to precise which currencies are considered supported (typically by live)
|
|
9
|
-
let userSupportedCurrencies = [];
|
|
10
|
-
function setSupportedCurrencies(ids) {
|
|
11
|
-
userSupportedCurrencies = Array.from(new Set(ids)) // Make sure to remove duplicates
|
|
12
|
-
.map(id => (0, cryptoassets_1.getCryptoCurrencyById)(id));
|
|
13
|
-
}
|
|
14
|
-
function getExperimentalSupports() {
|
|
15
|
-
return (0, live_env_1.getEnv)("EXPERIMENTAL_CURRENCIES")
|
|
16
|
-
.split(",")
|
|
17
|
-
.filter((id) => (0, cryptoassets_1.hasCryptoCurrencyId)(id) && !userSupportedCurrencies.find(c => c.id === id))
|
|
18
|
-
.map(cryptoassets_1.getCryptoCurrencyById);
|
|
19
|
-
}
|
|
20
|
-
function listSupportedCurrencies() {
|
|
21
|
-
const experimentals = getExperimentalSupports();
|
|
22
|
-
return experimentals.length === 0
|
|
23
|
-
? userSupportedCurrencies
|
|
24
|
-
: userSupportedCurrencies.concat(experimentals);
|
|
25
|
-
}
|
|
26
|
-
// TODO: remove or refactor if needed using map of supported currencies and only the id
|
|
27
|
-
// We can even cache and use the set created in setSupportedCurrencies
|
|
28
|
-
function isCurrencySupported(currency) {
|
|
29
|
-
return listSupportedCurrencies().includes(currency);
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=support.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/currencies/support.ts"],"names":[],"mappings":";;AAOA,wDAGC;AAWD,0DAKC;AAID,kDAEC;AAhCD,yDAAoF;AAEpF,iDAA4C;AAE5C,mGAAmG;AACnG,IAAI,uBAAuB,GAAqB,EAAE,CAAC;AAEnD,SAAgB,sBAAsB,CAAC,GAAuB;IAC5D,uBAAuB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,iCAAiC;SACjF,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,oCAAqB,EAAC,EAAE,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO,IAAA,iBAAM,EAAC,yBAAyB,CAAC;SACrC,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CACL,CAAC,EAAU,EAAE,EAAE,CAAC,IAAA,kCAAmB,EAAC,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAC3F;SACA,GAAG,CAAC,oCAAqB,CAAC,CAAC;AAChC,CAAC;AAED,SAAgB,uBAAuB;IACrC,MAAM,aAAa,GAAG,uBAAuB,EAAE,CAAC;IAChD,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC;QAC/B,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,uBAAuB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AACpD,CAAC;AAED,uFAAuF;AACvF,sEAAsE;AACtE,SAAgB,mBAAmB,CAAC,QAAwB;IAC1D,OAAO,uBAAuB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CryptoCurrency, CryptoCurrencyId } from "@ledgerhq/types-cryptoassets";
|
|
2
|
-
export declare function setSupportedCurrencies(ids: CryptoCurrencyId[]): void;
|
|
3
|
-
export declare function listSupportedCurrencies(): CryptoCurrency[];
|
|
4
|
-
export declare function isCurrencySupported(currency: CryptoCurrency): boolean;
|
|
5
|
-
//# sourceMappingURL=support.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/currencies/support.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,EAAE,QAG7D;AAWD,wBAAgB,uBAAuB,IAAI,cAAc,EAAE,CAK1D;AAID,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAErE"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { getCryptoCurrencyById, hasCryptoCurrencyId } from "@ledgerhq/cryptoassets";
|
|
2
|
-
import { getEnv } from "@ledgerhq/live-env";
|
|
3
|
-
// set by user side effect to precise which currencies are considered supported (typically by live)
|
|
4
|
-
let userSupportedCurrencies = [];
|
|
5
|
-
export function setSupportedCurrencies(ids) {
|
|
6
|
-
userSupportedCurrencies = Array.from(new Set(ids)) // Make sure to remove duplicates
|
|
7
|
-
.map(id => getCryptoCurrencyById(id));
|
|
8
|
-
}
|
|
9
|
-
function getExperimentalSupports() {
|
|
10
|
-
return getEnv("EXPERIMENTAL_CURRENCIES")
|
|
11
|
-
.split(",")
|
|
12
|
-
.filter((id) => hasCryptoCurrencyId(id) && !userSupportedCurrencies.find(c => c.id === id))
|
|
13
|
-
.map(getCryptoCurrencyById);
|
|
14
|
-
}
|
|
15
|
-
export function listSupportedCurrencies() {
|
|
16
|
-
const experimentals = getExperimentalSupports();
|
|
17
|
-
return experimentals.length === 0
|
|
18
|
-
? userSupportedCurrencies
|
|
19
|
-
: userSupportedCurrencies.concat(experimentals);
|
|
20
|
-
}
|
|
21
|
-
// TODO: remove or refactor if needed using map of supported currencies and only the id
|
|
22
|
-
// We can even cache and use the set created in setSupportedCurrencies
|
|
23
|
-
export function isCurrencySupported(currency) {
|
|
24
|
-
return listSupportedCurrencies().includes(currency);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=support.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/currencies/support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,mGAAmG;AACnG,IAAI,uBAAuB,GAAqB,EAAE,CAAC;AAEnD,MAAM,UAAU,sBAAsB,CAAC,GAAuB;IAC5D,uBAAuB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,iCAAiC;SACjF,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO,MAAM,CAAC,yBAAyB,CAAC;SACrC,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CACL,CAAC,EAAU,EAAE,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAC3F;SACA,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,MAAM,aAAa,GAAG,uBAAuB,EAAE,CAAC;IAChD,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC;QAC/B,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,uBAAuB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AACpD,CAAC;AAED,uFAAuF;AACvF,sEAAsE;AACtE,MAAM,UAAU,mBAAmB,CAAC,QAAwB;IAC1D,OAAO,uBAAuB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getCryptoCurrencyById, hasCryptoCurrencyId } from "@ledgerhq/cryptoassets";
|
|
2
|
-
import { CryptoCurrency, CryptoCurrencyId } from "@ledgerhq/types-cryptoassets";
|
|
3
|
-
import { getEnv } from "@ledgerhq/live-env";
|
|
4
|
-
|
|
5
|
-
// set by user side effect to precise which currencies are considered supported (typically by live)
|
|
6
|
-
let userSupportedCurrencies: CryptoCurrency[] = [];
|
|
7
|
-
|
|
8
|
-
export function setSupportedCurrencies(ids: CryptoCurrencyId[]) {
|
|
9
|
-
userSupportedCurrencies = Array.from(new Set(ids)) // Make sure to remove duplicates
|
|
10
|
-
.map(id => getCryptoCurrencyById(id));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function getExperimentalSupports() {
|
|
14
|
-
return getEnv("EXPERIMENTAL_CURRENCIES")
|
|
15
|
-
.split(",")
|
|
16
|
-
.filter(
|
|
17
|
-
(id: string) => hasCryptoCurrencyId(id) && !userSupportedCurrencies.find(c => c.id === id),
|
|
18
|
-
)
|
|
19
|
-
.map(getCryptoCurrencyById);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function listSupportedCurrencies(): CryptoCurrency[] {
|
|
23
|
-
const experimentals = getExperimentalSupports();
|
|
24
|
-
return experimentals.length === 0
|
|
25
|
-
? userSupportedCurrencies
|
|
26
|
-
: userSupportedCurrencies.concat(experimentals);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// TODO: remove or refactor if needed using map of supported currencies and only the id
|
|
30
|
-
// We can even cache and use the set created in setSupportedCurrencies
|
|
31
|
-
export function isCurrencySupported(currency: CryptoCurrency): boolean {
|
|
32
|
-
return listSupportedCurrencies().includes(currency);
|
|
33
|
-
}
|