@argent/x-shared 1.78.12 → 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 (504) 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 +3 -9
  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/IPaymasterService.d.ts +2 -1
  251. package/dist/src/features/paymaster/PaymasterService.cjs +1 -1
  252. package/dist/src/features/paymaster/PaymasterService.d.ts +3 -1
  253. package/dist/src/features/paymaster/PaymasterService.js +73 -86
  254. package/dist/src/features/paymaster/types.cjs +1 -1
  255. package/dist/src/features/paymaster/types.d.ts +20 -2
  256. package/dist/src/features/paymaster/types.js +41 -39
  257. package/dist/src/features/simulation/activity/normalize.cjs +1 -1
  258. package/dist/src/features/simulation/activity/normalize.js +36 -38
  259. package/dist/src/features/simulation/activity/schema.cjs +1 -1
  260. package/dist/src/features/simulation/activity/schema.js +224 -250
  261. package/dist/src/features/simulation/activity/utils/createNativeActivity.cjs +1 -1
  262. package/dist/src/features/simulation/activity/utils/createNativeActivity.js +23 -27
  263. package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.cjs +1 -1
  264. package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.js +14 -21
  265. package/dist/src/features/simulation/activity/utils/getOverallLastModified.cjs +1 -1
  266. package/dist/src/features/simulation/activity/utils/getOverallLastModified.js +5 -5
  267. package/dist/src/features/simulation/activity/utils/hasDelegationActivity.cjs +1 -1
  268. package/dist/src/features/simulation/activity/utils/hasDelegationActivity.js +4 -4
  269. package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.cjs +1 -1
  270. package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.js +15 -19
  271. package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.cjs +1 -1
  272. package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.js +15 -19
  273. package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.cjs +1 -1
  274. package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.js +5 -5
  275. package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.cjs +1 -1
  276. package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.js +19 -21
  277. package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.cjs +1 -1
  278. package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.js +15 -19
  279. package/dist/src/features/simulation/activity/utils/isSwapActivity.cjs +1 -1
  280. package/dist/src/features/simulation/activity/utils/isSwapActivity.js +17 -18
  281. package/dist/src/features/simulation/activity/utils/isUpgradeActivity.cjs +1 -1
  282. package/dist/src/features/simulation/activity/utils/isUpgradeActivity.js +15 -19
  283. package/dist/src/features/simulation/activity/utils/parseAccountActivities.cjs +1 -1
  284. package/dist/src/features/simulation/activity/utils/parseAccountActivities.js +12 -12
  285. package/dist/src/features/simulation/activity/utils/parseFinanceActivities.cjs +1 -1
  286. package/dist/src/features/simulation/activity/utils/parseFinanceActivities.js +32 -32
  287. package/dist/src/features/simulation/fees/schema.cjs +1 -1
  288. package/dist/src/features/simulation/fees/schema.js +33 -47
  289. package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.cjs +1 -1
  290. package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.js +15 -17
  291. package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.cjs +1 -1
  292. package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.js +5 -5
  293. package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
  294. package/dist/src/features/simulation/transactionReview/schema.js +221 -242
  295. package/dist/src/features/simulation/warning/helper.cjs +1 -1
  296. package/dist/src/features/simulation/warning/helper.js +12 -11
  297. package/dist/src/features/simulation/warning/schema.cjs +1 -1
  298. package/dist/src/features/simulation/warning/schema.js +10 -11
  299. package/dist/src/features/swap/models/order.model.cjs +1 -1
  300. package/dist/src/features/swap/models/order.model.js +16 -19
  301. package/dist/src/features/swap/models/quote.model.cjs +1 -1
  302. package/dist/src/features/swap/models/quote.model.js +31 -35
  303. package/dist/src/features/swap/models/trade.model.cjs +1 -1
  304. package/dist/src/features/swap/models/trade.model.js +25 -27
  305. package/dist/src/features/swap/services/SwapSharedService.cjs +1 -1
  306. package/dist/src/features/swap/services/SwapSharedService.js +71 -75
  307. package/dist/src/features/swap/services/SwapTransactionService.cjs +1 -1
  308. package/dist/src/features/swap/services/SwapTransactionService.js +57 -63
  309. package/dist/src/features/swap/utils/slippage.cjs +1 -1
  310. package/dist/src/features/swap/utils/slippage.js +18 -25
  311. package/dist/src/features/swap/utils/totalFee.cjs +1 -1
  312. package/dist/src/features/swap/utils/totalFee.js +12 -12
  313. package/dist/src/http/DateService.cjs +1 -1
  314. package/dist/src/http/DateService.js +15 -18
  315. package/dist/src/http/HttpError.cjs +1 -1
  316. package/dist/src/http/HttpError.js +7 -7
  317. package/dist/src/http/HttpService.cjs +1 -1
  318. package/dist/src/http/HttpService.js +117 -134
  319. package/dist/src/http/IHttpService.cjs +1 -1
  320. package/dist/src/http/IHttpService.js +6 -6
  321. package/dist/src/http/SWRService.cjs +1 -1
  322. package/dist/src/http/SWRService.js +50 -57
  323. package/dist/src/http/fetcher.cjs +1 -1
  324. package/dist/src/http/fetcher.js +29 -35
  325. package/dist/src/http/time.cjs +1 -1
  326. package/dist/src/http/time.js +15 -18
  327. package/dist/src/knownDapps/KnownDappsBackendService.cjs +1 -1
  328. package/dist/src/knownDapps/KnownDappsBackendService.js +13 -14
  329. package/dist/src/knownDapps/schema.cjs +1 -1
  330. package/dist/src/knownDapps/schema.js +41 -44
  331. package/dist/src/knownDapps/utils/getDapplandUrl.cjs +1 -1
  332. package/dist/src/knownDapps/utils/getDapplandUrl.js +7 -8
  333. package/dist/src/nameResolution/ResolveNameService.cjs +1 -1
  334. package/dist/src/nameResolution/ResolveNameService.js +34 -41
  335. package/dist/src/nameResolution/schema.cjs +1 -1
  336. package/dist/src/nameResolution/schema.js +20 -25
  337. package/dist/src/nfts/BackendNftService.cjs +1 -1
  338. package/dist/src/nfts/BackendNftService.js +103 -116
  339. package/dist/src/nfts/BackendPaginationError.cjs +1 -1
  340. package/dist/src/nfts/BackendPaginationError.js +11 -12
  341. package/dist/src/nfts/utils.cjs +1 -1
  342. package/dist/src/nfts/utils.js +11 -14
  343. package/dist/src/onchainRecovery/OnchainRecoveryService.cjs +1 -1
  344. package/dist/src/onchainRecovery/OnchainRecoveryService.js +38 -68
  345. package/dist/src/onchainRecovery/schema.cjs +1 -1
  346. package/dist/src/onchainRecovery/schema.js +35 -49
  347. package/dist/src/platform/isBraveBrowser.cjs +1 -1
  348. package/dist/src/platform/isBraveBrowser.js +8 -10
  349. package/dist/src/platform/isBrowser.cjs +1 -1
  350. package/dist/src/platform/isBrowser.js +17 -22
  351. package/dist/src/signer/mergeOwnerGuardianSignatures.cjs +1 -1
  352. package/dist/src/signer/mergeOwnerGuardianSignatures.js +28 -30
  353. package/dist/src/signer/multisigner.cjs +1 -1
  354. package/dist/src/signer/multisigner.js +16 -17
  355. package/dist/src/signer/seedphrase.cjs +1 -1
  356. package/dist/src/signer/seedphrase.js +7 -7
  357. package/dist/src/staking/schema.cjs +1 -1
  358. package/dist/src/staking/schema.js +146 -162
  359. package/dist/src/storage/base.cjs +1 -1
  360. package/dist/src/storage/base.js +33 -34
  361. package/dist/src/storage/utils.cjs +1 -1
  362. package/dist/src/storage/utils.js +19 -28
  363. package/dist/src/tokens/balances.cjs +1 -1
  364. package/dist/src/tokens/balances.js +34 -38
  365. package/dist/src/tokens/constants.cjs +1 -1
  366. package/dist/src/tokens/constants.js +4 -4
  367. package/dist/src/tokens/convertCurrencyValueToTokenAmount.cjs +1 -1
  368. package/dist/src/tokens/convertCurrencyValueToTokenAmount.js +8 -9
  369. package/dist/src/tokens/convertTokenAmountToCurrencyValue.cjs +1 -1
  370. package/dist/src/tokens/convertTokenAmountToCurrencyValue.js +14 -15
  371. package/dist/src/tokens/convertTokenUnitAmountWithDecimals.cjs +1 -1
  372. package/dist/src/tokens/convertTokenUnitAmountWithDecimals.js +8 -9
  373. package/dist/src/tokens/ensureDecimals.cjs +1 -1
  374. package/dist/src/tokens/ensureDecimals.js +4 -4
  375. package/dist/src/tokens/getCurrencySymbol.cjs +1 -1
  376. package/dist/src/tokens/getCurrencySymbol.js +14 -14
  377. package/dist/src/tokens/isUnlimitedAmount.cjs +1 -1
  378. package/dist/src/tokens/isUnlimitedAmount.js +5 -5
  379. package/dist/src/tokens/prettifyCurrencyValue.cjs +1 -1
  380. package/dist/src/tokens/prettifyCurrencyValue.js +13 -14
  381. package/dist/src/tokens/prettifyTokenAmount.cjs +1 -1
  382. package/dist/src/tokens/prettifyTokenAmount.js +22 -22
  383. package/dist/src/tokens/service/implementation.cjs +1 -1
  384. package/dist/src/tokens/service/implementation.js +28 -40
  385. package/dist/src/tokens/service/tokenError.cjs +1 -1
  386. package/dist/src/tokens/service/tokenError.js +11 -12
  387. package/dist/src/tokens/service/types/backend.model.cjs +1 -1
  388. package/dist/src/tokens/service/types/backend.model.js +128 -163
  389. package/dist/src/tokens/service/types/defiPosition.model.cjs +1 -1
  390. package/dist/src/tokens/service/types/defiPosition.model.js +83 -99
  391. package/dist/src/tokens/service/types/defiPositionType.model.cjs +1 -1
  392. package/dist/src/tokens/service/types/defiPositionType.model.js +9 -9
  393. package/dist/src/tokens/service/types/unclaimedRewards.model.cjs +1 -1
  394. package/dist/src/tokens/service/types/unclaimedRewards.model.js +15 -16
  395. package/dist/src/tokens/service/types/webToken.model.cjs +1 -1
  396. package/dist/src/tokens/service/types/webToken.model.js +28 -51
  397. package/dist/src/tokens/utils.cjs +1 -1
  398. package/dist/src/tokens/utils.js +5 -9
  399. package/dist/src/transactions/amount.cjs +1 -1
  400. package/dist/src/transactions/amount.js +17 -24
  401. package/dist/src/transactions/buildTransactions.cjs +1 -1
  402. package/dist/src/transactions/buildTransactions.js +30 -33
  403. package/dist/src/transactions/errors.cjs +1 -1
  404. package/dist/src/transactions/errors.js +11 -18
  405. package/dist/src/transactions/estimate/adjustment.cjs +1 -1
  406. package/dist/src/transactions/estimate/adjustment.js +6 -6
  407. package/dist/src/transactions/estimate/argentMaxFee.cjs +1 -1
  408. package/dist/src/transactions/estimate/argentMaxFee.js +10 -13
  409. package/dist/src/transactions/estimate/error.cjs +1 -1
  410. package/dist/src/transactions/estimate/error.js +12 -13
  411. package/dist/src/transactions/estimate/model.cjs +1 -1
  412. package/dist/src/transactions/estimate/model.js +18 -13
  413. package/dist/src/transactions/estimate/utils.cjs +1 -1
  414. package/dist/src/transactions/estimate/utils.js +139 -172
  415. package/dist/src/transactions/findTransfersAndApprovals.cjs +1 -1
  416. package/dist/src/transactions/findTransfersAndApprovals.js +34 -30
  417. package/dist/src/transactions/getPrettyRcpError.cjs +1 -1
  418. package/dist/src/transactions/getPrettyRcpError.js +8 -10
  419. package/dist/src/transactions/service/implementation.cjs +1 -1
  420. package/dist/src/transactions/service/implementation.js +187 -208
  421. package/dist/src/transactions/service/types.cjs +1 -1
  422. package/dist/src/transactions/service/types.js +9 -9
  423. package/dist/src/transactions/service/utils.cjs +1 -1
  424. package/dist/src/transactions/service/utils.js +24 -25
  425. package/dist/src/transactions/transactionExecuteTypes.cjs +1 -1
  426. package/dist/src/transactions/transactionExecuteTypes.js +8 -9
  427. package/dist/src/transactions/transactionReviewTypes.cjs +1 -1
  428. package/dist/src/transactions/transactionReviewTypes.js +9 -9
  429. package/dist/src/transactions/transactionVersion.cjs +1 -1
  430. package/dist/src/transactions/transactionVersion.js +8 -13
  431. package/dist/src/transactions/txv3.cjs +1 -1
  432. package/dist/src/transactions/txv3.js +10 -11
  433. package/dist/src/utils/address.cjs +1 -1
  434. package/dist/src/utils/address.js +4 -4
  435. package/dist/src/utils/arrays.cjs +1 -1
  436. package/dist/src/utils/arrays.js +4 -4
  437. package/dist/src/utils/avatarImage.cjs +4 -4
  438. package/dist/src/utils/avatarImage.js +35 -40
  439. package/dist/src/utils/base58.cjs +1 -1
  440. package/dist/src/utils/base58.js +12 -15
  441. package/dist/src/utils/bigNumber.cjs +1 -1
  442. package/dist/src/utils/bigNumber.d.ts +1 -1
  443. package/dist/src/utils/bigNumber.js +5 -7
  444. package/dist/src/utils/bips.cjs +1 -1
  445. package/dist/src/utils/bips.js +12 -10
  446. package/dist/src/utils/daysBetween.cjs +1 -1
  447. package/dist/src/utils/daysBetween.js +6 -6
  448. package/dist/src/utils/env.cjs +1 -1
  449. package/dist/src/utils/env.js +4 -4
  450. package/dist/src/utils/hex.cjs +1 -1
  451. package/dist/src/utils/hex.js +7 -8
  452. package/dist/src/utils/id.cjs +1 -1
  453. package/dist/src/utils/id.js +7 -7
  454. package/dist/src/utils/initials.cjs +1 -1
  455. package/dist/src/utils/initials.js +12 -15
  456. package/dist/src/utils/isContractDeployed.cjs +1 -1
  457. package/dist/src/utils/isContractDeployed.js +9 -9
  458. package/dist/src/utils/nonNullable.cjs +1 -1
  459. package/dist/src/utils/nonNullable.js +6 -6
  460. package/dist/src/utils/number/abbreviateNumber.cjs +1 -1
  461. package/dist/src/utils/number/abbreviateNumber.js +13 -14
  462. package/dist/src/utils/number/isAllowedAddressHexInputValue.cjs +1 -1
  463. package/dist/src/utils/number/isAllowedAddressHexInputValue.js +4 -7
  464. package/dist/src/utils/number/isAllowedNumericInputValue.cjs +1 -1
  465. package/dist/src/utils/number/isAllowedNumericInputValue.js +5 -5
  466. package/dist/src/utils/number/isNumeric.cjs +1 -1
  467. package/dist/src/utils/number/isNumeric.js +4 -4
  468. package/dist/src/utils/number/prettifyNumber.cjs +1 -1
  469. package/dist/src/utils/number/prettifyNumber.js +65 -75
  470. package/dist/src/utils/parseAmount.cjs +1 -1
  471. package/dist/src/utils/parseAmount.js +10 -11
  472. package/dist/src/utils/pluralise.cjs +1 -1
  473. package/dist/src/utils/pluralise.js +4 -4
  474. package/dist/src/utils/readFileAsString.cjs +1 -1
  475. package/dist/src/utils/readFileAsString.js +6 -6
  476. package/dist/src/utils/retryUntilInitialised.cjs +1 -1
  477. package/dist/src/utils/retryUntilInitialised.js +21 -20
  478. package/dist/src/utils/schemas.cjs +1 -1
  479. package/dist/src/utils/schemas.js +29 -26
  480. package/dist/src/utils/starknet/starknet.cjs +1 -1
  481. package/dist/src/utils/starknet/starknet.js +64 -77
  482. package/dist/src/utils/starknet/starknetLibTypes.cjs +1 -1
  483. package/dist/src/utils/starknet/starknetLibTypes.js +7 -7
  484. package/dist/src/utils/starknet/starknetSchemas.cjs +1 -1
  485. package/dist/src/utils/starknet/starknetSchemas.js +84 -99
  486. package/dist/src/utils/transactions.cjs +1 -1
  487. package/dist/src/utils/transactions.js +10 -10
  488. package/dist/src/utils/url/urlWithQuery.cjs +1 -1
  489. package/dist/src/utils/url/urlWithQuery.js +8 -8
  490. package/dist/src/utils/voidify.cjs +1 -1
  491. package/dist/src/utils/voidify.js +7 -7
  492. package/dist/swap.cjs +1 -1
  493. package/dist/swap.js +8 -22
  494. package/package.json +15 -15
  495. package/dist/_virtual/_commonjsHelpers.cjs +0 -1
  496. package/dist/_virtual/_commonjsHelpers.js +0 -6
  497. package/dist/_virtual/numeral.cjs +0 -1
  498. package/dist/_virtual/numeral.js +0 -7
  499. package/dist/_virtual/numeral2.cjs +0 -1
  500. package/dist/_virtual/numeral2.js +0 -4
  501. package/dist/_virtual/semver.cjs +0 -1
  502. package/dist/_virtual/semver.js +0 -7
  503. package/dist/_virtual/semver2.cjs +0 -1
  504. package/dist/_virtual/semver2.js +0 -4
