@oakagentkit/core 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (678) hide show
  1. package/build/dist/api/abort-scope.d.ts +2 -0
  2. package/build/dist/api/abort-scope.js +1 -0
  3. package/build/dist/api/chain.js +1 -1
  4. package/build/dist/api/history.js +1 -1
  5. package/build/dist/api/http.js +1 -1
  6. package/build/dist/api/metadata.js +1 -1
  7. package/build/dist/api/modules/beefy/boosts.js +1 -1
  8. package/build/dist/api/modules/beefy/clm.js +1 -1
  9. package/build/dist/api/modules/beefy/guard.js +1 -1
  10. package/build/dist/api/modules/beefy/index.js +1 -1
  11. package/build/dist/api/modules/beefy/liquidity.js +1 -1
  12. package/build/dist/api/modules/beefy/management.js +1 -1
  13. package/build/dist/api/modules/beefy/vaults.js +1 -1
  14. package/build/dist/api/modules/borro/actions.js +1 -1
  15. package/build/dist/api/modules/borro/checks.js +1 -1
  16. package/build/dist/api/modules/borro/copy.d.ts +17 -12
  17. package/build/dist/api/modules/borro/copy.js +1 -1
  18. package/build/dist/api/modules/borro/index.js +1 -1
  19. package/build/dist/api/modules/borro/liquidity.js +1 -1
  20. package/build/dist/api/modules/borro/positions.js +1 -1
  21. package/build/dist/api/modules/borro/reader.d.ts +6 -2
  22. package/build/dist/api/modules/borro/reader.js +1 -1
  23. package/build/dist/api/modules/borro/types.d.ts +6 -0
  24. package/build/dist/api/modules/chop/abi.d.ts +558 -0
  25. package/build/dist/api/modules/chop/abi.js +1 -0
  26. package/build/dist/api/modules/chop/actions.d.ts +24 -0
  27. package/build/dist/api/modules/chop/actions.js +1 -0
  28. package/build/dist/api/modules/chop/checks.d.ts +34 -0
  29. package/build/dist/api/modules/chop/checks.js +1 -0
  30. package/build/dist/api/modules/chop/copy.d.ts +15 -0
  31. package/build/dist/api/modules/chop/copy.js +1 -0
  32. package/build/dist/api/modules/chop/guard.d.ts +13 -0
  33. package/build/dist/api/modules/chop/guard.js +1 -0
  34. package/build/dist/api/modules/chop/index.d.ts +3 -0
  35. package/build/dist/api/modules/chop/index.js +1 -0
  36. package/build/dist/api/modules/chop/pins.d.ts +53 -0
  37. package/build/dist/api/modules/chop/pins.js +1 -0
  38. package/build/dist/api/modules/chop/positions.d.ts +3 -0
  39. package/build/dist/api/modules/chop/positions.js +1 -0
  40. package/build/dist/api/modules/chop/reader.d.ts +195 -0
  41. package/build/dist/api/modules/chop/reader.js +1 -0
  42. package/build/dist/api/modules/chop/types.d.ts +44 -0
  43. package/build/dist/api/modules/chop/types.js +0 -0
  44. package/build/dist/api/modules/clanker/extensions.d.ts +9 -0
  45. package/build/dist/api/modules/clanker/extensions.js +1 -1
  46. package/build/dist/api/modules/clanker/index.js +1 -1
  47. package/build/dist/api/modules/clanker/manage.js +1 -1
  48. package/build/dist/api/modules/clanker/pool-config.d.ts +15 -0
  49. package/build/dist/api/modules/clanker/pool-config.js +1 -1
  50. package/build/dist/api/modules/clanker/protocol.js +1 -1
  51. package/build/dist/api/modules/earn/copy.d.ts +32 -10
  52. package/build/dist/api/modules/earn/copy.js +1 -1
  53. package/build/dist/api/modules/earn/cost.d.ts +11 -1
  54. package/build/dist/api/modules/earn/cost.js +1 -1
  55. package/build/dist/api/modules/earn/index.js +1 -1
  56. package/build/dist/api/modules/earn/lp.d.ts +14 -1
  57. package/build/dist/api/modules/earn/lp.js +1 -1
  58. package/build/dist/api/modules/earn/options.d.ts +6 -4
  59. package/build/dist/api/modules/earn/options.js +1 -1
  60. package/build/dist/api/modules/erc8004/common.d.ts +1 -1
  61. package/build/dist/api/modules/erc8004/common.js +1 -1
  62. package/build/dist/api/modules/erc8004/domain.js +1 -1
  63. package/build/dist/api/modules/erc8004/index.js +1 -1
  64. package/build/dist/api/modules/erc8004/management.js +1 -1
  65. package/build/dist/api/modules/erc8004/reputation.js +1 -1
  66. package/build/dist/api/modules/erc8004/services.js +1 -1
  67. package/build/dist/api/modules/erc8004/validation.js +1 -1
  68. package/build/dist/api/modules/factor/abi.d.ts +642 -0
  69. package/build/dist/api/modules/factor/abi.js +1 -0
  70. package/build/dist/api/modules/factor/actions.d.ts +15 -0
  71. package/build/dist/api/modules/factor/actions.js +1 -0
  72. package/build/dist/api/modules/factor/api.d.ts +7 -0
  73. package/build/dist/api/modules/factor/api.js +1 -0
  74. package/build/dist/api/modules/factor/checks.d.ts +11 -0
  75. package/build/dist/api/modules/factor/checks.js +1 -0
  76. package/build/dist/api/modules/factor/copy.d.ts +33 -0
  77. package/build/dist/api/modules/factor/copy.js +1 -0
  78. package/build/dist/api/modules/factor/guard.d.ts +12 -0
  79. package/build/dist/api/modules/factor/guard.js +1 -0
  80. package/build/dist/api/modules/factor/index.d.ts +16 -0
  81. package/build/dist/api/modules/factor/index.js +8 -0
  82. package/build/dist/api/modules/factor/messages.d.ts +46 -0
  83. package/build/dist/api/modules/factor/messages.js +1 -0
  84. package/build/dist/api/modules/factor/pins.d.ts +64 -0
  85. package/build/dist/api/modules/factor/pins.js +1 -0
  86. package/build/dist/api/modules/factor/reader.d.ts +17 -0
  87. package/build/dist/api/modules/factor/reader.js +1 -0
  88. package/build/dist/api/modules/factor/types.d.ts +18 -0
  89. package/build/dist/api/modules/factor/types.js +0 -0
  90. package/build/dist/api/modules/gloam/abi.d.ts +89 -0
  91. package/build/dist/api/modules/gloam/abi.js +1 -0
  92. package/build/dist/api/modules/gloam/actions.d.ts +5 -0
  93. package/build/dist/api/modules/gloam/actions.js +1 -0
  94. package/build/dist/api/modules/gloam/checks.d.ts +17 -0
  95. package/build/dist/api/modules/gloam/checks.js +1 -0
  96. package/build/dist/api/modules/gloam/copy.d.ts +23 -0
  97. package/build/dist/api/modules/gloam/copy.js +2 -0
  98. package/build/dist/api/modules/gloam/index.d.ts +6 -0
  99. package/build/dist/api/modules/gloam/index.js +1 -0
  100. package/build/dist/api/modules/gloam/pins.d.ts +41 -0
  101. package/build/dist/api/modules/gloam/pins.js +1 -0
  102. package/build/dist/api/modules/gloam/types.d.ts +308 -0
  103. package/build/dist/api/modules/gloam/types.js +1 -0
  104. package/build/dist/api/modules/grove/index.js +1 -1
  105. package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
  106. package/build/dist/api/modules/heyresearch/index.js +1 -1
  107. package/build/dist/api/modules/heyresearch/public-reads.d.ts +29 -1
  108. package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
  109. package/build/dist/api/modules/heyresearch/scan.js +1 -1
  110. package/build/dist/api/modules/heyresearch/status-labels.d.ts +2 -0
  111. package/build/dist/api/modules/heyresearch/status-labels.js +1 -1
  112. package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
  113. package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
  114. package/build/dist/api/modules/hoodag/index.js +1 -1
  115. package/build/dist/api/modules/hoodag/management.js +1 -1
  116. package/build/dist/api/modules/hoodag/public-reads.js +1 -1
  117. package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
  118. package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
  119. package/build/dist/api/modules/hoodlock/commerce.js +1 -1
  120. package/build/dist/api/modules/hoodlock/fee.js +1 -1
  121. package/build/dist/api/modules/hoodlock/guard.js +1 -1
  122. package/build/dist/api/modules/hoodlock/index.js +1 -1
  123. package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
  124. package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
  125. package/build/dist/api/modules/hoodlock/public.js +1 -1
  126. package/build/dist/api/modules/hookr/actions.js +1 -1
  127. package/build/dist/api/modules/hookr/addons.js +1 -1
  128. package/build/dist/api/modules/hookr/agent-gate.js +1 -1
  129. package/build/dist/api/modules/hookr/contracts.d.ts +2 -1
  130. package/build/dist/api/modules/hookr/contracts.js +1 -1
  131. package/build/dist/api/modules/hookr/create-cancel.js +1 -1
  132. package/build/dist/api/modules/hookr/discovery.js +1 -1
  133. package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
  134. package/build/dist/api/modules/hookr/index.js +1 -1
  135. package/build/dist/api/modules/hookr/launch-options.js +1 -1
  136. package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
  137. package/build/dist/api/modules/hookr/launch.js +1 -1
  138. package/build/dist/api/modules/hookr/liquidity.js +1 -1
  139. package/build/dist/api/modules/hookr/lp-positions.js +1 -1
  140. package/build/dist/api/modules/hookr/lp-reads.d.ts +2 -0
  141. package/build/dist/api/modules/hookr/lp-reads.js +1 -1
  142. package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
  143. package/build/dist/api/modules/hookr/lp-state.js +1 -1
  144. package/build/dist/api/modules/hookr/public-reads.js +1 -1
  145. package/build/dist/api/modules/hookr/read-utils.js +1 -1
  146. package/build/dist/api/modules/hookr/relay.js +1 -1
  147. package/build/dist/api/modules/hookr/revenue.js +1 -1
  148. package/build/dist/api/modules/kyberswap/index.js +1 -1
  149. package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
  150. package/build/dist/api/modules/layerbank/actions.js +1 -1
  151. package/build/dist/api/modules/layerbank/index.js +1 -1
  152. package/build/dist/api/modules/layerbank/merkl.js +1 -1
  153. package/build/dist/api/modules/layerbank/reader.js +1 -1
  154. package/build/dist/api/modules/lighter/index.js +1 -1
  155. package/build/dist/api/modules/longbow/administration.js +1 -1
  156. package/build/dist/api/modules/longbow/fixed.js +1 -1
  157. package/build/dist/api/modules/longbow/index.js +1 -1
  158. package/build/dist/api/modules/longbow/nft.js +1 -1
  159. package/build/dist/api/modules/longbow/rebates.js +1 -1
  160. package/build/dist/api/modules/longbow/staking.js +1 -1
  161. package/build/dist/api/modules/meridian/index.js +1 -1
  162. package/build/dist/api/modules/meridian/markets.js +1 -1
  163. package/build/dist/api/modules/meridian/perps-batch.js +1 -1
  164. package/build/dist/api/modules/meridian/perps-stream.js +1 -1
  165. package/build/dist/api/modules/meridian/perps.js +1 -1
  166. package/build/dist/api/modules/meridian/predict-read.js +1 -1
  167. package/build/dist/api/modules/meridian/rfq.js +1 -1
  168. package/build/dist/api/modules/merkl/discovery.js +1 -1
  169. package/build/dist/api/modules/merkl/index.js +1 -1
  170. package/build/dist/api/modules/merkl/manage.js +1 -1
  171. package/build/dist/api/modules/merkl/protocol.js +1 -1
  172. package/build/dist/api/modules/morpho/allocator.js +1 -1
  173. package/build/dist/api/modules/morpho/bundles.js +1 -1
  174. package/build/dist/api/modules/morpho/in-kind.js +1 -1
  175. package/build/dist/api/modules/morpho/index.js +1 -1
  176. package/build/dist/api/modules/morpho/local-guard.js +1 -1
  177. package/build/dist/api/modules/morpho/midnight.js +1 -1
  178. package/build/dist/api/modules/morpho/protocol.js +1 -1
  179. package/build/dist/api/modules/morpho/vault-management.js +1 -1
  180. package/build/dist/api/modules/morpho/vault-tools.js +1 -1
  181. package/build/dist/api/modules/morpho/vault-v2.d.ts +2 -0
  182. package/build/dist/api/modules/morpho/vault-v2.js +1 -1
  183. package/build/dist/api/modules/netnet/card-plan.js +1 -1
  184. package/build/dist/api/modules/netnet/card-read.js +1 -1
  185. package/build/dist/api/modules/netnet/card-recovery.js +1 -1
  186. package/build/dist/api/modules/netnet/desk-action.js +1 -1
  187. package/build/dist/api/modules/netnet/desk-read.js +1 -1
  188. package/build/dist/api/modules/netnet/financial.js +1 -1
  189. package/build/dist/api/modules/netnet/index.js +1 -1
  190. package/build/dist/api/modules/netnet/staking.js +1 -1
  191. package/build/dist/api/modules/orbio/gateway.js +1 -1
  192. package/build/dist/api/modules/orbio/index.js +1 -1
  193. package/build/dist/api/modules/pendle/convert.js +1 -1
  194. package/build/dist/api/modules/pendle/costs.js +1 -1
  195. package/build/dist/api/modules/pendle/index.js +1 -1
  196. package/build/dist/api/modules/pendle/markets.js +1 -1
  197. package/build/dist/api/modules/pendle/positions.js +1 -1
  198. package/build/dist/api/modules/pendle/pricecheck.js +1 -1
  199. package/build/dist/api/modules/pendle/reader.js +1 -1
  200. package/build/dist/api/modules/pendle/redeem.js +1 -1
  201. package/build/dist/api/modules/pendle/trade.js +1 -1
  202. package/build/dist/api/modules/pendle/validate.js +1 -1
  203. package/build/dist/api/modules/pons/claim.js +1 -1
  204. package/build/dist/api/modules/pons/holder-directory.js +1 -1
  205. package/build/dist/api/modules/pons/index.js +1 -1
  206. package/build/dist/api/modules/pons/launch-status.d.ts +1 -0
  207. package/build/dist/api/modules/pons/launch-status.js +1 -1
  208. package/build/dist/api/modules/pons/reads.js +1 -1
  209. package/build/dist/api/modules/pons/trade.d.ts +3 -2
  210. package/build/dist/api/modules/pons/trade.js +1 -1
  211. package/build/dist/api/modules/poolstrade/index.js +1 -1
  212. package/build/dist/api/modules/priors/coverage.js +1 -1
  213. package/build/dist/api/modules/priors/discovery.js +1 -1
  214. package/build/dist/api/modules/priors/features.js +1 -1
  215. package/build/dist/api/modules/priors/holdings.js +1 -1
  216. package/build/dist/api/modules/priors/index.js +1 -1
  217. package/build/dist/api/modules/priors/integration.d.ts +1 -0
  218. package/build/dist/api/modules/priors/integration.js +1 -1
  219. package/build/dist/api/modules/priors/market.js +1 -1
  220. package/build/dist/api/modules/priors/pt.js +1 -1
  221. package/build/dist/api/modules/priors/savings-exit.js +1 -1
  222. package/build/dist/api/modules/priors/stock-swap.js +1 -1
  223. package/build/dist/api/modules/raeto/authorization.d.ts +30 -0
  224. package/build/dist/api/modules/raeto/authorization.js +1 -0
  225. package/build/dist/api/modules/raeto/copy.d.ts +46 -0
  226. package/build/dist/api/modules/raeto/copy.js +1 -0
  227. package/build/dist/api/modules/raeto/errors.d.ts +4 -0
  228. package/build/dist/api/modules/raeto/errors.js +1 -0
  229. package/build/dist/api/modules/raeto/estimate.d.ts +2 -0
  230. package/build/dist/api/modules/raeto/estimate.js +1 -0
  231. package/build/dist/api/modules/raeto/index.d.ts +16 -0
  232. package/build/dist/api/modules/raeto/index.js +1 -0
  233. package/build/dist/api/modules/raeto/pairing.d.ts +40 -0
  234. package/build/dist/api/modules/raeto/pairing.js +1 -0
  235. package/build/dist/api/modules/raeto/pins.d.ts +24 -0
  236. package/build/dist/api/modules/raeto/pins.js +1 -0
  237. package/build/dist/api/modules/raeto/templates.d.ts +22 -0
  238. package/build/dist/api/modules/raeto/templates.js +1 -0
  239. package/build/dist/api/modules/raeto/terms.d.ts +8 -0
  240. package/build/dist/api/modules/raeto/terms.js +1 -0
  241. package/build/dist/api/modules/raeto/types.d.ts +64 -0
  242. package/build/dist/api/modules/raeto/types.js +0 -0
  243. package/build/dist/api/modules/relay/api.d.ts +16 -0
  244. package/build/dist/api/modules/relay/api.js +1 -1
  245. package/build/dist/api/modules/relay/discovery.js +1 -1
  246. package/build/dist/api/modules/relay/inbound.js +1 -1
  247. package/build/dist/api/modules/relay/index.d.ts +1 -0
  248. package/build/dist/api/modules/relay/index.js +1 -1
  249. package/build/dist/api/modules/relay/order.js +1 -1
  250. package/build/dist/api/modules/relay/outbound-status.js +1 -1
  251. package/build/dist/api/modules/relay/readiness.d.ts +1 -0
  252. package/build/dist/api/modules/relay/readiness.js +1 -1
  253. package/build/dist/api/modules/relay/reads.js +1 -1
  254. package/build/dist/api/modules/relay/vaults.js +1 -1
  255. package/build/dist/api/modules/spark/actions.js +1 -1
  256. package/build/dist/api/modules/spark/index.js +1 -1
  257. package/build/dist/api/modules/spark/management.js +1 -1
  258. package/build/dist/api/modules/steakhouse/analytics.js +1 -1
  259. package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
  260. package/build/dist/api/modules/steakhouse/index.js +1 -1
  261. package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
  262. package/build/dist/api/modules/steakhouse/management.js +1 -1
  263. package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
  264. package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
  265. package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
  266. package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
  267. package/build/dist/api/modules/tickerspring/guards.js +1 -1
  268. package/build/dist/api/modules/tickerspring/index.js +1 -1
  269. package/build/dist/api/modules/tickerspring/journeys.d.ts +1 -0
  270. package/build/dist/api/modules/tickerspring/journeys.js +1 -1
  271. package/build/dist/api/modules/tickerspring/ladder.js +1 -1
  272. package/build/dist/api/modules/tickerspring/maker.js +1 -1
  273. package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
  274. package/build/dist/api/modules/tickerspring/research.js +1 -1
  275. package/build/dist/api/modules/tickerspring/strategies.js +1 -1
  276. package/build/dist/api/modules/uniswap/auction-create.js +1 -1
  277. package/build/dist/api/modules/uniswap/auction.js +1 -1
  278. package/build/dist/api/modules/uniswap/batch.js +1 -1
  279. package/build/dist/api/modules/uniswap/common.js +1 -1
  280. package/build/dist/api/modules/uniswap/fee-percent.d.ts +4 -0
  281. package/build/dist/api/modules/uniswap/fee-percent.js +1 -0
  282. package/build/dist/api/modules/uniswap/fees.js +1 -1
  283. package/build/dist/api/modules/uniswap/index.js +1 -1
  284. package/build/dist/api/modules/uniswap/local-guard.d.ts +2 -0
  285. package/build/dist/api/modules/uniswap/local-guard.js +1 -1
  286. package/build/dist/api/modules/uniswap/oracle.js +1 -1
  287. package/build/dist/api/modules/uniswap/pool-math.js +1 -1
  288. package/build/dist/api/modules/uniswap/pools.d.ts +2 -0
  289. package/build/dist/api/modules/uniswap/pools.js +1 -1
  290. package/build/dist/api/modules/uniswap/position.js +1 -1
  291. package/build/dist/api/modules/uniswap/protocol.js +1 -1
  292. package/build/dist/api/modules/uniswap/quote-guard.d.ts +38 -0
  293. package/build/dist/api/modules/uniswap/quote-guard.js +1 -0
  294. package/build/dist/api/modules/uniswap/token-jar.js +1 -1
  295. package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
  296. package/build/dist/api/modules/uniswap/trade.d.ts +10 -3
  297. package/build/dist/api/modules/uniswap/trade.js +1 -1
  298. package/build/dist/api/modules/uniswap/v2.js +1 -1
  299. package/build/dist/api/modules/uniswap/v3.js +1 -1
  300. package/build/dist/api/modules/uniswap/v4.d.ts +6 -0
  301. package/build/dist/api/modules/uniswap/v4.js +1 -1
  302. package/build/dist/api/modules/uniswap/wrap.js +1 -1
  303. package/build/dist/api/modules/velora/claims.js +1 -1
  304. package/build/dist/api/modules/velora/delta-reads.js +1 -1
  305. package/build/dist/api/modules/velora/index.js +1 -1
  306. package/build/dist/api/modules/wormhole/index.d.ts +3 -0
  307. package/build/dist/api/modules/wormhole/index.js +1 -1
  308. package/build/dist/api/modules/wormhole/scan-text.js +1 -1
  309. package/build/dist/api/modules/wormhole/swap-token-verdict.d.ts +11 -0
  310. package/build/dist/api/modules/wormhole/swap-token-verdict.js +1 -0
  311. package/build/dist/api/modules/wormhole/third-party-text.d.ts +24 -0
  312. package/build/dist/api/modules/wormhole/third-party-text.js +1 -0
  313. package/build/dist/api/modules/wormhole/token-check.d.ts +2 -0
  314. package/build/dist/api/modules/wormhole/token-check.js +1 -1
  315. package/build/dist/api/modules/wormhole/x402-client.d.ts +36 -0
  316. package/build/dist/api/modules/wormhole/x402-client.js +1 -0
  317. package/build/dist/api/oak-fee.d.ts +12 -0
  318. package/build/dist/api/oak-fee.js +1 -0
  319. package/build/dist/api/param-text.d.ts +22 -0
  320. package/build/dist/api/param-text.js +1 -0
  321. package/build/dist/api/position-economics.d.ts +70 -0
  322. package/build/dist/api/position-economics.js +1 -0
  323. package/build/dist/api/positions.d.ts +8 -5
  324. package/build/dist/api/positions.js +1 -1
  325. package/build/dist/api/prices.d.ts +3 -0
  326. package/build/dist/api/prices.js +1 -1
  327. package/build/dist/api/progress.d.ts +7 -0
  328. package/build/dist/api/progress.js +1 -0
  329. package/build/dist/api/read-budgets.d.ts +4 -0
  330. package/build/dist/api/read-budgets.js +1 -0
  331. package/build/dist/api/read-shape.d.ts +45 -0
  332. package/build/dist/api/read-shape.js +1 -0
  333. package/build/dist/api/revert.d.ts +23 -0
  334. package/build/dist/api/revert.js +1 -0
  335. package/build/dist/api/routes.js +1 -1
  336. package/build/dist/api/rpc.d.ts +1 -0
  337. package/build/dist/api/rpc.js +1 -1
  338. package/build/dist/api/secret-fields.js +1 -1
  339. package/build/dist/api/send.js +1 -1
  340. package/build/dist/api/signing-registry.d.ts +8 -0
  341. package/build/dist/api/signing-registry.js +1 -1
  342. package/build/dist/api/simulate.js +1 -1
  343. package/build/dist/api/swap.d.ts +4 -0
  344. package/build/dist/api/swap.js +1 -1
  345. package/build/dist/api/tokens.d.ts +1 -0
  346. package/build/dist/api/tokens.js +1 -1
  347. package/build/dist/api/tool-policy.js +1 -1
  348. package/build/dist/api/types.d.ts +9 -1
  349. package/build/dist/api/untrusted-unwrap.d.ts +1 -0
  350. package/build/dist/api/untrusted-unwrap.js +1 -0
  351. package/build/dist/api/usd-estimate.d.ts +23 -0
  352. package/build/dist/api/usd-estimate.js +1 -0
  353. package/build/dist/api/vendor-limits.js +1 -1
  354. package/build/dist/chunks/{JVLLVNF2.js → 2E4I7CJ7.js} +1 -1
  355. package/build/dist/chunks/2FHELZ7Y.js +1 -0
  356. package/build/dist/chunks/2GXHYI23.js +1 -0
  357. package/build/dist/chunks/2LWBN35N.js +1 -0
  358. package/build/dist/chunks/{4HG6FRVH.js → 2OKYXT25.js} +1 -1
  359. package/build/dist/chunks/2SUHQWND.js +1 -0
  360. package/build/dist/chunks/2ZWKIBJT.js +1 -0
  361. package/build/dist/chunks/32RXFUOH.js +1 -0
  362. package/build/dist/chunks/3CH2IPQL.js +1 -0
  363. package/build/dist/chunks/3DNJTJ2X.js +1 -0
  364. package/build/dist/chunks/3K2N5VFH.js +1 -0
  365. package/build/dist/chunks/3VBIRLU3.js +1 -0
  366. package/build/dist/chunks/3VWVW7PX.js +1 -0
  367. package/build/dist/chunks/3ZABD6ZF.js +2 -0
  368. package/build/dist/chunks/44MB6SA6.js +1 -0
  369. package/build/dist/chunks/4D4ZRZUW.js +1 -0
  370. package/build/dist/chunks/{KIFSRO5K.js → 4FPV4CRC.js} +1 -1
  371. package/build/dist/chunks/4GNUXN4K.js +1 -0
  372. package/build/dist/chunks/{K4DHHQBI.js → 4JRXEN7C.js} +2 -2
  373. package/build/dist/chunks/4JTTA3BX.js +1 -0
  374. package/build/dist/chunks/4OVIMYNH.js +2 -0
  375. package/build/dist/chunks/{326QMOTR.js → 4Q2ZBZXM.js} +1 -1
  376. package/build/dist/chunks/4RQAOOO2.js +1 -0
  377. package/build/dist/chunks/4TTDAF4B.js +1 -0
  378. package/build/dist/chunks/523ZIR3J.js +1 -0
  379. package/build/dist/chunks/5DPJQCKJ.js +68 -0
  380. package/build/dist/chunks/5HIHUYA4.js +1 -0
  381. package/build/dist/chunks/5PI57UC2.js +1 -0
  382. package/build/dist/chunks/5RXALTDT.js +1 -0
  383. package/build/dist/chunks/5TUXSOMI.js +1 -0
  384. package/build/dist/chunks/5UAXLWJ2.js +1 -0
  385. package/build/dist/chunks/5XAXJEWM.js +5 -0
  386. package/build/dist/chunks/67BWOVET.js +1 -0
  387. package/build/dist/chunks/6NUNCD5J.js +1 -0
  388. package/build/dist/chunks/6PZGDVHV.js +1 -0
  389. package/build/dist/chunks/{OKUO3BVM.js → 6UVGQYZ3.js} +1 -1
  390. package/build/dist/chunks/753HZZTY.js +1 -0
  391. package/build/dist/chunks/77CLMPM7.js +1 -0
  392. package/build/dist/chunks/7D73A6KS.js +1 -0
  393. package/build/dist/chunks/7MBVTNLU.js +1 -0
  394. package/build/dist/chunks/7QKYDNF6.js +18 -0
  395. package/build/dist/chunks/7VC53B5X.js +70 -0
  396. package/build/dist/chunks/{QSHCBASA.js → 7VNO46LV.js} +1 -1
  397. package/build/dist/chunks/ACH4BSME.js +3 -0
  398. package/build/dist/chunks/AHUCYDBC.js +1 -0
  399. package/build/dist/chunks/AI3VAPA3.js +1 -0
  400. package/build/dist/chunks/AMTRDPVO.js +1 -0
  401. package/build/dist/chunks/APHNOGNS.js +1 -0
  402. package/build/dist/chunks/APQYLJGS.js +1 -0
  403. package/build/dist/chunks/{WDK6VOG4.js → ARI72OYT.js} +1 -1
  404. package/build/dist/chunks/ARLGF5MU.js +1 -0
  405. package/build/dist/chunks/BAIY32AV.js +1 -0
  406. package/build/dist/chunks/BB765L75.js +3 -0
  407. package/build/dist/chunks/BE3A7677.js +1 -0
  408. package/build/dist/chunks/BX46C5ZP.js +1 -0
  409. package/build/dist/chunks/{IY7BXLT4.js → BZ34ZR65.js} +1 -1
  410. package/build/dist/chunks/C3WBHFLX.js +1 -0
  411. package/build/dist/chunks/C75MT5SD.js +1 -0
  412. package/build/dist/chunks/CAWTAR5V.js +1 -0
  413. package/build/dist/chunks/CNLL4NCR.js +1 -0
  414. package/build/dist/chunks/CO4GCF4L.js +1 -0
  415. package/build/dist/chunks/{P5PYFK7L.js → CQ5WRWV4.js} +1 -1
  416. package/build/dist/chunks/{SJJR4ZBZ.js → CSDN4MYP.js} +1 -1
  417. package/build/dist/chunks/CSOO4SW7.js +1 -0
  418. package/build/dist/chunks/CZL6T2ZQ.js +1 -0
  419. package/build/dist/chunks/D742AYEV.js +1 -0
  420. package/build/dist/chunks/DGCJZ3HO.js +1 -0
  421. package/build/dist/chunks/DNNFKDZR.js +1 -0
  422. package/build/dist/chunks/DPE7SPW7.js +1 -0
  423. package/build/dist/chunks/DSTMEY5F.js +1 -0
  424. package/build/dist/chunks/{X3BYCOWS.js → DYYEA5HB.js} +1 -1
  425. package/build/dist/chunks/EFESPGA2.js +1 -0
  426. package/build/dist/chunks/EGZREEG2.js +1 -0
  427. package/build/dist/chunks/EH5G4O3U.js +1 -0
  428. package/build/dist/chunks/EI6GGPDS.js +20 -0
  429. package/build/dist/chunks/EVBHQQQG.js +1 -0
  430. package/build/dist/chunks/EZZM2GQT.js +2 -0
  431. package/build/dist/chunks/F3VDVTMS.js +1 -0
  432. package/build/dist/chunks/F4UQEPJT.js +1 -0
  433. package/build/dist/chunks/FHTNMGFR.js +1 -0
  434. package/build/dist/chunks/FIO6VC2J.js +1 -0
  435. package/build/dist/chunks/FJLJ7ZQ5.js +1 -0
  436. package/build/dist/chunks/{WP6RHXGN.js → FL5SSHUL.js} +1 -1
  437. package/build/dist/chunks/FNGIJKMZ.js +1 -0
  438. package/build/dist/chunks/{KIFZ5ZSK.js → FOD34G2H.js} +1 -1
  439. package/build/dist/chunks/{WV3A3OUU.js → FOKEFXGP.js} +1 -1
  440. package/build/dist/chunks/FV4WZOTD.js +1 -0
  441. package/build/dist/chunks/FWIFTPSE.js +2 -0
  442. package/build/dist/chunks/FZ6IJZZM.js +1 -0
  443. package/build/dist/chunks/G2LAO23N.js +1 -0
  444. package/build/dist/chunks/GDRQ2ANN.js +1 -0
  445. package/build/dist/chunks/GG24LO2R.js +1 -0
  446. package/build/dist/chunks/GLF7WEY2.js +1 -0
  447. package/build/dist/chunks/GQ3XZFRL.js +1 -0
  448. package/build/dist/chunks/{QU5XKRGK.js → GQYV4TFO.js} +1 -1
  449. package/build/dist/chunks/GRSXWQWD.js +1 -0
  450. package/build/dist/chunks/{3GOHSYHW.js → GSFHM5L3.js} +1 -1
  451. package/build/dist/chunks/H5DY7CNB.js +1 -0
  452. package/build/dist/chunks/HCBX4NFM.js +1 -0
  453. package/build/dist/chunks/HHO5ISMM.js +1 -0
  454. package/build/dist/chunks/HIX5N25Z.js +1 -0
  455. package/build/dist/chunks/HKVQ646Q.js +1 -0
  456. package/build/dist/chunks/HS4DZPYT.js +1 -0
  457. package/build/dist/chunks/I6PQW2JI.js +1 -0
  458. package/build/dist/chunks/IEG6GLFR.js +1 -0
  459. package/build/dist/chunks/INOYMBWE.js +1 -0
  460. package/build/dist/chunks/IV4K7FMD.js +1 -0
  461. package/build/dist/chunks/{T2WHOZXM.js → J73ATSEQ.js} +1 -1
  462. package/build/dist/chunks/JBTOZ6IH.js +1 -0
  463. package/build/dist/chunks/JESMX2UC.js +1 -0
  464. package/build/dist/chunks/JJGZ7W3V.js +1 -0
  465. package/build/dist/chunks/JKRBGAX2.js +1 -0
  466. package/build/dist/chunks/JLRHM2DQ.js +1 -0
  467. package/build/dist/chunks/JOKL5L6X.js +1 -0
  468. package/build/dist/chunks/JS53DQVT.js +1 -0
  469. package/build/dist/chunks/{WIRBCS4W.js → JWR5XVP2.js} +1 -1
  470. package/build/dist/chunks/K6D6SDIG.js +1 -0
  471. package/build/dist/chunks/K7HTDKAT.js +1 -0
  472. package/build/dist/chunks/{GQ5GYUEH.js → KDGSYNOP.js} +1 -1
  473. package/build/dist/chunks/KKPMOAVI.js +1 -0
  474. package/build/dist/chunks/KREBNL2D.js +1 -0
  475. package/build/dist/chunks/L646YWDP.js +1 -0
  476. package/build/dist/chunks/{2MAMJJJC.js → LR4XTZ37.js} +1 -1
  477. package/build/dist/chunks/LVFI74ST.js +1 -0
  478. package/build/dist/chunks/{Z4FZVJ5Z.js → M7ZXDLKM.js} +1 -1
  479. package/build/dist/chunks/MVD3KWPP.js +1 -0
  480. package/build/dist/chunks/N245WC5R.js +1 -0
  481. package/build/dist/chunks/{WTXC3XKW.js → N4XNNXOJ.js} +1 -1
  482. package/build/dist/chunks/N6GIC7HJ.js +1 -0
  483. package/build/dist/chunks/{RUC7KH7A.js → NA424YAL.js} +1 -1
  484. package/build/dist/chunks/NUFZUKYS.js +1 -0
  485. package/build/dist/chunks/O3JWCJIF.js +1 -0
  486. package/build/dist/chunks/OARVU3RC.js +1 -0
  487. package/build/dist/chunks/OEZ7FCLF.js +1 -0
  488. package/build/dist/chunks/{H43RNCX2.js → OUROA7XR.js} +1 -1
  489. package/build/dist/chunks/{3FUVMSCF.js → OYJFXEDU.js} +1 -1
  490. package/build/dist/chunks/OYPAVXGQ.js +1 -0
  491. package/build/dist/chunks/{SMYWWIE6.js → OZ5MDUD2.js} +1 -1
  492. package/build/dist/chunks/P6OMKZMR.js +3 -0
  493. package/build/dist/chunks/PV4AK32X.js +1 -0
  494. package/build/dist/chunks/{HKEMQBFA.js → PXVREXCS.js} +1 -1
  495. package/build/dist/chunks/PZEF5LBL.js +2 -0
  496. package/build/dist/chunks/Q2ACLVWR.js +1 -0
  497. package/build/dist/chunks/QFSBDPLN.js +1 -0
  498. package/build/dist/chunks/QJNLLI6N.js +1 -0
  499. package/build/dist/chunks/QMZEGT5B.js +1 -0
  500. package/build/dist/chunks/{HSCQZ66A.js → REWXG6X6.js} +1 -1
  501. package/build/dist/chunks/{6B3VVISQ.js → RLI4JDOL.js} +1 -1
  502. package/build/dist/chunks/{4MXM6Q4W.js → RLMVA575.js} +1 -1
  503. package/build/dist/chunks/RPB46QAC.js +1 -0
  504. package/build/dist/chunks/{Q42YI3EP.js → RT7IU6TI.js} +1 -1
  505. package/build/dist/chunks/{ER47KGRM.js → SBY4RJ7I.js} +1 -1
  506. package/build/dist/chunks/SCG5HWMN.js +1 -0
  507. package/build/dist/chunks/SENOU5JR.js +1 -0
  508. package/build/dist/chunks/SKEKXEUU.js +1 -0
  509. package/build/dist/chunks/SOTYQGPT.js +1 -0
  510. package/build/dist/chunks/SZ466I5X.js +1 -0
  511. package/build/dist/chunks/{GNC6RXLT.js → TDZTC5WR.js} +1 -1
  512. package/build/dist/chunks/TE6D3OIX.js +1 -0
  513. package/build/dist/chunks/TID4C2KC.js +1 -0
  514. package/build/dist/chunks/TK55VASJ.js +2 -0
  515. package/build/dist/chunks/TM7Z5SA4.js +1 -0
  516. package/build/dist/chunks/TNJTET4G.js +1 -0
  517. package/build/dist/chunks/TPEKCXVE.js +1 -0
  518. package/build/dist/chunks/TVIMP5CK.js +1 -0
  519. package/build/dist/chunks/U2YCQWZK.js +1 -0
  520. package/build/dist/chunks/U363GQTF.js +1 -0
  521. package/build/dist/chunks/{U4JGEMKT.js → UEDGYZOC.js} +1 -1
  522. package/build/dist/chunks/UOCRYXAB.js +1 -0
  523. package/build/dist/chunks/UQEEF5W5.js +1 -0
  524. package/build/dist/chunks/{QQECG3WP.js → UUID2E22.js} +1 -1
  525. package/build/dist/chunks/UWBKAWX3.js +7 -0
  526. package/build/dist/chunks/V37L4DU4.js +1 -0
  527. package/build/dist/chunks/VR344DAZ.js +1 -0
  528. package/build/dist/chunks/{TX2EOIRS.js → VST6LFUB.js} +1 -1
  529. package/build/dist/chunks/VTPT5544.js +1 -0
  530. package/build/dist/chunks/VVWFB53Q.js +1 -0
  531. package/build/dist/chunks/WHTRPRRD.js +1 -0
  532. package/build/dist/chunks/WHVZ372B.js +1 -0
  533. package/build/dist/chunks/{AFBEZXNV.js → WNWRF4HE.js} +1 -1
  534. package/build/dist/chunks/WOGWLFAL.js +3 -0
  535. package/build/dist/chunks/WUT7TZYM.js +1 -0
  536. package/build/dist/chunks/XCKTE4ON.js +1 -0
  537. package/build/dist/chunks/XEPCDGN2.js +1 -0
  538. package/build/dist/chunks/XHYFISVV.js +1 -0
  539. package/build/dist/chunks/XPEDQBLI.js +1 -0
  540. package/build/dist/chunks/{D3YLXQPW.js → XQ24RSEI.js} +1 -1
  541. package/build/dist/chunks/XRDXFHIK.js +1 -0
  542. package/build/dist/chunks/XTFRPI4G.js +1 -0
  543. package/build/dist/chunks/XVJ7ILKK.js +1 -0
  544. package/build/dist/chunks/XWKK75TO.js +1 -0
  545. package/build/dist/chunks/{74Y2KDNR.js → XYPGLG6A.js} +1 -1
  546. package/build/dist/chunks/Y77EVVT4.js +1 -0
  547. package/build/dist/chunks/YEIM6BZQ.js +1 -0
  548. package/build/dist/chunks/{S47VUTHM.js → YMV5TL5C.js} +1 -1
  549. package/build/dist/chunks/YSMWCKIX.js +1 -0
  550. package/build/dist/chunks/YTLH4M4Y.js +1 -0
  551. package/build/dist/chunks/YUHNPUNK.js +1 -0
  552. package/build/dist/chunks/YWZQJJYY.js +1 -0
  553. package/build/dist/chunks/{UMIZMJWW.js → ZF2VPDRQ.js} +1 -1
  554. package/build/dist/chunks/ZFU65MB4.js +1 -0
  555. package/build/dist/chunks/ZKZUS3QU.js +1 -0
  556. package/build/dist/chunks/ZOMFHTB2.js +1 -0
  557. package/build/dist/chunks/{BTD5SMOW.js → ZP36DSOD.js} +1 -1
  558. package/build/dist/chunks/ZQ6AF3VX.js +1 -0
  559. package/package.json +1 -1
  560. package/build/dist/chunks/2KYAMXTS.js +0 -1
  561. package/build/dist/chunks/2TK3ETUO.js +0 -1
  562. package/build/dist/chunks/3MLUCYCB.js +0 -1
  563. package/build/dist/chunks/3NJ5KQ3Q.js +0 -1
  564. package/build/dist/chunks/3XNZUIRU.js +0 -1
  565. package/build/dist/chunks/3XXBLNEX.js +0 -1
  566. package/build/dist/chunks/45BRW2ZF.js +0 -1
  567. package/build/dist/chunks/46547QT3.js +0 -1
  568. package/build/dist/chunks/4PY3UFNR.js +0 -1
  569. package/build/dist/chunks/52ELWNXJ.js +0 -2
  570. package/build/dist/chunks/553UE2ZQ.js +0 -1
  571. package/build/dist/chunks/57MEFFCU.js +0 -1
  572. package/build/dist/chunks/5APS4T2D.js +0 -1
  573. package/build/dist/chunks/5SMVQCAP.js +0 -1
  574. package/build/dist/chunks/64GOINYS.js +0 -1
  575. package/build/dist/chunks/6D5DJA5B.js +0 -1
  576. package/build/dist/chunks/6I4NTKB2.js +0 -1
  577. package/build/dist/chunks/6OGDTEGH.js +0 -1
  578. package/build/dist/chunks/6PBGEPUK.js +0 -20
  579. package/build/dist/chunks/6WZX7C4T.js +0 -2
  580. package/build/dist/chunks/7WSHW7KW.js +0 -1
  581. package/build/dist/chunks/ABPL3ZZI.js +0 -1
  582. package/build/dist/chunks/AKYF5264.js +0 -7
  583. package/build/dist/chunks/APGLZXIW.js +0 -1
  584. package/build/dist/chunks/AVG4W3Y7.js +0 -1
  585. package/build/dist/chunks/B3RXD5ET.js +0 -1
  586. package/build/dist/chunks/BBS3ODWZ.js +0 -1
  587. package/build/dist/chunks/BJ2VGRF4.js +0 -1
  588. package/build/dist/chunks/BTPXJAUX.js +0 -1
  589. package/build/dist/chunks/C36BFZH6.js +0 -1
  590. package/build/dist/chunks/C7AXJHBT.js +0 -1
  591. package/build/dist/chunks/CBG5HARQ.js +0 -2
  592. package/build/dist/chunks/CCTXCMH4.js +0 -1
  593. package/build/dist/chunks/CHXBOXOD.js +0 -1
  594. package/build/dist/chunks/DJN3JAWB.js +0 -1
  595. package/build/dist/chunks/E674J2MD.js +0 -1
  596. package/build/dist/chunks/EE64JSLY.js +0 -1
  597. package/build/dist/chunks/EJ7O75A7.js +0 -1
  598. package/build/dist/chunks/ELSXLZN5.js +0 -1
  599. package/build/dist/chunks/FQ6UZCM6.js +0 -1
  600. package/build/dist/chunks/GEIFITAQ.js +0 -1
  601. package/build/dist/chunks/GGSAKCND.js +0 -1
  602. package/build/dist/chunks/GL4NCUMH.js +0 -1
  603. package/build/dist/chunks/GW626GG2.js +0 -1
  604. package/build/dist/chunks/H2XDMFQQ.js +0 -1
  605. package/build/dist/chunks/HAQPIBYR.js +0 -1
  606. package/build/dist/chunks/HCUHMCBW.js +0 -1
  607. package/build/dist/chunks/I26DMNJG.js +0 -1
  608. package/build/dist/chunks/IMO3GDA5.js +0 -1
  609. package/build/dist/chunks/INOZIE55.js +0 -1
  610. package/build/dist/chunks/J2OT4KAH.js +0 -1
  611. package/build/dist/chunks/JUZ5JU6D.js +0 -70
  612. package/build/dist/chunks/K3RDPI5J.js +0 -1
  613. package/build/dist/chunks/KBKK7UNY.js +0 -1
  614. package/build/dist/chunks/KPCY5V35.js +0 -1
  615. package/build/dist/chunks/L4N2RSK2.js +0 -1
  616. package/build/dist/chunks/L5BLHY34.js +0 -1
  617. package/build/dist/chunks/LSXUAHOE.js +0 -1
  618. package/build/dist/chunks/M37654RL.js +0 -1
  619. package/build/dist/chunks/MJ6WEWMI.js +0 -3
  620. package/build/dist/chunks/MR5L7V6Z.js +0 -1
  621. package/build/dist/chunks/N4Q6GN65.js +0 -1
  622. package/build/dist/chunks/NAZPDRIF.js +0 -1
  623. package/build/dist/chunks/NDCLTVIU.js +0 -1
  624. package/build/dist/chunks/NEEZBJBC.js +0 -1
  625. package/build/dist/chunks/NKX3FE34.js +0 -1
  626. package/build/dist/chunks/NKZKKCK2.js +0 -1
  627. package/build/dist/chunks/OJ4WJUPP.js +0 -1
  628. package/build/dist/chunks/OJPG45AC.js +0 -1
  629. package/build/dist/chunks/OTXSKFUD.js +0 -1
  630. package/build/dist/chunks/P3S4BR5G.js +0 -1
  631. package/build/dist/chunks/P56RZC2M.js +0 -1
  632. package/build/dist/chunks/P7I62KFR.js +0 -1
  633. package/build/dist/chunks/PK66GCDT.js +0 -1
  634. package/build/dist/chunks/PSBQWDYI.js +0 -1
  635. package/build/dist/chunks/PXT5YTWU.js +0 -1
  636. package/build/dist/chunks/QA3UHEO3.js +0 -1
  637. package/build/dist/chunks/QC3HH5UD.js +0 -3
  638. package/build/dist/chunks/QF52OIBS.js +0 -1
  639. package/build/dist/chunks/QO3KCJMP.js +0 -1
  640. package/build/dist/chunks/QZZ4O34L.js +0 -1
  641. package/build/dist/chunks/RQ4GHJXE.js +0 -1
  642. package/build/dist/chunks/RUX3RY7Y.js +0 -1
  643. package/build/dist/chunks/RVDUSNWW.js +0 -1
  644. package/build/dist/chunks/S7IFAQPG.js +0 -1
  645. package/build/dist/chunks/SIYUNOLI.js +0 -1
  646. package/build/dist/chunks/SSHCD6RZ.js +0 -18
  647. package/build/dist/chunks/T3AJSQYT.js +0 -1
  648. package/build/dist/chunks/TEJ7W534.js +0 -1
  649. package/build/dist/chunks/TM2XCRU7.js +0 -1
  650. package/build/dist/chunks/TVWMTMEF.js +0 -1
  651. package/build/dist/chunks/U5PMVP56.js +0 -1
  652. package/build/dist/chunks/U67J4BCH.js +0 -1
  653. package/build/dist/chunks/UHTRW2R6.js +0 -1
  654. package/build/dist/chunks/UHVSINR5.js +0 -1
  655. package/build/dist/chunks/VEQBHI6O.js +0 -1
  656. package/build/dist/chunks/VJS4DHQQ.js +0 -1
  657. package/build/dist/chunks/VOMGT5SG.js +0 -1
  658. package/build/dist/chunks/VY7XRHZQ.js +0 -1
  659. package/build/dist/chunks/VYAJXLND.js +0 -1
  660. package/build/dist/chunks/VYN2NRAP.js +0 -1
  661. package/build/dist/chunks/W2BYU5JQ.js +0 -2
  662. package/build/dist/chunks/W6BS3T7S.js +0 -1
  663. package/build/dist/chunks/WCNHZYQQ.js +0 -1
  664. package/build/dist/chunks/X2KFXCVD.js +0 -1
  665. package/build/dist/chunks/X3PQMS4N.js +0 -1
  666. package/build/dist/chunks/XBE3B6Y2.js +0 -1
  667. package/build/dist/chunks/XLOYBLFI.js +0 -1
  668. package/build/dist/chunks/XR7VK24E.js +0 -1
  669. package/build/dist/chunks/XSRIJUFU.js +0 -1
  670. package/build/dist/chunks/Y25EXZCO.js +0 -1
  671. package/build/dist/chunks/YCZPSMZ5.js +0 -1
  672. package/build/dist/chunks/YN56C7PN.js +0 -1
  673. package/build/dist/chunks/YWRDZQI6.js +0 -1
  674. package/build/dist/chunks/YXTSWRV5.js +0 -1
  675. package/build/dist/chunks/Z43BTOTE.js +0 -1
  676. package/build/dist/chunks/ZMFRMWHR.js +0 -1
  677. package/build/dist/chunks/ZSN4IRI5.js +0 -1
  678. package/build/dist/chunks/ZV5HIQXC.js +0 -1
