@ledgerhq/coin-tester-evm 1.9.0-nightly.9 → 1.9.0

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.
Files changed (61) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +55 -92
  3. package/README.md +1 -0
  4. package/lib/src/scenarii/blast.js +4 -4
  5. package/lib/src/scenarii/blast.js.map +1 -1
  6. package/lib/src/scenarii/core.js +4 -4
  7. package/lib/src/scenarii/core.js.map +1 -1
  8. package/lib/src/scenarii/ethereum.js +4 -4
  9. package/lib/src/scenarii/ethereum.js.map +1 -1
  10. package/lib/src/scenarii/polygon.js +4 -4
  11. package/lib/src/scenarii/polygon.js.map +1 -1
  12. package/lib/src/scenarii/scroll.js +4 -4
  13. package/lib/src/scenarii/scroll.js.map +1 -1
  14. package/lib/src/scenarii/sonic.js +4 -4
  15. package/lib/src/scenarii/sonic.js.map +1 -1
  16. package/lib/src/{constants.d.ts → scenarii.test.d.ts} +1 -1
  17. package/lib/src/scenarii.test.d.ts.map +1 -0
  18. package/lib/src/scenarii.test.js +93 -0
  19. package/lib/src/scenarii.test.js.map +1 -0
  20. package/lib/tsconfig.tsbuildinfo +1 -1
  21. package/lib-es/src/scenarii/blast.js +2 -2
  22. package/lib-es/src/scenarii/blast.js.map +1 -1
  23. package/lib-es/src/scenarii/core.js +2 -2
  24. package/lib-es/src/scenarii/core.js.map +1 -1
  25. package/lib-es/src/scenarii/ethereum.js +2 -2
  26. package/lib-es/src/scenarii/ethereum.js.map +1 -1
  27. package/lib-es/src/scenarii/polygon.js +2 -2
  28. package/lib-es/src/scenarii/polygon.js.map +1 -1
  29. package/lib-es/src/scenarii/scroll.js +2 -2
  30. package/lib-es/src/scenarii/scroll.js.map +1 -1
  31. package/lib-es/src/scenarii/sonic.js +2 -2
  32. package/lib-es/src/scenarii/sonic.js.map +1 -1
  33. package/lib-es/src/{constants.d.ts → scenarii.test.d.ts} +1 -1
  34. package/lib-es/src/scenarii.test.d.ts.map +1 -0
  35. package/lib-es/src/scenarii.test.js +90 -0
  36. package/lib-es/src/scenarii.test.js.map +1 -0
  37. package/lib-es/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +10 -10
  39. package/src/scenarii/blast.ts +2 -2
  40. package/src/scenarii/core.ts +2 -2
  41. package/src/scenarii/ethereum.ts +2 -2
  42. package/src/scenarii/polygon.ts +2 -2
  43. package/src/scenarii/scroll.ts +2 -2
  44. package/src/scenarii/sonic.ts +2 -2
  45. package/src/scenarii.test.ts +1 -0
  46. package/lib/src/constants.d.ts.map +0 -1
  47. package/lib/src/constants.js +0 -5
  48. package/lib/src/constants.js.map +0 -1
  49. package/lib/src/fixtures.d.ts +0 -4
  50. package/lib/src/fixtures.d.ts.map +0 -1
  51. package/lib/src/fixtures.js +0 -63
  52. package/lib/src/fixtures.js.map +0 -1
  53. package/lib-es/src/constants.d.ts.map +0 -1
  54. package/lib-es/src/constants.js +0 -2
  55. package/lib-es/src/constants.js.map +0 -1
  56. package/lib-es/src/fixtures.d.ts +0 -4
  57. package/lib-es/src/fixtures.d.ts.map +0 -1
  58. package/lib-es/src/fixtures.js +0 -56
  59. package/lib-es/src/fixtures.js.map +0 -1
  60. package/src/constants.ts +0 -1
  61. package/src/fixtures.ts +0 -64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/coin-tester-evm",
3
- "version": "1.9.0-nightly.9",
3
+ "version": "1.9.0",
4
4
  "description": "Ledger EVM Coin Tester",
5
5
  "main": "src/scenarii.test.ts",
