@ledgerhq/live-common 34.51.0-nightly.3 → 34.51.0-nightly.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/lib/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib/bridge/crypto-assets/index.js +2 -30
- package/lib/bridge/crypto-assets/index.js.map +1 -1
- package/lib/bridge/crypto-assets/index.test.js +5 -34
- package/lib/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +2 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +1 -1
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/currencies/cryptoIcons.test.js +4 -1
- package/lib/currencies/cryptoIcons.test.js.map +1 -1
- package/lib/currencies/index.d.ts +1 -1
- package/lib/currencies/index.d.ts.map +1 -1
- package/lib/currencies/index.js +1 -3
- package/lib/currencies/index.js.map +1 -1
- package/lib/deposit/deposit.test.js +29 -12
- package/lib/deposit/deposit.test.js.map +1 -1
- package/lib/deposit/helper.d.ts.map +1 -1
- package/lib/deposit/helper.js +5 -1
- package/lib/deposit/helper.js.map +1 -1
- package/lib/e2e/index.d.ts +2 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/exchange/swap/hooks/useFromState.test.js +4 -1
- package/lib/exchange/swap/hooks/useFromState.test.js.map +1 -1
- package/lib/exchange/swap/hooks/useReverseAccounts.test.js +4 -1
- package/lib/exchange/swap/hooks/useReverseAccounts.test.js.map +1 -1
- package/lib/exchange/swap/hooks/useToState.test.js +4 -1
- package/lib/exchange/swap/hooks/useToState.test.js.map +1 -1
- package/lib/exchange/swap/hooks/useUpdateMaxAmount.test.js +4 -1
- package/lib/exchange/swap/hooks/useUpdateMaxAmount.test.js.map +1 -1
- package/lib/exchange/swap/utils/index.test.js +4 -1
- package/lib/exchange/swap/utils/index.test.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/modularDrawer/modules/__test__/createNetworkConfiguration.test.d.ts +5 -0
- package/lib/modularDrawer/modules/__test__/createNetworkConfiguration.test.d.ts.map +1 -0
- package/lib/modularDrawer/modules/__test__/createNetworkConfiguration.test.js +266 -0
- package/lib/modularDrawer/modules/__test__/createNetworkConfiguration.test.js.map +1 -0
- package/lib/notifications/ServiceStatusProvider/index.d.ts +1 -1
- package/lib/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib/notifications/ServiceStatusProvider/index.js +1 -1
- package/lib/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js +4 -1
- package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
- package/lib-es/bridge/crypto-assets/index.js +2 -7
- package/lib-es/bridge/crypto-assets/index.js.map +1 -1
- package/lib-es/bridge/crypto-assets/index.test.js +5 -11
- package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +2 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/currencies/cryptoIcons.test.js +5 -2
- package/lib-es/currencies/cryptoIcons.test.js.map +1 -1
- package/lib-es/currencies/index.d.ts +1 -1
- package/lib-es/currencies/index.d.ts.map +1 -1
- package/lib-es/currencies/index.js +1 -1
- package/lib-es/currencies/index.js.map +1 -1
- package/lib-es/deposit/deposit.test.js +30 -13
- package/lib-es/deposit/deposit.test.js.map +1 -1
- package/lib-es/deposit/helper.d.ts.map +1 -1
- package/lib-es/deposit/helper.js +6 -2
- package/lib-es/deposit/helper.js.map +1 -1
- package/lib-es/e2e/index.d.ts +2 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/exchange/swap/hooks/useFromState.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useFromState.test.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useReverseAccounts.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useReverseAccounts.test.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useToState.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useToState.test.js.map +1 -1
- package/lib-es/exchange/swap/hooks/useUpdateMaxAmount.test.js +5 -2
- package/lib-es/exchange/swap/hooks/useUpdateMaxAmount.test.js.map +1 -1
- package/lib-es/exchange/swap/utils/index.test.js +5 -2
- package/lib-es/exchange/swap/utils/index.test.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/modularDrawer/modules/__test__/createNetworkConfiguration.test.d.ts +5 -0
- package/lib-es/modularDrawer/modules/__test__/createNetworkConfiguration.test.d.ts.map +1 -0
- package/lib-es/modularDrawer/modules/__test__/createNetworkConfiguration.test.js +264 -0
- package/lib-es/modularDrawer/modules/__test__/createNetworkConfiguration.test.js.map +1 -0
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.js +1 -1
- package/lib-es/notifications/ServiceStatusProvider/index.js.map +1 -1
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js +5 -2
- package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
- package/package.json +49 -49
- package/src/bridge/crypto-assets/index.test.ts +9 -11
- package/src/bridge/crypto-assets/index.ts +2 -8
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +6 -4
- package/src/bridge/generic-alpaca/utils.ts +1 -2
- package/src/currencies/cryptoIcons.test.ts +4 -4
- package/src/currencies/index.ts +0 -2
- package/src/deposit/deposit.test.ts +29 -14
- package/src/deposit/helper.ts +6 -2
- package/src/exchange/swap/hooks/useFromState.test.ts +4 -2
- package/src/exchange/swap/hooks/useReverseAccounts.test.ts +4 -2
- package/src/exchange/swap/hooks/useToState.test.ts +4 -2
- package/src/exchange/swap/hooks/useUpdateMaxAmount.test.ts +4 -2
- package/src/exchange/swap/utils/index.test.ts +4 -2
- package/src/featureFlags/defaultFeatures.ts +1 -0
- package/src/modularDrawer/modules/__test__/createNetworkConfiguration.test.ts +383 -0
- package/src/notifications/ServiceStatusProvider/index.tsx +1 -1
- package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/notifications/ServiceStatusProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmD,YAAY,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,KAAK,EAAE,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM5F,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC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AAiB,CAY/F;AAED,eAAO,MAAM,qBAAqB,wDAK/B,KAAK,KAAG,YAgCV,CAAC"}
|
|
@@ -37,7 +37,7 @@ function sanitizeName(name) {
|
|
|
37
37
|
* @param {EntryPoint} [entryPoint] - Entry point where the incidents are displayed (specifically for Ledger components)
|
|
38
38
|
* @returns {Incident[]} The list of incidents relevant to the provided tickers or Ledger components.
|
|
39
39
|
*/
|
|
40
|
-
export function filterServiceStatusIncidents(incidents, tickers = [], entryPoint) {
|
|
40
|
+
export function filterServiceStatusIncidents(incidents = [], tickers = [], entryPoint) {
|
|
41
41
|
if (!incidents.length)
|
|
42
42
|
return [];
|
|
43
43
|
if (!tickers.length)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/notifications/ServiceStatusProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAgB,MAAM,OAAO,CAAC;AAE7F,OAAO,iBAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAexD,MAAM,oBAAoB,GAAG,aAAa,CAAoB;IAC5D,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,KAAK;IAChB,cAAc,EAAE,SAAS;IACzB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;IACnC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,Y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C;KACF,CAAC,CACH,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CACjB,GAAG,EAAE,CAAC,CAAC;QACL,UAAU,EAAE,KAAK,IAAI,EAAE;YACrB,IAAI,CAAC;gBACH,IAAI,EAAE,aAAa;aACpB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,EACF,CAAC,IAAI,CAAC,CACP,CAAC;IACF,MAAM,KAAK,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,CAAC;IAC5D,OAAO,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAiC,CAAC;AACjG,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCryptoCurrencyById,
|
|
1
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
2
2
|
import { genAccount } from "../../mock/account";
|
|
3
3
|
import { getAccountTuplesForCurrency } from "../getAccountTuplesForCurrency";
|
|
4
4
|
function* accountGenerator(currency) {
|
|
@@ -48,7 +48,10 @@ describe("getAccountTuplesForCurrency", () => {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
describe("TokenCurrency", () => {
|
|
51
|
-
const
|
|
51
|
+
const token = findTokenById("ethereum/erc20/aave");
|
|
52
|
+
if (!token)
|
|
53
|
+
throw new Error("AAVE token not found");
|
|
54
|
+
const aaveToken = token;
|
|
52
55
|
test("returns correct parent accounts including a new subAccount when a TokenCurrency is provided", () => {
|
|
53
56
|
const ethAccounts = [
|
|
54
57
|
{ ...getEthAccount(), subAccounts: [] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccountTuplesForCurrency.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/getAccountTuplesForCurrency.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"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AE;aACjD,CAAC;YAEF,MAAM,OAAO,GAAG,2BAA2B,CACzC,SAAS,EACT,YAAY,EACZ,IAAI,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CACtC,CAAC;YAEF,MAAM,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-common",
|
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
|
4
|
-
"version": "34.51.0-nightly.
|
|
4
|
+
"version": "34.51.0-nightly.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@dfinity/agent": "^0.21.0",
|
|
107
107
|
"@dfinity/candid": "^0.21.0",
|
|
108
108
|
"@dfinity/principal": "^0.15.6",
|
|
109
|
-
"@ledgerhq/device-management-kit": "0.9.
|
|
109
|
+
"@ledgerhq/device-management-kit": "0.9.1",
|
|
110
110
|
"@ledgerhq/live-app-sdk": "^0.8.1",
|
|
111
111
|
"@ledgerhq/wallet-api-client": "^1.12.1",
|
|
112
112
|
"@ledgerhq/wallet-api-core": "^1.24.1",
|
|
@@ -166,79 +166,79 @@
|
|
|
166
166
|
"xstate": "^5.19.2",
|
|
167
167
|
"yargs": "^17.0.0",
|
|
168
168
|
"zod": "^3.22.4",
|
|
169
|
-
"@ledgerhq/coin-algorand": "^0.11.0-nightly.
|
|
170
|
-
"@ledgerhq/coin-aptos": "^3.4.0-nightly.
|
|
171
|
-
"@ledgerhq/coin-bitcoin": "^0.23.0-nightly.
|
|
172
|
-
"@ledgerhq/coin-canton": "^0.8.0-nightly.
|
|
173
|
-
"@ledgerhq/coin-cardano": "^0.13.0-nightly.
|
|
174
|
-
"@ledgerhq/coin-casper": "^2.2.0-nightly.
|
|
175
|
-
"@ledgerhq/coin-celo": "^1.6.0-nightly.
|
|
176
|
-
"@ledgerhq/coin-cosmos": "^0.18.0-nightly.
|
|
177
|
-
"@ledgerhq/coin-evm": "^2.33.0-nightly.
|
|
178
|
-
"@ledgerhq/coin-filecoin": "^1.13.0-nightly.
|
|
179
|
-
"@ledgerhq/coin-framework": "^6.7.0-nightly.
|
|
180
|
-
"@ledgerhq/coin-hedera": "^1.12.0-nightly.
|
|
181
|
-
"@ledgerhq/coin-icon": "^0.13.0-nightly.
|
|
182
|
-
"@ledgerhq/coin-internet_computer": "^1.9.0-nightly.
|
|
183
|
-
"@ledgerhq/coin-kaspa": "^1.3.0-nightly.
|
|
184
|
-
"@ledgerhq/coin-mina": "^1.3.0-nightly.
|
|
185
|
-
"@ledgerhq/coin-multiversx": "^0.6.0-nightly.
|
|
186
|
-
"@ledgerhq/coin-near": "^0.14.0-nightly.
|
|
187
|
-
"@ledgerhq/coin-polkadot": "^6.11.0-nightly.
|
|
188
|
-
"@ledgerhq/coin-solana": "^0.35.0-nightly.
|
|
189
|
-
"@ledgerhq/coin-stacks": "^0.10.0-nightly.
|
|
190
|
-
"@ledgerhq/coin-stellar": "^6.5.0-nightly.
|
|
191
|
-
"@ledgerhq/coin-sui": "^0.16.0-nightly.
|
|
192
|
-
"@ledgerhq/coin-
|
|
193
|
-
"@ledgerhq/coin-
|
|
194
|
-
"@ledgerhq/coin-
|
|
195
|
-
"@ledgerhq/coin-
|
|
196
|
-
"@ledgerhq/coin-xrp": "^7.6.0-nightly.1",
|
|
169
|
+
"@ledgerhq/coin-algorand": "^0.11.0-nightly.3",
|
|
170
|
+
"@ledgerhq/coin-aptos": "^3.4.0-nightly.3",
|
|
171
|
+
"@ledgerhq/coin-bitcoin": "^0.23.0-nightly.3",
|
|
172
|
+
"@ledgerhq/coin-canton": "^0.8.0-nightly.3",
|
|
173
|
+
"@ledgerhq/coin-cardano": "^0.13.0-nightly.3",
|
|
174
|
+
"@ledgerhq/coin-casper": "^2.2.0-nightly.3",
|
|
175
|
+
"@ledgerhq/coin-celo": "^1.6.0-nightly.3",
|
|
176
|
+
"@ledgerhq/coin-cosmos": "^0.18.0-nightly.3",
|
|
177
|
+
"@ledgerhq/coin-evm": "^2.33.0-nightly.3",
|
|
178
|
+
"@ledgerhq/coin-filecoin": "^1.13.0-nightly.3",
|
|
179
|
+
"@ledgerhq/coin-framework": "^6.7.0-nightly.3",
|
|
180
|
+
"@ledgerhq/coin-hedera": "^1.12.0-nightly.3",
|
|
181
|
+
"@ledgerhq/coin-icon": "^0.13.0-nightly.3",
|
|
182
|
+
"@ledgerhq/coin-internet_computer": "^1.9.0-nightly.3",
|
|
183
|
+
"@ledgerhq/coin-kaspa": "^1.3.0-nightly.3",
|
|
184
|
+
"@ledgerhq/coin-mina": "^1.3.0-nightly.3",
|
|
185
|
+
"@ledgerhq/coin-multiversx": "^0.6.0-nightly.3",
|
|
186
|
+
"@ledgerhq/coin-near": "^0.14.0-nightly.3",
|
|
187
|
+
"@ledgerhq/coin-polkadot": "^6.11.0-nightly.3",
|
|
188
|
+
"@ledgerhq/coin-solana": "^0.35.0-nightly.3",
|
|
189
|
+
"@ledgerhq/coin-stacks": "^0.10.0-nightly.3",
|
|
190
|
+
"@ledgerhq/coin-stellar": "^6.5.0-nightly.3",
|
|
191
|
+
"@ledgerhq/coin-sui": "^0.16.0-nightly.4",
|
|
192
|
+
"@ledgerhq/coin-ton": "^0.15.0-nightly.3",
|
|
193
|
+
"@ledgerhq/coin-tron": "^5.5.0-nightly.3",
|
|
194
|
+
"@ledgerhq/coin-vechain": "^2.11.0-nightly.3",
|
|
195
|
+
"@ledgerhq/coin-xrp": "^7.6.0-nightly.3",
|
|
197
196
|
"@ledgerhq/crypto-icons-ui": "^1.21.0-nightly.1",
|
|
198
|
-
"@ledgerhq/cryptoassets": "^13.31.0-nightly.
|
|
199
|
-
"@ledgerhq/device-core": "^0.6.6-nightly.
|
|
197
|
+
"@ledgerhq/cryptoassets": "^13.31.0-nightly.3",
|
|
198
|
+
"@ledgerhq/device-core": "^0.6.6-nightly.2",
|
|
200
199
|
"@ledgerhq/devices": "8.6.1",
|
|
201
200
|
"@ledgerhq/errors": "^6.26.0",
|
|
202
201
|
"@ledgerhq/hw-app-algorand": "^6.31.8",
|
|
203
202
|
"@ledgerhq/hw-app-aptos": "^6.34.8",
|
|
204
203
|
"@ledgerhq/hw-app-btc": "^10.11.2",
|
|
205
|
-
"@ledgerhq/hw-app-celo": "^6.35.1-nightly.
|
|
204
|
+
"@ledgerhq/hw-app-celo": "^6.35.1-nightly.2",
|
|
206
205
|
"@ledgerhq/hw-app-cosmos": "^6.32.8",
|
|
207
|
-
"@ledgerhq/hw-app-eth": "^6.46.1-nightly.
|
|
208
|
-
"@ledgerhq/hw-app-exchange": "^0.15.0",
|
|
206
|
+
"@ledgerhq/hw-app-eth": "^6.46.1-nightly.2",
|
|
207
|
+
"@ledgerhq/hw-app-exchange": "^0.15.1-nightly.0",
|
|
209
208
|
"@ledgerhq/hw-app-hedera": "^1.2.8",
|
|
210
209
|
"@ledgerhq/hw-app-icon": "^1.3.8",
|
|
211
|
-
"@ledgerhq/hw-app-kaspa": "^1.3.1",
|
|
212
210
|
"@ledgerhq/hw-app-multiversx": "^6.25.3",
|
|
213
211
|
"@ledgerhq/hw-app-near": "^6.31.8",
|
|
214
|
-
"@ledgerhq/hw-app-polkadot": "^6.34.8",
|
|
215
212
|
"@ledgerhq/hw-app-str": "^7.2.8",
|
|
216
213
|
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
214
|
+
"@ledgerhq/coin-tezos": "^6.7.0-nightly.3",
|
|
215
|
+
"@ledgerhq/hw-app-kaspa": "^1.3.1",
|
|
216
|
+
"@ledgerhq/hw-app-polkadot": "^6.34.8",
|
|
217
217
|
"@ledgerhq/hw-app-tezos": "^6.31.8",
|
|
218
218
|
"@ledgerhq/hw-app-trx": "^6.31.8",
|
|
219
|
-
"@ledgerhq/hw-app-vet": "^0.
|
|
219
|
+
"@ledgerhq/hw-app-vet": "^0.7.0-nightly.3",
|
|
220
220
|
"@ledgerhq/hw-app-xrp": "^6.32.6",
|
|
221
|
-
"@ledgerhq/hw-bolos": "^6.32.8",
|
|
222
221
|
"@ledgerhq/hw-transport": "6.31.12",
|
|
223
222
|
"@ledgerhq/hw-transport-mocker": "^6.29.12",
|
|
224
223
|
"@ledgerhq/ledger-cal-service": "^1.7.0-nightly.0",
|
|
225
224
|
"@ledgerhq/ledger-trust-service": "^0.3.15-nightly.0",
|
|
226
225
|
"@ledgerhq/live-config": "^3.2.0",
|
|
227
|
-
"@ledgerhq/live-countervalues": "^0.8.0-nightly.
|
|
228
|
-
"@ledgerhq/live-countervalues-react": "^0.7.0-nightly.
|
|
229
|
-
"@ledgerhq/live-dmk-shared": "^0.14.0-nightly.
|
|
226
|
+
"@ledgerhq/live-countervalues": "^0.8.0-nightly.3",
|
|
227
|
+
"@ledgerhq/live-countervalues-react": "^0.7.0-nightly.3",
|
|
228
|
+
"@ledgerhq/live-dmk-shared": "^0.14.0-nightly.1",
|
|
230
229
|
"@ledgerhq/live-env": "^2.19.0-nightly.0",
|
|
231
230
|
"@ledgerhq/live-hooks": "0.2.0-nightly.0",
|
|
232
231
|
"@ledgerhq/live-network": "^2.0.20-nightly.0",
|
|
233
232
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
234
|
-
"@ledgerhq/live-signer-
|
|
235
|
-
"@ledgerhq/
|
|
236
|
-
"@ledgerhq/live-signer-solana": "^0.
|
|
237
|
-
"@ledgerhq/live-wallet": "^0.14.3-nightly.
|
|
233
|
+
"@ledgerhq/live-signer-evm": "^0.8.2-nightly.3",
|
|
234
|
+
"@ledgerhq/hw-bolos": "^6.32.8",
|
|
235
|
+
"@ledgerhq/live-signer-solana": "^0.6.0-nightly.3",
|
|
236
|
+
"@ledgerhq/live-wallet": "^0.14.3-nightly.3",
|
|
238
237
|
"@ledgerhq/logs": "^6.13.0",
|
|
239
238
|
"@ledgerhq/speculos-transport": "^0.2.13-nightly.0",
|
|
240
239
|
"@ledgerhq/wallet-api-acre-module": "^0.8.0-nightly.1",
|
|
241
|
-
"@ledgerhq/wallet-api-exchange-module": "^0.17.0-nightly.1"
|
|
240
|
+
"@ledgerhq/wallet-api-exchange-module": "^0.17.0-nightly.1",
|
|
241
|
+
"@ledgerhq/live-signer-canton": "^0.4.2-nightly.3"
|
|
242
242
|
},
|
|
243
243
|
"devDependencies": {
|
|
244
244
|
"@solana/web3.js": "1.95.4",
|
|
@@ -286,10 +286,10 @@
|
|
|
286
286
|
"undici": "6.19.2",
|
|
287
287
|
"uuid": "^8.3.2",
|
|
288
288
|
"ws": "7",
|
|
289
|
-
"@ledgerhq/device-react": "^0.3.0-nightly.
|
|
289
|
+
"@ledgerhq/device-react": "^0.3.0-nightly.2",
|
|
290
290
|
"@ledgerhq/types-cryptoassets": "^7.29.0-nightly.0",
|
|
291
291
|
"@ledgerhq/types-devices": "^6.27.0",
|
|
292
|
-
"@ledgerhq/types-live": "^6.87.0-nightly.
|
|
292
|
+
"@ledgerhq/types-live": "^6.87.0-nightly.2"
|
|
293
293
|
},
|
|
294
294
|
"scripts": {
|
|
295
295
|
"build": "zx ./scripts/build-ts.mjs",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
2
2
|
import { getCryptoAssetsStore, setCryptoAssetsStore } from ".";
|
|
3
|
-
import
|
|
3
|
+
import { legacyCryptoAssetsStore } from "@ledgerhq/cryptoassets/tokens";
|
|
4
4
|
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
|
5
5
|
|
|
6
6
|
describe("Testing CryptoAssetStore", () => {
|
|
@@ -13,11 +13,10 @@ describe("Testing CryptoAssetStore", () => {
|
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
const store = getCryptoAssetsStore();
|
|
16
|
-
expect(store).
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
16
|
+
expect(store.findTokenById).toBe(legacyCryptoAssetsStore.findTokenById);
|
|
17
|
+
expect(store.findTokenByAddressInCurrency).toBe(
|
|
18
|
+
legacyCryptoAssetsStore.findTokenByAddressInCurrency,
|
|
19
|
+
);
|
|
21
20
|
});
|
|
22
21
|
|
|
23
22
|
it("should return the default methods from cryptoassets libs when feature flag is disabled", () => {
|
|
@@ -29,11 +28,10 @@ describe("Testing CryptoAssetStore", () => {
|
|
|
29
28
|
});
|
|
30
29
|
|
|
31
30
|
const store = getCryptoAssetsStore();
|
|
32
|
-
expect(store).
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
31
|
+
expect(store.findTokenById).toBe(legacyCryptoAssetsStore.findTokenById);
|
|
32
|
+
expect(store.findTokenByAddressInCurrency).toBe(
|
|
33
|
+
legacyCryptoAssetsStore.findTokenByAddressInCurrency,
|
|
34
|
+
);
|
|
37
35
|
});
|
|
38
36
|
|
|
39
37
|
it("should throw an error when no store is set and feature flag is enabled", () => {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
|
|
2
|
-
import
|
|
2
|
+
import { legacyCryptoAssetsStore } from "@ledgerhq/cryptoassets/tokens";
|
|
3
3
|
import type { CryptoAssetsStore } from "@ledgerhq/types-live";
|
|
4
4
|
|
|
5
|
-
const legacyStore: CryptoAssetsStore = {
|
|
6
|
-
getTokenById: legacy.getTokenById,
|
|
7
|
-
findTokenById: legacy.findTokenById,
|
|
8
|
-
findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
5
|
let cryptoAssetsStore: CryptoAssetsStore | undefined = undefined;
|
|
12
6
|
|
|
13
7
|
export function setCryptoAssetsStore(store: CryptoAssetsStore) {
|
|
@@ -18,7 +12,7 @@ export function getCryptoAssetsStore(): CryptoAssetsStore {
|
|
|
18
12
|
const featureEnabled =
|
|
19
13
|
LiveConfig.isConfigSet() && LiveConfig.getValueByKey("feature_cal_lazy_loading");
|
|
20
14
|
if (!featureEnabled) {
|
|
21
|
-
return
|
|
15
|
+
return legacyCryptoAssetsStore;
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
if (!cryptoAssetsStore) {
|
|
@@ -36,14 +36,16 @@ export function genericGetTransactionStatus(
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const { errors, warnings, estimatedFees, amount, totalSpent } =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const { errors, warnings, estimatedFees, amount, totalSpent, totalFees } =
|
|
40
|
+
await alpacaApi.validateIntent(
|
|
41
|
+
transactionToIntent(account, draftTransaction, alpacaApi.computeIntentType),
|
|
42
|
+
{ value: transaction.fees ? BigInt(transaction.fees.toString()) : 0n },
|
|
43
|
+
);
|
|
43
44
|
|
|
44
45
|
return {
|
|
45
46
|
errors,
|
|
46
47
|
warnings,
|
|
48
|
+
totalFees: typeof totalFees === "bigint" ? new BigNumber(totalFees.toString()) : undefined,
|
|
47
49
|
estimatedFees:
|
|
48
50
|
!transaction.fees || transaction.fees.isZero()
|
|
49
51
|
? new BigNumber(estimatedFees.toString())
|
|
@@ -141,8 +141,7 @@ export function transactionToIntent(
|
|
|
141
141
|
amount,
|
|
142
142
|
asset: { type: "native", name: account.currency.name, unit: account.currency.units[0] },
|
|
143
143
|
useAllAmount,
|
|
144
|
-
feesStrategy:
|
|
145
|
-
transaction.feesStrategy === "custom" ? undefined : transaction.feesStrategy ?? undefined,
|
|
144
|
+
feesStrategy: transaction.feesStrategy ?? undefined,
|
|
146
145
|
data: Buffer.isBuffer(transaction.data)
|
|
147
146
|
? { type: "buffer", value: transaction.data }
|
|
148
147
|
: { type: "none" },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
|
2
2
|
import { inferCryptoCurrencyIcon } from "./cryptoIcons";
|
|
3
|
-
import {
|
|
3
|
+
import { findTokenById } from "@ledgerhq/cryptoassets/tokens";
|
|
4
4
|
|
|
5
5
|
describe("inferCryptoCurrencyIcon", () => {
|
|
6
6
|
const registryMock = {
|
|
@@ -23,8 +23,8 @@ describe("inferCryptoCurrencyIcon", () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
test("USDT is inferred properly", () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
).toBe(4);
|
|
26
|
+
const usdt = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
27
|
+
if (!usdt) throw new Error("USDT token not found");
|
|
28
|
+
expect(inferCryptoCurrencyIcon(registryMock, usdt)).toBe(4);
|
|
29
29
|
});
|
|
30
30
|
});
|
package/src/currencies/index.ts
CHANGED
|
@@ -9,12 +9,12 @@ import { MOCK_TOKENS_ONLY, MOCK_WITH_TOKEN_AND_CURRENCY_ASSET, MOCK_IDS, MOCK_PO
|
|
|
9
9
|
import { MappedAsset } from "./type";
|
|
10
10
|
import {
|
|
11
11
|
getCryptoCurrencyById,
|
|
12
|
-
|
|
12
|
+
findTokenById,
|
|
13
13
|
setSupportedCurrencies,
|
|
14
14
|
sortCurrenciesByIds,
|
|
15
15
|
} from "../currencies/index";
|
|
16
16
|
import { isCurrencySupported, listSupportedCurrencies, listTokens } from "../currencies";
|
|
17
|
-
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
17
|
+
import { CryptoOrTokenCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
18
18
|
|
|
19
19
|
const TOKEN_ONLY_ASSETS = MOCK_TOKENS_ONLY as MappedAsset[];
|
|
20
20
|
|
|
@@ -107,7 +107,9 @@ describe("Deposit logic", () => {
|
|
|
107
107
|
|
|
108
108
|
describe("groupCurrenciesByProvider", () => {
|
|
109
109
|
test("should group currencies by provider", () => {
|
|
110
|
-
const currencies = TOKEN_ONLY_ASSETS.map(asset =>
|
|
110
|
+
const currencies = TOKEN_ONLY_ASSETS.map(asset => findTokenById(asset.ledgerId)).filter(
|
|
111
|
+
(t): t is TokenCurrency => t !== undefined,
|
|
112
|
+
);
|
|
111
113
|
const { currenciesByProvider } = groupCurrenciesByProvider(TOKEN_ONLY_ASSETS, currencies);
|
|
112
114
|
expect(currenciesByProvider).toEqual([
|
|
113
115
|
{
|
|
@@ -120,9 +122,9 @@ describe("Deposit logic", () => {
|
|
|
120
122
|
test("should handle POL assets correctly", () => {
|
|
121
123
|
const currenciesPol = MOCK_POL.map(asset =>
|
|
122
124
|
asset.$type === "Token"
|
|
123
|
-
?
|
|
125
|
+
? findTokenById(asset.ledgerId)
|
|
124
126
|
: getCryptoCurrencyById(asset.ledgerId),
|
|
125
|
-
);
|
|
127
|
+
).filter((c): c is CryptoOrTokenCurrency => c !== undefined);
|
|
126
128
|
const { currenciesByProvider: currenciesByProviderBis, sortedCryptoCurrencies } =
|
|
127
129
|
groupCurrenciesByProvider(MOCK_POL as MappedAsset[], currenciesPol);
|
|
128
130
|
expect(currenciesByProviderBis).toEqual([
|
|
@@ -136,7 +138,9 @@ describe("Deposit logic", () => {
|
|
|
136
138
|
});
|
|
137
139
|
|
|
138
140
|
test("should handle empty assets array", () => {
|
|
139
|
-
const currencies = TOKEN_ONLY_ASSETS.map(asset =>
|
|
141
|
+
const currencies = TOKEN_ONLY_ASSETS.map(asset => findTokenById(asset.ledgerId)).filter(
|
|
142
|
+
(t): t is TokenCurrency => t !== undefined,
|
|
143
|
+
);
|
|
140
144
|
const { currenciesByProvider, sortedCryptoCurrencies } = groupCurrenciesByProvider(
|
|
141
145
|
[],
|
|
142
146
|
currencies,
|
|
@@ -172,7 +176,8 @@ describe("Deposit logic", () => {
|
|
|
172
176
|
|
|
173
177
|
setSupportedCurrencies(["ethereum"]);
|
|
174
178
|
const ethCurrency = getCryptoCurrencyById("ethereum");
|
|
175
|
-
const tokenCurrency =
|
|
179
|
+
const tokenCurrency = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
180
|
+
if (!tokenCurrency) throw new Error("Token not found");
|
|
176
181
|
|
|
177
182
|
const { sortedCryptoCurrencies } = groupCurrenciesByProvider(mockAssets, [
|
|
178
183
|
tokenCurrency,
|
|
@@ -188,7 +193,9 @@ describe("Deposit logic", () => {
|
|
|
188
193
|
{ ...TOKEN_ONLY_ASSETS[0], ledgerId: "different-id" },
|
|
189
194
|
] as MappedAsset[];
|
|
190
195
|
|
|
191
|
-
const
|
|
196
|
+
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
197
|
+
if (!token) throw new Error("Token not found");
|
|
198
|
+
const currencies = [token];
|
|
192
199
|
const { currenciesByProvider } = groupCurrenciesByProvider(duplicateAssets, currencies);
|
|
193
200
|
|
|
194
201
|
expect(currenciesByProvider).toHaveLength(1);
|
|
@@ -319,7 +326,7 @@ describe("Deposit logic", () => {
|
|
|
319
326
|
MOCK_TOKENS_ONLY as MappedAsset[],
|
|
320
327
|
currencies,
|
|
321
328
|
);
|
|
322
|
-
expect(sortedCryptoCurrencies).toEqual([
|
|
329
|
+
expect(sortedCryptoCurrencies).toEqual([findTokenById("polygon/erc20/(pos)_tether_usd")]);
|
|
323
330
|
});
|
|
324
331
|
|
|
325
332
|
it("should return only BSC token while its currency is supported in the list", () => {
|
|
@@ -333,7 +340,7 @@ describe("Deposit logic", () => {
|
|
|
333
340
|
MOCK_TOKENS_ONLY as MappedAsset[],
|
|
334
341
|
currencies,
|
|
335
342
|
);
|
|
336
|
-
expect(sortedCryptoCurrencies).toEqual([
|
|
343
|
+
expect(sortedCryptoCurrencies).toEqual([findTokenById("bsc/bep20/binance-peg_bsc-usd")]);
|
|
337
344
|
});
|
|
338
345
|
|
|
339
346
|
it("should return tokens that are actually supported based on mock data", () => {
|
|
@@ -596,7 +603,9 @@ describe("Deposit logic", () => {
|
|
|
596
603
|
{ ...TOKEN_ONLY_ASSETS[0], providerId: null as any },
|
|
597
604
|
] as MappedAsset[];
|
|
598
605
|
|
|
599
|
-
const
|
|
606
|
+
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
607
|
+
if (!token) throw new Error("Token not found");
|
|
608
|
+
const currencies = [token];
|
|
600
609
|
|
|
601
610
|
expect(() => {
|
|
602
611
|
groupCurrenciesByProvider(malformedAssets, currencies);
|
|
@@ -608,7 +617,9 @@ describe("Deposit logic", () => {
|
|
|
608
617
|
{ ...TOKEN_ONLY_ASSETS[0], providerId: "" },
|
|
609
618
|
] as MappedAsset[];
|
|
610
619
|
|
|
611
|
-
const
|
|
620
|
+
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
621
|
+
if (!token) throw new Error("Token not found");
|
|
622
|
+
const currencies = [token];
|
|
612
623
|
|
|
613
624
|
expect(() => {
|
|
614
625
|
groupCurrenciesByProvider(partiallyMalformedAssets, currencies);
|
|
@@ -624,7 +635,9 @@ describe("Deposit logic", () => {
|
|
|
624
635
|
providerId: `provider_${index % 10}`,
|
|
625
636
|
})) as MappedAsset[];
|
|
626
637
|
|
|
627
|
-
const
|
|
638
|
+
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
639
|
+
if (!token) throw new Error("Token not found");
|
|
640
|
+
const currencies = [token];
|
|
628
641
|
|
|
629
642
|
const startTime = Date.now();
|
|
630
643
|
const result = groupCurrenciesByProvider(largeAssetList, currencies);
|
|
@@ -640,7 +653,9 @@ describe("Deposit logic", () => {
|
|
|
640
653
|
{ ...TOKEN_ONLY_ASSETS[0], ledgerId: TOKEN_ONLY_ASSETS[0].ledgerId.toUpperCase() },
|
|
641
654
|
] as MappedAsset[];
|
|
642
655
|
|
|
643
|
-
const
|
|
656
|
+
const token = findTokenById(TOKEN_ONLY_ASSETS[0].ledgerId);
|
|
657
|
+
if (!token) throw new Error("Token not found");
|
|
658
|
+
const currencies = [token];
|
|
644
659
|
const { currenciesByProvider } = groupCurrenciesByProvider(mixedCaseAssets, currencies);
|
|
645
660
|
|
|
646
661
|
expect(currenciesByProvider).toHaveLength(1);
|
package/src/deposit/helper.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { MappedAsset, CurrenciesByProviderId, GroupedCurrencies } from "./type";
|
|
|
3
3
|
import {
|
|
4
4
|
currenciesByMarketcap,
|
|
5
5
|
getCryptoCurrencyById,
|
|
6
|
-
|
|
6
|
+
findTokenById,
|
|
7
7
|
hasCryptoCurrencyId,
|
|
8
8
|
} from "../currencies";
|
|
9
9
|
import { getMappedAssets } from "./api";
|
|
@@ -75,5 +75,9 @@ export const getTokenOrCryptoCurrencyById = (id: string): CryptoOrTokenCurrency
|
|
|
75
75
|
if (hasCryptoCurrencyId(id)) {
|
|
76
76
|
return getCryptoCurrencyById(id);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
const token = findTokenById(id);
|
|
79
|
+
if (!token) {
|
|
80
|
+
throw new Error(`token with id "${id}" not found`);
|
|
81
|
+
}
|
|
82
|
+
return token;
|
|
79
83
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById,
|
|
5
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import { Account } from "@ledgerhq/types-live";
|
|
7
7
|
import { renderHook, act } from "@testing-library/react";
|
|
8
8
|
import BigNumber from "bignumber.js";
|
|
@@ -14,7 +14,9 @@ import { useFromState } from "./useFromState";
|
|
|
14
14
|
|
|
15
15
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
16
16
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
17
|
-
const
|
|
17
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
18
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
19
|
+
const USDT = usdtToken;
|
|
18
20
|
|
|
19
21
|
jest.useFakeTimers();
|
|
20
22
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById,
|
|
5
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import type { Account } from "@ledgerhq/types-live";
|
|
7
7
|
import { renderHook, act } from "@testing-library/react";
|
|
8
8
|
import { genTokenAccount } from "@ledgerhq/coin-framework/mocks/account";
|
|
@@ -11,7 +11,9 @@ import { useReverseAccounts } from "./useReverseAccounts";
|
|
|
11
11
|
|
|
12
12
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
13
13
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
14
|
-
const
|
|
14
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
15
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
16
|
+
const USDT = usdtToken;
|
|
15
17
|
|
|
16
18
|
const fromParentAccount = genAccount("mocked-account-2", {
|
|
17
19
|
currency: ETH,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
5
|
import { renderHook, act } from "@testing-library/react";
|
|
6
|
-
import { getCryptoCurrencyById,
|
|
6
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
7
7
|
import { selectorStateDefaultValues, useToState } from ".";
|
|
8
8
|
import { genTokenAccount } from "@ledgerhq/coin-framework/mocks/account";
|
|
9
9
|
import { genAccount } from "../../../mock/account";
|
|
@@ -12,7 +12,9 @@ import type { Account } from "@ledgerhq/types-live";
|
|
|
12
12
|
|
|
13
13
|
const BTC = getCryptoCurrencyById("bitcoin");
|
|
14
14
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
15
|
-
const
|
|
15
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
16
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
17
|
+
const USDT = usdtToken;
|
|
16
18
|
|
|
17
19
|
const selectedAccount = genAccount("mocked-account-selected", { currency: ETH });
|
|
18
20
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import "../../../__tests__/test-helpers/dom-polyfill";
|
|
5
|
-
import { getCryptoCurrencyById,
|
|
5
|
+
import { getCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets";
|
|
6
6
|
import { act, renderHook } from "@testing-library/react";
|
|
7
7
|
import BigNumber from "bignumber.js";
|
|
8
8
|
import { checkAccountSupported } from "../../../account/index";
|
|
@@ -19,7 +19,9 @@ jest.mock("../../../families/evm/bridge/mock");
|
|
|
19
19
|
const mockedEstimateMaxSpendable = jest.mocked(ethBridge.accountBridge.estimateMaxSpendable);
|
|
20
20
|
|
|
21
21
|
const ETH = getCryptoCurrencyById("ethereum");
|
|
22
|
-
const
|
|
22
|
+
const usdtToken = findTokenById("ethereum/erc20/usd_tether__erc20_");
|
|
23
|
+
if (!usdtToken) throw new Error("USDT token not found");
|
|
24
|
+
const USDT = usdtToken;
|
|
23
25
|
|
|
24
26
|
const parentAccount = genAccount("parent-account", {
|
|
25
27
|
currency: ETH,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { findTokenById } from "@ledgerhq/cryptoassets";
|
|
2
2
|
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
3
3
|
import type { Account, TokenAccount } from "@ledgerhq/types-live";
|
|
4
4
|
import BigNumber from "bignumber.js";
|
|
@@ -87,7 +87,9 @@ describe("swap/utils/getAccountTuplesForCurrency", () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
describe("TokenCurrency", () => {
|
|
90
|
-
const
|
|
90
|
+
const token = findTokenById("ethereum/erc20/aave");
|
|
91
|
+
if (!token) throw new Error("AAVE token not found");
|
|
92
|
+
const aaveToken = Object.freeze(token);
|
|
91
93
|
|
|
92
94
|
test("returns correct parent accounts including a new subAccount when a TokenCurrency is provided", () => {
|
|
93
95
|
const ethAccounts = [
|