@argent/x-shared 1.79.0 → 1.79.1

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 (501) hide show
  1. package/dist/.ts-temp/tsconfig.tsbuildinfo +1 -1
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  3. package/dist/_virtual/_rolldown/runtime.js +20 -0
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.js +112 -488
  6. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.cjs +1 -1
  7. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.js +11 -11
  8. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.cjs +1 -1
  9. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.js +62 -85
  10. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.cjs +1 -1
  11. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.js +153 -190
  12. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.cjs +1 -1
  13. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.js +56 -65
  14. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.cjs +1 -1
  15. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.js +125 -151
  16. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.cjs +1 -1
  17. package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.js +470 -575
  18. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/_assert.cjs +1 -1
  19. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/_assert.js +26 -40
  20. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/crypto.cjs +1 -1
  21. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/crypto.js +4 -4
  22. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.cjs +1 -1
  23. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.js +38 -42
  24. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.cjs +1 -1
  25. package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js +28 -42
  26. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.cjs +1 -1
  27. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.js +17 -26
  28. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.cjs +1 -1
  29. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.js +52 -59
  30. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_u64.cjs +1 -1
  31. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_u64.js +20 -19
  32. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha256.cjs +1 -1
  33. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha256.js +118 -113
  34. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha3.cjs +1 -1
  35. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha3.js +95 -105
  36. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.cjs +1 -1
  37. package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.js +26 -32
  38. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_md.cjs +1 -1
  39. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_md.js +71 -82
  40. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_u64.cjs +1 -1
  41. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_u64.js +20 -20
  42. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha2.cjs +1 -1
  43. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha2.js +125 -124
  44. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha3.cjs +1 -1
  45. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha3.js +102 -116
  46. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.cjs +1 -1
  47. package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.js +62 -76
  48. package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.cjs +1 -1
  49. package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +519 -614
  50. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.cjs +1 -1
  51. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js +15 -19
  52. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.cjs +1 -1
  53. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js +15 -19
  54. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.cjs +1 -1
  55. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js +6 -6
  56. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.cjs +1 -1
  57. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js +15 -19
  58. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.cjs +1 -1
  59. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js +5 -5
  60. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.cjs +1 -1
  61. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js +10 -12
  62. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.cjs +1 -1
  63. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +5 -5
  64. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.cjs +1 -1
  65. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js +6 -7
  66. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.cjs +1 -1
  67. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js +6 -8
  68. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.cjs +1 -1
  69. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js +7 -9
  70. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.cjs +1 -1
  71. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js +6 -8
  72. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.cjs +1 -1
  73. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +9 -9
  74. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.cjs +1 -1
  75. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js +7 -7
  76. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.cjs +1 -1
  77. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js +5 -5
  78. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.cjs +1 -1
  79. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js +10 -15
  80. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.cjs +1 -1
  81. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js +26 -32
  82. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.cjs +1 -1
  83. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js +5 -5
  84. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.cjs +1 -1
  85. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js +5 -5
  86. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.cjs +1 -1
  87. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js +7 -7
  88. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.cjs +1 -1
  89. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +4 -4
  90. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.cjs +1 -1
  91. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js +6 -6
  92. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.cjs +1 -1
  93. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js +8 -8
  94. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.cjs +1 -1
  95. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +12 -13
  96. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.cjs +1 -1
  97. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js +5 -5
  98. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.cjs +1 -1
  99. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js +6 -6
  100. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.cjs +1 -1
  101. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js +6 -6
  102. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.cjs +1 -1
  103. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js +11 -11
  104. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.cjs +1 -1
  105. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js +8 -8
  106. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.cjs +1 -1
  107. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js +7 -7
  108. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.cjs +1 -1
  109. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js +6 -6
  110. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.cjs +1 -1
  111. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js +9 -9
  112. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.cjs +1 -1
  113. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js +5 -5
  114. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.cjs +1 -1
  115. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js +8 -11
  116. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.cjs +1 -1
  117. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js +7 -7
  118. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.cjs +1 -1
  119. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js +6 -6
  120. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.cjs +1 -1
  121. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js +6 -6
  122. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.cjs +1 -1
  123. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js +11 -11
  124. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.cjs +1 -1
  125. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js +7 -7
  126. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.cjs +1 -1
  127. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js +6 -6
  128. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.cjs +1 -1
  129. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js +6 -6
  130. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.cjs +1 -1
  131. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js +7 -7
  132. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.cjs +1 -1
  133. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js +4 -4
  134. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.cjs +1 -1
  135. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +6 -6
  136. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.cjs +1 -1
  137. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +4 -4
  138. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.cjs +1 -1
  139. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js +6 -6
  140. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.cjs +1 -1
  141. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js +5 -5
  142. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.cjs +1 -1
  143. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js +8 -8
  144. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.cjs +1 -1
  145. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js +6 -8
  146. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.cjs +1 -1
  147. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js +14 -16
  148. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.cjs +1 -1
  149. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js +5 -5
  150. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.cjs +1 -1
  151. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js +10 -11
  152. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.cjs +1 -1
  153. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +6 -6
  154. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.cjs +1 -1
  155. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js +4 -5
  156. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqWith.cjs +1 -1
  157. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqWith.js +6 -6
  158. package/dist/node_modules/.pnpm/micro-starknet@0.2.3/node_modules/micro-starknet/lib/esm/index.cjs +1 -1
  159. package/dist/node_modules/.pnpm/micro-starknet@0.2.3/node_modules/micro-starknet/lib/esm/index.js +121 -118
  160. package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.cjs +1 -1
  161. package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.js +377 -417
  162. package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.cjs +1 -1
  163. package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.js +546 -635
  164. package/dist/paymaster.cjs +1 -1
  165. package/dist/paymaster.js +2 -11
  166. package/dist/simulation.cjs +1 -1
  167. package/dist/simulation.js +22 -90
  168. package/dist/src/account/account.model.cjs +1 -1
  169. package/dist/src/account/account.model.js +58 -52
  170. package/dist/src/account/accountv4.cjs +1 -1
  171. package/dist/src/account/accountv4.js +9 -11
  172. package/dist/src/account/preferences.model.cjs +1 -1
  173. package/dist/src/account/preferences.model.js +12 -10
  174. package/dist/src/accountNameGenerator/colors.cjs +1 -1
  175. package/dist/src/accountNameGenerator/colors.js +24 -24
  176. package/dist/src/accountNameGenerator/index.cjs +1 -1
  177. package/dist/src/accountNameGenerator/index.js +23 -23
  178. package/dist/src/accountNameGenerator/x-names.json.cjs +1 -1
  179. package/dist/src/accountNameGenerator/x-names.json.js +1922 -7
  180. package/dist/src/assets/tokens.json.cjs +1 -1
  181. package/dist/src/assets/tokens.json.js +180 -180
  182. package/dist/src/backend/schema.cjs +1 -1
  183. package/dist/src/backend/schema.js +9 -12
  184. package/dist/src/backend/sessionKeys/schema.cjs +1 -1
  185. package/dist/src/backend/sessionKeys/schema.js +27 -30
  186. package/dist/src/bigdecimal/constants.cjs +1 -1
  187. package/dist/src/bigdecimal/constants.js +6 -3
  188. package/dist/src/bigdecimal/createUnitsSchema.cjs +1 -1
  189. package/dist/src/bigdecimal/createUnitsSchema.js +7 -7
  190. package/dist/src/bigdecimal/formatUnits.cjs +1 -1
  191. package/dist/src/bigdecimal/formatUnits.js +9 -10
  192. package/dist/src/bigdecimal/index.cjs +1 -1
  193. package/dist/src/bigdecimal/index.js +45 -41
  194. package/dist/src/bigdecimal/lib.cjs +1 -1
  195. package/dist/src/bigdecimal/lib.js +105 -117
  196. package/dist/src/bigdecimal/parseUnits.cjs +1 -1
  197. package/dist/src/bigdecimal/parseUnits.js +18 -21
  198. package/dist/src/bigdecimal/utils.cjs +1 -1
  199. package/dist/src/bigdecimal/utils.js +33 -30
  200. package/dist/src/cache/CacheService.cjs +1 -1
  201. package/dist/src/cache/CacheService.js +32 -36
  202. package/dist/src/chains/starknet/address.cjs +1 -1
  203. package/dist/src/chains/starknet/address.js +73 -117
  204. package/dist/src/chains/starknet/addressDomain.cjs +1 -1
  205. package/dist/src/chains/starknet/addressDomain.js +14 -29
  206. package/dist/src/chains/starknet/addressInput.cjs +1 -1
  207. package/dist/src/chains/starknet/addressInput.js +6 -7
  208. package/dist/src/chains/starknet/argentName.cjs +1 -1
  209. package/dist/src/chains/starknet/argentName.js +10 -14
  210. package/dist/src/chains/starknet/cairoVersionSchema.cjs +1 -1
  211. package/dist/src/chains/starknet/cairoVersionSchema.js +5 -5
  212. package/dist/src/chains/starknet/constants.cjs +1 -1
  213. package/dist/src/chains/starknet/constants.js +4 -10
  214. package/dist/src/chains/starknet/getAddressFromArgentName.cjs +1 -1
  215. package/dist/src/chains/starknet/getAddressFromArgentName.js +38 -46
  216. package/dist/src/chains/starknet/getAddressFromStarkName.cjs +1 -1
  217. package/dist/src/chains/starknet/getAddressFromStarkName.js +59 -66
  218. package/dist/src/chains/starknet/network.cjs +1 -1
  219. package/dist/src/chains/starknet/network.js +20 -26
  220. package/dist/src/chains/starknet/services/address/StarknetAddressService.cjs +1 -1
  221. package/dist/src/chains/starknet/services/address/StarknetAddressService.js +31 -36
  222. package/dist/src/chains/starknet/services/deploymentData/constants.cjs +1 -1
  223. package/dist/src/chains/starknet/services/deploymentData/constants.js +14 -21
  224. package/dist/src/chains/starknet/services/deploymentData/deploymentData.schema.cjs +1 -1
  225. package/dist/src/chains/starknet/services/deploymentData/deploymentData.schema.js +15 -17
  226. package/dist/src/chains/starknet/services/deploymentData/findImplementationForAccount.cjs +1 -1
  227. package/dist/src/chains/starknet/services/deploymentData/findImplementationForAccount.js +61 -65
  228. package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.cjs +1 -1
  229. package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.js +46 -65
  230. package/dist/src/chains/starknet/starknetId.cjs +1 -1
  231. package/dist/src/chains/starknet/starknetId.js +10 -14
  232. package/dist/src/currencyFetchService/CurrencyFetchService.cjs +1 -1
  233. package/dist/src/currencyFetchService/CurrencyFetchService.js +13 -18
  234. package/dist/src/currencyFetchService/types.ts.cjs +1 -1
  235. package/dist/src/currencyFetchService/types.ts.js +9 -12
  236. package/dist/src/errors/account.cjs +1 -1
  237. package/dist/src/errors/account.js +12 -13
  238. package/dist/src/errors/address.cjs +1 -1
  239. package/dist/src/errors/address.js +11 -12
  240. package/dist/src/errors/baseErrors.cjs +1 -1
  241. package/dist/src/errors/baseErrors.js +14 -14
  242. package/dist/src/errors/call.cjs +1 -1
  243. package/dist/src/errors/call.js +12 -13
  244. package/dist/src/errors/network.cjs +1 -1
  245. package/dist/src/errors/network.js +11 -12
  246. package/dist/src/errors/review.cjs +1 -1
  247. package/dist/src/errors/review.js +11 -12
  248. package/dist/src/errors/swap.cjs +1 -1
  249. package/dist/src/errors/swap.js +12 -13
  250. package/dist/src/features/paymaster/PaymasterService.cjs +1 -1
  251. package/dist/src/features/paymaster/PaymasterService.js +73 -87
  252. package/dist/src/features/paymaster/types.cjs +1 -1
  253. package/dist/src/features/paymaster/types.js +41 -51
  254. package/dist/src/features/simulation/activity/normalize.cjs +1 -1
  255. package/dist/src/features/simulation/activity/normalize.js +36 -38
  256. package/dist/src/features/simulation/activity/schema.cjs +1 -1
  257. package/dist/src/features/simulation/activity/schema.js +224 -250
  258. package/dist/src/features/simulation/activity/utils/createNativeActivity.cjs +1 -1
  259. package/dist/src/features/simulation/activity/utils/createNativeActivity.js +23 -27
  260. package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.cjs +1 -1
  261. package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.js +14 -21
  262. package/dist/src/features/simulation/activity/utils/getOverallLastModified.cjs +1 -1
  263. package/dist/src/features/simulation/activity/utils/getOverallLastModified.js +5 -5
  264. package/dist/src/features/simulation/activity/utils/hasDelegationActivity.cjs +1 -1
  265. package/dist/src/features/simulation/activity/utils/hasDelegationActivity.js +4 -4
  266. package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.cjs +1 -1
  267. package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.js +15 -19
  268. package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.cjs +1 -1
  269. package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.js +15 -19
  270. package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.cjs +1 -1
  271. package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.js +5 -5
  272. package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.cjs +1 -1
  273. package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.js +19 -21
  274. package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.cjs +1 -1
  275. package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.js +15 -19
  276. package/dist/src/features/simulation/activity/utils/isSwapActivity.cjs +1 -1
  277. package/dist/src/features/simulation/activity/utils/isSwapActivity.js +17 -18
  278. package/dist/src/features/simulation/activity/utils/isUpgradeActivity.cjs +1 -1
  279. package/dist/src/features/simulation/activity/utils/isUpgradeActivity.js +15 -19
  280. package/dist/src/features/simulation/activity/utils/parseAccountActivities.cjs +1 -1
  281. package/dist/src/features/simulation/activity/utils/parseAccountActivities.js +12 -12
  282. package/dist/src/features/simulation/activity/utils/parseFinanceActivities.cjs +1 -1
  283. package/dist/src/features/simulation/activity/utils/parseFinanceActivities.js +32 -32
  284. package/dist/src/features/simulation/fees/schema.cjs +1 -1
  285. package/dist/src/features/simulation/fees/schema.js +33 -47
  286. package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.cjs +1 -1
  287. package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.js +15 -17
  288. package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.cjs +1 -1
  289. package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.js +5 -5
  290. package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
  291. package/dist/src/features/simulation/transactionReview/schema.js +221 -242
  292. package/dist/src/features/simulation/warning/helper.cjs +1 -1
  293. package/dist/src/features/simulation/warning/helper.js +12 -11
  294. package/dist/src/features/simulation/warning/schema.cjs +1 -1
  295. package/dist/src/features/simulation/warning/schema.js +10 -11
  296. package/dist/src/features/swap/models/order.model.cjs +1 -1
  297. package/dist/src/features/swap/models/order.model.js +16 -19
  298. package/dist/src/features/swap/models/quote.model.cjs +1 -1
  299. package/dist/src/features/swap/models/quote.model.js +31 -35
  300. package/dist/src/features/swap/models/trade.model.cjs +1 -1
  301. package/dist/src/features/swap/models/trade.model.js +25 -27
  302. package/dist/src/features/swap/services/SwapSharedService.cjs +1 -1
  303. package/dist/src/features/swap/services/SwapSharedService.js +71 -75
  304. package/dist/src/features/swap/services/SwapTransactionService.cjs +1 -1
  305. package/dist/src/features/swap/services/SwapTransactionService.js +57 -63
  306. package/dist/src/features/swap/utils/slippage.cjs +1 -1
  307. package/dist/src/features/swap/utils/slippage.js +18 -25
  308. package/dist/src/features/swap/utils/totalFee.cjs +1 -1
  309. package/dist/src/features/swap/utils/totalFee.js +12 -12
  310. package/dist/src/http/DateService.cjs +1 -1
  311. package/dist/src/http/DateService.js +15 -18
  312. package/dist/src/http/HttpError.cjs +1 -1
  313. package/dist/src/http/HttpError.js +7 -7
  314. package/dist/src/http/HttpService.cjs +1 -1
  315. package/dist/src/http/HttpService.js +117 -134
  316. package/dist/src/http/IHttpService.cjs +1 -1
  317. package/dist/src/http/IHttpService.js +6 -6
  318. package/dist/src/http/SWRService.cjs +1 -1
  319. package/dist/src/http/SWRService.js +50 -57
  320. package/dist/src/http/fetcher.cjs +1 -1
  321. package/dist/src/http/fetcher.js +29 -35
  322. package/dist/src/http/time.cjs +1 -1
  323. package/dist/src/http/time.js +15 -18
  324. package/dist/src/knownDapps/KnownDappsBackendService.cjs +1 -1
  325. package/dist/src/knownDapps/KnownDappsBackendService.js +13 -14
  326. package/dist/src/knownDapps/schema.cjs +1 -1
  327. package/dist/src/knownDapps/schema.js +41 -44
  328. package/dist/src/knownDapps/utils/getDapplandUrl.cjs +1 -1
  329. package/dist/src/knownDapps/utils/getDapplandUrl.js +7 -8
  330. package/dist/src/nameResolution/ResolveNameService.cjs +1 -1
  331. package/dist/src/nameResolution/ResolveNameService.js +34 -41
  332. package/dist/src/nameResolution/schema.cjs +1 -1
  333. package/dist/src/nameResolution/schema.js +20 -25
  334. package/dist/src/nfts/BackendNftService.cjs +1 -1
  335. package/dist/src/nfts/BackendNftService.js +103 -116
  336. package/dist/src/nfts/BackendPaginationError.cjs +1 -1
  337. package/dist/src/nfts/BackendPaginationError.js +11 -12
  338. package/dist/src/nfts/utils.cjs +1 -1
  339. package/dist/src/nfts/utils.js +11 -14
  340. package/dist/src/onchainRecovery/OnchainRecoveryService.cjs +1 -1
  341. package/dist/src/onchainRecovery/OnchainRecoveryService.js +38 -68
  342. package/dist/src/onchainRecovery/schema.cjs +1 -1
  343. package/dist/src/onchainRecovery/schema.js +35 -49
  344. package/dist/src/platform/isBraveBrowser.cjs +1 -1
  345. package/dist/src/platform/isBraveBrowser.js +8 -10
  346. package/dist/src/platform/isBrowser.cjs +1 -1
  347. package/dist/src/platform/isBrowser.js +17 -22
  348. package/dist/src/signer/mergeOwnerGuardianSignatures.cjs +1 -1
  349. package/dist/src/signer/mergeOwnerGuardianSignatures.js +28 -30
  350. package/dist/src/signer/multisigner.cjs +1 -1
  351. package/dist/src/signer/multisigner.js +16 -17
  352. package/dist/src/signer/seedphrase.cjs +1 -1
  353. package/dist/src/signer/seedphrase.js +7 -7
  354. package/dist/src/staking/schema.cjs +1 -1
  355. package/dist/src/staking/schema.js +146 -162
  356. package/dist/src/storage/base.cjs +1 -1
  357. package/dist/src/storage/base.js +33 -34
  358. package/dist/src/storage/utils.cjs +1 -1
  359. package/dist/src/storage/utils.js +19 -28
  360. package/dist/src/tokens/balances.cjs +1 -1
  361. package/dist/src/tokens/balances.js +34 -38
  362. package/dist/src/tokens/constants.cjs +1 -1
  363. package/dist/src/tokens/constants.js +4 -4
  364. package/dist/src/tokens/convertCurrencyValueToTokenAmount.cjs +1 -1
  365. package/dist/src/tokens/convertCurrencyValueToTokenAmount.js +8 -9
  366. package/dist/src/tokens/convertTokenAmountToCurrencyValue.cjs +1 -1
  367. package/dist/src/tokens/convertTokenAmountToCurrencyValue.js +14 -15
  368. package/dist/src/tokens/convertTokenUnitAmountWithDecimals.cjs +1 -1
  369. package/dist/src/tokens/convertTokenUnitAmountWithDecimals.js +8 -9
  370. package/dist/src/tokens/ensureDecimals.cjs +1 -1
  371. package/dist/src/tokens/ensureDecimals.js +4 -4
  372. package/dist/src/tokens/getCurrencySymbol.cjs +1 -1
  373. package/dist/src/tokens/getCurrencySymbol.js +14 -14
  374. package/dist/src/tokens/isUnlimitedAmount.cjs +1 -1
  375. package/dist/src/tokens/isUnlimitedAmount.js +5 -5
  376. package/dist/src/tokens/prettifyCurrencyValue.cjs +1 -1
  377. package/dist/src/tokens/prettifyCurrencyValue.js +13 -14
  378. package/dist/src/tokens/prettifyTokenAmount.cjs +1 -1
  379. package/dist/src/tokens/prettifyTokenAmount.js +22 -22
  380. package/dist/src/tokens/service/implementation.cjs +1 -1
  381. package/dist/src/tokens/service/implementation.js +28 -40
  382. package/dist/src/tokens/service/tokenError.cjs +1 -1
  383. package/dist/src/tokens/service/tokenError.js +11 -12
  384. package/dist/src/tokens/service/types/backend.model.cjs +1 -1
  385. package/dist/src/tokens/service/types/backend.model.js +128 -163
  386. package/dist/src/tokens/service/types/defiPosition.model.cjs +1 -1
  387. package/dist/src/tokens/service/types/defiPosition.model.js +83 -99
  388. package/dist/src/tokens/service/types/defiPositionType.model.cjs +1 -1
  389. package/dist/src/tokens/service/types/defiPositionType.model.js +9 -9
  390. package/dist/src/tokens/service/types/unclaimedRewards.model.cjs +1 -1
  391. package/dist/src/tokens/service/types/unclaimedRewards.model.js +15 -16
  392. package/dist/src/tokens/service/types/webToken.model.cjs +1 -1
  393. package/dist/src/tokens/service/types/webToken.model.js +28 -51
  394. package/dist/src/tokens/utils.cjs +1 -1
  395. package/dist/src/tokens/utils.js +5 -9
  396. package/dist/src/transactions/amount.cjs +1 -1
  397. package/dist/src/transactions/amount.js +17 -24
  398. package/dist/src/transactions/buildTransactions.cjs +1 -1
  399. package/dist/src/transactions/buildTransactions.js +30 -33
  400. package/dist/src/transactions/errors.cjs +1 -1
  401. package/dist/src/transactions/errors.js +11 -18
  402. package/dist/src/transactions/estimate/adjustment.cjs +1 -1
  403. package/dist/src/transactions/estimate/adjustment.js +6 -6
  404. package/dist/src/transactions/estimate/argentMaxFee.cjs +1 -1
  405. package/dist/src/transactions/estimate/argentMaxFee.js +10 -13
  406. package/dist/src/transactions/estimate/error.cjs +1 -1
  407. package/dist/src/transactions/estimate/error.js +12 -13
  408. package/dist/src/transactions/estimate/model.cjs +1 -1
  409. package/dist/src/transactions/estimate/model.js +18 -13
  410. package/dist/src/transactions/estimate/utils.cjs +1 -1
  411. package/dist/src/transactions/estimate/utils.js +139 -172
  412. package/dist/src/transactions/findTransfersAndApprovals.cjs +1 -1
  413. package/dist/src/transactions/findTransfersAndApprovals.js +34 -30
  414. package/dist/src/transactions/getPrettyRcpError.cjs +1 -1
  415. package/dist/src/transactions/getPrettyRcpError.js +8 -10
  416. package/dist/src/transactions/service/implementation.cjs +1 -1
  417. package/dist/src/transactions/service/implementation.js +187 -208
  418. package/dist/src/transactions/service/types.cjs +1 -1
  419. package/dist/src/transactions/service/types.js +9 -9
  420. package/dist/src/transactions/service/utils.cjs +1 -1
  421. package/dist/src/transactions/service/utils.js +24 -25
  422. package/dist/src/transactions/transactionExecuteTypes.cjs +1 -1
  423. package/dist/src/transactions/transactionExecuteTypes.js +8 -9
  424. package/dist/src/transactions/transactionReviewTypes.cjs +1 -1
  425. package/dist/src/transactions/transactionReviewTypes.js +9 -9
  426. package/dist/src/transactions/transactionVersion.cjs +1 -1
  427. package/dist/src/transactions/transactionVersion.js +8 -13
  428. package/dist/src/transactions/txv3.cjs +1 -1
  429. package/dist/src/transactions/txv3.js +10 -11
  430. package/dist/src/utils/address.cjs +1 -1
  431. package/dist/src/utils/address.js +4 -4
  432. package/dist/src/utils/arrays.cjs +1 -1
  433. package/dist/src/utils/arrays.js +4 -4
  434. package/dist/src/utils/avatarImage.cjs +4 -4
  435. package/dist/src/utils/avatarImage.js +35 -40
  436. package/dist/src/utils/base58.cjs +1 -1
  437. package/dist/src/utils/base58.js +12 -15
  438. package/dist/src/utils/bigNumber.cjs +1 -1
  439. package/dist/src/utils/bigNumber.d.ts +1 -1
  440. package/dist/src/utils/bigNumber.js +5 -7
  441. package/dist/src/utils/bips.cjs +1 -1
  442. package/dist/src/utils/bips.js +12 -10
  443. package/dist/src/utils/daysBetween.cjs +1 -1
  444. package/dist/src/utils/daysBetween.js +6 -6
  445. package/dist/src/utils/env.cjs +1 -1
  446. package/dist/src/utils/env.js +4 -4
  447. package/dist/src/utils/hex.cjs +1 -1
  448. package/dist/src/utils/hex.js +7 -8
  449. package/dist/src/utils/id.cjs +1 -1
  450. package/dist/src/utils/id.js +7 -7
  451. package/dist/src/utils/initials.cjs +1 -1
  452. package/dist/src/utils/initials.js +12 -15
  453. package/dist/src/utils/isContractDeployed.cjs +1 -1
  454. package/dist/src/utils/isContractDeployed.js +9 -9
  455. package/dist/src/utils/nonNullable.cjs +1 -1
  456. package/dist/src/utils/nonNullable.js +6 -6
  457. package/dist/src/utils/number/abbreviateNumber.cjs +1 -1
  458. package/dist/src/utils/number/abbreviateNumber.js +13 -14
  459. package/dist/src/utils/number/isAllowedAddressHexInputValue.cjs +1 -1
  460. package/dist/src/utils/number/isAllowedAddressHexInputValue.js +4 -7
  461. package/dist/src/utils/number/isAllowedNumericInputValue.cjs +1 -1
  462. package/dist/src/utils/number/isAllowedNumericInputValue.js +5 -5
  463. package/dist/src/utils/number/isNumeric.cjs +1 -1
  464. package/dist/src/utils/number/isNumeric.js +4 -4
  465. package/dist/src/utils/number/prettifyNumber.cjs +1 -1
  466. package/dist/src/utils/number/prettifyNumber.js +65 -75
  467. package/dist/src/utils/parseAmount.cjs +1 -1
  468. package/dist/src/utils/parseAmount.js +10 -11
  469. package/dist/src/utils/pluralise.cjs +1 -1
  470. package/dist/src/utils/pluralise.js +4 -4
  471. package/dist/src/utils/readFileAsString.cjs +1 -1
  472. package/dist/src/utils/readFileAsString.js +6 -6
  473. package/dist/src/utils/retryUntilInitialised.cjs +1 -1
  474. package/dist/src/utils/retryUntilInitialised.js +21 -20
  475. package/dist/src/utils/schemas.cjs +1 -1
  476. package/dist/src/utils/schemas.js +29 -26
  477. package/dist/src/utils/starknet/starknet.cjs +1 -1
  478. package/dist/src/utils/starknet/starknet.js +64 -77
  479. package/dist/src/utils/starknet/starknetLibTypes.cjs +1 -1
  480. package/dist/src/utils/starknet/starknetLibTypes.js +7 -7
  481. package/dist/src/utils/starknet/starknetSchemas.cjs +1 -1
  482. package/dist/src/utils/starknet/starknetSchemas.js +84 -99
  483. package/dist/src/utils/transactions.cjs +1 -1
  484. package/dist/src/utils/transactions.js +10 -10
  485. package/dist/src/utils/url/urlWithQuery.cjs +1 -1
  486. package/dist/src/utils/url/urlWithQuery.js +8 -8
  487. package/dist/src/utils/voidify.cjs +1 -1
  488. package/dist/src/utils/voidify.js +7 -7
  489. package/dist/swap.cjs +1 -1
  490. package/dist/swap.js +8 -22
  491. package/package.json +15 -15
  492. package/dist/_virtual/_commonjsHelpers.cjs +0 -1
  493. package/dist/_virtual/_commonjsHelpers.js +0 -6
  494. package/dist/_virtual/numeral.cjs +0 -1
  495. package/dist/_virtual/numeral.js +0 -7
  496. package/dist/_virtual/numeral2.cjs +0 -1
  497. package/dist/_virtual/numeral2.js +0 -4
  498. package/dist/_virtual/semver.cjs +0 -1
  499. package/dist/_virtual/semver.js +0 -7
  500. package/dist/_virtual/semver2.cjs +0 -1
  501. package/dist/_virtual/semver2.js +0 -4
