@otim/utils 0.0.5 → 0.0.7

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 (467) hide show
  1. package/dist/api/index.d.mts +1910 -7
  2. package/dist/api/index.d.mts.map +1 -0
  3. package/dist/api/index.d.ts +1909 -6
  4. package/dist/api/index.d.ts.map +1 -1
  5. package/dist/api/index.js +1530 -1996
  6. package/dist/api/index.js.map +1 -7
  7. package/dist/api/index.mjs +1407 -1964
  8. package/dist/api/index.mjs.map +1 -7
  9. package/dist/api-urls-B-GTEiT3.d.mts +49 -0
  10. package/dist/api-urls-B-GTEiT3.d.mts.map +1 -0
  11. package/dist/api-urls-Cd20DG4i.js +171 -0
  12. package/dist/api-urls-Cd20DG4i.js.map +1 -0
  13. package/dist/api-urls-DJcIKBCy.mjs +135 -0
  14. package/dist/api-urls-DJcIKBCy.mjs.map +1 -0
  15. package/dist/api-urls-SKeIQMoZ.d.ts +49 -0
  16. package/dist/api-urls-SKeIQMoZ.d.ts.map +1 -0
  17. package/dist/chains/index.d.mts +13568 -16
  18. package/dist/chains/index.d.mts.map +1 -0
  19. package/dist/chains/index.d.ts +13567 -15
  20. package/dist/chains/index.d.ts.map +1 -1
  21. package/dist/chains/index.js +3615 -424
  22. package/dist/chains/index.js.map +1 -7
  23. package/dist/chains/index.mjs +3561 -440
  24. package/dist/chains/index.mjs.map +1 -7
  25. package/dist/chunk-kSYXY2_d.js +34 -0
  26. package/dist/client-factory-7xUSPC9I.mjs +42 -0
  27. package/dist/client-factory-7xUSPC9I.mjs.map +1 -0
  28. package/dist/client-factory-C3A4RPdj.d.ts +22 -0
  29. package/dist/client-factory-C3A4RPdj.d.ts.map +1 -0
  30. package/dist/client-factory-CTI_Nt35.js +49 -0
  31. package/dist/client-factory-CTI_Nt35.js.map +1 -0
  32. package/dist/client-factory-DOL0ZTWy.d.mts +22 -0
  33. package/dist/client-factory-DOL0ZTWy.d.mts.map +1 -0
  34. package/dist/constants.d.mts +14 -24
  35. package/dist/constants.d.mts.map +1 -0
  36. package/dist/constants.d.ts +13 -23
  37. package/dist/constants.d.ts.map +1 -1
  38. package/dist/constants.js +31 -46
  39. package/dist/constants.js.map +1 -7
  40. package/dist/constants.mjs +22 -26
  41. package/dist/constants.mjs.map +1 -7
  42. package/dist/date-CFzrYcjE.js +536 -0
  43. package/dist/date-CFzrYcjE.js.map +1 -0
  44. package/dist/date-gBac-Om9.mjs +313 -0
  45. package/dist/date-gBac-Om9.mjs.map +1 -0
  46. package/dist/defineProperty-DbMdhrDE.js +49 -0
  47. package/dist/defineProperty-DzhmunJg.mjs +43 -0
  48. package/dist/formatters/index.d.mts +1 -2
  49. package/dist/formatters/index.d.ts +1 -2
  50. package/dist/formatters/index.js +0 -19
  51. package/dist/formatters/index.mjs +1 -1
  52. package/dist/helpers/index.d.mts +562 -19
  53. package/dist/helpers/index.d.mts.map +1 -0
  54. package/dist/helpers/index.d.ts +561 -18
  55. package/dist/helpers/index.d.ts.map +1 -1
  56. package/dist/helpers/index.js +106 -1344
  57. package/dist/helpers/index.mjs +3 -1315
  58. package/dist/helpers-BNiSxjGq.mjs +895 -0
  59. package/dist/helpers-BNiSxjGq.mjs.map +1 -0
  60. package/dist/helpers-DoC7Xl12.js +1291 -0
  61. package/dist/helpers-DoC7Xl12.js.map +1 -0
  62. package/dist/index-BuJcJPoZ.d.ts +540 -0
  63. package/dist/index-BuJcJPoZ.d.ts.map +1 -0
  64. package/dist/index-DB0QdfAG.d.mts +540 -0
  65. package/dist/index-DB0QdfAG.d.mts.map +1 -0
  66. package/dist/index.d.mts +1 -1
  67. package/dist/index.d.ts +1 -1
  68. package/dist/index.js +0 -2
  69. package/dist/index.mjs +1 -1
  70. package/dist/instructions/index.d.mts +687 -6
  71. package/dist/instructions/index.d.mts.map +1 -0
  72. package/dist/instructions/index.d.ts +686 -5
  73. package/dist/instructions/index.d.ts.map +1 -1
  74. package/dist/instructions/index.js +1912 -1091
  75. package/dist/instructions/index.js.map +1 -7
  76. package/dist/instructions/index.mjs +1887 -1058
  77. package/dist/instructions/index.mjs.map +1 -7
  78. package/dist/payments/index.d.mts +322 -16
  79. package/dist/payments/index.d.mts.map +1 -0
  80. package/dist/payments/index.d.ts +321 -15
  81. package/dist/payments/index.d.ts.map +1 -1
  82. package/dist/payments/index.js +616 -1258
  83. package/dist/payments/index.js.map +1 -7
  84. package/dist/payments/index.mjs +594 -1236
  85. package/dist/payments/index.mjs.map +1 -7
  86. package/dist/schemas/index.d.mts +2 -10
  87. package/dist/schemas/index.d.ts +2 -10
  88. package/dist/schemas/index.js +350 -393
  89. package/dist/schemas/index.js.map +1 -7
  90. package/dist/schemas/index.mjs +283 -371
  91. package/dist/schemas/index.mjs.map +1 -7
  92. package/dist/server/index.d.mts +354 -3
  93. package/dist/server/index.d.mts.map +1 -0
  94. package/dist/server/index.d.ts +353 -2
  95. package/dist/server/index.d.ts.map +1 -1
  96. package/dist/server/index.js +248 -435
  97. package/dist/server/index.js.map +1 -7
  98. package/dist/server/index.mjs +199 -404
  99. package/dist/server/index.mjs.map +1 -7
  100. package/dist/server/react.d.mts +16 -0
  101. package/dist/server/react.d.mts.map +1 -0
  102. package/dist/server/react.d.ts +16 -0
  103. package/dist/server/react.d.ts.map +1 -0
  104. package/dist/server/react.js +30 -0
  105. package/dist/server/react.js.map +1 -0
  106. package/dist/server/react.mjs +28 -0
  107. package/dist/server/react.mjs.map +1 -0
  108. package/dist/wallet/wagmi/index.d.mts +23 -2
  109. package/dist/wallet/wagmi/index.d.mts.map +1 -0
  110. package/dist/wallet/wagmi/index.d.ts +22 -1
  111. package/dist/wallet/wagmi/index.d.ts.map +1 -1
  112. package/dist/wallet/wagmi/index.js +86 -417
  113. package/dist/wallet/wagmi/index.js.map +1 -7
  114. package/dist/wallet/wagmi/index.mjs +82 -418
  115. package/dist/wallet/wagmi/index.mjs.map +1 -7
  116. package/package.json +38 -27
  117. package/dist/api/api.d.mts +0 -18
  118. package/dist/api/api.d.ts +0 -18
  119. package/dist/api/api.d.ts.map +0 -1
  120. package/dist/api/core/error.d.mts +0 -74
  121. package/dist/api/core/error.d.ts +0 -74
  122. package/dist/api/core/error.d.ts.map +0 -1
  123. package/dist/api/core/index.d.mts +0 -4
  124. package/dist/api/core/index.d.ts +0 -4
  125. package/dist/api/core/index.d.ts.map +0 -1
  126. package/dist/api/core/instance.d.mts +0 -13
  127. package/dist/api/core/instance.d.ts +0 -13
  128. package/dist/api/core/instance.d.ts.map +0 -1
  129. package/dist/api/core/service.d.mts +0 -51
  130. package/dist/api/core/service.d.ts +0 -51
  131. package/dist/api/core/service.d.ts.map +0 -1
  132. package/dist/api/schemas/account.d.mts +0 -44
  133. package/dist/api/schemas/account.d.ts +0 -44
  134. package/dist/api/schemas/account.d.ts.map +0 -1
  135. package/dist/api/schemas/activity.d.mts +0 -277
  136. package/dist/api/schemas/activity.d.ts +0 -277
  137. package/dist/api/schemas/activity.d.ts.map +0 -1
  138. package/dist/api/schemas/auth.d.mts +0 -127
  139. package/dist/api/schemas/auth.d.ts +0 -127
  140. package/dist/api/schemas/auth.d.ts.map +0 -1
  141. package/dist/api/schemas/chain.d.mts +0 -15
  142. package/dist/api/schemas/chain.d.ts +0 -15
  143. package/dist/api/schemas/chain.d.ts.map +0 -1
  144. package/dist/api/schemas/config.d.mts +0 -33
  145. package/dist/api/schemas/config.d.ts +0 -33
  146. package/dist/api/schemas/config.d.ts.map +0 -1
  147. package/dist/api/schemas/contacts.d.mts +0 -27
  148. package/dist/api/schemas/contacts.d.ts +0 -27
  149. package/dist/api/schemas/contacts.d.ts.map +0 -1
  150. package/dist/api/schemas/index.d.mts +0 -12
  151. package/dist/api/schemas/index.d.ts +0 -12
  152. package/dist/api/schemas/index.d.ts.map +0 -1
  153. package/dist/api/schemas/instruction.d.mts +0 -446
  154. package/dist/api/schemas/instruction.d.ts +0 -446
  155. package/dist/api/schemas/instruction.d.ts.map +0 -1
  156. package/dist/api/schemas/integration.d.mts +0 -166
  157. package/dist/api/schemas/integration.d.ts +0 -166
  158. package/dist/api/schemas/integration.d.ts.map +0 -1
  159. package/dist/api/schemas/operating-account.d.mts +0 -11
  160. package/dist/api/schemas/operating-account.d.ts +0 -11
  161. package/dist/api/schemas/operating-account.d.ts.map +0 -1
  162. package/dist/api/schemas/payments.d.mts +0 -241
  163. package/dist/api/schemas/payments.d.ts +0 -241
  164. package/dist/api/schemas/payments.d.ts.map +0 -1
  165. package/dist/api/schemas/transaction.d.mts +0 -37
  166. package/dist/api/schemas/transaction.d.ts +0 -37
  167. package/dist/api/schemas/transaction.d.ts.map +0 -1
  168. package/dist/api/services/account.d.mts +0 -8
  169. package/dist/api/services/account.d.ts +0 -8
  170. package/dist/api/services/account.d.ts.map +0 -1
  171. package/dist/api/services/activity.d.mts +0 -7
  172. package/dist/api/services/activity.d.ts +0 -7
  173. package/dist/api/services/activity.d.ts.map +0 -1
  174. package/dist/api/services/auth.d.mts +0 -12
  175. package/dist/api/services/auth.d.ts +0 -12
  176. package/dist/api/services/auth.d.ts.map +0 -1
  177. package/dist/api/services/base.d.mts +0 -10
  178. package/dist/api/services/base.d.ts +0 -10
  179. package/dist/api/services/base.d.ts.map +0 -1
  180. package/dist/api/services/config.d.mts +0 -10
  181. package/dist/api/services/config.d.ts +0 -10
  182. package/dist/api/services/config.d.ts.map +0 -1
  183. package/dist/api/services/contacts.d.mts +0 -8
  184. package/dist/api/services/contacts.d.ts +0 -8
  185. package/dist/api/services/contacts.d.ts.map +0 -1
  186. package/dist/api/services/developer.d.mts +0 -6
  187. package/dist/api/services/developer.d.ts +0 -6
  188. package/dist/api/services/developer.d.ts.map +0 -1
  189. package/dist/api/services/index.d.mts +0 -13
  190. package/dist/api/services/index.d.ts +0 -13
  191. package/dist/api/services/index.d.ts.map +0 -1
  192. package/dist/api/services/instruction.d.mts +0 -12
  193. package/dist/api/services/instruction.d.ts +0 -12
  194. package/dist/api/services/instruction.d.ts.map +0 -1
  195. package/dist/api/services/integration.d.mts +0 -8
  196. package/dist/api/services/integration.d.ts +0 -8
  197. package/dist/api/services/integration.d.ts.map +0 -1
  198. package/dist/api/services/operating-account.d.mts +0 -8
  199. package/dist/api/services/operating-account.d.ts +0 -8
  200. package/dist/api/services/operating-account.d.ts.map +0 -1
  201. package/dist/api/services/payments.d.mts +0 -14
  202. package/dist/api/services/payments.d.ts +0 -14
  203. package/dist/api/services/payments.d.ts.map +0 -1
  204. package/dist/api/services/transaction.d.mts +0 -8
  205. package/dist/api/services/transaction.d.ts +0 -8
  206. package/dist/api/services/transaction.d.ts.map +0 -1
  207. package/dist/api/services/uniswap-token-list-service.d.mts +0 -66
  208. package/dist/api/services/uniswap-token-list-service.d.ts +0 -66
  209. package/dist/api/services/uniswap-token-list-service.d.ts.map +0 -1
  210. package/dist/api/utils/index.d.mts +0 -2
  211. package/dist/api/utils/index.d.ts +0 -2
  212. package/dist/api/utils/index.d.ts.map +0 -1
  213. package/dist/api/utils/pagination.d.mts +0 -32
  214. package/dist/api/utils/pagination.d.ts +0 -32
  215. package/dist/api/utils/pagination.d.ts.map +0 -1
  216. package/dist/chains/config/all-chains.d.mts +0 -4243
  217. package/dist/chains/config/all-chains.d.ts +0 -4243
  218. package/dist/chains/config/all-chains.d.ts.map +0 -1
  219. package/dist/chains/config/custom-chains.d.mts +0 -49
  220. package/dist/chains/config/custom-chains.d.ts +0 -49
  221. package/dist/chains/config/custom-chains.d.ts.map +0 -1
  222. package/dist/chains/config/mainnet-chains.d.mts +0 -1063
  223. package/dist/chains/config/mainnet-chains.d.ts +0 -1063
  224. package/dist/chains/config/mainnet-chains.d.ts.map +0 -1
  225. package/dist/chains/config/supported-chains.d.mts +0 -2172
  226. package/dist/chains/config/supported-chains.d.ts +0 -2172
  227. package/dist/chains/config/supported-chains.d.ts.map +0 -1
  228. package/dist/chains/config/testnet-chains.d.mts +0 -1110
  229. package/dist/chains/config/testnet-chains.d.ts +0 -1110
  230. package/dist/chains/config/testnet-chains.d.ts.map +0 -1
  231. package/dist/chains/lambda/chain-mapping.d.mts +0 -55
  232. package/dist/chains/lambda/chain-mapping.d.ts +0 -55
  233. package/dist/chains/lambda/chain-mapping.d.ts.map +0 -1
  234. package/dist/chains/lambda/index.d.mts +0 -2
  235. package/dist/chains/lambda/index.d.ts +0 -2
  236. package/dist/chains/lambda/index.d.ts.map +0 -1
  237. package/dist/chains/tokens/chain-tokens.d.mts +0 -6
  238. package/dist/chains/tokens/chain-tokens.d.ts +0 -6
  239. package/dist/chains/tokens/chain-tokens.d.ts.map +0 -1
  240. package/dist/chains/tokens/token-addresses.d.mts +0 -8
  241. package/dist/chains/tokens/token-addresses.d.ts +0 -8
  242. package/dist/chains/tokens/token-addresses.d.ts.map +0 -1
  243. package/dist/chains/tokens/token-metadata.d.mts +0 -5
  244. package/dist/chains/tokens/token-metadata.d.ts +0 -5
  245. package/dist/chains/tokens/token-metadata.d.ts.map +0 -1
  246. package/dist/chains/types.d.mts +0 -23
  247. package/dist/chains/types.d.ts +0 -23
  248. package/dist/chains/types.d.ts.map +0 -1
  249. package/dist/chains/utils/filter-tokens.d.mts +0 -3
  250. package/dist/chains/utils/filter-tokens.d.ts +0 -3
  251. package/dist/chains/utils/filter-tokens.d.ts.map +0 -1
  252. package/dist/chains/utils/stablecoin.d.mts +0 -7
  253. package/dist/chains/utils/stablecoin.d.ts +0 -7
  254. package/dist/chains/utils/stablecoin.d.ts.map +0 -1
  255. package/dist/chains/utils/token-maps.d.mts +0 -10
  256. package/dist/chains/utils/token-maps.d.ts +0 -10
  257. package/dist/chains/utils/token-maps.d.ts.map +0 -1
  258. package/dist/env.d.mts +0 -17
  259. package/dist/env.d.ts +0 -17
  260. package/dist/env.d.ts.map +0 -1
  261. package/dist/formatters/index.d.ts.map +0 -1
  262. package/dist/formatters/index.js.map +0 -7
  263. package/dist/formatters/index.mjs.map +0 -7
  264. package/dist/helpers/address.d.mts +0 -7
  265. package/dist/helpers/address.d.ts +0 -7
  266. package/dist/helpers/address.d.ts.map +0 -1
  267. package/dist/helpers/blockchain.d.mts +0 -41
  268. package/dist/helpers/blockchain.d.ts +0 -41
  269. package/dist/helpers/blockchain.d.ts.map +0 -1
  270. package/dist/helpers/date.d.mts +0 -70
  271. package/dist/helpers/date.d.ts +0 -70
  272. package/dist/helpers/date.d.ts.map +0 -1
  273. package/dist/helpers/datetime.d.mts +0 -57
  274. package/dist/helpers/datetime.d.ts +0 -57
  275. package/dist/helpers/datetime.d.ts.map +0 -1
  276. package/dist/helpers/domain.d.mts +0 -2
  277. package/dist/helpers/domain.d.ts +0 -2
  278. package/dist/helpers/domain.d.ts.map +0 -1
  279. package/dist/helpers/index.js.map +0 -7
  280. package/dist/helpers/index.mjs.map +0 -7
  281. package/dist/helpers/intl.d.mts +0 -20
  282. package/dist/helpers/intl.d.ts +0 -20
  283. package/dist/helpers/intl.d.ts.map +0 -1
  284. package/dist/helpers/logger.d.mts +0 -26
  285. package/dist/helpers/logger.d.ts +0 -26
  286. package/dist/helpers/logger.d.ts.map +0 -1
  287. package/dist/helpers/mask-options.d.mts +0 -10
  288. package/dist/helpers/mask-options.d.ts +0 -10
  289. package/dist/helpers/mask-options.d.ts.map +0 -1
  290. package/dist/helpers/num-formatter.d.mts +0 -3
  291. package/dist/helpers/num-formatter.d.ts +0 -3
  292. package/dist/helpers/num-formatter.d.ts.map +0 -1
  293. package/dist/helpers/polling.d.mts +0 -39
  294. package/dist/helpers/polling.d.ts +0 -39
  295. package/dist/helpers/polling.d.ts.map +0 -1
  296. package/dist/helpers/random.d.mts +0 -10
  297. package/dist/helpers/random.d.ts +0 -10
  298. package/dist/helpers/random.d.ts.map +0 -1
  299. package/dist/helpers/sdk-loader.d.mts +0 -25
  300. package/dist/helpers/sdk-loader.d.ts +0 -25
  301. package/dist/helpers/sdk-loader.d.ts.map +0 -1
  302. package/dist/helpers/signatures.d.mts +0 -17
  303. package/dist/helpers/signatures.d.ts +0 -17
  304. package/dist/helpers/signatures.d.ts.map +0 -1
  305. package/dist/helpers/string.d.mts +0 -17
  306. package/dist/helpers/string.d.ts +0 -17
  307. package/dist/helpers/string.d.ts.map +0 -1
  308. package/dist/helpers/types.d.mts +0 -39
  309. package/dist/helpers/types.d.ts +0 -39
  310. package/dist/helpers/types.d.ts.map +0 -1
  311. package/dist/helpers/url.d.mts +0 -11
  312. package/dist/helpers/url.d.ts +0 -11
  313. package/dist/helpers/url.d.ts.map +0 -1
  314. package/dist/helpers/window.d.mts +0 -37
  315. package/dist/helpers/window.d.ts +0 -37
  316. package/dist/helpers/window.d.ts.map +0 -1
  317. package/dist/helpers/zod.d.mts +0 -51
  318. package/dist/helpers/zod.d.ts +0 -51
  319. package/dist/helpers/zod.d.ts.map +0 -1
  320. package/dist/index.d.ts.map +0 -1
  321. package/dist/index.js.map +0 -7
  322. package/dist/index.mjs.map +0 -7
  323. package/dist/instructions/actions/index.d.mts +0 -5
  324. package/dist/instructions/actions/index.d.ts +0 -5
  325. package/dist/instructions/actions/index.d.ts.map +0 -1
  326. package/dist/instructions/actions/refuel/index.d.mts +0 -15
  327. package/dist/instructions/actions/refuel/index.d.ts +0 -15
  328. package/dist/instructions/actions/refuel/index.d.ts.map +0 -1
  329. package/dist/instructions/actions/swap/index.d.mts +0 -19
  330. package/dist/instructions/actions/swap/index.d.ts +0 -19
  331. package/dist/instructions/actions/swap/index.d.ts.map +0 -1
  332. package/dist/instructions/actions/sweep/index.d.mts +0 -16
  333. package/dist/instructions/actions/sweep/index.d.ts +0 -16
  334. package/dist/instructions/actions/sweep/index.d.ts.map +0 -1
  335. package/dist/instructions/actions/transfer/index.d.mts +0 -13
  336. package/dist/instructions/actions/transfer/index.d.ts +0 -13
  337. package/dist/instructions/actions/transfer/index.d.ts.map +0 -1
  338. package/dist/instructions/activate.d.mts +0 -84
  339. package/dist/instructions/activate.d.ts +0 -84
  340. package/dist/instructions/activate.d.ts.map +0 -1
  341. package/dist/instructions/build.d.mts +0 -146
  342. package/dist/instructions/build.d.ts +0 -146
  343. package/dist/instructions/build.d.ts.map +0 -1
  344. package/dist/instructions/constants.d.mts +0 -9
  345. package/dist/instructions/constants.d.ts +0 -9
  346. package/dist/instructions/constants.d.ts.map +0 -1
  347. package/dist/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.d.mts +0 -609
  348. package/dist/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.d.ts +0 -609
  349. package/dist/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.d.ts.map +0 -1
  350. package/dist/instructions/types.d.mts +0 -289
  351. package/dist/instructions/types.d.ts +0 -289
  352. package/dist/instructions/types.d.ts.map +0 -1
  353. package/dist/payments/action-names.d.mts +0 -16
  354. package/dist/payments/action-names.d.ts +0 -16
  355. package/dist/payments/action-names.d.ts.map +0 -1
  356. package/dist/payments/actions/index.d.mts +0 -5
  357. package/dist/payments/actions/index.d.ts +0 -5
  358. package/dist/payments/actions/index.d.ts.map +0 -1
  359. package/dist/payments/actions/sweep-cctp.d.mts +0 -15
  360. package/dist/payments/actions/sweep-cctp.d.ts +0 -15
  361. package/dist/payments/actions/sweep-cctp.d.ts.map +0 -1
  362. package/dist/payments/actions/sweep-erc20.d.mts +0 -12
  363. package/dist/payments/actions/sweep-erc20.d.ts +0 -12
  364. package/dist/payments/actions/sweep-erc20.d.ts.map +0 -1
  365. package/dist/payments/actions/sweep-uniswap-v3.d.mts +0 -17
  366. package/dist/payments/actions/sweep-uniswap-v3.d.ts +0 -17
  367. package/dist/payments/actions/sweep-uniswap-v3.d.ts.map +0 -1
  368. package/dist/payments/actions/sweep.d.mts +0 -12
  369. package/dist/payments/actions/sweep.d.ts +0 -12
  370. package/dist/payments/actions/sweep.d.ts.map +0 -1
  371. package/dist/payments/build.d.mts +0 -28
  372. package/dist/payments/build.d.ts +0 -28
  373. package/dist/payments/build.d.ts.map +0 -1
  374. package/dist/payments/chain-token-config-builder.d.mts +0 -10
  375. package/dist/payments/chain-token-config-builder.d.ts +0 -10
  376. package/dist/payments/chain-token-config-builder.d.ts.map +0 -1
  377. package/dist/payments/comprehensive-payment-request.d.mts +0 -26
  378. package/dist/payments/comprehensive-payment-request.d.ts +0 -26
  379. package/dist/payments/comprehensive-payment-request.d.ts.map +0 -1
  380. package/dist/payments/config/cctp.d.mts +0 -14
  381. package/dist/payments/config/cctp.d.ts +0 -14
  382. package/dist/payments/config/cctp.d.ts.map +0 -1
  383. package/dist/payments/config/index.d.mts +0 -3
  384. package/dist/payments/config/index.d.ts +0 -3
  385. package/dist/payments/config/index.d.ts.map +0 -1
  386. package/dist/payments/config/tokens.d.mts +0 -14
  387. package/dist/payments/config/tokens.d.ts +0 -14
  388. package/dist/payments/config/tokens.d.ts.map +0 -1
  389. package/dist/payments/instruction-registry.d.mts +0 -19
  390. package/dist/payments/instruction-registry.d.ts +0 -19
  391. package/dist/payments/instruction-registry.d.ts.map +0 -1
  392. package/dist/payments/payment-metadata-builder.d.mts +0 -56
  393. package/dist/payments/payment-metadata-builder.d.ts +0 -56
  394. package/dist/payments/payment-metadata-builder.d.ts.map +0 -1
  395. package/dist/payments/payment-metadata.d.mts +0 -15
  396. package/dist/payments/payment-metadata.d.ts +0 -15
  397. package/dist/payments/payment-metadata.d.ts.map +0 -1
  398. package/dist/payments/payment-request-token-resolver.d.mts +0 -25
  399. package/dist/payments/payment-request-token-resolver.d.ts +0 -25
  400. package/dist/payments/payment-request-token-resolver.d.ts.map +0 -1
  401. package/dist/payments/types.d.mts +0 -40
  402. package/dist/payments/types.d.ts +0 -40
  403. package/dist/payments/types.d.ts.map +0 -1
  404. package/dist/payments/validation.d.mts +0 -19
  405. package/dist/payments/validation.d.ts +0 -19
  406. package/dist/payments/validation.d.ts.map +0 -1
  407. package/dist/schemas/account.d.mts +0 -9
  408. package/dist/schemas/account.d.ts +0 -9
  409. package/dist/schemas/account.d.ts.map +0 -1
  410. package/dist/schemas/brand.d.mts +0 -7
  411. package/dist/schemas/brand.d.ts +0 -7
  412. package/dist/schemas/brand.d.ts.map +0 -1
  413. package/dist/schemas/contact.d.mts +0 -18
  414. package/dist/schemas/contact.d.ts +0 -18
  415. package/dist/schemas/contact.d.ts.map +0 -1
  416. package/dist/schemas/index.d.ts.map +0 -1
  417. package/dist/schemas/instruction.d.mts +0 -248
  418. package/dist/schemas/instruction.d.ts +0 -248
  419. package/dist/schemas/instruction.d.ts.map +0 -1
  420. package/dist/schemas/misc.d.mts +0 -36
  421. package/dist/schemas/misc.d.ts +0 -36
  422. package/dist/schemas/misc.d.ts.map +0 -1
  423. package/dist/schemas/payment.d.mts +0 -64
  424. package/dist/schemas/payment.d.ts +0 -64
  425. package/dist/schemas/payment.d.ts.map +0 -1
  426. package/dist/schemas/token.d.mts +0 -17
  427. package/dist/schemas/token.d.ts +0 -17
  428. package/dist/schemas/token.d.ts.map +0 -1
  429. package/dist/schemas/transaction.d.mts +0 -65
  430. package/dist/schemas/transaction.d.ts +0 -65
  431. package/dist/schemas/transaction.d.ts.map +0 -1
  432. package/dist/schemas/user.d.mts +0 -24
  433. package/dist/schemas/user.d.ts +0 -24
  434. package/dist/schemas/user.d.ts.map +0 -1
  435. package/dist/server/client.d.mts +0 -3
  436. package/dist/server/client.d.ts +0 -3
  437. package/dist/server/client.d.ts.map +0 -1
  438. package/dist/server/routes/account.d.mts +0 -4
  439. package/dist/server/routes/account.d.ts +0 -4
  440. package/dist/server/routes/account.d.ts.map +0 -1
  441. package/dist/server/routes/auth.d.mts +0 -28
  442. package/dist/server/routes/auth.d.ts +0 -28
  443. package/dist/server/routes/auth.d.ts.map +0 -1
  444. package/dist/server/routes/bridge.d.mts +0 -254
  445. package/dist/server/routes/bridge.d.ts +0 -254
  446. package/dist/server/routes/bridge.d.ts.map +0 -1
  447. package/dist/server/routes/config.d.mts +0 -3
  448. package/dist/server/routes/config.d.ts +0 -3
  449. package/dist/server/routes/config.d.ts.map +0 -1
  450. package/dist/server/routes/index.d.mts +0 -8
  451. package/dist/server/routes/index.d.ts +0 -8
  452. package/dist/server/routes/index.d.ts.map +0 -1
  453. package/dist/server/routes/instruction.d.mts +0 -4
  454. package/dist/server/routes/instruction.d.ts +0 -4
  455. package/dist/server/routes/instruction.d.ts.map +0 -1
  456. package/dist/server/routes/integration.d.mts +0 -4
  457. package/dist/server/routes/integration.d.ts +0 -4
  458. package/dist/server/routes/integration.d.ts.map +0 -1
  459. package/dist/server/routes/payments.d.mts +0 -5
  460. package/dist/server/routes/payments.d.ts +0 -5
  461. package/dist/server/routes/payments.d.ts.map +0 -1
  462. package/dist/server/routes/verify.d.mts +0 -3
  463. package/dist/server/routes/verify.d.ts +0 -3
  464. package/dist/server/routes/verify.d.ts.map +0 -1
  465. package/dist/wallet/wagmi/config.d.mts +0 -18
  466. package/dist/wallet/wagmi/config.d.ts +0 -18
  467. package/dist/wallet/wagmi/config.d.ts.map +0 -1