@@ -1,36 +1,32 @@
1
- import { z as e } from "zod";
2
- import { addressSchema as r } from "../../../chains/starknet/address.js";
3
- const t = e.object({
4
- quoteId: e.string()
5
- }), n = e.lazy(() => e.object({
6
- name: e.string(),
7
- percent: e.number(),
8
- sellToken: r,
9
- buyToken: r,
10
- routes: e.array(n)
11
- })), u = e.object({
12
- sellToken: r,
13
- sellAmount: e.string(),
14
- sellAmountInCurrency: e.string(),
15
- buyToken: r,
16
- buyAmount: e.string(),
17
- buyAmountInCurrency: e.string(),
18
- expiresAt: e.number(),
19
- expiresIn: e.number(),
20
- dexCount: e.number(),
21
- routes: e.array(n),
22
- providerName: e.string(),
23
- providerFee: e.string(),
24
- providerFeeInCurrency: e.string(),
25
- providerFeePercentage: e.number(),
26
- argentFee: e.string(),
27
- argentFeeInCurrency: e.string(),
28
- argentFeePercentage: e.number(),
29
- feeToken: r,
30
- data: t
1
+ import { addressSchema as e } from "../../../chains/starknet/address.js";
2
+ import { z as t } from "zod";
3
+ //#region src/features/swap/models/quote.model.ts
4
+ var n = t.object({ quoteId: t.string() }), r = t.lazy(() => t.object({
5
+ name: t.string(),
6
+ percent: t.number(),
7
+ sellToken: e,
8
+ buyToken: e,
9
+ routes: t.array(r)
10
+ })), i = t.object({
11
+ sellToken: e,
12
+ sellAmount: t.string(),
13
+ sellAmountInCurrency: t.string(),
14
+ buyToken: e,
15
+ buyAmount: t.string(),
16
+ buyAmountInCurrency: t.string(),
17
+ expiresAt: t.number(),
18
+ expiresIn: t.number(),
19
+ dexCount: t.number(),
20
+ routes: t.array(r),
21
+ providerName: t.string(),
22
+ providerFee: t.string(),
23
+ providerFeeInCurrency: t.string(),
24
+ providerFeePercentage: t.number(),
25
+ argentFee: t.string(),
26
+ argentFeeInCurrency: t.string(),
27
+ argentFeePercentage: t.number(),
28
+ feeToken: e,
29
+ data: n
31
30
  });
32
- export {
33
- t as SwapDataSchema,
34
- u as SwapQuoteResponseSchema,
35
- n as SwapQuoteRouteSchema
36
- };
31
+ //#endregion
32
+ export { n as SwapDataSchema, i as SwapQuoteResponseSchema, r as SwapQuoteRouteSchema };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),t=require("../../../tokens/service/types/webToken.model.cjs"),n=require("./quote.model.cjs");exports.TradeType=void 0;(function(r){r.EXACT_PAY="EXACT_PAY",r.EXACT_RECEIVE="EXACT_RECEIVE"})(exports.TradeType||(exports.TradeType={}));const a=e.z.enum(exports.TradeType),o=e.z.object({payToken:t.webTokenSchema,receiveToken:t.webTokenSchema,tradeType:a.default(exports.TradeType.EXACT_PAY),payAmount:e.z.string(),receiveAmount:e.z.string(),payAmountInCurrency:e.z.string(),receiveAmountInCurrency:e.z.string(),totalFee:e.z.string(),totalFeeInCurrency:e.z.string().optional(),totalFeePercentage:e.z.number(),expiresAt:e.z.number(),expiresIn:e.z.number(),route:n.SwapQuoteRouteSchema,data:n.SwapDataSchema});exports.TradeSchema=o;exports.TradeTypeSchema=a;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../tokens/service/types/webToken.model.cjs`),t=require(`./quote.model.cjs`);let n=require(`zod`);var r;(function(e){e.EXACT_PAY=`EXACT_PAY`,e.EXACT_RECEIVE=`EXACT_RECEIVE`})(r||={});var i=n.z.enum(r),a=n.z.object({payToken:e.webTokenSchema,receiveToken:e.webTokenSchema,tradeType:i.default(r.EXACT_PAY),payAmount:n.z.string(),receiveAmount:n.z.string(),payAmountInCurrency:n.z.string(),receiveAmountInCurrency:n.z.string(),totalFee:n.z.string(),totalFeeInCurrency:n.z.string().optional(),totalFeePercentage:n.z.number(),expiresAt:n.z.number(),expiresIn:n.z.number(),route:t.SwapQuoteRouteSchema,data:t.SwapDataSchema});exports.TradeSchema=a,Object.defineProperty(exports,`TradeType`,{enumerable:!0,get:function(){return r}}),exports.TradeTypeSchema=i;
@@ -1,28 +1,26 @@
1
- import { z as e } from "zod";
2
- import { webTokenSchema as n } from "../../../tokens/service/types/webToken.model.js";
3
- import { SwapDataSchema as o, SwapQuoteRouteSchema as a } from "./quote.model.js";
4
- var t;
5
- (function(r) {
6
- r.EXACT_PAY = "EXACT_PAY", r.EXACT_RECEIVE = "EXACT_RECEIVE";
7
- })(t || (t = {}));
8
- const m = e.enum(t), p = e.object({
9
- payToken: n,
10
- receiveToken: n,
11
- tradeType: m.default(t.EXACT_PAY),
12
- payAmount: e.string(),
13
- receiveAmount: e.string(),
14
- payAmountInCurrency: e.string(),
15
- receiveAmountInCurrency: e.string(),
16
- totalFee: e.string(),
17
- totalFeeInCurrency: e.string().optional(),
18
- totalFeePercentage: e.number(),
19
- expiresAt: e.number(),
20
- expiresIn: e.number(),
21
- route: a,
22
- data: o
1
+ import { webTokenSchema as e } from "../../../tokens/service/types/webToken.model.js";
2
+ import { SwapDataSchema as t, SwapQuoteRouteSchema as n } from "./quote.model.js";
3
+ import { z as r } from "zod";
4
+ //#region src/features/swap/models/trade.model.ts
5
+ var i;
6
+ (function(e) {
7
+ e.EXACT_PAY = "EXACT_PAY", e.EXACT_RECEIVE = "EXACT_RECEIVE";
8
+ })(i ||= {});
9
+ var a = r.enum(i), o = r.object({
10
+ payToken: e,
11
+ receiveToken: e,
12
+ tradeType: a.default(i.EXACT_PAY),
13
+ payAmount: r.string(),
14
+ receiveAmount: r.string(),
15
+ payAmountInCurrency: r.string(),
16
+ receiveAmountInCurrency: r.string(),
17
+ totalFee: r.string(),
18
+ totalFeeInCurrency: r.string().optional(),
19
+ totalFeePercentage: r.number(),
20
+ expiresAt: r.number(),
21
+ expiresIn: r.number(),
22
+ route: n,
23
+ data: t
23
24
  });
24
- export {
25
- p as TradeSchema,
26
- t as TradeType,
27
- m as TradeTypeSchema
28
- };
25
+ //#endregion
26
+ export { o as TradeSchema, i as TradeType, a as TradeTypeSchema };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("url-join"),a=require("../../../errors/swap.cjs"),p=require("../models/quote.model.cjs"),l=require("../utils/totalFee.cjs"),S=require("../models/trade.model.cjs"),i=require("../models/order.model.cjs"),d=require("../../../utils/url/urlWithQuery.cjs");class y{constructor(e,r){if(this.httpService=e,!r)throw new a.SwapError({code:"NO_SWAP_URL"});this.swapQuoteUrl=u(r,"/quote"),this.swapOrderUrl=u(r,"/order")}async getSwapQuoteForPay(e,r,o,n,t="USD"){const s=d.urlWithQuery(this.swapQuoteUrl,{accountAddress:n,currency:t,chain:"starknet",sellToken:e,buyToken:r,sellAmount:o});try{const c=await this.httpService.get(s);return await p.SwapQuoteResponseSchema.parseAsync(c)}catch(c){throw console.error(c),new a.SwapError({code:"INVALID_QUOTE_RESPONSE"})}}async getSwapTradeFromQuote(e,r,o){if(!r||!o)throw new a.SwapError({code:"INVALID_SWAP_TOKENS"});const{totalFee:n,totalFeeInCurrency:t,totalFeePercentage:s}=l.calculateTotalFee(e);return S.TradeSchema.parse({payToken:r,receiveToken:o,payAmount:e.sellAmount,receiveAmount:e.buyAmount,payAmountInCurrency:e.sellAmountInCurrency,receiveAmountInCurrency:e.buyAmountInCurrency,totalFee:n,totalFeeInCurrency:t,totalFeePercentage:s,expiresAt:e.expiresAt,expiresIn:e.expiresIn,route:e.routes[0],data:e.data})}async getSwapOrderFromTrade(e,r,o){const n=i.SwapOrderRequestSchema.parse({chain:"starknet",sellToken:r.payToken.address,buyToken:r.receiveToken.address,sellAmount:r.payAmount,buyAmount:r.receiveAmount,accountAddress:e,slippage:o/1e4,data:r.data});try{const t=await this.httpService.post(this.swapOrderUrl,{body:JSON.stringify(n),headers:{"Content-Type":"application/json"}});return await i.SwapOrderResponseSchema.parseAsync(t)}catch(t){throw console.error(t),new a.SwapError({code:"INVALID_SWAP_ORDER_RESPONSE"})}}}exports.SharedSwapService=y;
1
+ const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../utils/url/urlWithQuery.cjs`),n=require(`../../../errors/swap.cjs`),r=require(`../models/quote.model.cjs`),i=require(`../models/order.model.cjs`),a=require(`../models/trade.model.cjs`),o=require(`../utils/totalFee.cjs`);let s=require(`url-join`);s=e.__toESM(s);var c=class{constructor(e,t){if(this.httpService=e,!t)throw new n.SwapError({code:`NO_SWAP_URL`});this.swapQuoteUrl=(0,s.default)(t,`/quote`),this.swapOrderUrl=(0,s.default)(t,`/order`)}async getSwapQuoteForPay(e,i,a,o,s=`USD`){let c=t.urlWithQuery(this.swapQuoteUrl,{accountAddress:o,currency:s,chain:`starknet`,sellToken:e,buyToken:i,sellAmount:a});try{let e=await this.httpService.get(c);return await r.SwapQuoteResponseSchema.parseAsync(e)}catch(e){throw console.error(e),new n.SwapError({code:`INVALID_QUOTE_RESPONSE`})}}async getSwapTradeFromQuote(e,t,r){if(!t||!r)throw new n.SwapError({code:`INVALID_SWAP_TOKENS`});let{totalFee:i,totalFeeInCurrency:s,totalFeePercentage:c}=o.calculateTotalFee(e);return a.TradeSchema.parse({payToken:t,receiveToken:r,payAmount:e.sellAmount,receiveAmount:e.buyAmount,payAmountInCurrency:e.sellAmountInCurrency,receiveAmountInCurrency:e.buyAmountInCurrency,totalFee:i,totalFeeInCurrency:s,totalFeePercentage:c,expiresAt:e.expiresAt,expiresIn:e.expiresIn,route:e.routes[0],data:e.data})}async getSwapOrderFromTrade(e,t,r){let a=i.SwapOrderRequestSchema.parse({chain:`starknet`,sellToken:t.payToken.address,buyToken:t.receiveToken.address,sellAmount:t.payAmount,buyAmount:t.receiveAmount,accountAddress:e,slippage:r/1e4,data:t.data});try{let e=await this.httpService.post(this.swapOrderUrl,{body:JSON.stringify(a),headers:{"Content-Type":`application/json`}});return await i.SwapOrderResponseSchema.parseAsync(e)}catch(e){throw console.error(e),new n.SwapError({code:`INVALID_SWAP_ORDER_RESPONSE`})}}};exports.SharedSwapService=c;
@@ -1,76 +1,72 @@
1
- import p from "url-join";
2
- import { SwapError as a } from "../../../errors/swap.js";
3
- import { SwapQuoteResponseSchema as i } from "../models/quote.model.js";
4
- import { calculateTotalFee as u } from "../utils/totalFee.js";
5
- import { TradeSchema as m } from "../models/trade.model.js";
6
- import { SwapOrderRequestSchema as l, SwapOrderResponseSchema as S } from "../models/order.model.js";
7
- import { urlWithQuery as y } from "../../../utils/url/urlWithQuery.js";
8
- class _ {
9
- constructor(e, r) {
10
- if (this.httpService = e, !r)
11
- throw new a({ code: "NO_SWAP_URL" });
12
- this.swapQuoteUrl = p(r, "/quote"), this.swapOrderUrl = p(r, "/order");
13
- }
14
- async getSwapQuoteForPay(e, r, o, n, t = "USD") {
15
- const s = y(this.swapQuoteUrl, {
16
- accountAddress: n,
17
- currency: t,
18
- chain: "starknet",
19
- sellToken: e,
20
- buyToken: r,
21
- sellAmount: o
22
- });
23
- try {
24
- const c = await this.httpService.get(s);
25
- return await i.parseAsync(c);
26
- } catch (c) {
27
- throw console.error(c), new a({ code: "INVALID_QUOTE_RESPONSE" });
28
- }
29
- }
30
- async getSwapTradeFromQuote(e, r, o) {
31
- if (!r || !o)
32
- throw new a({ code: "INVALID_SWAP_TOKENS" });
33
- const { totalFee: n, totalFeeInCurrency: t, totalFeePercentage: s } = u(e);
34
- return m.parse({
35
- payToken: r,
36
- receiveToken: o,
37
- payAmount: e.sellAmount,
38
- receiveAmount: e.buyAmount,
39
- payAmountInCurrency: e.sellAmountInCurrency,
40
- receiveAmountInCurrency: e.buyAmountInCurrency,
41
- totalFee: n,
42
- totalFeeInCurrency: t,
43
- totalFeePercentage: s,
44
- expiresAt: e.expiresAt,
45
- expiresIn: e.expiresIn,
46
- route: e.routes[0],
47
- data: e.data
48
- });
49
- }
50
- async getSwapOrderFromTrade(e, r, o) {
51
- const n = l.parse({
52
- chain: "starknet",
53
- sellToken: r.payToken.address,
54
- buyToken: r.receiveToken.address,
55
- sellAmount: r.payAmount,
56
- buyAmount: r.receiveAmount,
57
- accountAddress: e,
58
- slippage: o / 1e4,
59
- data: r.data
60
- });
61
- try {
62
- const t = await this.httpService.post(this.swapOrderUrl, {
63
- body: JSON.stringify(n),
64
- headers: {
65
- "Content-Type": "application/json"
66
- }
67
- });
68
- return await S.parseAsync(t);
69
- } catch (t) {
70
- throw console.error(t), new a({ code: "INVALID_SWAP_ORDER_RESPONSE" });
71
- }
72
- }
73
- }
74
- export {
75
- _ as SharedSwapService
1
+ import { urlWithQuery as e } from "../../../utils/url/urlWithQuery.js";
2
+ import { SwapError as t } from "../../../errors/swap.js";
3
+ import { SwapQuoteResponseSchema as n } from "../models/quote.model.js";
4
+ import { SwapOrderRequestSchema as r, SwapOrderResponseSchema as i } from "../models/order.model.js";
5
+ import { TradeSchema as a } from "../models/trade.model.js";
6
+ import { calculateTotalFee as o } from "../utils/totalFee.js";
7
+ import s from "url-join";
8
+ //#region src/features/swap/services/SwapSharedService.ts
9
+ var c = class {
10
+ constructor(e, n) {
11
+ if (this.httpService = e, !n) throw new t({ code: "NO_SWAP_URL" });
12
+ this.swapQuoteUrl = s(n, "/quote"), this.swapOrderUrl = s(n, "/order");
13
+ }
14
+ async getSwapQuoteForPay(r, i, a, o, s = "USD") {
15
+ let c = e(this.swapQuoteUrl, {
16
+ accountAddress: o,
17
+ currency: s,
18
+ chain: "starknet",
19
+ sellToken: r,
20
+ buyToken: i,
21
+ sellAmount: a
22
+ });
23
+ try {
24
+ let e = await this.httpService.get(c);
25
+ return await n.parseAsync(e);
26
+ } catch (e) {
27
+ throw console.error(e), new t({ code: "INVALID_QUOTE_RESPONSE" });
28
+ }
29
+ }
30
+ async getSwapTradeFromQuote(e, n, r) {
31
+ if (!n || !r) throw new t({ code: "INVALID_SWAP_TOKENS" });
32
+ let { totalFee: i, totalFeeInCurrency: s, totalFeePercentage: c } = o(e);
33
+ return a.parse({
34
+ payToken: n,
35
+ receiveToken: r,
36
+ payAmount: e.sellAmount,
37
+ receiveAmount: e.buyAmount,
38
+ payAmountInCurrency: e.sellAmountInCurrency,
39
+ receiveAmountInCurrency: e.buyAmountInCurrency,
40
+ totalFee: i,
41
+ totalFeeInCurrency: s,
42
+ totalFeePercentage: c,
43
+ expiresAt: e.expiresAt,
44
+ expiresIn: e.expiresIn,
45
+ route: e.routes[0],
46
+ data: e.data
47
+ });
48
+ }
49
+ async getSwapOrderFromTrade(e, n, a) {
50
+ let o = r.parse({
51
+ chain: "starknet",
52
+ sellToken: n.payToken.address,
53
+ buyToken: n.receiveToken.address,
54
+ sellAmount: n.payAmount,
55
+ buyAmount: n.receiveAmount,
56
+ accountAddress: e,
57
+ slippage: a / 1e4,
58
+ data: n.data
59
+ });
60
+ try {
61
+ let e = await this.httpService.post(this.swapOrderUrl, {
62
+ body: JSON.stringify(o),
63
+ headers: { "Content-Type": "application/json" }
64
+ });
65
+ return await i.parseAsync(e);
66
+ } catch (e) {
67
+ throw console.error(e), new t({ code: "INVALID_SWAP_ORDER_RESPONSE" });
68
+ }
69
+ }
76
70
  };
71
+ //#endregion
72
+ export { c as SharedSwapService };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("lodash-es"),a=require("starknet"),g=require("../../../transactions/transactionExecuteTypes.cjs"),f=require("../../../utils/url/urlWithQuery.cjs");class y{constructor(t="",o){this.argentAffiliateUrl=t,this.httpService=o}async execute({paymasterParams:t,transactionParams:o,isSubsidised:c,currency:u}){if(_.isEmpty(this.argentAffiliateUrl))throw new Error("Argent affiliate URL is not set");let s;t?s={executeRequest:{...t,signature:t.signature,deploymentData:t.deploymentData,userAddress:t.accountAddress,typedData:t.typedData},isSubsidised:c}:s={transactions:o?.map(e=>{const n=e.resourceBounds?a.stark.resourceBoundsToHexString(e.resourceBounds):void 0,i={type:e.type,calls:e.calls,chainId:e.chainId,cairoVersion:e.cairoVersion,account:e.account,signature:e.signature,nonce:e.nonce,version:e.version,resourceBounds:{l1Gas:{maxAmount:n?.l1_gas?.max_amount,maxPricePerUnit:n?.l1_gas?.max_price_per_unit},l2Gas:{maxAmount:n?.l2_gas?.max_amount,maxPricePerUnit:n?.l2_gas?.max_price_per_unit},l1DataGas:{maxAmount:n?.l1_data_gas?.max_amount,maxPricePerUnit:n?.l1_data_gas?.max_price_per_unit}}};return i.nonceDataAvailabilityMode=e.nonceDataAvailabilityMode,i.feeDataAvailabilityMode=e.feeDataAvailabilityMode,i.tip=e.tip,i})};const l={currency:u},d=f.urlWithQuery(this.argentAffiliateUrl,l),p=await this.httpService.post(d,{body:a.json.stringify(s),headers:{"Content-Type":"application/json"}}),r=g.transactionExecutionResponseSchema.safeParse(p);if(!r.success)throw new Error("Invalid response from swap API");return r.data}}exports.SwapTransactionService=y;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../utils/url/urlWithQuery.cjs`),t=require(`../../../transactions/transactionExecuteTypes.cjs`);let n=require(`lodash-es`),r=require(`starknet`);var i=class{constructor(e=``,t){this.argentAffiliateUrl=e,this.httpService=t}async execute({paymasterParams:i,transactionParams:a,isSubsidised:o,currency:s}){if((0,n.isEmpty)(this.argentAffiliateUrl))throw Error(`Argent affiliate URL is not set`);let c;c=i?{executeRequest:{...i,signature:i.signature,deploymentData:i.deploymentData,userAddress:i.accountAddress,typedData:i.typedData},isSubsidised:o}:{transactions:a?.map(e=>{let t=e.resourceBounds?r.stark.resourceBoundsToHexString(e.resourceBounds):void 0,n={type:e.type,calls:e.calls,chainId:e.chainId,cairoVersion:e.cairoVersion,account:e.account,signature:e.signature,nonce:e.nonce,version:e.version,resourceBounds:{l1Gas:{maxAmount:t?.l1_gas?.max_amount,maxPricePerUnit:t?.l1_gas?.max_price_per_unit},l2Gas:{maxAmount:t?.l2_gas?.max_amount,maxPricePerUnit:t?.l2_gas?.max_price_per_unit},l1DataGas:{maxAmount:t?.l1_data_gas?.max_amount,maxPricePerUnit:t?.l1_data_gas?.max_price_per_unit}}};return n.nonceDataAvailabilityMode=e.nonceDataAvailabilityMode,n.feeDataAvailabilityMode=e.feeDataAvailabilityMode,n.tip=e.tip,n})};let l={currency:s},u=e.urlWithQuery(this.argentAffiliateUrl,l),d=await this.httpService.post(u,{body:r.json.stringify(c),headers:{"Content-Type":`application/json`}}),f=t.transactionExecutionResponseSchema.safeParse(d);if(!f.success)throw Error(`Invalid response from swap API`);return f.data}};exports.SwapTransactionService=i;
@@ -1,64 +1,58 @@
1
- import { isEmpty as d } from "lodash-es";
2
- import { stark as f, json as _ } from "starknet";
3
- import { transactionExecutionResponseSchema as g } from "../../../transactions/transactionExecuteTypes.js";
4
- import { urlWithQuery as h } from "../../../utils/url/urlWithQuery.js";
5
- class U {
6
- constructor(t = "", o) {
7
- this.argentAffiliateUrl = t, this.httpService = o;
8
- }
9
- async execute({ paymasterParams: t, transactionParams: o, isSubsidised: a, currency: c }) {
10
- if (d(this.argentAffiliateUrl))
11
- throw new Error("Argent affiliate URL is not set");
12
- let r;
13
- t ? r = {
14
- executeRequest: {
15
- ...t,
16
- signature: t.signature,
17
- deploymentData: t.deploymentData,
18
- userAddress: t.accountAddress,
19
- typedData: t.typedData
20
- },
21
- isSubsidised: a
22
- } : r = { transactions: o?.map((e) => {
23
- const n = e.resourceBounds ? f.resourceBoundsToHexString(e.resourceBounds) : void 0, i = {
24
- type: e.type,
25
- calls: e.calls,
26
- chainId: e.chainId,
27
- cairoVersion: e.cairoVersion,
28
- account: e.account,
29
- signature: e.signature,
30
- nonce: e.nonce,
31
- version: e.version,
32
- resourceBounds: {
33
- l1Gas: {
34
- maxAmount: n?.l1_gas?.max_amount,
35
- maxPricePerUnit: n?.l1_gas?.max_price_per_unit
36
- },
37
- l2Gas: {
38
- maxAmount: n?.l2_gas?.max_amount,
39
- maxPricePerUnit: n?.l2_gas?.max_price_per_unit
40
- },
41
- l1DataGas: {
42
- maxAmount: n?.l1_data_gas?.max_amount,
43
- maxPricePerUnit: n?.l1_data_gas?.max_price_per_unit
44
- }
45
- }
46
- };
47
- return i.nonceDataAvailabilityMode = e.nonceDataAvailabilityMode, i.feeDataAvailabilityMode = e.feeDataAvailabilityMode, i.tip = e.tip, i;
48
- }) };
49
- const u = {
50
- currency: c
51
- }, l = h(this.argentAffiliateUrl, u), p = await this.httpService.post(l, {
52
- body: _.stringify(r),
53
- headers: {
54
- "Content-Type": "application/json"
55
- }
56
- }), s = g.safeParse(p);
57
- if (!s.success)
58
- throw new Error("Invalid response from swap API");
59
- return s.data;
60
- }
61
- }
62
- export {
63
- U as SwapTransactionService
1
+ import { urlWithQuery as e } from "../../../utils/url/urlWithQuery.js";
2
+ import { transactionExecutionResponseSchema as t } from "../../../transactions/transactionExecuteTypes.js";
3
+ import { isEmpty as n } from "lodash-es";
4
+ import { json as r, stark as i } from "starknet";
5
+ //#region src/features/swap/services/SwapTransactionService.ts
6
+ var a = class {
7
+ constructor(e = "", t) {
8
+ this.argentAffiliateUrl = e, this.httpService = t;
9
+ }
10
+ async execute({ paymasterParams: a, transactionParams: o, isSubsidised: s, currency: c }) {
11
+ if (n(this.argentAffiliateUrl)) throw Error("Argent affiliate URL is not set");
12
+ let l;
13
+ l = a ? {
14
+ executeRequest: {
15
+ ...a,
16
+ signature: a.signature,
17
+ deploymentData: a.deploymentData,
18
+ userAddress: a.accountAddress,
19
+ typedData: a.typedData
20
+ },
21
+ isSubsidised: s
22
+ } : { transactions: o?.map((e) => {
23
+ let t = e.resourceBounds ? i.resourceBoundsToHexString(e.resourceBounds) : void 0, n = {
24
+ type: e.type,
25
+ calls: e.calls,
26
+ chainId: e.chainId,
27
+ cairoVersion: e.cairoVersion,
28
+ account: e.account,
29
+ signature: e.signature,
30
+ nonce: e.nonce,
31
+ version: e.version,
32
+ resourceBounds: {
33
+ l1Gas: {
34
+ maxAmount: t?.l1_gas?.max_amount,
35
+ maxPricePerUnit: t?.l1_gas?.max_price_per_unit
36
+ },
37
+ l2Gas: {
38
+ maxAmount: t?.l2_gas?.max_amount,
39
+ maxPricePerUnit: t?.l2_gas?.max_price_per_unit
40
+ },
41
+ l1DataGas: {
42
+ maxAmount: t?.l1_data_gas?.max_amount,
43
+ maxPricePerUnit: t?.l1_data_gas?.max_price_per_unit
44
+ }
45
+ }
46
+ };
47
+ return n.nonceDataAvailabilityMode = e.nonceDataAvailabilityMode, n.feeDataAvailabilityMode = e.feeDataAvailabilityMode, n.tip = e.tip, n;
48
+ }) };
49
+ let u = { currency: c }, d = e(this.argentAffiliateUrl, u), f = await this.httpService.post(d, {
50
+ body: r.stringify(l),
51
+ headers: { "Content-Type": "application/json" }
52
+ }), p = t.safeParse(f);
53
+ if (!p.success) throw Error("Invalid response from swap API");
54
+ return p.data;
55
+ }
64
56
  };
57
+ //#endregion
58
+ export { a as SwapTransactionService };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../../utils/bips.cjs"),m=require("../models/trade.model.cjs"),r=require("../../../bigdecimal/lib.cjs"),c=require("../../../bigdecimal/constants.cjs");function a(e,i){const t=u.bipsToPercent(i),n={value:BigInt(e.payAmount),decimals:e.payToken.decimals};if(e.tradeType===m.TradeType.EXACT_PAY||t.value<=0n)return n;const o=r.add(c.ONE,t);return r.mul(n,o)}function s(e,i){const t=u.bipsToPercent(i),n={value:BigInt(e.receiveAmount),decimals:e.receiveToken.decimals};if(e.tradeType===m.TradeType.EXACT_RECEIVE)return n;const o=r.add(c.ONE,t);return r.div(n,o)}exports.maximumAmountInForTrade=a;exports.minimumAmountOutFromTrade=s;
1
+ const e=require(`../../../bigdecimal/lib.cjs`),t=require(`../../../bigdecimal/constants.cjs`),n=require(`../../../utils/bips.cjs`),r=require(`../models/trade.model.cjs`);function i(i,a){let o=n.bipsToPercent(a),s={value:BigInt(i.payAmount),decimals:i.payToken.decimals};if(i.tradeType===r.TradeType.EXACT_PAY||o.value<=0n)return s;let c=e.add(t.ONE,o);return e.mul(s,c)}function a(i,a){let o=n.bipsToPercent(a),s={value:BigInt(i.receiveAmount),decimals:i.receiveToken.decimals};if(i.tradeType===r.TradeType.EXACT_RECEIVE)return s;let c=e.add(t.ONE,o);return e.div(s,c)}exports.maximumAmountInForTrade=i,exports.minimumAmountOutFromTrade=a;
@@ -1,28 +1,21 @@
1
+ import { add as e, div as t, mul as n } from "../../../bigdecimal/lib.js";
2
+ import { ONE as r } from "../../../bigdecimal/constants.js";
1
3
  import { bipsToPercent as i } from "../../../utils/bips.js";
2
- import { TradeType as m } from "../models/trade.model.js";
3
- import { add as u, mul as c, div as a } from "../../../bigdecimal/lib.js";
4
- import { ONE as p } from "../../../bigdecimal/constants.js";
5
- function f(n, o) {
6
- const t = i(o), e = {
7
- value: BigInt(n.payAmount),
8
- decimals: n.payToken.decimals
9
- };
10
- if (n.tradeType === m.EXACT_PAY || t.value <= 0n)
11
- return e;
12
- const r = u(p, t);
13
- return c(e, r);
4
+ import { TradeType as a } from "../models/trade.model.js";
5
+ //#region src/features/swap/utils/slippage.ts
6
+ function o(t, o) {
7
+ let s = i(o), c = {
8
+ value: BigInt(t.payAmount),
9
+ decimals: t.payToken.decimals
10
+ };
11
+ return t.tradeType === a.EXACT_PAY || s.value <= 0n ? c : n(c, e(r, s));
14
12
  }
15
- function A(n, o) {
16
- const t = i(o), e = {
17
- value: BigInt(n.receiveAmount),
18
- decimals: n.receiveToken.decimals
19
- };
20
- if (n.tradeType === m.EXACT_RECEIVE)
21
- return e;
22
- const r = u(p, t);
23
- return a(e, r);
13
+ function s(n, o) {
14
+ let s = i(o), c = {
15
+ value: BigInt(n.receiveAmount),
16
+ decimals: n.receiveToken.decimals
17
+ };
18
+ return n.tradeType === a.EXACT_RECEIVE ? c : t(c, e(r, s));
24
19
  }
25
- export {
26
- f as maximumAmountInForTrade,
27
- A as minimumAmountOutFromTrade
28
- };
20
+ //#endregion
21
+ export { o as maximumAmountInForTrade, s as minimumAmountOutFromTrade };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../bigdecimal/lib.cjs"),r=require("../../../bigdecimal/utils.cjs");function l(e){const t=BigInt(e.providerFee)+BigInt(e.argentFee),n=o.add(r.parseCurrency(e.argentFeeInCurrency),r.parseCurrency(e.providerFeeInCurrency)),a=r.formatCurrency(n.value),c=e.argentFeePercentage+e.providerFeePercentage;return{totalFee:t.toString(),totalFeePercentage:c,totalFeeInCurrency:a}}exports.calculateTotalFee=l;
1
+ const e=require(`../../../bigdecimal/lib.cjs`),t=require(`../../../bigdecimal/utils.cjs`);function n(n){let r=BigInt(n.providerFee)+BigInt(n.argentFee),i=t.formatCurrency(e.add(t.parseCurrency(n.argentFeeInCurrency),t.parseCurrency(n.providerFeeInCurrency)).value),a=n.argentFeePercentage+n.providerFeePercentage;return{totalFee:r.toString(),totalFeePercentage:a,totalFeeInCurrency:i}}exports.calculateTotalFee=n;
@@ -1,13 +1,13 @@
1
- import { add as o } from "../../../bigdecimal/lib.js";
2
- import { parseCurrency as r, formatCurrency as F } from "../../../bigdecimal/utils.js";
3
- function l(e) {
4
- const t = BigInt(e.providerFee) + BigInt(e.argentFee), n = o(r(e.argentFeeInCurrency), r(e.providerFeeInCurrency)), a = F(n.value), c = e.argentFeePercentage + e.providerFeePercentage;
5
- return {
6
- totalFee: t.toString(),
7
- totalFeePercentage: c,
8
- totalFeeInCurrency: a
9
- };
1
+ import { add as e } from "../../../bigdecimal/lib.js";
2
+ import { formatCurrency as t, parseCurrency as n } from "../../../bigdecimal/utils.js";
3
+ //#region src/features/swap/utils/totalFee.ts
4
+ function r(r) {
5
+ let i = BigInt(r.providerFee) + BigInt(r.argentFee), a = t(e(n(r.argentFeeInCurrency), n(r.providerFeeInCurrency)).value), o = r.argentFeePercentage + r.providerFeePercentage;
6
+ return {
7
+ totalFee: i.toString(),
8
+ totalFeePercentage: o,
9
+ totalFeeInCurrency: a
10
+ };
10
11
  }
11
- export {
12
- l as calculateTotalFee
13
- };
12
+ //#endregion
13
+ export { r as calculateTotalFee };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(t,e){this.httpService=t,this.baseUrl=e,this.offsetInS=0,this.syncIntervalInMs=60*1e3,this.initialSync=this.syncWithServer(),setInterval(()=>{this.syncWithServer()},this.syncIntervalInMs)}async now(){return await this.initialSync,new Date(Date.now()+this.offsetInS*1e3)}async syncWithServer(){if(typeof window>"u")return;const{time:t}=await this.httpService.get(`${this.baseUrl}/time`),e=Math.floor(Date.now()/1e3),i=t-e;this.offsetInS=i}}exports.DateService=s;
1
+ var e=class{constructor(e,t){this.httpService=e,this.baseUrl=t,this.offsetInS=0,this.syncIntervalInMs=60*1e3,this.initialSync=this.syncWithServer(),setInterval(()=>void this.syncWithServer(),this.syncIntervalInMs)}async now(){return await this.initialSync,new Date(Date.now()+this.offsetInS*1e3)}async syncWithServer(){if(typeof window>`u`)return;let{time:e}=await this.httpService.get(`${this.baseUrl}/time`),t=e-Math.floor(Date.now()/1e3);t!==0&&console.log(`🕒 Time offset: `,`${t}s`),this.offsetInS=t}};exports.DateService=e;
@@ -1,19 +1,16 @@
1
- class n {
2
- constructor(t, e) {
3
- this.httpService = t, this.baseUrl = e, this.offsetInS = 0, this.syncIntervalInMs = 60 * 1e3, this.initialSync = this.syncWithServer(), setInterval(() => {
4
- this.syncWithServer();
5
- }, this.syncIntervalInMs);
6
- }
7
- async now() {
8
- return await this.initialSync, new Date(Date.now() + this.offsetInS * 1e3);
9
- }
10
- async syncWithServer() {
11
- if (typeof window > "u")
12
- return;
13
- const { time: t } = await this.httpService.get(`${this.baseUrl}/time`), e = Math.floor(Date.now() / 1e3), i = t - e;
14
- this.offsetInS = i;
15
- }
16
- }
17
- export {
18
- n as DateService
1
+ //#region src/http/DateService.ts
2
+ var e = class {
3
+ constructor(e, t) {
4
+ this.httpService = e, this.baseUrl = t, this.offsetInS = 0, this.syncIntervalInMs = 60 * 1e3, this.initialSync = this.syncWithServer(), setInterval(() => void this.syncWithServer(), this.syncIntervalInMs);
5
+ }
6
+ async now() {
7
+ return await this.initialSync, new Date(Date.now() + this.offsetInS * 1e3);
8
+ }
9
+ async syncWithServer() {
10
+ if (typeof window > "u") return;
11
+ let { time: e } = await this.httpService.get(`${this.baseUrl}/time`), t = e - Math.floor(Date.now() / 1e3);
12
+ t !== 0 && console.log("🕒 Time offset: ", `${t}s`), this.offsetInS = t;
13
+ }
19
14
  };
15
+ //#endregion
16
+ export { e as DateService };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t extends Error{constructor(r,e,s){super(r),this.status=e,this.data=s,Object.setPrototypeOf(this,t.prototype)}}exports.HttpError=t;
1
+ var e=class e extends Error{constructor(t,n,r){super(t),this.status=n,this.data=r,Object.setPrototypeOf(this,e.prototype)}};exports.HttpError=e;
@@ -1,8 +1,8 @@
1
- class t extends Error {
2
- constructor(s, r, e) {
3
- super(s), this.status = r, this.data = e, Object.setPrototypeOf(this, t.prototype);
4
- }
5
- }
6
- export {
7
- t as HttpError
1
+ //#region src/http/HttpError.ts
2
+ var e = class e extends Error {
3
+ constructor(t, n, r) {
4
+ super(t), this.status = n, this.data = r, Object.setPrototypeOf(this, e.prototype);
5
+ }
8
6
  };
7
+ //#endregion
8
+ export { e as HttpError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-es"),n=require("./HttpError.cjs"),u=require("./IHttpService.cjs");class d{constructor(c,e="json"){this.requestInit=c,this.responseType=e}async get(c,e,r){const i=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,s={...i,...e,method:"GET",headers:{...i?.headers,...e?.headers}},t=await fetch(c,s).catch(async a=>{let o;throw a instanceof Response&&(o=await a.json().catch(()=>{})),new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_FETCH_URL,0,o)});if(this.responseType==="json"){if(!t.ok)throw new n.HttpError(t.statusText,t.status,await t.json().catch(()=>{}));const a=await t.json();if(r)try{return r.parse(a)}catch(o){throw new n.HttpError(o.message,0)}return a}return t}async post(c,e,r){const i=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,s={...i,...e,method:"POST",headers:{...i?.headers,...e?.headers}},t=await fetch(c,s).catch(()=>{throw new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_POST_URL,0)});if(!t.ok){const o=await t.json().catch(()=>{});throw new n.HttpError(t.statusText,t.status,o)}if(t.status===204)return{};const a=await t.json();if(r)try{return r.parse(a)}catch(o){throw new n.HttpError(o.message,0)}return a}async put(c,e,r){const i=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,s={...i,...e,method:"PUT",headers:{...i?.headers,...e?.headers}},t=await fetch(c,s).catch(()=>{throw new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_PUT_URL,0)});if(!t.ok)throw new n.HttpError(t.statusText,t.status,await t.json().catch(()=>{}));if(t.status===204)return{};const a=await t.json();if(r)try{return r.parse(a)}catch(o){throw new n.HttpError(o.message,0)}return a}async delete(c,e){const r=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,i={...r,...e,method:"DELETE",headers:{...r?.headers,...e?.headers}},s=await fetch(c,i).catch(()=>{throw new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_DELETE_URL,0)});if(!s.ok){const t=await s.json().catch(()=>{});throw new n.HttpError(s.statusText,s.status,t)}}async patch(c,e){const r=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,i={...r,...e,method:"PATCH",headers:{...r?.headers,...e?.headers}},s=await fetch(c,i).catch(()=>{throw new n.HttpError("Failed to patch url",0)});if(!s.ok){const a=await s.json().catch(()=>{});throw new n.HttpError(s.statusText,s.status,a)}return await s.json()}}exports.HTTPService=d;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./HttpError.cjs`),t=require(`./IHttpService.cjs`);let n=require(`lodash-es`);var r=class{constructor(e,t=`json`){this.requestInit=e,this.responseType=t}async get(r,i,a){let o=(0,n.isFunction)(this.requestInit)?await this.requestInit():this.requestInit,s={...o,...i,method:`GET`,headers:{...o?.headers,...i?.headers}},c=await fetch(r,s).catch(async n=>{let r;throw n instanceof Response&&(r=await n.json().catch(()=>void 0)),new e.HttpError(t.HTTP_ERROR_MESSAGE.FAILED_TO_FETCH_URL,0,r)});if(this.responseType===`json`){if(!c.ok)throw new e.HttpError(c.statusText,c.status,await c.json().catch(()=>void 0));let t=await c.json();if(a)try{return a.parse(t)}catch(t){throw new e.HttpError(t.message,0)}return t}return c}async post(r,i,a){let o=(0,n.isFunction)(this.requestInit)?await this.requestInit():this.requestInit,s={...o,...i,method:`POST`,headers:{...o?.headers,...i?.headers}},c=await fetch(r,s).catch(()=>{throw new e.HttpError(t.HTTP_ERROR_MESSAGE.FAILED_TO_POST_URL,0)});if(!c.ok){let t=await c.json().catch(()=>void 0);throw new e.HttpError(c.statusText,c.status,t)}if(c.status===204)return{};let l=await c.json();if(a)try{return a.parse(l)}catch(t){throw new e.HttpError(t.message,0)}return l}async put(r,i,a){let o=(0,n.isFunction)(this.requestInit)?await this.requestInit():this.requestInit,s={...o,...i,method:`PUT`,headers:{...o?.headers,...i?.headers}},c=await fetch(r,s).catch(()=>{throw new e.HttpError(t.HTTP_ERROR_MESSAGE.FAILED_TO_PUT_URL,0)});if(!c.ok)throw new e.HttpError(c.statusText,c.status,await c.json().catch(()=>void 0));if(c.status===204)return{};let l=await c.json();if(a)try{return a.parse(l)}catch(t){throw new e.HttpError(t.message,0)}return l}async delete(r,i){let a=(0,n.isFunction)(this.requestInit)?await this.requestInit():this.requestInit,o={...a,...i,method:`DELETE`,headers:{...a?.headers,...i?.headers}},s=await fetch(r,o).catch(()=>{throw new e.HttpError(t.HTTP_ERROR_MESSAGE.FAILED_TO_DELETE_URL,0)});if(!s.ok){let t=await s.json().catch(()=>void 0);throw new e.HttpError(s.statusText,s.status,t)}}async patch(t,r){let i=(0,n.isFunction)(this.requestInit)?await this.requestInit():this.requestInit,a={...i,...r,method:`PATCH`,headers:{...i?.headers,...r?.headers}},o=await fetch(t,a).catch(()=>{throw new e.HttpError(`Failed to patch url`,0)});if(!o.ok){let t=await o.json().catch(()=>void 0);throw new e.HttpError(o.statusText,o.status,t)}return await o.json()}};exports.HTTPService=r;