@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,1152 +1,1973 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/instructions/index.ts
31
- var instructions_exports = {};
32
- __export(instructions_exports, {
33
- DEFAULT_INTERVAL_SECONDS: () => DEFAULT_INTERVAL_SECONDS,
34
- INSTRUCTION_DEFAULT_TIMEOUT: () => INSTRUCTION_DEFAULT_TIMEOUT,
35
- convertGweiToWei: () => convertGweiToWei,
36
- createActivationPayload: () => createActivationPayload,
37
- createBuildPayload: () => createBuildPayload,
38
- createInstructionDomain: () => createInstructionDomain,
39
- createInstructionTypedData: () => createInstructionTypedData,
40
- createRefuelBuildPayload: () => createRefuelBuildPayload,
41
- createScheduleInterval: () => createScheduleInterval,
42
- createScheduleIntervalLatencyLimit: () => createScheduleIntervalLatencyLimit,
43
- createScheduleRepeat: () => createScheduleRepeat,
44
- createScheduleStart: () => createScheduleStart,
45
- createSweepDepositAccountBuildPayload: () => createSweepDepositAccountBuildPayload,
46
- createTransferBuildPayload: () => createTransferBuildPayload,
47
- createUniswapV3ExactInputBuildPayload: () => createUniswapV3ExactInputBuildPayload,
48
- decodeInstructionParameters: () => decodeInstructionParameters,
49
- eip712TypesMap: () => eip712TypesMap,
50
- resolveDepositorForSweepDepositAccountIfNeeded: () => resolveDepositorForSweepDepositAccountIfNeeded,
51
- resolveFee: () => resolveFee,
52
- resolveGasLimitIfNeeded: () => resolveGasLimitIfNeeded,
53
- resolveRecipientForUniswapV3ExactInputIfNeeded: () => resolveRecipientForUniswapV3ExactInputIfNeeded,
54
- resolveSchedule: () => resolveSchedule
55
- });
56
- module.exports = __toCommonJS(instructions_exports);
57
-
58
- // src/schemas/instruction.ts
59
- var import_zod2 = require("zod");
1
+ const require_chunk = require('../chunk-kSYXY2_d.js');
2
+ let _otim_utils_schemas = require("@otim/utils/schemas");
3
+ let _otim_utils_helpers = require("@otim/utils/helpers");
4
+ let viem = require("viem");
60
5
 
