@otim/utils 0.0.4 → 0.0.6

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