@ledgerhq/live-common 25.0.0-next.1 → 25.0.0-next.4
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/lib/__tests__/accounts/importAccounts.js +1 -1
- package/lib/__tests__/test-helpers/setup.js +1 -1
- package/lib/account/helpers.d.ts +5 -1
- package/lib/account/helpers.d.ts.map +1 -1
- package/lib/account/helpers.js +28 -1
- package/lib/account/helpers.js.map +1 -1
- package/lib/apps/filtering.test.js +1 -1
- package/lib/countervalues/api/api.d.ts.map +1 -1
- package/lib/countervalues/api/api.js +25 -13
- package/lib/countervalues/api/api.js.map +1 -1
- package/lib/countervalues/logic.d.ts.map +1 -1
- package/lib/countervalues/logic.integration.test.d.ts +1 -1
- package/lib/countervalues/logic.integration.test.d.ts.map +1 -1
- package/lib/countervalues/logic.integration.test.js +78 -2
- package/lib/countervalues/logic.integration.test.js.map +1 -1
- package/lib/countervalues/logic.js +5 -1
- package/lib/countervalues/logic.js.map +1 -1
- package/lib/countervalues/modules/index.d.ts +1 -1
- package/lib/countervalues/modules/index.d.ts.map +1 -1
- package/lib/countervalues/modules/index.js +3 -1
- package/lib/countervalues/modules/index.js.map +1 -1
- package/lib/countervalues/types.d.ts +1 -0
- package/lib/countervalues/types.d.ts.map +1 -1
- package/lib/currencies/helpers.d.ts +9 -0
- package/lib/currencies/helpers.d.ts.map +1 -0
- package/lib/currencies/helpers.js +78 -0
- package/lib/currencies/helpers.js.map +1 -0
- package/lib/currencies/helpers.test.d.ts +2 -0
- package/lib/currencies/helpers.test.d.ts.map +1 -0
- package/lib/currencies/helpers.test.js +20 -0
- package/lib/currencies/helpers.test.js.map +1 -0
- package/lib/currencies/index.d.ts +1 -0
- package/lib/currencies/index.d.ts.map +1 -1
- package/lib/currencies/index.js +1 -0
- package/lib/currencies/index.js.map +1 -1
- package/lib/currencies/react.d.ts +4 -0
- package/lib/currencies/react.d.ts.map +1 -0
- package/lib/currencies/react.js +16 -0
- package/lib/currencies/react.js.map +1 -0
- package/lib/families/hedera/api/mirror.js +1 -1
- package/lib/families/hedera/api/mirror.js.map +1 -1
- package/lib/families/hedera/api/network.d.ts.map +1 -1
- package/lib/families/hedera/api/network.js +3 -1
- package/lib/families/hedera/api/network.js.map +1 -1
- package/lib/families/hedera/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/families/hedera/deviceTransactionConfig.js +7 -0
- package/lib/families/hedera/deviceTransactionConfig.js.map +1 -1
- package/lib/families/hedera/js-synchronisation.d.ts.map +1 -1
- package/lib/families/hedera/js-synchronisation.js +10 -7
- package/lib/families/hedera/js-synchronisation.js.map +1 -1
- package/lib/families/hedera/specs.d.ts.map +1 -1
- package/lib/families/hedera/specs.js +23 -0
- package/lib/families/hedera/specs.js.map +1 -1
- package/lib/families/hedera/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/hedera/speculos-deviceActions.js +5 -1
- package/lib/families/hedera/speculos-deviceActions.js.map +1 -1
- package/lib/families/hedera/transaction.d.ts.map +1 -1
- package/lib/families/hedera/transaction.js +2 -2
- package/lib/families/hedera/transaction.js.map +1 -1
- package/lib/families/hedera/types.d.ts +2 -5
- package/lib/families/hedera/types.d.ts.map +1 -1
- package/lib/families/hedera/types.js +0 -4
- package/lib/families/hedera/types.js.map +1 -1
- package/lib/families/hedera/utils.d.ts.map +1 -1
- package/lib/featureFlags/types.d.ts +1 -1
- package/lib/featureFlags/types.d.ts.map +1 -1
- package/lib/platform/PlatformAppProvider/api/api.mock.js +11 -11
- package/lib/platform/PlatformAppProvider/api/api.mock.js.map +1 -1
- package/lib/platform/PlatformAppProvider/helpers.d.ts +0 -7
- package/lib/platform/PlatformAppProvider/helpers.d.ts.map +1 -1
- package/lib/platform/PlatformAppProvider/helpers.js +1 -29
- package/lib/platform/PlatformAppProvider/helpers.js.map +1 -1
- package/lib/platform/converters.d.ts +4 -4
- package/lib/platform/converters.d.ts.map +1 -1
- package/lib/platform/converters.js +40 -2
- package/lib/platform/converters.js.map +1 -1
- package/lib/platform/filters.d.ts +18 -0
- package/lib/platform/filters.d.ts.map +1 -0
- package/lib/platform/filters.js +63 -0
- package/lib/platform/filters.js.map +1 -0
- package/lib/platform/helpers.d.ts +7 -0
- package/lib/platform/helpers.d.ts.map +1 -0
- package/lib/platform/helpers.js +22 -0
- package/lib/platform/helpers.js.map +1 -0
- package/lib/platform/logic.d.ts +1 -5
- package/lib/platform/logic.d.ts.map +1 -1
- package/lib/platform/logic.js +1 -18
- package/lib/platform/logic.js.map +1 -1
- package/lib/platform/providers/RemoteLiveAppProvider/api/mock.json +87 -246
- package/lib/platform/react.d.ts +11 -0
- package/lib/platform/react.d.ts.map +1 -0
- package/lib/platform/react.js +61 -0
- package/lib/platform/react.js.map +1 -0
- package/lib/platform/types.d.ts +8 -2
- package/lib/platform/types.d.ts.map +1 -1
- package/lib/platform/types.js +15 -0
- package/lib/platform/types.js.map +1 -1
- package/lib/platform/version.test.js +1 -1
- package/lib/walletconnect/walletconnect.test.js +0 -2
- package/lib/walletconnect/walletconnect.test.js.map +1 -1
- package/package.json +3 -2
- package/src/__tests__/accounts/importAccounts.ts +1 -1
- package/src/__tests__/test-helpers/setup.ts +1 -1
- package/src/account/helpers.ts +51 -0
- package/src/apps/filtering.test.ts +1 -1
- package/src/countervalues/api/api.ts +25 -8
- package/src/countervalues/logic.integration.test.ts +71 -1
- package/src/countervalues/logic.ts +3 -1
- package/src/countervalues/modules/index.ts +3 -1
- package/src/countervalues/types.ts +2 -0
- package/src/currencies/helpers.test.ts +21 -0
- package/src/currencies/helpers.ts +69 -0
- package/src/currencies/index.ts +1 -0
- package/src/currencies/react.ts +16 -0
- package/src/families/hedera/api/mirror.ts +1 -1
- package/src/families/hedera/api/network.ts +1 -0
- package/src/families/hedera/deviceTransactionConfig.ts +8 -0
- package/src/families/hedera/js-synchronisation.ts +5 -3
- package/src/families/hedera/specs.ts +56 -5
- package/src/families/hedera/speculos-deviceActions.ts +1 -0
- package/src/families/hedera/transaction.ts +2 -0
- package/src/families/hedera/types.ts +2 -8
- package/src/families/hedera/utils.ts +1 -1
- package/src/featureFlags/types.ts +1 -0
- package/src/platform/PlatformAppProvider/api/api.mock.ts +11 -11
- package/src/platform/PlatformAppProvider/helpers.ts +0 -48
- package/src/platform/converters.ts +60 -6
- package/src/platform/filters.ts +102 -0
- package/src/platform/helpers.ts +33 -0
- package/src/platform/logic.ts +1 -20
- package/src/platform/providers/RemoteLiveAppProvider/api/mock.json +87 -246
- package/src/platform/react.ts +93 -0
- package/src/platform/types.ts +23 -1
- package/src/platform/version.test.ts +1 -1
- package/src/walletconnect/walletconnect.test.ts +0 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isCryptoCurrency, isTokenCurrency } from "../currencies";
|
|
2
|
+
import { Currency } from "../types";
|
|
3
|
+
import {
|
|
4
|
+
PlatformCurrency,
|
|
5
|
+
PlatformSupportedCurrency,
|
|
6
|
+
PlatformERC20TokenCurrency,
|
|
7
|
+
PlatformCryptoCurrency,
|
|
8
|
+
PlatformCurrencyType,
|
|
9
|
+
} from "./types";
|
|
10
|
+
|
|
11
|
+
export function isPlatformSupportedCurrency(
|
|
12
|
+
currency: Currency
|
|
13
|
+
): currency is PlatformSupportedCurrency {
|
|
14
|
+
return isCryptoCurrency(currency) || isTokenCurrency(currency);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function isPlatformCryptoCurrency(
|
|
18
|
+
currency: PlatformCurrency
|
|
19
|
+
): currency is PlatformCryptoCurrency {
|
|
20
|
+
return currency.type === PlatformCurrencyType.CryptoCurrency;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function isPlatformTokenCurrency(
|
|
24
|
+
currency: PlatformCurrency
|
|
25
|
+
): currency is PlatformERC20TokenCurrency {
|
|
26
|
+
return currency.type === PlatformCurrencyType.TokenCurrency;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function isPlatformERC20TokenCurrency(
|
|
30
|
+
currency: PlatformCurrency
|
|
31
|
+
): currency is PlatformERC20TokenCurrency {
|
|
32
|
+
return (currency as PlatformERC20TokenCurrency).standard === "ERC20";
|
|
33
|
+
}
|
package/src/platform/logic.ts
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { AppManifest, AppPlatform, AppBranch } from "./types";
|
|
3
|
-
import { getPlatformVersion } from "./version";
|
|
4
|
-
|
|
5
|
-
export function translateContent(content: any, locale = "en") {
|
|
1
|
+
export function translateContent(content: any, locale = "en"): string {
|
|
6
2
|
if (!content || typeof content !== "object") return content;
|
|
7
3
|
return content[locale] || content.en;
|
|
8
4
|
}
|
|
9
|
-
|
|
10
|
-
export function isSupported(manifest: AppManifest) {
|
|
11
|
-
return semver.satisfies(
|
|
12
|
-
semver.coerce(getPlatformVersion()) || "",
|
|
13
|
-
manifest.apiVersion
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function matchBranches(manifest: AppManifest, branches: AppBranch[]) {
|
|
18
|
-
return branches.indexOf(manifest.branch) > -1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function matchPlatform(manifest: AppManifest, platform: AppPlatform) {
|
|
22
|
-
return manifest.platform === "all" || manifest.platform === platform;
|
|
23
|
-
}
|