@@ -1,2066 +1,1509 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1
+ import { i as getOffchainApiUrl } from "../api-urls-DJcIKBCy.mjs";
2
+ import { t as _defineProperty } from "../defineProperty-DzhmunJg.mjs";
3
+ import { z as z$1 } from "zod";
4
+ import axios from "axios";
5
+ import { InstructionAction, PaymentsSchema, eip2098SignatureSchema, hexStringSchema, instructionActionValues, instructionSchema, instructionsSchema, numberSchema, sortValues, transactionSchema, userSchema, vrsSchema } from "@otim/utils/schemas";
6
+ import { parseSchema } from "@otim/utils/helpers";
4
7
 
5
- // src/api/core/error.ts
6
- import { z } from "zod";
7
- var apiErrorSchema = z.object({
8
- code: z.string().nullish(),
9
- message: z.string().nullish(),
10
- errorCode: z.string().nullish(),
11
- errorMessage: z.string().nullish(),
12
- status: z.number().nullish(),
13
- context: z.object({
14
- field_errors: z.record(z.string(), z.string()).nullish()
15
- }).nullish()
16
- });
17
- var errorResponseSchema = z.object({
18
- message: z.string().nullish(),
19
- errorMessage: z.string().nullish(),
20
- errorCode: z.string().nullish(),
21
- errors: z.array(apiErrorSchema).nullish()
22
- });
23
- var defaultErrorCode = "unknown";
24
- var defaultErrorMessage = "Unexpected error";
8
+ //#region src/api/core/error.ts
9
+ const apiErrorSchema = z$1.object({
10
+ code: z$1.string().nullish(),
11
+ message: z$1.string().nullish(),
12
+ errorCode: z$1.string().nullish(),
13
+ errorMessage: z$1.string().nullish(),
14
+ status: z$1.number().nullish(),
15
+ context: z$1.object({ field_errors: z$1.record(z$1.string(), z$1.string()).nullish() }).nullish()
16
+ });
17
+ const errorResponseSchema = z$1.object({
18
+ message: z$1.string().nullish(),
19
+ errorMessage: z$1.string().nullish(),
20
+ errorCode: z$1.string().nullish(),
21
+ errors: z$1.array(apiErrorSchema).nullish()
22
+ });
23
+ const defaultErrorCode = "unknown";
24
+ const defaultErrorMessage = "Unexpected error";
25
+ /**
26
+ * Extract the most likely server-provided error payload from a thrown value.
27
+ * Supports common shapes from HTTP clients (Axios/fetch) and plain objects.
28
+ */
25
29
  function extractErrorData(maybeError) {
26
- let errorData = maybeError?.body;
27
- if (!errorData && maybeError?.response?.data) {
28
- errorData = maybeError.response.data;
29
- }
30
- if (!errorData && (maybeError?.errorMessage || maybeError?.message || maybeError?.errorCode)) {
31
- errorData = maybeError;
32
- }
33
- return errorData;
30
+ let errorData = maybeError?.body;
31
+ if (!errorData && maybeError?.response?.data) errorData = maybeError.response.data;
32
+ if (!errorData && (maybeError?.errorMessage || maybeError?.message || maybeError?.errorCode)) errorData = maybeError;
33
+ return errorData;
34
34
  }
35
+ /**
36
+ * Normalize Error Shapes Into One User‑Facing Message.
37
+ * Why: Prefer server messages and avoid leaking technical details.
38
+ *
39
+ * @param maybeError An unknown error thrown by an HTTP client, SDK, or server.
40
+ * @param fallbackMessage Message used when the payload cannot be parsed or
41
+ * lacks a message.
42
+ */
35
43
  function getErrorMessage(maybeError, fallbackMessage) {
36
- const errorMessage = fallbackMessage ?? defaultErrorMessage;
37
- const errorData = extractErrorData(maybeError);
38
- const result = errorResponseSchema.safeParse(errorData);
39
- if (!result.success) {
40
- return errorMessage;
41
- }
42
- const { message, errorMessage: apiErrorMessage, errors } = result.data;
43
- return apiErrorMessage ?? message ?? errors?.[0]?.errorMessage ?? errors?.[0]?.message ?? errorMessage;
44
+ const errorMessage = fallbackMessage ?? defaultErrorMessage;
45
+ const errorData = extractErrorData(maybeError);
46
+ const result = errorResponseSchema.safeParse(errorData);
47
+ if (!result.success) return errorMessage;
48
+ const { message, errorMessage: apiErrorMessage, errors } = result.data;
49
+ /**
50
+ * Prioritize Error Message From Backend, Then Message, Then Errors Array.
51
+ * Surfaces the most specific, server‑intended feedback first for better UX.
52
+ */
53
+ return apiErrorMessage ?? message ?? errors?.[0]?.errorMessage ?? errors?.[0]?.message ?? errorMessage;
44
54
  }
55
+ /**
56
+ * Provide A Unified Error Message And Code For UI/Control‑Flow.
57
+ * Why: Normalize shapes and fall back to an "unknown" code.
58
+ *
59
+ * @param maybeError An unknown error thrown by an HTTP client, SDK, or server.
60
+ * @param fallbackMessage Message used when the payload cannot be parsed or is
61
+ * empty.
62
+ */
45
63
  function getErrorMessageWithCode(maybeError, fallbackMessage) {
46
- const errorMessage = fallbackMessage ?? defaultErrorMessage;
47
- const errorData = extractErrorData(maybeError);
48
- const result = errorResponseSchema.safeParse(errorData);
49
- if (!result.success || !result.data.errors?.[0] && !result.data.errorMessage && !result.data.message) {
50
- return {
51
- message: errorMessage,
52
- code: defaultErrorCode
53
- };
54
- }
55
- const {
56
- message,
57
- errorMessage: apiErrorMessage,
58
- errorCode,
59
- errors
60
- } = result.data;
61
- return {
62
- message: apiErrorMessage ?? message ?? errors?.[0]?.errorMessage ?? errors?.[0]?.message ?? errorMessage,
63
- code: errorCode ?? errors?.[0]?.errorCode ?? errors?.[0]?.code ?? defaultErrorCode
64
- };
64
+ const errorMessage = fallbackMessage ?? defaultErrorMessage;
65
+ const errorData = extractErrorData(maybeError);
66
+ const result = errorResponseSchema.safeParse(errorData);
67
+ if (!result.success || !result.data.errors?.[0] && !result.data.errorMessage && !result.data.message) return {
68
+ message: errorMessage,
69
+ code: defaultErrorCode
70
+ };
71
+ const { message, errorMessage: apiErrorMessage, errorCode, errors } = result.data;
72
+ return {
73
+ message: apiErrorMessage ?? message ?? errors?.[0]?.errorMessage ?? errors?.[0]?.message ?? errorMessage,
74
+ code: errorCode ?? errors?.[0]?.errorCode ?? errors?.[0]?.code ?? defaultErrorCode
75
+ };
65
76
  }
77
+ /**
78
+ * Detect User Rejection (e.g., Canceled Wallet Signature).
79
+ * Why: Treat cancellations as benign and keep telemetry clean.
80
+ *
81
+ * @param error The error object to check.
82
+ * @returns true if the error is a user rejection, false otherwise.
83
+ */
66
84
  function isUserRejectionError(error) {
67
- if (!error) return false;
68
- let errorMessage = "";
69
- if (typeof error === "string") {
70
- errorMessage = error;
71
- } else if (typeof error === "object") {
72
- errorMessage = error.message || error.errorMessage || error.details || "";
73
- }
74
- if (!errorMessage) {
75
- errorMessage = String(error);
76
- }
77
- errorMessage = errorMessage.toLowerCase();
78
- const rejectionPatterns = [
79
- "user rejected",
80
- "user denied",
81
- "user cancelled",
82
- "cancelled by user",
83
- "rejected by user",
84
- "user abort",
85
- "transaction rejected",
86
- "signature rejected",
87
- "request rejected"
88
- ];
89
- return rejectionPatterns.some((pattern) => errorMessage.includes(pattern));
85
+ if (!error) return false;
86
+ /**
87
+ * Safely Extract Error Message From Various Possible Error Formats.
88
+ * Providers may throw strings, plain objects, or non-Error values.
89
+ */
90
+ let errorMessage = "";
91
+ if (typeof error === "string") errorMessage = error;
92
+ else if (typeof error === "object") errorMessage = error.message || error.errorMessage || error.details || "";
93
+ if (!errorMessage) errorMessage = String(error);
94
+ errorMessage = errorMessage.toLowerCase();
95
+ return [
96
+ "user rejected",
97
+ "user denied",
98
+ "user cancelled",
99
+ "cancelled by user",
100
+ "rejected by user",
101
+ "user abort",
102
+ "transaction rejected",
103
+ "signature rejected",
104
+ "request rejected"
105
+ ].some((pattern) => errorMessage.includes(pattern));
90
106
  }