@@ -1,41 +1,45 @@
1
- import { absBigInt as t, formatCurrency as o, formatEther as m, parseCurrency as s, parseCurrencyAbs as a, parseEther as i, toBigDecimal as n } from "./utils.js";
2
- import { abs as f, add as c, ceil as l, div as x, eq as d, floor as u, gt as b, gte as g, lt as h, lte as y, max as C, min as D, mod as E, mul as U, not as q, pow as B, round as v, sign as w, sqrt as A, sub as F, toFixedDecimals as I, toTiniestPossibleDecimal as N } from "./lib.js";
3
- import { parseUnits as P } from "./parseUnits.js";
4
- import { formatUnits as T } from "./formatUnits.js";
5
- import { ONE as k } from "./constants.js";
6
- import { createUnitsSchema as G } from "./createUnitsSchema.js";
7
- export {
8
- k as ONE,
9
- f as abs,
10
- t as absBigInt,
11
- c as add,
12
- l as ceil,
13
- G as createUnitsSchema,
14
- x as div,
15
- d as eq,
16
- u as floor,
17
- o as formatCurrency,
18
- m as formatEther,
19
- T as formatUnits,
20
- b as gt,
21
- g as gte,
22
- h as lt,
23
- y as lte,
24
- C as max,
25
- D as min,
26
- E as mod,
27
- U as mul,
28
- q as not,
29
- s as parseCurrency,
30
- a as parseCurrencyAbs,
31
- i as parseEther,
32
- P as parseUnits,
33
- B as pow,
34
- v as round,
35
- w as sign,
36
- A as sqrt,
37
- F as sub,
38
- n as toBigDecimal,
39
- I as toFixedDecimals,
40
- N as toTiniestPossibleDecimal
41
- };
1
+ import { __exportAll as e } from "../../_virtual/_rolldown/runtime.js";
2
+ import { formatUnits as t } from "./formatUnits.js";
3
+ import { abs as n, add as r, ceil as i, div as a, eq as o, floor as s, gt as c, gte as l, lt as u, lte as d, max as f, min as p, mod as m, mul as h, not as g, pow as _, round as v, sign as y, sqrt as b, sub as x, toFixedDecimals as S, toTiniestPossibleDecimal as C } from "./lib.js";
4
+ import { parseUnits as w } from "./parseUnits.js";
5
+ import { absBigInt as T, formatCurrency as E, formatEther as D, parseCurrency as O, parseCurrencyAbs as k, parseEther as A, toBigDecimal as j } from "./utils.js";
6
+ import { ONE as M } from "./constants.js";
7
+ import { createUnitsSchema as N } from "./createUnitsSchema.js";
8
+ //#region src/bigdecimal/index.ts
9
+ var P = /* @__PURE__ */ e({
10
+ ONE: () => M,
11
+ abs: () => n,
12
+ absBigInt: () => T,
13
+ add: () => r,
14
+ ceil: () => i,
15
+ createUnitsSchema: () => N,
16
+ div: () => a,
17
+ eq: () => o,
18
+ floor: () => s,
19
+ formatCurrency: () => E,
20
+ formatEther: () => D,
21
+ formatUnits: () => t,
22
+ gt: () => c,
23
+ gte: () => l,
24
+ lt: () => u,
25
+ lte: () => d,
26
+ max: () => f,
27
+ min: () => p,
28
+ mod: () => m,
29
+ mul: () => h,
30
+ not: () => g,
31
+ parseCurrency: () => O,
32
+ parseCurrencyAbs: () => k,
33
+ parseEther: () => A,
34
+ parseUnits: () => w,
35
+ pow: () => _,
36
+ round: () => v,
37
+ sign: () => y,
38
+ sqrt: () => b,
39
+ sub: () => x,
40
+ toBigDecimal: () => j,
41
+ toFixedDecimals: () => S,
42
+ toTiniestPossibleDecimal: () => C
43
+ });
44
+ //#endregion
45
+ export { P as bigdecimal_exports };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(e,t)=>({decimals:t,value:t>=e.decimals?e.value*BigInt(10)**BigInt(t-e.decimals):e.value/BigInt(10)**BigInt(e.decimals-t)}),d=e=>{if(e.value===BigInt(0))return{value:BigInt(0),decimals:0};const i=e.value.toString().replace("-","").split("").reverse();let l=0;for(const a of i){if(a!=="0")break;l++}const s=Math.max(0,e.decimals-l);return r(e,s)},v=(e,t)=>{const i=Math.max(e.decimals,t.decimals),[l,s]=[e,t].map(a=>r(a,i));return[l.value,s.value,i]},o=e=>(t,i)=>{const[l,s,a]=v(t,i);return{decimals:a,value:e(l,s,a)}},c=e=>(t,i)=>{const[l,s]=v(t,i);return e(l,s)},h=o((e,t)=>e+t),b=o((e,t)=>e-t),g=o((e,t,i)=>{if(t===BigInt(0))throw new Error("Division by zero is not allowed");return e*BigInt(10)**BigInt(i)/t}),j=(e,t)=>d({decimals:e.decimals+t.decimals,value:e.value*t.value}),p=o((e,t)=>{if(t===BigInt(0))throw new Error("Modulus by zero is not allowed");return e%t}),D=e=>({decimals:e.decimals,value:e.value>=BigInt(0)?e.value:-e.value}),m=c((e,t)=>e===t),B=c((e,t)=>e<t),q=c((e,t)=>e>t),I=c((e,t)=>e<=t),f=c((e,t)=>e>=t),A=(e,t)=>!m(e,t),w=(e,t)=>{if(!Number.isInteger(t))throw new Error("Exponent must be an integer");if(t<0)return g({value:BigInt(1),decimals:0},w(e,-t));if(t===0)return{value:BigInt(1),decimals:0};let i={value:BigInt(1),decimals:0},l={...e},s=Math.abs(t);for(;s>0;)s&1&&(i={value:i.value*l.value,decimals:i.decimals+l.decimals}),l={value:l.value*l.value,decimals:l.decimals*2},s>>=1;return i},E=e=>{if(B(e,{value:BigInt(0),decimals:0}))throw new Error("Cannot calculate square root of negative number");if(e.value===BigInt(0))return{value:BigInt(0),decimals:0};const t=e.decimals+e.decimals%2,i=r(e,t);let l=BigInt(0),s=i.value,a=s;for(;l<=s;){const n=(l+s)/BigInt(2),u=n*n;if(u===i.value){a=n;break}u<i.value?(l=n+BigInt(1),a=n):s=n-BigInt(1)}return{value:a,decimals:t/2}},M=e=>{const t=BigInt(10)**BigInt(e.decimals),i=e.value%t,l=t/BigInt(2);return{decimals:0,value:e.value/t+(i>=l?BigInt(1):BigInt(0))}},S=e=>({decimals:0,value:e.value/BigInt(10)**BigInt(e.decimals)}),y=e=>{const t=BigInt(10)**BigInt(e.decimals);return{decimals:0,value:(e.value+t-BigInt(1))/t}},z=(e,t)=>f(e,t)?e:t,F=(e,t)=>I(e,t)?e:t,O=e=>e.value===BigInt(0)?0:e.value>BigInt(0)?1:-1;exports.abs=D;exports.add=h;exports.ceil=y;exports.div=g;exports.eq=m;exports.floor=S;exports.gt=q;exports.gte=f;exports.lt=B;exports.lte=I;exports.max=z;exports.min=F;exports.mod=p;exports.mul=j;exports.not=A;exports.pow=w;exports.round=M;exports.sign=O;exports.sqrt=E;exports.sub=b;exports.toFixedDecimals=r;exports.toTiniestPossibleDecimal=d;
1
+ var e=(e,t)=>({decimals:t,value:t>=e.decimals?e.value*BigInt(10)**BigInt(t-e.decimals):e.value/BigInt(10)**BigInt(e.decimals-t)}),t=t=>{if(t.value===BigInt(0))return{value:BigInt(0),decimals:0};let n=t.value.toString().replace(`-`,``).split(``).reverse(),r=0;for(let e of n){if(e!==`0`)break;r++}return e(t,Math.max(0,t.decimals-r))},n=(t,n)=>{let r=Math.max(t.decimals,n.decimals),[i,a]=[t,n].map(t=>e(t,r));return[i.value,a.value,r]},r=e=>(t,r)=>{let[i,a,o]=n(t,r);return{decimals:o,value:e(i,a,o)}},i=e=>(t,r)=>{let[i,a]=n(t,r);return e(i,a)},a=r((e,t)=>e+t),o=r((e,t)=>e-t),s=r((e,t,n)=>{if(t===BigInt(0))throw Error(`Division by zero is not allowed`);return e*BigInt(10)**BigInt(n)/t}),c=(e,n)=>t({decimals:e.decimals+n.decimals,value:e.value*n.value}),l=r((e,t)=>{if(t===BigInt(0))throw Error(`Modulus by zero is not allowed`);return e%t}),u=e=>({decimals:e.decimals,value:e.value>=BigInt(0)?e.value:-e.value}),d=i((e,t)=>e===t),f=i((e,t)=>e<t),p=i((e,t)=>e>t),m=i((e,t)=>e<=t),h=i((e,t)=>e>=t),g=(e,t)=>!d(e,t),_=(e,t)=>{if(!Number.isInteger(t))throw Error(`Exponent must be an integer`);if(t<0)return s({value:BigInt(1),decimals:0},_(e,-t));if(t===0)return{value:BigInt(1),decimals:0};let n={value:BigInt(1),decimals:0},r={...e},i=Math.abs(t);for(;i>0;)i&1&&(n={value:n.value*r.value,decimals:n.decimals+r.decimals}),r={value:r.value*r.value,decimals:r.decimals*2},i>>=1;return n},v=t=>{if(f(t,{value:BigInt(0),decimals:0}))throw Error(`Cannot calculate square root of negative number`);if(t.value===BigInt(0))return{value:BigInt(0),decimals:0};let n=t.decimals+t.decimals%2,r=e(t,n),i=BigInt(0),a=r.value,o=a;for(;i<=a;){let e=(i+a)/BigInt(2),t=e*e;if(t===r.value){o=e;break}t<r.value?(i=e+BigInt(1),o=e):a=e-BigInt(1)}return{value:o,decimals:n/2}},y=e=>{let t=BigInt(10)**BigInt(e.decimals),n=e.value%t,r=t/BigInt(2);return{decimals:0,value:e.value/t+BigInt(n>=r?1:0)}},b=e=>({decimals:0,value:e.value/BigInt(10)**BigInt(e.decimals)}),x=e=>{let t=BigInt(10)**BigInt(e.decimals);return{decimals:0,value:(e.value+t-BigInt(1))/t}},S=(e,t)=>h(e,t)?e:t,C=(e,t)=>m(e,t)?e:t,w=e=>e.value===BigInt(0)?0:e.value>BigInt(0)?1:-1;exports.abs=u,exports.add=a,exports.ceil=x,exports.div=s,exports.eq=d,exports.floor=b,exports.gt=p,exports.gte=h,exports.lt=f,exports.lte=m,exports.max=S,exports.min=C,exports.mod=l,exports.mul=c,exports.not=g,exports.pow=_,exports.round=y,exports.sign=w,exports.sqrt=v,exports.sub=o,exports.toFixedDecimals=e,exports.toTiniestPossibleDecimal=t;
@@ -1,117 +1,105 @@
1
- const u = (e, t) => ({
2
- decimals: t,
3
- value: t >= e.decimals ? e.value * BigInt(10) ** BigInt(t - e.decimals) : e.value / BigInt(10) ** BigInt(e.decimals - t)
4
- }), v = (e) => {
5
- if (e.value === BigInt(0))
6
- return { value: BigInt(0), decimals: 0 };
7
- const i = e.value.toString().replace("-", "").split("").reverse();
8
- let l = 0;
9
- for (const a of i) {
10
- if (a !== "0")
11
- break;
12
- l++;
13
- }
14
- const s = Math.max(0, e.decimals - l);
15
- return u(e, s);
16
- }, d = (e, t) => {
17
- const i = Math.max(e.decimals, t.decimals), [l, s] = [e, t].map((a) => u(a, i));
18
- return [l.value, s.value, i];
19
- }, r = (e) => (t, i) => {
20
- const [l, s, a] = d(t, i);
21
- return {
22
- decimals: a,
23
- value: e(l, s, a)
24
- };
25
- }, c = (e) => (t, i) => {
26
- const [l, s] = d(t, i);
27
- return e(l, s);
28
- }, h = r((e, t) => e + t), j = r((e, t) => e - t), g = r((e, t, i) => {
29
- if (t === BigInt(0))
30
- throw new Error("Division by zero is not allowed");
31
- return e * BigInt(10) ** BigInt(i) / t;
32
- }), p = (e, t) => v({
33
- decimals: e.decimals + t.decimals,
34
- value: e.value * t.value
35
- }), A = r((e, t) => {
36
- if (t === BigInt(0))
37
- throw new Error("Modulus by zero is not allowed");
38
- return e % t;
39
- }), D = (e) => ({
40
- decimals: e.decimals,
41
- value: e.value >= BigInt(0) ? e.value : -e.value
42
- }), m = c((e, t) => e === t), B = c((e, t) => e < t), E = c((e, t) => e > t), I = c((e, t) => e <= t), f = c((e, t) => e >= t), b = (e, t) => !m(e, t), w = (e, t) => {
43
- if (!Number.isInteger(t))
44
- throw new Error("Exponent must be an integer");
45
- if (t < 0)
46
- return g({ value: BigInt(1), decimals: 0 }, w(e, -t));
47
- if (t === 0)
48
- return { value: BigInt(1), decimals: 0 };
49
- let i = { value: BigInt(1), decimals: 0 }, l = { ...e }, s = Math.abs(t);
50
- for (; s > 0; )
51
- s & 1 && (i = {
52
- value: i.value * l.value,
53
- decimals: i.decimals + l.decimals
54
- }), l = {
55
- value: l.value * l.value,
56
- decimals: l.decimals * 2
57
- }, s >>= 1;
58
- return i;
59
- }, q = (e) => {
60
- if (B(e, { value: BigInt(0), decimals: 0 }))
61
- throw new Error("Cannot calculate square root of negative number");
62
- if (e.value === BigInt(0))
63
- return { value: BigInt(0), decimals: 0 };
64
- const t = e.decimals + e.decimals % 2, i = u(e, t);
65
- let l = BigInt(0), s = i.value, a = s;
66
- for (; l <= s; ) {
67
- const n = (l + s) / BigInt(2), o = n * n;
68
- if (o === i.value) {
69
- a = n;
70
- break;
71
- }
72
- o < i.value ? (l = n + BigInt(1), a = n) : s = n - BigInt(1);
73
- }
74
- return {
75
- value: a,
76
- decimals: t / 2
77
- };
78
- }, z = (e) => {
79
- const t = BigInt(10) ** BigInt(e.decimals), i = e.value % t, l = t / BigInt(2);
80
- return {
81
- decimals: 0,
82
- value: e.value / t + (i >= l ? BigInt(1) : BigInt(0))
83
- };
84
- }, M = (e) => ({
85
- decimals: 0,
86
- value: e.value / BigInt(10) ** BigInt(e.decimals)
87
- }), S = (e) => {
88
- const t = BigInt(10) ** BigInt(e.decimals);
89
- return {
90
- decimals: 0,
91
- value: (e.value + t - BigInt(1)) / t
92
- };
93
- }, k = (e, t) => f(e, t) ? e : t, y = (e, t) => I(e, t) ? e : t, C = (e) => e.value === BigInt(0) ? 0 : e.value > BigInt(0) ? 1 : -1;
94
- export {
95
- D as abs,
96
- h as add,
97
- S as ceil,
98
- g as div,
99
- m as eq,
100
- M as floor,
101
- E as gt,
102
- f as gte,
103
- B as lt,
104
- I as lte,
105
- k as max,
106
- y as min,
107
- A as mod,
108
- p as mul,
109
- b as not,
110
- w as pow,
111
- z as round,
112
- C as sign,
113
- q as sqrt,
114
- j as sub,
115
- u as toFixedDecimals,
116
- v as toTiniestPossibleDecimal
117
- };
1
+ //#region src/bigdecimal/lib.ts
2
+ var e = (e, t) => ({
3
+ decimals: t,
4
+ value: t >= e.decimals ? e.value * BigInt(10) ** BigInt(t - e.decimals) : e.value / BigInt(10) ** BigInt(e.decimals - t)
5
+ }), t = (t) => {
6
+ if (t.value === BigInt(0)) return {
7
+ value: BigInt(0),
8
+ decimals: 0
9
+ };
10
+ let n = t.value.toString().replace("-", "").split("").reverse(), r = 0;
11
+ for (let e of n) {
12
+ if (e !== "0") break;
13
+ r++;
14
+ }
15
+ return e(t, Math.max(0, t.decimals - r));
16
+ }, n = (t, n) => {
17
+ let r = Math.max(t.decimals, n.decimals), [i, a] = [t, n].map((t) => e(t, r));
18
+ return [
19
+ i.value,
20
+ a.value,
21
+ r
22
+ ];
23
+ }, r = (e) => (t, r) => {
24
+ let [i, a, o] = n(t, r);
25
+ return {
26
+ decimals: o,
27
+ value: e(i, a, o)
28
+ };
29
+ }, i = (e) => (t, r) => {
30
+ let [i, a] = n(t, r);
31
+ return e(i, a);
32
+ }, a = r((e, t) => e + t), o = r((e, t) => e - t), s = r((e, t, n) => {
33
+ if (t === BigInt(0)) throw Error("Division by zero is not allowed");
34
+ return e * BigInt(10) ** BigInt(n) / t;
35
+ }), c = (e, n) => t({
36
+ decimals: e.decimals + n.decimals,
37
+ value: e.value * n.value
38
+ }), l = r((e, t) => {
39
+ if (t === BigInt(0)) throw Error("Modulus by zero is not allowed");
40
+ return e % t;
41
+ }), u = (e) => ({
42
+ decimals: e.decimals,
43
+ value: e.value >= BigInt(0) ? e.value : -e.value
44
+ }), d = i((e, t) => e === t), f = i((e, t) => e < t), p = i((e, t) => e > t), m = i((e, t) => e <= t), h = i((e, t) => e >= t), g = (e, t) => !d(e, t), _ = (e, t) => {
45
+ if (!Number.isInteger(t)) throw Error("Exponent must be an integer");
46
+ if (t < 0) return s({
47
+ value: BigInt(1),
48
+ decimals: 0
49
+ }, _(e, -t));
50
+ if (t === 0) return {
51
+ value: BigInt(1),
52
+ decimals: 0
53
+ };
54
+ let n = {
55
+ value: BigInt(1),
56
+ decimals: 0
57
+ }, r = { ...e }, i = Math.abs(t);
58
+ for (; i > 0;) i & 1 && (n = {
59
+ value: n.value * r.value,
60
+ decimals: n.decimals + r.decimals
61
+ }), r = {
62
+ value: r.value * r.value,
63
+ decimals: r.decimals * 2
64
+ }, i >>= 1;
65
+ return n;
66
+ }, v = (t) => {
67
+ if (f(t, {
68
+ value: BigInt(0),
69
+ decimals: 0
70
+ })) throw Error("Cannot calculate square root of negative number");
71
+ if (t.value === BigInt(0)) return {
72
+ value: BigInt(0),
73
+ decimals: 0
74
+ };
75
+ let n = t.decimals + t.decimals % 2, r = e(t, n), i = BigInt(0), a = r.value, o = a;
76
+ for (; i <= a;) {
77
+ let e = (i + a) / BigInt(2), t = e * e;
78
+ if (t === r.value) {
79
+ o = e;
80
+ break;
81
+ }
82
+ t < r.value ? (i = e + BigInt(1), o = e) : a = e - BigInt(1);
83
+ }
84
+ return {
85
+ value: o,
86
+ decimals: n / 2
87
+ };
88
+ }, y = (e) => {
89
+ let t = BigInt(10) ** BigInt(e.decimals), n = e.value % t, r = t / BigInt(2);
90
+ return {
91
+ decimals: 0,
92
+ value: e.value / t + BigInt(n >= r ? 1 : 0)
93
+ };
94
+ }, b = (e) => ({
95
+ decimals: 0,
96
+ value: e.value / BigInt(10) ** BigInt(e.decimals)
97
+ }), x = (e) => {
98
+ let t = BigInt(10) ** BigInt(e.decimals);
99
+ return {
100
+ decimals: 0,
101
+ value: (e.value + t - BigInt(1)) / t
102
+ };
103
+ }, S = (e, t) => h(e, t) ? e : t, C = (e, t) => m(e, t) ? e : t, w = (e) => e.value === BigInt(0) ? 0 : e.value > BigInt(0) ? 1 : -1;
104
+ //#endregion
105
+ export { u as abs, a as add, x as ceil, s as div, d as eq, b as floor, p as gt, h as gte, f as lt, m as lte, S as max, C as min, l as mod, c as mul, g as not, _ as pow, y as round, w as sign, v as sqrt, o as sub, e as toFixedDecimals, t as toTiniestPossibleDecimal };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=t=>/^(-?\d+\.?\d*|\.\d+)[eE]([+-]?\d+)$/.test(t),d=t=>{if(!l(t))throw new Error("Invalid scientific notation");const[e,s]=t.toLowerCase().split("e"),n=parseInt(s,10),o=e.indexOf("."),c=e.replace(".","").replace("-",""),r=e.startsWith("-");let i=c,a=o===-1?0:e.length-o-1;return n>0?i=i.padEnd(i.length+n,"0"):n<0&&(a+=Math.abs(n)),i=i.replace(/^0+/,"")||"0",{value:BigInt(`${r?"-":""}${i}`),decimals:a}},u=(t,e)=>{if(l(t))return d(t);const[s,n=""]=t.split("."),o=s.startsWith("-"),c=o?s.slice(1):s,r=e??n.length,i=n.slice(0,r),a=e!==void 0&&n.length>e?p(i,n[e]):i.padEnd(r,"0");return{value:BigInt(`${o?"-":""}${c}${a}`),decimals:r}},p=(t,e)=>Number(e)>=5?(BigInt(t)+1n).toString().padStart(t.length,"0"):t;exports.parseUnits=u;
1
+ var e=e=>/^(-?\d+\.?\d*|\.\d+)[eE]([+-]?\d+)$/.test(e),t=t=>{if(!e(t))throw Error(`Invalid scientific notation`);let[n,r]=t.toLowerCase().split(`e`),i=parseInt(r,10),a=n.indexOf(`.`),o=n.replace(`.`,``).replace(`-`,``),s=n.startsWith(`-`),c=o,l=a===-1?0:n.length-a-1;return i>0?c=c.padEnd(c.length+i,`0`):i<0&&(l+=Math.abs(i)),c=c.replace(/^0+/,``)||`0`,{value:BigInt(`${s?`-`:``}${c}`),decimals:l}},n=(n,i)=>{if(e(n))return t(n);let[a,o=``]=n.split(`.`),s=a.startsWith(`-`),c=s?a.slice(1):a,l=i??o.length,u=o.slice(0,l),d=i!==void 0&&o.length>i?r(u,o[i]):u.padEnd(l,`0`);return{value:BigInt(`${s?`-`:``}${c}${d}`),decimals:l}},r=(e,t)=>Number(t)>=5?(BigInt(e)+1n).toString().padStart(e.length,`0`):e;exports.parseUnits=n;
@@ -1,21 +1,18 @@
1
- const l = (t) => /^(-?\d+\.?\d*|\.\d+)[eE]([+-]?\d+)$/.test(t), d = (t) => {
2
- if (!l(t))
3
- throw new Error("Invalid scientific notation");
4
- const [n, o] = t.toLowerCase().split("e"), e = parseInt(o, 10), s = n.indexOf("."), c = n.replace(".", "").replace("-", ""), r = n.startsWith("-");
5
- let i = c, a = s === -1 ? 0 : n.length - s - 1;
6
- return e > 0 ? i = i.padEnd(i.length + e, "0") : e < 0 && (a += Math.abs(e)), i = i.replace(/^0+/, "") || "0", {
7
- value: BigInt(`${r ? "-" : ""}${i}`),
8
- decimals: a
9
- };
10
- }, g = (t, n) => {
11
- if (l(t))
12
- return d(t);
13
- const [o, e = ""] = t.split("."), s = o.startsWith("-"), c = s ? o.slice(1) : o, r = n ?? e.length, i = e.slice(0, r), a = n !== void 0 && e.length > n ? p(i, e[n]) : i.padEnd(r, "0");
14
- return {
15
- value: BigInt(`${s ? "-" : ""}${c}${a}`),
16
- decimals: r
17
- };
18
- }, p = (t, n) => Number(n) >= 5 ? (BigInt(t) + 1n).toString().padStart(t.length, "0") : t;
19
- export {
20
- g as parseUnits
21
- };
1
+ //#region src/bigdecimal/parseUnits.ts
2
+ var e = (e) => /^(-?\d+\.?\d*|\.\d+)[eE]([+-]?\d+)$/.test(e), t = (t) => {
3
+ if (!e(t)) throw Error("Invalid scientific notation");
4
+ let [n, r] = t.toLowerCase().split("e"), i = parseInt(r, 10), a = n.indexOf("."), o = n.replace(".", "").replace("-", ""), s = n.startsWith("-"), c = o, l = a === -1 ? 0 : n.length - a - 1;
5
+ return i > 0 ? c = c.padEnd(c.length + i, "0") : i < 0 && (l += Math.abs(i)), c = c.replace(/^0+/, "") || "0", {
6
+ value: BigInt(`${s ? "-" : ""}${c}`),
7
+ decimals: l
8
+ };
9
+ }, n = (n, i) => {
10
+ if (e(n)) return t(n);
11
+ let [a, o = ""] = n.split("."), s = a.startsWith("-"), c = s ? a.slice(1) : a, l = i ?? o.length, u = o.slice(0, l), d = i !== void 0 && o.length > i ? r(u, o[i]) : u.padEnd(l, "0");
12
+ return {
13
+ value: BigInt(`${s ? "-" : ""}${c}${d}`),
14
+ decimals: l
15
+ };
16
+ }, r = (e, t) => Number(t) >= 5 ? (BigInt(e) + 1n).toString().padStart(e.length, "0") : e;
17
+ //#endregion
18
+ export { n as parseUnits };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../tokens/constants.cjs"),t=require("./formatUnits.cjs"),n=require("./lib.cjs"),a=require("./parseUnits.cjs");function u(r){return t.formatUnits({value:r,decimals:e.DEFAULT_TOKEN_DECIMALS})}function c(r){return a.parseUnits(r,e.DEFAULT_TOKEN_DECIMALS)}function o(r){return t.formatUnits({value:r,decimals:e.DEFAULT_TOKEN_DECIMALS})}function s(r){return a.parseUnits(r,e.DEFAULT_TOKEN_DECIMALS)}function E(r){return n.abs({value:r,decimals:0}).value}function f(r){return n.abs(s(r))}function l(r,i){return{value:BigInt(r),decimals:i}}exports.absBigInt=E;exports.formatCurrency=o;exports.formatEther=u;exports.parseCurrency=s;exports.parseCurrencyAbs=f;exports.parseEther=c;exports.toBigDecimal=l;
1
+ require(`../tokens/constants.cjs`);const e=require(`./formatUnits.cjs`),t=require(`./lib.cjs`),n=require(`./parseUnits.cjs`);function r(t){return e.formatUnits({value:t,decimals:18})}function i(e){return n.parseUnits(e,18)}function a(t){return e.formatUnits({value:t,decimals:18})}function o(e){return n.parseUnits(e,18)}function s(e){return t.abs({value:e,decimals:0}).value}function c(e){return t.abs(o(e))}function l(e,t){return{value:BigInt(e),decimals:t}}exports.absBigInt=s,exports.formatCurrency=a,exports.formatEther=r,exports.parseCurrency=o,exports.parseCurrencyAbs=c,exports.parseEther=i,exports.toBigDecimal=l;
@@ -1,37 +1,40 @@
1
- import { DEFAULT_TOKEN_DECIMALS as t } from "../tokens/constants.js";
2
- import { formatUnits as n } from "./formatUnits.js";
3
- import { abs as e } from "./lib.js";
4
- import { parseUnits as u } from "./parseUnits.js";
5
- function s(r) {
6
- return n({ value: r, decimals: t });
1
+ import "../tokens/constants.js";
2
+ import { formatUnits as e } from "./formatUnits.js";
3
+ import { abs as t } from "./lib.js";
4
+ import { parseUnits as n } from "./parseUnits.js";
5
+ //#region src/bigdecimal/utils.ts
6
+ function r(t) {
7
+ return e({
8
+ value: t,
9
+ decimals: 18
10
+ });
7
11
  }
8
- function p(r) {
9
- return u(r, t);
12
+ function i(e) {
13
+ return n(e, 18);
10
14
  }
11
- function l(r) {
12
- return n({ value: r, decimals: t });
15
+ function a(t) {
16
+ return e({
17
+ value: t,
18
+ decimals: 18
19
+ });
13
20
  }
14
- function o(r) {
15
- return u(r, t);
21
+ function o(e) {
22
+ return n(e, 18);
16
23
  }
17
- function E(r) {
18
- return e({ value: r, decimals: 0 }).value;
24
+ function s(e) {
25
+ return t({
26
+ value: e,
27
+ decimals: 0
28
+ }).value;
19
29
  }
20
- function v(r) {
21
- return e(o(r));
30
+ function c(e) {
31
+ return t(o(e));
22
32
  }
23
- function C(r, i) {
24
- return {
25
- value: BigInt(r),
26
- decimals: i
27
- };
33
+ function l(e, t) {
34
+ return {
35
+ value: BigInt(e),
36
+ decimals: t
37
+ };
28
38
  }
29
- export {
30
- E as absBigInt,
31
- l as formatCurrency,
32
- s as formatEther,
33
- o as parseCurrency,
34
- v as parseCurrencyAbs,
35
- p as parseEther,
36
- C as toBigDecimal
37
- };
39
+ //#endregion
40
+ export { s as absBigInt, a as formatCurrency, r as formatEther, o as parseCurrency, c as parseCurrencyAbs, i as parseEther, l as toBigDecimal };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{constructor(e,c){this.cachePromise=c.open(e).catch(a=>(console.error(new Error("Failed to open cache",{cause:a})),null))}async get(e){const c=await this.cachePromise;if(!c)throw new Error("No cache available");const a=await c.match(e).catch(()=>{throw new Error("Failed to match cache")});if(!a)throw new Error("Failed to match cache");return a.clone()}async set(e,c){const a=await this.cachePromise;a&&await a.put(e,c).catch(()=>{throw new Error("Failed to match cache")})}async delete(e){const c=await this.cachePromise;return c?c.delete(e):!1}async flush(){const e=await this.cachePromise;if(!e)return;const c=await e.keys();await Promise.allSettled(c.map(a=>e.delete(a)))}}exports.CacheService=t;
1
+ var e=class{constructor(e,t){this.cachePromise=t.open(e).catch(e=>(console.error(Error(`Failed to open cache`,{cause:e})),null))}async get(e){let t=await this.cachePromise;if(!t)throw Error(`No cache available`);let n=await t.match(e).catch(()=>{throw Error(`Failed to match cache`)});if(!n)throw Error(`Failed to match cache`);return n.clone()}async set(e,t){let n=await this.cachePromise;n&&await n.put(e,t).catch(()=>{throw Error(`Failed to match cache`)})}async delete(e){let t=await this.cachePromise;return t?t.delete(e):!1}async flush(){let e=await this.cachePromise;if(!e)return;let t=await e.keys();await Promise.allSettled(t.map(t=>e.delete(t)))}};exports.CacheService=e;
@@ -1,37 +1,33 @@
1
- class r {
2
- constructor(e, c) {
3
- this.cachePromise = c.open(e).catch((a) => (console.error(new Error("Failed to open cache", { cause: a })), null));
4
- }
5
- async get(e) {
6
- const c = await this.cachePromise;
7
- if (!c)
8
- throw new Error("No cache available");
9
- const a = await c.match(e).catch(() => {
10
- throw new Error("Failed to match cache");
11
- });
12
- if (!a)
13
- throw new Error("Failed to match cache");
14
- return a.clone();
15
- }
16
- async set(e, c) {
17
- const a = await this.cachePromise;
18
- a && await a.put(e, c).catch(() => {
19
- throw new Error("Failed to match cache");
20
- });
21
- }
22
- async delete(e) {
23
- const c = await this.cachePromise;
24
- return c ? c.delete(e) : !1;
25
- }
26
- // should be called on logout
27
- async flush() {
28
- const e = await this.cachePromise;
29
- if (!e)
30
- return;
31
- const c = await e.keys();
32
- await Promise.allSettled(c.map((a) => e.delete(a)));
33
- }
34
- }
35
- export {
36
- r as CacheService
1
+ //#region src/cache/CacheService.ts
2
+ var e = class {
3
+ constructor(e, t) {
4
+ this.cachePromise = t.open(e).catch((e) => (console.error(Error("Failed to open cache", { cause: e })), null));
5
+ }
6
+ async get(e) {
7
+ let t = await this.cachePromise;
8
+ if (!t) throw Error("No cache available");
9
+ let n = await t.match(e).catch(() => {
10
+ throw Error("Failed to match cache");
11
+ });
12
+ if (!n) throw Error("Failed to match cache");
13
+ return n.clone();
14
+ }
15
+ async set(e, t) {
16
+ let n = await this.cachePromise;
17
+ n && await n.put(e, t).catch(() => {
18
+ throw Error("Failed to match cache");
19
+ });
20
+ }
21
+ async delete(e) {
22
+ let t = await this.cachePromise;
23
+ return t ? t.delete(e) : !1;
24
+ }
25
+ async flush() {
26
+ let e = await this.cachePromise;
27
+ if (!e) return;
28
+ let t = await e.keys();
29
+ await Promise.allSettled(t.map((t) => e.delete(t)));
30
+ }
37
31
  };
32
+ //#endregion
33
+ export { e as CacheService };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("lodash-es"),n=require("starknet"),d=require("zod"),B=require("../../utils/base58.cjs"),f=d.z.string().refine(e=>{if(e.toLowerCase()===e)return!0;try{return n.validateChecksumAddress(e)&&$(e)}catch{}return!1},{message:"Invalid address (checksum error)"}),v=d.z.string().refine(e=>{try{return n.validateAndParseAddress(e)}catch{}return!1},{message:"Invalid address (validation error)"}),c=d.z.string().regex(/^0x[0-9a-fA-F]+$/,"Invalid address"),p=c.min(50,"Address must at least be 50 characters long").max(66,"Address must at most be 66 characters long"),P=c.length(66,"Address must be 66 characters long"),h=p.pipe(f).transform(e=>`0x${(e.startsWith("0x")?e.slice(2):e).padStart(64,"0")}`),E=h.or(d.z.literal("")).transform(e=>e===""?void 0:e).optional(),b=c.transform(e=>`0x${e.replace(/^0x/,"").toLowerCase().padStart(64,"0")}`),l=e=>d.z.string().refine(s=>{if(s.toLowerCase()===s)return!0;try{return n.validateChecksumAddress(s)&&$(s)}catch{}return!1},{message:e("validation.address.invalidChecksum")}),x=e=>d.z.string().refine(s=>{try{return n.validateAndParseAddress(s)}catch{}return!1},{message:e("validation.address.validationError")}),o=e=>d.z.string().regex(/^0x[0-9a-fA-F]+$/,e("validation.address.invalidFormat")),u=e=>o(e).min(50,e("validation.address.tooShort")).max(66,e("validation.address.tooLong")),L=e=>o(e).length(66,e("validation.address.exactLength")),g=e=>{const s=u(e),r=l(e);return s.pipe(r).transform(t=>`0x${(t.startsWith("0x")?t.slice(2):t).padStart(64,"0")}`)},k=e=>g(e).or(d.z.literal("")).transform(r=>r===""?void 0:r).optional(),w=e=>o(e).transform(r=>`0x${r.replace(/^0x/,"").toLowerCase().padStart(64,"0")}`),V=e=>({validChecksumAddressSchema:l(e),validateAddressRangeSchema:x(e),addressSchemaBase:o(e),addressSchemaLooseLength:u(e),addressSchemaStrictLength:L(e),addressSchema:g(e),addressOrEmptyUndefinedSchema:k(e),addressSchemaArgentBackend:w(e)}),z=e=>h.safeParse(e).success,C=z,A=e=>n.getChecksumAddress(e),F=e=>{if(!e)return!1;try{const s=B.decodeBase58(e);return C(s)}catch{return!1}},O=e=>{const s=A(e),r=s.slice(0,2),t=s.slice(2,6),a=s.slice(-4);return`${r}${t}…${a}`},T=e=>{const s=A(e),r=s.slice(0,2),a=s.slice(2).match(/.{1,4}/g)||[];return`${r} ${a.join(" ")}`},$=e=>!/^0x[0-9a-f]{63,64}$/.test(e),i=e=>e.toLowerCase().replace(/^[0x]+/,""),m=e=>{try{return/^(0x)?[0-9a-f]+$/i.test(e)}catch{}return!1},y=(e,s)=>{try{return!e||!s||!m(e)||!m(s)?!1:i(e)===i(s)}catch{}return!1},q=e=>{try{return n.num.toBigInt(c.parse(e))===n.constants.ZERO}catch{}return!1},R=(e,s)=>!!s?.some(r=>y(r,e)),U=S.memoize(e=>{const s=e.slice(0,6),r=e.slice(-4);return`${s}…${r}`}),Z=S.memoize((e,s)=>{if(e.length<s)return e;const r=Math.floor((s-1)/2),t=e.slice(0,r),a=e.slice(-r);return`${t}…${a}`});exports.addressOrEmptyUndefinedSchema=E;exports.addressSchema=h;exports.addressSchemaArgentBackend=b;exports.addressSchemaBase=c;exports.addressSchemaLooseLength=p;exports.addressSchemaStrictLength=P;exports.formatFullAddress=T;exports.formatTruncatedAddress=O;exports.formatTruncatedSignerKey=U;exports.formatTruncatedString=Z;exports.getAddressOrEmptyUndefinedSchema=k;exports.getAddressSchema=g;exports.getAddressSchemaArgentBackend=w;exports.getAddressSchemaBase=o;exports.getAddressSchemaLooseLength=u;exports.getAddressSchemaStrictLength=L;exports.getAddressValidationSchemas=V;exports.getValidChecksumAddressSchema=l;exports.getValidateAddressRangeSchema=x;exports.includesAddress=R;exports.isAddress=z;exports.isBase58Address=F;exports.isEqualAddress=y;exports.isValidAddress=C;exports.isValidHexString=m;exports.isZeroAddress=q;exports.normalizeAddress=A;exports.normalizeAddressForCompare=i;exports.validChecksumAddressSchema=f;exports.validateAddressRangeSchema=v;
1
+ require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/base58.cjs`);let t=require(`zod`),n=require(`lodash-es`),r=require(`starknet`);var i=t.z.string().refine(e=>{if(e.toLowerCase()===e)return!0;try{return(0,r.validateChecksumAddress)(e)&&D(e)}catch{}return!1},{message:`Invalid address (checksum error)`}),a=t.z.string().refine(e=>{try{return(0,r.validateAndParseAddress)(e)}catch{}return!1},{message:`Invalid address (validation error)`}),o=t.z.string().regex(/^0x[0-9a-fA-F]+$/,`Invalid address`),s=o.min(50,`Address must at least be 50 characters long`).max(66,`Address must at most be 66 characters long`),c=o.length(66,`Address must be 66 characters long`),l=s.pipe(i).transform(e=>`0x${(e.startsWith(`0x`)?e.slice(2):e).padStart(64,`0`)}`),u=l.or(t.z.literal(``)).transform(e=>e===``?void 0:e).optional(),d=o.transform(e=>`0x${e.replace(/^0x/,``).toLowerCase().padStart(64,`0`)}`),f=e=>t.z.string().refine(e=>{if(e.toLowerCase()===e)return!0;try{return(0,r.validateChecksumAddress)(e)&&D(e)}catch{}return!1},{message:e(`validation.address.invalidChecksum`)}),p=e=>t.z.string().refine(e=>{try{return(0,r.validateAndParseAddress)(e)}catch{}return!1},{message:e(`validation.address.validationError`)}),m=e=>t.z.string().regex(/^0x[0-9a-fA-F]+$/,e(`validation.address.invalidFormat`)),h=e=>m(e).min(50,e(`validation.address.tooShort`)).max(66,e(`validation.address.tooLong`)),g=e=>m(e).length(66,e(`validation.address.exactLength`)),_=e=>{let t=h(e),n=f(e);return t.pipe(n).transform(e=>`0x${(e.startsWith(`0x`)?e.slice(2):e).padStart(64,`0`)}`)},v=e=>_(e).or(t.z.literal(``)).transform(e=>e===``?void 0:e).optional(),y=e=>m(e).transform(e=>`0x${e.replace(/^0x/,``).toLowerCase().padStart(64,`0`)}`),b=e=>({validChecksumAddressSchema:f(e),validateAddressRangeSchema:p(e),addressSchemaBase:m(e),addressSchemaLooseLength:h(e),addressSchemaStrictLength:g(e),addressSchema:_(e),addressOrEmptyUndefinedSchema:v(e),addressSchemaArgentBackend:y(e)}),x=e=>l.safeParse(e).success,S=x,C=e=>(0,r.getChecksumAddress)(e),w=t=>{if(!t)return!1;try{return S(e.decodeBase58(t))}catch{return!1}},T=e=>{let t=C(e);return`${t.slice(0,2)}${t.slice(2,6)}…${t.slice(-4)}`},E=e=>{let t=C(e);return`${t.slice(0,2)} ${(t.slice(2).match(/.{1,4}/g)||[]).join(` `)}`},D=e=>!/^0x[0-9a-f]{63,64}$/.test(e),O=e=>e.toLowerCase().replace(/^[0x]+/,``),k=e=>{try{return/^(0x)?[0-9a-f]+$/i.test(e)}catch{}return!1},A=(e,t)=>{try{return!e||!t||!k(e)||!k(t)?!1:O(e)===O(t)}catch{}return!1},j=e=>{try{return r.num.toBigInt(o.parse(e))===r.constants.ZERO}catch{}return!1},M=(e,t)=>!!t?.some(t=>A(t,e)),N=(0,n.memoize)(e=>`${e.slice(0,6)}…${e.slice(-4)}`),P=(0,n.memoize)((e,t)=>{if(e.length<t)return e;let n=Math.floor((t-1)/2);return`${e.slice(0,n)}…${e.slice(-n)}`});exports.addressOrEmptyUndefinedSchema=u,exports.addressSchema=l,exports.addressSchemaArgentBackend=d,exports.addressSchemaBase=o,exports.addressSchemaLooseLength=s,exports.addressSchemaStrictLength=c,exports.formatFullAddress=E,exports.formatTruncatedAddress=T,exports.formatTruncatedSignerKey=N,exports.formatTruncatedString=P,exports.getAddressOrEmptyUndefinedSchema=v,exports.getAddressSchema=_,exports.getAddressSchemaArgentBackend=y,exports.getAddressSchemaBase=m,exports.getAddressSchemaLooseLength=h,exports.getAddressSchemaStrictLength=g,exports.getAddressValidationSchemas=b,exports.getValidChecksumAddressSchema=f,exports.getValidateAddressRangeSchema=p,exports.includesAddress=M,exports.isAddress=x,exports.isBase58Address=w,exports.isEqualAddress=A,exports.isValidAddress=S,exports.isValidHexString=k,exports.isZeroAddress=j,exports.normalizeAddress=C,exports.normalizeAddressForCompare=O,exports.validChecksumAddressSchema=i,exports.validateAddressRangeSchema=a;