decentraland-dapps 12.52.2-rc → 12.52.2

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 (59) hide show
  1. package/dist/lib/mana.d.ts +0 -4
  2. package/dist/lib/mana.js +6 -30
  3. package/dist/lib/mana.js.map +1 -1
  4. package/package.json +1 -1
  5. package/coverage/clover.xml +0 -894
  6. package/coverage/coverage-final.json +0 -35
  7. package/coverage/lcov-report/base.css +0 -224
  8. package/coverage/lcov-report/block-navigation.js +0 -79
  9. package/coverage/lcov-report/containers/MetaTransactionError/MetaTransactionError.container.ts.html +0 -116
  10. package/coverage/lcov-report/containers/MetaTransactionError/MetaTransactionError.tsx.html +0 -188
  11. package/coverage/lcov-report/containers/MetaTransactionError/index.html +0 -141
  12. package/coverage/lcov-report/containers/MetaTransactionError/index.ts.html +0 -86
  13. package/coverage/lcov-report/favicon.png +0 -0
  14. package/coverage/lcov-report/index.html +0 -246
  15. package/coverage/lcov-report/lib/api.ts.html +0 -275
  16. package/coverage/lcov-report/lib/chainConfiguration.ts.html +0 -194
  17. package/coverage/lcov-report/lib/entities.ts.html +0 -401
  18. package/coverage/lcov-report/lib/eth.ts.html +0 -320
  19. package/coverage/lcov-report/lib/index.html +0 -216
  20. package/coverage/lcov-report/lib/localStorage.ts.html +0 -287
  21. package/coverage/lcov-report/lib/mana.ts.html +0 -155
  22. package/coverage/lcov-report/lib/peer.ts.html +0 -212
  23. package/coverage/lcov-report/lib/utils.ts.html +0 -308
  24. package/coverage/lcov-report/modules/loading/index.html +0 -141
  25. package/coverage/lcov-report/modules/loading/reducer.ts.html +0 -158
  26. package/coverage/lcov-report/modules/loading/selectors.ts.html +0 -110
  27. package/coverage/lcov-report/modules/loading/utils.ts.html +0 -122
  28. package/coverage/lcov-report/modules/profile/actions.ts.html +0 -398
  29. package/coverage/lcov-report/modules/profile/index.html +0 -156
  30. package/coverage/lcov-report/modules/profile/reducer.ts.html +0 -524
  31. package/coverage/lcov-report/modules/profile/sagas.ts.html +0 -536
  32. package/coverage/lcov-report/modules/profile/selectors.ts.html +0 -173
  33. package/coverage/lcov-report/modules/toast/actions.ts.html +0 -185
  34. package/coverage/lcov-report/modules/toast/cache.ts.html +0 -146
  35. package/coverage/lcov-report/modules/toast/index.html +0 -171
  36. package/coverage/lcov-report/modules/toast/reducer.ts.html +0 -194
  37. package/coverage/lcov-report/modules/toast/sagas.ts.html +0 -395
  38. package/coverage/lcov-report/modules/toast/selectors.ts.html +0 -104
  39. package/coverage/lcov-report/modules/toast/toasts/index.html +0 -111
  40. package/coverage/lcov-report/modules/toast/toasts/meta-transactions.tsx.html +0 -293
  41. package/coverage/lcov-report/modules/transaction/index.html +0 -126
  42. package/coverage/lcov-report/modules/transaction/types.ts.html +0 -389
  43. package/coverage/lcov-report/modules/transaction/utils.ts.html +0 -422
  44. package/coverage/lcov-report/modules/translation/index.html +0 -111
  45. package/coverage/lcov-report/modules/translation/utils.ts.html +0 -326
  46. package/coverage/lcov-report/modules/wallet/actions.ts.html +0 -344
  47. package/coverage/lcov-report/modules/wallet/index.html +0 -156
  48. package/coverage/lcov-report/modules/wallet/sagas.ts.html +0 -872
  49. package/coverage/lcov-report/modules/wallet/selectors.ts.html +0 -227
  50. package/coverage/lcov-report/modules/wallet/utils.ts.html +0 -896
  51. package/coverage/lcov-report/prettify.css +0 -1
  52. package/coverage/lcov-report/prettify.js +0 -2
  53. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  54. package/coverage/lcov-report/sorter.js +0 -170
  55. package/coverage/lcov-report/tests/index.html +0 -141
  56. package/coverage/lcov-report/tests/profileMocks.ts.html +0 -218
  57. package/coverage/lcov-report/tests/sagas.ts.html +0 -113
  58. package/coverage/lcov-report/tests/transactions.ts.html +0 -449
  59. package/coverage/lcov.info +0 -1688
