@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,13 +1,10 @@
1
1
  import { z as e } from "zod";
2
- const r = e.object({
3
- code: e.string(),
4
- symbol: e.string(),
5
- name: e.string(),
6
- decimals: e.number()
7
- }), s = e.object({
8
- currencies: e.array(r)
9
- });
10
- export {
11
- s as currenciesDetailsSchema,
12
- r as currencyDetailsSchema
13
- };
2
+ //#region src/currencyFetchService/types.ts.ts
3
+ var t = e.object({
4
+ code: e.string(),
5
+ symbol: e.string(),
6
+ name: e.string(),
7
+ decimals: e.number()
8
+ }), n = e.object({ currencies: e.array(t) });
9
+ //#endregion
10
+ export { n as currenciesDetailsSchema, t as currencyDetailsSchema };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./baseErrors.cjs");exports.ACCOUNT_ERROR_MESSAGES=void 0;(function(r){r.NOT_FOUND="Account not found",r.CALCULATED_ADDRESS_NO_MATCH="Calculated address does not match account address"})(exports.ACCOUNT_ERROR_MESSAGES||(exports.ACCOUNT_ERROR_MESSAGES={}));class c extends t.BaseError{constructor(o){super(o,exports.ACCOUNT_ERROR_MESSAGES),this.name="AccountError"}}exports.AccountError=c;
1
+ const e=require(`./baseErrors.cjs`);var t;(function(e){e.NOT_FOUND=`Account not found`,e.CALCULATED_ADDRESS_NO_MATCH=`Calculated address does not match account address`})(t||={});var n=class extends e.BaseError{constructor(e){super(e,t),this.name=`AccountError`}};exports.AccountError=n;
@@ -1,14 +1,13 @@
1
- import { BaseError as c } from "./baseErrors.js";
2
- var o;
3
- (function(r) {
4
- r.NOT_FOUND = "Account not found", r.CALCULATED_ADDRESS_NO_MATCH = "Calculated address does not match account address";
5
- })(o || (o = {}));
6
- class s extends c {
7
- constructor(t) {
8
- super(t, o), this.name = "AccountError";
9
- }
10
- }
11
- export {
12
- o as ACCOUNT_ERROR_MESSAGES,
13
- s as AccountError
1
+ import { BaseError as e } from "./baseErrors.js";
2
+ //#region src/errors/account.ts
3
+ var t;
4
+ (function(e) {
5
+ e.NOT_FOUND = "Account not found", e.CALCULATED_ADDRESS_NO_MATCH = "Calculated address does not match account address";
6
+ })(t ||= {});
7
+ var n = class extends e {
8
+ constructor(e) {
9
+ super(e, t), this.name = "AccountError";
10
+ }
14
11
  };
12
+ //#endregion
13
+ export { n as AccountError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./baseErrors.cjs");exports.ADDRESS_ERROR_MESSAGES=void 0;(function(e){e.NOT_VALID="Invalid address",e.NOT_FOUND="Address not found",e.STARKNAME_NOT_FOUND="Stark name not found",e.STARKNAME_ERROR="Could not get address from stark name",e.STARKNAME_INVALID_ADDRESS="Stark name resolved to an invalid address",e.ARGENT_NAME_NOT_FOUND="Argent name not found",e.NO_ADDRESS_FROM_ARGENT_NAME="Could not get address from Argent name",e.ARGENT_NAME_INVALID_ADDRESS="Argent name resolved to an invalid address",e.NO_ADDRESS_FROM_DOMAIN="Could not get address from domain",e.ARGENT_NAME_INVALID_NETWORK="Argent name is not enabled on the requested network"})(exports.ADDRESS_ERROR_MESSAGES||(exports.ADDRESS_ERROR_MESSAGES={}));class n extends d.BaseError{constructor(r){super(r,exports.ADDRESS_ERROR_MESSAGES),this.name="AddressError"}}exports.AddressError=n;
1
+ const e=require(`./baseErrors.cjs`);var t;(function(e){e.NOT_VALID=`Invalid address`,e.NOT_FOUND=`Address not found`,e.STARKNAME_NOT_FOUND=`Stark name not found`,e.STARKNAME_ERROR=`Could not get address from stark name`,e.STARKNAME_INVALID_ADDRESS=`Stark name resolved to an invalid address`,e.ARGENT_NAME_NOT_FOUND=`Argent name not found`,e.NO_ADDRESS_FROM_ARGENT_NAME=`Could not get address from Argent name`,e.ARGENT_NAME_INVALID_ADDRESS=`Argent name resolved to an invalid address`,e.NO_ADDRESS_FROM_DOMAIN=`Could not get address from domain`,e.ARGENT_NAME_INVALID_NETWORK=`Argent name is not enabled on the requested network`})(t||={});var n=class extends e.BaseError{constructor(e){super(e,t),this.name=`AddressError`}};exports.AddressError=n;
@@ -1,14 +1,13 @@
1
- import { BaseError as d } from "./baseErrors.js";
2
- var r;
1
+ import { BaseError as e } from "./baseErrors.js";
2
+ //#region src/errors/address.ts
3
+ var t;
3
4
  (function(e) {
4
- e.NOT_VALID = "Invalid address", e.NOT_FOUND = "Address not found", e.STARKNAME_NOT_FOUND = "Stark name not found", e.STARKNAME_ERROR = "Could not get address from stark name", e.STARKNAME_INVALID_ADDRESS = "Stark name resolved to an invalid address", e.ARGENT_NAME_NOT_FOUND = "Argent name not found", e.NO_ADDRESS_FROM_ARGENT_NAME = "Could not get address from Argent name", e.ARGENT_NAME_INVALID_ADDRESS = "Argent name resolved to an invalid address", e.NO_ADDRESS_FROM_DOMAIN = "Could not get address from domain", e.ARGENT_NAME_INVALID_NETWORK = "Argent name is not enabled on the requested network";
5
- })(r || (r = {}));
6
- class s extends d {
7
- constructor(n) {
8
- super(n, r), this.name = "AddressError";
9
- }
10
- }
11
- export {
12
- r as ADDRESS_ERROR_MESSAGES,
13
- s as AddressError
5
+ e.NOT_VALID = "Invalid address", e.NOT_FOUND = "Address not found", e.STARKNAME_NOT_FOUND = "Stark name not found", e.STARKNAME_ERROR = "Could not get address from stark name", e.STARKNAME_INVALID_ADDRESS = "Stark name resolved to an invalid address", e.ARGENT_NAME_NOT_FOUND = "Argent name not found", e.NO_ADDRESS_FROM_ARGENT_NAME = "Could not get address from Argent name", e.ARGENT_NAME_INVALID_ADDRESS = "Argent name resolved to an invalid address", e.NO_ADDRESS_FROM_DOMAIN = "Could not get address from domain", e.ARGENT_NAME_INVALID_NETWORK = "Argent name is not enabled on the requested network";
6
+ })(t ||= {});
7
+ var n = class extends e {
8
+ constructor(e) {
9
+ super(e, t), this.name = "AddressError";
10
+ }
14
11
  };
12
+ //#endregion
13
+ export { n as AddressError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Error{constructor({code:e,message:s,options:r={}},t){const{error:o,context:a}=r;super(s,{cause:o}),this.errorMessages=t,this.name="BaseError",this.context=a,this.code=e,this.setMessageByCode(e,s)}setMessageByCode(e,s){!e||!this.errorMessages||s||(this.message=this.errorMessages[e])}toString(){return this.message||""}}exports.BaseError=i;
1
+ var e=class extends Error{constructor({code:e,message:t,options:n={}},r){let{error:i,context:a}=n;super(t,{cause:i}),this.errorMessages=r,this.name=`BaseError`,this.context=a,this.code=e,this.setMessageByCode(e,t)}setMessageByCode(e,t){!e||!this.errorMessages||t||(this.message=this.errorMessages[e])}toString(){return this.message||``}};exports.BaseError=e;
@@ -1,15 +1,15 @@
1
- class h extends Error {
2
- constructor({ code: s, message: e, options: r = {} }, t) {
3
- const { error: o, context: a } = r;
4
- super(e, { cause: o }), this.errorMessages = t, this.name = "BaseError", this.context = a, this.code = s, this.setMessageByCode(s, e);
5
- }
6
- setMessageByCode(s, e) {
7
- !s || !this.errorMessages || e || (this.message = this.errorMessages[s]);
8
- }
9
- toString() {
10
- return this.message || "";
11
- }
12
- }
13
- export {
14
- h as BaseError
1
+ //#region src/errors/baseErrors.ts
2
+ var e = class extends Error {
3
+ constructor({ code: e, message: t, options: n = {} }, r) {
4
+ let { error: i, context: a } = n;
5
+ super(t, { cause: i }), this.errorMessages = r, this.name = "BaseError", this.context = a, this.code = e, this.setMessageByCode(e, t);
6
+ }
7
+ setMessageByCode(e, t) {
8
+ !e || !this.errorMessages || t || (this.message = this.errorMessages[e]);
9
+ }
10
+ toString() {
11
+ return this.message || "";
12
+ }
15
13
  };
14
+ //#endregion
15
+ export { e as BaseError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./baseErrors.cjs");exports.CALL_ERROR_MESSAGES=void 0;(function(r){r.NOT_VALID="Invalid call"})(exports.CALL_ERROR_MESSAGES||(exports.CALL_ERROR_MESSAGES={}));class o extends e.BaseError{constructor(E){super(E,exports.CALL_ERROR_MESSAGES),this.name="CallError"}}exports.CallError=o;
1
+ const e=require(`./baseErrors.cjs`);var t;(function(e){e.NOT_VALID=`Invalid call`})(t||={});var n=class extends e.BaseError{constructor(e){super(e,t),this.name=`CallError`}};exports.CallError=n;
@@ -1,14 +1,13 @@
1
- import { BaseError as l } from "./baseErrors.js";
2
- var r;
3
- (function(o) {
4
- o.NOT_VALID = "Invalid call";
5
- })(r || (r = {}));
6
- class t extends l {
7
- constructor(a) {
8
- super(a, r), this.name = "CallError";
9
- }
10
- }
11
- export {
12
- r as CALL_ERROR_MESSAGES,
13
- t as CallError
1
+ import { BaseError as e } from "./baseErrors.js";
2
+ //#region src/errors/call.ts
3
+ var t;
4
+ (function(e) {
5
+ e.NOT_VALID = "Invalid call";
6
+ })(t ||= {});
7
+ var n = class extends e {
8
+ constructor(e) {
9
+ super(e, t), this.name = "CallError";
10
+ }
14
11
  };
12
+ //#endregion
13
+ export { n as CallError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./baseErrors.cjs");exports.NETWORK_ERROR_MESSAGES=void 0;(function(r){r.NO_NETWORK_OR_MULTICALL="Missing networkId or multicall",r.NOT_FOUND="Network not found"})(exports.NETWORK_ERROR_MESSAGES||(exports.NETWORK_ERROR_MESSAGES={}));class t extends e.BaseError{constructor(o){super(o,exports.NETWORK_ERROR_MESSAGES),this.name="NetworkError"}}exports.NetworkError=t;
1
+ const e=require(`./baseErrors.cjs`);var t;(function(e){e.NO_NETWORK_OR_MULTICALL=`Missing networkId or multicall`,e.NOT_FOUND=`Network not found`})(t||={});var n=class extends e.BaseError{constructor(e){super(e,t),this.name=`NetworkError`}};exports.NetworkError=n;
@@ -1,14 +1,13 @@
1
1
  import { BaseError as e } from "./baseErrors.js";
2
- var o;
3
- (function(r) {
4
- r.NO_NETWORK_OR_MULTICALL = "Missing networkId or multicall", r.NOT_FOUND = "Network not found";
5
- })(o || (o = {}));
6
- class s extends e {
7
- constructor(t) {
8
- super(t, o), this.name = "NetworkError";
9
- }
10
- }
11
- export {
12
- o as NETWORK_ERROR_MESSAGES,
13
- s as NetworkError
2
+ //#region src/errors/network.ts
3
+ var t;
4
+ (function(e) {
5
+ e.NO_NETWORK_OR_MULTICALL = "Missing networkId or multicall", e.NOT_FOUND = "Network not found";
6
+ })(t ||= {});
7
+ var n = class extends e {
8
+ constructor(e) {
9
+ super(e, t), this.name = "NetworkError";
10
+ }
14
11
  };
12
+ //#endregion
13
+ export { n as NetworkError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./baseErrors.cjs");exports.REVIEW_ERROR_MESSAGE=void 0;(function(e){e.SIMULATE_AND_REVIEW_FAILED="Something went wrong fetching review",e.NO_CALLS_FOUND="No calls found",e.ONCHAIN_FEE_ESTIMATION_FAILED="Failed to estimate fees onchain"})(exports.REVIEW_ERROR_MESSAGE||(exports.REVIEW_ERROR_MESSAGE={}));class o extends E.BaseError{constructor(r){super(r,exports.REVIEW_ERROR_MESSAGE),this.name="ReviewError"}}exports.ReviewError=o;
1
+ const e=require(`./baseErrors.cjs`);var t;(function(e){e.SIMULATE_AND_REVIEW_FAILED=`Something went wrong fetching review`,e.NO_CALLS_FOUND=`No calls found`,e.ONCHAIN_FEE_ESTIMATION_FAILED=`Failed to estimate fees onchain`})(t||={});var n=class extends e.BaseError{constructor(e){super(e,t),this.name=`ReviewError`}};exports.ReviewError=n;
@@ -1,14 +1,13 @@
1
- import { BaseError as t } from "./baseErrors.js";
2
- var r;
1
+ import { BaseError as e } from "./baseErrors.js";
2
+ //#region src/errors/review.ts
3
+ var t;
3
4
  (function(e) {
4
- e.SIMULATE_AND_REVIEW_FAILED = "Something went wrong fetching review", e.NO_CALLS_FOUND = "No calls found", e.ONCHAIN_FEE_ESTIMATION_FAILED = "Failed to estimate fees onchain";
5
- })(r || (r = {}));
6
- class i extends t {
7
- constructor(o) {
8
- super(o, r), this.name = "ReviewError";
9
- }
10
- }
11
- export {
12
- r as REVIEW_ERROR_MESSAGE,
13
- i as ReviewError
5
+ e.SIMULATE_AND_REVIEW_FAILED = "Something went wrong fetching review", e.NO_CALLS_FOUND = "No calls found", e.ONCHAIN_FEE_ESTIMATION_FAILED = "Failed to estimate fees onchain";
6
+ })(t ||= {});
7
+ var n = class extends e {
8
+ constructor(e) {
9
+ super(e, t), this.name = "ReviewError";
10
+ }
14
11
  };
12
+ //#endregion
13
+ export { n as ReviewError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./baseErrors.cjs");exports.SWAP_ERROR_MESSAGE=void 0;(function(r){r.NO_SWAP_URL="Swap base url not provided",r.INVALID_QUOTE_RESPONSE="Invalid quote response",r.NO_NETWORK_FOR_SWAP="Network for swap not found",r.INVALID_SWAP_TOKENS="Invalid swap tokens",r.INVALID_SWAP_ORDER_RESPONSE="Invalid swap order response"})(exports.SWAP_ERROR_MESSAGE||(exports.SWAP_ERROR_MESSAGE={}));class s extends o.BaseError{constructor(e){super(e,exports.SWAP_ERROR_MESSAGE),this.name="SwapError"}}exports.SwapError=s;
1
+ const e=require(`./baseErrors.cjs`);var t;(function(e){e.NO_SWAP_URL=`Swap base url not provided`,e.INVALID_QUOTE_RESPONSE=`Invalid quote response`,e.NO_NETWORK_FOR_SWAP=`Network for swap not found`,e.INVALID_SWAP_TOKENS=`Invalid swap tokens`,e.INVALID_SWAP_ORDER_RESPONSE=`Invalid swap order response`})(t||={});var n=class extends e.BaseError{constructor(e){super(e,t),this.name=`SwapError`}};exports.SwapError=n;
@@ -1,14 +1,13 @@
1
- import { BaseError as s } from "./baseErrors.js";
2
- var o;
3
- (function(r) {
4
- r.NO_SWAP_URL = "Swap base url not provided", r.INVALID_QUOTE_RESPONSE = "Invalid quote response", r.NO_NETWORK_FOR_SWAP = "Network for swap not found", r.INVALID_SWAP_TOKENS = "Invalid swap tokens", r.INVALID_SWAP_ORDER_RESPONSE = "Invalid swap order response";
5
- })(o || (o = {}));
6
- class n extends s {
7
- constructor(e) {
8
- super(e, o), this.name = "SwapError";
9
- }
10
- }
11
- export {
12
- o as SWAP_ERROR_MESSAGE,
13
- n as SwapError
1
+ import { BaseError as e } from "./baseErrors.js";
2
+ //#region src/errors/swap.ts
3
+ var t;
4
+ (function(e) {
5
+ e.NO_SWAP_URL = "Swap base url not provided", e.INVALID_QUOTE_RESPONSE = "Invalid quote response", e.NO_NETWORK_FOR_SWAP = "Network for swap not found", e.INVALID_SWAP_TOKENS = "Invalid swap tokens", e.INVALID_SWAP_ORDER_RESPONSE = "Invalid swap order response";
6
+ })(t ||= {});
7
+ var n = class extends e {
8
+ constructor(e) {
9
+ super(e, t), this.name = "SwapError";
10
+ }
14
11
  };
12
+ //#endregion
13
+ export { n as SwapError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("starknet"),g=require("url-join"),w=require("./types.cjs"),v=require("../../chains/starknet/network.cjs"),m=require("../../utils/starknet/starknet.cjs"),c=require("../../utils/url/urlWithQuery.cjs");class k{constructor(e="",t){this.argentRelayerUrl=e,this.httpService=t}async buildRequestInit(e,t,n,a={}){const s=a.getAdditionalHeaders?await a.getAdditionalHeaders(e,t,n):{};return{body:n,headers:{"Content-Type":"application/json",...s}}}async getExecutionData(e,t={}){const{useAvnu:n,isSubsidised:a}=t,{networkId:s}=e,o=s?{network:v.getArgentNetwork(s)}:void 0,r=n?g(this.getAvnuUrl(s),"/build-typed-data"):c.urlWithQuery([this.argentRelayerUrl,"/build-typed-data"],o),d=n?e.calls.map(p=>({contractAddress:i.num.toHex(p.contractAddress),calldata:i.CallData.toCalldata(p.calldata).map(b=>i.num.toHex(b)),entrypoint:p.entrypoint})):e.calls,l=a?null:e.feeTokenAddress!==void 0?i.num.toHex(e.feeTokenAddress):void 0,y=a?null:e.maxFee!==void 0?i.num.toHex(e.maxFee):void 0,h={calls:d,userAddress:e.accountAddress,gasTokenAddress:l,maxGasTokenAmount:y,accountClassHash:e.accountClassHash},u=i.json.stringify(h),A=await this.buildRequestInit(r,"POST",u,t),S=await this.httpService.post(r,A),f=m.typedDataSchema.safeParse(S);if(!f.success)throw new Error("Invalid response from paymaster");return f.data}getAvnuUrl(e){if(!e)throw new Error("Network id is required for Avnu paymaster");let t="";if(e==="mainnet"||e==="mainnet-alpha")t="starknet";else if(e==="sepolia"||e==="sepolia-alpha")t="sepolia";else throw new Error("Invalid network id");return`https://${t}.api.avnu.fi/paymaster/v1`}async execute(e,t={}){const{useAvnu:n,isSubsidised:a}=t,{networkId:s}=e,o=s?{network:v.getArgentNetwork(s)}:void 0;let r=n?g(this.getAvnuUrl(s),"/execute"):c.urlWithQuery([this.argentRelayerUrl,"/execute"],o);a&&(r=c.urlWithQuery(r,{isSubsidised:"true"}));const d={signature:e.signature,userAddress:e.accountAddress,typedData:n?i.json.stringify(e.typedData):e.typedData,deploymentData:e.deploymentData},l=i.json.stringify(d),y=await this.buildRequestInit(r,"POST",l,t),h=await this.httpService.post(r,y),u=w.paymasterExecuteResponse.safeParse(h);if(!u.success)throw new Error("Invalid response from paymaster");return u.data.transactionHash}async deployAccount(e,t={}){const{useAvnu:n,isSubsidised:a}=t,{networkId:s}=e,o=s?{network:v.getArgentNetwork(s)}:void 0;let r=n?g(this.getAvnuUrl(s),"/execute"):c.urlWithQuery([this.argentRelayerUrl,"/execute"],o);a&&(r=c.urlWithQuery(r,{isSubsidised:"true"}));const d={userAddress:e.accountAddress,deploymentData:e.deploymentData},l=i.json.stringify(d),y=await this.buildRequestInit(r,"POST",l,t),h=await this.httpService.post(r,y),u=w.paymasterExecuteResponse.safeParse(h);if(!u.success)throw new Error("Invalid response from paymaster");return u.data.transactionHash}async canUserSubsidise(e,t={}){const n=c.urlWithQuery([this.argentRelayerUrl,"/can-user-subsidise"]),a=i.json.stringify(e),s=await this.buildRequestInit(n,"POST",a,t),o=await this.httpService.post(n,s),r=w.canSubsidiseResponse.safeParse(o);if(!r.success)throw new Error("Invalid response from paymaster");return r.data.canSubsidise}}exports.PaymasterService=k;
1
+ const e=require(`../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils/starknet/starknet.cjs`),n=require(`../../chains/starknet/network.cjs`),r=require(`../../utils/url/urlWithQuery.cjs`),i=require(`./types.cjs`);let a=require(`starknet`),o=require(`url-join`);o=e.__toESM(o);var s=class{constructor(e=``,t){this.argentRelayerUrl=e,this.httpService=t}async buildRequestInit(e,t,n,r={}){let i=r.getAdditionalHeaders?await r.getAdditionalHeaders(e,t,n):{};return{body:n,headers:{"Content-Type":`application/json`,...i}}}async getExecutionData(e,i={}){let{useAvnu:s,isSubsidised:c}=i,{networkId:l}=e,u=l?{network:n.getArgentNetwork(l)}:void 0,d=s?(0,o.default)(this.getAvnuUrl(l),`/build-typed-data`):r.urlWithQuery([this.argentRelayerUrl,`/build-typed-data`],u),f=s?e.calls.map(e=>({contractAddress:a.num.toHex(e.contractAddress),calldata:a.CallData.toCalldata(e.calldata).map(e=>a.num.toHex(e)),entrypoint:e.entrypoint})):e.calls,p=c?null:e.feeTokenAddress===void 0?void 0:a.num.toHex(e.feeTokenAddress),m=c?null:e.maxFee===void 0?void 0:a.num.toHex(e.maxFee),h={calls:f,userAddress:e.accountAddress,gasTokenAddress:p,maxGasTokenAmount:m,accountClassHash:e.accountClassHash},g=a.json.stringify(h),_=await this.buildRequestInit(d,`POST`,g,i),v=await this.httpService.post(d,_),y=t.typedDataSchema.safeParse(v);if(!y.success)throw Error(`Invalid response from paymaster`);return y.data}getAvnuUrl(e){if(!e)throw Error(`Network id is required for Avnu paymaster`);let t=``;if(e===`mainnet`||e===`mainnet-alpha`)t=`starknet`;else if(e===`sepolia`||e===`sepolia-alpha`)t=`sepolia`;else throw Error(`Invalid network id`);return`https://${t}.api.avnu.fi/paymaster/v1`}async execute(e,t={}){let{useAvnu:s,isSubsidised:c}=t,{networkId:l}=e,u=l?{network:n.getArgentNetwork(l)}:void 0,d=s?(0,o.default)(this.getAvnuUrl(l),`/execute`):r.urlWithQuery([this.argentRelayerUrl,`/execute`],u);c&&(d=r.urlWithQuery(d,{isSubsidised:`true`}));let f={signature:e.signature,userAddress:e.accountAddress,typedData:s?a.json.stringify(e.typedData):e.typedData,deploymentData:e.deploymentData},p=a.json.stringify(f),m=await this.buildRequestInit(d,`POST`,p,t),h=await this.httpService.post(d,m),g=i.paymasterExecuteResponse.safeParse(h);if(!g.success)throw Error(`Invalid response from paymaster`);return g.data.transactionHash}async deployAccount(e,t={}){let{useAvnu:s,isSubsidised:c}=t,{networkId:l}=e,u=l?{network:n.getArgentNetwork(l)}:void 0,d=s?(0,o.default)(this.getAvnuUrl(l),`/execute`):r.urlWithQuery([this.argentRelayerUrl,`/execute`],u);c&&(d=r.urlWithQuery(d,{isSubsidised:`true`}));let f={userAddress:e.accountAddress,deploymentData:e.deploymentData},p=a.json.stringify(f),m=await this.buildRequestInit(d,`POST`,p,t),h=await this.httpService.post(d,m),g=i.paymasterExecuteResponse.safeParse(h);if(!g.success)throw Error(`Invalid response from paymaster`);return g.data.transactionHash}async canUserSubsidise(e,t={}){let n=r.urlWithQuery([this.argentRelayerUrl,`/can-user-subsidise`]),o=a.json.stringify(e),s=await this.buildRequestInit(n,`POST`,o,t),c=await this.httpService.post(n,s),l=i.canSubsidiseResponse.safeParse(c);if(!l.success)throw Error(`Invalid response from paymaster`);return l.data.canSubsidise}};exports.PaymasterService=s;
@@ -1,88 +1,74 @@
1
- import { CallData as x, num as h, json as y } from "starknet";
2
- import w from "url-join";
3
- import { paymasterExecuteResponse as m, canSubsidiseResponse as R } from "./types.js";
4
- import { getArgentNetwork as v } from "../../chains/starknet/network.js";
5
- import { typedDataSchema as k } from "../../utils/starknet/starknet.js";
6
- import { urlWithQuery as d } from "../../utils/url/urlWithQuery.js";
7
- class E {
8
- constructor(e = "", t) {
9
- this.argentRelayerUrl = e, this.httpService = t;
10
- }
11
- async buildRequestInit(e, t, n, a = {}) {
12
- const s = a.getAdditionalHeaders ? await a.getAdditionalHeaders(e, t, n) : {};
13
- return {
14
- body: n,
15
- headers: {
16
- "Content-Type": "application/json",
17
- ...s
18
- }
19
- };
20
- }
21
- async getExecutionData(e, t = {}) {
22
- const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: v(s) } : void 0, r = n ? w(this.getAvnuUrl(s), "/build-typed-data") : d([this.argentRelayerUrl, "/build-typed-data"], i), c = n ? e.calls.map((f) => ({
23
- contractAddress: h.toHex(f.contractAddress),
24
- calldata: x.toCalldata(f.calldata).map((b) => h.toHex(b)),
25
- entrypoint: f.entrypoint
26
- })) : e.calls, u = a ? null : e.feeTokenAddress !== void 0 ? h.toHex(e.feeTokenAddress) : void 0, l = a ? null : e.maxFee !== void 0 ? h.toHex(e.maxFee) : void 0, p = {
27
- calls: c,
28
- userAddress: e.accountAddress,
29
- gasTokenAddress: u,
30
- maxGasTokenAmount: l,
31
- accountClassHash: e.accountClassHash
32
- }, o = y.stringify(p), A = await this.buildRequestInit(r, "POST", o, t), S = await this.httpService.post(r, A), g = k.safeParse(S);
33
- if (!g.success)
34
- throw new Error("Invalid response from paymaster");
35
- return g.data;
36
- }
37
- getAvnuUrl(e) {
38
- if (!e)
39
- throw new Error("Network id is required for Avnu paymaster");
40
- let t = "";
41
- if (e === "mainnet" || e === "mainnet-alpha")
42
- t = "starknet";
43
- else if (e === "sepolia" || e === "sepolia-alpha")
44
- t = "sepolia";
45
- else
46
- throw new Error("Invalid network id");
47
- return `https://${t}.api.avnu.fi/paymaster/v1`;
48
- }
49
- async execute(e, t = {}) {
50
- const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: v(s) } : void 0;
51
- let r = n ? w(this.getAvnuUrl(s), "/execute") : d([this.argentRelayerUrl, "/execute"], i);
52
- a && (r = d(r, {
53
- isSubsidised: "true"
54
- }));
55
- const c = {
56
- signature: e.signature,
57
- userAddress: e.accountAddress,
58
- typedData: n ? y.stringify(e.typedData) : e.typedData,
59
- deploymentData: e.deploymentData
60
- }, u = y.stringify(c), l = await this.buildRequestInit(r, "POST", u, t), p = await this.httpService.post(r, l), o = m.safeParse(p);
61
- if (!o.success)
62
- throw new Error("Invalid response from paymaster");
63
- return o.data.transactionHash;
64
- }
65
- async deployAccount(e, t = {}) {
66
- const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: v(s) } : void 0;
67
- let r = n ? w(this.getAvnuUrl(s), "/execute") : d([this.argentRelayerUrl, "/execute"], i);
68
- a && (r = d(r, {
69
- isSubsidised: "true"
70
- }));
71
- const c = {
72
- userAddress: e.accountAddress,
73
- deploymentData: e.deploymentData
74
- }, u = y.stringify(c), l = await this.buildRequestInit(r, "POST", u, t), p = await this.httpService.post(r, l), o = m.safeParse(p);
75
- if (!o.success)
76
- throw new Error("Invalid response from paymaster");
77
- return o.data.transactionHash;
78
- }
79
- async canUserSubsidise(e, t = {}) {
80
- const n = d([this.argentRelayerUrl, "/can-user-subsidise"]), a = y.stringify(e), s = await this.buildRequestInit(n, "POST", a, t), i = await this.httpService.post(n, s), r = R.safeParse(i);
81
- if (!r.success)
82
- throw new Error("Invalid response from paymaster");
83
- return r.data.canSubsidise;
84
- }
85
- }
86
- export {
87
- E as PaymasterService
1
+ import { typedDataSchema as e } from "../../utils/starknet/starknet.js";
2
+ import { getArgentNetwork as t } from "../../chains/starknet/network.js";
3
+ import { urlWithQuery as n } from "../../utils/url/urlWithQuery.js";
4
+ import { canSubsidiseResponse as r, paymasterExecuteResponse as i } from "./types.js";
5
+ import { CallData as a, json as o, num as s } from "starknet";
6
+ import c from "url-join";
7
+ //#region src/features/paymaster/PaymasterService.ts
8
+ var l = class {
9
+ constructor(e = "", t) {
10
+ this.argentRelayerUrl = e, this.httpService = t;
11
+ }
12
+ async buildRequestInit(e, t, n, r = {}) {
13
+ let i = r.getAdditionalHeaders ? await r.getAdditionalHeaders(e, t, n) : {};
14
+ return {
15
+ body: n,
16
+ headers: {
17
+ "Content-Type": "application/json",
18
+ ...i
19
+ }
20
+ };
21
+ }
22
+ async getExecutionData(r, i = {}) {
23
+ let { useAvnu: l, isSubsidised: u } = i, { networkId: d } = r, f = d ? { network: t(d) } : void 0, p = l ? c(this.getAvnuUrl(d), "/build-typed-data") : n([this.argentRelayerUrl, "/build-typed-data"], f), m = l ? r.calls.map((e) => ({
24
+ contractAddress: s.toHex(e.contractAddress),
25
+ calldata: a.toCalldata(e.calldata).map((e) => s.toHex(e)),
26
+ entrypoint: e.entrypoint
27
+ })) : r.calls, h = u ? null : r.feeTokenAddress === void 0 ? void 0 : s.toHex(r.feeTokenAddress), g = u ? null : r.maxFee === void 0 ? void 0 : s.toHex(r.maxFee), _ = {
28
+ calls: m,
29
+ userAddress: r.accountAddress,
30
+ gasTokenAddress: h,
31
+ maxGasTokenAmount: g,
32
+ accountClassHash: r.accountClassHash
33
+ }, v = o.stringify(_), y = await this.buildRequestInit(p, "POST", v, i), b = await this.httpService.post(p, y), x = e.safeParse(b);
34
+ if (!x.success) throw Error("Invalid response from paymaster");
35
+ return x.data;
36
+ }
37
+ getAvnuUrl(e) {
38
+ if (!e) throw Error("Network id is required for Avnu paymaster");
39
+ let t = "";
40
+ if (e === "mainnet" || e === "mainnet-alpha") t = "starknet";
41
+ else if (e === "sepolia" || e === "sepolia-alpha") t = "sepolia";
42
+ else throw Error("Invalid network id");
43
+ return `https://${t}.api.avnu.fi/paymaster/v1`;
44
+ }
45
+ async execute(e, r = {}) {
46
+ let { useAvnu: a, isSubsidised: s } = r, { networkId: l } = e, u = l ? { network: t(l) } : void 0, d = a ? c(this.getAvnuUrl(l), "/execute") : n([this.argentRelayerUrl, "/execute"], u);
47
+ s && (d = n(d, { isSubsidised: "true" }));
48
+ let f = {
49
+ signature: e.signature,
50
+ userAddress: e.accountAddress,
51
+ typedData: a ? o.stringify(e.typedData) : e.typedData,
52
+ deploymentData: e.deploymentData
53
+ }, p = o.stringify(f), m = await this.buildRequestInit(d, "POST", p, r), h = await this.httpService.post(d, m), g = i.safeParse(h);
54
+ if (!g.success) throw Error("Invalid response from paymaster");
55
+ return g.data.transactionHash;
56
+ }
57
+ async deployAccount(e, r = {}) {
58
+ let { useAvnu: a, isSubsidised: s } = r, { networkId: l } = e, u = l ? { network: t(l) } : void 0, d = a ? c(this.getAvnuUrl(l), "/execute") : n([this.argentRelayerUrl, "/execute"], u);
59
+ s && (d = n(d, { isSubsidised: "true" }));
60
+ let f = {
61
+ userAddress: e.accountAddress,
62
+ deploymentData: e.deploymentData
63
+ }, p = o.stringify(f), m = await this.buildRequestInit(d, "POST", p, r), h = await this.httpService.post(d, m), g = i.safeParse(h);
64
+ if (!g.success) throw Error("Invalid response from paymaster");
65
+ return g.data.transactionHash;
66
+ }
67
+ async canUserSubsidise(e, t = {}) {
68
+ let i = n([this.argentRelayerUrl, "/can-user-subsidise"]), a = o.stringify(e), s = await this.buildRequestInit(i, "POST", a, t), c = await this.httpService.post(i, s), l = r.safeParse(c);
69
+ if (!l.success) throw Error("Invalid response from paymaster");
70
+ return l.data.canSubsidise;
71
+ }
88
72
  };
73
+ //#endregion
74
+ export { l as PaymasterService };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),t=require("../../chains/starknet/address.cjs"),s=require("../../utils/starknet/starknet.cjs"),e=require("../../backend/schema.cjs"),o=a.z.object({calls:a.z.array(s.callSchema),accountAddress:t.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),feeTokenAddress:t.addressSchema.optional(),maxFee:s.bigNumberishSchema.optional(),accountClassHash:a.z.string().optional()}),n=a.z.object({signature:a.z.string().array(),accountAddress:t.addressSchema,typedData:s.typedDataSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),deploymentData:a.z.object({class_hash:a.z.string().optional(),salt:a.z.string().or(a.z.number()).or(a.z.bigint()).optional(),unique:a.z.string(),calldata:a.z.array(a.z.string())}).optional()}),c=a.z.object({transactionHash:a.z.string()}),r=a.z.object({contractAddress:a.z.string(),entrypoint:a.z.string(),calldata:a.z.array(a.z.string()).optional()}),i=a.z.object({accountAddress:t.addressSchema,calls:a.z.array(r)}),d=a.z.object({canSubsidise:a.z.boolean()}),l=a.z.object({accountAddress:t.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),deploymentData:a.z.object({class_hash:a.z.string().optional(),salt:a.z.string().or(a.z.number()).or(a.z.bigint()).optional(),unique:a.z.string(),calldata:a.z.array(a.z.string())}).optional()});exports.canSubsidiseResponse=d;exports.canUserSubsidiseParams=i;exports.paymasterDeployAccountParams=l;exports.paymasterExecuteParams=n;exports.paymasterExecuteResponse=c;exports.paymasterExecutionDataParams=o;exports.subsidyCallSchema=r;
1
+ require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../backend/schema.cjs`),t=require(`../../chains/starknet/address.cjs`),n=require(`../../utils/starknet/starknet.cjs`);let r=require(`zod`);var i=r.z.object({calls:r.z.array(n.callSchema),accountAddress:t.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),feeTokenAddress:t.addressSchema.optional(),maxFee:n.bigNumberishSchema.optional(),accountClassHash:r.z.string().optional()}),a=r.z.object({signature:r.z.string().array(),accountAddress:t.addressSchema,typedData:n.typedDataSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),deploymentData:r.z.object({class_hash:r.z.string().optional(),salt:r.z.string().or(r.z.number()).or(r.z.bigint()).optional(),unique:r.z.string(),calldata:r.z.array(r.z.string())}).optional()}),o=r.z.object({transactionHash:r.z.string()}),s=r.z.object({contractAddress:r.z.string(),entrypoint:r.z.string(),calldata:r.z.array(r.z.string()).optional()}),c=r.z.object({accountAddress:t.addressSchema,calls:r.z.array(s)}),l=r.z.object({canSubsidise:r.z.boolean()}),u=r.z.object({accountAddress:t.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),deploymentData:r.z.object({class_hash:r.z.string().optional(),salt:r.z.string().or(r.z.number()).or(r.z.bigint()).optional(),unique:r.z.string(),calldata:r.z.array(r.z.string())}).optional()});exports.canSubsidiseResponse=l,exports.canUserSubsidiseParams=c,exports.paymasterDeployAccountParams=u,exports.paymasterExecuteParams=a,exports.paymasterExecuteResponse=o,exports.paymasterExecutionDataParams=i,exports.subsidyCallSchema=s;
@@ -1,52 +1,42 @@
1
- import { z as a } from "zod";
2
- import { addressSchema as t } from "../../chains/starknet/address.js";
3
- import { bigNumberishSchema as r, callSchema as e, typedDataSchema as n } from "../../utils/starknet/starknet.js";
4
- import { argentNetworkIdSchema as o, argentBackendNetworkIdSchema as s } from "../../backend/schema.js";
5
- const m = a.object({
6
- calls: a.array(e),
7
- accountAddress: t,
8
- networkId: o.or(s).optional(),
9
- feeTokenAddress: t.optional(),
10
- maxFee: r.optional(),
11
- accountClassHash: a.string().optional()
12
- }), u = a.object({
13
- signature: a.string().array(),
14
- accountAddress: t,
15
- typedData: n,
16
- networkId: o.or(s).optional(),
17
- deploymentData: a.object({
18
- class_hash: a.string().optional(),
19
- salt: a.string().or(a.number()).or(a.bigint()).optional(),
20
- unique: a.string(),
21
- calldata: a.array(a.string())
22
- }).optional()
23
- }), b = a.object({
24
- transactionHash: a.string()
25
- }), c = a.object({
26
- contractAddress: a.string(),
27
- entrypoint: a.string(),
28
- calldata: a.array(a.string()).optional()
29
- }), g = a.object({
30
- accountAddress: t,
31
- calls: a.array(c)
32
- }), y = a.object({
33
- canSubsidise: a.boolean()
34
- }), h = a.object({
35
- accountAddress: t,
36
- networkId: o.or(s).optional(),
37
- deploymentData: a.object({
38
- class_hash: a.string().optional(),
39
- salt: a.string().or(a.number()).or(a.bigint()).optional(),
40
- unique: a.string(),
41
- calldata: a.array(a.string())
42
- }).optional()
1
+ import { argentBackendNetworkIdSchema as e, argentNetworkIdSchema as t } from "../../backend/schema.js";
2
+ import { addressSchema as n } from "../../chains/starknet/address.js";
3
+ import { bigNumberishSchema as r, callSchema as i, typedDataSchema as a } from "../../utils/starknet/starknet.js";
4
+ import { z as o } from "zod";
5
+ //#region src/features/paymaster/types.ts
6
+ var s = o.object({
7
+ calls: o.array(i),
8
+ accountAddress: n,
9
+ networkId: t.or(e).optional(),
10
+ feeTokenAddress: n.optional(),
11
+ maxFee: r.optional(),
12
+ accountClassHash: o.string().optional()
13
+ }), c = o.object({
14
+ signature: o.string().array(),
15
+ accountAddress: n,
16
+ typedData: a,
17
+ networkId: t.or(e).optional(),
18
+ deploymentData: o.object({
19
+ class_hash: o.string().optional(),
20
+ salt: o.string().or(o.number()).or(o.bigint()).optional(),
21
+ unique: o.string(),
22
+ calldata: o.array(o.string())
23
+ }).optional()
24
+ }), l = o.object({ transactionHash: o.string() }), u = o.object({
25
+ contractAddress: o.string(),
26
+ entrypoint: o.string(),
27
+ calldata: o.array(o.string()).optional()
28
+ }), d = o.object({
29
+ accountAddress: n,
30
+ calls: o.array(u)
31
+ }), f = o.object({ canSubsidise: o.boolean() }), p = o.object({
32
+ accountAddress: n,
33
+ networkId: t.or(e).optional(),
34
+ deploymentData: o.object({
35
+ class_hash: o.string().optional(),
36
+ salt: o.string().or(o.number()).or(o.bigint()).optional(),
37
+ unique: o.string(),
38
+ calldata: o.array(o.string())
39
+ }).optional()
43
40
  });
44
- export {
45
- y as canSubsidiseResponse,
46
- g as canUserSubsidiseParams,
47
- h as paymasterDeployAccountParams,
48
- u as paymasterExecuteParams,
49
- b as paymasterExecuteResponse,
50
- m as paymasterExecutionDataParams,
51
- c as subsidyCallSchema
52
- };
41
+ //#endregion
42
+ export { f as canSubsidiseResponse, d as canUserSubsidiseParams, p as paymasterDeployAccountParams, c as paymasterExecuteParams, l as paymasterExecuteResponse, s as paymasterExecutionDataParams, u as subsidyCallSchema };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./schema.cjs"),c=e=>e.map(o),o=e=>{if(t.isActivitySummary(e))return t.activitySummarySchema.parse(e);const n=!!e.sent;if(e.token.type!=="ERC20"){const a={asset:{type:"nft",tokenAddress:e.token.address,tokenId:e.tokenId?parseInt(e.tokenId):0,amount:e.value,collectionName:e.token.name,collectionPreviewImage:e.token.imageUrls?.preview,nftName:e.tokenIdDetails?.name,nftPreviewImage:e.tokenIdDetails?.imageUrls?.preview},sent:n};return t.activitySummarySchema.parse(a)}const i={asset:{type:"token",tokenAddress:e.token.address,amount:e.value,fiatAmount:{currency:e.currency||"USD",currencyAmount:e.ccyValue||"0"}},sent:n};return t.activitySummarySchema.parse(i)};exports.normalizeActivitySummary=o;exports.normalizeActivitySummaryCollection=c;
1
+ const e=require(`./schema.cjs`);var t=e=>e.map(n),n=t=>{if(e.isActivitySummary(t))return e.activitySummarySchema.parse(t);let n=!!t.sent;if(t.token.type!==`ERC20`){let r={asset:{type:`nft`,tokenAddress:t.token.address,tokenId:t.tokenId?parseInt(t.tokenId):0,amount:t.value,collectionName:t.token.name,collectionPreviewImage:t.token.imageUrls?.preview,nftName:t.tokenIdDetails?.name,nftPreviewImage:t.tokenIdDetails?.imageUrls?.preview},sent:n};return e.activitySummarySchema.parse(r)}let r={asset:{type:`token`,tokenAddress:t.token.address,amount:t.value,fiatAmount:{currency:t.currency||`USD`,currencyAmount:t.ccyValue||`0`}},sent:n};return e.activitySummarySchema.parse(r)};exports.normalizeActivitySummary=n,exports.normalizeActivitySummaryCollection=t;