@@ -0,0 +1 @@
1
+ import{b as f}from"./L646YWDP.js";import{a as p}from"./43LI5NKJ.js";import{a as u}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{encodeFunctionData as A,getAddress as w,parseAbi as T,parseAbiItem as F}from"viem";var R=[["setOwner(address newOwner)","owner"],["setCurator(address newCurator)","owner"],["setIsSentinel(address account,bool enabled)","owner"],["setName(string name)","owner"],["setSymbol(string symbol)","owner"],["setIsAllocator(address account,bool enabled)","timelock"],["setReceiveSharesGate(address gate)","timelock"],["setSendSharesGate(address gate)","timelock"],["setReceiveAssetsGate(address gate)","timelock"],["setSendAssetsGate(address gate)","timelock"],["setAdapterRegistry(address registry)","timelock"],["addAdapter(address adapter)","timelock"],["removeAdapter(address adapter)","timelock"],["increaseTimelock(bytes4 selector,uint256 duration)","timelock"],["decreaseTimelock(bytes4 selector,uint256 duration)","timelock"],["abdicate(bytes4 selector)","timelock"],["setPerformanceFee(uint256 fee)","timelock"],["setManagementFee(uint256 fee)","timelock"],["setPerformanceFeeRecipient(address recipient)","timelock"],["setManagementFeeRecipient(address recipient)","timelock"],["increaseAbsoluteCap(bytes idData,uint256 cap)","timelock"],["increaseRelativeCap(bytes idData,uint256 cap)","timelock"],["decreaseAbsoluteCap(bytes idData,uint256 cap)","curatorOrSentinel"],["decreaseRelativeCap(bytes idData,uint256 cap)","curatorOrSentinel"],["setForceDeallocatePenalty(address adapter,uint256 penalty)","timelock"],["allocate(address adapter,bytes data,uint256 assets)","allocator"],["deallocate(address adapter,bytes data,uint256 assets)","allocatorOrSentinel"],["setLiquidityAdapterAndData(address adapter,bytes data)","allocator"],["setMaxRate(uint256 rate)","allocator"],["accrueInterest()","any"]],S=R.map(([a,t])=>({abi:F(`function ${a}`),authority:t})),x=T(["function asset() view returns (address)","function owner() view returns (address)","function curator() view returns (address)","function isSentinel(address) view returns (bool)","function isAllocator(address) view returns (bool)","function executableAt(bytes) view returns (uint256)","function abdicated(bytes4) view returns (bool)","function submit(bytes data)","function revoke(bytes data)"]);function M(a,t){if(a==="bool"){if(typeof t!="boolean")throw new n("Boolean operation values must be booleans.");return t}if(typeof t!="string")throw new n("All address, byte, text and integer operation values must be strings.");if(a==="address")return p(t),w(t);if(a==="uint256"){if(!/^\d+$/.test(t)||BigInt(t)>=1n<<256n)throw new n("Integer operation values must be uint256 decimal base-unit strings.");return BigInt(t)}if((a==="bytes"||a==="bytes4")&&!(a==="bytes4"?/^0x[0-9a-f]{8}$/i:/^0x(?:[0-9a-f]{2})*$/i).test(t))throw new n("Invalid hexadecimal operation bytes.");return t}function V(a,t,m,O){return{name:t,inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:S.map(i=>i.abi.name),description:"Vault management function to call (role-gated curator, owner, allocator or sentinel actions); values supplies its arguments in order."},values:{type:"array",maxItems:3,items:{oneOf:[{type:"string"},{type:"boolean"}]},description:"Ordered ABI values. Integers are decimal base-unit strings; addresses and bytes are explicit strings."},mode:{enum:["call","submit","revoke"],default:"call",description:"Submit/revoke only for timelocked curator operations. Execution is a separate call after the delay."}}},execute:async(i,c)=>{try{if(p(c),Object.keys(i).some(e=>!["operation","values","mode"].includes(e)))throw new n("Unexpected vault management argument.");let r=S.find(e=>e.abi.name===i.operation);if(!r||!Array.isArray(i.values)||i.values.length!==r.abi.inputs.length)throw new n("Provide a supported operation and its exact ordered values.");let o=i.mode??"call";if(!["call","submit","revoke"].includes(String(o))||o!=="call"&&r.authority!=="timelock")throw new n("Submit/revoke is available only for timelocked curator operations.");let I=r.abi.inputs.map((e,d)=>M(e.type,i.values[d])),l=A({abi:[r.abi],functionName:r.abi.name,args:I}),b=a.clientFor(u);if(await b.getChainId()!==u)throw new n("Vault management requires chain 4663.");let s=(e,d=[])=>b.readContract({address:m,abi:x,functionName:e,args:d}),y=await s("asset");if(typeof y!="string"||w(y)!==w(O.address))throw new n("Vault management requires the pinned vault asset.");let g=e=>typeof e=="string"&&e.toLowerCase()===c.toLowerCase(),C=async e=>e==="any"?!0:e==="owner"?g(await s("owner")):e==="allocator"?await s("isAllocator",[c])===!0:e==="allocatorOrSentinel"?await s("isAllocator",[c])===!0||await s("isSentinel",[c])===!0:g(await s("curator"))||e==="curatorOrSentinel"&&await s("isSentinel",[c])===!0;if(r.authority==="timelock"&&o==="call"){let[e,d,D]=await Promise.all([s("executableAt",[l]),s("abdicated",[l.slice(0,10)]),b.getBlock()]);if(f(e)===0n||f(e)>D.timestamp||d!==!1)throw new n("This exact operation has not matured or its selector is abdicated. Submit it with the curator, then wait for its executable time.")}else if(!await C(o==="submit"?"timelock":o==="revoke"?"curatorOrSentinel":r.authority))throw new n("This wallet does not hold the required vault management role. No transaction was built.");let $=o==="call"?l:A({abi:x,functionName:o==="submit"?"submit":"revoke",args:[l]}),k=`${o} ${r.abi.name} on ${m}; ordered values ${JSON.stringify(i.values)}. ${r.abi.name==="abdicate"?"Abdication is irreversible.":""}`,h=[a.unsignedTx({to:m,data:$,value:"0",chainId:u,description:k})],v=await a.preview(h,c);return{txs:h,preview:v,summary:`${k} ${v.summary} ${o==="submit"?"Submission schedules this exact operation; it does not execute the configuration change.":"Role, cap and timing checks can change before execution."}`}}catch(r){throw new n(a.plainError(r))}}}}export{S as a,M as b,V as c};
@@ -0,0 +1 @@
1
+ import{i as s,j as h,k as p,m as E,n as C,p as T,r as O,v as w,y as L}from"./QJNLLI6N.js";import{b as P,c as I,e as k,g as S}from"./NWNYJ26T.js";import{a as $}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{a as D}from"./JXOEJPJ4.js";import{getAddress as R}from"viem";var u={type:"integer",minimum:1},l={type:"string",minLength:1,maxLength:512},_={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},g={type:"integer",minimum:1,maximum:100},v={limit:{...g,description:"Maximum number of results."},cursor:{...l,description:"Continuation cursor from a previous page."}},M={relay_chain_health:"Read Relay service health. chainId is required.",relay_requests:"Page this wallet\u2019s requests. Requires server OAK_RELAY_API_KEY; the wallet filter is automatic. Optional id, chain and status filters narrow results.",relay_balance_events:"Page this wallet\u2019s balance events. Requires server OAK_RELAY_API_KEY with access to this resource.",relay_exchange_rates:"Read reference rates without a freshness guarantee. Relay may be unavailable; use relay_token_price for an individual token."};function q(n,r){if(r.type==="string"){if(typeof n!="string"||n.length<Number(r.minLength??0)||n.length>Number(r.maxLength??1024)||typeof r.pattern=="string"&&!new RegExp(r.pattern).test(n))throw new d("Provide a valid Relay search, address or cursor.")}else if(r.type==="integer"){if(typeof n!="number"||!Number.isSafeInteger(n)||n<Number(r.minimum??0)||n>Number(r.maximum??Number.MAX_SAFE_INTEGER))throw new d("Provide an integer within the Relay parameter bounds.")}else{if(r.type==="boolean"&&typeof n!="boolean")throw new d("Provide a boolean Relay filter.");if(r.type==="array"){if(!Array.isArray(n)||n.length>100)throw new d("Provide at most 100 Relay search values.");for(let i of n)q(i,s(r.items))}}if(Array.isArray(r.enum)&&!r.enum.includes(n))throw new d("Choose a supported Relay filter.")}function y(n){return new URLSearchParams(Object.entries(n).map(([r,i])=>[r==="cursor"?"continuation":r,String(i)])).toString()}function x(n){if(n!=null)return q(n,l),n}function m(n){return typeof n=="string"?P.test(n)?R(n.toLowerCase()):/^(?:0x[0-9a-fA-F]{64}|-?\d+(?:\.\d+)?)$/.test(n)?n:D(n):Array.isArray(n)?n.map(m):k(n)?Object.fromEntries(Object.entries(n).filter(([r])=>!/api.?key|signature|authorization|secret/i.test(r)).map(([r,i])=>[r,m(i)])):n}function A(n){return h(n).map(r=>{let i=s(r),e=i.decimals;if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255||typeof i.address!="string")throw new d("Relay returned invalid currency metadata.");let t=i.vmType===void 0||i.vmType==="evm";return{chainId:E(i.chainId),address:t?R(p(i.address)):D(i.address),symbol:w(i.symbol)??"unknown",decimals:e,vmType:w(i.vmType),verified:k(i.metadata)&&i.metadata.verified===!0}})}var B=["relay_vault_status","relay_currencies","relay_token_price","relay_currency_classifications","relay_liquidity","relay_swap_sources","relay_requests","relay_app_fee_balance","relay_app_fee_claims","relay_balance_events","relay_deposit_address","relay_recovery_balances","relay_withdrawal_status","relay_chain_health","relay_token_details","relay_token_chart","relay_trending","relay_exchange_rates","relay_protocol_execution"],X=n=>{let r=L(n);function i(e,t,a,o){return{name:e,inputSchema:{type:"object",...M[e]?{description:M[e]}:{},additionalProperties:!1,properties:t,required:a},execute:async(c,b)=>{for(let f of a)if(c[f]===void 0)throw new d(`Provide ${f} for ${e}.`);for(let[f,j]of Object.entries(c)){if(!Object.hasOwn(t,f))throw new d(`Unsupported ${e} parameter ${f}.`);q(j,t[f])}return o(c,p(b))}}}return{tools:[i("relay_chain_health",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/health?${y(e)}`));if(typeof t.healthy!="boolean")throw new d("Relay returned invalid chain health.");return{healthy:t.healthy,chainId:e.chainId}}),i("relay_token_details",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}`));if(t.chainId!==e.chainId||p(t.address)!==p(e.address))throw new d("Relay returned another token.");return{token:A([t])[0],data:m(t)}}),i("relay_token_chart",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."},timeframe:{type:"string",enum:["5M","1H","4H","24H","7D","30D","MAX"],description:"Chart period: 5M = 5 minutes, 1H = 1 hour, 4H = 4 hours, 24H = 1 day, 7D = 7 days, 30D = 30 days, MAX = all history."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}/chart?${y(e.timeframe===void 0?{}:{timeframe:e.timeframe})}`));return{chainId:e.chainId,address:R(p(e.address)),data:m(t),summary:"Relay historical market data. Chart prices and volumes are not token base-unit balances."}}),i("relay_trending",{chainId:{...u,description:"Chain ID."},limit:{...g,maximum:20,description:"Maximum number of results, from 1 to 20."},sortBy:{type:"string",enum:["relay24hBuyTxCount","relay24hBuyUsdVolume","coingecko6hTrending"],description:"Sort by 24-hour buy count, 24-hour USD volume, or six-hour CoinGecko trending."}},[],async e=>({currencies:A(await r(`/currencies/trending?${y(e)}`))})),i("relay_exchange_rates",{},[],async()=>({rates:m(s(await r("/prices/rates"))),summary:"Relay reference rates; timestamps are not supplied. These are prices, not token base-unit amounts."})),i("relay_protocol_execution",{id:{..._,description:"Protocol execution idempotency key as a 0x-prefixed 32-byte hex string."}},["id"],async e=>{let t=s(await r(`/protocol/executions/${e.id}`)),a=s(t.execution);if(!S(T(a.idempotencyKey),String(e.id)))throw new d("Relay returned another protocol execution.");return{data:m(t),summary:"Oracle execution status only; this does not prove a destination bridge fill."}}),i("relay_currencies",{chainIds:{type:"array",items:u,description:"Chain IDs to search."},term:{...l,maxLength:256,description:"Token search term."},address:{...l,description:"Token address filter."},currencyId:{...l,description:"Relay currency ID filter."},symbol:{...l,description:"Token symbol filter."},groupID:{...l,description:"Relay currency group ID filter."},tokens:{type:"array",items:l,description:"Token identifiers to filter."},verified:{type:"boolean",description:"Filter by Relay verification status."},defaultList:{type:"boolean",description:"Filter by Relay default-list status."},includeAllChains:{type:"boolean",description:"Include currencies on all chains."},useExternalSearch:{type:"boolean",description:"Include external search results."},depositAddressOnly:{type:"boolean",description:"Include only deposit-address currencies."},limit:{...g,description:"Maximum number of results."}},[],async e=>({currencies:A(await r("/currencies/v2",{chainIds:[$],...e})),summary:"Relay currency search. Provider verification is not an Oak token endorsement; obtain a quote to check route availability."})),i("relay_token_price",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/currencies/token/price/v2?${y(e)}`));if(typeof t.price!="string"||!/^\d+(?:\.\d+)?$/.test(t.price))throw new d("Relay returned an invalid USD price.");return{chainId:e.chainId,address:R(p(e.address)),priceUsd:t.price,summary:"Relay USD price; freshness is not supplied by this endpoint."}}),i("relay_currency_classifications",{},[],async()=>{let e=s(await r("/currencies/classifications"));return{major:h(e.major).map(t=>w(t)??"unknown"),stable:h(e.stable).map(t=>w(t)??"unknown")}}),i("relay_liquidity",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/liquidity?${y(e)}`));return{liquidity:h(t.liquidity).map(a=>{let o=s(a);if(o.chainId!==e.chainId)throw new d("Relay liquidity chain does not match the request.");return{...A([o])[0],amount:C(o.balance)}}),summary:"Relay solver balances are indicative capacity, not a reserved route or user funds."}}),i("relay_swap_sources",{chainId:{...u,description:"Chain ID."}},[],async e=>({sources:h(s(await r(`/swap-sources?${y(e)}`)).sources).map(t=>w(t,"name")??"unknown")})),i("relay_requests",{...v,originChainId:{...u,description:"Origin chain ID filter."},destinationChainId:{...u,description:"Destination chain ID filter."},chainId:{...u,description:"Chain ID."},id:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},orderId:{..._,description:"Relay order ID as a 0x-prefixed 32-byte hex string."},depositTxHash:{..._,description:"Deposit transaction hash as a 0x-prefixed 32-byte hex string."},fillTxHash:{..._,description:"Fill transaction hash as a 0x-prefixed 32-byte hex string."},refundTxHash:{..._,description:"Refund transaction hash as a 0x-prefixed 32-byte hex string."},status:{type:"string",enum:["success","failure","refund","pending","depositing"],description:"Filter by success, failure, refund, pending or depositing status."},includeChildRequests:{type:"boolean",description:"Include child requests."}},[],async(e,t)=>{let a=s(await r(`/requests/v3?${y({...e,user:t,includePendingRequests:!0})}`)),o=h(a.requests).map(s);for(let c of o){let b=k(c.depositAddress)?c.depositAddress.depositor:void 0;if(![c.user,c.sender,b].some(f=>typeof f=="string"&&f.toLowerCase()===t))throw new d("Relay returned a request for another wallet.");T(c.id)}return{requests:m(o),nextCursor:x(a.continuation),summary:"One page of this wallet\u2019s Relay requests, including pending requests. Pass nextCursor as cursor to resume; provider success is not destination receipt verification."}}),i("relay_app_fee_balance",{},[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/balances`));return{balances:h(a.balances).map(o=>{let c=O(o);return{...c,token:{...c.token,address:R(c.token.address),symbol:w(c.token.symbol)??"unknown"}}}),summary:"Off-chain Relay app fee credits for this wallet. Claiming requires separate local signature integration."}}),i("relay_app_fee_claims",v,[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/claims?${y(e)}`)),o=h(a.claims).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a fee claim for another wallet.");return{claims:m(o),nextCursor:x(a.continuation)}}),i("relay_balance_events",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},requestId:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},chainId:{...u,description:"Chain ID."},currency:{...I,description:"Token address filter."},startTimestamp:{type:"integer",minimum:0,description:"Start time in Unix seconds."},endTimestamp:{type:"integer",minimum:0,description:"End time in Unix seconds."},type:{...l,description:"Balance event type filter."}},[],async(e,t)=>{let a=s(await r(`/balance/${t}/events?${y(e)}`));if(p(a.wallet)!==t)throw new d("Relay returned balance events for another wallet.");let o=h(a.events).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a balance event for another wallet.");return{events:m(o),nextCursor:x(a.continuation)}}),i("relay_deposit_address",{address:{...l,description:"Deposit address to look up; supply this or depositAddressId."},depositAddressId:{...l,description:"Relay deposit address ID; supply this or address."},pageSize:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},pageToken:{...l,description:"Page token from a previous response."}},[],async e=>{if(e.address===void 0==(e.depositAddressId===void 0))throw new d("Provide exactly one deposit address or depositAddressId.");let t=s(await r(`/deposit-addresses/v2?${y(e)}`)),a=s(t.data),o=s(a.depositAddress);if(e.address!==void 0&&o.address!==e.address||e.depositAddressId!==void 0&&o.id!==e.depositAddressId)throw new d("Relay returned another deposit address.");return{data:m(a),nextPageToken:x(a.nextPageToken),summary:"Deposit address monitoring only. Reading an address does not create, change, fund or recover it."}}),i("relay_recovery_balances",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},ownerChainId:{...u,description:"Recovery owner chain ID."}},["ownerChainId"],async(e,t)=>{let a=s(await r(`/withdrawals/balances?${y({...e,recoveryAddress:t})}`)),o=h(a.balances).map(c=>{let b=s(c);return C(b.amount),b});return{balances:m(o),nextCursor:x(a.continuation),summary:"Credited recovery balances only. Empty balances do not prove that an unattested deposit has no recoverable funds. Withdrawal signing remains a separate action."}}),i("relay_withdrawal_status",{id:{...l,description:"Relay withdrawal job ID."}},["id"],async e=>{let t=s(await r(`/withdrawals/status?${y(e)}`));if(typeof t.status!="string")throw new d("Relay returned an invalid withdrawal status.");return{status:w(t.status)??"unknown",data:m(t),summary:"Relay withdrawal job status; verify any reported transaction on its chain before treating funds as received."}})]}};export{B as a,X as b};
@@ -0,0 +1 @@
1
+ import{a as r}from"./4TTDAF4B.js";import{a}from"./3CH2IPQL.js";import{isAddress as h}from"viem";function u(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new r;return e}function w(e){if(typeof e!="string"||!e.length)throw new r;return e}function f(e){if(typeof e!="string"||!h(e,{strict:!1}))throw new r;return e}function p(e,o){let n=u(e);if(n.x402Version!==o||!Array.isArray(n.accepts)||n.accepts.length!==1)throw new r;let t=u(n.accepts[0]),i=u(t.extra);if(t.scheme!=="exact"||t.network!==(o===1?"robinhood":"eip155:4663"))throw new r;let c=w(o===1?t.maxAmountRequired:t.amount);if(!/^[1-9][0-9]*$/.test(c)||typeof t.maxTimeoutSeconds!="number"||!Number.isInteger(t.maxTimeoutSeconds))throw new r;return{x402Version:o,terms:{scheme:"exact",network:"eip155:4663",amount:c,asset:f(t.asset),payTo:f(t.payTo),maxTimeoutSeconds:t.maxTimeoutSeconds,resourceUrl:w(o===1?t.resource:u(n.resource).url),extra:{name:w(i.name),version:w(i.version)}}}}function d(e,o){try{if(typeof o!="string"||!o.length||o.length>32768||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(o))throw new r;let n=Buffer.from(o,"base64"),t=n.toString("utf8");if(!Buffer.from(t,"utf8").equals(n))throw new r;let i=p(e,1),c=p(JSON.parse(t),2),s=i.terms,m=c.terms;if(s.scheme!==m.scheme||s.network!==m.network||s.amount!==m.amount||s.asset!==m.asset||s.payTo!==m.payTo||s.maxTimeoutSeconds!==m.maxTimeoutSeconds||s.resourceUrl!==m.resourceUrl||s.extra.name!==m.extra.name||s.extra.version!==m.extra.version)throw new r;return{v1:i,v2:c,terms:s}}catch{throw new r}}function x(e){if(typeof e!="number"||!Number.isInteger(e)||e<1||e>50)throw new Error("Use whole dollars from 1 to 50.");return(BigInt(e)*1000000n).toString()}function l(e,o){try{let n=x(o);if(e.scheme!=="exact"||e.network!=="eip155:4663"||e.amount!==n||f(e.asset).toLowerCase()!==a.usdg.toLowerCase()||f(e.payTo).toLowerCase()!==a.payTo.toLowerCase()||!Number.isInteger(e.maxTimeoutSeconds)||e.maxTimeoutSeconds<60||e.maxTimeoutSeconds>300||e.resourceUrl!==`${a.apiOrigin}${a.topupPath}?usd=${o}`||e.extra.name!==a.usdgDomain.name||e.extra.version!==a.usdgDomain.version)throw new r}catch{throw new r}}export{d as a,x as b,l as c};
@@ -0,0 +1 @@
1
+ import{a as f,b as T,f as c,g as v,i as E}from"./PV5FDT6O.js";import{c as a,g as O}from"./NWNYJ26T.js";import{a as m}from"./FWD4L3CJ.js";import{a as s}from"./XSD5NL7J.js";import{encodeFunctionData as $,parseAbi as x}from"viem";var F=["function owner() view returns (address)","function admins(address) view returns (bool)","function allowedDepositors(address) view returns (bool)","function setAdmin(address,bool)","function setDeprecated(bool)","function setTeamFeeRecipient(address)","function claimTeamFees(address)","function setHook(address,bool)","function setLocker(address,address,bool)","function setMevModule(address,bool)","function setExtension(address,bool)","function addDepositor(address)","function storeFees(address,address,uint256)","function claim(address,address)","function withdrawETH(address)","function withdrawERC20(address,address)","function transferOwnership(address)","function renounceOwnership()"],h=x(F),g={setAdmin:{contract:"factory",fields:["target","enabled"],admin:!1},setDeprecated:{contract:"factory",fields:["enabled"],admin:!1},setTeamFeeRecipient:{contract:"factory",fields:["recipient"],admin:!1},claimTeamFees:{contract:"factory",fields:["token"],admin:!0},setHook:{contract:"factory",fields:["target","enabled"],admin:!0},setLocker:{contract:"factory",fields:["target","hook","enabled"],admin:!0},setMevModule:{contract:"factory",fields:["target","enabled"],admin:!0},setExtension:{contract:"factory",fields:["target","enabled"],admin:!0},addDepositor:{contract:"fee_locker",fields:["target"],admin:!1},withdrawETH:{contract:"locker",fields:["recipient"],admin:!1},withdrawERC20:{contract:"locker",fields:["token","recipient"],admin:!1}},N=p=>{let w=()=>p.clientFor(m),k=async(e,t,o)=>({txs:e,preview:await p.preview(e,t),summary:o}),y=(e,t,o,r)=>p.unsignedTx({to:e,chainId:m,data:$({abi:h,functionName:t,args:o}),value:"0",description:r}),_={operation:{enum:[...Object.keys(g),"transferOwnership","renounceOwnership"],description:"Owner or admin call on a pinned Clanker contract: toggle admins, hooks, lockers, MEV modules, extensions or depositors, claim team fees, withdraw assets, or change ownership."},contract:{enum:["factory","locker","fee_locker"],description:"Which pinned Clanker contract to call; required only for transferOwnership and renounceOwnership, otherwise implied by the operation."},target:{...a,description:"Address of the admin, hook, locker, MEV module, extension or depositor being configured."},hook:{...a,description:"Address of the pool hook the locker is enabled for; used by setLocker."},token:{...a,description:"Address of the ERC-20 token to claim team fees on or withdraw."},recipient:{...a,description:"Address that receives funds, the new fee recipient, or the new owner, depending on the operation."},enabled:{type:"boolean",description:"True to enable (or deprecate, for setDeprecated) the target; false to disable."}},b=(e,t,o,r)=>({name:`clanker_${e}`,inputSchema:{type:"object",properties:t,required:o,additionalProperties:!1},execute:async(n,i)=>{try{return E(n,Object.keys(t)),await r(n,c(i))}catch(d){throw new s(p.plainError(d))}}});return{tools:[b("protocol_admin",_,["operation"],async(e,t)=>{let o=String(e.operation),r=o==="transferOwnership"||o==="renounceOwnership";if(!r&&!Object.hasOwn(g,o))throw new s("Choose a supported Clanker protocol operation.");let n=r?void 0:g[o],i=n?.contract??e.contract;if(i!=="factory"&&i!=="locker"&&i!=="fee_locker")throw new s("Select factory, locker or fee_locker for an ownership change.");if(!r&&e.contract!==void 0&&e.contract!==i)throw new s("This operation targets a different pinned contract.");let d=n?.fields??(o==="transferOwnership"?["recipient"]:[]);for(let l of["target","hook","token","recipient","enabled"])if(e[l]!==void 0&&!d.includes(l))throw new s(`Input ${l} does not match this protocol operation.`);let u=f[i].address,D=c(await w().readContract({address:u,abi:h,functionName:"owner"}),!0);if(!O(D,t)&&(n?.admin&&await w().readContract({address:u,abi:h,functionName:"admins",args:[t]}))!==!0)throw new s("The connected wallet lacks the required Clanker protocol owner/admin role.");let A=d.map(l=>{if(l!=="enabled")return c(e[l]);if(typeof e.enabled!="boolean")throw new s("Provide enabled as boolean.");return e.enabled}),C=`Clanker protocol ${i}: ${o} ${JSON.stringify(A)}. Owner/admin operation; renouncing ownership permanently removes owner-only controls. Withdrawals transfer the entire recorded asset balance; team fees go to the configured team recipient.`;return k([y(u,o,A,C)],t,C)}),b("store_fees",{token:{...a,description:"Address of the ERC-20 token whose fees are deposited."},recipient:{...a,description:"Address of the fee owner who can later claim these fees."},amount:{...T,description:'Amount of the token to deposit, in base units of that token (read its decimals). Example: "1000000000000000000" = 1 token at 18 decimals.'}},["token","recipient","amount"],async(e,t)=>{let o=c(e.token),r=c(e.recipient),n=v(e.amount);if(!n)throw new s("Provide a positive fee deposit amount.");if(await w().readContract({address:f.fee_locker.address,abi:h,functionName:"allowedDepositors",args:[t]})!==!0)throw new s("This wallet is not an authorized Clanker fee depositor.");let d=`Deposit exactly ${n} base units of token ${o} into Clanker fees for ${r}. Fee-on-transfer receipts may be smaller; the recorded recipient can later claim them.`,u=[p.approval(o,f.fee_locker.address,n.toString(),m),y(f.fee_locker.address,"storeFees",[r,o,n],d)];return k(u,t,d)}),b("claim_for",{token:{...a,description:"Address of the fee token to claim for the owner."},recipient:{...a,description:"Address of the fee owner whose collected fees are claimed; receipts go to this address."}},["token","recipient"],async(e,t)=>{let o=c(e.token),r=c(e.recipient),n=`Permissionlessly claim already-collected Clanker ${o} fees for ${r}; all receipts go to that fee owner, while ${t} pays gas.`;return k([y(f.fee_locker.address,"claim",[r,o],n)],t,n)})]}};export{N as a};
@@ -0,0 +1 @@
1
+ import{B as se,t as W,y as G}from"./BAIY32AV.js";import{d as ke}from"./XYPGLG6A.js";import{a as de,b as oe,c as pe,e as ne,f as ye,g as fe,h as K,i as b,j as g,l as _,m as U,o as N,p as B,q,s as V,u as $,v as D}from"./2E4I7CJ7.js";import{b as X,g as O,h as E,i as ue,j as me}from"./MQK6OP7S.js";import{a as j}from"./G2LAO23N.js";import{c as ee}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";import{encodeAbiParameters as Oe,getAddress as we,keccak256 as Ke,parseAbi as je,toHex as ce,zeroAddress as ze}from"viem";import{encodeAbiParameters as he,encodePacked as Ce,getAddress as Fe,keccak256 as re,parseAbi as Le,toHex as Re,zeroAddress as be}from"viem";var ve=1n<<256n,Ne=1n<<128n,Te=Le(["function extsload(bytes32[] slots) view returns (bytes32[])"]),Q=(o,n,e)=>({type:"object",additionalProperties:!1,properties:o,required:n,...e===void 0?{}:{description:e}}),Ue={description:"Hookr LP position, chosen by kind: a launcher family member, a position NFT, or an agent-account position.",oneOf:[Q({kind:{const:"family",description:j.enumValues({family:"one member position of a Hookr launcher family"})},launcher:{...ee,description:"Address of the Hookr launcher contract that created the family."},familyId:{...oe,description:"Bytes32 hex id of the launcher family (0x plus 64 hex digits)."},member:{type:"string",enum:["0","1","2","3","4","5","6","7"],description:'Member index within the family, a decimal string from "0" to "7".'}},["kind","launcher","familyId","member"],"Hookr family LP position: one member of a launcher family, identified by launcher, familyId and member."),Q({kind:{const:"nft",description:j.enumValues({nft:"a position held as an NFT"})},tokenId:{...de,description:j.id("position NFT")}},["kind","tokenId"]),Q({kind:{const:"agent-account",description:j.enumValues({"agent-account":"a position held by an agent account"})},account:{...ee,description:j.address("agent account that holds the position")},positionId:{...oe,description:"Bytes32 hex id of the position within the agent account (0x plus 64 hex digits)."}},["kind","account","positionId"])]};function qe(o){let n=U(o);if(n.kind!=="family")throw new i("This step supports Launcher family positions only. NFT and agent-account position reads are reserved for a later integration.");ne(n,["kind","launcher","familyId","member"],["kind","launcher","familyId","member"]);let e=ye(n.member,8);if(e>7n)throw new i("Hookr family member must be a decimal string from 0 to 7.");return{kind:"family",launcher:me(n.launcher),familyId:K(n.familyId),member:e.toString()}}var A=o=>Re(BigInt.asUintN(256,o),{size:32}),te=(o,n)=>re(he([{type:"bytes32"},{type:"bytes32"}],[o,n]));function ie(o,n,e,a,r,H){let h=te(o,A(6n)),P=m=>te(A(BigInt(m)),A(BigInt(h)+4n)),p=re(he([{type:"bytes32"},{type:"uint8"}],[e,a])),c=re(Ce(["address","int24","int24","bytes32"],[n,r,H,p])),u=te(c,A(BigInt(h)+6n));return[h,A(BigInt(h)+1n),A(BigInt(h)+2n),A(BigInt(P(r))+1n),A(BigInt(P(r))+2n),A(BigInt(P(H))+1n),A(BigInt(P(H))+2n),u,A(BigInt(u)+1n),A(BigInt(u)+2n)]}function J(o,n,e,a,r,H){return BigInt.asUintN(256,a<r?n-e:a>=H?e-n:o-n-e)}function Y(o,n,e){if(o<0n||o>=1n<<128n||[n,e].some(a=>a<0n||a>=ve))throw new i("Hookr fee inputs are outside the verified v4 layout.");return o*BigInt.asUintN(256,n-e)/Ne}function ae(o){let n=U(o),e={currency0:b(n.currency0),currency1:b(n.currency1),fee:Number(g(n.fee,24)),tickSpacing:Number(g(n.tickSpacing,24)),hooks:b(n.hooks)};if(BigInt(e.currency0)>=BigInt(e.currency1)||e.fee!==8388608||e.hooks!==q||e.tickSpacing<1||e.tickSpacing>32767)throw new i("Hookr family PoolKey is not a supported Root dynamic-fee pool.");return e}async function Ve(o,n,e,a){let r=await E(o,a),H={},h=new Set,P=(t,k=[])=>B(o,e.launcher,N(e.launcher===Fe(X.launcherV1)?"launcherV1":"launcher"),t,k,r.number),p=async(t,k)=>{try{return await k()}catch(x){return H[t]=x instanceof i?x.message:`Hookr ${t} read failed at block ${r.number}. Retry the named-block read; no zero or empty result is implied.`,null}},c={chainId:4663,blockNumber:r.number.toString(),blockHash:r.hash,position:e,owner:null,ownedByWallet:null,poolId:null,poolKey:null,range:null,liquidity:null,tokens:null,principal:null,uncollectedLpFees:null,collectedLpFees:null,claimableCoreCredits:null,poolPendingRecapture:null,inRange:null,gateStatus:null,locks:null},u=async()=>(await ue(o,r),{...c,readStatus:{status:Object.keys(H).length?"partial":"complete",reasons:H},warnings:["collectedLpFees is null: no complete collection-history reconstruction is available in this step.","LP fees can include donations already released into v4 fee growth. Pending recapture is pool-level, unallocated and excluded from LP fees.","Principal is current withdrawable token inventory before fees, gas or price changes; it is not the original deposit value."]});if(await p("pins",async()=>(await O(o,r.number,[e.launcher,q,V],h),!0))===null)return u();let m=await p("owner",async()=>{let t=b(await P("familyOwner",[e.familyId]));if(t===be)throw new i("Hookr family does not exist at this block. Check its Launcher and family ID.");return t});if(m===null)return u();c.owner=m,c.ownedByWallet=m===n;let R=await p("position",async()=>{let[t,k,x]=await Promise.all([P("memberCount",[e.familyId]),P("position",[e.familyId,Number(e.member)]),P("poolManager")]);if(x!==V||g(t,8)>8n||BigInt(e.member)>=g(t,8))throw new i("Hookr family member or PoolManager is invalid.");let w=U(k),d=ae(w.key);if(typeof w.tickLower!="number"||typeof w.tickUpper!="number")throw new i("Hookr position range is incomplete.");G(w.tickLower,w.tickUpper,d.tickSpacing);let s=g(w.liquidity,128),L=W(d);if(await P("poolFamily",[L])!==e.familyId)throw new i("Hookr pool does not belong to this family.");return{key:d,id:L,tickLower:w.tickLower,tickUpper:w.tickUpper,liquidity:s}});if(R===null)return u();let{key:l,id:y,tickLower:C,tickUpper:I,liquidity:v}=R;c.poolKey=l,c.poolId=y,c.range={tickLower:C,tickUpper:I},c.liquidity=v.toString();let[f,T,F]=await Promise.all([p("tokens",()=>Promise.all([D(o,l.currency0,r.number),D(o,l.currency1,r.number)])),p("feeGrowth",async()=>{let t=ie(y,e.launcher,e.familyId,Number(e.member),C,I),k=await B(o,V,Te,"extsload",[t],r.number),x=_(k,10).map(Ae=>BigInt(K(Ae))),[w,d,s,L,Z,S,z,Ie,xe,He]=x,le=w&(1n<<160n)-1n,M=Number(BigInt.asIntN(24,w>>160n));if(le===0n||M<-887272||M>887272||Ie!==v)throw new i("Hookr PoolManager position is uninitialized or differs from the Launcher liquidity. No principal or fee amount is inferred.");let Se=J(d,L,S,M,C,I),Be=J(s,Z,z,M,C,I);return{sqrtPriceX96:le,tick:M,fee0:Y(v,Se,xe),fee1:Y(v,Be,He)}}),p("poolConfig",async()=>{let t=U(await B(o,q,N("rootV1"),"poolConfig",[y],r.number));if(b(t.liquidityOwner)!==e.launcher||![l.currency0,l.currency1].includes(b(t.subject))||![l.currency0,l.currency1].includes(b(t.quote))||t.subject===t.quote)throw new i("Hookr pool configuration differs from this family position.");let k=b(t.rules),x=$(k);return await O(o,r.number,[k],h),{pc:t,core:k,role:x}})]);if(c.tokens=f,T&&(c.inRange=T.tick>=C&&T.tick<I,f)){let t=se({liquidity:v,tickLower:C,tickUpper:I,sqrtPriceX96:T.sqrtPriceX96});c.principal=[{token:f[0],amount:t.amount0.toString()},{token:f[1],amount:t.amount1.toString()}],c.uncollectedLpFees=[{token:f[0],amount:T.fee0.toString()},{token:f[1],amount:T.fee1.toString()}]}if(F){let t=(s,L=[])=>B(o,F.core,N("rulesV1"),s,L,r.number),[k,x,w,d]=await Promise.all([p("gateStatus",async()=>{let s=b(F.pc.advisory);return s!==be&&await O(o,r.number,[s],h),ke(o,r.number,y,e.launcher,s)}),p("locks",async()=>ge(o,{position:e,block:r,poolId:y,core:F.core,role:F.role})),p("claimableCoreCredits",async()=>{if(!f)throw new i("Read token metadata before displaying core credits.");let s=await t("poolAccruedCurrencies",[y]);if(!Array.isArray(s)||s.length>32||s.some(S=>S!==l.currency0&&S!==l.currency1))throw new i("Core accrual includes unmeasured currencies; read the core directly before collecting.");let[L,Z]=await Promise.all([Promise.all([l.currency0,l.currency1].map(S=>t("poolAccrued",[y,S]))),Promise.all([l.currency0,l.currency1].map(S=>B(o,F.core,N(F.role),"claimable",[S,n],r.number)))]);return{core:F.core,familyOwnerAccrual:L.map((S,z)=>({token:f[z],amount:g(S).toString()})),walletCredits:Z.map((S,z)=>({token:f[z],amount:g(S).toString()})),walletCreditsScope:"Core-wide wallet credits, not attributed to this position. Do not add them to LP fees."}}),p("poolPendingRecapture",async()=>{if(!f)throw new i("Read token metadata before displaying pending recapture.");let s=_(await t("pendingDonation",[y]),5).map(L=>g(L));return{due:[{token:f[0],amount:s[0].toString()},{token:f[1],amount:s[1].toString()}],fresh:[{token:f[0],amount:s[2].toString()},{token:f[1],amount:s[3].toString()}],freshChildBlock:s[4].toString(),scope:"pool",allocatedToPosition:!1}})]);c.gateStatus=k,c.locks=x,c.claimableCoreCredits=w,c.poolPendingRecapture=d}return u()}function Ze(o){return[{name:"hookr_lp_position",inputSchema:Q({position:Ue,...pe},["position"]),execute:async(n,e)=>{ne(n,["position","blockNumber"],["position"]);let a=qe(n.position);if(o.network==="testnet")throw new i("Hookr LP reads are configured only on mainnet, chain 4663.");try{return await Ve(o.clientFor(4663),e,a,fe(n))}catch(r){throw r instanceof i?r:new i("Hookr position block is unavailable. Retry the complete named-block read; no zero position or fee is implied.")}}}]}var Pe=o=>N(o.launcher===we(X.launcherV1)?"launcherV1":"launcher");function Me(o){let n=Ke(Oe([{type:"bytes32"},{type:"bytes32"}],[o,"0x3c0d3d8cba92527b3a48aa783c8734a4e170057eb16401c9df8a7c8a6588b900"]));return ce(BigInt(n)+5n,{size:32})}async function _e(o,n){try{let e="0x0000000000000000000000000000000000000a11",a=await o.request({method:"eth_call",params:[{to:e,data:"0x"},ce(n.number),{[e]:{code:"0x4360005260206000f3"}}]});return BigInt(K(a))}catch{throw new i("Hookr parent-block clock is unavailable. Retry with an RPC supporting named-block eth_call state overrides; child-chain height cannot establish lock expiry.")}}async function co(o,n,e){let a=await E(o);await O(o,a.number,[e.launcher,q,V]);let r=(d,s=[])=>B(o,e.launcher,Pe(e),d,s,a.number),[H,h,P,p]=await Promise.all([r("familyOwner",[e.familyId]),r("memberCount",[e.familyId]),r("position",[e.familyId,Number(e.member)]),r("poolManager")]),c=b(H);if(c===ze||c!==n)throw new i("Only the current Hookr family owner can add, collect or remove this position. Use its signing wallet.");if(p!==V||g(h,8)<1n||g(h,8)>8n||BigInt(e.member)>=g(h,8))throw new i("Hookr family member or PoolManager differs from the reviewed deployment.");let u=U(P),m=ae(u.key),R=g(u.liquidity,128);if(typeof u.tickLower!="number"||typeof u.tickUpper!="number")throw new i("Hookr family range is unavailable.");let l=u.tickLower,y=u.tickUpper;G(l,y,m.tickSpacing);let C=W(m);if(await r("poolFamily",[C])!==e.familyId)throw new i("Hookr pool does not belong to this Launcher family.");let I=U(await B(o,q,N("rootV1"),"poolConfig",[C],a.number)),v=b(I.rules),f=$(v);if(b(I.liquidityOwner)!==e.launcher||![m.currency0,m.currency1].includes(b(I.subject))||![m.currency0,m.currency1].includes(b(I.quote))||I.subject===I.quote)throw new i("Hookr pool configuration differs from this family key.");await O(o,a.number,[v]);let[T,F]=await Promise.all([Promise.all([m.currency0,m.currency1].map(d=>D(o,d,a.number))),B(o,V,je(["function extsload(bytes32[] slots) view returns (bytes32[])"]),"extsload",[ie(C,e.launcher,e.familyId,Number(e.member),l,y)],a.number)]),t=_(F,10).map(d=>BigInt(K(d))),k=t[0]&(1n<<160n)-1n,x=Number(BigInt.asIntN(24,t[0]>>160n));if(!k||x<-887272||x>887272||t[7]!==R)throw new i("Hookr PoolManager state differs from the family position. Retry the full read.");let w=[0,1].map(d=>Y(R,J(t[1+d],t[3+d],t[5+d],x,l,y),t[8+d]));return{position:e,block:a,owner:c,key:m,poolId:C,liquidity:R,tickLower:l,tickUpper:y,sqrtPriceX96:k,fees:w,tokens:T,pc:I,core:v,role:f}}async function ge(o,n){let{position:e,block:a,poolId:r,core:H,role:h}=n,[P,p,c,u]=await Promise.all([B(o,e.launcher,Pe(e),"principalLockedUntil",[e.familyId],a.number),B(o,H,N(h),"removalLockedUntil",[r],a.number),o.getStorageAt({address:q,slot:Me(r),blockNumber:a.number}),_e(o,a)]),m=BigInt(K(c));if(we(ce(m&(1n<<160n)-1n,{size:20}))!==e.launcher)throw new i("Hookr frozen Root lock storage does not match the family owner contract.");let R=m>>160n&(1n<<40n)-1n,l=g(P),y=g(p);return{clock:"parent-block",parentBlock:u.toString(),familyUntilParentBlock:l.toString(),poolRulesUntilParentBlock:y.toString(),rootUntilParentBlock:R.toString(),currentlyLocked:u<l||u<y||u<R,feesCollectableDuringPrincipalLocks:!0}}export{Pe as a,Me as b,_e as c,co as d,ge as e,Ue as f,qe as g,ie as h,J as i,Y as j,ae as k,Ve as l,Ze as m};
@@ -1 +1 @@
1
- import{ca as S}from"./6PBGEPUK.js";import{a as d}from"./E3RACZUY.js";import{h as c,i as R,l as N,m as x}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{erc20Abi as y,isHex as O,keccak256 as _,parseAbi as z}from"viem";var b=z(["function asset() view returns (address)","function decimals() view returns (uint8)","function symbol() view returns (string)","function owner() view returns (address)","function curator() view returns (address)","function adaptersLength() view returns (uint256)","function adapters(uint256) view returns (address)","function parentVault() view returns (address)","function isVaultV2(address) view returns (bool)","function totalAssets() view returns (uint256)","function totalSupply() view returns (uint256)","function convertToAssets(uint256) view returns (uint256)","function previewDeposit(uint256) view returns (uint256)","function performanceFee() view returns (uint256)","function getThreshold() view returns (uint256)","function getOwners() view returns (address[])"]),i=S("setup-mismatch",{}),m=e=>N(R(e,i),i),k=e=>x(e,i);function v(e){if(typeof e!="string"||!O(e,{strict:!0})||e.length<4||e.length%2!==0)throw new n(i);return _(e)}function V(e){if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255)throw new n(i);return e}function I(e,t){return typeof e=="string"&&/^[A-Za-z0-9.$_-]{1,32}$/.test(e)?e:t}async function P(e,t){if(await e.getChainId()!==d.chainId)throw new n("Borro requires chain 4663.");return k(t??await e.getBlockNumber({cacheTime:0}))}async function B(e,t,f){let a=(r,s,p=[])=>e.readContract({address:r,abi:b,functionName:s,args:p,blockNumber:f}),o={ok:!0,drift:[]};for(let r of["owner","curator"])try{o[r]=m(await a(t,r)),c(o[r],d[r])||o.drift.push(r)}catch{o.drift.push(`${r} unreadable`)}try{let r=k(await a(t,"adaptersLength"));if(r>64n)throw new n(i);let s=await Promise.all(Array.from({length:Number(r)},async(p,u)=>{let h=m(await a(t,"adapters",[BigInt(u)]));if(v(await e.getCode({address:h,blockNumber:f})),!c(await a(h,"parentVault"),t))throw new n(i);return h}));if(new Set(s).size!==s.length)throw new n(i);o.adapters=s}catch{o.drift.push("adapters unreadable or invalid")}return o}function $(e=[]){return async(t,f)=>{let a=c(f,d.assetRule.usdg.address)?{...d.assetRule.usdg,chainId:d.chainId}:e.find(o=>o.chainId===d.chainId&&c(o.address,f));return a?{...a,address:m(a.address)}:void 0}}function L(e={resolveAllowedAsset:$()}){return async(t,f,a,o={})=>{try{let r=m(f),s=await P(t,o.blockNumber),[p,u,h,A,T]=await Promise.all([t.getCode({address:d.factory.address,blockNumber:s}),t.readContract({address:d.factory.address,abi:b,functionName:"isVaultV2",args:[r],blockNumber:s}),t.getCode({address:r,blockNumber:s}),t.readContract({address:r,abi:b,functionName:"asset",blockNumber:s}),t.readContract({address:r,abi:b,functionName:"decimals",blockNumber:s})]);if(!c(v(p),d.factory.codeHash)||u!==!0||V(T)!==18)throw new n(i);let D=v(h),g=m(A),C=V(await t.readContract({address:g,abi:y,functionName:"decimals",blockNumber:s})),w;try{w=await e.resolveAllowedAsset(t,g,s)}catch{}if(w&&(!c(w.address,g)||w.chainId!==4663||w.decimals!==C||I(w.symbol,"")===""))throw new n(i);let l=await B(t,r,s);if(w||l.drift.push("asset identity is outside the available official catalogue"),l.drift.length){if(a!=="withdraw"||!o.wallet)throw new n(i);if(k(await t.readContract({address:r,abi:y,functionName:"balanceOf",args:[m(o.wallet)],blockNumber:s}))===0n)throw new n(i)}let H=I(await t.readContract({address:r,abi:y,functionName:"symbol",blockNumber:s}).catch(()=>{}),"shares");return{vault:r,symbol:w?.symbol??"token",vaultSymbol:H,asset:g,assetDecimals:C,codeHash:D,chainId:4663,shareDecimals:18,...l.owner&&{owner:l.owner},...l.curator&&{curator:l.curator},...l.adapters&&{adapters:l.adapters},setup:l,assetAllowed:!!w,mode:a,source:d.factory.source,measuredAtBlock:s.toString(),provenance:{kind:"factory",factory:d.factory.address,isVaultV2:!0}}}catch(r){throw r instanceof n?r:new n(i)}}}var G=L(),J=async(e,t,f)=>{try{let a=await P(e),[o,r,s,p]=await Promise.all([e.getCode({address:t.vault,blockNumber:a}),e.readContract({address:t.vault,abi:b,functionName:"asset",blockNumber:a}),e.readContract({address:t.vault,abi:y,functionName:"decimals",blockNumber:a}),e.readContract({address:t.asset,abi:y,functionName:"decimals",blockNumber:a})]);if(!c(v(o),t.codeHash)||!c(m(r),t.asset)||V(s)!==18||V(p)!==t.assetDecimals)throw new n(i);let u=await B(e,t.vault,a);if(t.adapters&&u.adapters&&(t.adapters.length!==u.adapters.length||t.adapters.some((h,A)=>!c(h,u.adapters[A])))&&u.drift.push("adapters changed"),f==="deposit"&&u.drift.length)throw new n(i);return u}catch(a){throw a instanceof n?a:new n(i)}};export{b as a,i as b,m as c,k as d,v as e,V as f,I as g,P as h,$ as i,L as j,G as k,J as l};
1
+ import{a as d}from"./E3RACZUY.js";import{fa as S}from"./EI6GGPDS.js";import{h as c,i as R,l as N,m as x}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{erc20Abi as y,isHex as O,keccak256 as _,parseAbi as z}from"viem";var b=z(["function asset() view returns (address)","function decimals() view returns (uint8)","function symbol() view returns (string)","function owner() view returns (address)","function curator() view returns (address)","function adaptersLength() view returns (uint256)","function adapters(uint256) view returns (address)","function parentVault() view returns (address)","function isVaultV2(address) view returns (bool)","function totalAssets() view returns (uint256)","function totalSupply() view returns (uint256)","function convertToAssets(uint256) view returns (uint256)","function previewDeposit(uint256) view returns (uint256)","function performanceFee() view returns (uint256)","function getThreshold() view returns (uint256)","function getOwners() view returns (address[])"]),i=S("setup-mismatch",{}),m=e=>N(R(e,i),i),k=e=>x(e,i);function v(e){if(typeof e!="string"||!O(e,{strict:!0})||e.length<4||e.length%2!==0)throw new n(i);return _(e)}function V(e){if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255)throw new n(i);return e}function I(e,t){return typeof e=="string"&&/^[A-Za-z0-9.$_-]{1,32}$/.test(e)?e:t}async function P(e,t){if(await e.getChainId()!==d.chainId)throw new n("Borro requires chain 4663.");return k(t??await e.getBlockNumber({cacheTime:0}))}async function B(e,t,f){let a=(r,s,p=[])=>e.readContract({address:r,abi:b,functionName:s,args:p,blockNumber:f}),o={ok:!0,drift:[]};for(let r of["owner","curator"])try{o[r]=m(await a(t,r)),c(o[r],d[r])||o.drift.push(r)}catch{o.drift.push(`${r} unreadable`)}try{let r=k(await a(t,"adaptersLength"));if(r>64n)throw new n(i);let s=await Promise.all(Array.from({length:Number(r)},async(p,u)=>{let h=m(await a(t,"adapters",[BigInt(u)]));if(v(await e.getCode({address:h,blockNumber:f})),!c(await a(h,"parentVault"),t))throw new n(i);return h}));if(new Set(s).size!==s.length)throw new n(i);o.adapters=s}catch{o.drift.push("adapters unreadable or invalid")}return o}function $(e=[]){return async(t,f)=>{let a=c(f,d.assetRule.usdg.address)?{...d.assetRule.usdg,chainId:d.chainId}:e.find(o=>o.chainId===d.chainId&&c(o.address,f));return a?{...a,address:m(a.address)}:void 0}}function L(e={resolveAllowedAsset:$()}){return async(t,f,a,o={})=>{try{let r=m(f),s=await P(t,o.blockNumber),[p,u,h,A,T]=await Promise.all([t.getCode({address:d.factory.address,blockNumber:s}),t.readContract({address:d.factory.address,abi:b,functionName:"isVaultV2",args:[r],blockNumber:s}),t.getCode({address:r,blockNumber:s}),t.readContract({address:r,abi:b,functionName:"asset",blockNumber:s}),t.readContract({address:r,abi:b,functionName:"decimals",blockNumber:s})]);if(!c(v(p),d.factory.codeHash)||u!==!0||V(T)!==18)throw new n(i);let D=v(h),g=m(A),C=V(await t.readContract({address:g,abi:y,functionName:"decimals",blockNumber:s})),w;try{w=await e.resolveAllowedAsset(t,g,s)}catch{}if(w&&(!c(w.address,g)||w.chainId!==4663||w.decimals!==C||I(w.symbol,"")===""))throw new n(i);let l=await B(t,r,s);if(w||l.drift.push("asset identity is outside the available official catalogue"),l.drift.length){if(a!=="withdraw"||!o.wallet)throw new n(i);if(k(await t.readContract({address:r,abi:y,functionName:"balanceOf",args:[m(o.wallet)],blockNumber:s}))===0n)throw new n(i)}let H=I(await t.readContract({address:r,abi:y,functionName:"symbol",blockNumber:s}).catch(()=>{}),"shares");return{vault:r,symbol:w?.symbol??"token",vaultSymbol:H,asset:g,assetDecimals:C,codeHash:D,chainId:4663,shareDecimals:18,...l.owner&&{owner:l.owner},...l.curator&&{curator:l.curator},...l.adapters&&{adapters:l.adapters},setup:l,assetAllowed:!!w,mode:a,source:d.factory.source,measuredAtBlock:s.toString(),provenance:{kind:"factory",factory:d.factory.address,isVaultV2:!0}}}catch(r){throw r instanceof n?r:new n(i)}}}var G=L(),J=async(e,t,f)=>{try{let a=await P(e),[o,r,s,p]=await Promise.all([e.getCode({address:t.vault,blockNumber:a}),e.readContract({address:t.vault,abi:b,functionName:"asset",blockNumber:a}),e.readContract({address:t.vault,abi:y,functionName:"decimals",blockNumber:a}),e.readContract({address:t.asset,abi:y,functionName:"decimals",blockNumber:a})]);if(!c(v(o),t.codeHash)||!c(m(r),t.asset)||V(s)!==18||V(p)!==t.assetDecimals)throw new n(i);let u=await B(e,t.vault,a);if(t.adapters&&u.adapters&&(t.adapters.length!==u.adapters.length||t.adapters.some((h,A)=>!c(h,u.adapters[A])))&&u.drift.push("adapters changed"),f==="deposit"&&u.drift.length)throw new n(i);return u}catch(a){throw a instanceof n?a:new n(i)}};export{b as a,i as b,m as c,k as d,v as e,V as f,I as g,P as h,$ as i,L as j,G as k,J as l};
@@ -0,0 +1 @@
1
+ import{i as a,j as s,k as r,n as i,o as f}from"./QJNLLI6N.js";import{a as p}from"./XSD5NL7J.js";import{hashStruct as g}from"viem";var w={Order:[{name:"version",type:"string"},{name:"solverChainId",type:"string"},{name:"solver",type:"address"},{name:"salt",type:"uint256"},{name:"inputs",type:"Input[]"},{name:"output",type:"Output"},{name:"fees",type:"Fee[]"}],Input:[{name:"payment",type:"InputPayment"},{name:"refunds",type:"InputRefund[]"}],InputPayment:[{name:"chainId",type:"string"},{name:"currency",type:"bytes"},{name:"amount",type:"uint256"},{name:"weight",type:"uint256"}],InputRefund:[{name:"chainId",type:"string"},{name:"recipient",type:"bytes"},{name:"currency",type:"bytes"},{name:"minimumAmount",type:"uint256"},{name:"deadline",type:"uint32"},{name:"extraData",type:"bytes"}],Output:[{name:"chainId",type:"string"},{name:"payments",type:"OutputPayment[]"},{name:"deadline",type:"uint32"},{name:"calls",type:"bytes[]"},{name:"extraData",type:"bytes"}],OutputPayment:[{name:"recipient",type:"bytes"},{name:"currency",type:"bytes"},{name:"minimumAmount",type:"uint256"},{name:"expectedAmount",type:"uint256"}],Fee:[{name:"recipientChainId",type:"string"},{name:"recipient",type:"bytes"},{name:"currencyChainId",type:"string"},{name:"currency",type:"bytes"},{name:"amount",type:"uint256"}]};function A(I,l){let t=a(I);if(t.version!=="v1")throw new p("Relay order ID cannot be verified for this order version. Request a supported v1 quote.");let u=n=>{if(typeof n!="string"||!l.includes(n))throw new p("Relay order ID cannot be verified for an unknown or non-EVM chain.");return n},c=n=>{if(typeof n!="string"||!/^0x(?:[0-9a-fA-F]{2})*$/.test(n))throw new p("Relay order ID cannot be verified with malformed bytes.");return n},d=n=>{let e=f(n);if(e>4294967295)throw new p("Relay order deadline exceeds uint32. Request a new quote.");return e};if(typeof t.salt!="string"||!/^(?:0x[0-9a-fA-F]{1,64}|0|[1-9][0-9]*)$/.test(t.salt)||BigInt(t.salt)>=1n<<256n)throw new p("Relay order ID cannot be verified with an invalid salt.");let y=a(t.output);return g({types:w,primaryType:"Order",data:{version:t.version,solverChainId:u(t.solverChainId),solver:r(t.solver),salt:BigInt(t.salt),inputs:s(t.inputs).map(n=>{let e=a(n),o=a(e.payment);return{payment:{chainId:u(o.chainId),currency:r(o.currency),amount:BigInt(i(o.amount)),weight:BigInt(i(o.weight))},refunds:s(e.refunds).map(h=>{let m=a(h);return{chainId:u(m.chainId),recipient:r(m.recipient),currency:r(m.currency),minimumAmount:BigInt(i(m.minimumAmount)),deadline:d(m.deadline),extraData:c(m.extraData)}})}}),output:{chainId:u(y.chainId),payments:s(y.payments).map(n=>{let e=a(n);return{recipient:r(e.recipient),currency:r(e.currency),minimumAmount:BigInt(i(e.minimumAmount)),expectedAmount:BigInt(i(e.expectedAmount))}}),deadline:d(y.deadline),calls:s(y.calls).map(c),extraData:c(y.extraData)},fees:s(t.fees).map(n=>{let e=a(n);return{recipientChainId:u(e.recipientChainId),recipient:r(e.recipient),currencyChainId:u(e.currencyChainId),currency:r(e.currency),amount:BigInt(i(e.amount))}})}})}export{A as a};
@@ -0,0 +1 @@
1
+ import{a as m}from"./TVIMP5CK.js";import{d as g}from"./M7U3A4EH.js";import{e as d}from"./NWNYJ26T.js";import{a as f}from"./XSD5NL7J.js";import{createHash as b}from"node:crypto";var p=32768,T="wormhole-x402@0.11.0/603aba277a626630d9b9463f713121dc4327325c";function j(r){if(!d(r)||Object.keys(r).length!==1||typeof r.text!="string")throw new f("Provide only text as a string for the local Wormhole scan.");let o=r.text,x=o.length>p||Buffer.byteLength(o,"utf8")>p,h={local:!0,scannerVersion:T,attribution:{provider:"Agent Wormhole",source:"https://github.com/runningoffcode/agent-wormhole"},limitation:"Evadable English instruction-shape rules. Allow is not proof of safety, intent, or coverage of unknown attacks."};if(x)return{...h,decision:"abstain",codes:[],findings:[],scannedPaths:[],charsScanned:0,inputHash:null,reason:"Text exceeds the 32768-byte local scan limit; no text was scanned or hashed."};let w=b("sha256").update(o,"utf8").digest("hex"),y={maxFieldChars:p,maxDecodeDepth:3,maxDepth:12},a=t=>{try{return g(t,y)}catch{return{decision:"abstain",findings:[],scanned:[],charsScanned:0}}},n=[{path:"text",verdict:a(o)}],c=[],l=t=>{let e=m(t);e!==void 0&&c.push(e)};l(o);try{let t=JSON.parse(o);if(typeof t=="string"||d(t)||Array.isArray(t)){n.push({path:"text.json",verdict:a(t)});let e=[t];for(;e.length;){let s=e.pop();if(typeof s=="string")l(s);else if(s!==null&&typeof s=="object")for(let v of Object.values(s))e.push(v)}}}catch{}c.length&&n.push({path:"text.unwrapped",verdict:a(c)});let i=n.flatMap(t=>t.verdict.findings.map(e=>({code:e.code,severity:e.severity,path:t.path,offset:e.offset}))),u=n.some(t=>t.verdict.decision==="refuse")?"refuse":n.some(t=>t.verdict.decision==="abstain")?"abstain":"allow";return{...h,decision:u,codes:[...new Set(i.map(t=>t.code))],findings:i.slice(0,64),findingsTruncated:i.length>64,scannedPaths:n.filter(t=>t.verdict.scanned.length).map(t=>t.path),charsScanned:n.reduce((t,e)=>t+e.verdict.charsScanned,0),inputHash:w,...u==="abstain"?{reason:"The local scanner could not cover all supplied text. Treat the result as unknown."}:{}}}export{p as a,T as b,j as c};
@@ -0,0 +1 @@
1
+ import{e as h,i as y}from"./4FPV4CRC.js";import{b as l,e as f,g as v}from"./J73ATSEQ.js";import{c as p}from"./NWNYJ26T.js";import{a as g}from"./FWD4L3CJ.js";import{a as r}from"./XSD5NL7J.js";import{parseAbi as C,zeroAddress as I}from"viem";var N=C(["function observe(uint32[] secondsAgos) view returns (int56[] tickCumulatives,uint160[] secondsPerLiquidityCumulativeX128s)"]);function B(s){return{tools:[{name:"uniswap_oracle",inputSchema:{type:"object",additionalProperties:!1,required:["token0","token1","fee","secondsAgo"],properties:{token0:{...p,description:"Lower sorted ERC-20 token address; use WETH for native ETH in v3."},token1:{...p,description:"Higher sorted ERC-20 token address."},fee:{description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%).",type:"integer",minimum:0,maximum:999999},secondsAgo:{description:"Oracle lookback duration in seconds; a positive integer.",type:"integer",minimum:1,maximum:4294967295}}},async execute(t){v(t,["token0","token1","fee","secondsAgo"]);let a=l(t.token0),c=l(t.token1),o=t.fee,e=t.secondsAgo;if(BigInt(a)>=BigInt(c))throw new r("Oracle tokens must be strictly sorted token0 < token1.");if(typeof o!="number"||!Number.isInteger(o)||o<0||o>=1e6||typeof e!="number"||!Number.isInteger(e)||e<=0||e>4294967295)throw new r("Provide integer fee pips and a positive uint32 secondsAgo.");let d=s.clientFor(g),i=await d.getBlockNumber(),m=await d.readContract({address:h.factory,abi:y,functionName:"getPool",args:[a,c,o],blockNumber:i});if(m===I)throw new r("No factory-verified v3 pool exists for this oracle.");let[[n,k],w,A]=await Promise.all([d.readContract({address:m,abi:N,functionName:"observe",args:[[e,0]],blockNumber:i}),f(s,a,i),f(s,c,i)]);if(n.length!==2||k.length!==2)throw new r("Oracle returned an unexpected observation count.");let u=n[1]-n[0],b=BigInt(e),P=u/b-(u<0n&&u%b!==0n?1n:0n);return{pool:m,token0:w,token1:A,secondsAgo:e,blockNumber:i.toString(),tickCumulatives:n.map(String),secondsPerLiquidityCumulativeX128s:k.map(String),arithmeticMeanTick:P.toString(),summary:"V3 time-weighted arithmetic mean tick, rounded toward negative infinity. Price is token1-base-units per token0-base-unit before decimal adjustment. Insufficient pool history reverts; an unavailable oracle is never reported as zero."}}}]}}export{B as a};
@@ -0,0 +1 @@
1
+ import{e as g,f as T,g as k,i as E}from"./7QKYDNF6.js";import{c as _,d as S}from"./DNNFKDZR.js";import{g as h}from"./NWNYJ26T.js";import{a as f}from"./FWD4L3CJ.js";import{a as i}from"./XSD5NL7J.js";import{decodeAbiParameters as P,encodeAbiParameters as B,getAddress as d}from"viem";var D=d("0xcEF685D4796FA80F71a97e803D2c0b6719F1b4E2"),H=[{name:"items",type:"tuple[]",components:[{...k[0],name:"offer"},{name:"ratifierData",type:"bytes"}]}],G=l=>({tools:[{name:"longbow_fixed_offers",inputSchema:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of offers to return, 1 to 50 (default 20). Newest-expiring offers come first."},marketId:{type:"string",description:"Optional Midnight market id as 0x followed by 64 hex digits (bytes32); only offers in that market are returned."}}},execute:async o=>{try{let a=o.limit??20;if(Object.keys(o).some(s=>!["limit","marketId"].includes(s))||!Number.isInteger(a)||Number(a)<1||Number(a)>50||o.marketId!==void 0&&(typeof o.marketId!="string"||!/^0x[0-9a-f]{64}$/i.test(o.marketId)))throw new i("Use limit 1..50 and an optional exact bytes32 marketId.");let p=await l.http("https://longbow.credit/api/fixed/offers",{method:"GET",redirect:"error"});if(!p.ok)throw new i(`Longbow fixed order book returned HTTP ${p.status}; offers are unavailable.`);let x=await p.text();if(x.length>2e6)throw new i("Longbow fixed order book exceeds the supported response size.");let t=JSON.parse(x);if(!t||t.chainId!==f||typeof t.mempool!="string"||d(t.mempool)!==D||!Array.isArray(t.publications)||t.publications.length>1e3||!Number.isSafeInteger(t.head)||Number(t.head)<0)throw new i("Longbow fixed indexer does not match the pinned chain, mempool or publication schema.");let c=[],u=[],y=0;for(let[s,m]of t.publications.entries())try{if(!m||typeof m!="object")throw new i("Invalid publication.");let r=m,n=r.itemsAbi;if(!Number.isSafeInteger(r.blockNumber)||Number(r.blockNumber)<0||Number(r.blockNumber)>Number(t.head))throw new i("Invalid publication block.");if(typeof n!="string"||!/^0x[0-9a-f]+$/i.test(n)||n.length>1e6||n.length<130||BigInt(`0x${n.slice(2,66)}`)!==32n||BigInt(`0x${n.slice(66,130)}`)>512n)throw new i("Invalid or oversized publication encoding.");let[w]=P(H,n);if(w.length!==r.items)throw new i("Publication count mismatch.");for(let b of w){y++;let e=b.offer;if(e.market.chainId!==BigInt(f)||d(e.market.midnight)!==g||b.ratifierData.length>32770)throw new i("Publication market or proof is unqualified.");let I=E(e.market);if(o.marketId!==void 0&&!h(I,String(o.marketId)))continue;let N=[_,S].find(O=>h(O.address,e.market.loanToken));c.push({marketId:I,offer:B(k,[e]),ratifierData:b.ratifierData,maker:d(e.maker),buy:e.buy,maturity:e.market.maturity.toString(),start:e.start.toString(),expiry:e.expiry.toString(),tick:e.tick.toString(),loanToken:N??null,directBuilderSupported:!!N&&/^0x0{40}$/i.test(e.callback)&&e.callbackData==="0x"&&T.includes(d(e.ratifier)),sourceBlock:String(r.blockNumber)})}}catch(r){u.push({publication:s,reason:l.plainError(r)})}return c.sort((s,m)=>BigInt(s.expiry)>BigInt(m.expiry)?-1:BigInt(s.expiry)<BigInt(m.expiry)?1:0),{chainId:f,midnight:g,mempool:D,indexedHead:String(t.head),decodedCount:y,matchingCount:c.length,offers:c.slice(0,Number(a)),incomplete:u.length>0||t.skipped!==0,rejected:u,warning:"Historical off-chain publications, not executable quotes. Expiry, consumption, authorization, signatures and liquidity are not verified here. Use morpho_midnight_status and preview morpho_midnight_take with the returned exact offer/proof; callback offers need a separately qualified builder. This read publishes nothing and creates no signature."}}catch(a){throw new i(l.plainError(a))}}}]});export{D as a,H as b,G as c};
@@ -1 +1 @@
1
- import{h as L,j as i,k as d,l as w,m as y,n as D,o as f,p as l,q as h,r as _,s as q,t as r}from"./JVLLVNF2.js";import{a as O,f as F}from"./MQK6OP7S.js";import{a as c}from"./XSD5NL7J.js";import{encodeAbiParameters as M,getAddress as B,keccak256 as j,parseAbi as $,zeroHash as N}from"viem";var Y="0x167ba3b15d65044b17c87154087d35fc5efde07538be66b804a54e63d6089136",z=$(["function getVersion() view returns (string)"]),E=B("0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"),R=B("0x8004BAa17C55a88189AE136b182e5fdA19dE9b63");function ee(n,s){let e=y(n),o=y(e.caps),t=i(e.gasLimit,32),m=i(o.maxLpFeePips,24);if(s!==Y||e.schemaHash!==Y||e.codeHash!==F(r).codeHash||e.implementation!==r||i(e.kind,8)!==1n||i(e.phaseMask,8)!==1n||d(e.failOpen)||t<400000n||t>2000000n||m>50000n||i(o.maxQuoteTakePips,24)!==0n||i(o.maxSubjectTakeBps,16)!==0n)throw new c("Hookr agent gate admission, schema or execution caps differ from the supported fail-closed BEFORE_SWAP profile. Review the deployment before entry.");return d(e.feeOnly),{...e,caps:o}}async function oe(n,s,e,o=[]){let t=(a,p=[])=>l(n,r,f("agentGateV1"),a,p,s),[m,A,S,g,x,v,k,H,Q,U,W,X]=await Promise.all([t("configSchemaHash"),l(n,_,f("registry"),"admission",[h,r],s),t("retired"),t("identity"),t("reputation"),t("poolManager"),t("isAgent",[e]),t("linkOf",[e]),t("MIN_ADVISORY_GAS"),t("MAX_ADVISORY_GAS"),l(n,E,z,"getVersion",[],s),l(n,R,z,"getVersion",[],s)]),J=ee(A,m);if(g!==E||x!==R||v!==q||i(Q)!==400000n||i(U)!==2000000n)throw new c("Hookr gate dependencies or gas limits differ from the reviewed profile.");let C=a=>{if(typeof a!="string"||new TextEncoder().encode(a).length>32)throw new c("Hookr registry version read is incomplete.");return j(M([{type:"string"}],[a]))},I=C(W)!==O.gateVersions.identity,K=C(X)!==O.gateVersions.reputation,P=I||K,u=d(S),T=w(H,2),Z=await Promise.all(o.map(async a=>{let[p,b]=w(await t("reviewerSet",[a]),2);if(!Array.isArray(p)||p.length===0||p.length>32||typeof b!="string")throw new c("Reviewer set is unregistered or unavailable. Supply an existing registered bytes32 set ID.");let V=p.map(G=>B(String(G)));if(V.some(G=>BigInt(G)===0n)||j(M([{type:"address[]"},{type:"string"}],[V,b]))!==a.toLowerCase())throw new c("Hookr reviewer set does not match its registered ID.");return{id:a,clients:V,tag:b}}));return{address:r,healthy:!u&&!P,healthyIdentityOnly:!u&&!I,healthyForScores:!u&&!P,retired:u,registryVersionDrift:P,schemaHash:m,admission:D(J),identity:E,reputation:R,walletAgent:d(k),link:{linked:d(T[0]),agentId:i(T[1]).toString()},reviewerSets:Z,reviewerSetsComplete:!1,reviewerSetsNotice:"Only explicitly requested registered set IDs are read. This is not an enumeration. No reviewed Priors alias is configured; provide a registered bytes32 set ID.",termsSchema:{flags:"uint16",minScore:"uint32",tierScore:"uint32",tierPips:"uint24",reviewers:"bytes32"},defaults:{flags:"1",minScore:"0",tierScore:"0",tierPips:"0",reviewers:N},maxTierPips:"50000",minGas:"400000",maxGas:"2000000"}}async function ae(n,s,e,o,t){if(BigInt(t)===0n)return{gated:!1,admissionRequiredForCollectOrRemove:!1};if(t!==r)throw new c("This position uses an unreviewed advisory. Gate status is unknown.");let[m,A,S]=await Promise.all([l(n,r,f("agentGateV1"),"terms",[h,e],s),l(n,r,f("agentGateV1"),"explainLiquidity",[h,e,o],s),l(n,r,f("agentGateV1"),"retired",[],s)]),g=y(m),[x,v]=w(A,2);if(!d(g.bound)||g.launcher!==o)throw new c("Hookr gate is not bound to this family Launcher.");for(let[k,H]of[["flags",16],["minScore",32],["tierScore",32],["tierPips",24]])i(g[k],H);return L(g.reviewers),{gated:!0,gate:r,terms:D(g),retired:d(S),liquidityEntryAllowed:d(x),entryReason:i(v,8).toString(),admissionRequiredForCollectOrRemove:!1}}export{Y as a,ee as b,oe as c,ae as d};
1
+ import{h as L,j as i,k as d,l as w,m as y,n as D,o as f,p as l,q as h,r as _,s as q,t as r}from"./2E4I7CJ7.js";import{a as O,f as F}from"./MQK6OP7S.js";import{a as c}from"./XSD5NL7J.js";import{encodeAbiParameters as M,getAddress as B,keccak256 as j,parseAbi as $,zeroHash as N}from"viem";var Y="0x167ba3b15d65044b17c87154087d35fc5efde07538be66b804a54e63d6089136",z=$(["function getVersion() view returns (string)"]),E=B("0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"),R=B("0x8004BAa17C55a88189AE136b182e5fdA19dE9b63");function ee(n,s){let e=y(n),o=y(e.caps),t=i(e.gasLimit,32),m=i(o.maxLpFeePips,24);if(s!==Y||e.schemaHash!==Y||e.codeHash!==F(r).codeHash||e.implementation!==r||i(e.kind,8)!==1n||i(e.phaseMask,8)!==1n||d(e.failOpen)||t<400000n||t>2000000n||m>50000n||i(o.maxQuoteTakePips,24)!==0n||i(o.maxSubjectTakeBps,16)!==0n)throw new c("Hookr agent gate admission, schema or execution caps differ from the supported fail-closed BEFORE_SWAP profile. Review the deployment before entry.");return d(e.feeOnly),{...e,caps:o}}async function oe(n,s,e,o=[]){let t=(a,p=[])=>l(n,r,f("agentGateV1"),a,p,s),[m,A,S,g,x,v,k,H,Q,U,W,X]=await Promise.all([t("configSchemaHash"),l(n,_,f("registry"),"admission",[h,r],s),t("retired"),t("identity"),t("reputation"),t("poolManager"),t("isAgent",[e]),t("linkOf",[e]),t("MIN_ADVISORY_GAS"),t("MAX_ADVISORY_GAS"),l(n,E,z,"getVersion",[],s),l(n,R,z,"getVersion",[],s)]),J=ee(A,m);if(g!==E||x!==R||v!==q||i(Q)!==400000n||i(U)!==2000000n)throw new c("Hookr gate dependencies or gas limits differ from the reviewed profile.");let C=a=>{if(typeof a!="string"||new TextEncoder().encode(a).length>32)throw new c("Hookr registry version read is incomplete.");return j(M([{type:"string"}],[a]))},I=C(W)!==O.gateVersions.identity,K=C(X)!==O.gateVersions.reputation,P=I||K,u=d(S),T=w(H,2),Z=await Promise.all(o.map(async a=>{let[p,b]=w(await t("reviewerSet",[a]),2);if(!Array.isArray(p)||p.length===0||p.length>32||typeof b!="string")throw new c("Reviewer set is unregistered or unavailable. Supply an existing registered bytes32 set ID.");let V=p.map(G=>B(String(G)));if(V.some(G=>BigInt(G)===0n)||j(M([{type:"address[]"},{type:"string"}],[V,b]))!==a.toLowerCase())throw new c("Hookr reviewer set does not match its registered ID.");return{id:a,clients:V,tag:b}}));return{address:r,healthy:!u&&!P,healthyIdentityOnly:!u&&!I,healthyForScores:!u&&!P,retired:u,registryVersionDrift:P,schemaHash:m,admission:D(J),identity:E,reputation:R,walletAgent:d(k),link:{linked:d(T[0]),agentId:i(T[1]).toString()},reviewerSets:Z,reviewerSetsComplete:!1,reviewerSetsNotice:"Only explicitly requested registered set IDs are read. This is not an enumeration. No reviewed Priors alias is configured; provide a registered bytes32 set ID.",termsSchema:{flags:"uint16",minScore:"uint32",tierScore:"uint32",tierPips:"uint24",reviewers:"bytes32"},defaults:{flags:"1",minScore:"0",tierScore:"0",tierPips:"0",reviewers:N},maxTierPips:"50000",minGas:"400000",maxGas:"2000000"}}async function ae(n,s,e,o,t){if(BigInt(t)===0n)return{gated:!1,admissionRequiredForCollectOrRemove:!1};if(t!==r)throw new c("This position uses an unreviewed advisory. Gate status is unknown.");let[m,A,S]=await Promise.all([l(n,r,f("agentGateV1"),"terms",[h,e],s),l(n,r,f("agentGateV1"),"explainLiquidity",[h,e,o],s),l(n,r,f("agentGateV1"),"retired",[],s)]),g=y(m),[x,v]=w(A,2);if(!d(g.bound)||g.launcher!==o)throw new c("Hookr gate is not bound to this family Launcher.");for(let[k,H]of[["flags",16],["minScore",32],["tierScore",32],["tierPips",24]])i(g[k],H);return L(g.reviewers),{gated:!0,gate:r,terms:D(g),retired:d(S),liquidityEntryAllowed:d(x),entryReason:i(v,8).toString(),admissionRequiredForCollectOrRemove:!1}}export{Y as a,ee as b,oe as c,ae as d};
@@ -0,0 +1 @@
1
+ import{a as c,b as m,f as T,g as d,h as i,i as l}from"./PV5FDT6O.js";import{c as P,e as p}from"./NWNYJ26T.js";import{a as r}from"./XSD5NL7J.js";import{encodeAbiParameters as y,parseAbiParameters as h,zeroAddress as B}from"viem";var A={type:"object",properties:{pairedToken:{...P,description:"Address of the token paired against the launched token in the pool. Defaults to WETH."},startingTick:{type:"integer",minimum:-887272,maximum:887272,description:"Initial pool price as a tick (when the launched token is token0). Default -230400."},tickSpacing:{type:"integer",minimum:1,maximum:32767,description:"Pool tick spacing; position ticks must be multiples of it. Default 200."},positions:{type:"array",minItems:1,maxItems:7,description:"Liquidity positions, 1 to 7, whose bps allocations total 10000. Default: one position from -230400 to -120000.",items:{type:"object",properties:{tickLower:{type:"integer",description:"Lower tick of the position; at or above the starting tick and a multiple of tick spacing."},tickUpper:{type:"integer",description:"Upper tick of the position; above tickLower and a multiple of tick spacing."},bps:{type:"integer",minimum:1,maximum:1e4,description:"Share of the pool liquidity supply in this position, in basis points (5000 = 50%)."}},required:["tickLower","tickUpper","bps"],additionalProperties:!1}},dynamicFee:{type:"object",description:"Optional dynamic LP fee settings; cannot be combined with feeBps.",properties:{baseFeeBps:{type:"integer",minimum:25,maximum:1e3,description:"Minimum LP fee in basis points (100 = 1%)."},maxFeeBps:{type:"integer",minimum:25,maximum:1e3,description:"Maximum LP fee in basis points (100 = 1%); at least baseFeeBps."},referenceTickFilterPeriod:{...m,description:"Seconds during which the reference tick is held before it may update, as a decimal string."},resetPeriod:{...m,description:"Seconds of inactivity after which the dynamic fee resets to base, as a decimal string."},resetTickFilter:{type:"integer",minimum:-887272,maximum:887272,description:"Tick distance from the reference tick that triggers a fee reset."},feeControlNumerator:{...m,description:"Numerator scaling how fast the fee rises with price movement, as a decimal string."},decayFilterBps:{type:"integer",minimum:0,maximum:3e4,description:"Decay rate of the reference-tick filter in basis points (50 = 0.5%)."}},required:["baseFeeBps","maxFeeBps","referenceTickFilterPeriod","resetPeriod","resetTickFilter","feeControlNumerator","decayFilterBps"],additionalProperties:!1}},additionalProperties:!1};function D(f){let o=f.pool??{};if(!p(o))throw new r("Provide pool configuration as an object.");l(o,["pairedToken","startingTick","tickSpacing","positions","dynamicFee"]);let x=T(o.pairedToken??c.paired_weth.address),g=i(o.startingTick??-230400,-887272,887272),u=i(o.tickSpacing??200,1,32767),n=o.positions??[{tickLower:-230400,tickUpper:-12e4,bps:1e4}];if(!Array.isArray(n)||!n.length||n.length>7)throw new r("Provide one to seven liquidity positions.");let a=n.map(e=>{if(!p(e))throw new r("Provide liquidity position objects.");l(e,["tickLower","tickUpper","bps"]);let t=i(e.tickLower,-887272,887272),s=i(e.tickUpper,-887272,887272);if(t>=s||t<g||t%u||s%u)throw new r("Liquidity ticks must ascend from the starting tick and be multiples of tick spacing.");return{lower:t,upper:s,bps:i(e.bps,1,1e4)}});if(a.reduce((e,t)=>e+t.bps,0)!==1e4)throw new r("Liquidity position allocations must total 10000 bps.");let k=i(f.feeBps??100,0,1e3)*100,b=c.fee_static_hook_v2.address,w=y(h("uint24,uint24"),[k,k]),F=`Static LP fee ${k/100} bps`;if(o.dynamicFee!==void 0){let e=o.dynamicFee;if(!p(e)||f.feeBps!==void 0)throw new r("Provide dynamic fee configuration without a static feeBps override.");l(e,["baseFeeBps","maxFeeBps","referenceTickFilterPeriod","resetPeriod","resetTickFilter","feeControlNumerator","decayFilterBps"]);let t=i(e.baseFeeBps,25,1e3),s=i(e.maxFeeBps,t,1e3);b=c.fee_dynamic_hook_v2.address,w=y(h("(uint24,uint24,uint256,uint256,int24,uint256,uint24)"),[[t*100,s*100,d(e.referenceTickFilterPeriod),d(e.resetPeriod),i(e.resetTickFilter,-887272,887272),d(e.feeControlNumerator),i(e.decayFilterBps,0,3e4)]]),F=`Dynamic LP fee ${t} to ${s} bps; parameters ${JSON.stringify(e)}`}return{feeSummary:F,poolConfig:{hook:b,pairedToken:x,tickIfToken0IsClanker:g,tickSpacing:u,poolData:y(h("(address,bytes,bytes)"),[[B,"0x",w]])},tickLower:a.map(e=>e.lower),tickUpper:a.map(e=>e.upper),positionBps:a.map(e=>e.bps)}}export{A as a,D as b};
@@ -0,0 +1 @@
1
+ function r(e){let n=BigInt(e),t=(n%10000n).toString().padStart(4,"0").replace(/0+$/,"");return`${n/10000n}${t?`.${t}`:""}%`}function o(e,n){return(e.fee&8388608)!==0?`fee set by the pool's hook, currently ${r(n)}, can change on every trade`:`${r(e.fee)} pool fee`}export{r as a,o as b};
@@ -1 +1 @@
1
- import{b as T}from"./52ELWNXJ.js";import{c as A}from"./MRMR4QHA.js";import{i as b}from"./Q42YI3EP.js";import{j as P}from"./57MEFFCU.js";import{a as f,i as g}from"./FWD4L3CJ.js";var U=.5,E=394930n,C=315200n,R=1000000000n,x=10000n*10n**18n,M="fees estimated high because the live price was unavailable";function I(s,r){if(s.impliedApy===void 0)return{reason:"Pendle's service gave no rate, so Oak won't show one."};let t=Math.expm1(Number(r)/1e18)*100,n=s.impliedApy*100;return!Number.isFinite(t)||!Number.isFinite(n)?{reason:"the rate could not be checked against the chain, so Oak won't show one."}:Math.abs(n-t)>U?{reason:`The rate Pendle's service lists (${n.toFixed(2)}% a year) differs from the chain's (${t.toFixed(2)}% a year) by more than ${U} points, so Oak won't show one.`}:{ratePct:n}}async function S(s,r){let t=s.clientFor(f),n=await t.getGasPrice().catch(()=>{}),i=r;i===void 0&&(i=await P(g[f].tokens.WETH.address,{client:t}).then(a=>BigInt(a.usdE18),()=>{}));let o=n!==void 0&&n>0n&&i!==void 0&&i>0n?{gasPrice:n,ethUsd:i}:void 0,{gasPrice:u,ethUsd:h}=o??{gasPrice:R,ethUsd:x},m=a=>Number(a*u*h)/1e36;return{inUsd:m(E),outUsd:m(C),checks:o?[]:[M]}}async function v(s,r,t={}){let n=s.clientFor(f),i=t.now??Math.floor(Date.now()/1e3),o=await b(s,{allowChain:!1}),u=await T(n,r,o.rows),h=e=>(u.get(e.pt.toLowerCase())??0n)>0n,m=o.rows.filter(e=>e.active&&e.expiry>i||h(e)),[{ok:a,dropped:_},p]=await Promise.all([A(n,m,{now:i}),S(s,t.ethUsdE18)]),y=[...o.dropped,..._],l=[];for(let{row:e,facts:d}of a){let c=d.verified,k={market:e.market,kind:c.kind,unitSymbol:c.inputSymbol,unitDecimals:c.inputDecimals,endsAt:c.expiry,liquidityUsd:e.liquidityUsd??0,ptBalanceBase:u.get(e.pt.toLowerCase())??0n,gasInUsd:p.inUsd,gasOutUsd:p.outUsd};if(c.expired){k.ptBalanceBase>0n&&l.push({...k,ratePct:0,matured:!0,checks:["this term has ended",...p.checks]});continue}if(!e.active)continue;let w=I(e,d.lnImpliedRate);if("reason"in w){y.push(`${e.market}: ${w.reason}`);continue}l.push({...k,ratePct:w.ratePct,matured:!1,checks:[...e.liquidityUsd===void 0?["liquidity was not reported"]:[],...p.checks]})}return l.sort((e,d)=>e.kind===d.kind?e.endsAt-d.endsAt:e.kind==="stable"?-1:1),{terms:l,dropped:y}}async function L(s,r,t={}){return(await v(s,r,t)).terms}export{I as a,v as b,L as c};
1
+ import{b as T}from"./TK55VASJ.js";import{c as A}from"./MRMR4QHA.js";import{i as b}from"./RT7IU6TI.js";import{k as P}from"./U2YCQWZK.js";import{a as f,i as g}from"./FWD4L3CJ.js";var U=.5,E=394930n,C=315200n,R=1000000000n,x=10000n*10n**18n,M="fees estimated high because the live price was unavailable";function I(s,r){if(s.impliedApy===void 0)return{reason:"Pendle's service gave no rate, so Oak won't show one."};let t=Math.expm1(Number(r)/1e18)*100,n=s.impliedApy*100;return!Number.isFinite(t)||!Number.isFinite(n)?{reason:"the rate could not be checked against the chain, so Oak won't show one."}:Math.abs(n-t)>U?{reason:`The rate Pendle's service lists (${n.toFixed(2)}% a year) differs from the chain's (${t.toFixed(2)}% a year) by more than ${U} points, so Oak won't show one.`}:{ratePct:n}}async function S(s,r){let t=s.clientFor(f),n=await t.getGasPrice().catch(()=>{}),i=r;i===void 0&&(i=await P(g[f].tokens.WETH.address,{client:t}).then(a=>BigInt(a.usdE18),()=>{}));let o=n!==void 0&&n>0n&&i!==void 0&&i>0n?{gasPrice:n,ethUsd:i}:void 0,{gasPrice:u,ethUsd:h}=o??{gasPrice:R,ethUsd:x},m=a=>Number(a*u*h)/1e36;return{inUsd:m(E),outUsd:m(C),checks:o?[]:[M]}}async function v(s,r,t={}){let n=s.clientFor(f),i=t.now??Math.floor(Date.now()/1e3),o=await b(s,{allowChain:!1}),u=await T(n,r,o.rows),h=e=>(u.get(e.pt.toLowerCase())??0n)>0n,m=o.rows.filter(e=>e.active&&e.expiry>i||h(e)),[{ok:a,dropped:_},p]=await Promise.all([A(n,m,{now:i}),S(s,t.ethUsdE18)]),y=[...o.dropped,..._],l=[];for(let{row:e,facts:d}of a){let c=d.verified,k={market:e.market,kind:c.kind,unitSymbol:c.inputSymbol,unitDecimals:c.inputDecimals,endsAt:c.expiry,liquidityUsd:e.liquidityUsd??0,ptBalanceBase:u.get(e.pt.toLowerCase())??0n,gasInUsd:p.inUsd,gasOutUsd:p.outUsd};if(c.expired){k.ptBalanceBase>0n&&l.push({...k,ratePct:0,matured:!0,checks:["this term has ended",...p.checks]});continue}if(!e.active)continue;let w=I(e,d.lnImpliedRate);if("reason"in w){y.push(`${e.market}: ${w.reason}`);continue}l.push({...k,ratePct:w.ratePct,matured:!1,checks:[...e.liquidityUsd===void 0?["liquidity was not reported"]:[],...p.checks]})}return l.sort((e,d)=>e.kind===d.kind?e.endsAt-d.endsAt:e.kind==="stable"?-1:1),{terms:l,dropped:y}}async function L(s,r,t={}){return(await v(s,r,t)).terms}export{I as a,v as b,L as c};
@@ -0,0 +1 @@
1
+ import{d as A,e as G,f as O,h as U,i as x,l as T,m as D,n as L,o as B,p as I,q as j,w as C,z as E}from"./V37L4DU4.js";import{a as N,b as m}from"./X5V2Z2NM.js";import{a as M}from"./43LI5NKJ.js";import{c as H,g as S}from"./NWNYJ26T.js";import{a as f}from"./XSD5NL7J.js";import{a as $}from"./JXOEJPJ4.js";import{encodeFunctionData as q}from"viem";var z=10n**38n,W=`0x${"00".repeat(32)}`;function _(o,g){let k=o<0n,l=(k?-o:o).toString().padStart(g+1,"0"),P=l.slice(0,l.length-g),v=g?l.slice(l.length-g).replace(/0+$/,""):"";return`${k?"-":""}${P}${v?`.${v}`:""}`}var ie=o=>{let g=(e,a,i)=>({name:e,inputSchema:a,execute:async(t,n)=>{try{return M(n),L(o,t.chainId),await i(t,n)}catch(r){throw new f(o.plainError(r))}}}),k={transactionHash:{...G,description:"After local submission, repeat the same arguments with the mined hash to verify calldata, event and registry state."}},l=(e,a,i)=>o.clientFor(U(o).chainId).readContract({address:e,abi:m,functionName:a,args:i});async function P(e){let{chainId:a,registry:i}=U(o),t=await o.clientFor(a).readContract({address:i,abi:N,functionName:"ownerOf",args:[e]});return M(t),t}let v=e=>{if(typeof e!="string"||!/^[1-9][0-9]{0,18}$/.test(e)||BigInt(e)>=2n**64n)throw new f("Provide feedbackIndex as a decimal integer string of at least 1 (indexes are 1-based).");return BigInt(e)},X=g("erc8004_give_feedback",{type:"object",additionalProperties:!1,required:["agentId","value"],description:"Post public, permanent-by-hash feedback about an agent (ERC-8004 Reputation Registry giveFeedback). You cannot rate an agent you own or operate.",properties:{agentId:A,value:{type:"string",pattern:"^-?[0-9]+$",description:'Signed integer in fixed point, e.g. "87" with valueDecimals 0 is 87; "9977" with valueDecimals 2 is 99.77.'},valueDecimals:{type:"integer",minimum:0,maximum:18,default:0,description:'Decimal places of the signed feedback value, from 0 to 18; "9977" with 2 means 99.77.'},tag1:{type:"string",description:"Optional filter tag such as starred, uptime, successRate, responseTime."},tag2:{type:"string",description:"Second feedback category tag to record or filter."},endpoint:{type:"string",description:"Optional endpoint the feedback is about."},feedbackURI:{type:"string",description:"Optional HTTPS/IPFS URI of an off-chain feedback file."},feedbackHash:{...O,description:"keccak256 of the feedbackURI content; optional for IPFS, recommended for HTTPS."},...k}},async(e,a)=>{let{address:i}=x(o),t=T(e.agentId);if(typeof e.value!="string"||!/^-?[0-9]+$/.test(e.value))throw new f("Provide value as a signed integer string.");let n=BigInt(e.value);if(n>z||n<-z)throw new f("The feedback value is out of range (\xB11e38).");let r=e.valueDecimals===void 0?0:e.valueDecimals;if(typeof r!="number"||!Number.isInteger(r)||r<0||r>18)throw new f("valueDecimals must be an integer from 0 to 18.");let s=I(e.tag1,"tag1",128),b=I(e.tag2,"tag2",128),p=e.endpoint===void 0?"":I(e.endpoint,"endpoint",2048),u=e.feedbackURI===void 0?"":j(e.feedbackURI,"feedbackURI"),w=e.feedbackHash===void 0?W:B(e.feedbackHash,"feedbackHash"),R=q({abi:m,functionName:"giveFeedback",args:[t,n,r,s,b,p,u,w]});return E(o,a,e,{to:i,data:R,description:`Give feedback ${e.value}e-${r} to ERC-8004 agent ${t}.`,summary:`Publishes feedback ${_(n,r)} about agent ${t}${s?` (tag ${$(s)})`:""} from this wallet. Feedback is public and attributable to this wallet; it can be revoked later but never erased. Repeat with transactionHash to read back the feedback index.`,authority:async()=>{await P(t);let{registry:h,chainId:d}=U(o);if(await o.clientFor(d).readContract({address:h,abi:N,functionName:"isAuthorizedOrOwner",args:[a,t]})===!0)throw new f("The registry refuses feedback from the owner or an approved operator of the same agent.")},verify:async h=>{let d=C(h,i,m,"NewFeedback"),c=d.feedbackIndex,F=await l(i,"readFeedback",[t,a,c]);if(d.agentId!==t||!S(String(d.clientAddress),a)||d.value!==n||F[0]!==n||F[4])throw new f("The registry event or stored feedback does not match.");return{agentId:t.toString(),feedbackIndex:c.toString(),value:_(n,r),confirmed:!0}}})}),Y=g("erc8004_revoke_feedback",{type:"object",additionalProperties:!1,required:["agentId","feedbackIndex"],properties:{agentId:A,feedbackIndex:{type:"string",pattern:"^[1-9][0-9]*$",description:"Feedback entry identifier as a one-based decimal string."},...k}},async(e,a)=>{let{address:i}=x(o),t=T(e.agentId),n=v(e.feedbackIndex);return E(o,a,e,{to:i,data:q({abi:m,functionName:"revokeFeedback",args:[t,n]}),description:`Revoke feedback #${n} on ERC-8004 agent ${t}.`,summary:`Marks your feedback #${n} about agent ${t} as revoked. The original entry stays on-chain, flagged revoked. Repeat with transactionHash to verify.`,authority:async()=>{let r=await l(i,"getLastIndex",[t,a]);if(n>r)throw new f(`This wallet has given only ${r} feedback entries on agent ${t}.`);if((await l(i,"readFeedback",[t,a,n]))[4])throw new f("That feedback is already revoked.")},verify:async r=>{let s=C(r,i,m,"FeedbackRevoked"),b=await l(i,"readFeedback",[t,a,n]);if(s.agentId!==t||s.feedbackIndex!==n||!S(String(s.clientAddress),a)||!b[4])throw new f("The registry event or stored feedback does not show a revocation.");return{agentId:t.toString(),feedbackIndex:n.toString(),revoked:!0}}})}),Z=g("erc8004_append_response",{type:"object",additionalProperties:!1,required:["agentId","clientAddress","feedbackIndex","responseURI"],description:"Append a public response to a feedback entry (the agent showing a refund, or anyone tagging spam).",properties:{agentId:A,clientAddress:{...H,description:"The wallet that gave the feedback."},feedbackIndex:{type:"string",pattern:"^[1-9][0-9]*$",description:"Feedback entry identifier as a one-based decimal string."},responseURI:{type:"string",description:"HTTPS or IPFS URI of the response file."},responseHash:{...O,description:"keccak256 of the response content; optional for IPFS."},...k}},async(e,a)=>{let{address:i}=x(o),t=T(e.agentId),n=D(e.clientAddress,"clientAddress"),r=v(e.feedbackIndex),s=j(e.responseURI,"responseURI"),b=e.responseHash===void 0?W:B(e.responseHash,"responseHash");return E(o,a,e,{to:i,data:q({abi:m,functionName:"appendResponse",args:[t,n,r,s,b]}),description:`Append a response to feedback #${r} by ${n} on ERC-8004 agent ${t}.`,summary:`Publishes a response (${$(s)}) under feedback #${r} that ${n} gave agent ${t}, attributed to this wallet. Responses are append-only. Repeat with transactionHash to verify.`,authority:async()=>{let p=await l(i,"getLastIndex",[t,n]);if(r>p)throw new f(`${n} has given only ${p} feedback entries on agent ${t}.`)},verify:async p=>{let u=C(p,i,m,"ResponseAppended");if(u.agentId!==t||u.feedbackIndex!==r||!S(String(u.clientAddress),n)||!S(String(u.responder),a)||u.responseURI!==s)throw new f("The registry event does not match the response.");return{agentId:t.toString(),clientAddress:n,feedbackIndex:r.toString(),responder:a,confirmed:!0}}})}),J=g("erc8004_reputation",{type:"object",additionalProperties:!1,required:["agentId"],description:"Read-only: an agent's feedback summary and entries. Pass the reviewers you trust in clients; without it the summary counts every wallet, which anyone can spam.",properties:{agentId:A,clients:{type:"array",maxItems:200,items:H,description:"Reviewer wallets to count (recommended)."},tag1:{type:"string",description:"First feedback category tag to filter."},tag2:{type:"string",description:"Second feedback category tag to record or filter."},includeRevoked:{type:"boolean",default:!1,description:"Include feedback entries revoked by their authors."},limit:{type:"integer",minimum:1,maximum:200,default:50,description:"Maximum feedback entries to return, from 1 to 200."},clientAddress:{...H,description:"With feedbackIndex: also count responses to that one entry."},feedbackIndex:{type:"string",pattern:"^[1-9][0-9]*$",description:"Feedback entry identifier as a one-based decimal string."}}},async e=>{let{address:a}=x(o),i=T(e.agentId);await P(i);let t=I(e.tag1,"tag1",128),n=I(e.tag2,"tag2",128),r=typeof e.limit=="number"?Math.min(Math.max(1,Math.trunc(e.limit)),200):50,s=Array.isArray(e.clients)?e.clients.map(d=>D(d,"client")):void 0;if(s&&s.length>200)throw new f("Provide at most 200 reviewer wallets.");let b=s??await l(a,"getClients",[i]),p=b.slice(0,200),u={count:"0",value:"0",valueDecimals:0},w=[],R=0;if(p.length){let[d,c]=await Promise.all([l(a,"getSummary",[i,p,t,n]),l(a,"readAllFeedback",[i,p,t,n,e.includeRevoked===!0])]);u={count:d[0].toString(),value:_(d[1],d[2]),valueDecimals:d[2]},R=c[0].length,w=c[0].slice(0,r).map((F,y)=>({clientAddress:F,feedbackIndex:c[1][y].toString(),value:_(c[2][y],c[3][y]),valueDecimals:c[3][y],tag1:$(c[4][y]),tag2:$(c[5][y]),revoked:c[6][y]}))}let h;if(e.clientAddress!==void 0){let d=D(e.clientAddress,"clientAddress"),c=e.feedbackIndex===void 0?0n:v(e.feedbackIndex);h=(await l(a,"getResponseCount",[i,d,c,[]])).toString()}return{agentId:i.toString(),registry:a,clientsTotal:b.length,clientsUsed:p.length,filteredByClients:s!==void 0,summary:u,feedback:w,feedbackTotal:R,truncated:R>w.length||b.length>p.length,...h===void 0?{}:{responseCount:h},note:s?"Summary counts only the reviewers you named.":"Unfiltered: every reviewer wallet counts, and anyone can post feedback for free, so a high score is not evidence. Name trusted reviewers in clients for a meaningful score."}});return{tools:[X,Y,Z,J]}};export{_ as a,ie as b};
@@ -0,0 +1 @@
1
+ import{e as P,h as T,n as A}from"./4FPV4CRC.js";import{a as h,b as k,f as y,g as m}from"./J73ATSEQ.js";import{O as b,b as I}from"./BAIY32AV.js";import{a as N}from"./66F5ZH34.js";import{c as w,g}from"./NWNYJ26T.js";import{a as v}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{encodeFunctionData as c,parseAbi as _,zeroAddress as F}from"viem";var i=_(["function ownerOf(uint256) view returns (address)","function getApproved(uint256) view returns (address)","function getPositionLiquidity(uint256) view returns (uint128)","function safeTransferFrom(address from,address to,uint256 tokenId)","function approve(address spender,uint256 tokenId)","function burn(uint256 tokenId)"]),q={version:{description:'Uniswap version: "v3" for concentrated liquidity or "v4" for PoolManager.',type:"string",enum:["v3","v4"]},tokenId:N('Identifier of the position NFT, as a decimal string. Example: "1".'),operation:{description:'Choose "transfer" to move the NFT, "approve" to grant an NFT approval, "revoke" to clear it or "burn" to destroy an empty NFT.',type:"string",enum:["transfer","approve","revoke","burn"]},target:{...w,description:"Intended NFT recipient or per-NFT approved operator address; required for transfer or approve."}};function $(s){return{tools:[!1,!0].map(f=>({name:f?"uniswap_position_manage":"uniswap_position_status",inputSchema:{type:"object",additionalProperties:!1,required:f?["version","tokenId","operation"]:["version","tokenId"],properties:q},async execute(e,p){if(e.version!=="v3"&&e.version!=="v4")throw new n("Specify position version v3 or v4.");let o=h(e.tokenId,"tokenId"),a=e.version==="v3"?P.positionManager:I,d=s.clientFor(v),l=await d.readContract({address:a,abi:i,functionName:"ownerOf",args:[o]});if(!f){m(e,["version","tokenId"]);let r=await d.readContract({address:a,abi:i,functionName:"getApproved",args:[o]});return{version:e.version,tokenId:o.toString(),manager:a,owner:l,approved:r}}if(!g(l,p))throw new n("Only manage a Uniswap NFT owned by the signing wallet.");let t=e.operation;m(e,["version","tokenId","operation",...["transfer","approve"].includes(String(t))?["target"]:[]]);let u;if(t==="transfer"||t==="approve"){let r=k(e.target);if(r===F)throw new n("Choose a nonzero target, or operation revoke to clear approval.");u=t==="transfer"?c({abi:i,functionName:"safeTransferFrom",args:[p,r,o]}):c({abi:i,functionName:"approve",args:[r,o]})}else if(t==="revoke")u=c({abi:i,functionName:"approve",args:[F,o]});else if(t==="burn"){if(e.version==="v4"){if(await d.readContract({address:a,abi:i,functionName:"getPositionLiquidity",args:[o]})!==0n)throw new n("Remove all liquidity before burning an empty position.");return b(s).tools.find(S=>S.name==="uniswap_remove").execute({version:"v4",tokenId:o.toString(),liquidity:"all",amount0Min:"0",amount1Min:"0"},p)}let r=A(await d.readContract({address:a,abi:T,functionName:"positions",args:[o]}));if(r.liquidity!==0n||r.tokensOwed0!==0n||r.tokensOwed1!==0n)throw new n("Remove liquidity and collect all owed tokens before burning a v3 NFT.");u=c({abi:i,functionName:"burn",args:[o]})}else throw new n("Choose transfer, approve, revoke or burn. Operator-wide approvals are not exact approvals.");return y(s,[s.unsignedTx({to:a,data:u,value:"0",chainId:v,description:`${t} Uniswap ${e.version} NFT #${o}${e.target?` with target ${e.target}`:""}.`})],p,"Position ownership or exact per-NFT approval changes. A transferred position includes its liquidity and accrued rights; burn requires an empty NFT.")}}))}}export{i as a,$ as b};
@@ -0,0 +1 @@
1
+ import{g as m}from"./3VBIRLU3.js";import{a as U}from"./43LI5NKJ.js";import{a as w}from"./66F5ZH34.js";import{h as x}from"./NWNYJ26T.js";import{a as l,i as E}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{encodeFunctionData as k,getAddress as D,parseAbi as T,parseAbiItem as P,zeroAddress as R}from"viem";var b=D("0x23e99d72e24dc538c955b9bade710d2ce3a7fca4"),I={address:D(E[l].tokens.USDG.address),symbol:"USDG",decimals:6,chainId:l},f=T(["function rewardToken() view returns (address)","function owner() view returns (address)","function publisher() view returns (address)","function epochs(uint256) view returns (bytes32 root,uint128 total,uint128 claimed,uint64 expiry,bool swept)","function hasClaimed(uint256,address) view returns (bool)","function claimable(uint256 epochId,address account,uint256 amount,bytes32[] proof) view returns (bool)","function claim(uint256 epochId,uint256 amount,bytes32[] proof)","function setPublisher(address publisher)","function sweep(uint256 epochId,address to)","function fundEpoch(uint256 epochId,bytes32 root,uint256 total,uint64 expiry)","function transferOwnership(address newOwner)","function renounceOwnership()"]),C=P("event EpochFunded(uint256 indexed epochId,bytes32 root,uint256 total,uint64 expiry)"),O=p=>{if(typeof p!="string"||!/^0x[0-9a-f]{64}$/i.test(p))throw new n("Provide a bytes32 Merkle root or proof element.");return p};function G(p){if(!Array.isArray(p)||p.length>64)throw new n("Provide the publisher\u2019s Merkle proof array (at most 64 elements).");return p.map(O)}var j=p=>{async function v(){let e=p.clientFor(l);if(await e.getChainId()!==l)throw new n("Longbow rebates require chain 4663.");let a=await e.getBlock(),s=(o,c=[])=>e.readContract({address:b,abi:f,functionName:o,args:c,blockNumber:a.number}),i=await s("rewardToken");if(!x(i,I.address))throw new n("The Longbow rebate distributor does not report canonical USDG.");return{client:e,block:a,read:s}}async function S(e,a,s,i){let[o,c]=await Promise.all([s("epochs",[e]),s("hasClaimed",[e,a])]);if(!Array.isArray(o)||o.length!==5||typeof c!="boolean")throw new n("Invalid rebate epoch state.");let[r,d,u,h,t]=o;if(typeof d!="bigint"||typeof u!="bigint"||u>d||typeof h!="bigint"||typeof t!="boolean")throw new n("Invalid rebate epoch amounts.");return{epochId:e.toString(),root:O(r),total:d.toString(),claimedAmount:u.toString(),outstanding:(t?0n:d-u).toString(),expiry:h.toString(),swept:t,hasClaimed:c,open:r!==`0x${"0".repeat(64)}`&&!t&&i<h}}let A=(e,a,s,i)=>({name:e,inputSchema:{type:"object",properties:a,required:s,additionalProperties:!1},execute:async(o,c)=>{try{if(U(c),Object.keys(o).some(r=>!Object.hasOwn(a,r)))throw new n("Unsupported Longbow rebate argument.");return await i(o,c)}catch(r){throw new n(p.plainError(r))}}});return{tools:[A("longbow_rebates",{epochIds:{type:"array",maxItems:100,description:"Rebate epoch ids to read, at most 100. Use this or fromBlock, not both.",items:w("Rebate epoch id, as a decimal string.")},fromBlock:w("Block number to start scanning for funded epochs, as a decimal string. Default is the last 100000 blocks; at most 1000000 blocks are scanned.")},[],async(e,a)=>{let{client:s,read:i,block:o}=await v();if(e.epochIds!==void 0&&e.fromBlock!==void 0)throw new n("Use epochIds or fromBlock, not both.");let c,r;if(e.epochIds!==void 0){if(!Array.isArray(e.epochIds)||e.epochIds.length>100)throw new n("Provide at most 100 rebate epochIds.");c=e.epochIds.map(t=>m(t))}else{if(r=e.fromBlock===void 0?o.number>100000n?o.number-100000n:0n:m(e.fromBlock),r>o.number||o.number-r>1000000n)throw new n("Read at most 1000000 blocks per rebate discovery window.");let t=await s.getLogs({address:b,event:C,fromBlock:r,toBlock:o.number,strict:!0});if(c=[...new Set(t.map(y=>y.args.epochId))],c.length>100)throw new n("Too many rebate epochs; narrow the block window.")}let[d,u,h]=await Promise.all([i("owner"),i("publisher"),Promise.all(c.map(t=>S(t,a,i,o.timestamp)))]);return{chainId:l,distributor:b,token:I,blockNumber:o.number.toString(),owner:d,publisher:u,epochs:h,scannedFromBlock:r?.toString()??null,caveat:"Discovery covers only these IDs or this event window. Amounts/proofs require the publisher\u2019s tree; the app does not expose a verified proof endpoint. Claims expire at each on-chain expiry, even if app prose says otherwise."}}),A("longbow_claim_rebate",{epochId:w("Rebate epoch id to claim from, as a decimal string."),amount:w('Amount of USDG you are entitled to in this epoch, in base units (USDG has 6 decimals). Example: "1000000" = 1 USDG.'),proof:{type:"array",maxItems:64,description:"Merkle proof for this wallet and amount from the rebate publisher, as 0x-prefixed 32-byte hex strings.",items:{type:"string"}}},["epochId","amount","proof"],async(e,a)=>{let s=m(e.epochId),i=m(e.amount),o=G(e.proof),{read:c,block:r}=await v(),d=await S(s,a,c,r.timestamp);if(!d.open||d.hasClaimed||i===0n||await c("claimable",[s,a,i,o])!==!0)throw new n("Rebate is closed, already claimed or not proven for this wallet and amount.");let u=`Claim ${i} USDG base units from Longbow rebate epoch ${s} to this wallet ${a}. No approvals.`,h=[p.unsignedTx({to:b,data:k({abi:f,functionName:"claim",args:[s,i,o]}),value:"0",chainId:l,description:u})],t=await p.preview(h,a);if(t.changes.filter(g=>g.token.chainId===l&&x(g.token.address,I.address)&&g.token.decimals===6).reduce((g,B)=>g+BigInt(B.amount),0n)!==i)throw new n("Rebate preview does not return the exact proven USDG amount.");return{txs:h,preview:t,summary:`${u} ${t.summary}`}}),A("longbow_manage_rebates",{operation:{enum:["setPublisher","fundEpoch","sweep","transferOwnership","renounceOwnership"],description:"Distributor admin call: set the publisher, fund an epoch (publisher), sweep an expired epoch, transfer ownership, or renounce it permanently (owner)."},epochId:w("Rebate epoch id, as a decimal string. Used by fundEpoch and sweep."),root:{type:"string",description:"Merkle root of the epoch claims, as 0x followed by 64 hex digits. Used by fundEpoch."},amount:w('Total USDG funded into the epoch, in base units (USDG has 6 decimals). Example: "1000000" = 1 USDG. Used by fundEpoch.'),expiry:w("Unix seconds when claims close; must be at least 30 days ahead. Used by fundEpoch."),account:{type:"string",description:"Address that receives the role or funds: new publisher, new owner, or the sweep recipient."}},["operation"],async(e,a)=>{let{read:s,block:i}=await v(),o=e.operation==="fundEpoch";if(!x(await s(o?"publisher":"owner"),a))throw new n("This wallet lacks the rebate publisher/owner role.");let c=o?["operation","epochId","root","amount","expiry"]:e.operation==="sweep"?["operation","epochId","account"]:e.operation==="renounceOwnership"?["operation"]:["operation","account"];if(Object.keys(e).some(t=>!c.includes(t)))throw new n("Unexpected fields for this rebate management operation.");let r,d=0n;if(o){let t=m(e.expiry,64);if(d=m(e.amount,128),d===0n||t<i.timestamp+30n*86400n)throw new n("Fund a positive rebate amount with at least 30 days to claim.");r=k({abi:f,functionName:"fundEpoch",args:[m(e.epochId),O(e.root),d,t]})}else if(e.operation==="renounceOwnership")r=k({abi:f,functionName:"renounceOwnership"});else{if(typeof e.account!="string")throw new n("Provide the explicit publisher, owner or sweep recipient.");U(e.account);let t=D(e.account);if(t===R)throw new n("The rebate recipient/role cannot be zero.");if(e.operation==="sweep"){let y=await S(m(e.epochId),a,s,i.timestamp);if(y.swept||i.timestamp<BigInt(y.expiry))throw new n("Only expired, unswept rebate epochs can be swept.");r=k({abi:f,functionName:"sweep",args:[m(e.epochId),t]})}else if(e.operation==="setPublisher"||e.operation==="transferOwnership")r=k({abi:f,functionName:e.operation,args:[t]});else throw new n("Choose a supported rebate management operation.")}let u=`Longbow rebate ${String(e.operation)}: ${JSON.stringify(e)}. ${e.operation==="renounceOwnership"?"Owner administration is permanently relinquished.":""}`,h=[...o?[p.approval(I.address,b,d.toString(),l)]:[],p.unsignedTx({to:b,data:r,value:"0",chainId:l,description:u})];return{txs:h,preview:await p.preview(h,a),summary:u}})]}};export{b as a,f as b,j as c};
@@ -0,0 +1 @@
1
+ import{n as k}from"./CAWTAR5V.js";import{a as A}from"./UEDGYZOC.js";import{b as T}from"./43LI5NKJ.js";import{b as D}from"./66F5ZH34.js";import{c as _,d as I,g as v,i as $,n as V}from"./NWNYJ26T.js";import{a as u}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeFunctionData as R,erc20Abi as O,getAddress as C,parseAbi as S}from"viem";var N=C("0x0000000000bbf5c5fd284e657f01bd000933c96d"),b=C("0x0a0d53b6684c7b32b4cbef5fe8483bfcc8406742"),U=C("0x00700052c0608F670705380a4900e0a8080010CC"),x=S(["function getCollectedFees(address partner,address token) view returns (uint256)","function withdrawAllFees(address token,address recipient) returns (uint256 amount)","function getBalance(address token,address partner) view returns (uint256)","function withdrawAllERC20(address token,address recipient) returns (bool)","function withdrawNative(uint256 amount,address owner,address receiver)"]),H=(1n<<256n)-1n,B={description:'Choose "market" for market-swap fees or "delta" for Delta fees.',type:"string",enum:["market","delta"]};function w(t){return $(t,"Provide a token or wallet address.",I)}function y(t){if(t!=="market"&&t!=="delta")throw new o("Choose market or delta fees.");return t}function P(t){return V(t,"Amount must be positive and within uint256.",{notString:"Amount must be a decimal base-unit string.",positive:!0}).toString()}function E(t,m,d){if(d=w(d),t==="velora_unwrap_deth"){for(let e of Object.keys(m))if(e!=="amount")throw new o(`Unsupported ${t} argument: ${e}.`);let a=P(m.amount);return{tx:T({to:b,chainId:u,value:"0",data:R({abi:x,functionName:"withdrawNative",args:[BigInt(a),d,d]}),description:`Unwrap ${a} dETH base units into the same amount of native ETH for ${d} on chain ${u}.`}),inputs:[{token:b,amount:a}]}}if(t!=="velora_claim_fees")throw new o("Unknown Velora claim action.");for(let a of Object.keys(m))if(!["token","kind"].includes(a))throw new o(`Unsupported ${t} argument: ${a}.`);let f=w(m.token);if(k(f))throw new o("Velora fee claims require an ERC-20 token address.");let c=y(m.kind);return{tx:T({to:c==="delta"?N:U,chainId:u,value:"0",data:R({abi:x,functionName:c==="delta"?"withdrawAllFees":"withdrawAllERC20",args:[f,d]}),description:`Claim the full accrued ${c} fee balance of ${f} to ${d} on chain ${u}. Receipt amount can change before mining; no minimum is encoded.`}),inputs:[]}}function Q(t,m,d,f){let{tx:c}=E(m,d,f),a=t[0];if(t.length!==1||!a||a.chainId!==c.chainId||!v(a.to,c.to)||!v(a.data,c.data)||a.value!==c.value)throw new o("Velora claim calldata, recipient, amount or destination differs from the request.")}function X(t){let m=async()=>{let e=t.clientFor(u);if(await e.getChainId()!==u)throw new o("Velora requires an RPC on chain 4663.");return e};async function d(e){if(e===b)return{address:e,symbol:"dETH",decimals:18,chainId:u};let n=await m(),[s,r]=await Promise.all([A(n,u,e,"symbol"),A(n,u,e,"decimals")]);if(typeof s!="string"||!s.trim()||!Number.isInteger(r)||r<0||r>255)throw new o("Velora fee token metadata is unavailable.");return{address:e,symbol:s,decimals:r,chainId:u}}async function f(e,n){let s=y(e.kind),r=w(e.token);if(k(r))throw new o("Velora fee claims require an ERC-20 token address.");let i=await(await m()).readContract({address:s==="delta"?N:U,abi:x,functionName:s==="delta"?"getCollectedFees":"getBalance",args:s==="delta"?[n,r]:[r,n]});if(typeof i!="bigint"||i<0n||i>H)throw new o("Velora fee balance is unavailable.");return i}function c(e,n,s,r){return{name:e,inputSchema:{type:"object",additionalProperties:!1,properties:n,required:s},execute:async(p,i)=>{try{i=w(i);for(let l of Object.keys(p))if(!Object.hasOwn(n,l))throw new o(`Unsupported ${e} argument: ${l}.`);return await r(p,i)}catch(l){throw new o(t.plainError(l))}}}}let a={token:{..._,description:"Address of the token to inspect or use."},kind:B};return[c("velora_fee_balance",a,["token","kind"],async(e,n)=>({kind:y(e.kind),token:await d(w(e.token)),amount:(await f(e,n)).toString()})),c("velora_claim_fees",a,["token","kind"],async(e,n)=>{let{tx:s}=E("velora_claim_fees",e,n),r=await f(e,n);if(r===0n)throw new o("No accrued Velora fees for this wallet and token.");let p=await d(w(e.token)),i=[s],l=await t.preview(i,n);return{txs:i,preview:l,estimatedReceipt:{token:p,amount:r.toString()},summary:`${s.description} ${l.summary}`}}),c("velora_unwrap_deth",{amount:D('Amount of wallet-held dETH in base units (18 decimals). Example: "1000000000000000000" = 1 dETH.')},["amount"],async(e,n)=>{let{tx:s,inputs:r}=E("velora_unwrap_deth",e,n),i=await(await m()).readContract({address:b,abi:O,functionName:"balanceOf",args:[n]});if(typeof i!="bigint"||i<0n||i>H)throw new o("Wallet dETH balance is unavailable.");if(i<BigInt(r[0].amount))throw new o("Insufficient wallet-held dETH. An active native Delta order must first settle, expire or cancel.");let l=[s],g=await t.preview(l,n);if(g.changes.filter(h=>h.token.chainId===u&&k(h.token.address)).reduce((h,F)=>h+BigInt(F.amount),0n)<BigInt(r[0].amount))throw new o("Velora dETH preview does not return the requested native ETH amount.");return{txs:l,preview:g,summary:`${s.description} ${g.summary}`}})]}export{N as a,b,U as c,x as d,E as e,Q as f,X as g};
@@ -1 +1 @@
1
- import{a as S}from"./WWNAGOCD.js";import{c as U}from"./74Y2KDNR.js";import{b as R,c as I,d as j,e as C,g as D,h as V,j as t,k as w,l as E,m as B,o as n,p as o,q as d,r as p,s as y,v as H}from"./JVLLVNF2.js";import{b as a,f as F,g as L,h as O,i as q}from"./MQK6OP7S.js";import{a as s}from"./XSD5NL7J.js";import{getAddress as i}from"viem";async function re(r,m,x,u=[]){let e=await O(r,x);await L(r,e.number,[a.launcherV1,d,a.rulesV1,a.agentGateV1]);let l=i(a.launcherV1),[h,_,z,N,Q,K,G,W,$,J,X,A,b]=await Promise.all([U(r,e.number,m,u),o(r,l,j,"launchFee",[],e.number),o(r,p,n("registry"),"rootOpenFor",[d,m],e.number),o(r,p,n("registry"),"newMarketsPaused",[],e.number),o(r,p,n("registry"),"isLauncher",[l],e.number),o(r,d,n("rootV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"registry",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"trustedRoot",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"poolManager",[],e.number),o(r,p,n("registry"),"admission",[d,i(a.rulesV1)],e.number),o(r,i(a.rulesV1),n("rulesV1"),"configSchemaHash",[],e.number),o(r,p,n("registry"),"quoteAssets",[],e.number)]);if(K!==y||G!==y||W!==p||$!==d||J!==y)throw new s("Hookr launch dependency wiring differs from the reviewed deployment.");V(A);let c=B(X),g=B(c.caps);if(c.implementation!==i(a.rulesV1)||t(c.kind,8)!==0n||c.codeHash!==F(a.rulesV1).codeHash||c.schemaHash!==A||t(c.gasLimit,32)===0n||t(g.maxLpFeePips,24)>600000n||t(g.maxQuoteTakePips,24)>=1000000n||t(g.maxSubjectTakeBps,16)>1000n)throw new s("Hookr core admission, schema or caps differ from the supported launch profile.");if(!Array.isArray(b)||b.length>32)throw new s("Hookr qualified quote list is incomplete or exceeds the bounded read.");let T=[];for(let f=0;f<b.length;f+=2)T.push(...await Promise.all(b.slice(f,f+2).map(ee=>H(r,i(String(ee)),e.number))));let Y=await H(r,i("0x0000000000000000000000000000000000000000"),e.number),k=E(_,5),Z={token:Y,amount:t(k[0]).toString(),currency:"ETH",decimals:18,treasury:i(String(k[1])),pendingAmount:t(k[2]).toString(),pendingTreasury:i(String(k[3])),readyAt:t(k[4]).toString()},M=w(z),P=w(N),v=w(Q);return await q(r,e),{chainId:4663,blockNumber:e.number.toString(),blockHash:e.hash,timestamp:e.timestamp.toString(),version:"hookr-launcher-v1",launcher:l,root:d,core:i(a.rulesV1),poolManager:y,permissionMask:"0x2acc",launchFee:Z,qualifiedQuotes:T,coreAdmission:{schemaHash:A,gasLimit:t(c.gasLimit,32).toString(),caps:{maxLpFeePips:t(g.maxLpFeePips,24).toString(),maxQuoteTakePips:t(g.maxQuoteTakePips,24).toString(),maxSubjectTakeBps:t(g.maxSubjectTakeBps,16).toString()}},gate:h,rootOpenForWallet:M,newMarketsPaused:P,launcherAdmitted:v,launchAvailable:M&&!P&&v&&h.healthyIdentityOnly&&h.walletAgent,scoreLaunchAvailable:M&&!P&&v&&h.healthyForScores&&h.walletAgent,supportedSettings:{route:"launchAdvised",members:"1",tokenKinds:["new"],reservedTokenKinds:["existing"],tickSpacing:String(S.tickSpacing),baseLpFeePips:String(S.baseLpFeePips),deadlineSecondsMax:S.deadlineSeconds.toString(),guardEndBlock:"0",burnBps:"0",royaltyBps:"0",integrator:null,nameMaxUtf8Bytes:"48",symbolMaxUtf8Bytes:"12",supplyMaxBaseUnits:((1n<<108n)-1n).toString(),liquidityMax:((1n<<127n)-1n).toString(),fee:"8388608",tickSpacingMin:"1",tickSpacingMax:"32767",tickMin:"-887272",tickMax:"887272",requiresTickAlignment:!0,gateRequired:!0,gatePhases:"1",gateFailOpen:!1,arbitraryAdvisories:!1,devBuy:!1,locks:!1,ownedRoot:!1,lpRewardsBpsMax:"1000",lpRewardsPlusBurnBpsMax:"1000",totalLpFeePipsMax:"600000",protocolShareBpsMin:"2000",protocolShareBpsMax:"5000",existingTokenFunding:"requires a separately qualified token route"},readStatus:"complete",warnings:["Read-only admission snapshot. hookr_launch supports one new-token agents-only pool with the fixed profile; add/collect/remove require separate tools.","Oak identity linking alone does not establish on-chain Hookr gate eligibility.",h.reviewerSetsNotice]}}function le(r){return[{name:"hookr_launch_options",inputSchema:{type:"object",additionalProperties:!1,properties:{...I,reviewerSetIds:{type:"array",maxItems:8,uniqueItems:!0,items:R,description:"Existing registered reviewer set IDs to inspect; no alias or arbitrary reviewer address."}}},execute:async(m,x)=>{if(C(m,["blockNumber","reviewerSetIds"]),r.network==="testnet")throw new s("Hookr launch reads are configured only on mainnet, chain 4663.");let u=m.reviewerSetIds??[];if(!Array.isArray(u)||u.length>8||new Set(u).size!==u.length)throw new s("Provide at most eight distinct reviewer set IDs.");let e=u.map(V);if(new Set(e).size!==e.length)throw new s("Provide distinct reviewer set IDs.");try{return await re(r.clientFor(4663),x,D(m),e)}catch(l){throw l instanceof s?l:new s("Hookr launch settings are unavailable at the named block. Retry the complete read; no zero fee or healthy gate is implied.")}}}]}export{re as a,le as b};
1
+ import{a as S}from"./WWNAGOCD.js";import{c as U}from"./XYPGLG6A.js";import{b as R,c as I,d as j,e as C,g as D,h as V,j as t,k as w,l as E,m as B,o as n,p as o,q as d,r as p,s as y,v as H}from"./2E4I7CJ7.js";import{b as a,f as F,g as L,h as O,i as q}from"./MQK6OP7S.js";import{a as s}from"./XSD5NL7J.js";import{getAddress as i}from"viem";async function re(r,m,x,u=[]){let e=await O(r,x);await L(r,e.number,[a.launcherV1,d,a.rulesV1,a.agentGateV1]);let l=i(a.launcherV1),[h,_,z,N,Q,K,G,W,$,J,X,A,b]=await Promise.all([U(r,e.number,m,u),o(r,l,j,"launchFee",[],e.number),o(r,p,n("registry"),"rootOpenFor",[d,m],e.number),o(r,p,n("registry"),"newMarketsPaused",[],e.number),o(r,p,n("registry"),"isLauncher",[l],e.number),o(r,d,n("rootV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"registry",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"trustedRoot",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"poolManager",[],e.number),o(r,p,n("registry"),"admission",[d,i(a.rulesV1)],e.number),o(r,i(a.rulesV1),n("rulesV1"),"configSchemaHash",[],e.number),o(r,p,n("registry"),"quoteAssets",[],e.number)]);if(K!==y||G!==y||W!==p||$!==d||J!==y)throw new s("Hookr launch dependency wiring differs from the reviewed deployment.");V(A);let c=B(X),g=B(c.caps);if(c.implementation!==i(a.rulesV1)||t(c.kind,8)!==0n||c.codeHash!==F(a.rulesV1).codeHash||c.schemaHash!==A||t(c.gasLimit,32)===0n||t(g.maxLpFeePips,24)>600000n||t(g.maxQuoteTakePips,24)>=1000000n||t(g.maxSubjectTakeBps,16)>1000n)throw new s("Hookr core admission, schema or caps differ from the supported launch profile.");if(!Array.isArray(b)||b.length>32)throw new s("Hookr qualified quote list is incomplete or exceeds the bounded read.");let T=[];for(let f=0;f<b.length;f+=2)T.push(...await Promise.all(b.slice(f,f+2).map(ee=>H(r,i(String(ee)),e.number))));let Y=await H(r,i("0x0000000000000000000000000000000000000000"),e.number),k=E(_,5),Z={token:Y,amount:t(k[0]).toString(),currency:"ETH",decimals:18,treasury:i(String(k[1])),pendingAmount:t(k[2]).toString(),pendingTreasury:i(String(k[3])),readyAt:t(k[4]).toString()},M=w(z),P=w(N),v=w(Q);return await q(r,e),{chainId:4663,blockNumber:e.number.toString(),blockHash:e.hash,timestamp:e.timestamp.toString(),version:"hookr-launcher-v1",launcher:l,root:d,core:i(a.rulesV1),poolManager:y,permissionMask:"0x2acc",launchFee:Z,qualifiedQuotes:T,coreAdmission:{schemaHash:A,gasLimit:t(c.gasLimit,32).toString(),caps:{maxLpFeePips:t(g.maxLpFeePips,24).toString(),maxQuoteTakePips:t(g.maxQuoteTakePips,24).toString(),maxSubjectTakeBps:t(g.maxSubjectTakeBps,16).toString()}},gate:h,rootOpenForWallet:M,newMarketsPaused:P,launcherAdmitted:v,launchAvailable:M&&!P&&v&&h.healthyIdentityOnly&&h.walletAgent,scoreLaunchAvailable:M&&!P&&v&&h.healthyForScores&&h.walletAgent,supportedSettings:{route:"launchAdvised",members:"1",tokenKinds:["new"],reservedTokenKinds:["existing"],tickSpacing:String(S.tickSpacing),baseLpFeePips:String(S.baseLpFeePips),deadlineSecondsMax:S.deadlineSeconds.toString(),guardEndBlock:"0",burnBps:"0",royaltyBps:"0",integrator:null,nameMaxUtf8Bytes:"48",symbolMaxUtf8Bytes:"12",supplyMaxBaseUnits:((1n<<108n)-1n).toString(),liquidityMax:((1n<<127n)-1n).toString(),fee:"8388608",tickSpacingMin:"1",tickSpacingMax:"32767",tickMin:"-887272",tickMax:"887272",requiresTickAlignment:!0,gateRequired:!0,gatePhases:"1",gateFailOpen:!1,arbitraryAdvisories:!1,devBuy:!1,locks:!1,ownedRoot:!1,lpRewardsBpsMax:"1000",lpRewardsPlusBurnBpsMax:"1000",totalLpFeePipsMax:"600000",protocolShareBpsMin:"2000",protocolShareBpsMax:"5000",existingTokenFunding:"requires a separately qualified token route"},readStatus:"complete",warnings:["Read-only admission snapshot. hookr_launch supports one new-token agents-only pool with the fixed profile; add/collect/remove require separate tools.","Oak identity linking alone does not establish on-chain Hookr gate eligibility.",h.reviewerSetsNotice]}}function le(r){return[{name:"hookr_launch_options",inputSchema:{type:"object",additionalProperties:!1,properties:{...I,reviewerSetIds:{type:"array",maxItems:8,uniqueItems:!0,items:R,description:"Existing registered reviewer set IDs to inspect; no alias or arbitrary reviewer address."}}},execute:async(m,x)=>{if(C(m,["blockNumber","reviewerSetIds"]),r.network==="testnet")throw new s("Hookr launch reads are configured only on mainnet, chain 4663.");let u=m.reviewerSetIds??[];if(!Array.isArray(u)||u.length>8||new Set(u).size!==u.length)throw new s("Provide at most eight distinct reviewer set IDs.");let e=u.map(V);if(new Set(e).size!==e.length)throw new s("Provide distinct reviewer set IDs.");try{return await re(r.clientFor(4663),x,D(m),e)}catch(l){throw l instanceof s?l:new s("Hookr launch settings are unavailable at the named block. Retry the complete read; no zero fee or healthy gate is implied.")}}}]}export{re as a,le as b};
@@ -0,0 +1 @@
1
+ import{b as _,c as q,d as F,e as O}from"./M7ZXDLKM.js";import{a as N}from"./DSTMEY5F.js";import{a as M}from"./FV4WZOTD.js";import{a as I}from"./OARVU3RC.js";import{c as E}from"./L646YWDP.js";import{b as P}from"./SPJCSEKP.js";import{a as b}from"./43LI5NKJ.js";import{b as G}from"./IX3GZMTM.js";import{a as r,d as $,i as C,j as y}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeFunctionData as g,erc20Abi as D,parseAbi as W}from"viem";var i=C[r].vaults.steakhouse.address,R=(1n<<256n)-1n,l=W(["function asset() view returns (address)","function totalAssets() view returns (uint256)","function convertToAssets(uint256 shares) view returns (uint256 assets)","function previewWithdraw(uint256 assets) view returns (uint256 shares)","function deposit(uint256 assets,address receiver) returns (uint256 shares)","function withdraw(uint256 assets,address receiver,address owner) returns (uint256 shares)","function redeem(uint256 shares,address receiver,address owner) returns (uint256 assets)"]);function S(e){if(typeof e!="bigint"||e<0n||e>R)throw new o("The vault returned an invalid base-unit amount.");return e}function k(e){if(typeof e!="string")throw new o("Amount must be an integer string in base units.");let c=G(e);if(c===0n)throw new o("Amount must be positive.");if(c>R)throw new o("Amount exceeds the uint256 range.");return c}function U(e,c,h=!1){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(w=>!c||!["amount",...h?["force","maxPenaltyAssets","minAmountOut"]:[]].includes(w)))throw new o("Unexpected Steakhouse argument.")}var L=e=>{async function c(t){try{return await t()}catch(s){throw new o(e.plainError(s))}}async function h(){let t=e.clientFor(r);if(await t.getChainId()!==r)throw new o("Steakhouse requires chain 4663.");let s=await t.readContract({address:i,abi:l,functionName:"asset"});if(typeof s!="string"||s.toLowerCase()!==y.toLowerCase())throw new o("The Steakhouse vault asset does not match USDG on chain 4663.");let[a,n]=await Promise.all([t.readContract({address:y,abi:D,functionName:"decimals"}),t.readContract({address:i,abi:D,functionName:"decimals"})]);if(a!==$||!Number.isInteger(n)||n<0||n>255)throw new o("The vault returned invalid asset or share decimals.");return{client:t,asset:{address:y,symbol:"USDG",decimals:a,chainId:r},shares:{address:i,symbol:"steakUSDG",decimals:n,chainId:r}}}async function w(t,s){return S(await t.readContract({address:i,abi:D,functionName:"balanceOf",args:[s]}))}async function x(t,s,a){let n=await e.preview(t,s);if(n.changes.length===0)throw new o("The Steakhouse simulation returned no token balance changes.");let u=n.changes.map(({token:m,amount:d})=>{let f=d.startsWith("-"),p=e.formatAmount(f?d.slice(1):d,m.decimals);return`${f?"-":""}${p} ${m.symbol} (${m.address}, chain ${m.chainId}, decimals ${m.decimals})`});return{txs:t,summary:`${a} ${n.summary} Changes: ${u.join("; ")}.`}}return{tools:[q(e,"steakhouse_details",i),I(e,"steakhouse_analytics",i),M(e,"steakhouse_manage",i),...N(e,"steakhouse",i),{name:"steakhouse_list",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async t=>c(async()=>{U(t,!1);let{client:s,asset:a,shares:n}=await h(),u=S(await s.readContract({address:i,abi:l,functionName:"totalAssets"}));return[{name:"Steakhouse USDG",vault:n,asset:a,totalAssets:{token:a,amount:u.toString()}}]})},{name:"steakhouse_deposit",inputSchema:{...T(!1),description:"Deposit USDG in base units (1 USDG = 1000000) for vault shares. Exit with steakhouse_withdraw; check positions after confirmation."},execute:async(t,s)=>c(async()=>{U(t,!0);let a=k(t.amount);b(s);let{asset:n}=await h(),u=[e.approval(n.address,i,a.toString(),r),e.unsignedTx({to:i,data:g({abi:l,functionName:"deposit",args:[a,s]}),value:"0",chainId:r,description:`Deposit ${e.formatAmount(a.toString(),n.decimals)} USDG into Steakhouse.`})];return x(u,s,"Approve the exact USDG amount, then deposit into Steakhouse.")})},{name:"steakhouse_withdraw",inputSchema:{...T(!0),description:"Withdraw USDG in 6-decimal base units, or amount max to redeem every share for USDG. Check positions after confirmation.",properties:{...T(!0).properties,force:{type:"boolean",description:"Explicitly plan a full Morpho V2 force exit with penalty disclosure."},maxPenaltyAssets:{type:"string",pattern:"^[0-9]+$",description:'Force exit only: most USDG, in base units (6 decimals), you accept losing to the exit penalty. Example: "1000000" = 1 USDG.'},minAmountOut:{type:"string",pattern:"^[0-9]+$",description:'Force exit only: least USDG you must receive, in base units (6 decimals). Example: "1000000" = 1 USDG.'}}},execute:async(t,s)=>c(async()=>{U(t,!0,!0);let a=t.amount==="max"?null:k(t.amount);b(s);let{client:n,asset:u,shares:m}=await h(),d=await w(n,s);if(d===0n)throw new o("The wallet has no Steakhouse shares to withdraw.");if(t.force!==void 0&&typeof t.force!="boolean")throw new o("force must be a boolean.");if(t.force===!0){if(a!==null)throw new o("Force exit currently requires amount max.");let p=E(t.maxPenaltyAssets),j=k(t.minAmountOut),v=await _(e,n,i,s,d,p),A=await e.preview([v.tx],s);return O(A.changes,i,d,j),{txs:[v.tx],preview:A,summary:`${F(v.plan)} ${A.summary}`}}if(t.maxPenaltyAssets!==void 0||t.minAmountOut!==void 0)throw new o("Penalty and output limits require force true.");let f;if(a===null)f=e.unsignedTx({to:i,data:g({abi:l,functionName:"redeem",args:[d,s,s]}),value:"0",chainId:r,description:`Redeem all ${e.formatAmount(d.toString(),m.decimals)} steakUSDG shares.`});else{let p=S(await n.readContract({address:i,abi:l,functionName:"previewWithdraw",args:[a]}));if(p===0n||p>d)throw new o("The withdrawal exceeds the available share balance or has an invalid share quote.");f=e.unsignedTx({to:i,data:g({abi:l,functionName:"withdraw",args:[a,s,s]}),value:"0",chainId:r,description:`Withdraw ${e.formatAmount(a.toString(),u.decimals)} USDG from Steakhouse.`})}return x([f],s,a===null?"Redeem the current full share balance from Steakhouse.":"Withdraw the requested USDG amount from Steakhouse.")})}],positions:t=>c(async()=>{b(t);let{client:s,asset:a,shares:n}=await h(),u=await w(s,t);if(u===0n)return[];let m=S(await s.readContract({address:i,abi:l,functionName:"convertToAssets",args:[u]}));return[{module:"steakhouse",id:`${r}:${i.toLowerCase()}`,chainId:r,assets:[{token:a,amount:m.toString()}],description:`${e.formatAmount(u.toString(),n.decimals)} steakUSDG shares (${i}, chain ${r}, decimals ${n.decimals}); USDG conversion is indicative, not guaranteed exit liquidity.`}]})}};function T(e){return{type:"object",additionalProperties:!1,required:["amount"],properties:{amount:{type:"string",pattern:e?"^(?:[0-9]+|max)$":"^[0-9]+$",description:`Amount of USDG in base units (USDG has 6 decimals)${e?", or max to redeem every share":""}. Example: "1000000" = 1 USDG.`}}}}var te=e=>P("steakhouse",[L(e)]);export{L as a,te as b};
@@ -0,0 +1 @@
1
+ import{a as f}from"./GRSXWQWD.js";import{a as k}from"./G2LAO23N.js";import{c as l}from"./NWNYJ26T.js";import{a as p}from"./FWD4L3CJ.js";import{a as s}from"./XSD5NL7J.js";import{getAddress as g}from"viem";var v={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Hookr v4 pool ID: 32 bytes, 0x followed by 64 hex digits."},b=[["hookr_release",{},[],"Read verified release contracts, block and recapture lane."],["hookr_blocks",{},[],"Read all Hook Blocks and their current availability."],["hookr_kings",{poolId:v},[],"Read King of the Pool rounds, leaders, pots and endings."],["hookr_claims",{poolId:v},[],"Read the signing wallet's prizes, royalties, recapture and PoolManager claims."],["hookr_revenue_tokens",{limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of revenue tokens to return, 1 to 50."},cursor:{type:"string",pattern:"^(v1|v1:[1-9][0-9]{0,19}|v2:[1-9][0-9]{0,19})$",description:"Paging cursor: the nextCursor string from the previous page (v1, v1:N or v2:N); omit for the first page."}},[],"Read revenue tokens, tokenizer provenance, streams and income, page by page."],["hookr_revenue_token",{token:{...l,description:k.address("revenue token")}},["token"],"Read a revenue token, stream endings, income, drops and the signing wallet's claims."],["hookr_hook",{address:{...l,description:k.address("Hookr hook contract")}},["address"],"Read shared or owned hook provenance, ownership, allowed blocks, opening and pools."]],M=[...b.map(d=>d[0]),"hookr_contracts","hookr_read","hookr_revenue_read","hookr_addon_read","hookr_api_read"];function P(d){return[...b.map(([t,c,a,o])=>({name:t,inputSchema:{type:"object",description:o,properties:c,required:a,additionalProperties:!1},execute:async(r,w)=>{if(Object.keys(r).some(n=>!Object.hasOwn(c,n))||a.some(n=>r[n]===void 0))throw new s(`Provide the documented arguments for ${t}.`);let m={};for(let[n,i]of Object.entries(r)){let u=c[n];if(u.type==="integer"){if(typeof i!="number"||!Number.isInteger(i)||i<Number(u.minimum)||i>Number(u.maximum))throw new s("Hookr revenue page limit must be an integer from 1 to 50.")}else if(typeof i!="string"||!new RegExp(String(u.pattern)).test(i))throw new s(`Provide a valid Hookr ${n}.`);m[n]=n==="token"||n==="address"?g(String(i)):i}return(t==="hookr_claims"||t==="hookr_revenue_token")&&(m.account=w),{...await f(d,t,m),chainId:p,source:"https://hookr.fun/api/mcp"}}})),y(d)]}var h={catalog:"/api/hooks/catalog",stats:"/api/protocol-stats",poolApr:"/api/pool-apr",revenueTokens:"/api/revenue-tokens",revenueIncome:"/api/revenue-tokens/income"};function y(d){return{name:"hookr_api_read",inputSchema:{type:"object",description:"Read Hookr public catalog, protocol stats, pool APR, revenue directory/income, or one token's doors/mark. Marks are project metadata, not investment or security endorsements.",properties:{resource:{type:"string",enum:[...Object.keys(h),"revenueDoors","revenueMark"],description:"Public feed to read: catalog, stats, poolApr, revenueTokens, revenueIncome; revenueDoors and revenueMark also need token (that token's doors, or its mark image URL)."},token:{...l,description:k.address("revenue token, only for revenueDoors and revenueMark")}},required:["resource"],additionalProperties:!1},execute:async e=>{if(Object.keys(e).some(o=>!["resource","token"].includes(o))||typeof e.resource!="string")throw new s("Choose a documented Hookr public resource.");let t=["revenueDoors","revenueMark"].includes(e.resource);if(!t&&e.token!==void 0||t&&typeof e.token!="string")throw new s("Only the revenueDoors and revenueMark resources take a token address.");let c;if(t){let o;try{o=g(String(e.token))}catch{throw new s("Provide a valid revenue token address.")}c=`/api/revenue-tokens/${o}/${e.resource==="revenueDoors"?"doors":"mark"}`}else{if(!Object.hasOwn(h,e.resource))throw new s("Choose a documented Hookr public resource.");c=h[e.resource]}let a=`https://hookr.fun${c}`;try{let o=await d.http(a,{method:"GET",redirect:"error",signal:AbortSignal.timeout(15e3)});if(!o.ok)throw new Error("Unavailable");if(e.resource==="revenueMark"){if(!o.headers.get("content-type")?.includes("image/svg+xml"))throw new Error("Invalid mark");return{chainId:p,source:a,imageUrl:a,pngUrl:`${a}.png`,note:"Official SVG mark URL; SVG code is not executed or returned. The PNG URL has not been fetched."}}let r=await o.json();if(!r||typeof r!="object"||"error"in r||"status"in r&&r.status==="unavailable")throw new Error("Unavailable");return{chainId:p,source:a,data:r}}catch{throw new s("Hookr public resource is unavailable. Retry later; no empty or zero result is implied.")}}}}export{M as a,P as b,y as c};
@@ -0,0 +1 @@
1
+ import{a as y,b as P,d as I,e as q,f as T,g as L}from"./J73ATSEQ.js";import{a as w}from"./66F5ZH34.js";import{c as k,g as D}from"./NWNYJ26T.js";import{a as f}from"./FWD4L3CJ.js";import{a as c}from"./XSD5NL7J.js";import{encodeFunctionData as U,erc20Abi as $,getAddress as O,parseAbi as S,zeroAddress as g}from"viem";var _=O("0x8bceaa40b9acdfaedf85adf4ff01f5ad6517937f"),h=O("0x89e5db8b5aa49aa85ac63f691524311aeb649eba"),F=S(["function getPair(address,address) view returns (address)"]),N=S(["function token0() view returns (address)","function token1() view returns (address)","function getReserves() view returns (uint112,uint112,uint32)","function totalSupply() view returns (uint256)","function balanceOf(address) view returns (uint256)"]),E=S(["function factory() view returns (address)","function addLiquidity(address tokenA,address tokenB,uint256 amountADesired,uint256 amountBDesired,uint256 amountAMin,uint256 amountBMin,address to,uint256 deadline) returns (uint256,uint256,uint256)","function removeLiquidity(address tokenA,address tokenB,uint256 liquidity,uint256 amountAMin,uint256 amountBMin,address to,uint256 deadline) returns (uint256,uint256)","function getAmountsOut(uint256 amountIn,address[] path) view returns (uint256[] amounts)","function getAmountsIn(uint256 amountOut,address[] path) view returns (uint256[] amounts)"]);async function z(s,p,t,n){if(p===g||t===g||p===t)throw new c("Provide two different ERC-20 tokens; use WETH for native ETH.");let r=s.clientFor(f),i=await r.getBlockNumber(),a=await r.readContract({address:_,abi:F,functionName:"getPair",args:[p,t],blockNumber:i}),[e,A]=await Promise.all([q(s,p,i),q(s,t,i)]);if(a===g)return{pair:a,tokenA:e,tokenB:A,reserveA:0n,reserveB:0n,supply:0n,balance:0n,blockNumber:i};let[M,l,v,B]=await Promise.all([r.readContract({address:a,abi:N,functionName:"token0",blockNumber:i}),r.readContract({address:a,abi:N,functionName:"getReserves",blockNumber:i}),r.readContract({address:a,abi:N,functionName:"totalSupply",blockNumber:i}),r.readContract({address:a,abi:$,functionName:"balanceOf",args:[n],blockNumber:i})]),[b,o]=D(M,p)?l:[l[1],l[0]];return{pair:a,tokenA:e,tokenB:A,reserveA:b,reserveB:o,supply:v,balance:B,blockNumber:i}}var H={tokenA:{...k,description:"Address of the first ERC-20 token."},tokenB:{...k,description:"Address of the second ERC-20 token."},amountADesired:w('Desired amount of tokenA in base units; use tokenA decimals. Example: "1000000" = 1 tokenA at 6 decimals.'),amountBDesired:w('Desired amount of tokenB in base units; use tokenB decimals. Example: "1000000" = 1 tokenB at 6 decimals.'),liquidity:{description:'LP token amount in base units (18 decimals), or "all" for the wallet balance. Example: "1000000000000000000" = 1 LP token.',type:"string",pattern:"^(?:[0-9]+|all)$"},slippageBps:{description:"Slippage tolerance in basis points (50 = 0.5%).",type:"integer",minimum:0,maximum:9999},amountAMin:w('Minimum amount of tokenA in base units; use tokenA decimals. Example: "1000000" = 1 tokenA at 6 decimals.'),amountBMin:w('Minimum amount of tokenB in base units; use tokenB decimals. Example: "1000000" = 1 tokenB at 6 decimals.')};function J(s){let p=async(t,n,r)=>{L(n,t==="pool"?["tokenA","tokenB"]:["tokenA","tokenB","slippageBps","amountAMin","amountBMin",...t==="add"?["amountADesired","amountBDesired"]:["liquidity"]]);let i=P(n.tokenA),a=P(n.tokenB),e=await z(s,i,a,r);if(t==="pool")return{pair:e.pair,tokenA:e.tokenA,tokenB:e.tokenB,reserveA:e.reserveA.toString(),reserveB:e.reserveB.toString(),totalSupply:e.supply.toString(),balance:e.balance.toString(),blockNumber:e.blockNumber.toString(),initialized:e.pair!==g};let A=s.clientFor(f),M=I(n.slippageBps);if(!D(await A.readContract({address:h,abi:E,functionName:"factory"}),_))throw new c("Uniswap v2 router factory differs from its pinned deployment.");let l=(await A.getBlock()).timestamp+300n,v=[],B=(o,d,m)=>{let u=o===void 0?d*BigInt(1e4-M)/10000n:y(o,m,256,!0);if(u>d||d>0n&&u===0n)throw new c(`${m} must be positive and no more than the reserve-ratio estimate.`);return u},b;if(t==="add"){let o=y(n.amountADesired,"amountADesired"),d=y(n.amountBDesired,"amountBDesired");if(e.reserveA===0n!=(e.reserveB===0n))throw new c("Uniswap v2 pair reserves are inconsistent.");let m=o,u=d;if(e.reserveA>0n&&e.reserveB>0n){let R=o*e.reserveB/e.reserveA;R<=d?u=R:m=d*e.reserveA/e.reserveB}if(m===0n||u===0n)throw new c("Liquidity amounts round to zero at the pool reserve ratio.");let x=B(n.amountAMin,m,"amountAMin"),C=B(n.amountBMin,u,"amountBMin");v.push(s.approval(i,h,o.toString(),f),s.approval(a,h,d.toString(),f)),b=U({abi:E,functionName:"addLiquidity",args:[i,a,o,d,x,C,r,l]})}else{if(e.pair===g||e.supply===0n)throw new c("No Uniswap v2 liquidity exists for this pair.");let o=n.liquidity==="all"?e.balance:y(n.liquidity,"liquidity");if(o===0n||o>e.balance)throw new c("Removal exceeds the wallet LP token balance or is zero.");let[d,m]=await Promise.all([i,a].map(C=>A.readContract({address:C,abi:$,functionName:"balanceOf",args:[e.pair]}))),u=B(n.amountAMin,o*d/e.supply,"amountAMin"),x=B(n.amountBMin,o*m/e.supply,"amountBMin");v.push(s.approval(e.pair,h,o.toString(),f)),b=U({abi:E,functionName:"removeLiquidity",args:[i,a,o,u,x,r,l]})}return v.push(s.unsignedTx({to:h,data:b,value:"0",chainId:f,description:`${t} Uniswap v2 liquidity for ${i}/${a}; recipient ${r}; deadline ${l}.`})),T(s,v,r,`${t==="add"?"Add":"Remove"} v2 liquidity. Review exact approvals, token minimums and wallet recipient. The first deposit sets the price; v2 locks MINIMUM_LIQUIDITY permanently.`)};return{tools:["pool","add","remove"].map(t=>({name:`uniswap_v2_${t}`,inputSchema:{type:"object",additionalProperties:!1,required:["tokenA","tokenB",...t==="add"?["amountADesired","amountBDesired"]:t==="remove"?["liquidity"]:[]],properties:t==="pool"?{tokenA:{...k,description:"Address of the first ERC-20 token."},tokenB:{...k,description:"Address of the second ERC-20 token."}}:H},execute:(n,r)=>p(t,n,r)}))}}export{_ as a,h as b,F as c,N as d,E as e,z as f,J as g};