@ledgerhq/coin-polkadot 6.13.1-nightly.20251202023925 → 6.14.0-nightly.20251203101856

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 (53) hide show
  1. package/CHANGELOG.md +10 -6
  2. package/lib/bridge/preload.d.ts.map +1 -1
  3. package/lib/bridge/preload.js +7 -1
  4. package/lib/bridge/preload.js.map +1 -1
  5. package/lib/network/index.d.ts +3 -3
  6. package/lib/network/index.d.ts.map +1 -1
  7. package/lib/network/index.js.map +1 -1
  8. package/lib/network/node/validators.d.ts.map +1 -1
  9. package/lib/network/node/validators.js +7 -3
  10. package/lib/network/node/validators.js.map +1 -1
  11. package/lib/network/sidecar.d.ts +4 -4
  12. package/lib/network/sidecar.d.ts.map +1 -1
  13. package/lib/network/sidecar.js +14 -3
  14. package/lib/network/sidecar.js.map +1 -1
  15. package/lib/network/sidecar.mock.d.ts +1 -1
  16. package/lib/network/sidecar.mock.d.ts.map +1 -1
  17. package/lib/network/sidecar.mock.js +1 -1
  18. package/lib/network/sidecar.mock.js.map +1 -1
  19. package/lib/test/bridgeDatasetTest.d.ts.map +1 -1
  20. package/lib/test/bridgeDatasetTest.js +10 -17
  21. package/lib/test/bridgeDatasetTest.js.map +1 -1
  22. package/lib-es/bridge/preload.d.ts.map +1 -1
  23. package/lib-es/bridge/preload.js +7 -1
  24. package/lib-es/bridge/preload.js.map +1 -1
  25. package/lib-es/network/index.d.ts +3 -3
  26. package/lib-es/network/index.d.ts.map +1 -1
  27. package/lib-es/network/index.js.map +1 -1
  28. package/lib-es/network/node/validators.d.ts.map +1 -1
  29. package/lib-es/network/node/validators.js +7 -3
  30. package/lib-es/network/node/validators.js.map +1 -1
  31. package/lib-es/network/sidecar.d.ts +4 -4
  32. package/lib-es/network/sidecar.d.ts.map +1 -1
  33. package/lib-es/network/sidecar.js +14 -3
  34. package/lib-es/network/sidecar.js.map +1 -1
  35. package/lib-es/network/sidecar.mock.d.ts +1 -1
  36. package/lib-es/network/sidecar.mock.d.ts.map +1 -1
  37. package/lib-es/network/sidecar.mock.js +1 -1
  38. package/lib-es/network/sidecar.mock.js.map +1 -1
  39. package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -1
  40. package/lib-es/test/bridgeDatasetTest.js +10 -17
  41. package/lib-es/test/bridgeDatasetTest.js.map +1 -1
  42. package/package.json +5 -5
  43. package/src/api/index.integ.test.ts +7 -7
  44. package/src/bridge/preload.ts +8 -1
  45. package/src/bridge/synchronization.test.ts +167 -0
  46. package/src/logic/broadcast.test.ts +11 -8
  47. package/src/network/index.ts +2 -2
  48. package/src/network/node/validators.ts +8 -3
  49. package/src/network/sidecar.integ.test.ts +249 -90
  50. package/src/network/sidecar.mock.ts +1 -1
  51. package/src/network/sidecar.ts +19 -7
  52. package/src/network/sidecar.unit.test.ts +7 -6
  53. package/src/test/bridgeDatasetTest.ts +10 -17