6
6
  "keywords": [
@@ -51,15 +51,15 @@
51
51
  "dotenv": "^16.4.5",
52
52
  "ethers": "6.15.0",
53
53
  "msw": "^2.2.1",
54
- "@ledgerhq/coin-evm": "^2.33.0-nightly.7",
55
- "@ledgerhq/coin-tester": "^0.10.2-nightly.0",
56
- "@ledgerhq/cryptoassets": "^13.31.0-nightly.7",
57
- "@ledgerhq/live-common": "^34.51.0-nightly.9",
58
- "@ledgerhq/coin-framework": "^6.7.0-nightly.7",
59
- "@ledgerhq/live-signer-evm": "^0.8.2-nightly.7",
60
- "@ledgerhq/types-cryptoassets": "^7.29.0-nightly.0",
54
+ "@ledgerhq/coin-framework": "^6.7.0",
55
+ "@ledgerhq/coin-tester": "^0.10.1",
56
+ "@ledgerhq/coin-evm": "^2.33.0",
57
+ "@ledgerhq/cryptoassets": "^13.31.0",
58
+ "@ledgerhq/live-common": "^34.51.0",
61
59
  "@ledgerhq/live-config": "^3.2.0",
62
- "@ledgerhq/types-live": "^6.87.0-nightly.5"
60
+ "@ledgerhq/live-signer-evm": "^0.9.0",
61
+ "@ledgerhq/types-live": "^6.87.0",
62
+ "@ledgerhq/types-cryptoassets": "^7.29.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@swc/core": "1.4.11",
@@ -72,7 +72,7 @@
72
72
  "ts-jest": "^29.1.2",
73
73
  "ts-node": "^10.9.2",
74
74
  "typescript": "^5.3.3",
75
- "@ledgerhq/hw-transport": "6.31.13-nightly.0"
75
+ "@ledgerhq/hw-transport": "6.31.12"
76
76
  },