91
- var isUserAddressableError = (errorCode, errorMessage) => {
92
- const isInUserErrorRange = errorCode >= 1e3 && errorCode < 2e3;
93
- const hasErrorMessage = Boolean(errorMessage);
94
- return isInUserErrorRange && hasErrorMessage;
107
+ /**
108
+ * Determine If An Error Code Is User‑Addressable.
109
+ * Why: 1000–1999 are intended to be surfaced to users.
110
+ *
111
+ * @param errorCode The error code to check.
112
+ * @param errorMessage Optional error message.
113
+ */
114
+ const isUserAddressableError = (errorCode, errorMessage) => {
115
+ return errorCode >= 1e3 && errorCode < 2e3 && Boolean(errorMessage);
95
116
  };
117
+ /**
118
+ * Detect Whether An Error Looks Technical/Low‑Level.
119
+ * Why: Avoid leaking framework/runtime details to users; rely on logging.
120
+ */
96
121
  function isTechnicalError(error) {
97
- if (!error) return false;
98
- let errorMessage = "";
99
- if (typeof error === "string") {
100
- errorMessage = error;
101
- } else if (typeof error === "object") {
102
- errorMessage = error.message || error.errorMessage || error.details || "";
103
- }
104
- if (!errorMessage) {
105
- errorMessage = String(error);
106
- }
107
- errorMessage = errorMessage.toLowerCase();
108
- const technicalErrorPatterns = [
109
- "is not a function",
110
- "cannot read prop",
111
- "cannot read property",
112
- "reading undefined",
113
- "read undefined of",
114
- "cannot access before initialization",
115
- "is not defined",
116
- "is undefined",
117
- "is null",
118
- "unexpected token",
119
- "syntax error",
120
- "reference error",
121
- "type error",
122
- "network error",
123
- "failed to fetch",
124
- "server components"
125
- ];
126
- return technicalErrorPatterns.some(
127
- (pattern) => errorMessage.includes(pattern)
128
- );
122
+ if (!error) return false;
123
+ /**
124
+ * Safely Extract Error Message From Various Possible Error Formats.
125
+ * Upstream code can throw strings or custom objects instead of Error
126
+ * instances.
127
+ */
128
+ let errorMessage = "";
129
+ if (typeof error === "string") errorMessage = error;
130
+ else if (typeof error === "object") errorMessage = error.message || error.errorMessage || error.details || "";
131
+ if (!errorMessage) errorMessage = String(error);
132
+ errorMessage = errorMessage.toLowerCase();
133
+ return [
134
+ "is not a function",
135
+ "cannot read prop",
136
+ "cannot read property",
137
+ "reading undefined",
138
+ "read undefined of",
139
+ "cannot access before initialization",
140
+ "is not defined",
141
+ "is undefined",
142
+ "is null",
143
+ "unexpected token",
144
+ "syntax error",
145
+ "reference error",
146
+ "type error",
147
+ "network error",
148
+ "failed to fetch",
149
+ "server components"
150
+ ].some((pattern) => errorMessage.includes(pattern));
129
151
  }
130
152
  function getUserFriendlyErrorMessage(error, fallbackMessage) {
131
- if (isTechnicalError(error)) {
132
- return "Internal server error";
133
- }
134
- return getErrorMessage(error, fallbackMessage);
153
+ if (isTechnicalError(error)) return "Internal server error";
154
+ return getErrorMessage(error, fallbackMessage);
135
155
  }
136
156
 
137
- // src/api/core/instance.ts
138
- import axios from "axios";
139
- var API_INSTANCE_DEFAULT_TIMEOUT = 3e4;
140
- var createInstance = (config) => {
141
- const instance = axios.create({
142
- timeout: API_INSTANCE_DEFAULT_TIMEOUT,
143
- ...config
144
- });
145
- return instance;
157
+ //#endregion
158
+ //#region src/api/core/instance.ts
159
+ const API_INSTANCE_DEFAULT_TIMEOUT = 3e4;
160
+ const createInstance = (config) => {
161
+ return axios.create({
162
+ timeout: API_INSTANCE_DEFAULT_TIMEOUT,
163
+ ...config
164
+ });
146
165
  };
147
- var createAbortController = () => {
148
- return new AbortController();
166
+ const createAbortController = () => {
167
+ return new AbortController();
149
168
  };
150
- var isInstanceInit = (init) => {
151
- return !!init && typeof init === "object" && "instance" in init;
169
+ const isInstanceInit = (init) => {
170
+ return !!init && typeof init === "object" && "instance" in init;
152
171
  };
153
172
 
154
- // src/api/core/service.ts
173
+ //#endregion
174
+ //#region src/api/core/service.ts
155
175
  var ServiceError = class extends Error {
156
- constructor(message, code) {
157
- super(message);
158
- this.code = code;
159
- this.name = "ServiceError";
160
- }
176
+ constructor(message, code) {
177
+ super(message);
178
+ this.code = code;
179
+ this.name = "ServiceError";
180
+ }
161
181
  };
162
- var HttpMethod = {
163
- Get: "GET",
164
- Post: "POST",
165
- Put: "PUT",
166
- Delete: "DELETE"
167
- };
168
-
169
- // src/api/schemas/account.ts
170
- import { z as z2 } from "zod";
171
- var DelegationStatus = {
172
- Undelegated: "Undelegated",
173
- Pending: "Pending",
174
- Delegated: "Delegated",
175
- Expired: "Expired",
176
- Errored: "Errored"
182
+ const HttpMethod = {
183
+ Get: "GET",
184
+ Post: "POST",
185
+ Put: "PUT",
186
+ Delete: "DELETE"
177
187
  };
178
- var delegationStatusValues = Object.values(DelegationStatus);
179
- var delegationStatusSchema = z2.enum(delegationStatusValues);
180
- var delegationStatusRequestSchema = z2.object({
181
- address: z2.string(),
182
- chainId: z2.number()
183
- });
184
- var delegationStatusResponseSchema = z2.object({
185
- delegationStatus: delegationStatusSchema
186
- });
187
- var delegationCreateRequestSchema = z2.object({
188
- signedAuthorization: z2.string(),
189
- signerAddress: z2.string()
190
- });
191
- var delegationCreateResponseSchema = z2.object({
192
- success: z2.boolean(),
193
- transactionHash: z2.string().optional(),
194
- message: z2.string().optional()
195
- });
196
188
 
197
- // src/api/schemas/activity.ts
198
- import { z as z8 } from "zod";
199
-
200
- // src/schemas/instruction.ts
201
- import { z as z4 } from "zod";
202
-
203
- // src/schemas/misc.ts
204
- import { z as z3 } from "zod";
205
- var DATE_REGEX = /^(19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
206
- var DATE_ISO_8601_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
207
- var DATE_STANDARD_REGEX = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d{2}$/;
208
- var TIME_REGEX = /^(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] (AM|PM)$/;
209
- var regexSchema = (regex, message) => z3.string().regex(regex, message);
210
- var nonEmptyStringSchema = z3.string().min(1);
211
- var numberSchema = z3.union([
212
- z3.number().finite(),
213
- z3.string().regex(/^-?\d*\.?\d+(?:[eE][-+]?\d+)?$/).transform(Number)
214
- ]);
215
- var decimalStringSchema = z3.string().regex(/^-?\d*\.?\d+$/).refine((val) => !isNaN(parseFloat(val)), {
216
- message: "Must be a valid decimal number"
217
- });
218
- var bigintSchema = z3.union([
219
- z3.bigint(),
220
- z3.string().regex(/^-?\d+$/).transform(BigInt)
221
- ]);
222
- var hexStringSchema = z3.string().startsWith("0x").transform((val) => val);
223
- var dateSchema = regexSchema(DATE_REGEX);
224
- var dateISO8601Schema = regexSchema(DATE_ISO_8601_REGEX);
225
- var dateStandardSchema = regexSchema(DATE_STANDARD_REGEX);
226
- var timeSchema = regexSchema(TIME_REGEX);
227
- var Sort = {
228
- Asc: "asc",
229
- Desc: "desc"
189
+ //#endregion
190
+ //#region src/api/schemas/account.ts
191
+ const DelegationStatus = {
192
+ Undelegated: "Undelegated",
193
+ Pending: "Pending",
194
+ Delegated: "Delegated",
195
+ Expired: "Expired",
196
+ Errored: "Errored"
230
197
  };
231
- var sortValues = Object.values(Sort);
232
- var vrsSchema = z3.object({
233
- v: z3.number(),
234
- r: z3.string(),
235
- s: z3.string()
236
- });
237
- var eip2098SignatureSchema = z3.object({
238
- yParity: z3.number(),
239
- r: z3.string(),
240
- s: z3.string()
198
+ const delegationStatusValues = Object.values(DelegationStatus);
199
+ const delegationStatusSchema = z$1.enum(delegationStatusValues);
200
+ const delegationStatusRequestSchema = z$1.object({
201
+ address: z$1.string(),
202
+ chainId: z$1.number()
203
+ });
204
+ const delegationStatusResponseSchema = z$1.object({ delegationStatus: delegationStatusSchema });
205
+ const delegationCreateRequestSchema = z$1.object({
206
+ signedAuthorization: z$1.string(),
207
+ signerAddress: z$1.string()
208
+ });
209
+ const delegationCreateResponseSchema = z$1.object({
210
+ success: z$1.boolean(),
211
+ transactionHash: z$1.string().optional(),
212
+ message: z$1.string().optional()
241
213
  });
242
214
 
243
- // src/schemas/instruction.ts
244
- var instructionIdSchema = hexStringSchema;
245
- var InstructionState = {
246
- PendingActivation: "PendingActivation",
247
- Active: "Active",
248
- PendingDeactivation: "PendingDeactivation",
249
- Deactivated: "Deactivated",
250
- Errored: "Errored",
251
- Completed: "Completed",
252
- UserNotDelegated: "UserNotDelegated",
253
- InFlight: "InFlight",
254
- NotifyUser: "NotifyUser"
215
+ //#endregion
216
+ //#region src/api/schemas/activity.ts
217
+ const actionNameSchema = z$1.enum(instructionActionValues);
218
+ /**
219
+ * Human-readable labels for automation action names.
220
+ */
221
+ const ACTION_NAME_LABELS = {
222
+ [InstructionAction.Refuel]: "Refuel",
223
+ [InstructionAction.RefuelERC20]: "Refuel",
224
+ [InstructionAction.Transfer]: "Transfer",
225
+ [InstructionAction.TransferERC20]: "Transfer",
226
+ [InstructionAction.TransferCCTP]: "Transfer",
227
+ [InstructionAction.Sweep]: "Sweep",
228
+ [InstructionAction.SweepERC20]: "Sweep",
229
+ [InstructionAction.SweepCCTP]: "Sweep",
230
+ [InstructionAction.SweepUniswapV3]: "Trade",
231
+ [InstructionAction.UniswapV3ExactInput]: "Trade",
232
+ [InstructionAction.DepositERC4626]: "Deposit",
233
+ [InstructionAction.SweepDepositERC4626]: "Deposit",
234
+ [InstructionAction.WithdrawERC4626]: "Withdraw",
235
+ [InstructionAction.SweepWithdrawERC4626]: "Withdraw",
236
+ [InstructionAction.DeactivateInstruction]: "Deactivate",
237
+ [InstructionAction.CallOnce]: "Call Once"
255
238
  };
256
- var instructionStateValues = Object.values(InstructionState);
257
- var instructionStateSchema = z4.enum(instructionStateValues);
258
- var InstructionAction = {
259
- RefuelERC20: "refuelERC20",
260
- Refuel: "refuel",
261
- Transfer: "transfer",
262
- TransferERC20: "transferERC20",
263
- UniswapV3ExactInput: "uniswapV3ExactInput",
264
- Sweep: "sweep",
265
- SweepERC20: "sweepERC20",
266
- SweepCCTP: "sweepCCTP",
267
- SweepUniswapV3: "sweepUniswapV3",
268
- SweepDepositAccount: "sweepDepositAccount",
269
- SweepDepositAccountERC20: "sweepDepositAccountERC20",
270
- DeactivateInstruction: "deactivateInstruction",
271
- SweepSkipCCTPDepositAccount: "sweepSkipCCTPDepositAccount"
239
+ const DEFAULT_ACTION_LABEL = "–";
240
+ /**
241
+ * Human-readable labels for payment rails.
242
+ */
243
+ const PAYMENT_RAIL_LABELS = {
244
+ ach_push: "ACH",
245
+ pix: "PIX",
246
+ sepa: "SEPA",
247
+ spei: "SPEI",
248
+ wire: "Wire"
272
249
  };
273
- var instructionActionValues = Object.values(InstructionAction);
274
- var instructionActionSchema = z4.enum(instructionActionValues);
275
- var InstructionScheduleStartType = {
276
- Now: "now",
277
- DateTime: "datetime"
278
- };
279
- var instructionScheduleStartValues = Object.values(
280
- InstructionScheduleStartType
281
- );
282
- var baseStartSchema = z4.object({
283
- type: z4.enum(instructionScheduleStartValues)
284
- });
285
- var nowStartSchema = baseStartSchema.extend({
286
- type: z4.literal(InstructionScheduleStartType.Now)
287
- });
288
- var dateTimeStartSchema = baseStartSchema.extend({
289
- type: z4.literal(InstructionScheduleStartType.DateTime),
290
- startDate: dateStandardSchema,
291
- startTime: z4.string()
292
- });
293
- var instructionScheduleStartSchema = z4.discriminatedUnion("type", [
294
- nowStartSchema,
295
- dateTimeStartSchema
296
- ]);
297
- var InstructionScheduleRepeatType = {
298
- UntilDeactivated: "until-deactivated",
299
- MaxExecutions: "max-executions"
250
+ /**
251
+ * Human-readable labels for virtual account event types.
252
+ */
253
+ const VIRTUAL_ACCOUNT_EVENT_LABELS = {
254
+ funds_received: "Funds Received",
255
+ payment_submitted: "Payment Submitted",
256
+ payment_processed: "Payment Processed",
257
+ in_review: "In Review",
258
+ microdeposit: "Microdeposit",
259
+ funds_scheduled: "Funds Scheduled"
300
260
  };
301
- var instructionScheduleRepeatValues = Object.values(
302
- InstructionScheduleRepeatType
303
- );
304
- var baseRepeatSchema = z4.object({});
305
- var untilDeactivatedRepeatSchema = baseRepeatSchema.extend({
306
- type: z4.literal(InstructionScheduleRepeatType.UntilDeactivated)
307
- });
308
- var maxExecutionsRepeatSchema = baseRepeatSchema.extend({
309
- type: z4.literal(InstructionScheduleRepeatType.MaxExecutions),
310
- maxExecutions: numberSchema
311
- });
312
- var instructionScheduleRepeatSchema = z4.discriminatedUnion("type", [
313
- untilDeactivatedRepeatSchema,
314
- maxExecutionsRepeatSchema
315
- ]);
316
- var InstructionScheduleRetryType = {
317
- UntilDeactivated: "until-deactivated",
318
- TimeLimited: "time-limited"
319
- };
320
- var instructionScheduleRetryValues = Object.values(
321
- InstructionScheduleRetryType
322
- );
323
- var baseRetrySchema = z4.object({});
324
- var untilDeactivatedRetrySchema = baseRetrySchema.extend({
325
- type: z4.literal(InstructionScheduleRetryType.UntilDeactivated)
326
- });
327
- var timeLimitedRetrySchema = baseRetrySchema.extend({
328
- type: z4.literal(InstructionScheduleRetryType.TimeLimited),
329
- retryCount: numberSchema
330
- });
331
- var instructionScheduleRetrySchema = z4.discriminatedUnion("type", [
332
- untilDeactivatedRetrySchema,
333
- timeLimitedRetrySchema
334
- ]);
335
- var TimeUnit = {
336
- None: "none",
337
- Second: "second",
338
- Minute: "minute",
339
- Hour: "hour",
340
- Day: "day",
341
- Week: "week",
342
- Month: "month"
343
- };
344
- var timeUnitValues = Object.values(TimeUnit);
345
- var timeUnitSchema = z4.enum(timeUnitValues);
346
- var instructionExecutionStateSchema = z4.object({
347
- executionStatus: instructionStateSchema.optional(),
348
- executionCounter: z4.number().int().optional(),
349
- lastExecuted: z4.number().int().optional()
350
- });
351
- var instructionSchema = z4.object({
352
- instructionId: hexStringSchema,
353
- createdAt: z4.number().optional(),
354
- startAt: z4.string().nullish(),
355
- interval: z4.number().nullish(),
356
- timeout: z4.number().nullish(),
357
- maxExecutions: z4.number().nullish(),
358
- executionState: instructionExecutionStateSchema.optional(),
359
- actionName: z4.string().optional(),
360
- arguments: z4.any(),
361
- nickname: z4.string().nullish(),
362
- lastInstructedValue: z4.string().optional(),
363
- lastErrorCode: z4.number().nullish(),
364
- lastErrorMessage: z4.string().nullish(),
365
- totalInstructedValue: z4.string().optional(),
366
- instructedTokenAddress: hexStringSchema.nullish(),
367
- chainId: z4.number().nullish(),
368
- chain: z4.string().optional()
369
- });
370
- var instructionsSchema = z4.array(instructionSchema);
371
- var instructionSummarySchema = z4.object({
372
- instructionId: hexStringSchema,
373
- chainId: z4.number().int(),
374
- executionCount: z4.number().int(),
375
- onTimeCount: z4.number().int(),
376
- lateCount: z4.number().int(),
377
- wasActivatedDuring: z4.boolean(),
378
- amount: z4.number().default(0),
379
- instructedValue: z4.string().nullish().default("0"),
380
- instructedTokenAddress: z4.string().nullish().default(null)
381
- });
382
- var instructionSummariesSchema = z4.array(instructionSummarySchema);
383
- var instructionSummariesByDateSchema = z4.record(
384
- z4.string(),
385
- instructionSummariesSchema
386
- );
387
- var InstructionViewTimescale = {
388
- Days: "days",
389
- Hours: "hours",
390
- Minutes: "minutes",
391
- Seconds: "seconds"
392
- };
393
- var instructionViewTimescaleValues = Object.values(
394
- InstructionViewTimescale
395
- );
396
-
397
- // src/schemas/payment.ts
398
- import { z as z5 } from "zod";
399
- var PaymentStatus = {
400
- Due: "due",
401
- NotDue: "not-due",
402
- Paid: "paid"
403
- };
404
- var PaymentSource = {
405
- Bill: "Bill",
406
- Stripe: "Stripe",
407
- Clio: "Clio",
408
- QuickBooks: "QuickBooks"
409
- };
410
- var paymentRequestSourceValues = [
411
- PaymentSource.Bill,
412
- PaymentSource.Stripe,
413
- PaymentSource.Clio,
414
- PaymentSource.QuickBooks
415
- ];
416
- var paymentSchema = z5.object({
417
- id: z5.string(),
418
- fromUserId: z5.string().nullable().optional(),
419
- toUserId: z5.string().nullable().optional(),
420
- payerAddress: z5.string().nullable().optional(),
421
- ephemeralWalletAddress: z5.string(),
422
- ephemeralWalletId: z5.string().optional(),
423
- instructions: z5.object({
424
- ids: z5.array(z5.string()),
425
- completionIds: z5.array(z5.string())
426
- }).optional(),
427
- metadata: z5.record(z5.string(), z5.unknown()).optional(),
428
- // UI-derived fields
429
- status: z5.union([
430
- z5.literal(PaymentStatus.Due),
431
- z5.literal(PaymentStatus.NotDue),
432
- z5.literal(PaymentStatus.Paid)
433
- ]),
434
- dueDate: z5.string(),
435
- amountDue: z5.number(),
436
- note: z5.string().nullable().optional(),
437
- address: z5.string().nullable().optional(),
438
- addedOn: z5.string(),
439
- source: z5.union([
440
- z5.literal(PaymentSource.Bill),
441
- z5.literal(PaymentSource.Stripe),
442
- z5.literal(PaymentSource.Clio),
443
- z5.literal(PaymentSource.QuickBooks)
444
- ]).nullish(),
445
- attachmentUrl: z5.string().url().nullable().optional(),
446
- attachmentName: z5.string().nullable().optional(),
447
- fromAccountAddress: z5.string().nullable().optional()
448
- });
449
- var PaymentsSchema = z5.array(paymentSchema);
450
-
451
- // src/schemas/transaction.ts
452
- import { z as z6 } from "zod";
453
- var transactionSchema = z6.object({
454
- instructionId: instructionIdSchema,
455
- transactionHash: hexStringSchema.optional(),
456
- blockHash: z6.string().nullable(),
457
- transactionStatus: z6.string(),
458
- error: z6.string().nullish(),
459
- startedAt: z6.string(),
460
- startedAtBlock: z6.number(),
461
- finishedAt: z6.string().nullable(),
462
- finishedAtBlock: z6.number().nullable(),
463
- amount: z6.object({ value: z6.number(), token: z6.string() }).nullish(),
464
- instructedValue: z6.string(),
465
- instructedTokenAddress: z6.string().nullable(),
466
- executionNum: z6.number(),
467
- chainId: z6.number().nullish(),
468
- chain: z6.string().optional()
469
- });
470
- var transactionWithValidAmountSchema = transactionSchema.extend({
471
- amount: z6.object({
472
- value: z6.number(),
473
- token: z6.string()
474
- })
475
- });
476
- var transactionsSchema = z6.array(transactionSchema);
477
-
478
- // src/schemas/user.ts
479
- import { z as z7 } from "zod";
480
- var entityIdSchema = z7.string().uuid();
481
- var addressSchema = z7.string().regex(/^0x[a-fA-F0-9]{40}$/).transform((v) => v.toLowerCase());
482
- var userPreferencesSchema = z7.object({
483
- chainId: z7.number().optional(),
484
- tokenSymbol: z7.string().optional(),
485
- localCurrency: z7.string().optional()
486
- });
487
- var userSchema = z7.object({
488
- id: entityIdSchema,
489
- address: addressSchema,
490
- createdAt: z7.string(),
491
- updatedAt: z7.string(),
492
- preferences: userPreferencesSchema.optional(),
493
- isDeveloper: z7.boolean(),
494
- developerPublicKey: z7.string().nullable().optional()
495
- });
496
-
497
- // src/api/schemas/activity.ts
498
- var actionNameSchema = z8.enum([
499
- "refuel",
500
- "transfer",
501
- "refuelERC20",
502
- "transferERC20",
503
- "uniswapV3ExactInput",
504
- "deactivateInstruction",
505
- "sweepCCTP",
506
- "transferCCTP",
507
- "sweep",
508
- "sweepERC20",
509
- "sweepUniswapV3",
510
- "depositERC4626",
511
- "sweepDepositERC4626",
512
- "withdrawERC4626",
513
- "sweepWithdrawERC4626",
514
- "callOnce"
515
- ]);
516
- var transferFieldsSchema = z8.object({
517
- token: hexStringSchema,
518
- from: hexStringSchema,
519
- to: hexStringSchema,
520
- value: hexStringSchema
521
- });
522
- var swapFieldsSchema = z8.object({
523
- poolAddress: hexStringSchema,
524
- fromToken: hexStringSchema,
525
- toToken: hexStringSchema,
526
- from: hexStringSchema,
527
- to: hexStringSchema,
528
- fromAmount: hexStringSchema,
529
- toAmount: hexStringSchema
530
- });
531
- var cctpBurnFieldsSchema = z8.object({
532
- token: hexStringSchema,
533
- from: hexStringSchema,
534
- mintRecipient: hexStringSchema,
535
- destinationDomain: hexStringSchema,
536
- value: hexStringSchema
537
- });
538
- var erc4626DepositFieldsSchema = z8.object({
539
- vault: hexStringSchema,
540
- token: hexStringSchema,
541
- from: hexStringSchema,
542
- owner: hexStringSchema,
543
- value: hexStringSchema,
544
- shares: hexStringSchema
545
- });
546
- var erc4626WithdrawFieldsSchema = z8.object({
547
- vault: hexStringSchema,
548
- token: hexStringSchema,
549
- from: hexStringSchema,
550
- to: hexStringSchema,
551
- value: hexStringSchema,
552
- shares: hexStringSchema
553
- });
554
- var activityDataSchema = z8.union([
555
- z8.object({ transfer: transferFieldsSchema }),
556
- z8.object({ swap: swapFieldsSchema }),
557
- z8.object({ cctpBurn: cctpBurnFieldsSchema }),
558
- z8.object({ erc4626Deposit: erc4626DepositFieldsSchema }),
559
- z8.object({ erc4626Withdraw: erc4626WithdrawFieldsSchema })
261
+ /**
262
+ * Formats a payment rail value to a human-readable label.
263
+ */
264
+ function formatPaymentRail(paymentRail) {
265
+ if (!paymentRail) return DEFAULT_ACTION_LABEL;
266
+ const label = PAYMENT_RAIL_LABELS[paymentRail.toLowerCase()];
267
+ if (label) return label;
268
+ return paymentRail.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
269
+ }
270
+ /**
271
+ * Formats an action name to a human-readable label.
272
+ */
273
+ function formatActionName(actionName, source) {
274
+ if (!actionName) return DEFAULT_ACTION_LABEL;
275
+ if (actionName.startsWith("virtual_account_")) {
276
+ if (source?.payment_rail) return formatPaymentRail(source.payment_rail);
277
+ const eventType = actionName.replace("virtual_account_", "");
278
+ const label = VIRTUAL_ACCOUNT_EVENT_LABELS[eventType];
279
+ if (label) return label;
280
+ return eventType.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
281
+ }
282
+ return ACTION_NAME_LABELS[actionName] ?? DEFAULT_ACTION_LABEL;
283
+ }
284
+ const transferFieldsSchema = z$1.object({
285
+ token: hexStringSchema,
286
+ from: hexStringSchema,
287
+ to: hexStringSchema,
288
+ value: hexStringSchema
289
+ });
290
+ const swapFieldsSchema = z$1.object({
291
+ poolAddress: hexStringSchema,
292
+ fromToken: hexStringSchema,
293
+ toToken: hexStringSchema,
294
+ from: hexStringSchema,
295
+ to: hexStringSchema,
296
+ fromAmount: hexStringSchema,
297
+ toAmount: hexStringSchema
298
+ });
299
+ const cctpBurnFieldsSchema = z$1.object({
300
+ token: hexStringSchema,
301
+ from: hexStringSchema,
302
+ mintRecipient: hexStringSchema,
303
+ destinationDomain: hexStringSchema,
304
+ value: hexStringSchema
305
+ });
306
+ const erc4626DepositFieldsSchema = z$1.object({
307
+ vault: hexStringSchema,
308
+ token: hexStringSchema,
309
+ from: hexStringSchema,
310
+ owner: hexStringSchema,
311
+ value: hexStringSchema,
312
+ shares: hexStringSchema
313
+ });
314
+ const erc4626WithdrawFieldsSchema = z$1.object({
315
+ vault: hexStringSchema,
316
+ token: hexStringSchema,
317
+ from: hexStringSchema,
318
+ to: hexStringSchema,
319
+ value: hexStringSchema,
320
+ shares: hexStringSchema
321
+ });
322
+ const activityDataSchema = z$1.union([
323
+ z$1.object({ transfer: transferFieldsSchema }),
324
+ z$1.object({ swap: swapFieldsSchema }),
325
+ z$1.object({ cctpBurn: cctpBurnFieldsSchema }),
326
+ z$1.object({ erc4626Deposit: erc4626DepositFieldsSchema }),
327
+ z$1.object({ erc4626Withdraw: erc4626WithdrawFieldsSchema })
560
328
  ]);
561
- var activityRecordSchema = z8.object({
562
- actionName: actionNameSchema,
563
- blockTimestamp: numberSchema,
564
- transactionHash: hexStringSchema,
565
- activity: activityDataSchema,
566
- instructionId: hexStringSchema.nullable(),
567
- executionCount: z8.number().nullable()
568
- });
569
- var getInstructionActivityRequestSchema = z8.object({
570
- chainId: z8.number(),
571
- actionNames: z8.array(actionNameSchema),
572
- page: numberSchema.optional(),
573
- perPage: numberSchema.optional()
574
- });
575
- var getInstructionActivityResponseSchema = z8.array(activityRecordSchema);
329
+ const activityRecordSchema = z$1.object({
330
+ actionName: actionNameSchema,
331
+ blockTimestamp: numberSchema,
332
+ transactionHash: hexStringSchema,
333
+ activity: activityDataSchema,
334
+ instructionId: hexStringSchema.nullable(),
335
+ executionCount: z$1.number().nullable()
336
+ });
337
+ const getInstructionActivityRequestSchema = z$1.object({
338
+ chainId: z$1.number(),
339
+ actionNames: z$1.array(actionNameSchema),
340
+ page: numberSchema.optional(),
341
+ perPage: numberSchema.optional()
342
+ });
343
+ const getInstructionActivityResponseSchema = z$1.array(activityRecordSchema);
576
344
 
577
- // src/api/schemas/auth.ts
578
- import { z as z9 } from "zod";
579
- var authLoginRequestSchema = z9.object({
580
- siwe: z9.string(),
581
- signature: vrsSchema
582
- });
583
- var authLoginResponseSchema = z9.object({
584
- authorization: z9.string(),
585
- user: userSchema
586
- });
587
- var turnkeyVerificationRequestSchema = z9.object({
588
- email: z9.string().email()
589
- });
590
- var turnkeyVerificationResponseSchema = z9.object({
591
- isLogin: z9.boolean()
592
- });
593
- var attestationSchema = z9.object({
594
- credentialId: z9.string(),
595
- clientDataJson: z9.string(),
596
- attestationObject: z9.string(),
597
- transports: z9.array(z9.string()).optional()
598
- });
599
- var turnkeyLoginRequestSchema = z9.object({
600
- email: z9.email(),
601
- verificationCode: z9.coerce.number().int().min(1e5).max(999999),
602
- passkeyChallenge: z9.string().optional(),
603
- attestation: attestationSchema.optional()
604
- });
605
- var turnkeyLoginResponseSchema = z9.object({
606
- email: z9.string(),
607
- subOrgId: z9.string(),
608
- walletAddress: z9.string(),
609
- isLogin: z9.boolean().optional()
610
- });
611
- var meResponseSchema = userSchema;
612
- var sessionTokenRequestSchema = z9.object({
613
- sessionToken: z9.string()
614
- });
615
- var sessionTokenResponseSchema = z9.object({
616
- success: z9.boolean()
617
- });
618
- var sessionVerifyResponseSchema = z9.object({
619
- authenticated: z9.boolean(),
620
- hasSessionToken: z9.boolean()
621
- });
622
- var whitelistCheckRequestSchema = z9.object({
623
- email: z9.string().email()
624
- });
625
- var whitelistCheckResponseSchema = z9.object({
626
- isAllowed: z9.boolean(),
627
- message: z9.string().optional()
628
- });
629
- var addressWhitelistCheckRequestSchema = z9.object({
630
- address: z9.string()
631
- });
632
- var addressWhitelistCheckResponseSchema = z9.object({
633
- isAllowed: z9.boolean(),
634
- message: z9.string().optional()
635
- });
636
- var getCurrentUserResponseSchema = z9.object({
637
- data: userSchema
345
+ //#endregion
346
+ //#region src/api/schemas/auth.ts
347
+ const authLoginRequestSchema = z$1.object({
348
+ siwe: z$1.string(),
349
+ signature: vrsSchema
350
+ });
351
+ const authLoginResponseSchema = z$1.object({
352
+ authorization: z$1.string(),
353
+ user: userSchema
354
+ });
355
+ const turnkeyVerificationRequestSchema = z$1.object({ email: z$1.string().email() });
356
+ const turnkeyVerificationResponseSchema = z$1.object({
357
+ isLogin: z$1.boolean(),
358
+ codeAlreadyExists: z$1.boolean().optional()
359
+ });
360
+ const attestationSchema = z$1.object({
361
+ credentialId: z$1.string(),
362
+ clientDataJson: z$1.string(),
363
+ attestationObject: z$1.string(),
364
+ transports: z$1.array(z$1.string()).optional()
365
+ });
366
+ const turnkeyLoginRequestSchema = z$1.object({
367
+ email: z$1.email(),
368
+ verificationCode: z$1.coerce.number().int().min(1e5).max(999999),
369
+ passkeyChallenge: z$1.string().optional(),
370
+ attestation: attestationSchema.optional()
371
+ });
372
+ const turnkeyLoginResponseSchema = z$1.object({
373
+ email: z$1.string(),
374
+ subOrgId: z$1.string(),
375
+ walletAddress: z$1.string(),
376
+ isLogin: z$1.boolean().optional()
377
+ });
378
+ const meResponseSchema = userSchema;
379
+ const sessionTokenRequestSchema = z$1.object({
380
+ sessionToken: z$1.string(),
381
+ userId: z$1.string()
382
+ });
383
+ const sessionTokenResponseSchema = z$1.object({ success: z$1.boolean() });
384
+ const sessionVerifyResponseSchema = z$1.object({
385
+ authenticated: z$1.boolean(),
386
+ hasSessionToken: z$1.boolean()
387
+ });
388
+ /**
389
+ * @todo
390
+ * - Remove later, this is a temporary schema for the whitelist check
391
+ */
392
+ const whitelistCheckRequestSchema = z$1.object({ email: z$1.string().email() });
393
+ const whitelistCheckResponseSchema = z$1.object({
394
+ isAllowed: z$1.boolean(),
395
+ message: z$1.string().optional()
396
+ });
397
+ const addressWhitelistCheckRequestSchema = z$1.object({ address: z$1.string() });
398
+ const addressWhitelistCheckResponseSchema = z$1.object({
399
+ isAllowed: z$1.boolean(),
400
+ message: z$1.string().optional()
638
401
  });
639
402
 
640
- // src/api/schemas/chain.ts
641
- import { z as z10 } from "zod";
642
- var chainIdSchema = z10.object({
643
- chainId: z10.number().nullable()
644
- });
645
- var setChainIdSchema = z10.object({
646
- chainId: z10.number().positive()
647
- });
648
- var chainSuccessResponseSchema = z10.object({
649
- success: z10.boolean(),
650
- chainId: z10.number().optional()
403
+ //#endregion
404
+ //#region src/api/schemas/chain.ts
405
+ const chainIdSchema = z$1.object({ chainId: z$1.number().nullable() });
406
+ const setChainIdSchema = z$1.object({ chainId: z$1.number().positive() });
407
+ const chainSuccessResponseSchema = z$1.object({
408
+ success: z$1.boolean(),
409
+ chainId: z$1.number().optional()
651
410
  });
652
411
 
653
- // src/api/schemas/config.ts
654
- import { z as z11 } from "zod";
655
- var getDelegateAddressSchema = z11.object({
656
- chainId: z11.number()
657
- });
658
- var getDelegateAddressResponseSchema = z11.object({
659
- otimDelegateAddress: z11.string()
660
- });
661
- var getConfigTokensRequestParametersSchema = z11.object({
662
- chainId: z11.number()
663
- });
664
- var getConfigTokensResponseSchema = z11.object({
665
- tokens: z11.array(
666
- z11.object({
667
- symbol: z11.any(),
668
- address: hexStringSchema
669
- })
670
- )
671
- });
672
- var getConfigChainsResponseSchema = z11.unknown();
673
- var getMaxPriorityFeePerGasEstimateSchema = z11.object({
674
- chainId: z11.number()
675
- });
676
- var getMaxPriorityFeePerGasEstimateResponseSchema = z11.object({
677
- slowMaxPriorityFeeEstimate: z11.number(),
678
- normalMaxPriorityFeeEstimate: z11.number(),
679
- fastMaxPriorityFeeEstimate: z11.number()
412
+ //#endregion
413
+ //#region src/api/schemas/config.ts
414
+ const getDelegateAddressSchema = z$1.object({ chainId: z$1.number() });
415
+ const getDelegateAddressResponseSchema = z$1.object({ otimDelegateAddress: z$1.string() });
416
+ const getConfigTokensRequestParametersSchema = z$1.object({ chainId: z$1.number() });
417
+ const getConfigTokensResponseSchema = z$1.object({ tokens: z$1.array(z$1.object({
418
+ symbol: z$1.any(),
419
+ address: hexStringSchema
420
+ })) });
421
+ const getConfigChainsResponseSchema = z$1.unknown();
422
+ const getMaxPriorityFeePerGasEstimateSchema = z$1.object({ chainId: z$1.number() });
423
+ const getMaxPriorityFeePerGasEstimateResponseSchema = z$1.object({
424
+ slowMaxPriorityFeeEstimate: z$1.number(),
425
+ normalMaxPriorityFeeEstimate: z$1.number(),
426
+ fastMaxPriorityFeeEstimate: z$1.number()
680
427
  });
681
428
 
682
- // src/api/schemas/contacts.ts
683
- import { z as z12 } from "zod";
684
- var newContactRequestSchema = z12.object({
685
- address: hexStringSchema,
686
- name: z12.string()
687
- });
688
- var getContactsRequestSchema = z12.object({
689
- perPage: numberSchema.optional(),
690
- page: numberSchema.optional()
691
- });
692
- var contactSchema = z12.object({
693
- userId: z12.string(),
694
- address: hexStringSchema,
695
- name: z12.string(),
696
- createdAt: z12.string(),
697
- updatedAt: z12.string()
698
- });
699
- var getContactsResponseSchema = z12.array(contactSchema);
429
+ //#endregion
430
+ //#region src/api/schemas/contacts.ts
431
+ const newContactRequestSchema = z$1.object({
432
+ address: hexStringSchema,
433
+ name: z$1.string()
434
+ });
435
+ const getContactsRequestSchema = z$1.object({
436
+ perPage: numberSchema.optional(),
437
+ page: numberSchema.optional()
438
+ });
439
+ const contactSchema = z$1.object({
440
+ userId: z$1.string(),
441
+ address: hexStringSchema,
442
+ name: z$1.string(),
443
+ createdAt: z$1.string(),
444
+ updatedAt: z$1.string()
445
+ });
446
+ const getContactsResponseSchema = z$1.array(contactSchema);
700
447
 
701
- // src/api/schemas/instruction.ts
702
- import { z as z13 } from "zod";
703
- var feeSchema = z13.object({
704
- executionFee: hexStringSchema,
705
- maxBaseFeePerGas: hexStringSchema,
706
- maxPriorityFeePerGas: hexStringSchema,
707
- token: hexStringSchema
708
- });
709
- var scheduleSchema = z13.object({
710
- startAt: numberSchema,
711
- startBy: numberSchema,
712
- interval: numberSchema,
713
- timeout: numberSchema
714
- });
715
- var baseActionArgumentsSchema = z13.object({
716
- target: hexStringSchema,
717
- fee: feeSchema,
718
- token: hexStringSchema
719
- });
720
- var refuelActionArgumentsSchema = baseActionArgumentsSchema.extend({
721
- threshold: numberSchema,
722
- endBalance: numberSchema,
723
- gasLimit: numberSchema
724
- });
725
- var refuelERC20ActionArgumentsSchema = baseActionArgumentsSchema.extend({
726
- threshold: numberSchema,
727
- endBalance: numberSchema,
728
- gasLimit: numberSchema
729
- });
730
- var transferActionArgumentsSchema = baseActionArgumentsSchema.extend({
731
- value: numberSchema,
732
- gasLimit: numberSchema,
733
- schedule: scheduleSchema
734
- });
735
- var transferERC20ActionArgumentsSchema = baseActionArgumentsSchema.extend({
736
- value: numberSchema,
737
- gasLimit: numberSchema,
738
- schedule: scheduleSchema
739
- });
740
- var sweepDepositAccountActionArgumentsSchema = baseActionArgumentsSchema.extend({
741
- threshold: numberSchema,
742
- recipient: hexStringSchema,
743
- depositorAddress: hexStringSchema
744
- });
745
- var sweepDepositAccountERC20ActionArgumentsSchema = baseActionArgumentsSchema.extend({
746
- threshold: numberSchema,
747
- recipient: hexStringSchema,
748
- depositorAddress: hexStringSchema
749
- });
750
- var uniswapV3ExactInputActionArgumentsSchema = z13.object({
751
- tokenIn: hexStringSchema,
752
- tokenOut: hexStringSchema,
753
- amountIn: numberSchema,
754
- floorAmountOut: numberSchema,
755
- feeTier: z13.string(),
756
- recipient: hexStringSchema,
757
- meanPriceLookBack: numberSchema,
758
- maxPriceDeviationBps: numberSchema,
759
- fee: feeSchema,
760
- schedule: scheduleSchema
761
- });
762
- var deactivateInstructionActionArgumentsSchema = z13.object({
763
- instructionId: hexStringSchema,
764
- fee: feeSchema
765
- });
766
- var actionArgumentsSchema = z13.union([
767
- refuelActionArgumentsSchema,
768
- refuelERC20ActionArgumentsSchema,
769
- transferActionArgumentsSchema,
770
- transferERC20ActionArgumentsSchema,
771
- sweepDepositAccountActionArgumentsSchema,
772
- sweepDepositAccountERC20ActionArgumentsSchema,
773
- uniswapV3ExactInputActionArgumentsSchema,
774
- deactivateInstructionActionArgumentsSchema
448
+ //#endregion
449
+ //#region src/api/schemas/instruction.ts
450
+ const feeSchema = z$1.object({
451
+ executionFee: hexStringSchema,
452
+ maxBaseFeePerGas: hexStringSchema,
453
+ maxPriorityFeePerGas: hexStringSchema,
454
+ token: hexStringSchema
455
+ });
456
+ const scheduleSchema = z$1.object({
457
+ startAt: numberSchema,
458
+ startBy: numberSchema,
459
+ interval: numberSchema,
460
+ timeout: numberSchema
461
+ });
462
+ const baseActionArgumentsSchema = z$1.object({
463
+ target: hexStringSchema,
464
+ fee: feeSchema,
465
+ token: hexStringSchema
466
+ });
467
+ const refuelActionArgumentsSchema = baseActionArgumentsSchema.extend({
468
+ threshold: numberSchema,
469
+ endBalance: numberSchema,
470
+ gasLimit: numberSchema
471
+ });
472
+ const refuelERC20ActionArgumentsSchema = baseActionArgumentsSchema.extend({
473
+ threshold: numberSchema,
474
+ endBalance: numberSchema,
475
+ gasLimit: numberSchema
476
+ });
477
+ const transferActionArgumentsSchema = baseActionArgumentsSchema.extend({
478
+ value: numberSchema,
479
+ gasLimit: numberSchema,
480
+ schedule: scheduleSchema
481
+ });
482
+ const transferERC20ActionArgumentsSchema = baseActionArgumentsSchema.extend({
483
+ value: numberSchema,
484
+ gasLimit: numberSchema,
485
+ schedule: scheduleSchema
486
+ });
487
+ const uniswapV3ExactInputActionArgumentsSchema = z$1.object({
488
+ tokenIn: hexStringSchema,
489
+ tokenOut: hexStringSchema,
490
+ amountIn: numberSchema,
491
+ floorAmountOut: numberSchema,
492
+ feeTier: z$1.string(),
493
+ recipient: hexStringSchema,
494
+ meanPriceLookBack: numberSchema,
495
+ maxPriceDeviationBps: numberSchema,
496
+ fee: feeSchema,
497
+ schedule: scheduleSchema
498
+ });
499
+ const deactivateInstructionActionArgumentsSchema = z$1.object({
500
+ instructionId: hexStringSchema,
501
+ fee: feeSchema
502
+ });
503
+ const depositERC4626ActionArgumentsSchema = z$1.object({
504
+ vault: hexStringSchema,
505
+ recipient: hexStringSchema,
506
+ value: numberSchema,
507
+ minDeposit: numberSchema,
508
+ minTotalShares: numberSchema,
509
+ schedule: scheduleSchema,
510
+ fee: feeSchema
511
+ });
512
+ const sweepDepositERC4626ActionArgumentsSchema = z$1.object({
513
+ vault: hexStringSchema,
514
+ recipient: hexStringSchema,
515
+ threshold: numberSchema,
516
+ endBalance: numberSchema,
517
+ minDeposit: numberSchema,
518
+ minTotalShares: numberSchema,
519
+ fee: feeSchema
520
+ });
521
+ const withdrawERC4626ActionArgumentsSchema = z$1.object({
522
+ vault: hexStringSchema,
523
+ recipient: hexStringSchema,
524
+ value: numberSchema,
525
+ minWithdraw: numberSchema,
526
+ schedule: scheduleSchema,
527
+ fee: feeSchema
528
+ });
529
+ const sweepWithdrawERC4626ActionArgumentsSchema = z$1.object({
530
+ vault: hexStringSchema,
531
+ recipient: hexStringSchema,
532
+ threshold: numberSchema,
533
+ endBalance: numberSchema,
534
+ minWithdraw: numberSchema,
535
+ fee: feeSchema
536
+ });
537
+ const actionArgumentsSchema = z$1.union([
538
+ refuelActionArgumentsSchema,
539
+ refuelERC20ActionArgumentsSchema,
540
+ transferActionArgumentsSchema,
541
+ transferERC20ActionArgumentsSchema,
542
+ uniswapV3ExactInputActionArgumentsSchema,
543
+ deactivateInstructionActionArgumentsSchema,
544
+ depositERC4626ActionArgumentsSchema,
545
+ sweepDepositERC4626ActionArgumentsSchema,
546
+ withdrawERC4626ActionArgumentsSchema,
547
+ sweepWithdrawERC4626ActionArgumentsSchema
775
548
  ]);
776
- var feeResponseSchema = z13.object({
777
- token: hexStringSchema,
778
- executionFee: hexStringSchema,
779
- maxBaseFeePerGas: hexStringSchema,
780
- maxPriorityFeePerGas: hexStringSchema
781
- });
782
- var scheduleResponseSchema = z13.object({
783
- startAt: hexStringSchema,
784
- startBy: hexStringSchema,
785
- interval: hexStringSchema,
786
- timeout: hexStringSchema
787
- });
788
- var refuelActionResponseSchema = z13.object({
789
- target: hexStringSchema,
790
- threshold: hexStringSchema,
791
- endBalance: hexStringSchema,
792
- gasLimit: hexStringSchema,
793
- fee: feeResponseSchema
794
- });
795
- var transferActionResponseSchema = z13.object({
796
- target: hexStringSchema,
797
- value: hexStringSchema,
798
- gasLimit: hexStringSchema,
799
- schedule: scheduleResponseSchema,
800
- fee: feeResponseSchema
801
- });
802
- var refuelERC20ActionResponseSchema = z13.object({
803
- token: hexStringSchema,
804
- target: hexStringSchema,
805
- threshold: hexStringSchema,
806
- endBalance: hexStringSchema,
807
- fee: feeResponseSchema
808
- });
809
- var transferERC20ActionResponseSchema = z13.object({
810
- token: hexStringSchema,
811
- target: hexStringSchema,
812
- value: hexStringSchema,
813
- schedule: scheduleResponseSchema,
814
- fee: feeResponseSchema
815
- });
816
- var actionArgumentsResponseSchema = z13.union([
817
- refuelActionResponseSchema,
818
- transferActionResponseSchema,
819
- refuelERC20ActionResponseSchema,
820
- transferERC20ActionResponseSchema
549
+ const feeResponseSchema$1 = z$1.object({
550
+ token: hexStringSchema,
551
+ executionFee: hexStringSchema,
552
+ maxBaseFeePerGas: hexStringSchema,
553
+ maxPriorityFeePerGas: hexStringSchema
554
+ });
555
+ const scheduleResponseSchema = z$1.object({
556
+ startAt: hexStringSchema,
557
+ startBy: hexStringSchema,
558
+ interval: hexStringSchema,
559
+ timeout: hexStringSchema
560
+ });
561
+ const refuelActionResponseSchema = z$1.object({
562
+ target: hexStringSchema,
563
+ threshold: hexStringSchema,
564
+ endBalance: hexStringSchema,
565
+ gasLimit: hexStringSchema,
566
+ fee: feeResponseSchema$1
567
+ });
568
+ const transferActionResponseSchema = z$1.object({
569
+ target: hexStringSchema,
570
+ value: hexStringSchema,
571
+ gasLimit: hexStringSchema,
572
+ schedule: scheduleResponseSchema,
573
+ fee: feeResponseSchema$1
574
+ });
575
+ const refuelERC20ActionResponseSchema = z$1.object({
576
+ token: hexStringSchema,
577
+ target: hexStringSchema,
578
+ threshold: hexStringSchema,
579
+ endBalance: hexStringSchema,
580
+ fee: feeResponseSchema$1
581
+ });
582
+ const transferERC20ActionResponseSchema = z$1.object({
583
+ token: hexStringSchema,
584
+ target: hexStringSchema,
585
+ value: hexStringSchema,
586
+ schedule: scheduleResponseSchema,
587
+ fee: feeResponseSchema$1
588
+ });
589
+ const actionArgumentsResponseSchema = z$1.union([
590
+ refuelActionResponseSchema,
591
+ transferActionResponseSchema,
592
+ refuelERC20ActionResponseSchema,
593
+ transferERC20ActionResponseSchema
821
594
  ]);
822
- var instructionBuildSchema = z13.object({
823
- action: hexStringSchema,
824
- arguments: hexStringSchema,
825
- maxExecutions: hexStringSchema,
826
- salt: hexStringSchema,
827
- nickname: z13.string().nullish()
828
- });
829
- var instructionGetAllRequestSchema = z13.object({
830
- address: hexStringSchema,
831
- chainId: z13.number(),
832
- page: z13.number().optional(),
833
- perPage: z13.number().optional()
834
- });
835
- var instructionGetAllResponseSchema = z13.array(instructionSchema);
836
- var instructionBuildRequestSchema = z13.object({
837
- address: hexStringSchema,
838
- chainId: z13.number(),
839
- salt: z13.number(),
840
- maxExecutions: z13.number(),
841
- actionArguments: z13.record(z13.string(), actionArgumentsSchema).refine(
842
- (args) => {
843
- const keys = Object.keys(args);
844
- return keys.length === 1 && instructionActionValues.includes(
845
- keys[0]
846
- );
847
- },
848
- {
849
- message: "actionArguments must contain exactly one valid instruction action"
850
- }
851
- )
852
- });
853
- var instructionActivateRequestSchema = z13.object({
854
- nickname: z13.string().optional(),
855
- address: hexStringSchema,
856
- chainId: z13.number(),
857
- salt: hexStringSchema,
858
- maxExecutions: hexStringSchema,
859
- action: hexStringSchema,
860
- arguments: hexStringSchema,
861
- activationSignature: eip2098SignatureSchema
862
- });
863
- var instructionActivateResponseSchema = z13.object({
864
- instructionId: hexStringSchema
865
- });
866
- var instructionDeactivateRequestSchema = z13.object({
867
- address: hexStringSchema,
868
- chainId: z13.number(),
869
- deactivation: z13.object({
870
- instructionId: hexStringSchema
871
- }),
872
- deactivationSignature: eip2098SignatureSchema
873
- });
874
- var instructionDeactivateResponseSchema = z13.unknown();
875
- var instructionDetailsRequestSchema = z13.object({
876
- address: hexStringSchema,
877
- instructionId: hexStringSchema,
878
- chainId: z13.number()
879
- });
880
- var instructionDetailsResponseSchema = z13.object({
881
- action: hexStringSchema,
882
- actionArguments: z13.any(),
883
- actionName: z13.string().nullish(),
884
- salt: hexStringSchema,
885
- maxExecutions: hexStringSchema,
886
- nickname: z13.string().nullish(),
887
- lastErrorCode: z13.number().int(),
888
- lastErrorMessage: z13.string().nullish()
889
- });
890
- var instructionGetRulesRequestSchema = z13.object({
891
- chainId: z13.number(),
892
- page: z13.number().optional(),
893
- perPage: z13.number().optional()
894
- });
895
- var instructionGetRulesResponseSchema = z13.array(
896
- instructionSchema
897
- );
595
+ const instructionBuildSchema = z$1.object({
596
+ action: hexStringSchema,
597
+ arguments: hexStringSchema,
598
+ maxExecutions: hexStringSchema,
599
+ salt: hexStringSchema,
600
+ nickname: z$1.string().nullish()
601
+ });
602
+ const instructionGetAllRequestSchema = z$1.object({
603
+ address: hexStringSchema,
604
+ chainId: z$1.number(),
605
+ actionName: z$1.string().optional(),
606
+ page: z$1.number().optional(),
607
+ perPage: z$1.number().optional()
608
+ });
609
+ const instructionGetAllResponseSchema = z$1.array(instructionSchema);
610
+ const instructionBuildRequestSchema = z$1.object({
611
+ address: hexStringSchema,
612
+ chainId: z$1.number(),
613
+ salt: z$1.number(),
614
+ maxExecutions: z$1.number(),
615
+ actionArguments: z$1.record(z$1.string(), actionArgumentsSchema).refine((args) => {
616
+ const keys = Object.keys(args);
617
+ return keys.length === 1 && instructionActionValues.includes(keys[0]);
618
+ }, { message: "actionArguments must contain exactly one valid instruction action" })
619
+ });
620
+ const instructionActivateRequestSchema = z$1.object({
621
+ nickname: z$1.string().optional(),
622
+ address: hexStringSchema,
623
+ chainId: z$1.number(),
624
+ salt: hexStringSchema,
625
+ maxExecutions: hexStringSchema,
626
+ action: hexStringSchema,
627
+ arguments: hexStringSchema,
628
+ activationSignature: eip2098SignatureSchema
629
+ });
630
+ const instructionActivateResponseSchema = z$1.object({ instructionId: hexStringSchema });
631
+ const instructionDeactivateRequestSchema = z$1.object({
632
+ address: hexStringSchema,
633
+ chainId: z$1.number(),
634
+ deactivation: z$1.object({ instructionId: hexStringSchema }),
635
+ deactivationSignature: eip2098SignatureSchema
636
+ });
637
+ const instructionDeactivateResponseSchema = z$1.unknown();
638
+ const instructionDetailsRequestSchema = z$1.object({
639
+ address: hexStringSchema,
640
+ instructionId: hexStringSchema,
641
+ chainId: z$1.number()
642
+ });
643
+ const instructionDetailsResponseSchema = z$1.object({
644
+ action: hexStringSchema,
645
+ actionArguments: z$1.any(),
646
+ actionName: z$1.string().nullish(),
647
+ salt: hexStringSchema,
648
+ maxExecutions: hexStringSchema,
649
+ nickname: z$1.string().nullish(),
650
+ lastErrorCode: z$1.number().int(),
651
+ lastErrorMessage: z$1.string().nullish()
652
+ });
653
+ const instructionGetRulesRequestSchema = z$1.object({
654
+ chainId: z$1.number(),
655
+ page: z$1.number().optional(),
656
+ perPage: z$1.number().optional()
657
+ });
658
+ const instructionGetRulesResponseSchema = z$1.array(instructionSchema);
898
659
 
899
- // src/api/schemas/integration.ts
900
- import { z as z14 } from "zod";
901
- var IntegrationType = {
902
- Bank: "Bank",
903
- Clio: "Clio",
904
- Stripe: "Stripe",
905
- QuickBooks: "QuickBooks",
906
- Bill: "Bill",
907
- Zoho: "Zoho"
660
+ //#endregion
661
+ //#region src/api/schemas/integration.ts
662
+ const IntegrationType = {
663
+ Bank: "Bank",
664
+ Clio: "Clio",
665
+ Stripe: "Stripe",
666
+ QuickBooks: "QuickBooks",
667
+ Bill: "Bill",
668
+ Zoho: "Zoho"
908
669
  };
909
- var integrationTypeValues = [
910
- IntegrationType.Bank,
911
- IntegrationType.Clio,
912
- IntegrationType.Stripe,
913
- IntegrationType.QuickBooks,
914
- IntegrationType.Bill,
915
- IntegrationType.Zoho
670
+ const integrationTypeValues = [
671
+ IntegrationType.Bank,
672
+ IntegrationType.Clio,
673
+ IntegrationType.Stripe,
674
+ IntegrationType.QuickBooks,
675
+ IntegrationType.Bill,
676
+ IntegrationType.Zoho
916
677
  ];
917
- var quickBooksDetailsSchema = z14.object({
918
- accessToken: z14.string().optional(),
919
- refreshToken: z14.string().optional(),
920
- realmId: z14.string().optional(),
921
- tokenType: z14.string().optional(),
922
- expiresIn: z14.number().optional(),
923
- xRefreshTokenExpiresIn: z14.number().optional()
924
- });
925
- var stripeTokensSchema = z14.object({
926
- accessToken: z14.string(),
927
- refreshToken: z14.string().optional()
928
- });
929
- var stripeDetailsSchema = z14.object({
930
- clientId: z14.string().optional(),
931
- clientSecret: z14.string().optional(),
932
- tokens: stripeTokensSchema.optional()
933
- });
934
- var billcomDetailsSchema = z14.object({
935
- devKey: z14.string().optional(),
936
- sessionId: z14.string().optional(),
937
- orgId: z14.string().optional(),
938
- rememberMeId: z14.string().optional()
939
- });
940
- var liquidationAddressSchema = z14.object({
941
- liquidationAddressId: z14.string(),
942
- address: z14.string(),
943
- chain: z14.string(),
944
- currency: z14.string(),
945
- blockchainMemo: z14.string().optional()
946
- });
947
- var plaidAccountSchema = z14.object({
948
- accountId: z14.string(),
949
- name: z14.string().optional(),
950
- mask: z14.string().optional(),
951
- subtype: z14.string().optional(),
952
- externalAccountId: z14.string().optional(),
953
- liquidationAddress: liquidationAddressSchema.optional()
954
- });
955
- var plaidConnectionSchema = z14.object({
956
- accessToken: z14.string(),
957
- itemId: z14.string(),
958
- institutionId: z14.string().optional(),
959
- institutionName: z14.string().optional(),
960
- accounts: z14.array(plaidAccountSchema)
961
- });
962
- var bridgeConnectionSchema = z14.object({
963
- customerId: z14.string(),
964
- kycLinkId: z14.string().optional(),
965
- kycLink: z14.string().optional(),
966
- tosLink: z14.string().optional(),
967
- completedSteps: z14.array(z14.string()).optional()
968
- });
969
- var bankDetailsSchema = z14.object({
970
- plaid: z14.array(plaidConnectionSchema).optional(),
971
- bridge: z14.array(bridgeConnectionSchema).optional()
972
- });
973
- var integrationTypeSchema = z14.enum(integrationTypeValues);
974
- var updateIntegrationRequestSchema = z14.discriminatedUnion(
975
- "integrationType",
976
- [
977
- z14.object({
978
- integrationType: z14.literal(IntegrationType.QuickBooks),
979
- details: quickBooksDetailsSchema
980
- }),
981
- z14.object({
982
- integrationType: z14.literal(IntegrationType.Bank),
983
- details: bankDetailsSchema
984
- }),
985
- z14.object({
986
- integrationType: z14.literal(IntegrationType.Clio),
987
- details: z14.unknown()
988
- }),
989
- z14.object({
990
- integrationType: z14.literal(IntegrationType.Stripe),
991
- details: stripeDetailsSchema
992
- }),
993
- z14.object({
994
- integrationType: z14.literal(IntegrationType.Bill),
995
- details: billcomDetailsSchema
996
- }),
997
- z14.object({
998
- integrationType: z14.literal(IntegrationType.Zoho),
999
- details: z14.unknown()
1000
- })
1001
- ]
1002
- );
1003
- var getIntegrationRequestSchema = z14.object({
1004
- integrationType: integrationTypeSchema
1005
- });
1006
- var integrationResponseSchema = z14.discriminatedUnion(
1007
- "integrationType",
1008
- [
1009
- z14.object({
1010
- integrationType: z14.literal(IntegrationType.QuickBooks),
1011
- details: quickBooksDetailsSchema
1012
- }),
1013
- z14.object({
1014
- integrationType: z14.literal(IntegrationType.Bank),
1015
- details: bankDetailsSchema
1016
- }),
1017
- z14.object({
1018
- integrationType: z14.literal(IntegrationType.Clio),
1019
- details: z14.unknown()
1020
- }),
1021
- z14.object({
1022
- integrationType: z14.literal(IntegrationType.Stripe),
1023
- details: stripeDetailsSchema
1024
- }),
1025
- z14.object({
1026
- integrationType: z14.literal(IntegrationType.Bill),
1027
- details: billcomDetailsSchema
1028
- }),
1029
- z14.object({
1030
- integrationType: z14.literal(IntegrationType.Zoho),
1031
- details: z14.unknown()
1032
- })
1033
- ]
1034
- );
678
+ const quickBooksDetailsSchema = z$1.object({
679
+ accessToken: z$1.string().optional(),
680
+ refreshToken: z$1.string().optional(),
681
+ realmId: z$1.string().optional(),
682
+ tokenType: z$1.string().optional(),
683
+ expiresIn: z$1.number().optional(),
684
+ xRefreshTokenExpiresIn: z$1.number().optional()
685
+ });
686
+ const stripeTokensSchema = z$1.object({
687
+ accessToken: z$1.string(),
688
+ refreshToken: z$1.string().optional()
689
+ });
690
+ const stripeDetailsSchema = z$1.object({
691
+ clientId: z$1.string().optional(),
692
+ clientSecret: z$1.string().optional(),
693
+ tokens: stripeTokensSchema.optional()
694
+ });
695
+ const billcomDetailsSchema = z$1.object({
696
+ devKey: z$1.string().optional(),
697
+ sessionId: z$1.string().optional(),
698
+ orgId: z$1.string().optional(),
699
+ rememberMeId: z$1.string().optional()
700
+ });
701
+ const liquidationAddressSchema = z$1.object({
702
+ liquidationAddressId: z$1.string(),
703
+ address: z$1.string(),
704
+ chain: z$1.string(),
705
+ currency: z$1.string(),
706
+ blockchainMemo: z$1.string().optional()
707
+ });
708
+ const plaidAccountSchema = z$1.object({
709
+ accountId: z$1.string(),
710
+ name: z$1.string().optional(),
711
+ mask: z$1.string().optional(),
712
+ subtype: z$1.string().optional(),
713
+ externalAccountId: z$1.string().optional(),
714
+ liquidationAddress: liquidationAddressSchema.optional()
715
+ });
716
+ const plaidConnectionSchema = z$1.object({
717
+ accessToken: z$1.string(),
718
+ itemId: z$1.string(),
719
+ institutionId: z$1.string().optional(),
720
+ institutionName: z$1.string().optional(),
721
+ accounts: z$1.array(plaidAccountSchema)
722
+ });
723
+ const bridgeConnectionSchema = z$1.object({
724
+ customerId: z$1.string(),
725
+ kycLinkId: z$1.string().optional(),
726
+ kycLink: z$1.string().optional(),
727
+ tosLink: z$1.string().optional(),
728
+ completedSteps: z$1.array(z$1.string()).optional()
729
+ });
730
+ const bankDetailsSchema = z$1.object({
731
+ plaid: z$1.array(plaidConnectionSchema).optional(),
732
+ bridge: z$1.array(bridgeConnectionSchema).optional()
733
+ });
734
+ const integrationTypeSchema = z$1.enum(integrationTypeValues);
735
+ const updateIntegrationRequestSchema = z$1.discriminatedUnion("integrationType", [
736
+ z$1.object({
737
+ integrationType: z$1.literal(IntegrationType.QuickBooks),
738
+ details: quickBooksDetailsSchema
739
+ }),
740
+ z$1.object({
741
+ integrationType: z$1.literal(IntegrationType.Bank),
742
+ details: bankDetailsSchema
743
+ }),
744
+ z$1.object({
745
+ integrationType: z$1.literal(IntegrationType.Clio),
746
+ details: z$1.unknown()
747
+ }),
748
+ z$1.object({
749
+ integrationType: z$1.literal(IntegrationType.Stripe),
750
+ details: stripeDetailsSchema
751
+ }),
752
+ z$1.object({
753
+ integrationType: z$1.literal(IntegrationType.Bill),
754
+ details: billcomDetailsSchema
755
+ }),
756
+ z$1.object({
757
+ integrationType: z$1.literal(IntegrationType.Zoho),
758
+ details: z$1.unknown()
759
+ })
760
+ ]);
761
+ const getIntegrationRequestSchema = z$1.object({ integrationType: integrationTypeSchema });
762
+ const integrationResponseSchema = z$1.discriminatedUnion("integrationType", [
763
+ z$1.object({
764
+ integrationType: z$1.literal(IntegrationType.QuickBooks),
765
+ details: quickBooksDetailsSchema
766
+ }),
767
+ z$1.object({
768
+ integrationType: z$1.literal(IntegrationType.Bank),
769
+ details: bankDetailsSchema
770
+ }),
771
+ z$1.object({
772
+ integrationType: z$1.literal(IntegrationType.Clio),
773
+ details: z$1.unknown()
774
+ }),
775
+ z$1.object({
776
+ integrationType: z$1.literal(IntegrationType.Stripe),
777
+ details: stripeDetailsSchema
778
+ }),
779
+ z$1.object({
780
+ integrationType: z$1.literal(IntegrationType.Bill),
781
+ details: billcomDetailsSchema
782
+ }),
783
+ z$1.object({
784
+ integrationType: z$1.literal(IntegrationType.Zoho),
785
+ details: z$1.unknown()
786
+ })
787
+ ]);
1035
788
 
1036
- // src/api/schemas/operating-account.ts
1037
- import { z as z15 } from "zod";
1038
- var newOperatingAccountSubOrgResponseSchema = z15.object({
1039
- subOrganizationId: z15.string(),
1040
- endUserId: z15.string()
1041
- });
1042
- var getOperatingAccountSubOrgResponseSchema = z15.object({
1043
- subOrganizationId: z15.string()
789
+ //#endregion
790
+ //#region src/api/schemas/operating-account.ts
791
+ const newOperatingAccountSubOrgResponseSchema = z$1.object({
792
+ subOrganizationId: z$1.string(),
793
+ endUserId: z$1.string()
1044
794
  });
795
+ const getOperatingAccountSubOrgResponseSchema = z$1.object({ subOrganizationId: z$1.string() });
1045
796
 
1046
- // src/api/schemas/payments.ts
1047
- import { z as z16 } from "zod";
1048
- var paymentRequestsDirectionSchema = z16.enum(["from", "to"]);
1049
- var getPaymentRequestsRequestSchema = z16.object({
1050
- direction: paymentRequestsDirectionSchema,
1051
- statuses: z16.array(z16.enum(["pending", "inProgress", "paid", "cancelled", "draft"])).optional(),
1052
- perPage: numberSchema.optional(),
1053
- page: numberSchema.optional()
1054
- });
1055
- var paymentRequestStatusSchema = z16.enum([
1056
- "pending",
1057
- "inProgress",
1058
- "paid",
1059
- "cancelled",
1060
- "draft"
797
+ //#endregion
798
+ //#region src/api/schemas/payments.ts
799
+ const paymentRequestsDirectionSchema = z$1.enum(["from", "to"]);
800
+ const orchestrationTypeSchema = z$1.enum(["AutoEarn", "PaymentRequest"]);
801
+ const getPaymentRequestsRequestSchema = z$1.object({
802
+ direction: paymentRequestsDirectionSchema,
803
+ statuses: z$1.array(z$1.enum([
804
+ "pending",
805
+ "inProgress",
806
+ "paid",
807
+ "cancelled",
808
+ "draft"
809
+ ])).optional(),
810
+ perPage: numberSchema.optional(),
811
+ page: numberSchema.optional(),
812
+ orchestrationType: orchestrationTypeSchema.optional()
813
+ });
814
+ const paymentRequestStatusSchema = z$1.enum([
815
+ "pending",
816
+ "inProgress",
817
+ "paid",
818
+ "cancelled",
819
+ "draft"
1061
820
  ]);
1062
- var paymentRequestSchema = z16.object({
1063
- id: z16.string(),
1064
- fromUserId: z16.string(),
1065
- toUserId: z16.string().nullable(),
1066
- payerAddress: hexStringSchema.nullable(),
1067
- ephemeralWalletAddress: hexStringSchema,
1068
- instructions: z16.object({
1069
- ids: z16.array(z16.string()),
1070
- completionIds: z16.array(z16.string())
1071
- }),
1072
- metadata: z16.record(z16.string(), z16.unknown()),
1073
- status: paymentRequestStatusSchema,
1074
- createdAt: z16.string(),
1075
- updatedAt: z16.string()
1076
- });
1077
- var getPaymentRequestsResponseSchema = z16.array(paymentRequestSchema);
1078
- var buildEphemeralInstructionSchema = z16.object({
1079
- chainId: z16.number(),
1080
- salt: numberSchema,
1081
- maxExecutions: numberSchema,
1082
- actionArguments: z16.record(z16.string(), z16.unknown()),
1083
- setEphemeralTarget: z16.boolean().optional()
1084
- });
1085
- var paymentRequestBuildRequestSchema = z16.object({
1086
- payerAddress: hexStringSchema.nullish(),
1087
- completionInstructions: z16.array(buildEphemeralInstructionSchema),
1088
- instructions: z16.array(buildEphemeralInstructionSchema),
1089
- metadata: z16.record(z16.string(), z16.unknown()).optional().default({}),
1090
- maxRuns: z16.number().int().positive({ message: "maxRuns must be greater than 0" }).max(Number.MAX_SAFE_INTEGER, {
1091
- message: "maxRuns must be less than MAX_SAFE_INTEGER"
1092
- }).optional()
1093
- });
1094
- var feeResponseSchema2 = z16.object({
1095
- token: hexStringSchema,
1096
- executionFee: hexStringSchema,
1097
- maxBaseFeePerGas: hexStringSchema,
1098
- maxPriorityFeePerGas: hexStringSchema
1099
- });
1100
- var buildInstructionResponseSchema = z16.object({
1101
- address: hexStringSchema,
1102
- chainId: z16.number(),
1103
- salt: hexStringSchema,
1104
- maxExecutions: hexStringSchema,
1105
- action: hexStringSchema,
1106
- actionName: z16.string().optional(),
1107
- arguments: hexStringSchema
1108
- });
1109
- var paymentRequestBuildResponseSchema = z16.object({
1110
- requestId: z16.string(),
1111
- subOrgId: z16.string(),
1112
- walletId: z16.string(),
1113
- ephemeralWalletAddress: hexStringSchema,
1114
- completionInstructions: z16.array(buildInstructionResponseSchema),
1115
- instructions: z16.array(buildInstructionResponseSchema)
1116
- });
1117
- var newInstructionRequestSchema = z16.object({
1118
- nickname: z16.string().optional(),
1119
- actionName: z16.string().optional(),
1120
- address: hexStringSchema,
1121
- chainId: z16.number(),
1122
- salt: hexStringSchema,
1123
- maxExecutions: hexStringSchema,
1124
- action: hexStringSchema,
1125
- arguments: hexStringSchema,
1126
- activationSignature: eip2098SignatureSchema
1127
- });
1128
- var paymentRequestNewRequestSchema = z16.object({
1129
- requestId: z16.string(),
1130
- signedAuthorization: z16.string(),
1131
- completionInstructions: z16.array(newInstructionRequestSchema),
1132
- instructions: z16.array(newInstructionRequestSchema)
1133
- });
1134
- var paymentRequestDetailsRequestSchema = z16.object({
1135
- requestId: z16.string()
1136
- });
1137
- var paymentRequestDetailsResponseSchema = z16.object({
1138
- requestId: z16.string(),
1139
- ephemeralWalletAddress: hexStringSchema,
1140
- ephemeralWalletId: z16.string().optional(),
1141
- status: z16.enum(["pending", "inProgress", "paid", "cancelled", "draft"]),
1142
- metadata: z16.record(z16.string(), z16.unknown()),
1143
- numRuns: z16.number(),
1144
- maxRuns: z16.number().optional()
1145
- });
1146
- var buildSettlementRequestSchema = z16.object({
1147
- acceptedTokens: z16.record(z16.string(), z16.array(hexStringSchema)),
1148
- settlementChain: z16.number(),
1149
- settlementToken: hexStringSchema,
1150
- settlementAmount: numberSchema,
1151
- recipientAddress: hexStringSchema,
1152
- metadata: z16.record(z16.string(), z16.unknown()),
1153
- payerAddress: hexStringSchema.nullish(),
1154
- dueDate: z16.string().datetime().nullish(),
1155
- maxRuns: z16.number().int().positive().nullish()
1156
- });
1157
- var buildSettlementResponseSchema = z16.object({
1158
- requestId: z16.string(),
1159
- subOrgId: z16.string(),
1160
- walletId: z16.string(),
1161
- ephemeralWalletAddress: hexStringSchema,
1162
- completionInstructions: z16.array(buildInstructionResponseSchema),
1163
- instructions: z16.array(buildInstructionResponseSchema)
821
+ const paymentRequestSchema = z$1.object({
822
+ id: z$1.string(),
823
+ fromUserId: z$1.string(),
824
+ toUserId: z$1.string().nullable(),
825
+ payerAddress: hexStringSchema.nullable(),
826
+ ephemeralWalletAddress: hexStringSchema,
827
+ instructions: z$1.object({
828
+ ids: z$1.array(z$1.string()),
829
+ completionIds: z$1.array(z$1.string())
830
+ }),
831
+ metadata: z$1.record(z$1.string(), z$1.unknown()),
832
+ status: paymentRequestStatusSchema,
833
+ createdAt: z$1.string(),
834
+ updatedAt: z$1.string()
835
+ });
836
+ const getPaymentRequestsResponseSchema = z$1.array(paymentRequestSchema);
837
+ const buildEphemeralInstructionSchema = z$1.object({
838
+ chainId: z$1.number(),
839
+ salt: numberSchema,
840
+ maxExecutions: numberSchema,
841
+ actionArguments: z$1.record(z$1.string(), z$1.unknown()),
842
+ setEphemeralTarget: z$1.boolean().optional()
843
+ });
844
+ const paymentRequestBuildRequestSchema = z$1.object({
845
+ payerAddress: hexStringSchema.nullish(),
846
+ completionInstructions: z$1.array(buildEphemeralInstructionSchema),
847
+ instructions: z$1.array(buildEphemeralInstructionSchema),
848
+ metadata: z$1.record(z$1.string(), z$1.unknown()).optional().default({}),
849
+ maxRuns: z$1.number().int().positive({ message: "maxRuns must be greater than 0" }).max(Number.MAX_SAFE_INTEGER, { message: "maxRuns must be less than MAX_SAFE_INTEGER" }).optional()
850
+ });
851
+ const feeResponseSchema = z$1.object({
852
+ token: hexStringSchema,
853
+ executionFee: hexStringSchema,
854
+ maxBaseFeePerGas: hexStringSchema,
855
+ maxPriorityFeePerGas: hexStringSchema
856
+ });
857
+ const buildInstructionResponseSchema = z$1.object({
858
+ address: hexStringSchema,
859
+ chainId: z$1.number(),
860
+ salt: hexStringSchema,
861
+ maxExecutions: hexStringSchema,
862
+ action: hexStringSchema,
863
+ actionName: z$1.string().optional(),
864
+ arguments: hexStringSchema
865
+ });
866
+ const paymentRequestBuildResponseSchema = z$1.object({
867
+ requestId: z$1.string(),
868
+ subOrgId: z$1.string(),
869
+ walletId: z$1.string(),
870
+ ephemeralWalletAddress: hexStringSchema,
871
+ completionInstructions: z$1.array(buildInstructionResponseSchema),
872
+ instructions: z$1.array(buildInstructionResponseSchema)
873
+ });
874
+ const newInstructionRequestSchema = z$1.object({
875
+ nickname: z$1.string().optional(),
876
+ actionName: z$1.string().optional(),
877
+ address: hexStringSchema,
878
+ chainId: z$1.number(),
879
+ salt: hexStringSchema,
880
+ maxExecutions: hexStringSchema,
881
+ action: hexStringSchema,
882
+ arguments: hexStringSchema,
883
+ activationSignature: eip2098SignatureSchema
884
+ });
885
+ const paymentRequestNewRequestSchema = z$1.object({
886
+ requestId: z$1.string(),
887
+ signedAuthorization: z$1.string(),
888
+ completionInstructions: z$1.array(newInstructionRequestSchema),
889
+ instructions: z$1.array(newInstructionRequestSchema)
890
+ });
891
+ const paymentRequestDetailsRequestSchema = z$1.object({ requestId: z$1.string() });
892
+ const paymentRequestDetailsResponseSchema = z$1.object({
893
+ requestId: z$1.string(),
894
+ ephemeralWalletAddress: hexStringSchema,
895
+ ephemeralWalletId: z$1.string().optional(),
896
+ status: z$1.enum([
897
+ "pending",
898
+ "inProgress",
899
+ "paid",
900
+ "cancelled",
901
+ "draft"
902
+ ]),
903
+ metadata: z$1.record(z$1.string(), z$1.unknown()),
904
+ numRuns: z$1.number(),
905
+ maxRuns: z$1.number().nullish()
906
+ });
907
+ const settlementParamsSchema = z$1.object({
908
+ acceptedTokens: z$1.record(z$1.string(), z$1.array(hexStringSchema)),
909
+ settlementChainId: z$1.number(),
910
+ settlementToken: hexStringSchema,
911
+ settlementAmount: numberSchema,
912
+ recipientAddress: hexStringSchema
913
+ });
914
+ const vaultWithdrawSettlementParamsSchema = z$1.object({
915
+ vaultAddress: hexStringSchema,
916
+ vaultUnderlyingToken: hexStringSchema,
917
+ vaultChainId: z$1.number(),
918
+ settlementChainId: z$1.number(),
919
+ settlementToken: hexStringSchema,
920
+ recipientAddress: hexStringSchema,
921
+ withdrawAmount: numberSchema
922
+ });
923
+ const orchestrationParamsSchema = z$1.union([z$1.object({ settlement: settlementParamsSchema }), z$1.object({ vaultWithdrawSettlement: vaultWithdrawSettlementParamsSchema })]);
924
+ const buildSettlementRequestSchema = z$1.object({
925
+ params: orchestrationParamsSchema,
926
+ payerAddress: hexStringSchema.nullish(),
927
+ metadata: z$1.record(z$1.string(), z$1.unknown()).optional(),
928
+ dueDate: z$1.string().datetime().nullish(),
929
+ maxRuns: z$1.number().int().positive().nullish()
930
+ });
931
+ const buildSettlementResponseSchema = z$1.object({
932
+ requestId: z$1.string(),
933
+ subOrgId: z$1.string(),
934
+ walletId: z$1.string(),
935
+ ephemeralWalletAddress: hexStringSchema,
936
+ completionInstructions: z$1.array(buildInstructionResponseSchema),
937
+ instructions: z$1.array(buildInstructionResponseSchema)
1164
938
  });
1165
939
 
1166
- // src/api/schemas/transaction.ts
1167
- import { z as z17 } from "zod";
1168
- var transactionGetListRequestSchema = z17.object({
1169
- address: hexStringSchema,
1170
- chainId: z17.number(),
1171
- instructionIds: z17.array(z17.string()).optional(),
1172
- from: z17.string().optional(),
1173
- to: z17.string().optional(),
1174
- page: z17.number().optional(),
1175
- perPage: z17.number().optional(),
1176
- sort: z17.enum(sortValues).optional()
1177
- });
1178
- var transactionGetListResponseSchema = z17.array(transactionSchema);
940
+ //#endregion
941
+ //#region src/api/schemas/transaction.ts
942
+ const transactionGetListRequestSchema = z$1.object({
943
+ address: hexStringSchema,
944
+ chainId: z$1.number(),
945
+ instructionIds: z$1.array(z$1.string()).optional(),
946
+ from: z$1.string().optional(),
947
+ to: z$1.string().optional(),
948
+ page: z$1.number().optional(),
949
+ perPage: z$1.number().optional(),
950
+ sort: z$1.enum(sortValues).optional()
951
+ });
952
+ const transactionGetListResponseSchema = z$1.array(transactionSchema);
1179
953
 
1180
- // src/env.ts
1181
- var BUILD_MODE = "development";
1182
-
1183
- // src/helpers/logger.ts
1184
- var Logger = class {
1185
- constructor() {
1186
- __publicField(this, "isDevelopment", BUILD_MODE === "development");
1187
- }
1188
- debug(message, options) {
1189
- if (this.isDevelopment) {
1190
- this.log("debug", message, options);
1191
- }
1192
- }
1193
- info(message, options) {
1194
- this.log("info", message, options);
1195
- }
1196
- warn(message, options) {
1197
- this.log("warn", message, options);
1198
- }
1199
- error(message, options) {
1200
- this.log("error", message, options);
1201
- }
1202
- /**
1203
- * Log errors with context - useful for non-API errors
1204
- * For API errors, use the existing getErrorMessage from @otim/utils/api
1205
- */
1206
- logError(error, options = {}) {
1207
- const { context, operation, metadata } = options;
1208
- const prefix = this.buildPrefix(context, operation);
1209
- let message = "Unknown error";
1210
- if (error instanceof Error) {
1211
- message = error.message;
1212
- } else if (typeof error === "string") {
1213
- message = error;
1214
- } else if (error && typeof error === "object" && "message" in error) {
1215
- message = String(error.message);
1216
- }
1217
- console.error(prefix ? `${prefix} ${message}` : message);
1218
- if (metadata && Object.keys(metadata).length > 0) {
1219
- console.error("Context:", metadata);
1220
- }
1221
- if (error instanceof Error && error.stack) {
1222
- console.error("Stack:", error.stack);
1223
- } else {
1224
- console.error("Error details:", error);
1225
- }
1226
- }
1227
- buildPrefix(context, operation) {
1228
- const parts = [];
1229
- if (context) parts.push(`[${context}]`);
1230
- if (operation) parts.push(`[${operation}]`);
1231
- return parts.join(" ");
1232
- }
1233
- log(level, message, options) {
1234
- const prefix = options?.context ? `[${options.context}]` : "";
1235
- const fullMessage = `${prefix} ${message}`.trim();
1236
- switch (level) {
1237
- case "debug":
1238
- case "info":
1239
- console.log(fullMessage);
1240
- break;
1241
- case "warn":
1242
- console.warn(fullMessage);
1243
- break;
1244
- case "error":
1245
- console.error(fullMessage);
1246
- break;
1247
- }
1248
- if (options?.data) {
1249
- console.dir(options.data, { depth: null });
1250
- }
1251
- }
1252
- };
1253
- var logger = new Logger();
1254
-
1255
- // src/helpers/zod.ts
1256
- import { z as z18 } from "zod";
1257
- var parseSchema = (values, schema) => {
1258
- const inputValues = schema.safeParse(values);
1259
- if (!inputValues.success) {
1260
- throw new Error(
1261
- `parseSchema: invalid input values ${JSON.stringify(inputValues.error)}`
1262
- );
1263
- }
1264
- return inputValues.data;
954
+ //#endregion
955
+ //#region src/api/utils/backoff.ts
956
+ const DEFAULT_INITIAL_INTERVAL = 5e3;
957
+ const DEFAULT_MAX_INTERVAL = 3e4;
958
+ const DEFAULT_MULTIPLIER = 1.5;
959
+ /**
960
+ * Calculates an exponential backoff interval based on the failure count.
961
+ *
962
+ * @param failureCount - Number of consecutive failures
963
+ * @param options - Configuration options for the backoff calculation
964
+ * @returns The calculated interval in milliseconds, capped at maxInterval
965
+ */
966
+ const calculateBackoffInterval = (failureCount, options = {}) => {
967
+ const { initialInterval = DEFAULT_INITIAL_INTERVAL, maxInterval = DEFAULT_MAX_INTERVAL, multiplier = DEFAULT_MULTIPLIER } = options;
968
+ return Math.min(initialInterval * Math.pow(multiplier, failureCount), maxInterval);
1265
969
  };
1266
970
 
1267
- // src/api/utils/pagination.ts
971
+ //#endregion
972
+ //#region src/api/utils/pagination.ts
973
+ /**
974
+ * Determine if additional pages are likely available based on the number of
975
+ * items received and the requested page size.
976
+ *
977
+ * Returns true when the current page contains at least `requestedPageSize`
978
+ * items, implying there may be more data to fetch.
979
+ *
980
+ * @param items Array of items returned for the current page.
981
+ * @param requestedPageSize The `perPage` value requested for this fetch.
982
+ * @returns Whether another page may be available.
983
+ */
1268
984
  function calculateHasMore(items, requestedPageSize) {
1269
- return items.length >= requestedPageSize;
985
+ return items.length >= requestedPageSize;
1270
986
  }
987
+ /**
988
+ * Extract pagination-related fields from a request object and return them
989
+ * separately from the remaining parameters.
990
+ *
991
+ * @param request Request object containing `page`, `perPage`, and other fields.
992
+ * @returns Object with `paginationParams` and `restParams` split for
993
+ * convenience.
994
+ */
1271
995
  function extractPaginationParams(request) {
1272
- const { page, perPage, ...restParams } = request;
1273
- return {
1274
- paginationParams: { page, perPage },
1275
- restParams
1276
- };
996
+ const { page, perPage, ...restParams } = request;
997
+ return {
998
+ paginationParams: {
999
+ page,
1000
+ perPage
1001
+ },
1002
+ restParams
1003
+ };
1277
1004
  }
1005
+ /**
1006
+ * Provide a standard default for pagination parameters.
1007
+ *
1008
+ * @returns Default pagination with `page: 0` and `perPage: 100`.
1009
+ */
1278
1010
  function getDefaultPagination() {
1279
- return {
1280
- page: 0,
1281
- perPage: 100
1282
- };
1011
+ return {
1012
+ page: 0,
1013
+ perPage: 100
1014
+ };
1283
1015
  }
1284
1016
 
1285
- // src/api/services/base.ts
1017
+ //#endregion
1018
+ //#region src/api/services/base.ts
1286
1019
  var BaseService = class {
1287
- constructor(instance) {
1288
- this.instance = instance;
1289
- }
1290
- async makeRequest({
1291
- url,
1292
- method = HttpMethod.Get,
1293
- data,
1294
- schema,
1295
- validateResponse,
1296
- ...config
1297
- }) {
1298
- try {
1299
- const res = await this.instance.request({ url, method, data, ...config });
1300
- if (validateResponse && !validateResponse(res.data)) {
1301
- throw new ServiceError("Invalid response format", "INVALID_RESPONSE");
1302
- }
1303
- const parsedData = schema ? parseSchema(res.data, schema) : res.data;
1304
- return { data: parsedData };
1305
- } catch (error) {
1306
- if (error instanceof ServiceError) {
1307
- throw error;
1308
- }
1309
- let errorMessage = "Unknown error";
1310
- let errorCode;
1311
- if (error && typeof error === "object" && "response" in error) {
1312
- const axiosError = error;
1313
- const responseData = axiosError.response?.data;
1314
- errorMessage = responseData?.errorMessage || responseData?.message || errorMessage;
1315
- errorCode = responseData?.errorCode;
1316
- } else if (error instanceof Error) {
1317
- errorMessage = error.message;
1318
- }
1319
- throw new ServiceError(errorMessage, errorCode || "REQUEST_FAILED");
1320
- }
1321
- }
1322
- async makePaginatedRequest({
1323
- url,
1324
- method = HttpMethod.Get,
1325
- data,
1326
- schema,
1327
- validateResponse,
1328
- ...config
1329
- }) {
1330
- const { paginationParams, restParams } = extractPaginationParams(
1331
- data || {}
1332
- );
1333
- const { page, perPage } = {
1334
- ...getDefaultPagination(),
1335
- ...paginationParams
1336
- };
1337
- const requestData = { ...restParams, page, perPage };
1338
- const response = await this.makeRequest({
1339
- url,
1340
- method,
1341
- data: requestData,
1342
- schema,
1343
- validateResponse,
1344
- ...config
1345
- });
1346
- const hasMore = Array.isArray(response.data) ? calculateHasMore(response.data, perPage) : false;
1347
- return {
1348
- data: response.data,
1349
- hasMore
1350
- };
1351
- }
1020
+ constructor(instance) {
1021
+ this.instance = instance;
1022
+ }
1023
+ async makeRequest({ url, method = HttpMethod.Get, data, schema, validateResponse, ...config }) {
1024
+ try {
1025
+ const res = await this.instance.request({
1026
+ url,
1027
+ method,
1028
+ data,
1029
+ ...config
1030
+ });
1031
+ if (validateResponse && !validateResponse(res.data)) throw new ServiceError("Invalid response format", "INVALID_RESPONSE");
1032
+ return { data: schema ? parseSchema(res.data, schema) : res.data };
1033
+ } catch (error) {
1034
+ if (error instanceof ServiceError) throw error;
1035
+ let errorMessage = "Unknown error";
1036
+ let errorCode;
1037
+ if (error && typeof error === "object" && "response" in error) {
1038
+ const responseData = error.response?.data;
1039
+ errorMessage = responseData?.errorMessage || responseData?.message || errorMessage;
1040
+ errorCode = responseData?.errorCode;
1041
+ } else if (error instanceof Error) errorMessage = error.message;
1042
+ throw new ServiceError(errorMessage, errorCode || "REQUEST_FAILED");
1043
+ }
1044
+ }
1045
+ async makePaginatedRequest({ url, method = HttpMethod.Get, data, schema, validateResponse, ...config }) {
1046
+ const { paginationParams, restParams } = extractPaginationParams(data || {});
1047
+ const { page, perPage } = {
1048
+ ...getDefaultPagination(),
1049
+ ...paginationParams
1050
+ };
1051
+ const requestData = {
1052
+ ...restParams,
1053
+ page,
1054
+ perPage
1055
+ };
1056
+ const response = await this.makeRequest({
1057
+ url,
1058
+ method,
1059
+ data: requestData,
1060
+ schema,
1061
+ validateResponse,
1062
+ ...config
1063
+ });
1064
+ const hasMore = Array.isArray(response.data) ? calculateHasMore(response.data, perPage) : false;
1065
+ return {
1066
+ data: response.data,
1067
+ hasMore
1068
+ };
1069
+ }
1352
1070
  };
1353
1071
 
1354
- // src/api/services/account.ts
1072
+ //#endregion
1073
+ //#region src/api/services/account.ts
1355
1074
  var AccountService = class extends BaseService {
1356
- async getDelegationStatus(requestBody) {
1357
- const res = await this.makeRequest({
1358
- url: "/delegation/status",
1359
- method: HttpMethod.Get,
1360
- data: requestBody,
1361
- schema: delegationStatusResponseSchema
1362
- });
1363
- return res;
1364
- }
1365
- async createDelegation(requestBody) {
1366
- await this.makeRequest({
1367
- url: "/delegation/new",
1368
- method: HttpMethod.Post,
1369
- data: requestBody
1370
- });
1371
- return {
1372
- data: { success: true, message: "Delegation created" }
1373
- };
1374
- }
1075
+ async getDelegationStatus(requestBody) {
1076
+ return await this.makeRequest({
1077
+ url: "/delegation/status",
1078
+ method: HttpMethod.Get,
1079
+ data: requestBody,
1080
+ schema: delegationStatusResponseSchema
1081
+ });
1082
+ }
1083
+ async createDelegation(requestBody) {
1084
+ await this.makeRequest({
1085
+ url: "/delegation/new",
1086
+ method: HttpMethod.Post,
1087
+ data: requestBody
1088
+ });
1089
+ return { data: {
1090
+ success: true,
1091
+ message: "Delegation created"
1092
+ } };
1093
+ }
1375
1094
  };
1376
1095
 
1377
- // src/api/services/activity.ts
1378
- import { z as z19 } from "zod";
1379
- var safeParseActivityArray = (data) => {
1380
- if (!Array.isArray(data)) {
1381
- return [];
1382
- }
1383
- const validRecords = [];
1384
- data.forEach((record) => {
1385
- const result = activityRecordSchema.safeParse(record);
1386
- if (result.success) {
1387
- validRecords.push(result.data);
1388
- }
1389
- });
1390
- return validRecords;
1096
+ //#endregion
1097
+ //#region src/api/services/activity.ts
1098
+ const safeParseActivityArray = (data) => {
1099
+ if (!Array.isArray(data)) return [];
1100
+ const validRecords = [];
1101
+ data.forEach((record) => {
1102
+ const result = activityRecordSchema.safeParse(record);
1103
+ if (result.success) validRecords.push(result.data);
1104
+ });
1105
+ return validRecords;
1391
1106
  };
1392
- var safeActivityArraySchema = z19.unknown().transform(safeParseActivityArray);
1107
+ const safeActivityArraySchema = z$1.unknown().transform(safeParseActivityArray);
1393
1108
  var ActivityService = class extends BaseService {
1394
- async getInstructionActivity(requestBody) {
1395
- return this.makePaginatedRequest({
1396
- url: "/instructions/activity",
1397
- method: HttpMethod.Get,
1398
- data: requestBody,
1399
- schema: safeActivityArraySchema
1400
- });
1401
- }
1109
+ async getInstructionActivity(requestBody) {
1110
+ return this.makePaginatedRequest({
1111
+ url: "/instructions/activity",
1112
+ method: HttpMethod.Get,
1113
+ data: requestBody,
1114
+ schema: safeActivityArraySchema
1115
+ });
1116
+ }
1402
1117
  };
1403
1118
 
1404
- // src/api/services/auth.ts
1119
+ //#endregion
1120
+ //#region src/api/services/auth.ts
1405
1121
  var AuthService = class extends BaseService {
1406
- async login(requestBody) {
1407
- const res = await this.makeRequest({
1408
- url: "/auth/login",
1409
- method: HttpMethod.Post,
1410
- data: requestBody,
1411
- schema: authLoginResponseSchema
1412
- });
1413
- return res;
1414
- }
1415
- async turnkeyVerification(requestBody) {
1416
- const res = await this.makeRequest({
1417
- url: "/turnkey/verification",
1418
- method: HttpMethod.Post,
1419
- data: requestBody,
1420
- schema: turnkeyVerificationResponseSchema
1421
- });
1422
- return res;
1423
- }
1424
- async turnkeyLogin(requestBody) {
1425
- const res = await this.makeRequest({
1426
- url: "/turnkey/login",
1427
- method: HttpMethod.Post,
1428
- data: requestBody,
1429
- schema: turnkeyLoginResponseSchema
1430
- });
1431
- return res;
1432
- }
1433
- async me() {
1434
- const res = await this.makeRequest({
1435
- url: "/auth/me",
1436
- method: HttpMethod.Get,
1437
- schema: userSchema
1438
- });
1439
- return res;
1440
- }
1441
- async updatePreferences(preferences) {
1442
- const res = await this.makeRequest({
1443
- url: "/user/preferences",
1444
- method: HttpMethod.Put,
1445
- data: { preferences }
1446
- });
1447
- return res;
1448
- }
1122
+ async login(requestBody) {
1123
+ return await this.makeRequest({
1124
+ url: "/auth/login",
1125
+ method: HttpMethod.Post,
1126
+ data: requestBody,
1127
+ schema: authLoginResponseSchema
1128
+ });
1129
+ }
1130
+ async turnkeyVerification(requestBody) {
1131
+ return await this.makeRequest({
1132
+ url: "/turnkey/verification",
1133
+ method: HttpMethod.Post,
1134
+ data: requestBody,
1135
+ schema: turnkeyVerificationResponseSchema
1136
+ });
1137
+ }
1138
+ async turnkeyLogin(requestBody) {
1139
+ return await this.makeRequest({
1140
+ url: "/turnkey/login",
1141
+ method: HttpMethod.Post,
1142
+ data: requestBody,
1143
+ schema: turnkeyLoginResponseSchema
1144
+ });
1145
+ }
1146
+ async me() {
1147
+ return await this.makeRequest({
1148
+ url: "/auth/me",
1149
+ method: HttpMethod.Get,
1150
+ schema: userSchema
1151
+ });
1152
+ }
1153
+ async updatePreferences(preferences) {
1154
+ return await this.makeRequest({
1155
+ url: "/user/preferences",
1156
+ method: HttpMethod.Put,
1157
+ data: { preferences }
1158
+ });
1159
+ }
1449
1160
  };
1450
1161
 
1451
- // src/api/services/config.ts
1162
+ //#endregion
1163
+ //#region src/api/services/config.ts
1452
1164
  var ConfigService = class extends BaseService {
1453
- async getDelegateAddress(requestBody) {
1454
- const res = await this.makeRequest({
1455
- url: `/config/delegate/address/${requestBody.chainId}`,
1456
- method: HttpMethod.Get,
1457
- schema: getDelegateAddressResponseSchema
1458
- });
1459
- return res;
1460
- }
1461
- async getConfigTokens({
1462
- chainId
1463
- }) {
1464
- const res = await this.makeRequest({
1465
- url: `/config/tokens/${chainId}`,
1466
- method: HttpMethod.Get,
1467
- schema: getConfigTokensResponseSchema
1468
- });
1469
- return res;
1470
- }
1471
- async getConfigChains() {
1472
- const res = await this.makeRequest({
1473
- url: `/config/chains`,
1474
- method: HttpMethod.Get,
1475
- schema: getConfigChainsResponseSchema
1476
- });
1477
- return res;
1478
- }
1479
- async getMaxPriorityFeePerGasEstimate(requestBody) {
1480
- const res = await this.makeRequest({
1481
- url: `/instruction/estimate/max_priority_fee_per_gas/${requestBody.chainId}`,
1482
- method: HttpMethod.Get,
1483
- schema: getMaxPriorityFeePerGasEstimateResponseSchema
1484
- });
1485
- return res;
1486
- }
1165
+ async getDelegateAddress(requestBody) {
1166
+ return await this.makeRequest({
1167
+ url: `/config/delegate/address/${requestBody.chainId}`,
1168
+ method: HttpMethod.Get,
1169
+ schema: getDelegateAddressResponseSchema
1170
+ });
1171
+ }
1172
+ async getConfigTokens({ chainId }) {
1173
+ return await this.makeRequest({
1174
+ url: `/config/tokens/${chainId}`,
1175
+ method: HttpMethod.Get,
1176
+ schema: getConfigTokensResponseSchema
1177
+ });
1178
+ }
1179
+ async getConfigChains() {
1180
+ return await this.makeRequest({
1181
+ url: `/config/chains`,
1182
+ method: HttpMethod.Get,
1183
+ schema: getConfigChainsResponseSchema
1184
+ });
1185
+ }
1186
+ async getMaxPriorityFeePerGasEstimate(requestBody) {
1187
+ return await this.makeRequest({
1188
+ url: `/instruction/estimate/max_priority_fee_per_gas/${requestBody.chainId}`,
1189
+ method: HttpMethod.Get,
1190
+ schema: getMaxPriorityFeePerGasEstimateResponseSchema
1191
+ });
1192
+ }
1487
1193
  };
1488
1194
 
1489
- // src/api/services/contacts.ts
1195
+ //#endregion
1196
+ //#region src/api/services/contacts.ts
1490
1197
  var ContactsService = class extends BaseService {
1491
- async create(request) {
1492
- const validated = newContactRequestSchema.parse(request);
1493
- return this.makeRequest({
1494
- url: "/contacts",
1495
- method: HttpMethod.Put,
1496
- data: validated
1497
- });
1498
- }
1499
- async list(request) {
1500
- const validated = getContactsRequestSchema.parse(request);
1501
- return this.makePaginatedRequest({
1502
- url: "/contacts",
1503
- method: HttpMethod.Get,
1504
- data: validated,
1505
- schema: getContactsResponseSchema
1506
- });
1507
- }
1198
+ async create(request) {
1199
+ const validated = newContactRequestSchema.parse(request);
1200
+ return this.makeRequest({
1201
+ url: "/contacts",
1202
+ method: HttpMethod.Put,
1203
+ data: validated
1204
+ });
1205
+ }
1206
+ async list(request) {
1207
+ const validated = getContactsRequestSchema.parse(request);
1208
+ return this.makePaginatedRequest({
1209
+ url: "/contacts",
1210
+ method: HttpMethod.Get,
1211
+ data: validated,
1212
+ schema: getContactsResponseSchema
1213
+ });
1214
+ }
1508
1215
  };
1509
1216
 
1510
- // src/api/services/developer.ts
1217
+ //#endregion
1218
+ //#region src/api/services/developer.ts
1511
1219
  var DeveloperService = class extends BaseService {
1512
- async updatePublicKey(developerPublicKey) {
1513
- return this.makeRequest({
1514
- url: "/developer/public_key",
1515
- method: HttpMethod.Put,
1516
- data: { developerPublicKey }
1517
- });
1518
- }
1519
- async generateApiKey() {
1520
- return this.makeRequest({
1521
- url: "/developer/api_key",
1522
- method: HttpMethod.Post
1523
- });
1524
- }
1220
+ async updatePublicKey(developerPublicKey) {
1221
+ return this.makeRequest({
1222
+ url: "/developer/public_key",
1223
+ method: HttpMethod.Put,
1224
+ data: { developerPublicKey }
1225
+ });
1226
+ }
1227
+ async generateApiKey() {
1228
+ return this.makeRequest({
1229
+ url: "/developer/api_key",
1230
+ method: HttpMethod.Post
1231
+ });
1232
+ }
1525
1233
  };
1526
1234
 
1527
- // src/api/services/instruction.ts
1235
+ //#endregion
1236
+ //#region src/api/services/instruction.ts
1528
1237
  var InstructionService = class extends BaseService {
1529
- async all(requestBody) {
1530
- return this.makePaginatedRequest({
1531
- url: "/instructions/all",
1532
- method: HttpMethod.Get,
1533
- data: requestBody,
1534
- schema: instructionsSchema
1535
- });
1536
- }
1537
- async build(requestBody) {
1538
- const res = await this.makeRequest({
1539
- url: "/instruction/build",
1540
- method: HttpMethod.Post,
1541
- data: requestBody,
1542
- schema: instructionBuildSchema
1543
- });
1544
- return res;
1545
- }
1546
- async activate(requestBody) {
1547
- const res = await this.makeRequest({
1548
- url: "/instruction/new",
1549
- method: HttpMethod.Post,
1550
- data: requestBody,
1551
- schema: instructionActivateResponseSchema
1552
- });
1553
- return res;
1554
- }
1555
- async deactivate(requestBody) {
1556
- const res = await this.makeRequest({
1557
- url: "/instruction/deactivate",
1558
- method: HttpMethod.Post,
1559
- data: requestBody,
1560
- schema: instructionDeactivateResponseSchema
1561
- });
1562
- return res;
1563
- }
1564
- async details(requestBody) {
1565
- const res = await this.makeRequest({
1566
- url: "/instruction/details",
1567
- method: HttpMethod.Get,
1568
- data: requestBody,
1569
- schema: instructionDetailsResponseSchema
1570
- });
1571
- return res;
1572
- }
1573
- async rules(requestBody) {
1574
- return this.makePaginatedRequest({
1575
- url: "/instructions/rules",
1576
- method: HttpMethod.Get,
1577
- data: requestBody,
1578
- schema: instructionGetRulesResponseSchema
1579
- });
1580
- }
1238
+ async all(requestBody) {
1239
+ return this.makePaginatedRequest({
1240
+ url: "/instructions/all",
1241
+ method: HttpMethod.Get,
1242
+ data: requestBody,
1243
+ schema: instructionsSchema
1244
+ });
1245
+ }
1246
+ async build(requestBody) {
1247
+ return await this.makeRequest({
1248
+ url: "/instruction/build",
1249
+ method: HttpMethod.Post,
1250
+ data: requestBody,
1251
+ schema: instructionBuildSchema
1252
+ });
1253
+ }
1254
+ async activate(requestBody) {
1255
+ return await this.makeRequest({
1256
+ url: "/instruction/new",
1257
+ method: HttpMethod.Post,
1258
+ data: requestBody,
1259
+ schema: instructionActivateResponseSchema
1260
+ });
1261
+ }
1262
+ async deactivate(requestBody) {
1263
+ return await this.makeRequest({
1264
+ url: "/instruction/deactivate",
1265
+ method: HttpMethod.Post,
1266
+ data: requestBody,
1267
+ schema: instructionDeactivateResponseSchema
1268
+ });
1269
+ }
1270
+ async details(requestBody) {
1271
+ return await this.makeRequest({
1272
+ url: "/instruction/details",
1273
+ method: HttpMethod.Get,
1274
+ data: requestBody,
1275
+ schema: instructionDetailsResponseSchema
1276
+ });
1277
+ }
1278
+ async rules(requestBody) {
1279
+ return this.makePaginatedRequest({
1280
+ url: "/instructions/rules",
1281
+ method: HttpMethod.Get,
1282
+ data: requestBody,
1283
+ schema: instructionGetRulesResponseSchema
1284
+ });
1285
+ }
1581
1286
  };
1582
1287
 
1583
- // src/api/services/transaction.ts
1288
+ //#endregion
1289
+ //#region src/api/services/transaction.ts
1584
1290
  var TransactionService = class extends BaseService {
1585
- async list(requestBody) {
1586
- return this.makePaginatedRequest({
1587
- url: "/transactions",
1588
- method: HttpMethod.Get,
1589
- data: requestBody,
1590
- schema: transactionGetListResponseSchema
1591
- });
1592
- }
1291
+ async list(requestBody) {
1292
+ return this.makePaginatedRequest({
1293
+ url: "/transactions",
1294
+ method: HttpMethod.Get,
1295
+ data: requestBody,
1296
+ schema: transactionGetListResponseSchema
1297
+ });
1298
+ }
1593
1299
  };
1594
1300
 
1595
- // src/api/services/payments.ts
1301
+ //#endregion
1302
+ //#region src/api/services/payments.ts
1596
1303
  var PaymentsService = class extends BaseService {
1597
- async getOutgoingPaymentsList(request) {
1598
- return this.makePaginatedRequest({
1599
- url: "/api/payments/outgoing",
1600
- method: HttpMethod.Get,
1601
- data: request,
1602
- schema: PaymentsSchema
1603
- });
1604
- }
1605
- async getIncomingPaymentsList(request) {
1606
- return this.makePaginatedRequest({
1607
- url: "/api/payments/incoming",
1608
- method: HttpMethod.Get,
1609
- data: request,
1610
- schema: PaymentsSchema
1611
- });
1612
- }
1613
- async buildPaymentRequest(requestBody) {
1614
- return this.makeRequest({
1615
- url: "/orchestration/build",
1616
- method: HttpMethod.Post,
1617
- data: requestBody,
1618
- schema: paymentRequestBuildResponseSchema
1619
- });
1620
- }
1621
- async newPaymentRequest(requestBody) {
1622
- return this.makeRequest({
1623
- url: "/orchestration/new",
1624
- method: HttpMethod.Post,
1625
- data: requestBody,
1626
- validateResponse: () => true
1627
- });
1628
- }
1629
- async getPaymentRequestDetails(requestBody) {
1630
- return this.makeRequest({
1631
- url: "/orchestration/details",
1632
- method: HttpMethod.Get,
1633
- data: requestBody,
1634
- schema: paymentRequestDetailsResponseSchema
1635
- });
1636
- }
1637
- async getPaymentRequests(request) {
1638
- return this.makePaginatedRequest({
1639
- url: "/orchestrations",
1640
- method: HttpMethod.Get,
1641
- data: request,
1642
- schema: getPaymentRequestsResponseSchema
1643
- });
1644
- }
1645
- async buildSettlementOrchestration(requestBody) {
1646
- return this.makeRequest({
1647
- url: "/orchestration/build/settlement",
1648
- method: HttpMethod.Post,
1649
- data: requestBody,
1650
- schema: buildSettlementResponseSchema
1651
- });
1652
- }
1304
+ async getOutgoingPaymentsList(request) {
1305
+ return this.makePaginatedRequest({
1306
+ url: "/api/payments/outgoing",
1307
+ method: HttpMethod.Get,
1308
+ data: request,
1309
+ schema: PaymentsSchema
1310
+ });
1311
+ }
1312
+ async getIncomingPaymentsList(request) {
1313
+ return this.makePaginatedRequest({
1314
+ url: "/api/payments/incoming",
1315
+ method: HttpMethod.Get,
1316
+ data: request,
1317
+ schema: PaymentsSchema
1318
+ });
1319
+ }
1320
+ async buildPaymentRequest(requestBody) {
1321
+ return this.makeRequest({
1322
+ url: "/orchestration/build",
1323
+ method: HttpMethod.Post,
1324
+ data: requestBody,
1325
+ schema: paymentRequestBuildResponseSchema
1326
+ });
1327
+ }
1328
+ async newPaymentRequest(requestBody) {
1329
+ return this.makeRequest({
1330
+ url: "/orchestration/new",
1331
+ method: HttpMethod.Post,
1332
+ data: requestBody,
1333
+ validateResponse: () => true
1334
+ });
1335
+ }
1336
+ async getPaymentRequestDetails(requestBody) {
1337
+ return this.makeRequest({
1338
+ url: "/orchestration/details",
1339
+ method: HttpMethod.Get,
1340
+ data: requestBody,
1341
+ schema: paymentRequestDetailsResponseSchema
1342
+ });
1343
+ }
1344
+ async getPaymentRequests(request) {
1345
+ return this.makePaginatedRequest({
1346
+ url: "/orchestrations",
1347
+ method: HttpMethod.Get,
1348
+ data: request,
1349
+ schema: getPaymentRequestsResponseSchema
1350
+ });
1351
+ }
1352
+ async buildSettlementOrchestration(requestBody) {
1353
+ return this.makeRequest({
1354
+ url: "/orchestration/build/settlement",
1355
+ method: HttpMethod.Post,
1356
+ data: requestBody,
1357
+ schema: buildSettlementResponseSchema
1358
+ });
1359
+ }
1653
1360
  };
1654
1361
 
1655
- // src/api/services/integration.ts
1656
- import axios2 from "axios";
1362
+ //#endregion
1363
+ //#region src/api/services/integration.ts
1657
1364
  function createEmptyIntegrationResponse(integrationType) {
1658
- switch (integrationType) {
1659
- case IntegrationType.QuickBooks:
1660
- return { integrationType: IntegrationType.QuickBooks, details: {} };
1661
- case IntegrationType.Bank:
1662
- return { integrationType: IntegrationType.Bank, details: {} };
1663
- case IntegrationType.Clio:
1664
- return { integrationType: IntegrationType.Clio, details: {} };
1665
- case IntegrationType.Stripe:
1666
- return { integrationType: IntegrationType.Stripe, details: {} };
1667
- case IntegrationType.Bill:
1668
- return { integrationType: IntegrationType.Bill, details: {} };
1669
- case IntegrationType.Zoho:
1670
- return { integrationType: IntegrationType.Zoho, details: {} };
1671
- default:
1672
- return { integrationType: IntegrationType.Bank, details: {} };
1673
- }
1365
+ switch (integrationType) {
1366
+ case IntegrationType.QuickBooks: return {
1367
+ integrationType: IntegrationType.QuickBooks,
1368
+ details: {}
1369
+ };
1370
+ case IntegrationType.Bank: return {
1371
+ integrationType: IntegrationType.Bank,
1372
+ details: {}
1373
+ };
1374
+ case IntegrationType.Clio: return {
1375
+ integrationType: IntegrationType.Clio,
1376
+ details: {}
1377
+ };
1378
+ case IntegrationType.Stripe: return {
1379
+ integrationType: IntegrationType.Stripe,
1380
+ details: {}
1381
+ };
1382
+ case IntegrationType.Bill: return {
1383
+ integrationType: IntegrationType.Bill,
1384
+ details: {}
1385
+ };
1386
+ case IntegrationType.Zoho: return {
1387
+ integrationType: IntegrationType.Zoho,
1388
+ details: {}
1389
+ };
1390
+ default: return {
1391
+ integrationType: IntegrationType.Bank,
1392
+ details: {}
1393
+ };
1394
+ }
1674
1395
  }
1675
1396
  var IntegrationService = class extends BaseService {
1676
- async upsert(request) {
1677
- return this.makeRequest({
1678
- url: "/integration",
1679
- method: HttpMethod.Put,
1680
- data: request,
1681
- schema: integrationResponseSchema
1682
- });
1683
- }
1684
- async get(request) {
1685
- try {
1686
- return await this.makeRequest(
1687
- {
1688
- url: "/integration/get",
1689
- method: HttpMethod.Post,
1690
- data: request,
1691
- schema: integrationResponseSchema
1692
- }
1693
- );
1694
- } catch (error) {
1695
- if (axios2.isAxiosError(error) && error.response?.status === 404) {
1696
- const defaultResponse = createEmptyIntegrationResponse(
1697
- request.integrationType
1698
- );
1699
- return { data: defaultResponse };
1700
- }
1701
- throw error;
1702
- }
1703
- }
1397
+ async upsert(request) {
1398
+ return this.makeRequest({
1399
+ url: "/integration",
1400
+ method: HttpMethod.Put,
1401
+ data: request,
1402
+ schema: integrationResponseSchema
1403
+ });
1404
+ }
1405
+ async get(request) {
1406
+ try {
1407
+ return await this.makeRequest({
1408
+ url: "/integration/get",
1409
+ method: HttpMethod.Post,
1410
+ data: request,
1411
+ schema: integrationResponseSchema
1412
+ });
1413
+ } catch (error) {
1414
+ if (axios.isAxiosError(error) && error.response?.status === 404) return { data: createEmptyIntegrationResponse(request.integrationType) };
1415
+ throw error;
1416
+ }
1417
+ }
1704
1418
  };
1705
1419
 
1706
- // src/api/services/operating-account.ts
1420
+ //#endregion
1421
+ //#region src/api/services/operating-account.ts
1707
1422
  var OperatingAccountService = class extends BaseService {
1708
- async createSubOrganization() {
1709
- const res = await this.makeRequest({
1710
- url: "/operating_accounts/sub_organization/new",
1711
- method: HttpMethod.Post,
1712
- schema: newOperatingAccountSubOrgResponseSchema
1713
- });
1714
- return res;
1715
- }
1716
- async getSubOrganization() {
1717
- const res = await this.makeRequest({
1718
- url: "/operating_accounts/sub_organization",
1719
- method: HttpMethod.Get,
1720
- schema: getOperatingAccountSubOrgResponseSchema
1721
- });
1722
- return res;
1723
- }
1423
+ async createSubOrganization() {
1424
+ return await this.makeRequest({
1425
+ url: "/operating_accounts/sub_organization/new",
1426
+ method: HttpMethod.Post,
1427
+ schema: newOperatingAccountSubOrgResponseSchema
1428
+ });
1429
+ }
1430
+ async getSubOrganization() {
1431
+ return await this.makeRequest({
1432
+ url: "/operating_accounts/sub_organization",
1433
+ method: HttpMethod.Get,
1434
+ schema: getOperatingAccountSubOrgResponseSchema
1435
+ });
1436
+ }
1724
1437
  };
1725
1438
 
1726
- // src/api/services/uniswap-token-list-service.ts
1727
- var UniswapTokenListService = class extends BaseService {
1728
- constructor() {
1729
- super(...arguments);
1730
- __publicField(this, "UNISWAP_TOKEN_LIST_URL", "https://ipfs.io/ipns/tokens.uniswap.org");
1731
- __publicField(this, "FALLBACK_URL", "https://tokens.uniswap.org/");
1732
- __publicField(this, "CACHE_DURATION", 30 * 60 * 1e3);
1733
- // 30 minutes
1734
- __publicField(this, "SUPPORTED_CHAIN_IDS", [1, 10, 42161, 8453]);
1735
- // mainnet, optimism, arbitrum, base
1736
- __publicField(this, "tokenListCache", null);
1737
- __publicField(this, "lastFetch", 0);
1738
- }
1739
- /**
1740
- * Get tokens for a specific chain
1741
- */
1742
- async getTokensForChain({
1743
- chainId,
1744
- limit = 50
1745
- }) {
1746
- try {
1747
- const tokenList = await this.fetchTokenList();
1748
- if (!this.SUPPORTED_CHAIN_IDS.includes(chainId)) {
1749
- return {
1750
- data: {
1751
- tokens: [],
1752
- source: "uniswap",
1753
- timestamp: tokenList.timestamp
1754
- }
1755
- };
1756
- }
1757
- const chainTokens = tokenList.tokens.filter(
1758
- (token) => token.chainId === chainId
1759
- );
1760
- const filteredTokens = chainTokens.filter((token) => {
1761
- const suspiciousPatterns = [
1762
- /test/i,
1763
- /fake/i,
1764
- /scam/i,
1765
- /shit/i,
1766
- /moon/i,
1767
- /doge/i,
1768
- /inu/i,
1769
- /baby/i,
1770
- /mini/i,
1771
- /micro/i,
1772
- /nano/i,
1773
- /pico/i,
1774
- /mega/i,
1775
- /ultra/i,
1776
- /super/i,
1777
- /hyper/i,
1778
- /meta/i,
1779
- /safe/i,
1780
- /new/i,
1781
- /old/i,
1782
- /v2/i,
1783
- /v3/i,
1784
- /v4/i,
1785
- /v5/i,
1786
- /2\.0/i,
1787
- /3\.0/i,
1788
- /4\.0/i,
1789
- /5\.0/i
1790
- ];
1791
- const name = token.name?.toLowerCase() || "";
1792
- const symbol = token.symbol?.toLowerCase() || "";
1793
- if (suspiciousPatterns.some(
1794
- (pattern) => pattern.test(name) || pattern.test(symbol)
1795
- )) {
1796
- return false;
1797
- }
1798
- if (name.length < 2 || name.length > 50) return false;
1799
- if (symbol.length < 2 || symbol.length > 20) return false;
1800
- if (!token.name || !token.symbol || !token.address) return false;
1801
- return true;
1802
- });
1803
- const limitedTokens = filteredTokens.slice(0, limit);
1804
- return {
1805
- data: {
1806
- tokens: limitedTokens,
1807
- source: "uniswap",
1808
- timestamp: tokenList.timestamp
1809
- }
1810
- };
1811
- } catch (error) {
1812
- throw new Error(error instanceof Error ? error.message : "Unknown error");
1813
- }
1814
- }
1815
- /**
1816
- * Get all supported chains from the token list
1817
- */
1818
- async getSupportedChains() {
1819
- try {
1820
- const tokenList = await this.fetchTokenList();
1821
- const chainIds = Array.from(
1822
- new Set(tokenList.tokens.map((token) => token.chainId))
1823
- ).sort((a, b) => a - b);
1824
- return {
1825
- data: chainIds
1826
- };
1827
- } catch (error) {
1828
- throw new Error(error instanceof Error ? error.message : "Unknown error");
1829
- }
1830
- }
1831
- /**
1832
- * Search for a specific token by address or symbol
1833
- */
1834
- async findToken(chainId, query) {
1835
- try {
1836
- const tokenList = await this.fetchTokenList();
1837
- const token = tokenList.tokens.find(
1838
- (t) => t.chainId === chainId && (t.address.toLowerCase() === query.toLowerCase() || t.symbol.toLowerCase() === query.toLowerCase() || t.name.toLowerCase().includes(query.toLowerCase()))
1839
- );
1840
- return {
1841
- data: token || null
1842
- };
1843
- } catch (error) {
1844
- throw new Error(error instanceof Error ? error.message : "Unknown error");
1845
- }
1846
- }
1847
- /**
1848
- * Get bridge information for a token
1849
- */
1850
- async getBridgeInfo(chainId, tokenAddress) {
1851
- try {
1852
- const tokenList = await this.fetchTokenList();
1853
- const token = tokenList.tokens.find(
1854
- (t) => t.chainId === chainId && t.address.toLowerCase() === tokenAddress.toLowerCase()
1855
- );
1856
- if (!token || !token.extensions?.bridgeInfo) {
1857
- return {
1858
- data: {}
1859
- };
1860
- }
1861
- const bridgeInfo = {};
1862
- for (const [targetChainId, info] of Object.entries(
1863
- token.extensions.bridgeInfo
1864
- )) {
1865
- bridgeInfo[targetChainId] = info.tokenAddress;
1866
- }
1867
- return {
1868
- data: bridgeInfo
1869
- };
1870
- } catch (error) {
1871
- throw new Error(error instanceof Error ? error.message : "Unknown error");
1872
- }
1873
- }
1874
- /**
1875
- * Fetch the Uniswap token list
1876
- */
1877
- async fetchTokenList() {
1878
- const now = Date.now();
1879
- if (this.tokenListCache && now - this.lastFetch < this.CACHE_DURATION) {
1880
- return this.tokenListCache;
1881
- }
1882
- try {
1883
- const response = await fetch(this.UNISWAP_TOKEN_LIST_URL, {
1884
- headers: {
1885
- Accept: "application/json"
1886
- }
1887
- });
1888
- if (!response.ok) {
1889
- throw new Error(`IPFS fetch failed: ${response.status}`);
1890
- }
1891
- const data = await response.json();
1892
- this.tokenListCache = data;
1893
- this.lastFetch = now;
1894
- return data;
1895
- } catch (error) {
1896
- logger.logError(error, {
1897
- context: this.fetchTokenList.name
1898
- });
1899
- try {
1900
- const response = await fetch(this.FALLBACK_URL, {
1901
- headers: {
1902
- Accept: "application/json"
1903
- }
1904
- });
1905
- if (!response.ok) {
1906
- throw new Error(`Fallback fetch failed: ${response.status}`);
1907
- }
1908
- const data = await response.json();
1909
- this.tokenListCache = data;
1910
- this.lastFetch = now;
1911
- return data;
1912
- } catch (fallbackError) {
1913
- logger.logError(fallbackError, {
1914
- context: this.fetchTokenList.name
1915
- });
1916
- throw new Error("Unable to fetch Uniswap token list");
1917
- }
1918
- }
1919
- }
1920
- };
1921
-
1922
- // src/api/api.ts
1439
+ //#endregion
1440
+ //#region src/api/api.ts
1923
1441
  var APIClient = class {
1924
- constructor(init) {
1925
- __publicField(this, "account");
1926
- __publicField(this, "activity");
1927
- __publicField(this, "auth");
1928
- __publicField(this, "operatingAccount");
1929
- __publicField(this, "config");
1930
- __publicField(this, "contacts");
1931
- __publicField(this, "developer");
1932
- __publicField(this, "instruction");
1933
- __publicField(this, "transaction");
1934
- __publicField(this, "payments");
1935
- __publicField(this, "integration");
1936
- const instance = isInstanceInit(init) ? init.instance : createInstance(init);
1937
- this.account = new AccountService(instance);
1938
- this.activity = new ActivityService(instance);
1939
- this.auth = new AuthService(instance);
1940
- this.config = new ConfigService(instance);
1941
- this.contacts = new ContactsService(instance);
1942
- this.developer = new DeveloperService(instance);
1943
- this.instruction = new InstructionService(instance);
1944
- this.integration = new IntegrationService(instance);
1945
- this.transaction = new TransactionService(instance);
1946
- this.operatingAccount = new OperatingAccountService(instance);
1947
- this.payments = new PaymentsService(instance);
1948
- }
1442
+ constructor(init) {
1443
+ _defineProperty(this, "account", void 0);
1444
+ _defineProperty(this, "activity", void 0);
1445
+ _defineProperty(this, "auth", void 0);
1446
+ _defineProperty(this, "operatingAccount", void 0);
1447
+ _defineProperty(this, "config", void 0);
1448
+ _defineProperty(this, "contacts", void 0);
1449
+ _defineProperty(this, "developer", void 0);
1450
+ _defineProperty(this, "instruction", void 0);
1451
+ _defineProperty(this, "transaction", void 0);
1452
+ _defineProperty(this, "payments", void 0);
1453
+ _defineProperty(this, "integration", void 0);
1454
+ const instance = isInstanceInit(init) ? init.instance : createInstance({
1455
+ ...init,
1456
+ baseURL: init?.environment ? getOffchainApiUrl(init.environment) : init?.baseURL
1457
+ });
1458
+ this.account = new AccountService(instance);
1459
+ this.activity = new ActivityService(instance);
1460
+ this.auth = new AuthService(instance);
1461
+ this.config = new ConfigService(instance);
1462
+ this.contacts = new ContactsService(instance);
1463
+ this.developer = new DeveloperService(instance);
1464
+ this.instruction = new InstructionService(instance);
1465
+ this.integration = new IntegrationService(instance);
1466
+ this.transaction = new TransactionService(instance);
1467
+ this.operatingAccount = new OperatingAccountService(instance);
1468
+ this.payments = new PaymentsService(instance);
1469
+ }
1949
1470
  };
1950
- var createAPIClient = (...params) => {
1951
- return new APIClient(...params);
1471
+ const createAPIClient = (...params) => {
1472
+ return new APIClient(...params);
1952
1473
  };
1953
- export {
1954
- APIClient,
1955
- AccountService,
1956
- ActivityService,
1957
- AuthService,
1958
- ConfigService,
1959
- ContactsService,
1960
- DelegationStatus,
1961
- DeveloperService,
1962
- HttpMethod,
1963
- InstructionService,
1964
- IntegrationService,
1965
- IntegrationType,
1966
- OperatingAccountService,
1967
- PaymentsService,
1968
- ServiceError,
1969
- TransactionService,
1970
- UniswapTokenListService,
1971
- actionArgumentsResponseSchema,
1972
- actionArgumentsSchema,
1973
- actionNameSchema,
1974
- activityDataSchema,
1975
- activityRecordSchema,
1976
- addressWhitelistCheckRequestSchema,
1977
- addressWhitelistCheckResponseSchema,
1978
- apiErrorSchema,
1979
- attestationSchema,
1980
- authLoginRequestSchema,
1981
- authLoginResponseSchema,
1982
- buildEphemeralInstructionSchema,
1983
- buildSettlementRequestSchema,
1984
- buildSettlementResponseSchema,
1985
- calculateHasMore,
1986
- chainIdSchema,
1987
- chainSuccessResponseSchema,
1988
- contactSchema,
1989
- createAPIClient,
1990
- createAbortController,
1991
- createInstance,
1992
- delegationCreateRequestSchema,
1993
- delegationCreateResponseSchema,
1994
- delegationStatusRequestSchema,
1995
- delegationStatusResponseSchema,
1996
- delegationStatusSchema,
1997
- delegationStatusValues,
1998
- errorResponseSchema,
1999
- extractPaginationParams,
2000
- feeResponseSchema2 as feeResponseSchema,
2001
- getConfigChainsResponseSchema,
2002
- getConfigTokensRequestParametersSchema,
2003
- getConfigTokensResponseSchema,
2004
- getContactsRequestSchema,
2005
- getContactsResponseSchema,
2006
- getCurrentUserResponseSchema,
2007
- getDefaultPagination,
2008
- getDelegateAddressResponseSchema,
2009
- getDelegateAddressSchema,
2010
- getErrorMessage,
2011
- getErrorMessageWithCode,
2012
- getInstructionActivityRequestSchema,
2013
- getInstructionActivityResponseSchema,
2014
- getIntegrationRequestSchema,
2015
- getMaxPriorityFeePerGasEstimateResponseSchema,
2016
- getMaxPriorityFeePerGasEstimateSchema,
2017
- getOperatingAccountSubOrgResponseSchema,
2018
- getPaymentRequestsRequestSchema,
2019
- getPaymentRequestsResponseSchema,
2020
- getUserFriendlyErrorMessage,
2021
- instructionActivateRequestSchema,
2022
- instructionActivateResponseSchema,
2023
- instructionBuildRequestSchema,
2024
- instructionBuildSchema,
2025
- instructionDeactivateRequestSchema,
2026
- instructionDeactivateResponseSchema,
2027
- instructionDetailsRequestSchema,
2028
- instructionDetailsResponseSchema,
2029
- instructionGetAllRequestSchema,
2030
- instructionGetAllResponseSchema,
2031
- instructionGetRulesRequestSchema,
2032
- instructionGetRulesResponseSchema,
2033
- integrationResponseSchema,
2034
- integrationTypeSchema,
2035
- integrationTypeValues,
2036
- isInstanceInit,
2037
- isTechnicalError,
2038
- isUserAddressableError,
2039
- isUserRejectionError,
2040
- meResponseSchema,
2041
- newContactRequestSchema,
2042
- newInstructionRequestSchema,
2043
- newOperatingAccountSubOrgResponseSchema,
2044
- paymentRequestBuildRequestSchema,
2045
- paymentRequestBuildResponseSchema,
2046
- paymentRequestDetailsRequestSchema,
2047
- paymentRequestDetailsResponseSchema,
2048
- paymentRequestNewRequestSchema,
2049
- paymentRequestSchema,
2050
- paymentRequestStatusSchema,
2051
- paymentRequestsDirectionSchema,
2052
- sessionTokenRequestSchema,
2053
- sessionTokenResponseSchema,
2054
- sessionVerifyResponseSchema,
2055
- setChainIdSchema,
2056
- transactionGetListRequestSchema,
2057
- transactionGetListResponseSchema,
2058
- turnkeyLoginRequestSchema,
2059
- turnkeyLoginResponseSchema,
2060
- turnkeyVerificationRequestSchema,
2061
- turnkeyVerificationResponseSchema,
2062
- updateIntegrationRequestSchema,
2063
- whitelistCheckRequestSchema,
2064
- whitelistCheckResponseSchema
1474
+
1475
+ //#endregion
1476
+ //#region src/api/result.ts
1477
+ function success(data) {
1478
+ return {
1479
+ success: true,
1480
+ data
1481
+ };
1482
+ }
1483
+ function failure(error, code) {
1484
+ return {
1485
+ success: false,
1486
+ error,
1487
+ code
1488
+ };
1489
+ }
1490
+ function isSuccess(result) {
1491
+ return result.success === true;
1492
+ }
1493
+ function isFailure(result) {
1494
+ return result.success === false;
1495
+ }
1496
+ const ErrorCode = {
1497
+ NetworkError: "NETWORK_ERROR",
1498
+ Unauthorized: "UNAUTHORIZED",
1499
+ AuthenticationFailed: "AUTH_FAILED",
1500
+ MissingParameter: "MISSING_PARAMETER",
1501
+ Forbidden: "FORBIDDEN",
1502
+ SessionExpired: "SESSION_EXPIRED",
1503
+ InvalidInput: "INVALID_INPUT",
1504
+ UnknownError: "UNKNOWN_ERROR"
2065
1505
  };
2066
- //# sourceMappingURL=index.mjs.map
1506
+
1507
+ //#endregion
1508
+ export { APIClient, AccountService, ActivityService, AuthService, ConfigService, ContactsService, DelegationStatus, DeveloperService, ErrorCode, HttpMethod, InstructionService, IntegrationService, IntegrationType, OperatingAccountService, PaymentsService, ServiceError, TransactionService, actionArgumentsResponseSchema, actionArgumentsSchema, actionNameSchema, activityDataSchema, activityRecordSchema, addressWhitelistCheckRequestSchema, addressWhitelistCheckResponseSchema, apiErrorSchema, attestationSchema, authLoginRequestSchema, authLoginResponseSchema, buildEphemeralInstructionSchema, buildSettlementRequestSchema, buildSettlementResponseSchema, calculateBackoffInterval, calculateHasMore, chainIdSchema, chainSuccessResponseSchema, contactSchema, createAPIClient, createAbortController, createInstance, delegationCreateRequestSchema, delegationCreateResponseSchema, delegationStatusRequestSchema, delegationStatusResponseSchema, delegationStatusSchema, delegationStatusValues, errorResponseSchema, extractPaginationParams, failure, feeResponseSchema, formatActionName, formatPaymentRail, getConfigChainsResponseSchema, getConfigTokensRequestParametersSchema, getConfigTokensResponseSchema, getContactsRequestSchema, getContactsResponseSchema, getDefaultPagination, getDelegateAddressResponseSchema, getDelegateAddressSchema, getErrorMessage, getErrorMessageWithCode, getInstructionActivityRequestSchema, getInstructionActivityResponseSchema, getIntegrationRequestSchema, getMaxPriorityFeePerGasEstimateResponseSchema, getMaxPriorityFeePerGasEstimateSchema, getOperatingAccountSubOrgResponseSchema, getPaymentRequestsRequestSchema, getPaymentRequestsResponseSchema, getUserFriendlyErrorMessage, instructionActivateRequestSchema, instructionActivateResponseSchema, instructionBuildRequestSchema, instructionBuildSchema, instructionDeactivateRequestSchema, instructionDeactivateResponseSchema, instructionDetailsRequestSchema, instructionDetailsResponseSchema, instructionGetAllRequestSchema, instructionGetAllResponseSchema, instructionGetRulesRequestSchema, instructionGetRulesResponseSchema, integrationResponseSchema, integrationTypeSchema, integrationTypeValues, isFailure, isInstanceInit, isSuccess, isTechnicalError, isUserAddressableError, isUserRejectionError, meResponseSchema, newContactRequestSchema, newInstructionRequestSchema, newOperatingAccountSubOrgResponseSchema, orchestrationParamsSchema, orchestrationTypeSchema, paymentRequestBuildRequestSchema, paymentRequestBuildResponseSchema, paymentRequestDetailsRequestSchema, paymentRequestDetailsResponseSchema, paymentRequestNewRequestSchema, paymentRequestSchema, paymentRequestStatusSchema, paymentRequestsDirectionSchema, sessionTokenRequestSchema, sessionTokenResponseSchema, sessionVerifyResponseSchema, setChainIdSchema, settlementParamsSchema, success, transactionGetListRequestSchema, transactionGetListResponseSchema, turnkeyLoginRequestSchema, turnkeyLoginResponseSchema, turnkeyVerificationRequestSchema, turnkeyVerificationResponseSchema, updateIntegrationRequestSchema, vaultWithdrawSettlementParamsSchema, whitelistCheckRequestSchema, whitelistCheckResponseSchema };
1509
+ //# sourceMappingURL=index.mjs.map