@@ -17,7 +17,7 @@ jest.mock("./node", () => ({
17
17
  beforeAll(() => mockServer.listen({ onUnhandledRequest: "error" }));
18
18
  afterEach(() => mockServer.resetHandlers());
19
19
  afterAll(() => mockServer.close());
20
- const currency = getCryptoCurrencyById("polkadot");
20
+ const currency = getCryptoCurrencyById("assethub_polkadot");
21
21
 
22
22
  describe("getAccount", () => {
23
23
  let balanceResponseStub: Partial<SidecarAccountBalanceInfo> = {};
@@ -34,15 +34,16 @@ describe("getAccount", () => {
34
34
  url: SIDECAR_BASE_URL_TEST,
35
35
  },
36
36
  indexer: {
37
- url: "https://polkadot.coin.ledger.com",
37
+ url: "https://explorers.api.live.ledger.com/blockchain/dot_asset_hub",
38
38
  },
39
39
  metadataShortener: {
40
- id: "dot",
40
+ id: "dot-hub",
41
41
  url: "",
42
42
  },
43
43
  metadataHash: {
44
44
  url: "",
45
45
  },
46
+ hasBeenMigrated: true,
46
47
  }));
47
48
 
48
49
  mockServer.listen({ onUnhandledRequest: "error" });
@@ -77,7 +78,7 @@ describe("getAccount", () => {
77
78
  const lockedBalance = new BigNumber(balanceResponseStub.reserved!);
78
79
  const computedBalance = new BigNumber(balanceResponseStub.free!).plus(lockedBalance);
79
80
 
80
- const account = await getAccount("addr");
81
+ const account = await getAccount("addr", currency);
81
82
  expect(account).toMatchObject({
82
83
  blockHeight: Number(balanceResponseStub.at!.height),
83
84
  balance: computedBalance,
@@ -131,7 +132,7 @@ describe("getAccount", () => {
131
132
  const lockedBalance = new BigNumber(balanceResponseStub.reserved!);
132
133
  const computedBalance = new BigNumber(balanceResponseStub.free!).plus(lockedBalance);
133
134
 
134
- const account = await getAccount("addr");
135
+ const account = await getAccount("addr", currency);
135
136
  expect(account).toMatchObject({
136
137
  blockHeight: Number(balanceResponseStub.at!.height),
137
138
  balance: computedBalance,
@@ -227,7 +228,7 @@ describe("getAccount", () => {
227
228
  .plus(lockedBalance.minus(unlockingBalance))
228
229
  .plus(unlockingBalance.minus(unlockedBalance));
229
230
 
230
- const account = await getAccount("addr");
231
+ const account = await getAccount("addr", currency);
231
232
  expect(account).toMatchObject({
232
233
  blockHeight: Number(balanceResponseStub.at!.height),
233
234
  balance: computedBalance,
@@ -24,7 +24,7 @@ const ACCOUNT_CONTROLLER = "15oodc5d8DWJodZhTD6qsxxSQRYWhdkWCrwqNHajDirXRrAD";
24
24
  const ACCOUNT_EMPTY = "111111111111111111111111111111111HC1";
25
25
  const ACCOUNT_WITH_NO_OPERATION = "12EsPA79dvhtjp1bYvCiEWPsQmmdKGss44GzE3CT9tTo9g4Q";
26
26
 
27
- const polkadot: CurrenciesData<Transaction> = {
27
+ const assethub_polkadot: CurrenciesData<Transaction> = {
28
28
  FIXME_ignoreAccountFields: [
29
29
  "polkadotResources.unlockings", // Due to completion date that change everyday (estimated time)
30
30
  "polkadotResources.nominations", // TODO: try to only ignore status
@@ -35,15 +35,9 @@ const polkadot: CurrenciesData<Transaction> = {
35
35
  name: "polkadot seed 1",
36
36
  apdus: `
37
37
  => f9010000182c0000806201008000000080000000000000000000000000
38
- <= c71b1e00ca34fdd14ea065917a67168675828927e3adc3b68f444bf85b4d24be3135573461755239707652335a5765616f50516f4562616d54535557347571335072515369564a4e4e7953385868314e9000
39
- => f9010000182c0000806201008000000080000000800000008000000000
40
- <= 845175a888f0ced372bd352d59cb51242dff8438c3dd12a703835c25bdfa3f9231337a565838337a74575939446d69757446525738374262676b627631517031666366706f4a6964626448776b3335649000
41
- => f9010000182c0000806201008001000080000000800000008000000000
42
38
  <= 3a521fa830998568da9c205c987dcd157a78b2bd30ece3d1b6c32213986864ca31324b5542335272346163346469354a47707a545935474e516b44564e6b50556b636a324d4746546d7a617a4d5364739000
43
- => f9010000182c0000806201008002000080000000800000008000000000
39
+ => f9010000182c0000806201008000000080000000800000008000000000
44
40
  <= 7e52138bf614dddff1116623b027ea92d6015d8fe741575b78ac7773545066bd31337264523573727657463533566b4e654a757a35576b476b4736465358515141375a423551424769673441544373399000
45
- => f9010000182c0000806201008003000080000000800000008000000000
46
- <= dfd77108b64b8173805852f7550f1f2d6c166968d31d5c4984187c9cb1969d9331363456674b366f6f5a3466557555346946567770537558774658474c55356e5454577a4736347672447167697077689000
47
41
  `,
48
42
  },
49
43
  ],
@@ -51,7 +45,7 @@ const polkadot: CurrenciesData<Transaction> = {
51
45
  {
52
46
  // Account which is stash and controller
53
47
  raw: {
54
- id: `js:2:polkadot:${ACCOUNT_SAME_STASHCONTROLLER}:polkadotbip44`,
48
+ id: `js:2:assethub_polkadot:${ACCOUNT_SAME_STASHCONTROLLER}:polkadotbip44`,
55
49
  seedIdentifier: ACCOUNT_SAME_STASHCONTROLLER,
56
50
  name: "Polkadot 1",
57
51
  derivationMode: "polkadotbip44",
@@ -61,7 +55,7 @@ const polkadot: CurrenciesData<Transaction> = {
61
55
  blockHeight: 0,
62
56
  operations: [],
63
57
  pendingOperations: [],
64
- currencyId: "polkadot",
58
+ currencyId: "assethub_polkadot",
65
59
  lastSyncDate: "",
66
60
  balance: "21000310",
67
61
  },
@@ -357,7 +351,7 @@ const polkadot: CurrenciesData<Transaction> = {
357
351
  },
358
352
  {
359
353
  raw: {
360
- id: `js:2:polkadot:${ACCOUNT_STASH}:polkadotbip44`,
354
+ id: `js:2:assethub_polkadot:${ACCOUNT_STASH}:polkadotbip44`,
361
355
  seedIdentifier: ACCOUNT_STASH,
362
356
  name: "Polkadot 2",
363
357
  derivationMode: "polkadotbip44",
@@ -367,7 +361,7 @@ const polkadot: CurrenciesData<Transaction> = {
367
361
  blockHeight: 0,
368
362
  operations: [],
369
363
  pendingOperations: [],
370
- currencyId: "polkadot",
364
+ currencyId: "assethub_polkadot",
371
365
  lastSyncDate: "",
372
366
  balance: "11000000000",
373
367
  },
@@ -380,12 +374,11 @@ const polkadot: CurrenciesData<Transaction> = {
380
374
  mode: "send",
381
375
  recipient: ACCOUNT_SAME_STASHCONTROLLER,
382
376
  }),
383
- expectedStatus: (_account, _transaction, status) => ({
377
+ expectedStatus: (_account, _transaction, _status) => ({
384
378
  errors: {},
385
379
  warnings: {
386
380
  amount: new PolkadotAllFundsWarning(),
387
381
  },
388
- totalSpent: status.estimatedFees,
389
382
  }),
390
383
  },
391
384
  {
@@ -473,7 +466,7 @@ const polkadot: CurrenciesData<Transaction> = {
473
466
  // TODO: Write a setController test
474
467
  {
475
468
  raw: {
476
- id: `js:2:polkadot:${ACCOUNT_CONTROLLER}:polkadotbip44`,
469
+ id: `js:2:assethub_polkadot:${ACCOUNT_CONTROLLER}:polkadotbip44`,
477
470
  seedIdentifier: ACCOUNT_CONTROLLER,
478
471
  name: "Polkadot 3",
479
472
  derivationMode: "polkadotbip44",
@@ -483,7 +476,7 @@ const polkadot: CurrenciesData<Transaction> = {
483
476
  blockHeight: 0,
484
477
  operations: [],
485
478
  pendingOperations: [],
486
- currencyId: "polkadot",
479
+ currencyId: "assethub_polkadot",
487
480
  lastSyncDate: "",
488
481
  balance: "11000000000",
489
482
  },
@@ -654,6 +647,6 @@ const polkadot: CurrenciesData<Transaction> = {
654
647
  export const dataset: DatasetTest<Transaction> = {
655
648
  implementations: ["js"],
656
649
  currencies: {
657
- polkadot,
650
+ assethub_polkadot,
658
651
  },
659
652
  };