77
77
  "scripts": {
78
78
  "clean": "rimraf lib lib-es",
@@ -10,9 +10,9 @@ import { resetIndexer, setBlock, indexBlocks, initMswHandlers } from "../indexer
10
10
  import { buildAccountBridge, buildCurrencyBridge } from "@ledgerhq/coin-evm/bridge/js";
11
11
  import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
12
12
  import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
13
- import { makeAccount } from "../fixtures";
13
+ import { makeAccount } from "@ledgerhq/coin-evm/__tests__/fixtures/common.fixtures";
14
14
  import { blast, callMyDealer, VITALIK } from "../helpers";
15
- import { defaultNanoApp } from "../constants";
15
+ import { defaultNanoApp } from "../scenarii.test";
16
16
  import { killAnvil, spawnAnvil } from "../anvil";
17
17
  import resolver from "@ledgerhq/coin-evm/hw-getAddress";
18
18
  import { SignerContext } from "@ledgerhq/coin-framework/signer";
@@ -1,4 +1,4 @@
1
- import { makeAccount } from "../fixtures";
1
+ import { makeAccount } from "@ledgerhq/coin-evm/__tests__/fixtures/common.fixtures";
2
2
  import { buildAccountBridge, buildCurrencyBridge } from "@ledgerhq/coin-evm/bridge/js";
3
3
  import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
4
4
  import resolver from "@ledgerhq/coin-evm/hw-getAddress";
@@ -17,7 +17,7 @@ import { ethers } from "ethers";
17
17
  import { killAnvil, spawnAnvil } from "../anvil";
18
18
  import { VITALIK, core } from "../helpers";
19
19
  import { indexBlocks, initMswHandlers, resetIndexer, setBlock } from "../indexer";
20
- import { defaultNanoApp } from "../constants";
20
+ import { defaultNanoApp } from "../scenarii.test";
21
21
 
22
22
  type CoreScenarioTransaction = ScenarioTransaction<EvmTransaction, Account>;
23
23
 
@@ -5,7 +5,7 @@ import { findTokenById } from "@ledgerhq/cryptoassets/tokens";
5
5
  import { Account } from "@ledgerhq/types-live";
6
6
  import { BigNumber } from "bignumber.js";
7
7
  import { ethers } from "ethers";
8
- import { makeAccount } from "../fixtures";
8
+ import { makeAccount } from "@ledgerhq/coin-evm/__tests__/fixtures/common.fixtures";
9
9
  import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
10
10
  import {
11
11
  EvmNftTransaction,
@@ -14,7 +14,7 @@ import {
14
14
  import { killAnvil, spawnAnvil } from "../anvil";
15
15
  import { callMyDealer, ethereum, VITALIK, getBridges } from "../helpers";
16
16
  import { indexBlocks, initMswHandlers, resetIndexer, setBlock } from "../indexer";
17
- import { defaultNanoApp } from "../constants";
17
+ import { defaultNanoApp } from "../scenarii.test";
18
18
  import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
19
19
  import { BridgeStrategy } from "@ledgerhq/coin-tester/types";
20
20
 
@@ -8,9 +8,9 @@ import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/specu
8
8
  import { resetIndexer, initMswHandlers, setBlock, indexBlocks } from "../indexer";
9
9
  import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
10
10
  import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
11
- import { makeAccount } from "../fixtures";
11
+ import { makeAccount } from "@ledgerhq/coin-evm/__tests__/fixtures/common.fixtures";
12
12
  import { callMyDealer, getBridges, polygon, VITALIK } from "../helpers";
13
- import { defaultNanoApp } from "../constants";
13
+ import { defaultNanoApp } from "../scenarii.test";
14
14
  import { killAnvil, spawnAnvil } from "../anvil";
15
15
  import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
16
16
  import { BridgeStrategy } from "@ledgerhq/coin-tester/types";
@@ -10,9 +10,9 @@ import { resetIndexer, setBlock, indexBlocks, initMswHandlers } from "../indexer
10
10
  import { buildAccountBridge, buildCurrencyBridge } from "@ledgerhq/coin-evm/bridge/js";
11
11
  import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
12
12
  import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
13
- import { makeAccount } from "../fixtures";
13
+ import { makeAccount } from "@ledgerhq/coin-evm/__tests__/fixtures/common.fixtures";
14
14
  import { callMyDealer, scroll, VITALIK } from "../helpers";
15
- import { defaultNanoApp } from "../constants";
15
+ import { defaultNanoApp } from "../scenarii.test";
16
16
  import { killAnvil, spawnAnvil } from "../anvil";
17
17
  import resolver from "@ledgerhq/coin-evm/hw-getAddress";
18
18
  import { SignerContext } from "@ledgerhq/coin-framework/signer";
@@ -8,9 +8,9 @@ import { killSpeculos, spawnSpeculos } from "@ledgerhq/coin-tester/signers/specu
8
8
  import { resetIndexer, indexBlocks, initMswHandlers, setBlock } from "../indexer";
9
9
  import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
10
10
  import { getCoinConfig, setCoinConfig } from "@ledgerhq/coin-evm/config";
11
- import { makeAccount } from "../fixtures";
11
+ import { makeAccount } from "@ledgerhq/coin-evm/__tests__/fixtures/common.fixtures";
12
12
  import { VITALIK, callMyDealer, getBridges, sonic } from "../helpers";
13
- import { defaultNanoApp } from "../constants";
13
+ import { defaultNanoApp } from "../scenarii.test";
14
14
  import { killAnvil, spawnAnvil } from "../anvil";
15
15
  import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
16
16
 
@@ -18,6 +18,7 @@ setCryptoAssetsStoreForCoinFramework(legacyCryptoAssetsStore);
18
18
 
19
19
  // Note this config runs with NanoX
20
20
  // https://github.com/LedgerHQ/ledger-live/blob/develop/libs/coin-tester/docker-compose.yml
21
+ export const defaultNanoApp = { firmware: "2.4.2" as const, version: "1.17.0" as const };
21
22
 
22
23
  describe.each([["legacy"], ["generic-adapter"]] as const)(
23
24
  "EVM Deterministic Tester (%s strategy)",
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;CAA6D,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultNanoApp = void 0;
4
- exports.defaultNanoApp = { firmware: "2.4.2", version: "1.17.0" };
5
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,EAAE,QAAQ,EAAE,OAAgB,EAAE,OAAO,EAAE,QAAiB,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
2
- import { Account, TokenAccount } from "@ledgerhq/types-live";
3
- export declare const makeAccount: (address: string, currency: CryptoCurrency, subAccounts?: TokenAccount[]) => Account;
4
- //# sourceMappingURL=fixtures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,WAAW,YACb,MAAM,YACL,cAAc,gBACX,YAAY,EAAE,KAC1B,OAqDF,CAAC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.makeAccount = void 0;
7
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
- const derivation_1 = require("@ledgerhq/coin-framework/derivation");
9
- const index_1 = require("@ledgerhq/coin-framework/account/index");
10
- const makeAccount = (address, currency, subAccounts = []) => {
11
- const id = `js:2:${currency.id}:${address}:`;
12
- const { derivationMode, xpubOrAddress } = (0, index_1.decodeAccountId)(id);
13
- const scheme = (0, derivation_1.getDerivationScheme)({
14
- derivationMode: derivationMode,
15
- currency,
16
- });
17
- const index = 0;
18
- const freshAddressPath = (0, derivation_1.runDerivationScheme)(scheme, currency, {
19
- account: index,
20
- node: 0,
21
- address: 0,
22
- });
23
- const account = {
24
- type: "Account",
25
- xpub: xpubOrAddress,
26
- subAccounts,
27
- seedIdentifier: xpubOrAddress,
28
- used: true,
29
- swapHistory: [],
30
- id,
31
- derivationMode,
32
- currency,
33
- index,
34
- nfts: [],
35
- freshAddress: xpubOrAddress,
36
- freshAddressPath,
37
- balance: new bignumber_js_1.default(0),
38
- spendableBalance: new bignumber_js_1.default(0),
39
- operationsCount: 0,
40
- operations: [],
41
- pendingOperations: [],
42
- lastSyncDate: new Date(),
43
- blockHeight: 0,
44
- creationDate: new Date(),
45
- balanceHistoryCache: {
46
- HOUR: {
47
- latestDate: null,
48
- balances: [],
49
- },
50
- DAY: {
51
- latestDate: null,
52
- balances: [],
53
- },
54
- WEEK: {
55
- latestDate: null,
56
- balances: [],
57
- },
58
- },
59
- };
60
- return account;
61
- };
62
- exports.makeAccount = makeAccount;
63
- //# sourceMappingURL=fixtures.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/fixtures.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,oEAA+F;AAC/F,kEAAyE;AAIlE,MAAM,WAAW,GAAG,CACzB,OAAe,EACf,QAAwB,EACxB,cAA8B,EAAE,EACvB,EAAE;IACX,MAAM,EAAE,GAAG,QAAQ,QAAQ,CAAC,EAAE,IAAI,OAAO,GAAG,CAAC;IAC7C,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,IAAA,uBAAe,EAAC,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAA,gCAAmB,EAAC;QACjC,cAAc,EAAE,cAAc;QAC9B,QAAQ;KACT,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,CAAC,CAAC;IAChB,MAAM,gBAAgB,GAAG,IAAA,gCAAmB,EAAC,MAAM,EAAE,QAAQ,EAAE;QAC7D,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,CAAC;KACX,CAAC,CAAC;IAEH,MAAM,OAAO,GAAY;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,aAAa;QACnB,WAAW;QACX,cAAc,EAAE,aAAa;QAC7B,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,EAAE;QACf,EAAE;QACF,cAAc;QACd,QAAQ;QACR,KAAK;QACL,IAAI,EAAE,EAAE;QACR,YAAY,EAAE,aAAa;QAC3B,gBAAgB;QAChB,OAAO,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC;QACzB,gBAAgB,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC;QAClC,eAAe,EAAE,CAAC;QAClB,UAAU,EAAE,EAAE;QACd,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,IAAI,IAAI,EAAE;QACxB,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,IAAI,IAAI,EAAE;QACxB,mBAAmB,EAAE;YACnB,IAAI,EAAE;gBACJ,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,EAAE;aACb;YACD,GAAG,EAAE;gBACH,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,EAAE;aACb;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAzDW,QAAA,WAAW,eAyDtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;CAA6D,CAAC"}
@@ -1,2 +0,0 @@
1
- export const defaultNanoApp = { firmware: "2.4.2", version: "1.17.0" };
2
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,QAAQ,EAAE,OAAgB,EAAE,OAAO,EAAE,QAAiB,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
2
- import { Account, TokenAccount } from "@ledgerhq/types-live";
3
- export declare const makeAccount: (address: string, currency: CryptoCurrency, subAccounts?: TokenAccount[]) => Account;
4
- //# sourceMappingURL=fixtures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,WAAW,YACb,MAAM,YACL,cAAc,gBACX,YAAY,EAAE,KAC1B,OAqDF,CAAC"}
@@ -1,56 +0,0 @@
1
- import BigNumber from "bignumber.js";
2
- import { getDerivationScheme, runDerivationScheme } from "@ledgerhq/coin-framework/derivation";
3
- import { decodeAccountId } from "@ledgerhq/coin-framework/account/index";
4
- export const makeAccount = (address, currency, subAccounts = []) => {
5
- const id = `js:2:${currency.id}:${address}:`;
6
- const { derivationMode, xpubOrAddress } = decodeAccountId(id);
7
- const scheme = getDerivationScheme({
8
- derivationMode: derivationMode,
9
- currency,
10
- });
11
- const index = 0;
12
- const freshAddressPath = runDerivationScheme(scheme, currency, {
13
- account: index,
14
- node: 0,
15
- address: 0,
16
- });
17
- const account = {
18
- type: "Account",
19
- xpub: xpubOrAddress,
20
- subAccounts,
21
- seedIdentifier: xpubOrAddress,
22
- used: true,
23
- swapHistory: [],
24
- id,
25
- derivationMode,
26
- currency,
27
- index,
28
- nfts: [],
29
- freshAddress: xpubOrAddress,
30
- freshAddressPath,
31
- balance: new BigNumber(0),
32
- spendableBalance: new BigNumber(0),
33
- operationsCount: 0,
34
- operations: [],
35
- pendingOperations: [],
36
- lastSyncDate: new Date(),
37
- blockHeight: 0,
38
- creationDate: new Date(),
39
- balanceHistoryCache: {
40
- HOUR: {
41
- latestDate: null,
42
- balances: [],
43
- },
44
- DAY: {
45
- latestDate: null,
46
- balances: [],
47
- },
48
- WEEK: {
49
- latestDate: null,
50
- balances: [],
51
- },
52
- },
53
- };
54
- return account;
55
- };
56
- //# sourceMappingURL=fixtures.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAIzE,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,OAAe,EACf,QAAwB,EACxB,cAA8B,EAAE,EACvB,EAAE;IACX,MAAM,EAAE,GAAG,QAAQ,QAAQ,CAAC,EAAE,IAAI,OAAO,GAAG,CAAC;IAC7C,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,cAAc,EAAE,cAAc;QAC9B,QAAQ;KACT,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,CAAC,CAAC;IAChB,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE;QAC7D,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,CAAC;KACX,CAAC,CAAC;IAEH,MAAM,OAAO,GAAY;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,aAAa;QACnB,WAAW;QACX,cAAc,EAAE,aAAa;QAC7B,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,EAAE;QACf,EAAE;QACF,cAAc;QACd,QAAQ;QACR,KAAK;QACL,IAAI,EAAE,EAAE;QACR,YAAY,EAAE,aAAa;QAC3B,gBAAgB;QAChB,OAAO,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC;QACzB,gBAAgB,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC;QAClC,eAAe,EAAE,CAAC;QAClB,UAAU,EAAE,EAAE;QACd,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,IAAI,IAAI,EAAE;QACxB,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,IAAI,IAAI,EAAE;QACxB,mBAAmB,EAAE;YACnB,IAAI,EAAE;gBACJ,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,EAAE;aACb;YACD,GAAG,EAAE;gBACH,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,EAAE;aACb;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
package/src/constants.ts DELETED
@@ -1 +0,0 @@
1
- export const defaultNanoApp = { firmware: "2.4.2" as const, version: "1.17.0" as const };
package/src/fixtures.ts DELETED
@@ -1,64 +0,0 @@
1
- import BigNumber from "bignumber.js";
2
- import { getDerivationScheme, runDerivationScheme } from "@ledgerhq/coin-framework/derivation";
3
- import { decodeAccountId } from "@ledgerhq/coin-framework/account/index";
4
- import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
5
- import { Account, TokenAccount } from "@ledgerhq/types-live";
6
-
7
- export const makeAccount = (
8
- address: string,
9
- currency: CryptoCurrency,
10
- subAccounts: TokenAccount[] = [],
11
- ): Account => {
12
- const id = `js:2:${currency.id}:${address}:`;
13
- const { derivationMode, xpubOrAddress } = decodeAccountId(id);
14
- const scheme = getDerivationScheme({
15
- derivationMode: derivationMode,
16
- currency,
17
- });
18
- const index = 0;
19
- const freshAddressPath = runDerivationScheme(scheme, currency, {
20
- account: index,
21
- node: 0,
22
- address: 0,
23
- });
24
-
25
- const account: Account = {
26
- type: "Account",
27
- xpub: xpubOrAddress,
28
- subAccounts,
29
- seedIdentifier: xpubOrAddress,
30
- used: true,
31
- swapHistory: [],
32
- id,
33
- derivationMode,
34
- currency,
35
- index,
36
- nfts: [],
37
- freshAddress: xpubOrAddress,
38
- freshAddressPath,
39
- balance: new BigNumber(0),
40
- spendableBalance: new BigNumber(0),
41
- operationsCount: 0,
42
- operations: [],
43
- pendingOperations: [],
44
- lastSyncDate: new Date(),
45
- blockHeight: 0,
46
- creationDate: new Date(),
47
- balanceHistoryCache: {
48
- HOUR: {
49
- latestDate: null,
50
- balances: [],
51
- },
52
- DAY: {
53
- latestDate: null,
54
- balances: [],
55
- },
56
- WEEK: {
57
- latestDate: null,
58
- balances: [],
59
- },
60
- },
61
- };
62
-
63
- return account;
64
- };