@@ -4,7 +4,3 @@ export declare const MAXIMUM_FRACTION_DIGITS = 2;
4
4
  * It'll return the value as is if it's an invalid number or it doesn't have more than decimals than the upper limit.
5
5
  */
6
6
  export declare function toFixedMANAValue(strValue: string, maximumFractionDigits?: number): string;
7
- /**
8
- * Returns the amount of trailing zeros
9
- */
10
- export declare function getTrailingZeros(strValue: string): number;
package/dist/lib/mana.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTrailingZeros = exports.toFixedMANAValue = exports.MAXIMUM_FRACTION_DIGITS = void 0;
3
+ exports.toFixedMANAValue = exports.MAXIMUM_FRACTION_DIGITS = void 0;
4
4
  // Careful! This value is normally later formated by `toLocaleString` **but** if it ever goes above 3 (the default min maximumFractionDigits),
5
5
  // we should review every call to `toLocaleString` as it will round up values beyond that decimal point
6
6
  exports.MAXIMUM_FRACTION_DIGITS = 2;
@@ -13,39 +13,15 @@ function toFixedMANAValue(strValue, maximumFractionDigits = exports.MAXIMUM_FRAC
13
13
  if (!isNaN(value)) {
14
14
  const decimals = value.toString().split('.')[1];
15
15
  const decimalsCount = decimals ? decimals.length : 0;
16
- const trailingZeros = getTrailingZeros(strValue);
17
- if (trailingZeros + decimalsCount >= maximumFractionDigits) {
16
+ if (decimalsCount >= maximumFractionDigits) {
18
17
  return value.toFixed(maximumFractionDigits);
19
18
  }
19
+ else if (Number(strValue) === value) {
20
+ // when the original string was a valid number, return the parsed value to remove trailing zeros
21
+ return value.toString();
22
+ }
20
23
  }
21
24
  return strValue;
22
25
  }
23
26
  exports.toFixedMANAValue = toFixedMANAValue;
24
- /**
25
- * Returns the amount of trailing zeros
26
- */
27
- function getTrailingZeros(strValue) {
28
- // count zeros
29
- let zeros = 0;
30
- // parse string value to remove trailing zeros
31
- const parsed = parseFloat(strValue);
32
- // remove parsed value from original string value
33
- let rest = strValue.split(parsed.toString()).pop();
34
- // if after removing the parsed value there's nothing left, return 0
35
- if (!rest) {
36
- return 0;
37
- }
38
- // if the first char is a dot, skip it (this would be the case for an integer with decimals, like "1.00")
39
- if (rest[0] === '.') {
40
- rest = rest.slice(1);
41
- }
42
- // count zeros
43
- while (rest[0] === '0') {
44
- zeros++;
45
- rest = rest.slice(1);
46
- }
47
- // return amount
48
- return zeros;
49
- }
50
- exports.getTrailingZeros = getTrailingZeros;
51
27
  //# sourceMappingURL=mana.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mana.js","sourceRoot":"","sources":["../../src/lib/mana.ts"],"names":[],"mappings":";;;AAAA,8IAA8I;AAC9I,uGAAuG;AAC1F,QAAA,uBAAuB,GAAG,CAAC,CAAA;AAExC;;;GAGG;AACH,SAAgB,gBAAgB,CAC9B,QAAgB,EAChB,qBAAqB,GAAG,+BAAuB;IAE/C,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;IAElC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACjB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QAC/C,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QACpD,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;QAChD,IAAI,aAAa,GAAG,aAAa,IAAI,qBAAqB,EAAE;YAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAA;SAC5C;KACF;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAhBD,4CAgBC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,cAAc;IACd,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,8CAA8C;IAC9C,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;IACnC,iDAAiD;IACjD,IAAI,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAA;IAClD,oEAAoE;IACpE,IAAI,C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1,6 @@
1
1
  {
2
2
  "name": "decentraland-dapps",
3
- "version": "12.52.2-rc",
3
+ "version": "12.52.2",
4
4
  "dependencies": {
5
5
  "@0xsequence/multicall": "^0.25.1",
6
6
  "@0xsequence/relayer": "^0.25.1",