61
- // src/schemas/misc.ts
62
- var import_zod = require("zod");
63
- var DATE_REGEX = /^(19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
64
- var DATE_ISO_8601_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
65
- var DATE_STANDARD_REGEX = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d{2}$/;
66
- var TIME_REGEX = /^(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] (AM|PM)$/;
67
- var regexSchema = (regex, message) => import_zod.z.string().regex(regex, message);
68
- var nonEmptyStringSchema = import_zod.z.string().min(1);
69
- var numberSchema = import_zod.z.union([
70
- import_zod.z.number().finite(),
71
- import_zod.z.string().regex(/^-?\d*\.?\d+(?:[eE][-+]?\d+)?$/).transform(Number)
72
- ]);
73
- var decimalStringSchema = import_zod.z.string().regex(/^-?\d*\.?\d+$/).refine((val) => !isNaN(parseFloat(val)), {
74
- message: "Must be a valid decimal number"
75
- });
76
- var bigintSchema = import_zod.z.union([
77
- import_zod.z.bigint(),
78
- import_zod.z.string().regex(/^-?\d+$/).transform(BigInt)
79
- ]);
80
- var hexStringSchema = import_zod.z.string().startsWith("0x").transform((val) => val);
81
- var dateSchema = regexSchema(DATE_REGEX);
82
- var dateISO8601Schema = regexSchema(DATE_ISO_8601_REGEX);
83
- var dateStandardSchema = regexSchema(DATE_STANDARD_REGEX);
84
- var timeSchema = regexSchema(TIME_REGEX);
85
- var Sort = {
86
- Asc: "asc",
87
- Desc: "desc"
88
- };
89
- var sortValues = Object.values(Sort);
90
- var vrsSchema = import_zod.z.object({
91
- v: import_zod.z.number(),
92
- r: import_zod.z.string(),
93
- s: import_zod.z.string()
94
- });
95
- var eip2098SignatureSchema = import_zod.z.object({
96
- yParity: import_zod.z.number(),
97
- r: import_zod.z.string(),
98
- s: import_zod.z.string()
99
- });
6
+ //#region src/instructions/constants.ts
7
+ /**
8
+ * Default interval used when none is provided (in seconds).
9
+ */
10
+ const DEFAULT_INTERVAL_SECONDS = 12;
11
+ /**
12
+ * Default API timeout for instruction operations (in milliseconds).
13
+ */
14
+ const INSTRUCTION_DEFAULT_TIMEOUT = 3e4;
100
15
 
101
- // src/schemas/instruction.ts
102
- var InstructionState = {
103
- PendingActivation: "PendingActivation",
104
- Active: "Active",
105
- PendingDeactivation: "PendingDeactivation",
106
- Deactivated: "Deactivated",
107
- Errored: "Errored",
108
- Completed: "Completed",
109
- UserNotDelegated: "UserNotDelegated",
110
- InFlight: "InFlight",
111
- NotifyUser: "NotifyUser"
112
- };
113
- var instructionStateValues = Object.values(InstructionState);
114
- var instructionStateSchema = import_zod2.z.enum(instructionStateValues);
115
- var InstructionAction = {
116
- RefuelERC20: "refuelERC20",
117
- Refuel: "refuel",
118
- Transfer: "transfer",
119
- TransferERC20: "transferERC20",
120
- UniswapV3ExactInput: "uniswapV3ExactInput",
121
- Sweep: "sweep",
122
- SweepERC20: "sweepERC20",
123
- SweepCCTP: "sweepCCTP",
124
- SweepUniswapV3: "sweepUniswapV3",
125
- SweepDepositAccount: "sweepDepositAccount",
126
- SweepDepositAccountERC20: "sweepDepositAccountERC20",
127
- DeactivateInstruction: "deactivateInstruction",
128
- SweepSkipCCTPDepositAccount: "sweepSkipCCTPDepositAccount"
129
- };
130
- var instructionActionValues = Object.values(InstructionAction);
131
- var instructionActionSchema = import_zod2.z.enum(instructionActionValues);
132
- var InstructionScheduleStartType = {
133
- Now: "now",
134
- DateTime: "datetime"
135
- };
136
- var instructionScheduleStartValues = Object.values(
137
- InstructionScheduleStartType
138
- );
139
- var baseStartSchema = import_zod2.z.object({
140
- type: import_zod2.z.enum(instructionScheduleStartValues)
141
- });
142
- var nowStartSchema = baseStartSchema.extend({
143
- type: import_zod2.z.literal(InstructionScheduleStartType.Now)
144
- });
145
- var dateTimeStartSchema = baseStartSchema.extend({
146
- type: import_zod2.z.literal(InstructionScheduleStartType.DateTime),
147
- startDate: dateStandardSchema,
148
- startTime: import_zod2.z.string()
149
- });
150
- var instructionScheduleStartSchema = import_zod2.z.discriminatedUnion("type", [
151
- nowStartSchema,
152
- dateTimeStartSchema
153
- ]);
154
- var InstructionScheduleRepeatType = {
155
- UntilDeactivated: "until-deactivated",
156
- MaxExecutions: "max-executions"
157
- };
158
- var instructionScheduleRepeatValues = Object.values(
159
- InstructionScheduleRepeatType
160
- );
161
- var baseRepeatSchema = import_zod2.z.object({});
162
- var untilDeactivatedRepeatSchema = baseRepeatSchema.extend({
163
- type: import_zod2.z.literal(InstructionScheduleRepeatType.UntilDeactivated)
164
- });
165
- var maxExecutionsRepeatSchema = baseRepeatSchema.extend({
166
- type: import_zod2.z.literal(InstructionScheduleRepeatType.MaxExecutions),
167
- maxExecutions: numberSchema
168
- });
169
- var instructionScheduleRepeatSchema = import_zod2.z.discriminatedUnion("type", [
170
- untilDeactivatedRepeatSchema,
171
- maxExecutionsRepeatSchema
172
- ]);
173
- var InstructionScheduleRetryType = {
174
- UntilDeactivated: "until-deactivated",
175
- TimeLimited: "time-limited"
176
- };
177
- var instructionScheduleRetryValues = Object.values(
178
- InstructionScheduleRetryType
179
- );
180
- var baseRetrySchema = import_zod2.z.object({});
181
- var untilDeactivatedRetrySchema = baseRetrySchema.extend({
182
- type: import_zod2.z.literal(InstructionScheduleRetryType.UntilDeactivated)
183
- });
184
- var timeLimitedRetrySchema = baseRetrySchema.extend({
185
- type: import_zod2.z.literal(InstructionScheduleRetryType.TimeLimited),
186
- retryCount: numberSchema
187
- });
188
- var instructionScheduleRetrySchema = import_zod2.z.discriminatedUnion("type", [
189
- untilDeactivatedRetrySchema,
190
- timeLimitedRetrySchema
191
- ]);
192
- var TimeUnit = {
193
- None: "none",
194
- Second: "second",
195
- Minute: "minute",
196
- Hour: "hour",
197
- Day: "day",
198
- Week: "week",
199
- Month: "month"
200
- };
201
- var timeUnitValues = Object.values(TimeUnit);
202
- var timeUnitSchema = import_zod2.z.enum(timeUnitValues);
203
- var instructionExecutionStateSchema = import_zod2.z.object({
204
- executionStatus: instructionStateSchema.optional(),
205
- executionCounter: import_zod2.z.number().int().optional(),
206
- lastExecuted: import_zod2.z.number().int().optional()
207
- });
208
- var instructionSchema = import_zod2.z.object({
209
- instructionId: hexStringSchema,
210
- createdAt: import_zod2.z.number().optional(),
211
- startAt: import_zod2.z.string().nullish(),
212
- interval: import_zod2.z.number().nullish(),
213
- timeout: import_zod2.z.number().nullish(),
214
- maxExecutions: import_zod2.z.number().nullish(),
215
- executionState: instructionExecutionStateSchema.optional(),
216
- actionName: import_zod2.z.string().optional(),
217
- arguments: import_zod2.z.any(),
218
- nickname: import_zod2.z.string().nullish(),
219
- lastInstructedValue: import_zod2.z.string().optional(),
220
- lastErrorCode: import_zod2.z.number().nullish(),
221
- lastErrorMessage: import_zod2.z.string().nullish(),
222
- totalInstructedValue: import_zod2.z.string().optional(),
223
- instructedTokenAddress: hexStringSchema.nullish(),
224
- chainId: import_zod2.z.number().nullish(),
225
- chain: import_zod2.z.string().optional()
226
- });
227
- var instructionsSchema = import_zod2.z.array(instructionSchema);
228
- var instructionSummarySchema = import_zod2.z.object({
229
- instructionId: hexStringSchema,
230
- chainId: import_zod2.z.number().int(),
231
- executionCount: import_zod2.z.number().int(),
232
- onTimeCount: import_zod2.z.number().int(),
233
- lateCount: import_zod2.z.number().int(),
234
- wasActivatedDuring: import_zod2.z.boolean(),
235
- amount: import_zod2.z.number().default(0),
236
- instructedValue: import_zod2.z.string().nullish().default("0"),
237
- instructedTokenAddress: import_zod2.z.string().nullish().default(null)
238
- });
239
- var instructionSummariesSchema = import_zod2.z.array(instructionSummarySchema);
240
- var instructionSummariesByDateSchema = import_zod2.z.record(
241
- import_zod2.z.string(),
242
- instructionSummariesSchema
243
- );
244
- var InstructionViewTimescale = {
245
- Days: "days",
246
- Hours: "hours",
247
- Minutes: "minutes",
248
- Seconds: "seconds"
249
- };
250
- var instructionViewTimescaleValues = Object.values(
251
- InstructionViewTimescale
252
- );
253
-
254
- // src/instructions/build.ts
255
- var import_viem2 = require("viem");
256
-
257
- // src/helpers/blockchain.ts
258
- var import_viem = require("viem");
259
- var parseSignatureToVRS = (signature) => {
260
- if (typeof signature !== "string") {
261
- throw new Error("Signature must be a string");
262
- }
263
- if (!signature.startsWith("0x")) {
264
- throw new Error('Signature must start with "0x"');
265
- }
266
- if (signature.length !== 132) {
267
- throw new Error(
268
- 'Signature must be 65 bytes (130 hex chars) plus "0x" = 132 total length'
269
- );
270
- }
271
- const r = signature.slice(2, 66);
272
- const s = signature.slice(66, 130);
273
- const vHex = signature.slice(130, 132);
274
- const v = parseInt(vHex, 16);
275
- return { v, r: `0x${r}`, s: `0x${s}` };
276
- };
277
- var isValidV = (v) => {
278
- return v === 0 || v === 1 || v === 27 || v === 28 || v >= 35;
279
- };
280
- var normalizeV = (v) => {
281
- if (!isValidV(v)) return 0;
282
- const cmp = v <= 1 ? 1 : 0;
283
- const result = v % 2 === cmp;
284
- return Number(result) % 2;
285
- };
286
- var createEIP2098Signature = (vrs) => {
287
- const v = vrs.v;
288
- const r = vrs.r;
289
- const s = vrs.s;
290
- return { yParity: normalizeV(v), r, s };
291
- };
292
-
293
- // src/helpers/date.ts
294
- var import_zod3 = __toESM(require("zod"));
295
- var iso8601DateSchema = import_zod3.default.string().regex(
296
- /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/,
297
- "Must be a valid ISO 8601 date format (e.g., 2024-12-31T23:59:59.000Z)"
298
- );
299
- var TimeUnit2 = {
300
- Day: "day",
301
- Month: "month",
302
- Year: "year"
303
- };
304
- var units = {
305
- [TimeUnit2.Day]: {
306
- one: "day",
307
- other: "days"
308
- },
309
- [TimeUnit2.Month]: {
310
- one: "month",
311
- other: "months"
312
- },
313
- [TimeUnit2.Year]: {
314
- one: "year",
315
- other: "years"
316
- }
317
- };
318
- var parseDateTime = (dateInput, timeInput) => {
319
- const dateRegex = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/;
320
- const timeRegex = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*(AM|PM|am|pm)?$/;
321
- const dateMatch = dateRegex.exec(dateInput);
322
- if (!dateMatch) {
323
- return void 0;
324
- }
325
- const month = parseInt(dateMatch[1], 10) - 1;
326
- const day = parseInt(dateMatch[2], 10);
327
- const year = parseInt(dateMatch[3], 10);
328
- let hours = 0;
329
- let minutes = 0;
330
- let seconds = 0;
331
- if (timeInput) {
332
- timeInput = timeInput.replace(/\u00A0/g, " ").trim();
333
- const timeMatch = timeRegex.exec(timeInput);
334
- if (!timeMatch) {
335
- return void 0;
336
- }
337
- hours = parseInt(timeMatch[1], 10);
338
- minutes = parseInt(timeMatch[2], 10);
339
- seconds = timeMatch[3] ? parseInt(timeMatch[3], 10) : 0;
340
- const meridiem = timeMatch[4] ? timeMatch[4].toUpperCase() : null;
341
- if (meridiem === "PM" && hours < 12) {
342
- hours += 12;
343
- } else if (meridiem === "AM" && hours === 12) {
344
- hours = 0;
345
- }
346
- }
347
- const date = new Date(Date.UTC(year, month, day, hours, minutes, seconds));
348
- if (isNaN(date.getTime())) {
349
- return void 0;
350
- }
351
- return date;
352
- };
353
-
354
- // src/helpers/datetime.ts
355
- var import_zod4 = require("zod");
356
- var timeUnitInputValueSchema = import_zod4.z.object({
357
- unit: timeUnitSchema,
358
- value: import_zod4.z.number().finite(),
359
- seconds: import_zod4.z.number().finite()
360
- });
361
- var coerceSecondsFromTimeUnitValue = (value) => {
362
- if (!value) return 0;
363
- if (typeof value === "object") {
364
- const obj = value;
365
- const seconds = obj?.seconds;
366
- if (typeof seconds === "number" && Number.isFinite(seconds)) return seconds;
367
- }
368
- if (typeof value === "string") {
369
- try {
370
- const parsed = JSON.parse(value);
371
- const seconds = parsed?.seconds;
372
- if (typeof seconds === "number" && Number.isFinite(seconds))
373
- return seconds;
374
- } catch {
375
- }
376
- }
377
- return 0;
378
- };
379
-
380
- // src/instructions/constants.ts
381
- var DEFAULT_INTERVAL_SECONDS = 12;
382
- var INSTRUCTION_DEFAULT_TIMEOUT = 3e4;
383
-
384
- // src/instructions/build.ts
385
- function createBuildPayload({
386
- action,
387
- address,
388
- chainId,
389
- maxExecutions,
390
- salt,
391
- actionArguments
392
- }) {
393
- return {
394
- address,
395
- chainId,
396
- maxExecutions,
397
- salt: salt ?? Math.floor(Math.random() * Number.MAX_SAFE_INTEGER),
398
- actionArguments: {
399
- [action]: actionArguments
400
- }
401
- };
16
+ //#endregion
17
+ //#region src/instructions/build.ts
18
+ /**
19
+ * Converts a PascalCase string to camelCase.
20
+ * Example: "TransferERC20" -> "transferERC20"
21
+ */
22
+ function toCamelCase$1(str) {
23
+ return str.charAt(0).toLowerCase() + str.slice(1);
402
24
  }
403
- var createScheduleStart = (values) => {
404
- if (values && values.type === "datetime") {
405
- const date = parseDateTime(values.startDate, values.startTime);
406
- if (!date) throw new Error("Invalid start date or time");
407
- return { startAt: Math.floor(date.getTime() / 1e3), startBy: 0 };
408
- }
409
- return { startAt: 0, startBy: 0 };
410
- };
411
- var createScheduleInterval = (values) => {
412
- if (!values) return { interval: DEFAULT_INTERVAL_SECONDS };
413
- const seconds = coerceSecondsFromTimeUnitValue(values);
414
- return { interval: seconds || DEFAULT_INTERVAL_SECONDS };
25
+ /**
26
+ * Build payload creator
27
+ *
28
+ * Creates the request body to build an instruction on the backend.
29
+ */
30
+ function createBuildPayload({ action, address, chainId, maxExecutions, salt, actionArguments }) {
31
+ return {
32
+ address,
33
+ chainId,
34
+ maxExecutions,
35
+ salt: salt ?? Math.floor(Math.random() * Number.MAX_SAFE_INTEGER),
36
+ actionArguments: { [toCamelCase$1(action)]: actionArguments }
37
+ };
38
+ }
39
+ /**
40
+ * Resolves schedule start values.
41
+ * - "datetime": schedules with explicit startAt timestamp (in seconds)
42
+ * - "now" or omitted: starts immediately
43
+ */
44
+ const createScheduleStart = (values) => {
45
+ if (values && values.type === "datetime") {
46
+ const date = (0, _otim_utils_helpers.parseDateTime)(values.startDate, values.startTime);
47
+ if (!date) throw new Error("Invalid start date or time");
48
+ return {
49
+ startAt: Math.floor(date.getTime() / 1e3),
50
+ startBy: 0
51
+ };
52
+ }
53
+ return {
54
+ startAt: 0,
55
+ startBy: 0
56
+ };
415
57
  };
416
- var createScheduleIntervalLatencyLimit = (values) => {
417
- if (!values) return { timeout: 0 };
418
- const seconds = coerceSecondsFromTimeUnitValue(values);
419
- return { timeout: seconds };
58
+ const createScheduleInterval = (values) => {
59
+ if (!values) return { interval: DEFAULT_INTERVAL_SECONDS };
60
+ return { interval: (0, _otim_utils_helpers.coerceSecondsFromTimeUnitValue)(values) || DEFAULT_INTERVAL_SECONDS };
420
61
  };
421
- var createScheduleRepeat = (values) => {
422
- if (values.type === "max-executions") {
423
- return { maxExecutions: values.maxExecutions };
424
- }
425
- return { maxExecutions: 0 };
62
+ /**
63
+ * Converts a time unit value to seconds and returns the timeout field.
64
+ * Timeout represents the maximum latency allowed for scheduled execution (0 = no limit).
65
+ */
66
+ const createScheduleIntervalLatencyLimit = (values) => {
67
+ if (!values) return { timeout: 0 };
68
+ return { timeout: (0, _otim_utils_helpers.coerceSecondsFromTimeUnitValue)(values) };
426
69
  };
427
- var resolveSchedule = (repeat, start, interval, advanced) => {
428
- const { maxExecutions } = createScheduleRepeat(repeat);
429
- if (!start && !interval && !advanced?.intervalLatencyLimit) {
430
- return { maxExecutions };
431
- }
432
- const { startAt, startBy } = createScheduleStart(start);
433
- const { interval: intervalSeconds } = createScheduleInterval(interval);
434
- const { timeout } = createScheduleIntervalLatencyLimit(
435
- advanced?.intervalLatencyLimit
436
- );
437
- return {
438
- maxExecutions,
439
- schedule: { interval: intervalSeconds, startBy, startAt, timeout }
440
- };
70
+ /**
71
+ * Resolves maxExecutions based on repeat policy.
72
+ * Returns 0 for unlimited executions when type is "until-deactivated".
73
+ */
74
+ const createScheduleRepeat = (values) => {
75
+ if (values.type === "max-executions") return { maxExecutions: values.maxExecutions };
76
+ return { maxExecutions: 0 };
441
77
  };
442
- var convertGweiToWei = (gweiValue) => {
443
- try {
444
- if (isNaN(Number(gweiValue)) || Number(gweiValue) < 0) {
445
- throw new Error(`Invalid Gwei value: ${gweiValue}`);
446
- }
447
- const gweiString = Number(gweiValue).toFixed(18);
448
- return (0, import_viem2.toHex)((0, import_viem2.parseUnits)(gweiString, 9));
449
- } catch {
450
- return (0, import_viem2.toHex)(0n);
451
- }
78
+ /**
79
+ * Assembles the schedule object when any schedule-related option is provided.
80
+ */
81
+ const resolveSchedule = (repeat, start, interval, advanced) => {
82
+ const { maxExecutions } = createScheduleRepeat(repeat);
83
+ if (!start && !interval && !advanced?.intervalLatencyLimit) return { maxExecutions };
84
+ const { startAt, startBy } = createScheduleStart(start);
85
+ const { interval: intervalSeconds } = createScheduleInterval(interval);
86
+ const { timeout } = createScheduleIntervalLatencyLimit(advanced?.intervalLatencyLimit);
87
+ return {
88
+ maxExecutions,
89
+ schedule: {
90
+ interval: intervalSeconds,
91
+ startBy,
92
+ startAt,
93
+ timeout
94
+ }
95
+ };
452
96
  };
453
- var resolveFee = (fee, advanced) => {
454
- const baseFee = {
455
- fee: {
456
- executionFee: 0,
457
- token: fee.token,
458
- maxBaseFeePerGas: convertGweiToWei(advanced?.maxBaseFeePerGas ?? 0),
459
- maxPriorityFeePerGas: convertGweiToWei(
460
- advanced?.maxPriorityFeePerGas ?? 0
461
- )
462
- }
463
- };
464
- const additionalFields = {};
465
- if (advanced?.meanPriceLookBack) {
466
- additionalFields.meanPriceLookBack = coerceSecondsFromTimeUnitValue(
467
- advanced.meanPriceLookBack
468
- );
469
- }
470
- if (advanced?.maxPriceDeviationBps) {
471
- const bpsValue = parseInt(String(advanced.maxPriceDeviationBps), 10);
472
- if (!isNaN(bpsValue)) {
473
- additionalFields.maxPriceDeviationBps = bpsValue;
474
- }
475
- }
476
- return { ...baseFee, ...additionalFields };
97
+ /**
98
+ * Converts a Gwei value into Wei as a hex string. Returns 0x0 on invalid input.
99
+ */
100
+ const convertGweiToWei = (gweiValue) => {
101
+ try {
102
+ if (isNaN(Number(gweiValue)) || Number(gweiValue) < 0) throw new Error(`Invalid Gwei value: ${gweiValue}`);
103
+ return (0, viem.toHex)((0, viem.parseUnits)(Number(gweiValue).toFixed(18), 9));
104
+ } catch {
105
+ return (0, viem.toHex)(0n);
106
+ }
477
107
  };
478
- var resolveGasLimitIfNeeded = (action) => {
479
- const actionsWithGasLimit = [
480
- "refuel",
481
- "transfer"
482
- ];
483
- return actionsWithGasLimit.includes(action) ? { gasLimit: 0 } : {};
108
+ /**
109
+ * Builds the fee object including EIP-1559 caps and optional pricing controls.
110
+ */
111
+ const resolveFee = (fee, advanced) => {
112
+ const baseFee = { fee: {
113
+ executionFee: 0,
114
+ token: fee.token,
115
+ maxBaseFeePerGas: convertGweiToWei(advanced?.maxBaseFeePerGas ?? 0),
116
+ maxPriorityFeePerGas: convertGweiToWei(advanced?.maxPriorityFeePerGas ?? 0)
117
+ } };
118
+ const additionalFields = {};
119
+ if (advanced?.meanPriceLookBack) additionalFields.meanPriceLookBack = (0, _otim_utils_helpers.coerceSecondsFromTimeUnitValue)(advanced.meanPriceLookBack);
120
+ if (advanced?.maxPriceDeviationBps) {
121
+ const bpsValue = parseInt(String(advanced.maxPriceDeviationBps), 10);
122
+ if (!isNaN(bpsValue)) additionalFields.maxPriceDeviationBps = bpsValue;
123
+ }
124
+ return {
125
+ ...baseFee,
126
+ ...additionalFields
127
+ };
484
128
  };
485
- var resolveDepositorForSweepDepositAccountIfNeeded = (action, depositorAddress) => {
486
- const actions = [
487
- "sweepDepositAccount",
488
- "sweepDepositAccountERC20"
489
- ];
490
- return actions.includes(action) ? { depositor: depositorAddress } : {};
129
+ /**
130
+ * Some actions allow an explicit gas limit. Returns { gasLimit: 0 } when
131
+ * needed, otherwise an empty object to keep payload minimal.
132
+ */
133
+ const resolveGasLimitIfNeeded = (action) => {
134
+ return [_otim_utils_schemas.InstructionAction.Refuel, _otim_utils_schemas.InstructionAction.Transfer].includes(action) ? { gasLimit: 0 } : {};
491
135
  };
492
- var resolveRecipientForUniswapV3ExactInputIfNeeded = (action, recipientAddress) => {
493
- return action === "uniswapV3ExactInput" ? { recipient: recipientAddress } : {};
136
+ /**
137
+ * Adds recipient field for Uniswap V3 exact input action when required.
138
+ */
139
+ const resolveRecipientForUniswapV3ExactInputIfNeeded = (action, recipientAddress) => {
140
+ return action === _otim_utils_schemas.InstructionAction.UniswapV3ExactInput ? { recipient: recipientAddress } : {};
494
141
  };
495
142
 
496
- // src/instructions/actions/refuel/index.ts
143
+ //#endregion
144
+ //#region src/instructions/actions/refuel/index.ts
497
145
  function createRefuelBuildPayload(payload) {
498
- const { address, chainId, maxExecutions, salt } = payload;
499
- const action = payload.token ? InstructionAction.RefuelERC20 : InstructionAction.Refuel;
500
- const actionArguments = {
501
- target: payload.target,
502
- threshold: payload.threshold,
503
- endBalance: payload.endBalance,
504
- fee: payload.fee,
505
- schedule: payload.schedule
506
- };
507
- if (payload.token) {
508
- actionArguments.token = payload.token;
509
- }
510
- if (payload.gasLimit !== void 0) {
511
- actionArguments.gasLimit = payload.gasLimit;
512
- }
513
- return createBuildPayload({
514
- action,
515
- actionArguments,
516
- address,
517
- chainId,
518
- maxExecutions,
519
- salt
520
- });
146
+ const { address, chainId, maxExecutions, salt } = payload;
147
+ const action = payload.token ? _otim_utils_schemas.InstructionAction.RefuelERC20 : _otim_utils_schemas.InstructionAction.Refuel;
148
+ const actionArguments = {
149
+ target: payload.target,
150
+ threshold: payload.threshold,
151
+ endBalance: payload.endBalance,
152
+ fee: payload.fee,
153
+ schedule: payload.schedule
154
+ };
155
+ if (payload.token) actionArguments.token = payload.token;
156
+ if (payload.gasLimit !== void 0) actionArguments.gasLimit = payload.gasLimit;
157
+ return createBuildPayload({
158
+ action,
159
+ actionArguments,
160
+ address,
161
+ chainId,
162
+ maxExecutions,
163
+ salt
164
+ });
521
165
  }
522
166
 
523
- // src/instructions/actions/sweep/index.ts
524
- function createSweepDepositAccountBuildPayload(payload) {
525
- const { address, chainId, maxExecutions, salt } = payload;
526
- const action = payload.token ? InstructionAction.SweepDepositAccountERC20 : InstructionAction.SweepDepositAccount;
527
- const actionArguments = {
528
- depositor: payload.depositor,
529
- recipient: payload.recipient,
530
- threshold: payload.threshold,
531
- fee: payload.fee
532
- };
533
- if (payload.token) {
534
- actionArguments.token = payload.token;
535
- }
536
- return createBuildPayload({
537
- action,
538
- actionArguments,
539
- address,
540
- chainId,
541
- maxExecutions,
542
- salt
543
- });
544
- }
545
-
546
- // src/instructions/actions/swap/index.ts
167
+ //#endregion
168
+ //#region src/instructions/actions/swap/index.ts
547
169
  function createUniswapV3ExactInputBuildPayload(payload) {
548
- const { address, chainId, maxExecutions, salt } = payload;
549
- const action = InstructionAction.UniswapV3ExactInput;
550
- const actionArguments = {
551
- recipient: payload.recipient,
552
- tokenIn: payload.tokenIn,
553
- tokenOut: payload.tokenOut,
554
- feeTier: payload.feeTier,
555
- amountIn: payload.amountIn,
556
- floorAmountOut: payload.floorAmountOut,
557
- meanPriceLookBack: payload.meanPriceLookBack ?? 500,
558
- maxPriceDeviationBps: payload.maxPriceDeviationBps ?? 500,
559
- schedule: payload.schedule,
560
- fee: payload.fee
561
- };
562
- return createBuildPayload({
563
- action,
564
- actionArguments,
565
- address,
566
- chainId,
567
- maxExecutions,
568
- salt
569
- });
170
+ const { address, chainId, maxExecutions, salt } = payload;
171
+ const action = _otim_utils_schemas.InstructionAction.UniswapV3ExactInput;
172
+ return createBuildPayload({
173
+ action,
174
+ actionArguments: {
175
+ recipient: payload.recipient,
176
+ tokenIn: payload.tokenIn,
177
+ tokenOut: payload.tokenOut,
178
+ feeTier: payload.feeTier,
179
+ amountIn: payload.amountIn,
180
+ floorAmountOut: payload.floorAmountOut,
181
+ meanPriceLookBack: payload.meanPriceLookBack ?? 500,
182
+ maxPriceDeviationBps: payload.maxPriceDeviationBps ?? 500,
183
+ schedule: payload.schedule,
184
+ fee: payload.fee
185
+ },
186
+ address,
187
+ chainId,
188
+ maxExecutions,
189
+ salt
190
+ });
570
191
  }
571
192
 
572
- // src/instructions/actions/transfer/index.ts
193
+ //#endregion
194
+ //#region src/instructions/actions/transfer/index.ts
573
195
  function createTransferBuildPayload(payload) {
574
- const { address, chainId, maxExecutions, salt } = payload;
575
- const action = payload.token ? InstructionAction.TransferERC20 : InstructionAction.Transfer;
576
- const actionArguments = {
577
- target: payload.target,
578
- value: payload.value,
579
- fee: payload.fee,
580
- schedule: payload.schedule
581
- };
582
- if (payload.token) {
583
- actionArguments.token = payload.token;
584
- }
585
- if (payload.gasLimit !== void 0) {
586
- actionArguments.gasLimit = payload.gasLimit;
587
- }
588
- return createBuildPayload({
589
- action,
590
- actionArguments,
591
- address,
592
- chainId,
593
- maxExecutions,
594
- salt
595
- });
196
+ const { address, chainId, maxExecutions, salt } = payload;
197
+ const action = payload.token ? _otim_utils_schemas.InstructionAction.TransferERC20 : _otim_utils_schemas.InstructionAction.Transfer;
198
+ const actionArguments = {
199
+ target: payload.target,
200
+ value: payload.value,
201
+ fee: payload.fee,
202
+ schedule: payload.schedule
203
+ };
204
+ if (payload.token) actionArguments.token = payload.token;
205
+ if (payload.gasLimit !== void 0) actionArguments.gasLimit = payload.gasLimit;
206
+ return createBuildPayload({
207
+ action,
208
+ actionArguments,
209
+ address,
210
+ chainId,
211
+ maxExecutions,
212
+ salt
213
+ });
596
214
  }
597
215
 
598
- // src/instructions/activate.ts
599
- var import_viem3 = require("viem");
216
+ //#endregion
217
+ //#region src/instructions/actions/vault/index.ts
218
+ function createDepositERC4626BuildPayload(payload) {
219
+ const { address, chainId, maxExecutions, salt } = payload;
220
+ const action = _otim_utils_schemas.InstructionAction.DepositERC4626;
221
+ return createBuildPayload({
222
+ action,
223
+ actionArguments: {
224
+ vault: payload.vault,
225
+ recipient: payload.recipient,
226
+ value: payload.value,
227
+ minDeposit: payload.minDeposit,
228
+ minTotalShares: payload.minTotalShares,
229
+ schedule: payload.schedule,
230
+ fee: payload.fee
231
+ },
232
+ address,
233
+ chainId,
234
+ maxExecutions,
235
+ salt
236
+ });
237
+ }
238
+ function createSweepDepositERC4626BuildPayload(payload) {
239
+ const { address, chainId, maxExecutions, salt } = payload;
240
+ const action = _otim_utils_schemas.InstructionAction.SweepDepositERC4626;
241
+ return createBuildPayload({
242
+ action,
243
+ actionArguments: {
244
+ vault: payload.vault,
245
+ recipient: payload.recipient,
246
+ threshold: payload.threshold,
247
+ endBalance: payload.endBalance,
248
+ minDeposit: payload.minDeposit,
249
+ minTotalShares: payload.minTotalShares,
250
+ fee: payload.fee
251
+ },
252
+ address,
253
+ chainId,
254
+ maxExecutions,
255
+ salt
256
+ });
257
+ }
258
+ function createWithdrawERC4626BuildPayload(payload) {
259
+ const { address, chainId, maxExecutions, salt } = payload;
260
+ const action = _otim_utils_schemas.InstructionAction.WithdrawERC4626;
261
+ return createBuildPayload({
262
+ action,
263
+ actionArguments: {
264
+ vault: payload.vault,
265
+ recipient: payload.recipient,
266
+ value: payload.value,
267
+ minWithdraw: payload.minWithdraw,
268
+ schedule: payload.schedule,
269
+ fee: payload.fee
270
+ },
271
+ address,
272
+ chainId,
273
+ maxExecutions,
274
+ salt
275
+ });
276
+ }
277
+ function createSweepWithdrawERC4626BuildPayload(payload) {
278
+ const { address, chainId, maxExecutions, salt } = payload;
279
+ const action = _otim_utils_schemas.InstructionAction.SweepWithdrawERC4626;
280
+ return createBuildPayload({
281
+ action,
282
+ actionArguments: {
283
+ vault: payload.vault,
284
+ recipient: payload.recipient,
285
+ threshold: payload.threshold,
286
+ endBalance: payload.endBalance,
287
+ minWithdraw: payload.minWithdraw,
288
+ fee: payload.fee
289
+ },
290
+ address,
291
+ chainId,
292
+ maxExecutions,
293
+ salt
294
+ });
295
+ }
600
296
 
601
- // src/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.ts
602
- var targetField = {
603
- name: "target",
604
- type: "address"
297
+ //#endregion
298
+ //#region src/instructions/contracts/artifacts/abi/build-instruction-action-arguments-abi.ts
299
+ const targetField = {
300
+ name: "target",
301
+ type: "address"
605
302
  };
606
- var scheduleField = {
607
- name: "schedule",
608
- type: "tuple",
609
- components: [
610
- { name: "startAt", type: "uint256" },
611
- { name: "startBy", type: "uint256" },
612
- { name: "interval", type: "uint256" },
613
- { name: "timeout", type: "uint256" }
614
- ]
303
+ const scheduleField = {
304
+ name: "schedule",
305
+ type: "tuple",
306
+ components: [
307
+ {
308
+ name: "startAt",
309
+ type: "uint256"
310
+ },
311
+ {
312
+ name: "startBy",
313
+ type: "uint256"
314
+ },
315
+ {
316
+ name: "interval",
317
+ type: "uint256"
318
+ },
319
+ {
320
+ name: "timeout",
321
+ type: "uint256"
322
+ }
323
+ ]
615
324
  };
616
- var tokenField = {
617
- name: "token",
618
- type: "address"
325
+ const tokenField = {
326
+ name: "token",
327
+ type: "address"
619
328
  };
620
- var feeField = {
621
- name: "fee",
622
- type: "tuple",
623
- components: [
624
- { name: "token", type: "address" },
625
- { name: "maxBaseFeePerGas", type: "uint256" },
626
- { name: "maxPriorityFeePerGas", type: "uint256" },
627
- { name: "executionFee", type: "uint256" }
628
- ]
329
+ const feeField = {
330
+ name: "fee",
331
+ type: "tuple",
332
+ components: [
333
+ {
334
+ name: "token",
335
+ type: "address"
336
+ },
337
+ {
338
+ name: "maxBaseFeePerGas",
339
+ type: "uint256"
340
+ },
341
+ {
342
+ name: "maxPriorityFeePerGas",
343
+ type: "uint256"
344
+ },
345
+ {
346
+ name: "executionFee",
347
+ type: "uint256"
348
+ }
349
+ ]
629
350
  };
630
- var refuelArgumentsAbi = [
631
- targetField,
632
- { name: "threshold", type: "uint256" },
633
- { name: "endBalance", type: "uint256" },
634
- { name: "gasLimit", type: "uint256" },
635
- feeField
351
+ const refuelArgumentsAbi = [
352
+ targetField,
353
+ {
354
+ name: "threshold",
355
+ type: "uint256"
356
+ },
357
+ {
358
+ name: "endBalance",
359
+ type: "uint256"
360
+ },
361
+ {
362
+ name: "gasLimit",
363
+ type: "uint256"
364
+ },
365
+ feeField
366
+ ];
367
+ const refuelERC20ArgumentsAbi = [
368
+ tokenField,
369
+ targetField,
370
+ {
371
+ name: "threshold",
372
+ type: "uint256"
373
+ },
374
+ {
375
+ name: "endBalance",
376
+ type: "uint256"
377
+ },
378
+ feeField
379
+ ];
380
+ const transferArgumentsAbi = [
381
+ targetField,
382
+ {
383
+ name: "value",
384
+ type: "uint256"
385
+ },
386
+ {
387
+ name: "gasLimit",
388
+ type: "uint256"
389
+ },
390
+ scheduleField,
391
+ feeField
636
392
  ];
637
- var refuelERC20ArgumentsAbi = [
638
- tokenField,
639
- targetField,
640
- { name: "threshold", type: "uint256" },
641
- { name: "endBalance", type: "uint256" },
642
- feeField
393
+ const transferERC20ArgumentsAbi = [
394
+ tokenField,
395
+ targetField,
396
+ {
397
+ name: "value",
398
+ type: "uint256"
399
+ },
400
+ scheduleField,
401
+ feeField
643
402
  ];
644
- var transferArgumentsAbi = [
645
- targetField,
646
- { name: "value", type: "uint256" },
647
- { name: "gasLimit", type: "uint256" },
648
- scheduleField,
649
- feeField
403
+ const uniswapV3ExactInputArgumentsAbi = [
404
+ {
405
+ name: "recipient",
406
+ type: "address"
407
+ },
408
+ {
409
+ name: "tokenIn",
410
+ type: "address"
411
+ },
412
+ {
413
+ name: "tokenOut",
414
+ type: "address"
415
+ },
416
+ {
417
+ name: "feeTier",
418
+ type: "uint24"
419
+ },
420
+ {
421
+ name: "amountIn",
422
+ type: "uint256"
423
+ },
424
+ {
425
+ name: "floorAmountOut",
426
+ type: "uint256"
427
+ },
428
+ {
429
+ name: "meanPriceLookBack",
430
+ type: "uint32"
431
+ },
432
+ {
433
+ name: "maxPriceDeviationBPS",
434
+ type: "uint32"
435
+ },
436
+ scheduleField,
437
+ feeField
650
438
  ];
651
- var transferERC20ArgumentsAbi = [
652
- tokenField,
653
- targetField,
654
- { name: "value", type: "uint256" },
655
- scheduleField,
656
- feeField
439
+ const sweepSkipCCTPDepositAccountArgumentsAbi = [
440
+ {
441
+ name: "depositor",
442
+ type: "address"
443
+ },
444
+ {
445
+ name: "destinationDomain",
446
+ type: "uint32"
447
+ },
448
+ {
449
+ name: "destinationMintRecipient",
450
+ type: "bytes32"
451
+ },
452
+ {
453
+ name: "threshold",
454
+ type: "uint256"
455
+ },
456
+ feeField
657
457
  ];
658
- var uniswapV3ExactInputArgumentsAbi = [
659
- { name: "recipient", type: "address" },
660
- { name: "tokenIn", type: "address" },
661
- { name: "tokenOut", type: "address" },
662
- { name: "feeTier", type: "uint24" },
663
- { name: "amountIn", type: "uint256" },
664
- { name: "floorAmountOut", type: "uint256" },
665
- { name: "meanPriceLookBack", type: "uint32" },
666
- { name: "maxPriceDeviationBPS", type: "uint32" },
667
- scheduleField,
668
- feeField
458
+ const deactivateInstructionArgumentsAbi = [{
459
+ name: "instructionId",
460
+ type: "bytes32"
461
+ }, feeField];
462
+ const depositERC4626ArgumentsAbi = [
463
+ {
464
+ name: "vault",
465
+ type: "address"
466
+ },
467
+ {
468
+ name: "recipient",
469
+ type: "address"
470
+ },
471
+ {
472
+ name: "value",
473
+ type: "uint256"
474
+ },
475
+ {
476
+ name: "minDeposit",
477
+ type: "uint256"
478
+ },
479
+ {
480
+ name: "minTotalShares",
481
+ type: "uint256"
482
+ },
483
+ scheduleField,
484
+ feeField
669
485
  ];
670
- var sweepDepositAccountArgumentsAbi = [
671
- { name: "depositor", type: "address" },
672
- { name: "recipient", type: "address" },
673
- { name: "threshold", type: "uint256" },
674
- feeField
486
+ const sweepDepositERC4626ArgumentsAbi = [
487
+ {
488
+ name: "vault",
489
+ type: "address"
490
+ },
491
+ {
492
+ name: "recipient",
493
+ type: "address"
494
+ },
495
+ {
496
+ name: "threshold",
497
+ type: "uint256"
498
+ },
499
+ {
500
+ name: "endBalance",
501
+ type: "uint256"
502
+ },
503
+ {
504
+ name: "minDeposit",
505
+ type: "uint256"
506
+ },
507
+ {
508
+ name: "minTotalShares",
509
+ type: "uint256"
510
+ },
511
+ feeField
675
512
  ];
676
- var sweepDepositAccountERC20ArgumentsAbi = [
677
- tokenField,
678
- { name: "depositor", type: "address" },
679
- { name: "recipient", type: "address" },
680
- { name: "threshold", type: "uint256" },
681
- feeField
513
+ const withdrawERC4626ArgumentsAbi = [
514
+ {
515
+ name: "vault",
516
+ type: "address"
517
+ },
518
+ {
519
+ name: "recipient",
520
+ type: "address"
521
+ },
522
+ {
523
+ name: "value",
524
+ type: "uint256"
525
+ },
526
+ {
527
+ name: "minWithdraw",
528
+ type: "uint256"
529
+ },
530
+ scheduleField,
531
+ feeField
682
532
  ];
683
- var sweepSkipCCTPDepositAccountArgumentsAbi = [
684
- { name: "depositor", type: "address" },
685
- { name: "destinationDomain", type: "uint32" },
686
- { name: "destinationMintRecipient", type: "bytes32" },
687
- { name: "threshold", type: "uint256" },
688
- feeField
533
+ const sweepWithdrawERC4626ArgumentsAbi = [
534
+ {
535
+ name: "vault",
536
+ type: "address"
537
+ },
538
+ {
539
+ name: "recipient",
540
+ type: "address"
541
+ },
542
+ {
543
+ name: "threshold",
544
+ type: "uint256"
545
+ },
546
+ {
547
+ name: "endBalance",
548
+ type: "uint256"
549
+ },
550
+ {
551
+ name: "minWithdraw",
552
+ type: "uint256"
553
+ },
554
+ feeField
689
555
  ];
690
- var deactivateInstructionArgumentsAbi = [
691
- { name: "instructionId", type: "bytes32" },
692
- feeField
556
+ const sweepDepositAccountArgumentsAbi = [
557
+ {
558
+ name: "depositor",
559
+ type: "address"
560
+ },
561
+ {
562
+ name: "recipient",
563
+ type: "address"
564
+ },
565
+ {
566
+ name: "threshold",
567
+ type: "uint256"
568
+ },
569
+ feeField
693
570
  ];
694
- var buildInstructionActionArgumentsAbiMap = {
695
- [InstructionAction.Refuel]: refuelArgumentsAbi,
696
- [InstructionAction.RefuelERC20]: refuelERC20ArgumentsAbi,
697
- [InstructionAction.Transfer]: transferArgumentsAbi,
698
- [InstructionAction.TransferERC20]: transferERC20ArgumentsAbi,
699
- [InstructionAction.UniswapV3ExactInput]: uniswapV3ExactInputArgumentsAbi,
700
- [InstructionAction.SweepDepositAccount]: sweepDepositAccountArgumentsAbi,
701
- [InstructionAction.SweepDepositAccountERC20]: sweepDepositAccountERC20ArgumentsAbi,
702
- [InstructionAction.SweepSkipCCTPDepositAccount]: sweepSkipCCTPDepositAccountArgumentsAbi,
703
- [InstructionAction.DeactivateInstruction]: deactivateInstructionArgumentsAbi
571
+ const sweepDepositAccountERC20ArgumentsAbi = [
572
+ tokenField,
573
+ {
574
+ name: "depositor",
575
+ type: "address"
576
+ },
577
+ {
578
+ name: "recipient",
579
+ type: "address"
580
+ },
581
+ {
582
+ name: "threshold",
583
+ type: "uint256"
584
+ },
585
+ feeField
586
+ ];
587
+ const buildInstructionActionArgumentsAbiMap = {
588
+ [_otim_utils_schemas.InstructionAction.Refuel]: refuelArgumentsAbi,
589
+ [_otim_utils_schemas.InstructionAction.RefuelERC20]: refuelERC20ArgumentsAbi,
590
+ [_otim_utils_schemas.InstructionAction.Transfer]: transferArgumentsAbi,
591
+ [_otim_utils_schemas.InstructionAction.TransferERC20]: transferERC20ArgumentsAbi,
592
+ [_otim_utils_schemas.InstructionAction.UniswapV3ExactInput]: uniswapV3ExactInputArgumentsAbi,
593
+ [_otim_utils_schemas.InstructionAction.SweepSkipCCTPDepositAccount]: sweepSkipCCTPDepositAccountArgumentsAbi,
594
+ [_otim_utils_schemas.InstructionAction.DeactivateInstruction]: deactivateInstructionArgumentsAbi,
595
+ [_otim_utils_schemas.InstructionAction.DepositERC4626]: depositERC4626ArgumentsAbi,
596
+ [_otim_utils_schemas.InstructionAction.SweepDepositERC4626]: sweepDepositERC4626ArgumentsAbi,
597
+ [_otim_utils_schemas.InstructionAction.WithdrawERC4626]: withdrawERC4626ArgumentsAbi,
598
+ [_otim_utils_schemas.InstructionAction.SweepWithdrawERC4626]: sweepWithdrawERC4626ArgumentsAbi,
599
+ [_otim_utils_schemas.InstructionAction.SweepDepositAccount]: sweepDepositAccountArgumentsAbi,
600
+ [_otim_utils_schemas.InstructionAction.SweepDepositAccountERC20]: sweepDepositAccountERC20ArgumentsAbi
704
601
  };
705
602
 
706
- // src/instructions/contracts/schemas/eip-712/actions/deactivate-instruction.json
707
- var deactivate_instruction_default = {
708
- types: {
709
- Instruction: [
710
- { name: "salt", type: "uint256" },
711
- { name: "maxExecutions", type: "uint256" },
712
- { name: "action", type: "address" },
713
- { name: "deactivateInstruction", type: "DeactivateInstruction" }
714
- ],
715
- DeactivateInstruction: [
716
- { name: "instructionId", type: "bytes32" },
717
- { name: "fee", type: "Fee" }
718
- ],
719
- Fee: [
720
- { name: "token", type: "address" },
721
- { name: "maxBaseFeePerGas", type: "uint256" },
722
- { name: "maxPriorityFeePerGas", type: "uint256" },
723
- { name: "executionFee", type: "uint256" }
724
- ]
725
- }
726
- };
603
+ //#endregion
604
+ //#region src/instructions/contracts/schemas/eip-712/actions/deactivate-instruction.json
605
+ var deactivate_instruction_default = { types: {
606
+ "Instruction": [
607
+ {
608
+ "name": "salt",
609
+ "type": "uint256"
610
+ },
611
+ {
612
+ "name": "maxExecutions",
613
+ "type": "uint256"
614
+ },
615
+ {
616
+ "name": "action",
617
+ "type": "address"
618
+ },
619
+ {
620
+ "name": "deactivateInstruction",
621
+ "type": "DeactivateInstruction"
622
+ }
623
+ ],
624
+ "DeactivateInstruction": [{
625
+ "name": "instructionId",
626
+ "type": "bytes32"
627
+ }, {
628
+ "name": "fee",
629
+ "type": "Fee"
630
+ }],
631
+ "Fee": [
632
+ {
633
+ "name": "token",
634
+ "type": "address"
635
+ },
636
+ {
637
+ "name": "maxBaseFeePerGas",
638
+ "type": "uint256"
639
+ },
640
+ {
641
+ "name": "maxPriorityFeePerGas",
642
+ "type": "uint256"
643
+ },
644
+ {
645
+ "name": "executionFee",
646
+ "type": "uint256"
647
+ }
648
+ ]
649
+ } };
727
650
 
728
- // src/instructions/contracts/schemas/eip-712/actions/refuel-erc20.json
729
- var refuel_erc20_default = {
730
- types: {
731
- Instruction: [
732
- { name: "salt", type: "uint256" },
733
- { name: "maxExecutions", type: "uint256" },
734
- { name: "action", type: "address" },
735
- { name: "refuelERC20", type: "RefuelERC20" }
736
- ],
737
- RefuelERC20: [
738
- { name: "token", type: "address" },
739
- { name: "target", type: "address" },
740
- { name: "threshold", type: "uint256" },
741
- { name: "endBalance", type: "uint256" },
742
- { name: "fee", type: "Fee" }
743
- ],
744
- Fee: [
745
- { name: "token", type: "address" },
746
- { name: "maxBaseFeePerGas", type: "uint256" },
747
- { name: "maxPriorityFeePerGas", type: "uint256" },
748
- { name: "executionFee", type: "uint256" }
749
- ]
750
- }
751
- };
651
+ //#endregion
652
+ //#region src/instructions/contracts/schemas/eip-712/actions/deposit-erc4626.json
653
+ var deposit_erc4626_default = { types: {
654
+ "Instruction": [
655
+ {
656
+ "name": "salt",
657
+ "type": "uint256"
658
+ },
659
+ {
660
+ "name": "maxExecutions",
661
+ "type": "uint256"
662
+ },
663
+ {
664
+ "name": "action",
665
+ "type": "address"
666
+ },
667
+ {
668
+ "name": "depositERC4626",
669
+ "type": "DepositERC4626"
670
+ }
671
+ ],
672
+ "DepositERC4626": [
673
+ {
674
+ "name": "vault",
675
+ "type": "address"
676
+ },
677
+ {
678
+ "name": "recipient",
679
+ "type": "address"
680
+ },
681
+ {
682
+ "name": "value",
683
+ "type": "uint256"
684
+ },
685
+ {
686
+ "name": "minDeposit",
687
+ "type": "uint256"
688
+ },
689
+ {
690
+ "name": "minTotalShares",
691
+ "type": "uint256"
692
+ },
693
+ {
694
+ "name": "schedule",
695
+ "type": "Schedule"
696
+ },
697
+ {
698
+ "name": "fee",
699
+ "type": "Fee"
700
+ }
701
+ ],
702
+ "Schedule": [
703
+ {
704
+ "name": "startAt",
705
+ "type": "uint256"
706
+ },
707
+ {
708
+ "name": "startBy",
709
+ "type": "uint256"
710
+ },
711
+ {
712
+ "name": "interval",
713
+ "type": "uint256"
714
+ },
715
+ {
716
+ "name": "timeout",
717
+ "type": "uint256"
718
+ }
719
+ ],
720
+ "Fee": [
721
+ {
722
+ "name": "token",
723
+ "type": "address"
724
+ },
725
+ {
726
+ "name": "maxBaseFeePerGas",
727
+ "type": "uint256"
728
+ },
729
+ {
730
+ "name": "maxPriorityFeePerGas",
731
+ "type": "uint256"
732
+ },
733
+ {
734
+ "name": "executionFee",
735
+ "type": "uint256"
736
+ }
737
+ ]
738
+ } };
752
739
 
753
- // src/instructions/contracts/schemas/eip-712/actions/refuel.json
754
- var refuel_default = {
755
- types: {
756
- Instruction: [
757
- { name: "salt", type: "uint256" },
758
- { name: "maxExecutions", type: "uint256" },
759
- { name: "action", type: "address" },
760
- { name: "refuel", type: "Refuel" }
761
- ],
762
- Refuel: [
763
- { name: "target", type: "address" },
764
- { name: "threshold", type: "uint256" },
765
- { name: "endBalance", type: "uint256" },
766
- { name: "gasLimit", type: "uint256" },
767
- { name: "fee", type: "Fee" }
768
- ],
769
- Fee: [
770
- { name: "token", type: "address" },
771
- { name: "maxBaseFeePerGas", type: "uint256" },
772
- { name: "maxPriorityFeePerGas", type: "uint256" },
773
- { name: "executionFee", type: "uint256" }
774
- ]
775
- }
776
- };
740
+ //#endregion
741
+ //#region src/instructions/contracts/schemas/eip-712/actions/refuel-erc20.json
742
+ var refuel_erc20_default = { types: {
743
+ "Instruction": [
744
+ {
745
+ "name": "salt",
746
+ "type": "uint256"
747
+ },
748
+ {
749
+ "name": "maxExecutions",
750
+ "type": "uint256"
751
+ },
752
+ {
753
+ "name": "action",
754
+ "type": "address"
755
+ },
756
+ {
757
+ "name": "refuelERC20",
758
+ "type": "RefuelERC20"
759
+ }
760
+ ],
761
+ "RefuelERC20": [
762
+ {
763
+ "name": "token",
764
+ "type": "address"
765
+ },
766
+ {
767
+ "name": "target",
768
+ "type": "address"
769
+ },
770
+ {
771
+ "name": "threshold",
772
+ "type": "uint256"
773
+ },
774
+ {
775
+ "name": "endBalance",
776
+ "type": "uint256"
777
+ },
778
+ {
779
+ "name": "fee",
780
+ "type": "Fee"
781
+ }
782
+ ],
783
+ "Fee": [
784
+ {
785
+ "name": "token",
786
+ "type": "address"
787
+ },
788
+ {
789
+ "name": "maxBaseFeePerGas",
790
+ "type": "uint256"
791
+ },
792
+ {
793
+ "name": "maxPriorityFeePerGas",
794
+ "type": "uint256"
795
+ },
796
+ {
797
+ "name": "executionFee",
798
+ "type": "uint256"
799
+ }
800
+ ]
801
+ } };
777
802
 
778
- // src/instructions/contracts/schemas/eip-712/actions/sweep-cctp.json
779
- var sweep_cctp_default = {
780
- types: {
781
- Instruction: [
782
- { name: "salt", type: "uint256" },
783
- { name: "maxExecutions", type: "uint256" },
784
- { name: "action", type: "address" },
785
- { name: "sweepCCTP", type: "SweepCCTP" }
786
- ],
787
- SweepCCTP: [
788
- { name: "token", type: "address" },
789
- { name: "destinationDomain", type: "uint32" },
790
- { name: "destinationMintRecipient", type: "bytes32" },
791
- { name: "threshold", type: "uint256" },
792
- { name: "endBalance", type: "uint256" },
793
- { name: "fee", type: "Fee" }
794
- ],
795
- Fee: [
796
- { name: "token", type: "address" },
797
- { name: "maxBaseFeePerGas", type: "uint256" },
798
- { name: "maxPriorityFeePerGas", type: "uint256" },
799
- { name: "executionFee", type: "uint256" }
800
- ]
801
- }
802
- };
803
+ //#endregion
804
+ //#region src/instructions/contracts/schemas/eip-712/actions/refuel.json
805
+ var refuel_default = { types: {
806
+ "Instruction": [
807
+ {
808
+ "name": "salt",
809
+ "type": "uint256"
810
+ },
811
+ {
812
+ "name": "maxExecutions",
813
+ "type": "uint256"
814
+ },
815
+ {
816
+ "name": "action",
817
+ "type": "address"
818
+ },
819
+ {
820
+ "name": "refuel",
821
+ "type": "Refuel"
822
+ }
823
+ ],
824
+ "Refuel": [
825
+ {
826
+ "name": "target",
827
+ "type": "address"
828
+ },
829
+ {
830
+ "name": "threshold",
831
+ "type": "uint256"
832
+ },
833
+ {
834
+ "name": "endBalance",
835
+ "type": "uint256"
836
+ },
837
+ {
838
+ "name": "gasLimit",
839
+ "type": "uint256"
840
+ },
841
+ {
842
+ "name": "fee",
843
+ "type": "Fee"
844
+ }
845
+ ],
846
+ "Fee": [
847
+ {
848
+ "name": "token",
849
+ "type": "address"
850
+ },
851
+ {
852
+ "name": "maxBaseFeePerGas",
853
+ "type": "uint256"
854
+ },
855
+ {
856
+ "name": "maxPriorityFeePerGas",
857
+ "type": "uint256"
858
+ },
859
+ {
860
+ "name": "executionFee",
861
+ "type": "uint256"
862
+ }
863
+ ]
864
+ } };
803
865
 
804
- // src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account-erc20.json
805
- var sweep_deposit_account_erc20_default = {
806
- types: {
807
- Instruction: [
808
- { name: "salt", type: "uint256" },
809
- { name: "maxExecutions", type: "uint256" },
810
- { name: "action", type: "address" },
811
- { name: "sweepDepositAccountERC20", type: "SweepDepositAccountERC20" }
812
- ],
813
- SweepDepositAccountERC20: [
814
- { name: "token", type: "address" },
815
- { name: "depositor", type: "address" },
816
- { name: "recipient", type: "address" },
817
- { name: "threshold", type: "uint256" },
818
- { name: "fee", type: "Fee" }
819
- ],
820
- Fee: [
821
- { name: "token", type: "address" },
822
- { name: "maxBaseFeePerGas", type: "uint256" },
823
- { name: "maxPriorityFeePerGas", type: "uint256" },
824
- { name: "executionFee", type: "uint256" }
825
- ]
826
- }
827
- };
866
+ //#endregion
867
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-cctp.json
868
+ var sweep_cctp_default = { types: {
869
+ "Instruction": [
870
+ {
871
+ "name": "salt",
872
+ "type": "uint256"
873
+ },
874
+ {
875
+ "name": "maxExecutions",
876
+ "type": "uint256"
877
+ },
878
+ {
879
+ "name": "action",
880
+ "type": "address"
881
+ },
882
+ {
883
+ "name": "sweepCCTP",
884
+ "type": "SweepCCTP"
885
+ }
886
+ ],
887
+ "SweepCCTP": [
888
+ {
889
+ "name": "token",
890
+ "type": "address"
891
+ },
892
+ {
893
+ "name": "destinationDomain",
894
+ "type": "uint32"
895
+ },
896
+ {
897
+ "name": "destinationMintRecipient",
898
+ "type": "bytes32"
899
+ },
900
+ {
901
+ "name": "threshold",
902
+ "type": "uint256"
903
+ },
904
+ {
905
+ "name": "endBalance",
906
+ "type": "uint256"
907
+ },
908
+ {
909
+ "name": "fee",
910
+ "type": "Fee"
911
+ }
912
+ ],
913
+ "Fee": [
914
+ {
915
+ "name": "token",
916
+ "type": "address"
917
+ },
918
+ {
919
+ "name": "maxBaseFeePerGas",
920
+ "type": "uint256"
921
+ },
922
+ {
923
+ "name": "maxPriorityFeePerGas",
924
+ "type": "uint256"
925
+ },
926
+ {
927
+ "name": "executionFee",
928
+ "type": "uint256"
929
+ }
930
+ ]
931
+ } };
828
932
 
829
- // src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account.json
830
- var sweep_deposit_account_default = {
831
- types: {
832
- Instruction: [
833
- { name: "salt", type: "uint256" },
834
- { name: "maxExecutions", type: "uint256" },
835
- { name: "action", type: "address" },
836
- { name: "sweepDepositAccount", type: "SweepDepositAccount" }
837
- ],
838
- SweepDepositAccount: [
839
- { name: "depositor", type: "address" },
840
- { name: "recipient", type: "address" },
841
- { name: "threshold", type: "uint256" },
842
- { name: "fee", type: "Fee" }
843
- ],
844
- Fee: [
845
- { name: "token", type: "address" },
846
- { name: "maxBaseFeePerGas", type: "uint256" },
847
- { name: "maxPriorityFeePerGas", type: "uint256" },
848
- { name: "executionFee", type: "uint256" }
849
- ]
850
- }
851
- };
933
+ //#endregion
934
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account-erc20.json
935
+ var sweep_deposit_account_erc20_default = { types: {
936
+ "Instruction": [
937
+ {
938
+ "name": "salt",
939
+ "type": "uint256"
940
+ },
941
+ {
942
+ "name": "maxExecutions",
943
+ "type": "uint256"
944
+ },
945
+ {
946
+ "name": "action",
947
+ "type": "address"
948
+ },
949
+ {
950
+ "name": "sweepDepositAccountERC20",
951
+ "type": "SweepDepositAccountERC20"
952
+ }
953
+ ],
954
+ "SweepDepositAccountERC20": [
955
+ {
956
+ "name": "token",
957
+ "type": "address"
958
+ },
959
+ {
960
+ "name": "depositor",
961
+ "type": "address"
962
+ },
963
+ {
964
+ "name": "recipient",
965
+ "type": "address"
966
+ },
967
+ {
968
+ "name": "threshold",
969
+ "type": "uint256"
970
+ },
971
+ {
972
+ "name": "fee",
973
+ "type": "Fee"
974
+ }
975
+ ],
976
+ "Fee": [
977
+ {
978
+ "name": "token",
979
+ "type": "address"
980
+ },
981
+ {
982
+ "name": "maxBaseFeePerGas",
983
+ "type": "uint256"
984
+ },
985
+ {
986
+ "name": "maxPriorityFeePerGas",
987
+ "type": "uint256"
988
+ },
989
+ {
990
+ "name": "executionFee",
991
+ "type": "uint256"
992
+ }
993
+ ]
994
+ } };
852
995
 
853
- // src/instructions/contracts/schemas/eip-712/actions/sweep-erc20.json
854
- var sweep_erc20_default = {
855
- types: {
856
- Instruction: [
857
- { name: "salt", type: "uint256" },
858
- { name: "maxExecutions", type: "uint256" },
859
- { name: "action", type: "address" },
860
- { name: "sweepERC20", type: "SweepERC20" }
861
- ],
862
- SweepERC20: [
863
- { name: "token", type: "address" },
864
- { name: "target", type: "address" },
865
- { name: "threshold", type: "uint256" },
866
- { name: "endBalance", type: "uint256" },
867
- { name: "fee", type: "Fee" }
868
- ],
869
- Fee: [
870
- { name: "token", type: "address" },
871
- { name: "maxBaseFeePerGas", type: "uint256" },
872
- { name: "maxPriorityFeePerGas", type: "uint256" },
873
- { name: "executionFee", type: "uint256" }
874
- ]
875
- }
876
- };
996
+ //#endregion
997
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-account.json
998
+ var sweep_deposit_account_default = { types: {
999
+ "Instruction": [
1000
+ {
1001
+ "name": "salt",
1002
+ "type": "uint256"
1003
+ },
1004
+ {
1005
+ "name": "maxExecutions",
1006
+ "type": "uint256"
1007
+ },
1008
+ {
1009
+ "name": "action",
1010
+ "type": "address"
1011
+ },
1012
+ {
1013
+ "name": "sweepDepositAccount",
1014
+ "type": "SweepDepositAccount"
1015
+ }
1016
+ ],
1017
+ "SweepDepositAccount": [
1018
+ {
1019
+ "name": "depositor",
1020
+ "type": "address"
1021
+ },
1022
+ {
1023
+ "name": "recipient",
1024
+ "type": "address"
1025
+ },
1026
+ {
1027
+ "name": "threshold",
1028
+ "type": "uint256"
1029
+ },
1030
+ {
1031
+ "name": "fee",
1032
+ "type": "Fee"
1033
+ }
1034
+ ],
1035
+ "Fee": [
1036
+ {
1037
+ "name": "token",
1038
+ "type": "address"
1039
+ },
1040
+ {
1041
+ "name": "maxBaseFeePerGas",
1042
+ "type": "uint256"
1043
+ },
1044
+ {
1045
+ "name": "maxPriorityFeePerGas",
1046
+ "type": "uint256"
1047
+ },
1048
+ {
1049
+ "name": "executionFee",
1050
+ "type": "uint256"
1051
+ }
1052
+ ]
1053
+ } };
877
1054
 
878
- // src/instructions/contracts/schemas/eip-712/actions/sweep-skip-cctp-deposit-account.json
879
- var sweep_skip_cctp_deposit_account_default = {
880
- types: {
881
- Instruction: [
882
- { name: "salt", type: "uint256" },
883
- { name: "maxExecutions", type: "uint256" },
884
- { name: "action", type: "address" },
885
- {
886
- name: "sweepSkipCCTPDepositAccount",
887
- type: "SweepSkipCCTPDepositAccount"
888
- }
889
- ],
890
- SweepSkipCCTPDepositAccount: [
891
- { name: "depositor", type: "address" },
892
- { name: "destinationDomain", type: "uint32" },
893
- { name: "destinationMintRecipient", type: "bytes32" },
894
- { name: "threshold", type: "uint256" },
895
- { name: "fee", type: "Fee" }
896
- ],
897
- Fee: [
898
- { name: "token", type: "address" },
899
- { name: "maxBaseFeePerGas", type: "uint256" },
900
- { name: "maxPriorityFeePerGas", type: "uint256" },
901
- { name: "executionFee", type: "uint256" }
902
- ]
903
- }
904
- };
1055
+ //#endregion
1056
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-deposit-erc4626.json
1057
+ var sweep_deposit_erc4626_default = { types: {
1058
+ "Instruction": [
1059
+ {
1060
+ "name": "salt",
1061
+ "type": "uint256"
1062
+ },
1063
+ {
1064
+ "name": "maxExecutions",
1065
+ "type": "uint256"
1066
+ },
1067
+ {
1068
+ "name": "action",
1069
+ "type": "address"
1070
+ },
1071
+ {
1072
+ "name": "sweepDepositERC4626",
1073
+ "type": "SweepDepositERC4626"
1074
+ }
1075
+ ],
1076
+ "SweepDepositERC4626": [
1077
+ {
1078
+ "name": "vault",
1079
+ "type": "address"
1080
+ },
1081
+ {
1082
+ "name": "recipient",
1083
+ "type": "address"
1084
+ },
1085
+ {
1086
+ "name": "threshold",
1087
+ "type": "uint256"
1088
+ },
1089
+ {
1090
+ "name": "endBalance",
1091
+ "type": "uint256"
1092
+ },
1093
+ {
1094
+ "name": "minDeposit",
1095
+ "type": "uint256"
1096
+ },
1097
+ {
1098
+ "name": "minTotalShares",
1099
+ "type": "uint256"
1100
+ },
1101
+ {
1102
+ "name": "fee",
1103
+ "type": "Fee"
1104
+ }
1105
+ ],
1106
+ "Fee": [
1107
+ {
1108
+ "name": "token",
1109
+ "type": "address"
1110
+ },
1111
+ {
1112
+ "name": "maxBaseFeePerGas",
1113
+ "type": "uint256"
1114
+ },
1115
+ {
1116
+ "name": "maxPriorityFeePerGas",
1117
+ "type": "uint256"
1118
+ },
1119
+ {
1120
+ "name": "executionFee",
1121
+ "type": "uint256"
1122
+ }
1123
+ ]
1124
+ } };
905
1125
 
906
- // src/instructions/contracts/schemas/eip-712/actions/sweep-uniswap-v3.json
907
- var sweep_uniswap_v3_default = {
908
- types: {
909
- Instruction: [
910
- { name: "salt", type: "uint256" },
911
- { name: "maxExecutions", type: "uint256" },
912
- { name: "action", type: "address" },
913
- { name: "sweepUniswapV3", type: "SweepUniswapV3" }
914
- ],
915
- SweepUniswapV3: [
916
- { name: "recipient", type: "address" },
917
- { name: "tokenIn", type: "address" },
918
- { name: "tokenOut", type: "address" },
919
- { name: "feeTier", type: "uint24" },
920
- { name: "threshold", type: "uint256" },
921
- { name: "endBalance", type: "uint256" },
922
- { name: "floorAmountOut", type: "uint256" },
923
- { name: "meanPriceLookBack", type: "uint32" },
924
- { name: "maxPriceDeviationBPS", type: "uint32" },
925
- { name: "fee", type: "Fee" }
926
- ],
927
- Fee: [
928
- { name: "token", type: "address" },
929
- { name: "maxBaseFeePerGas", type: "uint256" },
930
- { name: "maxPriorityFeePerGas", type: "uint256" },
931
- { name: "executionFee", type: "uint256" }
932
- ]
933
- }
934
- };
1126
+ //#endregion
1127
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-erc20.json
1128
+ var sweep_erc20_default = { types: {
1129
+ "Instruction": [
1130
+ {
1131
+ "name": "salt",
1132
+ "type": "uint256"
1133
+ },
1134
+ {
1135
+ "name": "maxExecutions",
1136
+ "type": "uint256"
1137
+ },
1138
+ {
1139
+ "name": "action",
1140
+ "type": "address"
1141
+ },
1142
+ {
1143
+ "name": "sweepERC20",
1144
+ "type": "SweepERC20"
1145
+ }
1146
+ ],
1147
+ "SweepERC20": [
1148
+ {
1149
+ "name": "token",
1150
+ "type": "address"
1151
+ },
1152
+ {
1153
+ "name": "target",
1154
+ "type": "address"
1155
+ },
1156
+ {
1157
+ "name": "threshold",
1158
+ "type": "uint256"
1159
+ },
1160
+ {
1161
+ "name": "endBalance",
1162
+ "type": "uint256"
1163
+ },
1164
+ {
1165
+ "name": "fee",
1166
+ "type": "Fee"
1167
+ }
1168
+ ],
1169
+ "Fee": [
1170
+ {
1171
+ "name": "token",
1172
+ "type": "address"
1173
+ },
1174
+ {
1175
+ "name": "maxBaseFeePerGas",
1176
+ "type": "uint256"
1177
+ },
1178
+ {
1179
+ "name": "maxPriorityFeePerGas",
1180
+ "type": "uint256"
1181
+ },
1182
+ {
1183
+ "name": "executionFee",
1184
+ "type": "uint256"
1185
+ }
1186
+ ]
1187
+ } };
935
1188
 
936
- // src/instructions/contracts/schemas/eip-712/actions/sweep.json
937
- var sweep_default = {
938
- types: {
939
- Instruction: [
940
- { name: "salt", type: "uint256" },
941
- { name: "maxExecutions", type: "uint256" },
942
- { name: "action", type: "address" },
943
- { name: "sweep", type: "Sweep" }
944
- ],
945
- Sweep: [
946
- { name: "target", type: "address" },
947
- { name: "threshold", type: "uint256" },
948
- { name: "endBalance", type: "uint256" },
949
- { name: "gasLimit", type: "uint256" },
950
- { name: "fee", type: "Fee" }
951
- ],
952
- Fee: [
953
- { name: "token", type: "address" },
954
- { name: "maxBaseFeePerGas", type: "uint256" },
955
- { name: "maxPriorityFeePerGas", type: "uint256" },
956
- { name: "executionFee", type: "uint256" }
957
- ]
958
- }
959
- };
1189
+ //#endregion
1190
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-skip-cctp-deposit-account.json
1191
+ var sweep_skip_cctp_deposit_account_default = { types: {
1192
+ "Instruction": [
1193
+ {
1194
+ "name": "salt",
1195
+ "type": "uint256"
1196
+ },
1197
+ {
1198
+ "name": "maxExecutions",
1199
+ "type": "uint256"
1200
+ },
1201
+ {
1202
+ "name": "action",
1203
+ "type": "address"
1204
+ },
1205
+ {
1206
+ "name": "sweepSkipCCTPDepositAccount",
1207
+ "type": "SweepSkipCCTPDepositAccount"
1208
+ }
1209
+ ],
1210
+ "SweepSkipCCTPDepositAccount": [
1211
+ {
1212
+ "name": "depositor",
1213
+ "type": "address"
1214
+ },
1215
+ {
1216
+ "name": "destinationDomain",
1217
+ "type": "uint32"
1218
+ },
1219
+ {
1220
+ "name": "destinationMintRecipient",
1221
+ "type": "bytes32"
1222
+ },
1223
+ {
1224
+ "name": "threshold",
1225
+ "type": "uint256"
1226
+ },
1227
+ {
1228
+ "name": "fee",
1229
+ "type": "Fee"
1230
+ }
1231
+ ],
1232
+ "Fee": [
1233
+ {
1234
+ "name": "token",
1235
+ "type": "address"
1236
+ },
1237
+ {
1238
+ "name": "maxBaseFeePerGas",
1239
+ "type": "uint256"
1240
+ },
1241
+ {
1242
+ "name": "maxPriorityFeePerGas",
1243
+ "type": "uint256"
1244
+ },
1245
+ {
1246
+ "name": "executionFee",
1247
+ "type": "uint256"
1248
+ }
1249
+ ]
1250
+ } };
960
1251
 
961
- // src/instructions/contracts/schemas/eip-712/actions/transfer-erc20.json
962
- var transfer_erc20_default = {
963
- types: {
964
- Instruction: [
965
- { name: "salt", type: "uint256" },
966
- { name: "maxExecutions", type: "uint256" },
967
- { name: "action", type: "address" },
968
- { name: "transferERC20", type: "TransferERC20" }
969
- ],
970
- TransferERC20: [
971
- { name: "token", type: "address" },
972
- { name: "target", type: "address" },
973
- { name: "value", type: "uint256" },
974
- { name: "schedule", type: "Schedule" },
975
- { name: "fee", type: "Fee" }
976
- ],
977
- Schedule: [
978
- { name: "startAt", type: "uint256" },
979
- { name: "startBy", type: "uint256" },
980
- { name: "interval", type: "uint256" },
981
- { name: "timeout", type: "uint256" }
982
- ],
983
- Fee: [
984
- { name: "token", type: "address" },
985
- { name: "maxBaseFeePerGas", type: "uint256" },
986
- { name: "maxPriorityFeePerGas", type: "uint256" },
987
- { name: "executionFee", type: "uint256" }
988
- ]
989
- }
990
- };
1252
+ //#endregion
1253
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-uniswap-v3.json
1254
+ var sweep_uniswap_v3_default = { types: {
1255
+ "Instruction": [
1256
+ {
1257
+ "name": "salt",
1258
+ "type": "uint256"
1259
+ },
1260
+ {
1261
+ "name": "maxExecutions",
1262
+ "type": "uint256"
1263
+ },
1264
+ {
1265
+ "name": "action",
1266
+ "type": "address"
1267
+ },
1268
+ {
1269
+ "name": "sweepUniswapV3",
1270
+ "type": "SweepUniswapV3"
1271
+ }
1272
+ ],
1273
+ "SweepUniswapV3": [
1274
+ {
1275
+ "name": "recipient",
1276
+ "type": "address"
1277
+ },
1278
+ {
1279
+ "name": "tokenIn",
1280
+ "type": "address"
1281
+ },
1282
+ {
1283
+ "name": "tokenOut",
1284
+ "type": "address"
1285
+ },
1286
+ {
1287
+ "name": "feeTier",
1288
+ "type": "uint24"
1289
+ },
1290
+ {
1291
+ "name": "threshold",
1292
+ "type": "uint256"
1293
+ },
1294
+ {
1295
+ "name": "endBalance",
1296
+ "type": "uint256"
1297
+ },
1298
+ {
1299
+ "name": "floorAmountOut",
1300
+ "type": "uint256"
1301
+ },
1302
+ {
1303
+ "name": "meanPriceLookBack",
1304
+ "type": "uint32"
1305
+ },
1306
+ {
1307
+ "name": "maxPriceDeviationBPS",
1308
+ "type": "uint32"
1309
+ },
1310
+ {
1311
+ "name": "fee",
1312
+ "type": "Fee"
1313
+ }
1314
+ ],
1315
+ "Fee": [
1316
+ {
1317
+ "name": "token",
1318
+ "type": "address"
1319
+ },
1320
+ {
1321
+ "name": "maxBaseFeePerGas",
1322
+ "type": "uint256"
1323
+ },
1324
+ {
1325
+ "name": "maxPriorityFeePerGas",
1326
+ "type": "uint256"
1327
+ },
1328
+ {
1329
+ "name": "executionFee",
1330
+ "type": "uint256"
1331
+ }
1332
+ ]
1333
+ } };
991
1334
 
992
- // src/instructions/contracts/schemas/eip-712/actions/transfer.json
993
- var transfer_default = {
994
- types: {
995
- Instruction: [
996
- { name: "salt", type: "uint256" },
997
- { name: "maxExecutions", type: "uint256" },
998
- { name: "action", type: "address" },
999
- { name: "transfer", type: "Transfer" }
1000
- ],
1001
- Transfer: [
1002
- { name: "target", type: "address" },
1003
- { name: "value", type: "uint256" },
1004
- { name: "gasLimit", type: "uint256" },
1005
- { name: "schedule", type: "Schedule" },
1006
- { name: "fee", type: "Fee" }
1007
- ],
1008
- Schedule: [
1009
- { name: "startAt", type: "uint256" },
1010
- { name: "startBy", type: "uint256" },
1011
- { name: "interval", type: "uint256" },
1012
- { name: "timeout", type: "uint256" }
1013
- ],
1014
- Fee: [
1015
- { name: "token", type: "address" },
1016
- { name: "maxBaseFeePerGas", type: "uint256" },
1017
- { name: "maxPriorityFeePerGas", type: "uint256" },
1018
- { name: "executionFee", type: "uint256" }
1019
- ]
1020
- }
1021
- };
1335
+ //#endregion
1336
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep-withdraw-erc4626.json
1337
+ var sweep_withdraw_erc4626_default = { types: {
1338
+ "Instruction": [
1339
+ {
1340
+ "name": "salt",
1341
+ "type": "uint256"
1342
+ },
1343
+ {
1344
+ "name": "maxExecutions",
1345
+ "type": "uint256"
1346
+ },
1347
+ {
1348
+ "name": "action",
1349
+ "type": "address"
1350
+ },
1351
+ {
1352
+ "name": "sweepWithdrawERC4626",
1353
+ "type": "SweepWithdrawERC4626"
1354
+ }
1355
+ ],
1356
+ "SweepWithdrawERC4626": [
1357
+ {
1358
+ "name": "vault",
1359
+ "type": "address"
1360
+ },
1361
+ {
1362
+ "name": "recipient",
1363
+ "type": "address"
1364
+ },
1365
+ {
1366
+ "name": "threshold",
1367
+ "type": "uint256"
1368
+ },
1369
+ {
1370
+ "name": "endBalance",
1371
+ "type": "uint256"
1372
+ },
1373
+ {
1374
+ "name": "minWithdraw",
1375
+ "type": "uint256"
1376
+ },
1377
+ {
1378
+ "name": "fee",
1379
+ "type": "Fee"
1380
+ }
1381
+ ],
1382
+ "Fee": [
1383
+ {
1384
+ "name": "token",
1385
+ "type": "address"
1386
+ },
1387
+ {
1388
+ "name": "maxBaseFeePerGas",
1389
+ "type": "uint256"
1390
+ },
1391
+ {
1392
+ "name": "maxPriorityFeePerGas",
1393
+ "type": "uint256"
1394
+ },
1395
+ {
1396
+ "name": "executionFee",
1397
+ "type": "uint256"
1398
+ }
1399
+ ]
1400
+ } };
1022
1401
 
1023
- // src/instructions/contracts/schemas/eip-712/actions/uniswap-v3-exact-input.json
1024
- var uniswap_v3_exact_input_default = {
1025
- types: {
1026
- Instruction: [
1027
- { name: "salt", type: "uint256" },
1028
- { name: "maxExecutions", type: "uint256" },
1029
- { name: "action", type: "address" },
1030
- { name: "uniswapV3ExactInput", type: "UniswapV3ExactInput" }
1031
- ],
1032
- UniswapV3ExactInput: [
1033
- { name: "recipient", type: "address" },
1034
- { name: "tokenIn", type: "address" },
1035
- { name: "tokenOut", type: "address" },
1036
- { name: "feeTier", type: "uint24" },
1037
- { name: "amountIn", type: "uint256" },
1038
- { name: "floorAmountOut", type: "uint256" },
1039
- { name: "meanPriceLookBack", type: "uint32" },
1040
- { name: "maxPriceDeviationBPS", type: "uint32" },
1041
- { name: "schedule", type: "Schedule" },
1042
- { name: "fee", type: "Fee" }
1043
- ],
1044
- Schedule: [
1045
- { name: "startAt", type: "uint256" },
1046
- { name: "startBy", type: "uint256" },
1047
- { name: "interval", type: "uint256" },
1048
- { name: "timeout", type: "uint256" }
1049
- ],
1050
- Fee: [
1051
- { name: "token", type: "address" },
1052
- { name: "maxBaseFeePerGas", type: "uint256" },
1053
- { name: "maxPriorityFeePerGas", type: "uint256" },
1054
- { name: "executionFee", type: "uint256" }
1055
- ]
1056
- }
1057
- };
1402
+ //#endregion
1403
+ //#region src/instructions/contracts/schemas/eip-712/actions/sweep.json
1404
+ var sweep_default = { types: {
1405
+ "Instruction": [
1406
+ {
1407
+ "name": "salt",
1408
+ "type": "uint256"
1409
+ },
1410
+ {
1411
+ "name": "maxExecutions",
1412
+ "type": "uint256"
1413
+ },
1414
+ {
1415
+ "name": "action",
1416
+ "type": "address"
1417
+ },
1418
+ {
1419
+ "name": "sweep",
1420
+ "type": "Sweep"
1421
+ }
1422
+ ],
1423
+ "Sweep": [
1424
+ {
1425
+ "name": "target",
1426
+ "type": "address"
1427
+ },
1428
+ {
1429
+ "name": "threshold",
1430
+ "type": "uint256"
1431
+ },
1432
+ {
1433
+ "name": "endBalance",
1434
+ "type": "uint256"
1435
+ },
1436
+ {
1437
+ "name": "gasLimit",
1438
+ "type": "uint256"
1439
+ },
1440
+ {
1441
+ "name": "fee",
1442
+ "type": "Fee"
1443
+ }
1444
+ ],
1445
+ "Fee": [
1446
+ {
1447
+ "name": "token",
1448
+ "type": "address"
1449
+ },
1450
+ {
1451
+ "name": "maxBaseFeePerGas",
1452
+ "type": "uint256"
1453
+ },
1454
+ {
1455
+ "name": "maxPriorityFeePerGas",
1456
+ "type": "uint256"
1457
+ },
1458
+ {
1459
+ "name": "executionFee",
1460
+ "type": "uint256"
1461
+ }
1462
+ ]
1463
+ } };
1058
1464
 
1059
- // src/instructions/types.ts
1060
- var eip712TypesMap = {
1061
- refuel: refuel_default,
1062
- refuelERC20: refuel_erc20_default,
1063
- transfer: transfer_default,
1064
- transferERC20: transfer_erc20_default,
1065
- uniswapV3ExactInput: uniswap_v3_exact_input_default,
1066
- sweep: sweep_default,
1067
- sweepERC20: sweep_erc20_default,
1068
- sweepCCTP: sweep_cctp_default,
1069
- sweepUniswapV3: sweep_uniswap_v3_default,
1070
- sweepDepositAccount: sweep_deposit_account_default,
1071
- sweepDepositAccountERC20: sweep_deposit_account_erc20_default,
1072
- sweepSkipCCTPDepositAccount: sweep_skip_cctp_deposit_account_default,
1073
- deactivateInstruction: deactivate_instruction_default
1465
+ //#endregion
1466
+ //#region src/instructions/contracts/schemas/eip-712/actions/transfer-erc20.json
1467
+ var transfer_erc20_default = { types: {
1468
+ "Instruction": [
1469
+ {
1470
+ "name": "salt",
1471
+ "type": "uint256"
1472
+ },
1473
+ {
1474
+ "name": "maxExecutions",
1475
+ "type": "uint256"
1476
+ },
1477
+ {
1478
+ "name": "action",
1479
+ "type": "address"
1480
+ },
1481
+ {
1482
+ "name": "transferERC20",
1483
+ "type": "TransferERC20"
1484
+ }
1485
+ ],
1486
+ "TransferERC20": [
1487
+ {
1488
+ "name": "token",
1489
+ "type": "address"
1490
+ },
1491
+ {
1492
+ "name": "target",
1493
+ "type": "address"
1494
+ },
1495
+ {
1496
+ "name": "value",
1497
+ "type": "uint256"
1498
+ },
1499
+ {
1500
+ "name": "schedule",
1501
+ "type": "Schedule"
1502
+ },
1503
+ {
1504
+ "name": "fee",
1505
+ "type": "Fee"
1506
+ }
1507
+ ],
1508
+ "Schedule": [
1509
+ {
1510
+ "name": "startAt",
1511
+ "type": "uint256"
1512
+ },
1513
+ {
1514
+ "name": "startBy",
1515
+ "type": "uint256"
1516
+ },
1517
+ {
1518
+ "name": "interval",
1519
+ "type": "uint256"
1520
+ },
1521
+ {
1522
+ "name": "timeout",
1523
+ "type": "uint256"
1524
+ }
1525
+ ],
1526
+ "Fee": [
1527
+ {
1528
+ "name": "token",
1529
+ "type": "address"
1530
+ },
1531
+ {
1532
+ "name": "maxBaseFeePerGas",
1533
+ "type": "uint256"
1534
+ },
1535
+ {
1536
+ "name": "maxPriorityFeePerGas",
1537
+ "type": "uint256"
1538
+ },
1539
+ {
1540
+ "name": "executionFee",
1541
+ "type": "uint256"
1542
+ }
1543
+ ]
1544
+ } };
1545
+
1546
+ //#endregion
1547
+ //#region src/instructions/contracts/schemas/eip-712/actions/transfer.json
1548
+ var transfer_default = { types: {
1549
+ "Instruction": [
1550
+ {
1551
+ "name": "salt",
1552
+ "type": "uint256"
1553
+ },
1554
+ {
1555
+ "name": "maxExecutions",
1556
+ "type": "uint256"
1557
+ },
1558
+ {
1559
+ "name": "action",
1560
+ "type": "address"
1561
+ },
1562
+ {
1563
+ "name": "transfer",
1564
+ "type": "Transfer"
1565
+ }
1566
+ ],
1567
+ "Transfer": [
1568
+ {
1569
+ "name": "target",
1570
+ "type": "address"
1571
+ },
1572
+ {
1573
+ "name": "value",
1574
+ "type": "uint256"
1575
+ },
1576
+ {
1577
+ "name": "gasLimit",
1578
+ "type": "uint256"
1579
+ },
1580
+ {
1581
+ "name": "schedule",
1582
+ "type": "Schedule"
1583
+ },
1584
+ {
1585
+ "name": "fee",
1586
+ "type": "Fee"
1587
+ }
1588
+ ],
1589
+ "Schedule": [
1590
+ {
1591
+ "name": "startAt",
1592
+ "type": "uint256"
1593
+ },
1594
+ {
1595
+ "name": "startBy",
1596
+ "type": "uint256"
1597
+ },
1598
+ {
1599
+ "name": "interval",
1600
+ "type": "uint256"
1601
+ },
1602
+ {
1603
+ "name": "timeout",
1604
+ "type": "uint256"
1605
+ }
1606
+ ],
1607
+ "Fee": [
1608
+ {
1609
+ "name": "token",
1610
+ "type": "address"
1611
+ },
1612
+ {
1613
+ "name": "maxBaseFeePerGas",
1614
+ "type": "uint256"
1615
+ },
1616
+ {
1617
+ "name": "maxPriorityFeePerGas",
1618
+ "type": "uint256"
1619
+ },
1620
+ {
1621
+ "name": "executionFee",
1622
+ "type": "uint256"
1623
+ }
1624
+ ]
1625
+ } };
1626
+
1627
+ //#endregion
1628
+ //#region src/instructions/contracts/schemas/eip-712/actions/uniswap-v3-exact-input.json
1629
+ var uniswap_v3_exact_input_default = { types: {
1630
+ "Instruction": [
1631
+ {
1632
+ "name": "salt",
1633
+ "type": "uint256"
1634
+ },
1635
+ {
1636
+ "name": "maxExecutions",
1637
+ "type": "uint256"
1638
+ },
1639
+ {
1640
+ "name": "action",
1641
+ "type": "address"
1642
+ },
1643
+ {
1644
+ "name": "uniswapV3ExactInput",
1645
+ "type": "UniswapV3ExactInput"
1646
+ }
1647
+ ],
1648
+ "UniswapV3ExactInput": [
1649
+ {
1650
+ "name": "recipient",
1651
+ "type": "address"
1652
+ },
1653
+ {
1654
+ "name": "tokenIn",
1655
+ "type": "address"
1656
+ },
1657
+ {
1658
+ "name": "tokenOut",
1659
+ "type": "address"
1660
+ },
1661
+ {
1662
+ "name": "feeTier",
1663
+ "type": "uint24"
1664
+ },
1665
+ {
1666
+ "name": "amountIn",
1667
+ "type": "uint256"
1668
+ },
1669
+ {
1670
+ "name": "floorAmountOut",
1671
+ "type": "uint256"
1672
+ },
1673
+ {
1674
+ "name": "meanPriceLookBack",
1675
+ "type": "uint32"
1676
+ },
1677
+ {
1678
+ "name": "maxPriceDeviationBPS",
1679
+ "type": "uint32"
1680
+ },
1681
+ {
1682
+ "name": "schedule",
1683
+ "type": "Schedule"
1684
+ },
1685
+ {
1686
+ "name": "fee",
1687
+ "type": "Fee"
1688
+ }
1689
+ ],
1690
+ "Schedule": [
1691
+ {
1692
+ "name": "startAt",
1693
+ "type": "uint256"
1694
+ },
1695
+ {
1696
+ "name": "startBy",
1697
+ "type": "uint256"
1698
+ },
1699
+ {
1700
+ "name": "interval",
1701
+ "type": "uint256"
1702
+ },
1703
+ {
1704
+ "name": "timeout",
1705
+ "type": "uint256"
1706
+ }
1707
+ ],
1708
+ "Fee": [
1709
+ {
1710
+ "name": "token",
1711
+ "type": "address"
1712
+ },
1713
+ {
1714
+ "name": "maxBaseFeePerGas",
1715
+ "type": "uint256"
1716
+ },
1717
+ {
1718
+ "name": "maxPriorityFeePerGas",
1719
+ "type": "uint256"
1720
+ },
1721
+ {
1722
+ "name": "executionFee",
1723
+ "type": "uint256"
1724
+ }
1725
+ ]
1726
+ } };
1727
+
1728
+ //#endregion
1729
+ //#region src/instructions/contracts/schemas/eip-712/actions/withdraw-erc4626.json
1730
+ var withdraw_erc4626_default = { types: {
1731
+ "Instruction": [
1732
+ {
1733
+ "name": "salt",
1734
+ "type": "uint256"
1735
+ },
1736
+ {
1737
+ "name": "maxExecutions",
1738
+ "type": "uint256"
1739
+ },
1740
+ {
1741
+ "name": "action",
1742
+ "type": "address"
1743
+ },
1744
+ {
1745
+ "name": "withdrawERC4626",
1746
+ "type": "WithdrawERC4626"
1747
+ }
1748
+ ],
1749
+ "WithdrawERC4626": [
1750
+ {
1751
+ "name": "vault",
1752
+ "type": "address"
1753
+ },
1754
+ {
1755
+ "name": "recipient",
1756
+ "type": "address"
1757
+ },
1758
+ {
1759
+ "name": "value",
1760
+ "type": "uint256"
1761
+ },
1762
+ {
1763
+ "name": "minWithdraw",
1764
+ "type": "uint256"
1765
+ },
1766
+ {
1767
+ "name": "schedule",
1768
+ "type": "Schedule"
1769
+ },
1770
+ {
1771
+ "name": "fee",
1772
+ "type": "Fee"
1773
+ }
1774
+ ],
1775
+ "Schedule": [
1776
+ {
1777
+ "name": "startAt",
1778
+ "type": "uint256"
1779
+ },
1780
+ {
1781
+ "name": "startBy",
1782
+ "type": "uint256"
1783
+ },
1784
+ {
1785
+ "name": "interval",
1786
+ "type": "uint256"
1787
+ },
1788
+ {
1789
+ "name": "timeout",
1790
+ "type": "uint256"
1791
+ }
1792
+ ],
1793
+ "Fee": [
1794
+ {
1795
+ "name": "token",
1796
+ "type": "address"
1797
+ },
1798
+ {
1799
+ "name": "maxBaseFeePerGas",
1800
+ "type": "uint256"
1801
+ },
1802
+ {
1803
+ "name": "maxPriorityFeePerGas",
1804
+ "type": "uint256"
1805
+ },
1806
+ {
1807
+ "name": "executionFee",
1808
+ "type": "uint256"
1809
+ }
1810
+ ]
1811
+ } };
1812
+
1813
+ //#endregion
1814
+ //#region src/instructions/types.ts
1815
+ /**
1816
+ * Map of instruction actions to their EIP-712 type definitions.
1817
+ * Used for creating typed data structures for instruction signatures.
1818
+ */
1819
+ const eip712TypesMap = {
1820
+ [_otim_utils_schemas.InstructionAction.Refuel]: refuel_default,
1821
+ [_otim_utils_schemas.InstructionAction.RefuelERC20]: refuel_erc20_default,
1822
+ [_otim_utils_schemas.InstructionAction.Transfer]: transfer_default,
1823
+ [_otim_utils_schemas.InstructionAction.TransferERC20]: transfer_erc20_default,
1824
+ [_otim_utils_schemas.InstructionAction.UniswapV3ExactInput]: uniswap_v3_exact_input_default,
1825
+ [_otim_utils_schemas.InstructionAction.Sweep]: sweep_default,
1826
+ [_otim_utils_schemas.InstructionAction.SweepERC20]: sweep_erc20_default,
1827
+ [_otim_utils_schemas.InstructionAction.SweepCCTP]: sweep_cctp_default,
1828
+ [_otim_utils_schemas.InstructionAction.SweepUniswapV3]: sweep_uniswap_v3_default,
1829
+ [_otim_utils_schemas.InstructionAction.SweepSkipCCTPDepositAccount]: sweep_skip_cctp_deposit_account_default,
1830
+ [_otim_utils_schemas.InstructionAction.DeactivateInstruction]: deactivate_instruction_default,
1831
+ [_otim_utils_schemas.InstructionAction.DepositERC4626]: deposit_erc4626_default,
1832
+ [_otim_utils_schemas.InstructionAction.SweepDepositERC4626]: sweep_deposit_erc4626_default,
1833
+ [_otim_utils_schemas.InstructionAction.WithdrawERC4626]: withdraw_erc4626_default,
1834
+ [_otim_utils_schemas.InstructionAction.SweepWithdrawERC4626]: sweep_withdraw_erc4626_default,
1835
+ [_otim_utils_schemas.InstructionAction.SweepDepositAccount]: sweep_deposit_account_default,
1836
+ [_otim_utils_schemas.InstructionAction.SweepDepositAccountERC20]: sweep_deposit_account_erc20_default
1074
1837
  };
1075
1838
 
1076
- // src/instructions/activate.ts
1839
+ //#endregion
1840
+ //#region src/instructions/activate.ts
1841
+ /**
1842
+ * Converts a PascalCase string to camelCase.
1843
+ * Example: "TransferERC20" -> "transferERC20"
1844
+ */
1845
+ function toCamelCase(str) {
1846
+ return str.charAt(0).toLowerCase() + str.slice(1);
1847
+ }
1848
+ /**
1849
+ * Converts a camelCase string to PascalCase.
1850
+ * Example: "transferERC20" -> "TransferERC20"
1851
+ */
1852
+ function toPascalCase(str) {
1853
+ return str.charAt(0).toUpperCase() + str.slice(1);
1854
+ }
1855
+ /**
1856
+ * Creates the EIP-712 domain for instruction signatures.
1857
+ * Defines the domain separator used in typed data signing.
1858
+ *
1859
+ * @param config - Configuration containing delegate address and chain ID
1860
+ * @returns TypedDataDomain object for EIP-712 signing
1861
+ */
1077
1862
  function createInstructionDomain(config) {
1078
- return {
1079
- chainId: config.chainId,
1080
- name: "OtimDelegate",
1081
- salt: (0, import_viem3.keccak256)((0, import_viem3.toHex)("ON_TIME_INSTRUCTED_MONEY")),
1082
- verifyingContract: config.delegateAddress,
1083
- version: "1"
1084
- };
1863
+ return {
1864
+ chainId: config.chainId,
1865
+ name: "OtimDelegate",
1866
+ salt: (0, viem.keccak256)((0, viem.toHex)("ON_TIME_INSTRUCTED_MONEY")),
1867
+ verifyingContract: config.delegateAddress,
1868
+ version: "1"
1869
+ };
1085
1870
  }
1871
+ /**
1872
+ * Decodes hex-encoded instruction parameters for EIP-712 signatures.
1873
+ * Uses action-specific ABI definitions to properly decode arguments.
1874
+ *
1875
+ * @param salt - Hex-encoded salt value for instruction uniqueness
1876
+ * @param maxExecutions - Hex-encoded maximum execution count
1877
+ * @param argumentsHex - Hex-encoded action-specific arguments
1878
+ * @param actionName - Name of the instruction action (camelCase)
1879
+ * @returns Decoded parameters as TypeScript primitives
1880
+ * @throws Error if action has no EIP-712 types or ABI definition
1881
+ */
1086
1882
  function decodeInstructionParameters(salt, maxExecutions, argumentsHex, actionName) {
1087
- const eip712Types = eip712TypesMap[actionName];
1088
- const argumentsAbi = buildInstructionActionArgumentsAbiMap[actionName];
1089
- if (!eip712Types) {
1090
- throw new Error(`No EIP-712 types found for action: ${actionName}`);
1091
- }
1092
- if (!argumentsAbi) {
1093
- throw new Error(`No arguments ABI found for action: ${actionName}`);
1094
- }
1095
- const [decodedSalt] = (0, import_viem3.decodeAbiParameters)(
1096
- [eip712Types.types.Instruction[0]],
1097
- (0, import_viem3.pad)(salt)
1098
- );
1099
- const [decodedMaxExecutions] = (0, import_viem3.decodeAbiParameters)(
1100
- [eip712Types.types.Instruction[1]],
1101
- (0, import_viem3.pad)(maxExecutions)
1102
- );
1103
- const decodedArgsArray = (0, import_viem3.decodeAbiParameters)(argumentsAbi, argumentsHex);
1104
- const decodedArguments = {};
1105
- argumentsAbi.forEach((param, index) => {
1106
- decodedArguments[param.name] = decodedArgsArray[index];
1107
- });
1108
- return {
1109
- decodedSalt,
1110
- decodedMaxExecutions,
1111
- decodedArguments
1112
- };
1883
+ const pascalCaseActionName = toPascalCase(actionName);
1884
+ const eip712Types = eip712TypesMap[pascalCaseActionName];
1885
+ const argumentsAbi = buildInstructionActionArgumentsAbiMap[pascalCaseActionName];
1886
+ if (!eip712Types) throw new Error(`No EIP-712 types found for action: ${actionName}`);
1887
+ if (!argumentsAbi) throw new Error(`No arguments ABI found for action: ${actionName}`);
1888
+ const [decodedSalt] = (0, viem.decodeAbiParameters)([eip712Types.types.Instruction[0]], (0, viem.pad)(salt));
1889
+ const [decodedMaxExecutions] = (0, viem.decodeAbiParameters)([eip712Types.types.Instruction[1]], (0, viem.pad)(maxExecutions));
1890
+ const decodedArgsArray = (0, viem.decodeAbiParameters)(argumentsAbi, argumentsHex);
1891
+ const decodedArguments = {};
1892
+ argumentsAbi.forEach((param, index) => {
1893
+ decodedArguments[param.name] = decodedArgsArray[index];
1894
+ });
1895
+ return {
1896
+ decodedSalt,
1897
+ decodedMaxExecutions,
1898
+ decodedArguments
1899
+ };
1113
1900
  }
1901
+ /**
1902
+ * Creates EIP-712 typed data for instruction activation.
1903
+ * Automatically handles ABI decoding based on action type.
1904
+ *
1905
+ * @param payload - Instruction activation payload (without signature)
1906
+ * @param config - Signature configuration for domain creation
1907
+ * @returns Complete EIP-712 typed data structure ready for signing
1908
+ * @throws Error if action has no EIP-712 type definitions
1909
+ */
1114
1910
  function createInstructionTypedData(payload, config) {
1115
- const { decodedSalt, decodedMaxExecutions, decodedArguments } = decodeInstructionParameters(
1116
- payload.salt,
1117
- payload.maxExecutions,
1118
- payload.arguments,
1119
- payload.actionName
1120
- );
1121
- const eip712Types = eip712TypesMap[payload.actionName];
1122
- if (!eip712Types) {
1123
- throw new Error(`No EIP-712 types found for action: ${payload.actionName}`);
1124
- }
1125
- const domain = createInstructionDomain(config);
1126
- return {
1127
- domain,
1128
- primaryType: "Instruction",
1129
- types: eip712Types.types,
1130
- message: {
1131
- [payload.actionName]: decodedArguments,
1132
- salt: decodedSalt,
1133
- maxExecutions: decodedMaxExecutions,
1134
- action: payload.action
1135
- }
1136
- };
1911
+ const { decodedSalt, decodedMaxExecutions, decodedArguments } = decodeInstructionParameters(payload.salt, payload.maxExecutions, payload.arguments, payload.actionName);
1912
+ const eip712Types = eip712TypesMap[toPascalCase(payload.actionName)];
1913
+ if (!eip712Types) throw new Error(`No EIP-712 types found for action: ${payload.actionName}`);
1914
+ return {
1915
+ domain: createInstructionDomain(config),
1916
+ primaryType: "Instruction",
1917
+ types: eip712Types.types,
1918
+ message: {
1919
+ [payload.actionName]: decodedArguments,
1920
+ salt: decodedSalt,
1921
+ maxExecutions: decodedMaxExecutions,
1922
+ action: payload.action
1923
+ }
1924
+ };
1137
1925
  }
1926
+ /**
1927
+ * Creates an activation payload with EIP-2098 signature format.
1928
+ * Converts a standard signature to the compact EIP-2098 format used by the protocol.
1929
+ *
1930
+ * @param payload - The instruction activation payload including signature
1931
+ * @returns Formatted activation request ready for API submission
1932
+ */
1138
1933
  function createActivationPayload(payload) {
1139
- const vrs = parseSignatureToVRS(payload.signature);
1140
- const primitiveSignature = createEIP2098Signature(vrs);
1141
- return {
1142
- nickname: payload.nickname,
1143
- address: payload.address,
1144
- chainId: payload.chainId,
1145
- salt: payload.salt,
1146
- maxExecutions: payload.maxExecutions,
1147
- action: payload.action,
1148
- arguments: payload.arguments,
1149
- activationSignature: primitiveSignature
1150
- };
1934
+ const primitiveSignature = (0, _otim_utils_helpers.createEIP2098Signature)((0, _otim_utils_helpers.parseSignatureToVRS)(payload.signature));
1935
+ return {
1936
+ nickname: payload.nickname,
1937
+ address: payload.address,
1938
+ chainId: payload.chainId,
1939
+ salt: payload.salt,
1940
+ maxExecutions: payload.maxExecutions,
1941
+ action: payload.action,
1942
+ arguments: payload.arguments,
1943
+ activationSignature: primitiveSignature
1944
+ };
1151
1945
  }
1152
- //# sourceMappingURL=index.js.map
1946
+
1947
+ //#endregion
1948
+ exports.DEFAULT_INTERVAL_SECONDS = DEFAULT_INTERVAL_SECONDS;
1949
+ exports.INSTRUCTION_DEFAULT_TIMEOUT = INSTRUCTION_DEFAULT_TIMEOUT;
1950
+ exports.convertGweiToWei = convertGweiToWei;
1951
+ exports.createActivationPayload = createActivationPayload;
1952
+ exports.createBuildPayload = createBuildPayload;
1953
+ exports.createDepositERC4626BuildPayload = createDepositERC4626BuildPayload;
1954
+ exports.createInstructionDomain = createInstructionDomain;
1955
+ exports.createInstructionTypedData = createInstructionTypedData;
1956
+ exports.createRefuelBuildPayload = createRefuelBuildPayload;
1957
+ exports.createScheduleInterval = createScheduleInterval;
1958
+ exports.createScheduleIntervalLatencyLimit = createScheduleIntervalLatencyLimit;
1959
+ exports.createScheduleRepeat = createScheduleRepeat;
1960
+ exports.createScheduleStart = createScheduleStart;
1961
+ exports.createSweepDepositERC4626BuildPayload = createSweepDepositERC4626BuildPayload;
1962
+ exports.createSweepWithdrawERC4626BuildPayload = createSweepWithdrawERC4626BuildPayload;
1963
+ exports.createTransferBuildPayload = createTransferBuildPayload;
1964
+ exports.createUniswapV3ExactInputBuildPayload = createUniswapV3ExactInputBuildPayload;
1965
+ exports.createWithdrawERC4626BuildPayload = createWithdrawERC4626BuildPayload;
1966
+ exports.decodeInstructionParameters = decodeInstructionParameters;
1967
+ exports.eip712TypesMap = eip712TypesMap;
1968
+ exports.resolveFee = resolveFee;
1969
+ exports.resolveGasLimitIfNeeded = resolveGasLimitIfNeeded;
1970
+ exports.resolveRecipientForUniswapV3ExactInputIfNeeded = resolveRecipientForUniswapV3ExactInputIfNeeded;
1971
+ exports.resolveSchedule = resolveSchedule;
1972
+ exports.toCamelCase = toCamelCase;
1973
+ //# sourceMappingURL=index.js.map