@ledgerhq/live-common 34.54.0-nightly.20251205023918 → 34.54.0-nightly.20251205111238
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/currencies/helpers.d.ts +1 -0
- package/lib/currencies/helpers.d.ts.map +1 -1
- package/lib/currencies/helpers.js +7 -1
- package/lib/currencies/helpers.js.map +1 -1
- package/lib-es/currencies/helpers.d.ts +1 -0
- package/lib-es/currencies/helpers.d.ts.map +1 -1
- package/lib-es/currencies/helpers.js +5 -0
- package/lib-es/currencies/helpers.js.map +1 -1
- package/package.json +53 -53
- package/src/currencies/helpers.test.ts +10 -1
- package/src/currencies/helpers.ts +6 -0
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +57 -11
|
@@ -5,4 +5,5 @@ export declare function isUTXOCompliant(currencyFamily: string): boolean;
|
|
|
5
5
|
export type CurrencyFilters = {
|
|
6
6
|
currencies?: string[];
|
|
7
7
|
};
|
|
8
|
+
export declare function getFamilyByCurrencyId(currencyId: string): CryptoCurrency["family"] | undefined;
|
|
8
9
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGvF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAAI,cAAc,CAE/E;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAAI,aAAa,CAE7E;AAED,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAG9F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isUTXOCompliant = exports.isTokenCurrency = exports.isCryptoCurrency = void 0;
|
|
3
|
+
exports.getFamilyByCurrencyId = exports.isUTXOCompliant = exports.isTokenCurrency = exports.isCryptoCurrency = void 0;
|
|
4
|
+
const cryptoassets_1 = require("@ledgerhq/cryptoassets");
|
|
4
5
|
function isCryptoCurrency(currency) {
|
|
5
6
|
return currency.type === "CryptoCurrency";
|
|
6
7
|
}
|
|
@@ -13,4 +14,9 @@ function isUTXOCompliant(currencyFamily) {
|
|
|
13
14
|
return currencyFamily === "bitcoin" || currencyFamily === "cardano";
|
|
14
15
|
}
|
|
15
16
|
exports.isUTXOCompliant = isUTXOCompliant;
|
|
17
|
+
function getFamilyByCurrencyId(currencyId) {
|
|
18
|
+
const currency = (0, cryptoassets_1.findCryptoCurrencyById)(currencyId);
|
|
19
|
+
return currency?.family;
|
|
20
|
+
}
|
|
21
|
+
exports.getFamilyByCurrencyId = getFamilyByCurrencyId;
|
|
16
22
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":";;;AACA,yDAAgE;AAEhE,SAAgB,gBAAgB,CAAC,QAAkB;IACjD,OAAO,QAAQ,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAC5C,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,QAAkB;IAChD,OAAO,QAAQ,CAAC,IAAI,KAAK,eAAe,CAAC;AAC3C,CAAC;AAFD,0CAEC;AAED,SAAgB,eAAe,CAAC,cAAsB;IACpD,OAAO,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS,CAAC;AACtE,CAAC;AAFD,0CAEC;AAMD,SAAgB,qBAAqB,CAAC,UAAkB;IACtD,MAAM,QAAQ,GAAG,IAAA,qCAAsB,EAAC,UAAU,CAAC,CAAC;IACpD,OAAO,QAAQ,EAAE,MAAM,CAAC;AAC1B,CAAC;AAHD,sDAGC"}
|
|
@@ -5,4 +5,5 @@ export declare function isUTXOCompliant(currencyFamily: string): boolean;
|
|
|
5
5
|
export type CurrencyFilters = {
|
|
6
6
|
currencies?: string[];
|
|
7
7
|
};
|
|
8
|
+
export declare function getFamilyByCurrencyId(currencyId: string): CryptoCurrency["family"] | undefined;
|
|
8
9
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGvF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAAI,cAAc,CAE/E;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAAI,aAAa,CAE7E;AAED,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,SAAS,CAG9F"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
1
2
|
export function isCryptoCurrency(currency) {
|
|
2
3
|
return currency.type === "CryptoCurrency";
|
|
3
4
|
}
|
|
@@ -7,4 +8,8 @@ export function isTokenCurrency(currency) {
|
|
|
7
8
|
export function isUTXOCompliant(currencyFamily) {
|
|
8
9
|
return currencyFamily === "bitcoin" || currencyFamily === "cardano";
|
|
9
10
|
}
|
|
11
|
+
export function getFamilyByCurrencyId(currencyId) {
|
|
12
|
+
const currency = findCryptoCurrencyById(currencyId);
|
|
13
|
+
return currency?.family;
|
|
14
|
+
}
|
|
10
15
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/currencies/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,UAAU,gBAAgB,CAAC,QAAkB;IACjD,OAAO,QAAQ,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAkB;IAChD,OAAO,QAAQ,CAAC,IAAI,KAAK,eAAe,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,cAAsB;IACpD,OAAO,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS,CAAC;AACtE,CAAC;AAMD,MAAM,UAAU,qBAAqB,CAAC,UAAkB;IACtD,MAAM,QAAQ,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IACpD,OAAO,QAAQ,EAAE,MAAM,CAAC;AAC1B,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.54.0-nightly.
|
|
4
|
+
"version": "34.54.0-nightly.20251205111238",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@blooo/hw-app-acre": "^1.1.1",
|
|
116
116
|
"@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.2",
|
|
117
117
|
"@ledgerhq/device-management-kit": "0.11.2",
|
|
118
|
-
"@ledgerhq/speculos-device-controller": "0.
|
|
118
|
+
"@ledgerhq/speculos-device-controller": "0.2.0",
|
|
119
119
|
"@ledgerhq/live-app-sdk": "^0.8.1",
|
|
120
120
|
"@ledgerhq/wallet-api-client": "^1.12.6",
|
|
121
121
|
"@ledgerhq/wallet-api-core": "^1.27.0",
|
|
@@ -176,46 +176,46 @@
|
|
|
176
176
|
"xstate": "^5.19.2",
|
|
177
177
|
"yargs": "^17.0.0",
|
|
178
178
|
"zod": "^3.22.4",
|
|
179
|
-
"@ledgerhq/coin-algorand": "^0.14.0-nightly.
|
|
180
|
-
"@ledgerhq/coin-aptos": "^3.6.1-nightly.
|
|
181
|
-
"@ledgerhq/coin-
|
|
182
|
-
"@ledgerhq/coin-
|
|
183
|
-
"@ledgerhq/coin-
|
|
184
|
-
"@ledgerhq/coin-
|
|
185
|
-
"@ledgerhq/coin-celo": "^1.7.2-nightly.
|
|
186
|
-
"@ledgerhq/coin-cosmos": "^0.21.0-nightly.
|
|
187
|
-
"@ledgerhq/coin-evm": "^2.36.0-nightly.
|
|
188
|
-
"@ledgerhq/coin-filecoin": "^1.15.0-nightly.
|
|
189
|
-
"@ledgerhq/coin-framework": "^6.10.0-nightly.
|
|
190
|
-
"@ledgerhq/coin-hedera": "^1.15.0-nightly.
|
|
191
|
-
"@ledgerhq/coin-icon": "^0.15.1-nightly.
|
|
192
|
-
"@ledgerhq/coin-internet_computer": "^1.11.1-nightly.
|
|
193
|
-
"@ledgerhq/coin-kaspa": "^1.4.2-nightly.
|
|
194
|
-
"@ledgerhq/coin-mina": "^1.4.2-nightly.
|
|
195
|
-
"@ledgerhq/coin-multiversx": "^0.8.1-nightly.
|
|
196
|
-
"@ledgerhq/coin-near": "^0.16.1-nightly.
|
|
197
|
-
"@ledgerhq/coin-polkadot": "^6.14.0-nightly.
|
|
198
|
-
"@ledgerhq/coin-solana": "^0.38.0-nightly.
|
|
199
|
-
"@ledgerhq/coin-stacks": "^0.13.0-nightly.
|
|
200
|
-
"@ledgerhq/coin-stellar": "^6.8.0-nightly.
|
|
201
|
-
"@ledgerhq/coin-sui": "^0.18.1-nightly.
|
|
202
|
-
"@ledgerhq/coin-tezos": "^6.10.0-nightly.
|
|
203
|
-
"@ledgerhq/coin-ton": "^0.17.1-nightly.
|
|
204
|
-
"@ledgerhq/coin-tron": "^5.7.1-nightly.
|
|
205
|
-
"@ledgerhq/coin-
|
|
206
|
-
"@ledgerhq/
|
|
207
|
-
"@ledgerhq/
|
|
208
|
-
"@ledgerhq/device-core": "^0.6.9-nightly.
|
|
179
|
+
"@ledgerhq/coin-algorand": "^0.14.0-nightly.20251205111238",
|
|
180
|
+
"@ledgerhq/coin-aptos": "^3.6.1-nightly.20251205111238",
|
|
181
|
+
"@ledgerhq/coin-bitcoin": "^0.26.0-nightly.20251205111238",
|
|
182
|
+
"@ledgerhq/coin-canton": "^0.11.0-nightly.20251205111238",
|
|
183
|
+
"@ledgerhq/coin-cardano": "^0.15.1-nightly.20251205111238",
|
|
184
|
+
"@ledgerhq/coin-casper": "^2.4.1-nightly.20251205111238",
|
|
185
|
+
"@ledgerhq/coin-celo": "^1.7.2-nightly.20251205111238",
|
|
186
|
+
"@ledgerhq/coin-cosmos": "^0.21.0-nightly.20251205111238",
|
|
187
|
+
"@ledgerhq/coin-evm": "^2.36.0-nightly.20251205111238",
|
|
188
|
+
"@ledgerhq/coin-filecoin": "^1.15.0-nightly.20251205111238",
|
|
189
|
+
"@ledgerhq/coin-framework": "^6.10.0-nightly.20251205111238",
|
|
190
|
+
"@ledgerhq/coin-hedera": "^1.15.0-nightly.20251205111238",
|
|
191
|
+
"@ledgerhq/coin-icon": "^0.15.1-nightly.20251205111238",
|
|
192
|
+
"@ledgerhq/coin-internet_computer": "^1.11.1-nightly.20251205111238",
|
|
193
|
+
"@ledgerhq/coin-kaspa": "^1.4.2-nightly.20251205111238",
|
|
194
|
+
"@ledgerhq/coin-mina": "^1.4.2-nightly.20251205111238",
|
|
195
|
+
"@ledgerhq/coin-multiversx": "^0.8.1-nightly.20251205111238",
|
|
196
|
+
"@ledgerhq/coin-near": "^0.16.1-nightly.20251205111238",
|
|
197
|
+
"@ledgerhq/coin-polkadot": "^6.14.0-nightly.20251205111238",
|
|
198
|
+
"@ledgerhq/coin-solana": "^0.38.0-nightly.20251205111238",
|
|
199
|
+
"@ledgerhq/coin-stacks": "^0.13.0-nightly.20251205111238",
|
|
200
|
+
"@ledgerhq/coin-stellar": "^6.8.0-nightly.20251205111238",
|
|
201
|
+
"@ledgerhq/coin-sui": "^0.18.1-nightly.20251205111238",
|
|
202
|
+
"@ledgerhq/coin-tezos": "^6.10.0-nightly.20251205111238",
|
|
203
|
+
"@ledgerhq/coin-ton": "^0.17.1-nightly.20251205111238",
|
|
204
|
+
"@ledgerhq/coin-tron": "^5.7.1-nightly.20251205111238",
|
|
205
|
+
"@ledgerhq/coin-vechain": "^2.12.2-nightly.20251205111238",
|
|
206
|
+
"@ledgerhq/coin-xrp": "^7.9.0-nightly.20251205111238",
|
|
207
|
+
"@ledgerhq/cryptoassets": "^13.34.0-nightly.20251205111238",
|
|
208
|
+
"@ledgerhq/device-core": "^0.6.9-nightly.20251205111238",
|
|
209
209
|
"@ledgerhq/devices": "8.7.0",
|
|
210
210
|
"@ledgerhq/errors": "^6.27.0",
|
|
211
211
|
"@ledgerhq/hw-app-algorand": "^6.31.9",
|
|
212
212
|
"@ledgerhq/hw-app-aptos": "^6.34.9",
|
|
213
|
-
"@ledgerhq/hw-app-
|
|
214
|
-
"@ledgerhq/hw-app-
|
|
213
|
+
"@ledgerhq/hw-app-btc": "^10.12.1-nightly.20251205111238",
|
|
214
|
+
"@ledgerhq/hw-app-celo": "^6.35.4-nightly.20251205111238",
|
|
215
215
|
"@ledgerhq/hw-app-cosmos": "^6.32.9",
|
|
216
|
-
"@ledgerhq/hw-app-eth": "^7.0.0-nightly.
|
|
216
|
+
"@ledgerhq/hw-app-eth": "^7.0.0-nightly.20251205111238",
|
|
217
|
+
"@ledgerhq/hw-app-exchange": "^0.18.0-nightly.20251205111238",
|
|
217
218
|
"@ledgerhq/hw-app-hedera": "^1.2.9",
|
|
218
|
-
"@ledgerhq/hw-app-exchange": "^0.18.0-nightly.20251205023918",
|
|
219
219
|
"@ledgerhq/hw-app-icon": "^1.3.9",
|
|
220
220
|
"@ledgerhq/hw-app-kaspa": "^1.3.2",
|
|
221
221
|
"@ledgerhq/hw-app-multiversx": "^6.26.0",
|
|
@@ -223,31 +223,31 @@
|
|
|
223
223
|
"@ledgerhq/hw-app-polkadot": "^6.34.9",
|
|
224
224
|
"@ledgerhq/hw-app-str": "^7.2.9",
|
|
225
225
|
"@ledgerhq/hw-app-sui": "^1.4.0",
|
|
226
|
-
"@ledgerhq/hw-app-trx": "^6.31.9",
|
|
227
226
|
"@ledgerhq/hw-app-tezos": "^6.31.9",
|
|
228
|
-
"@ledgerhq/hw-app-
|
|
227
|
+
"@ledgerhq/hw-app-trx": "^6.31.9",
|
|
228
|
+
"@ledgerhq/hw-app-vet": "^0.8.0-nightly.20251205111238",
|
|
229
229
|
"@ledgerhq/hw-app-xrp": "^6.32.7",
|
|
230
230
|
"@ledgerhq/hw-bolos": "^6.32.9",
|
|
231
231
|
"@ledgerhq/hw-transport": "6.31.13",
|
|
232
232
|
"@ledgerhq/hw-transport-mocker": "^6.29.13",
|
|
233
|
-
"@ledgerhq/ledger-cal-service": "^1.9.1-nightly.
|
|
234
|
-
"@ledgerhq/ledger-trust-service": "^0.4.3-nightly.
|
|
233
|
+
"@ledgerhq/ledger-cal-service": "^1.9.1-nightly.20251205111238",
|
|
234
|
+
"@ledgerhq/ledger-trust-service": "^0.4.3-nightly.20251205111238",
|
|
235
235
|
"@ledgerhq/live-config": "^3.2.0",
|
|
236
|
-
"@ledgerhq/live-countervalues
|
|
236
|
+
"@ledgerhq/live-countervalues": "^0.10.1-nightly.20251205111238",
|
|
237
|
+
"@ledgerhq/live-countervalues-react": "^0.7.3-nightly.20251205111238",
|
|
237
238
|
"@ledgerhq/live-dmk-shared": "^0.15.0",
|
|
238
|
-
"@ledgerhq/live-
|
|
239
|
-
"@ledgerhq/live-env": "^2.22.0-nightly.20251205023918",
|
|
239
|
+
"@ledgerhq/live-env": "^2.22.0-nightly.20251205111238",
|
|
240
240
|
"@ledgerhq/live-hooks": "0.2.0",
|
|
241
|
+
"@ledgerhq/live-network": "^2.1.2-nightly.20251205111238",
|
|
241
242
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
242
|
-
"@ledgerhq/live-
|
|
243
|
-
"@ledgerhq/live-signer-evm": "^0.10.2-nightly.
|
|
244
|
-
"@ledgerhq/live-signer-
|
|
245
|
-
"@ledgerhq/live-
|
|
246
|
-
"@ledgerhq/live-wallet": "^0.16.1-nightly.20251205023918",
|
|
243
|
+
"@ledgerhq/live-signer-canton": "^0.5.2-nightly.20251205111238",
|
|
244
|
+
"@ledgerhq/live-signer-evm": "^0.10.2-nightly.20251205111238",
|
|
245
|
+
"@ledgerhq/live-signer-solana": "^0.6.2-nightly.20251205111238",
|
|
246
|
+
"@ledgerhq/live-wallet": "^0.16.1-nightly.20251205111238",
|
|
247
247
|
"@ledgerhq/logs": "^6.13.0",
|
|
248
|
-
"@ledgerhq/
|
|
249
|
-
"@ledgerhq/
|
|
250
|
-
"@ledgerhq/wallet-api-exchange-module": "^0.19.0-nightly.
|
|
248
|
+
"@ledgerhq/speculos-transport": "^0.3.0-nightly.20251205111238",
|
|
249
|
+
"@ledgerhq/wallet-api-acre-module": "^0.10.0-nightly.20251205111238",
|
|
250
|
+
"@ledgerhq/wallet-api-exchange-module": "^0.19.0-nightly.20251205111238"
|
|
251
251
|
},
|
|
252
252
|
"devDependencies": {
|
|
253
253
|
"@solana/web3.js": "1.95.4",
|
|
@@ -294,10 +294,10 @@
|
|
|
294
294
|
"undici": "6.19.2",
|
|
295
295
|
"uuid": "^8.3.2",
|
|
296
296
|
"ws": "7",
|
|
297
|
-
"@ledgerhq/device-react": "^0.3.3-nightly.
|
|
297
|
+
"@ledgerhq/device-react": "^0.3.3-nightly.20251205111238",
|
|
298
298
|
"@ledgerhq/types-cryptoassets": "^7.30.0",
|
|
299
299
|
"@ledgerhq/types-devices": "^6.27.0",
|
|
300
|
-
"@ledgerhq/types-live": "^6.90.0-nightly.
|
|
300
|
+
"@ledgerhq/types-live": "^6.90.0-nightly.20251205111238"
|
|
301
301
|
},
|
|
302
302
|
"scripts": {
|
|
303
303
|
"build": "zx ./scripts/build-ts.mjs",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../__tests__/test-helpers/setup";
|
|
2
|
-
import { isCryptoCurrency } from "./helpers";
|
|
2
|
+
import { isCryptoCurrency, getFamilyByCurrencyId } from "./helpers";
|
|
3
3
|
import { listCryptoCurrencies } from ".";
|
|
4
4
|
|
|
5
5
|
describe("Currencies helpers", () => {
|
|
@@ -10,4 +10,13 @@ describe("Currencies helpers", () => {
|
|
|
10
10
|
expect(isCryptoCurrency(currency)).toBeTruthy();
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
|
+
|
|
14
|
+
test("getFamilyByCurrencyId returns correct family for a known currency id", () => {
|
|
15
|
+
expect(getFamilyByCurrencyId("bitcoin")).toBe("bitcoin");
|
|
16
|
+
expect(getFamilyByCurrencyId("ethereum")).toBe("evm");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("getFamilyByCurrencyId returns undefined for an unknown currency id", () => {
|
|
20
|
+
expect(getFamilyByCurrencyId("unknown_currency_id")).toBeUndefined();
|
|
21
|
+
});
|
|
13
22
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Currency, CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
2
|
+
import { findCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
2
3
|
|
|
3
4
|
export function isCryptoCurrency(currency: Currency): currency is CryptoCurrency {
|
|
4
5
|
return currency.type === "CryptoCurrency";
|
|
@@ -15,3 +16,8 @@ export function isUTXOCompliant(currencyFamily: string): boolean {
|
|
|
15
16
|
export type CurrencyFilters = {
|
|
16
17
|
currencies?: string[];
|
|
17
18
|
};
|
|
19
|
+
|
|
20
|
+
export function getFamilyByCurrencyId(currencyId: string): CryptoCurrency["family"] | undefined {
|
|
21
|
+
const currency = findCryptoCurrencyById(currencyId);
|
|
22
|
+
return currency?.family;
|
|
23
|
+
}
|
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
|
|
4
4
|
[
|
|
5
5
|
{
|
|
6
|
-
"balance": "
|
|
6
|
+
"balance": "31414973242",
|
|
7
7
|
"currencyId": "hedera",
|
|
8
8
|
"derivationMode": "hederaBip44",
|
|
9
9
|
"freshAddress": "0.0.1040977",
|
|
10
10
|
"freshAddressPath": "44/3030",
|
|
11
11
|
"hederaResources": {
|
|
12
12
|
"delegation": {
|
|
13
|
-
"delegated": "
|
|
13
|
+
"delegated": "31414973242",
|
|
14
14
|
"nodeId": 0,
|
|
15
|
-
"pendingReward": "
|
|
15
|
+
"pendingReward": "2274774",
|
|
16
16
|
},
|
|
17
17
|
"isAutoTokenAssociationEnabled": false,
|
|
18
18
|
"maxAutomaticTokenAssociations": 0,
|
|
19
19
|
},
|
|
20
20
|
"id": "js:2:hedera:0.0.1040977:hederaBip44",
|
|
21
21
|
"index": 0,
|
|
22
|
-
"operationsCount":
|
|
22
|
+
"operationsCount": 55,
|
|
23
23
|
"pendingOperations": [],
|
|
24
24
|
"seedIdentifier": "9e92a312233d5fd6b5a723875aeea2cea81a8e48ffc00341cff6dffcfd3ab7f2",
|
|
25
|
-
"spendableBalance": "
|
|
25
|
+
"spendableBalance": "31414973242",
|
|
26
26
|
"subAccounts": [],
|
|
27
27
|
"swapHistory": [],
|
|
28
28
|
"syncHash": "0x43decf71",
|
|
@@ -62,26 +62,26 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
|
|
|
62
62
|
"type": "TokenAccountRaw",
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
"balance": "
|
|
65
|
+
"balance": "100226095",
|
|
66
66
|
"currencyId": "hedera",
|
|
67
67
|
"derivationMode": "hederaBip44",
|
|
68
68
|
"freshAddress": "0.0.7305122",
|
|
69
69
|
"freshAddressPath": "44/3030",
|
|
70
70
|
"hederaResources": {
|
|
71
71
|
"delegation": {
|
|
72
|
-
"delegated": "
|
|
72
|
+
"delegated": "100226095",
|
|
73
73
|
"nodeId": 0,
|
|
74
|
-
"pendingReward": "
|
|
74
|
+
"pendingReward": "3288",
|
|
75
75
|
},
|
|
76
76
|
"isAutoTokenAssociationEnabled": false,
|
|
77
77
|
"maxAutomaticTokenAssociations": 0,
|
|
78
78
|
},
|
|
79
79
|
"id": "js:2:hedera:0.0.7305122:hederaBip44",
|
|
80
80
|
"index": 1,
|
|
81
|
-
"operationsCount":
|
|
81
|
+
"operationsCount": 22,
|
|
82
82
|
"pendingOperations": [],
|
|
83
83
|
"seedIdentifier": "9e92a312233d5fd6b5a723875aeea2cea81a8e48ffc00341cff6dffcfd3ab7f2",
|
|
84
|
-
"spendableBalance": "
|
|
84
|
+
"spendableBalance": "100226095",
|
|
85
85
|
"subAccounts": [],
|
|
86
86
|
"swapHistory": [],
|
|
87
87
|
"syncHash": "0x43decf71",
|
|
@@ -182,7 +182,7 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
|
|
|
182
182
|
"delegation": {
|
|
183
183
|
"delegated": "100000000",
|
|
184
184
|
"nodeId": 7,
|
|
185
|
-
"pendingReward": "
|
|
185
|
+
"pendingReward": "150678",
|
|
186
186
|
},
|
|
187
187
|
"isAutoTokenAssociationEnabled": false,
|
|
188
188
|
"maxAutomaticTokenAssociations": 0,
|
|
@@ -1365,6 +1365,29 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 2`] = `
|
|
|
1365
1365
|
"type": "IN",
|
|
1366
1366
|
"value": "8289627",
|
|
1367
1367
|
},
|
|
1368
|
+
{
|
|
1369
|
+
"accountId": "js:2:hedera:0.0.1040977:hederaBip44",
|
|
1370
|
+
"blockHash": null,
|
|
1371
|
+
"blockHeight": 10,
|
|
1372
|
+
"extra": {
|
|
1373
|
+
"consensusTimestamp": "1764748857.858276000",
|
|
1374
|
+
"pagingToken": "1764748857.858276000",
|
|
1375
|
+
"transactionId": "0.0.1040977-1764748842-778719139",
|
|
1376
|
+
},
|
|
1377
|
+
"fee": "67757",
|
|
1378
|
+
"hasFailed": false,
|
|
1379
|
+
"hash": "XkIZpbgw_xScxbeqg-GvVZhuWkvNU_bvWglFXQ2aXRf3irK8RSUHsBvUZ80OMa52",
|
|
1380
|
+
"id": "js:2:hedera:0.0.1040977:hederaBip44-XkIZpbgw_xScxbeqg-GvVZhuWkvNU_bvWglFXQ2aXRf3irK8RSUHsBvUZ80OMa52-OUT",
|
|
1381
|
+
"recipients": [
|
|
1382
|
+
"0.0.7305122",
|
|
1383
|
+
"0.0.3",
|
|
1384
|
+
],
|
|
1385
|
+
"senders": [
|
|
1386
|
+
"0.0.1040977",
|
|
1387
|
+
],
|
|
1388
|
+
"type": "OUT",
|
|
1389
|
+
"value": "100067757",
|
|
1390
|
+
},
|
|
1368
1391
|
{
|
|
1369
1392
|
"accountId": "js:2:hedera:0.0.1040977:hederaBip44",
|
|
1370
1393
|
"blockHash": null,
|
|
@@ -1982,6 +2005,29 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 2`] = `
|
|
|
1982
2005
|
"type": "OUT",
|
|
1983
2006
|
"value": "8485224",
|
|
1984
2007
|
},
|
|
2008
|
+
{
|
|
2009
|
+
"accountId": "js:2:hedera:0.0.7305122:hederaBip44",
|
|
2010
|
+
"blockHash": null,
|
|
2011
|
+
"blockHeight": 10,
|
|
2012
|
+
"extra": {
|
|
2013
|
+
"consensusTimestamp": "1764748857.858276000",
|
|
2014
|
+
"pagingToken": "1764748857.858276000",
|
|
2015
|
+
"transactionId": "0.0.1040977-1764748842-778719139",
|
|
2016
|
+
},
|
|
2017
|
+
"fee": "67757",
|
|
2018
|
+
"hasFailed": false,
|
|
2019
|
+
"hash": "XkIZpbgw_xScxbeqg-GvVZhuWkvNU_bvWglFXQ2aXRf3irK8RSUHsBvUZ80OMa52",
|
|
2020
|
+
"id": "js:2:hedera:0.0.7305122:hederaBip44-XkIZpbgw_xScxbeqg-GvVZhuWkvNU_bvWglFXQ2aXRf3irK8RSUHsBvUZ80OMa52-IN",
|
|
2021
|
+
"recipients": [
|
|
2022
|
+
"0.0.7305122",
|
|
2023
|
+
"0.0.3",
|
|
2024
|
+
],
|
|
2025
|
+
"senders": [
|
|
2026
|
+
"0.0.1040977",
|
|
2027
|
+
],
|
|
2028
|
+
"type": "IN",
|
|
2029
|
+
"value": "100000000",
|
|
2030
|
+
},
|
|
1985
2031
|
{
|
|
1986
2032
|
"accountId": "js:2:hedera:0.0.7305122:hederaBip44",
|
|
1987
2033
|
"blockHash": null,
|