@ledgerhq/live-common 34.55.0-nightly.20251219024040 → 34.55.0-nightly.20251223024125

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 (34) hide show
  1. package/lib/account/recentAddresses.d.ts +2 -1
  2. package/lib/account/recentAddresses.d.ts.map +1 -1
  3. package/lib/account/recentAddresses.js +27 -9
  4. package/lib/account/recentAddresses.js.map +1 -1
  5. package/lib/e2e/enum/Provider.d.ts.map +1 -1
  6. package/lib/e2e/enum/Provider.js +3 -1
  7. package/lib/e2e/enum/Provider.js.map +1 -1
  8. package/lib/exchange/providers/swap.d.ts.map +1 -1
  9. package/lib/exchange/providers/swap.js +2 -0
  10. package/lib/exchange/providers/swap.js.map +1 -1
  11. package/lib/families/canton/react.d.ts.map +1 -1
  12. package/lib/families/canton/react.js +11 -9
  13. package/lib/families/canton/react.js.map +1 -1
  14. package/lib-es/account/recentAddresses.d.ts +2 -1
  15. package/lib-es/account/recentAddresses.d.ts.map +1 -1
  16. package/lib-es/account/recentAddresses.js +27 -9
  17. package/lib-es/account/recentAddresses.js.map +1 -1
  18. package/lib-es/e2e/enum/Provider.d.ts.map +1 -1
  19. package/lib-es/e2e/enum/Provider.js +3 -1
  20. package/lib-es/e2e/enum/Provider.js.map +1 -1
  21. package/lib-es/exchange/providers/swap.d.ts.map +1 -1
  22. package/lib-es/exchange/providers/swap.js +2 -0
  23. package/lib-es/exchange/providers/swap.js.map +1 -1
  24. package/lib-es/families/canton/react.d.ts.map +1 -1
  25. package/lib-es/families/canton/react.js +11 -9
  26. package/lib-es/families/canton/react.js.map +1 -1
  27. package/package.json +75 -75
  28. package/src/account/recentAddresses.test.ts +115 -15
  29. package/src/account/recentAddresses.ts +37 -13
  30. package/src/e2e/enum/Provider.ts +3 -1
  31. package/src/exchange/providers/swap.ts +2 -0
  32. package/src/families/canton/react.test.ts +24 -20
  33. package/src/families/canton/react.ts +12 -7
  34. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +758 -34
@@ -61,13 +61,18 @@ export const getRemainingTime = (diff: number): string => {
61
61
  const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
62
62
  const seconds = Math.floor((diff % (1000 * 60)) / 1000);
63
63
 
64
- let format = "";
65
- if (days > 0) format += `${days}d `;
66
- if (hours > 0) format += `${hours}h `;
67
- if (minutes > 0) format += `${minutes}m `;
68
- format += `${seconds}s`;
69
-
70
- return format.trim();
64
+ const startIndex = days > 0 ? 0 : hours > 0 ? 1 : minutes > 0 ? 2 : 3;
65
+ const units = [
66
+ [days, "d"],
67
+ [hours, "h"],
68
+ [minutes, "m"],
69
+ [seconds, "s"],
70
+ ] as const;
71
+
72
+ return units
73
+ .slice(startIndex)
74
+ .map(([value, suffix]) => `${value.toString().padStart(2, "0")}${suffix}`)
75
+ .join(" ");
71
76
  };
72
77
 
73
78
  export const useTimeRemaining = (expiresAtMicros = 0, isExpired = false): string => {