@oakagentkit/core 0.3.5 → 0.3.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 (525) hide show
  1. package/build/dist/api/addresses.d.ts +14 -0
  2. package/build/dist/api/addresses.js +1 -1
  3. package/build/dist/api/chain.js +1 -1
  4. package/build/dist/api/history.d.ts +2 -0
  5. package/build/dist/api/history.js +1 -1
  6. package/build/dist/api/identity-link.js +1 -1
  7. package/build/dist/api/metadata.js +1 -1
  8. package/build/dist/api/modules/beefy/boosts.js +1 -1
  9. package/build/dist/api/modules/beefy/clm.js +1 -1
  10. package/build/dist/api/modules/beefy/guard.js +1 -1
  11. package/build/dist/api/modules/beefy/index.js +1 -1
  12. package/build/dist/api/modules/beefy/liquidity.js +1 -1
  13. package/build/dist/api/modules/beefy/management.js +1 -1
  14. package/build/dist/api/modules/beefy/vaults.js +1 -1
  15. package/build/dist/api/modules/borro/actions.js +1 -1
  16. package/build/dist/api/modules/borro/index.js +1 -1
  17. package/build/dist/api/modules/borro/liquidity.js +1 -1
  18. package/build/dist/api/modules/borro/positions.js +1 -1
  19. package/build/dist/api/modules/borro/reader.js +1 -1
  20. package/build/dist/api/modules/chop/display.js +1 -1
  21. package/build/dist/api/modules/chop/guard.js +1 -1
  22. package/build/dist/api/modules/chop/index.js +1 -1
  23. package/build/dist/api/modules/clanker/extensions.js +1 -1
  24. package/build/dist/api/modules/clanker/index.js +1 -1
  25. package/build/dist/api/modules/clanker/manage.js +1 -1
  26. package/build/dist/api/modules/clanker/pool-config.js +1 -1
  27. package/build/dist/api/modules/clanker/protocol.js +1 -1
  28. package/build/dist/api/modules/clanker/state.js +1 -1
  29. package/build/dist/api/modules/earn/index.js +1 -1
  30. package/build/dist/api/modules/erc8004/common.js +1 -1
  31. package/build/dist/api/modules/erc8004/domain.js +1 -1
  32. package/build/dist/api/modules/erc8004/index.js +1 -1
  33. package/build/dist/api/modules/erc8004/management.js +1 -1
  34. package/build/dist/api/modules/erc8004/reputation.js +1 -1
  35. package/build/dist/api/modules/erc8004/services.js +1 -1
  36. package/build/dist/api/modules/erc8004/thesis.js +1 -1
  37. package/build/dist/api/modules/erc8004/validation.js +1 -1
  38. package/build/dist/api/modules/fobo/index.js +1 -1
  39. package/build/dist/api/modules/fobo/intent.js +1 -1
  40. package/build/dist/api/modules/fobo/steps.js +1 -1
  41. package/build/dist/api/modules/fobo/verify.js +1 -1
  42. package/build/dist/api/modules/grove/index.js +1 -1
  43. package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
  44. package/build/dist/api/modules/heyresearch/index.js +1 -1
  45. package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
  46. package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
  47. package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
  48. package/build/dist/api/modules/hoodag/index.js +1 -1
  49. package/build/dist/api/modules/hoodag/management.js +1 -1
  50. package/build/dist/api/modules/hoodag/public-reads.js +1 -1
  51. package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
  52. package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
  53. package/build/dist/api/modules/hoodlock/buyback.js +1 -1
  54. package/build/dist/api/modules/hoodlock/commerce.js +1 -1
  55. package/build/dist/api/modules/hoodlock/fee.js +1 -1
  56. package/build/dist/api/modules/hoodlock/guard.js +1 -1
  57. package/build/dist/api/modules/hoodlock/index.js +1 -1
  58. package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
  59. package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
  60. package/build/dist/api/modules/hoodlock/public.js +1 -1
  61. package/build/dist/api/modules/hookr/actions.d.ts +39 -2
  62. package/build/dist/api/modules/hookr/actions.js +1 -1
  63. package/build/dist/api/modules/hookr/addons.js +1 -1
  64. package/build/dist/api/modules/hookr/agent-gate.d.ts +14 -2
  65. package/build/dist/api/modules/hookr/agent-gate.js +1 -1
  66. package/build/dist/api/modules/hookr/agent-link.d.ts +17 -0
  67. package/build/dist/api/modules/hookr/agent-link.js +1 -0
  68. package/build/dist/api/modules/hookr/api-client.d.ts +9 -0
  69. package/build/dist/api/modules/hookr/api-client.js +1 -0
  70. package/build/dist/api/modules/hookr/blocks/advisory.d.ts +41 -0
  71. package/build/dist/api/modules/hookr/blocks/advisory.js +1 -0
  72. package/build/dist/api/modules/hookr/blocks/buy-sell-block.d.ts +7 -0
  73. package/build/dist/api/modules/hookr/blocks/buy-sell-block.js +1 -0
  74. package/build/dist/api/modules/hookr/blocks/core-settings.d.ts +6 -0
  75. package/build/dist/api/modules/hookr/blocks/core-settings.js +1 -0
  76. package/build/dist/api/modules/hookr/blocks/exit-clock.d.ts +14 -0
  77. package/build/dist/api/modules/hookr/blocks/exit-clock.js +1 -0
  78. package/build/dist/api/modules/hookr/blocks/holder-pot.d.ts +30 -0
  79. package/build/dist/api/modules/hookr/blocks/holder-pot.js +1 -0
  80. package/build/dist/api/modules/hookr/blocks/managed-fee.d.ts +96 -0
  81. package/build/dist/api/modules/hookr/blocks/managed-fee.js +1 -0
  82. package/build/dist/api/modules/hookr/blocks/market-guard.d.ts +116 -0
  83. package/build/dist/api/modules/hookr/blocks/market-guard.js +1 -0
  84. package/build/dist/api/modules/hookr/blocks/market-hours-fee.d.ts +87 -0
  85. package/build/dist/api/modules/hookr/blocks/market-hours-fee.js +1 -0
  86. package/build/dist/api/modules/hookr/blocks/pay-later.d.ts +199 -0
  87. package/build/dist/api/modules/hookr/blocks/pay-later.js +1 -0
  88. package/build/dist/api/modules/hookr/blocks/sandwich-guard.d.ts +3 -0
  89. package/build/dist/api/modules/hookr/blocks/sandwich-guard.js +1 -0
  90. package/build/dist/api/modules/hookr/blocks/storm-fee.d.ts +3 -0
  91. package/build/dist/api/modules/hookr/blocks/storm-fee.js +1 -0
  92. package/build/dist/api/modules/hookr/blocks/swap-cut.d.ts +3 -0
  93. package/build/dist/api/modules/hookr/blocks/swap-cut.js +1 -0
  94. package/build/dist/api/modules/hookr/blocks/swap-reward-mint.d.ts +125 -0
  95. package/build/dist/api/modules/hookr/blocks/swap-reward-mint.js +1 -0
  96. package/build/dist/api/modules/hookr/blocks/wallet-cap.d.ts +3 -0
  97. package/build/dist/api/modules/hookr/blocks/wallet-cap.js +1 -0
  98. package/build/dist/api/modules/hookr/blocks/zap-source.d.ts +161 -0
  99. package/build/dist/api/modules/hookr/blocks/zap-source.js +1 -0
  100. package/build/dist/api/modules/hookr/blocks/zap-target.d.ts +51 -0
  101. package/build/dist/api/modules/hookr/blocks/zap-target.js +1 -0
  102. package/build/dist/api/modules/hookr/claims.d.ts +53 -0
  103. package/build/dist/api/modules/hookr/claims.js +1 -0
  104. package/build/dist/api/modules/hookr/contracts.d.ts +3 -1
  105. package/build/dist/api/modules/hookr/contracts.js +1 -1
  106. package/build/dist/api/modules/hookr/create-cancel.js +1 -1
  107. package/build/dist/api/modules/hookr/discovery.d.ts +2 -2
  108. package/build/dist/api/modules/hookr/discovery.js +1 -1
  109. package/build/dist/api/modules/hookr/fill-bounty.d.ts +2 -0
  110. package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
  111. package/build/dist/api/modules/hookr/gas.d.ts +48 -0
  112. package/build/dist/api/modules/hookr/gas.js +1 -0
  113. package/build/dist/api/modules/hookr/gates.d.ts +51 -0
  114. package/build/dist/api/modules/hookr/gates.js +1 -0
  115. package/build/dist/api/modules/hookr/hook-blocks.d.ts +304 -0
  116. package/build/dist/api/modules/hookr/hook-blocks.js +1 -0
  117. package/build/dist/api/modules/hookr/index.d.ts +4 -2
  118. package/build/dist/api/modules/hookr/index.js +1 -1
  119. package/build/dist/api/modules/hookr/jobs.d.ts +7 -0
  120. package/build/dist/api/modules/hookr/jobs.js +1 -0
  121. package/build/dist/api/modules/hookr/launch-options.d.ts +52 -3
  122. package/build/dist/api/modules/hookr/launch-options.js +1 -1
  123. package/build/dist/api/modules/hookr/launch-profile.d.ts +8 -0
  124. package/build/dist/api/modules/hookr/launch-profile.js +1 -1
  125. package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
  126. package/build/dist/api/modules/hookr/launch.d.ts +24 -0
  127. package/build/dist/api/modules/hookr/launch.js +1 -1
  128. package/build/dist/api/modules/hookr/liquidity.js +1 -1
  129. package/build/dist/api/modules/hookr/lp-positions.js +1 -1
  130. package/build/dist/api/modules/hookr/lp-reads.js +1 -1
  131. package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
  132. package/build/dist/api/modules/hookr/lp-state.d.ts +90 -2
  133. package/build/dist/api/modules/hookr/lp-state.js +1 -1
  134. package/build/dist/api/modules/hookr/pay-later-actions.d.ts +52 -0
  135. package/build/dist/api/modules/hookr/pay-later-actions.js +1 -0
  136. package/build/dist/api/modules/hookr/pins.d.ts +5 -0
  137. package/build/dist/api/modules/hookr/pins.js +1 -1
  138. package/build/dist/api/modules/hookr/pm-liquidity.d.ts +215 -0
  139. package/build/dist/api/modules/hookr/pm-liquidity.js +1 -0
  140. package/build/dist/api/modules/hookr/public-reads.d.ts +1 -1
  141. package/build/dist/api/modules/hookr/public-reads.js +1 -1
  142. package/build/dist/api/modules/hookr/read-utils.js +1 -1
  143. package/build/dist/api/modules/hookr/relay.js +1 -1
  144. package/build/dist/api/modules/hookr/revenue.d.ts +4 -1
  145. package/build/dist/api/modules/hookr/revenue.js +1 -1
  146. package/build/dist/api/modules/hookr/scan.d.ts +25 -0
  147. package/build/dist/api/modules/hookr/scan.js +1 -0
  148. package/build/dist/api/modules/hookr/swap.d.ts +161 -0
  149. package/build/dist/api/modules/hookr/swap.js +1 -0
  150. package/build/dist/api/modules/kyberswap/index.js +1 -1
  151. package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
  152. package/build/dist/api/modules/layerbank/abi.js +1 -1
  153. package/build/dist/api/modules/layerbank/actions.js +1 -1
  154. package/build/dist/api/modules/layerbank/checks.js +1 -1
  155. package/build/dist/api/modules/layerbank/index.js +1 -1
  156. package/build/dist/api/modules/layerbank/merkl.js +1 -1
  157. package/build/dist/api/modules/layerbank/reader.js +1 -1
  158. package/build/dist/api/modules/layerbank/reserve.js +1 -1
  159. package/build/dist/api/modules/lighter/index.js +1 -1
  160. package/build/dist/api/modules/longbow/administration.js +1 -1
  161. package/build/dist/api/modules/longbow/analytics.js +1 -1
  162. package/build/dist/api/modules/longbow/fixed.js +1 -1
  163. package/build/dist/api/modules/longbow/index.js +1 -1
  164. package/build/dist/api/modules/longbow/nft.js +1 -1
  165. package/build/dist/api/modules/longbow/rebates.js +1 -1
  166. package/build/dist/api/modules/longbow/staking.js +1 -1
  167. package/build/dist/api/modules/meridian/index.js +1 -1
  168. package/build/dist/api/modules/meridian/markets.js +1 -1
  169. package/build/dist/api/modules/meridian/rfq.js +1 -1
  170. package/build/dist/api/modules/merkl/discovery.js +1 -1
  171. package/build/dist/api/modules/merkl/index.js +1 -1
  172. package/build/dist/api/modules/merkl/manage.js +1 -1
  173. package/build/dist/api/modules/merkl/protocol.js +1 -1
  174. package/build/dist/api/modules/merkl/stock-lp.d.ts +51 -0
  175. package/build/dist/api/modules/merkl/stock-lp.js +1 -0
  176. package/build/dist/api/modules/morpho/allocator.js +1 -1
  177. package/build/dist/api/modules/morpho/bundles.js +1 -1
  178. package/build/dist/api/modules/morpho/in-kind.js +1 -1
  179. package/build/dist/api/modules/morpho/index.js +1 -1
  180. package/build/dist/api/modules/morpho/local-guard.js +1 -1
  181. package/build/dist/api/modules/morpho/midnight.js +1 -1
  182. package/build/dist/api/modules/morpho/protocol.js +1 -1
  183. package/build/dist/api/modules/morpho/vault-management.js +1 -1
  184. package/build/dist/api/modules/morpho/vault-tools.js +1 -1
  185. package/build/dist/api/modules/morpho/vault-v2.js +1 -1
  186. package/build/dist/api/modules/netnet/card-plan.js +1 -1
  187. package/build/dist/api/modules/netnet/card-read.js +1 -1
  188. package/build/dist/api/modules/netnet/card-recovery.js +1 -1
  189. package/build/dist/api/modules/netnet/desk-action.js +1 -1
  190. package/build/dist/api/modules/netnet/desk-read.js +1 -1
  191. package/build/dist/api/modules/netnet/financial.js +1 -1
  192. package/build/dist/api/modules/netnet/index.js +1 -1
  193. package/build/dist/api/modules/netnet/staking.js +1 -1
  194. package/build/dist/api/modules/orbio/index.js +1 -1
  195. package/build/dist/api/modules/orbio/positions.js +1 -1
  196. package/build/dist/api/modules/pendle/costs.js +1 -1
  197. package/build/dist/api/modules/pendle/index.js +1 -1
  198. package/build/dist/api/modules/pendle/markets.js +1 -1
  199. package/build/dist/api/modules/pendle/positions.js +1 -1
  200. package/build/dist/api/modules/pendle/pricecheck.js +1 -1
  201. package/build/dist/api/modules/pendle/reader.js +1 -1
  202. package/build/dist/api/modules/pendle/redeem.js +1 -1
  203. package/build/dist/api/modules/pendle/trade.js +1 -1
  204. package/build/dist/api/modules/pendle/validate.js +1 -1
  205. package/build/dist/api/modules/pendle/verify.js +1 -1
  206. package/build/dist/api/modules/pons/claim.js +1 -1
  207. package/build/dist/api/modules/pons/index.js +1 -1
  208. package/build/dist/api/modules/pons/launch-status.js +1 -1
  209. package/build/dist/api/modules/pons/prices.js +1 -1
  210. package/build/dist/api/modules/pons/reads.js +1 -1
  211. package/build/dist/api/modules/pons/swap-terms.js +1 -1
  212. package/build/dist/api/modules/pons/trade.js +1 -1
  213. package/build/dist/api/modules/poolstrade/index.js +1 -1
  214. package/build/dist/api/modules/priors/coverage.js +1 -1
  215. package/build/dist/api/modules/priors/discovery.js +1 -1
  216. package/build/dist/api/modules/priors/features.js +1 -1
  217. package/build/dist/api/modules/priors/holdings.js +1 -1
  218. package/build/dist/api/modules/priors/index.js +1 -1
  219. package/build/dist/api/modules/priors/integration.js +1 -1
  220. package/build/dist/api/modules/priors/market.js +1 -1
  221. package/build/dist/api/modules/priors/pt.js +1 -1
  222. package/build/dist/api/modules/priors/savings-exit.js +1 -1
  223. package/build/dist/api/modules/priors/starter-line.js +1 -1
  224. package/build/dist/api/modules/priors/stock-swap.js +1 -1
  225. package/build/dist/api/modules/raeto/index.js +1 -1
  226. package/build/dist/api/modules/relay/bootstrap.js +1 -1
  227. package/build/dist/api/modules/relay/discovery.js +1 -1
  228. package/build/dist/api/modules/relay/inbound.js +1 -1
  229. package/build/dist/api/modules/relay/index.js +1 -1
  230. package/build/dist/api/modules/relay/outbound-status.js +1 -1
  231. package/build/dist/api/modules/relay/reads.js +1 -1
  232. package/build/dist/api/modules/spark/actions.js +1 -1
  233. package/build/dist/api/modules/spark/details.js +1 -1
  234. package/build/dist/api/modules/spark/index.js +1 -1
  235. package/build/dist/api/modules/spark/management.js +1 -1
  236. package/build/dist/api/modules/steakhouse/analytics.js +1 -1
  237. package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
  238. package/build/dist/api/modules/steakhouse/index.js +1 -1
  239. package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
  240. package/build/dist/api/modules/steakhouse/management.js +1 -1
  241. package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
  242. package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
  243. package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
  244. package/build/dist/api/modules/tickerspring/discovery.js +1 -1
  245. package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
  246. package/build/dist/api/modules/tickerspring/guards.js +1 -1
  247. package/build/dist/api/modules/tickerspring/index.js +1 -1
  248. package/build/dist/api/modules/tickerspring/journeys.js +1 -1
  249. package/build/dist/api/modules/tickerspring/ladder.js +1 -1
  250. package/build/dist/api/modules/tickerspring/maker.js +1 -1
  251. package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
  252. package/build/dist/api/modules/tickerspring/research.js +1 -1
  253. package/build/dist/api/modules/tickerspring/strategies.js +1 -1
  254. package/build/dist/api/modules/uniswap/auction-create.js +1 -1
  255. package/build/dist/api/modules/uniswap/auction.js +1 -1
  256. package/build/dist/api/modules/uniswap/batch.js +1 -1
  257. package/build/dist/api/modules/uniswap/common.js +1 -1
  258. package/build/dist/api/modules/uniswap/fees.js +1 -1
  259. package/build/dist/api/modules/uniswap/index.js +1 -1
  260. package/build/dist/api/modules/uniswap/local-guard.js +1 -1
  261. package/build/dist/api/modules/uniswap/oracle.js +1 -1
  262. package/build/dist/api/modules/uniswap/pool-math.js +1 -1
  263. package/build/dist/api/modules/uniswap/pools.js +1 -1
  264. package/build/dist/api/modules/uniswap/position.js +1 -1
  265. package/build/dist/api/modules/uniswap/protocol.js +1 -1
  266. package/build/dist/api/modules/uniswap/quote-guard.js +1 -1
  267. package/build/dist/api/modules/uniswap/stock-prices.d.ts +25 -0
  268. package/build/dist/api/modules/uniswap/stock-prices.js +1 -1
  269. package/build/dist/api/modules/uniswap/stocks.js +1 -1
  270. package/build/dist/api/modules/uniswap/token-jar.js +1 -1
  271. package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
  272. package/build/dist/api/modules/uniswap/trade.js +1 -1
  273. package/build/dist/api/modules/uniswap/v2.js +1 -1
  274. package/build/dist/api/modules/uniswap/v3.js +1 -1
  275. package/build/dist/api/modules/uniswap/v4.js +1 -1
  276. package/build/dist/api/modules/uniswap/wrap.js +1 -1
  277. package/build/dist/api/modules/upoch/index.js +1 -1
  278. package/build/dist/api/modules/upoch/reads.js +1 -1
  279. package/build/dist/api/modules/velora/claims.js +1 -1
  280. package/build/dist/api/modules/velora/delta-reads.js +1 -1
  281. package/build/dist/api/modules/velora/index.js +1 -1
  282. package/build/dist/api/modules/wormhole/index.js +1 -1
  283. package/build/dist/api/modules/wormhole/scan-text.d.ts +1 -1
  284. package/build/dist/api/positions.js +1 -1
  285. package/build/dist/api/pricenote.js +1 -1
  286. package/build/dist/api/prices.js +1 -1
  287. package/build/dist/api/rpc.js +1 -1
  288. package/build/dist/api/send.js +1 -1
  289. package/build/dist/api/signing-registry.js +1 -1
  290. package/build/dist/api/signing.js +1 -1
  291. package/build/dist/api/simulate.js +1 -1
  292. package/build/dist/api/swap.d.ts +2 -0
  293. package/build/dist/api/swap.js +1 -1
  294. package/build/dist/api/tokens.d.ts +9 -1
  295. package/build/dist/api/tokens.js +1 -1
  296. package/build/dist/api/tool-policy.d.ts +1 -0
  297. package/build/dist/api/tool-policy.js +1 -1
  298. package/build/dist/api/universal-router.js +1 -1
  299. package/build/dist/api/usd-estimate.js +1 -1
  300. package/build/dist/chunks/{DMDOSHV7.js → 266VIESP.js} +1 -1
  301. package/build/dist/chunks/{HFVXNKA5.js → 2BM2WX2G.js} +1 -1
  302. package/build/dist/chunks/{HDBZZOHJ.js → 2GYL3N2O.js} +1 -1
  303. package/build/dist/chunks/{OY5W7ZSL.js → 2H2OZE6X.js} +1 -1
  304. package/build/dist/chunks/{E76Z2TT4.js → 2QQ5CGQI.js} +1 -1
  305. package/build/dist/chunks/{4PLLS6CT.js → 2VYA6WIN.js} +1 -1
  306. package/build/dist/chunks/{FRT6AC6M.js → 2ZYFBBOE.js} +1 -1
  307. package/build/dist/chunks/{LCH6F5HT.js → 342OZP53.js} +1 -1
  308. package/build/dist/chunks/{XADHV2DT.js → 35DTANJW.js} +1 -1
  309. package/build/dist/chunks/{4IOHSX3Z.js → 37UBQQWL.js} +1 -1
  310. package/build/dist/chunks/3RGED2KO.js +1 -0
  311. package/build/dist/chunks/{4HQEJHCD.js → 3XIJCHT7.js} +1 -1
  312. package/build/dist/chunks/3XY44BP5.js +1 -0
  313. package/build/dist/chunks/3YNXQ3EZ.js +1 -0
  314. package/build/dist/chunks/{JDHPMS7X.js → 4JU23O3Z.js} +1 -1
  315. package/build/dist/chunks/{Y2QADJOB.js → 4P6DRKY3.js} +1 -1
  316. package/build/dist/chunks/{W3DGFMQE.js → 4RTXP2YP.js} +1 -1
  317. package/build/dist/chunks/{CNDIAF3P.js → 4WYTIM4T.js} +1 -1
  318. package/build/dist/chunks/{HPS4KOU4.js → 52AEVHKJ.js} +1 -1
  319. package/build/dist/chunks/{ZTKT3ZQK.js → 53VBLEYS.js} +1 -1
  320. package/build/dist/chunks/{ADIPEGNN.js → 5AO2QPWE.js} +1 -1
  321. package/build/dist/chunks/{GQITAJVF.js → 5BPFF7NX.js} +1 -1
  322. package/build/dist/chunks/5EQTOA5F.js +1 -0
  323. package/build/dist/chunks/{WAKZWSHB.js → 5KKAN7XQ.js} +1 -1
  324. package/build/dist/chunks/{VVAM3EAK.js → 5N6YJFFA.js} +1 -1
  325. package/build/dist/chunks/{QIB6OMQV.js → 5O67QQIY.js} +1 -1
  326. package/build/dist/chunks/{FAH7FKUT.js → 5UWVXEPD.js} +1 -1
  327. package/build/dist/chunks/{KKTOBXIT.js → 5VA66LFF.js} +1 -1
  328. package/build/dist/chunks/5VKVAUFQ.js +1 -0
  329. package/build/dist/chunks/5Y457HYC.js +1 -0
  330. package/build/dist/chunks/627SGCTU.js +1 -0
  331. package/build/dist/chunks/64LAWFBE.js +1 -0
  332. package/build/dist/chunks/{6F527FLN.js → 6HNQAYBM.js} +1 -1
  333. package/build/dist/chunks/{FUP53K6G.js → 6LDC5D2S.js} +1 -1
  334. package/build/dist/chunks/6RVAV6BB.js +1 -0
  335. package/build/dist/chunks/{WSILNJS2.js → 6STUQOFL.js} +1 -1
  336. package/build/dist/chunks/{4Z3IGMU6.js → 7AYP4ATZ.js} +1 -1
  337. package/build/dist/chunks/{YGW4ODAP.js → 7EPU3XGY.js} +1 -1
  338. package/build/dist/chunks/7GL547YZ.js +1 -0
  339. package/build/dist/chunks/{E47UYYK4.js → 7KK3OC7Q.js} +1 -1
  340. package/build/dist/chunks/{IZP3EKKS.js → 7PBCV7VS.js} +1 -1
  341. package/build/dist/chunks/{A3BJSQ23.js → 7VU5VCTL.js} +1 -1
  342. package/build/dist/chunks/{Z7FGEWO2.js → 7WXAS54T.js} +1 -1
  343. package/build/dist/chunks/{DRLBTB4E.js → A72ADVYF.js} +1 -1
  344. package/build/dist/chunks/{ANIF3JMV.js → AG66NM3J.js} +1 -1
  345. package/build/dist/chunks/AODUTN65.js +1 -0
  346. package/build/dist/chunks/{DBOGRUPS.js → AONO47JX.js} +1 -1
  347. package/build/dist/chunks/{2I7XHRTI.js → AOTTQPK7.js} +1 -1
  348. package/build/dist/chunks/{JTPHZCO3.js → AQJLEG6B.js} +1 -1
  349. package/build/dist/chunks/AZBTNUXF.js +1 -0
  350. package/build/dist/chunks/B4U43D5Z.js +1 -0
  351. package/build/dist/chunks/B5B7U3NZ.js +1 -0
  352. package/build/dist/chunks/{ZX43P4BK.js → B75SS7H6.js} +1 -1
  353. package/build/dist/chunks/{GBIBRYOV.js → B7HVPHSS.js} +1 -1
  354. package/build/dist/chunks/{LT5P6PZW.js → B7WZJHIJ.js} +1 -1
  355. package/build/dist/chunks/{3A2IKFTV.js → BIFANUTV.js} +1 -1
  356. package/build/dist/chunks/BM4KHOFB.js +1 -0
  357. package/build/dist/chunks/{ZVY7GGSP.js → BW755PNH.js} +1 -1
  358. package/build/dist/chunks/{VXCGMALF.js → BWE5PXRE.js} +1 -1
  359. package/build/dist/chunks/{7U62MMUQ.js → BY2OWKZB.js} +1 -1
  360. package/build/dist/chunks/{F7MGYRPU.js → CCPG6PRL.js} +1 -1
  361. package/build/dist/chunks/{OI3N4EW4.js → CG7ABZXH.js} +1 -1
  362. package/build/dist/chunks/{S37D7HOK.js → CITHH7NK.js} +1 -1
  363. package/build/dist/chunks/CJMVRV34.js +1 -0
  364. package/build/dist/chunks/{JJSCDDQO.js → CLHA557R.js} +1 -1
  365. package/build/dist/chunks/CQPIR6ER.js +1 -0
  366. package/build/dist/chunks/{MI5HZDMH.js → D6JOXK7Q.js} +1 -1
  367. package/build/dist/chunks/{IZFED3R2.js → DLNDJZR4.js} +1 -1
  368. package/build/dist/chunks/{UUF4Z6K6.js → DUTAMN3F.js} +1 -1
  369. package/build/dist/chunks/{NMJVQX5M.js → DWRRIFXS.js} +1 -1
  370. package/build/dist/chunks/{3ZH5SOC2.js → EFOC337C.js} +1 -1
  371. package/build/dist/chunks/{2PS4GCOZ.js → EKHNXPWO.js} +1 -1
  372. package/build/dist/chunks/EWZFZUVF.js +1 -0
  373. package/build/dist/chunks/EXKV6QJD.js +1 -0
  374. package/build/dist/chunks/{OB7BFDOV.js → EYE3ZAJB.js} +1 -1
  375. package/build/dist/chunks/{MQ5F2VOK.js → EZUQMTLE.js} +1 -1
  376. package/build/dist/chunks/FMEO7RX7.js +1 -0
  377. package/build/dist/chunks/{ZQPC54J5.js → FYWK3UK6.js} +1 -1
  378. package/build/dist/chunks/G53U6Y4L.js +1 -0
  379. package/build/dist/chunks/{O5QTITN6.js → GRHBE4MQ.js} +1 -1
  380. package/build/dist/chunks/GV6FZ6UG.js +1 -0
  381. package/build/dist/chunks/GV6Z3MET.js +1 -0
  382. package/build/dist/chunks/{GK3D7OKG.js → GVCNTGLC.js} +1 -1
  383. package/build/dist/chunks/H5J2LFPZ.js +1 -0
  384. package/build/dist/chunks/{DCGNVMKG.js → HC3QFA5I.js} +1 -1
  385. package/build/dist/chunks/{C76D54YG.js → HGSFRN57.js} +1 -1
  386. package/build/dist/chunks/HJI7KO6F.js +1 -0
  387. package/build/dist/chunks/{G5AMH4IP.js → HN5RBTNE.js} +1 -1
  388. package/build/dist/chunks/{MSRCJ2BS.js → HPBTSJW7.js} +1 -1
  389. package/build/dist/chunks/HPO673QQ.js +1 -0
  390. package/build/dist/chunks/{C57DITTF.js → HTOP2OKU.js} +1 -1
  391. package/build/dist/chunks/{DGDMRATN.js → ICHT3H3W.js} +1 -1
  392. package/build/dist/chunks/IJVBCEA2.js +1 -0
  393. package/build/dist/chunks/ILTGXU6G.js +1 -0
  394. package/build/dist/chunks/{I4473OC6.js → IMD33NQS.js} +1 -1
  395. package/build/dist/chunks/{X24YTJST.js → IY7FWTAL.js} +1 -1
  396. package/build/dist/chunks/{TOIKOIY6.js → J5624CVF.js} +1 -1
  397. package/build/dist/chunks/JCS24YBB.js +1 -0
  398. package/build/dist/chunks/JFYC2LVI.js +1 -0
  399. package/build/dist/chunks/JQVTHPUO.js +1 -0
  400. package/build/dist/chunks/{TGXEKBLV.js → JUVY6PCR.js} +1 -1
  401. package/build/dist/chunks/JYED2PZ3.js +1 -0
  402. package/build/dist/chunks/{KO7ANIKY.js → K3HCSCXE.js} +1 -1
  403. package/build/dist/chunks/{7VH6JQ2H.js → K5C6QBOO.js} +1 -1
  404. package/build/dist/chunks/{W7BFM6CK.js → KAXLZJU6.js} +1 -1
  405. package/build/dist/chunks/{YW4W3LPQ.js → KHLM6NIZ.js} +1 -1
  406. package/build/dist/chunks/{OIQTZOBN.js → KKGHXNM4.js} +1 -1
  407. package/build/dist/chunks/{TZ7S5KRB.js → KW5LJGNY.js} +1 -1
  408. package/build/dist/chunks/{SUNTJ6IU.js → KYANIEPX.js} +1 -1
  409. package/build/dist/chunks/{ZZ6FZGHF.js → L4UFGM7M.js} +1 -1
  410. package/build/dist/chunks/{YWVPK3DV.js → L76P6WIH.js} +1 -1
  411. package/build/dist/chunks/{QMNUB2GM.js → LBT6WR4U.js} +1 -1
  412. package/build/dist/chunks/LD3A2KLN.js +1 -0
  413. package/build/dist/chunks/{WRUTW6CG.js → LFSNAQ7V.js} +1 -1
  414. package/build/dist/chunks/LHC2YV2U.js +1 -0
  415. package/build/dist/chunks/{R66NSNNQ.js → LHVGWNMW.js} +1 -1
  416. package/build/dist/chunks/{RUHNLNVX.js → LOH6LUVT.js} +1 -1
  417. package/build/dist/chunks/{23HNDJ76.js → M2SWILNG.js} +1 -1
  418. package/build/dist/chunks/{IT2JLILU.js → MFKDNAHB.js} +1 -1
  419. package/build/dist/chunks/MFQTBUSD.js +1 -0
  420. package/build/dist/chunks/MFRKZOU4.js +1 -0
  421. package/build/dist/chunks/{V4UJMUIB.js → MLN5KTG7.js} +1 -1
  422. package/build/dist/chunks/{TJU644I7.js → MSIT5Q3M.js} +1 -1
  423. package/build/dist/chunks/{S4JUFCT4.js → MSQNOK3I.js} +1 -1
  424. package/build/dist/chunks/NCCKCGKL.js +1 -0
  425. package/build/dist/chunks/NGHRUNXO.js +1 -0
  426. package/build/dist/chunks/{N65J3L2H.js → NIGRNLNM.js} +1 -1
  427. package/build/dist/chunks/{DXAPKN7H.js → NLC36QHL.js} +1 -1
  428. package/build/dist/chunks/NUTTPUYJ.js +1 -0
  429. package/build/dist/chunks/{QMIH6HXH.js → NWW6GY5E.js} +1 -1
  430. package/build/dist/chunks/{O4S6XAYV.js → O7L55XM3.js} +1 -1
  431. package/build/dist/chunks/{NAO7VWZF.js → OCIEVYPR.js} +1 -1
  432. package/build/dist/chunks/{4NBXBKOX.js → OD7CY6BY.js} +1 -1
  433. package/build/dist/chunks/{RUTSEGGD.js → OHZHQSCA.js} +1 -1
  434. package/build/dist/chunks/{A4K5GXVO.js → ORKXBYVC.js} +1 -1
  435. package/build/dist/chunks/OUXPOFY2.js +1 -0
  436. package/build/dist/chunks/{NIWAVMDR.js → OWHXYE2G.js} +1 -1
  437. package/build/dist/chunks/PD5NXIRT.js +1 -0
  438. package/build/dist/chunks/{TXGZ6NWN.js → PG7HZIZL.js} +1 -1
  439. package/build/dist/chunks/PLEJPTTK.js +1 -0
  440. package/build/dist/chunks/{VREGY7E6.js → PMFR47H3.js} +1 -1
  441. package/build/dist/chunks/{ZXRIJG6H.js → PX2G2H6G.js} +1 -1
  442. package/build/dist/chunks/QAAKUIWE.js +1 -0
  443. package/build/dist/chunks/{YXXK6EPI.js → QBHY2QRC.js} +1 -1
  444. package/build/dist/chunks/{WQ2XTDHO.js → QCPJZBEO.js} +1 -1
  445. package/build/dist/chunks/{ELHRXA5U.js → QFK335LC.js} +1 -1
  446. package/build/dist/chunks/{3PHJUFU2.js → QFUSCK5C.js} +1 -1
  447. package/build/dist/chunks/QGO4EKXZ.js +1 -0
  448. package/build/dist/chunks/{IPU656WB.js → QKH7ED6B.js} +1 -1
  449. package/build/dist/chunks/{XW3VGWXK.js → QMWHQRYC.js} +1 -1
  450. package/build/dist/chunks/{USGMGKAG.js → QXBQ7WPB.js} +1 -1
  451. package/build/dist/chunks/{MQXSCNUL.js → R5UOFPDO.js} +1 -1
  452. package/build/dist/chunks/{MDLJFCT4.js → R5Z4HPCA.js} +1 -1
  453. package/build/dist/chunks/{A4FLWHLP.js → REXGROOD.js} +1 -1
  454. package/build/dist/chunks/RKJFSDGV.js +1 -0
  455. package/build/dist/chunks/RKS3M7L5.js +1 -0
  456. package/build/dist/chunks/{GDOHHXNH.js → RLX6YTNT.js} +1 -1
  457. package/build/dist/chunks/{PV7FEVBD.js → RWEA4SWP.js} +1 -1
  458. package/build/dist/chunks/{ZKBOPZH5.js → RWUF6T4I.js} +1 -1
  459. package/build/dist/chunks/{USEF3QKG.js → S432S6NA.js} +1 -1
  460. package/build/dist/chunks/{XTXXWRN2.js → SDDYM2H3.js} +1 -1
  461. package/build/dist/chunks/{2OVJ2BTJ.js → SEXKWYUM.js} +1 -1
  462. package/build/dist/chunks/TKJ4GFUP.js +1 -0
  463. package/build/dist/chunks/{BSX4LFYI.js → TNHU5UBQ.js} +1 -1
  464. package/build/dist/chunks/{PDPTJMTJ.js → TT2ST3Q3.js} +1 -1
  465. package/build/dist/chunks/TTBB6EFN.js +1 -0
  466. package/build/dist/chunks/{OVM4QIET.js → U4MSIH4G.js} +1 -1
  467. package/build/dist/chunks/{LKUZAJPZ.js → UCMOQAVD.js} +1 -1
  468. package/build/dist/chunks/{OB3YMTDI.js → UIVOYAO2.js} +1 -1
  469. package/build/dist/chunks/{3YH5B5NQ.js → UL4DY6GX.js} +1 -1
  470. package/build/dist/chunks/{XRDLMTBJ.js → UMY6SP7C.js} +1 -1
  471. package/build/dist/chunks/UNBRUWSV.js +1 -0
  472. package/build/dist/chunks/{LGLWEGPY.js → UPX3OWKA.js} +1 -1
  473. package/build/dist/chunks/{MJGEGNDU.js → UYYYSFMQ.js} +1 -1
  474. package/build/dist/chunks/{4RCYYN6O.js → V7HTGO23.js} +1 -1
  475. package/build/dist/chunks/{O2QBSINK.js → V7P4PCLL.js} +1 -1
  476. package/build/dist/chunks/{FRVCSDKU.js → VMSGNN3D.js} +1 -1
  477. package/build/dist/chunks/VQMBPY2P.js +1 -0
  478. package/build/dist/chunks/{HZSYMGJ2.js → VS7ZA4OF.js} +1 -1
  479. package/build/dist/chunks/{BJ2U2VXJ.js → VTWAVH74.js} +1 -1
  480. package/build/dist/chunks/W3M4KAPX.js +1 -0
  481. package/build/dist/chunks/{LZM3DO5Q.js → W5GWK72I.js} +1 -1
  482. package/build/dist/chunks/{65OITTDL.js → W73SLWBT.js} +1 -1
  483. package/build/dist/chunks/{2FOI2625.js → W7BTXU3F.js} +1 -1
  484. package/build/dist/chunks/{6LVHN33V.js → WADRRW3E.js} +1 -1
  485. package/build/dist/chunks/{ZXFJKW6H.js → WG7PMGTJ.js} +1 -1
  486. package/build/dist/chunks/{N742W5KX.js → WRNPYW47.js} +1 -1
  487. package/build/dist/chunks/{XL3W7DAQ.js → X3BB6WME.js} +1 -1
  488. package/build/dist/chunks/{SX5YNFHG.js → XD4JA43O.js} +1 -1
  489. package/build/dist/chunks/{GBPB7JIB.js → XSQJOOEY.js} +1 -1
  490. package/build/dist/chunks/{3BQ5XHDJ.js → Y7SKGRWC.js} +1 -1
  491. package/build/dist/chunks/{R73R4KN3.js → YBLJ2MCR.js} +1 -1
  492. package/build/dist/chunks/{6CKCZJ3F.js → YDJHXSS7.js} +1 -1
  493. package/build/dist/chunks/{GKUPC4DO.js → YLU5JVRI.js} +1 -1
  494. package/build/dist/chunks/YR6Y6UIR.js +1 -0
  495. package/build/dist/chunks/{FHB7QYJO.js → Z5WRTISY.js} +1 -1
  496. package/build/dist/chunks/ZB67QDN2.js +1 -0
  497. package/build/dist/chunks/{O4P5IQCP.js → ZRG34Y7Q.js} +1 -1
  498. package/build/dist/chunks/ZSGW2ZSO.js +1 -0
  499. package/build/dist/chunks/{HRAHGYNK.js → ZTNBX4VH.js} +1 -1
  500. package/package.json +1 -1
  501. package/build/dist/chunks/5H7NVE6O.js +0 -1
  502. package/build/dist/chunks/7OOCAZBE.js +0 -1
  503. package/build/dist/chunks/7TRO6MBQ.js +0 -1
  504. package/build/dist/chunks/DFM4T6ZE.js +0 -1
  505. package/build/dist/chunks/FCVH4FYH.js +0 -1
  506. package/build/dist/chunks/GDUKZYE2.js +0 -1
  507. package/build/dist/chunks/GYPMUYB5.js +0 -1
  508. package/build/dist/chunks/J7OZLXSG.js +0 -1
  509. package/build/dist/chunks/JFC2QCMW.js +0 -1
  510. package/build/dist/chunks/M267JEDO.js +0 -1
  511. package/build/dist/chunks/M6JNGU4E.js +0 -1
  512. package/build/dist/chunks/M7OVMIIE.js +0 -1
  513. package/build/dist/chunks/MQK6OP7S.js +0 -1
  514. package/build/dist/chunks/N624NR7Y.js +0 -1
  515. package/build/dist/chunks/OSMOBKRQ.js +0 -1
  516. package/build/dist/chunks/Q3Q3YHEX.js +0 -1
  517. package/build/dist/chunks/QBNASL3T.js +0 -1
  518. package/build/dist/chunks/QQD4PV64.js +0 -1
  519. package/build/dist/chunks/RN3WUJIO.js +0 -1
  520. package/build/dist/chunks/RP5VCG54.js +0 -1
  521. package/build/dist/chunks/TI727O2H.js +0 -1
  522. package/build/dist/chunks/UHIJMDD2.js +0 -1
  523. package/build/dist/chunks/W32UECOL.js +0 -1
  524. package/build/dist/chunks/WWNAGOCD.js +0 -1
  525. package/build/dist/chunks/XWC6IC5E.js +0 -1
@@ -1 +0,0 @@
1
- import{m as J}from"./WSILNJS2.js";import{a as U,e as Z,h as ee,i as te,k as ne}from"./KHOUBQJK.js";import{c as N,e as Q}from"./JFC2QCMW.js";import{a as Y}from"./Y2QADJOB.js";import{b as re,e as O,q as ie}from"./N624NR7Y.js";import{a as g,b as C}from"./Z7FGEWO2.js";import{a as P}from"./LIUXNOLP.js";import{e as z,f as j}from"./S65KXMZ7.js";import{f as $,l as V}from"./CW37EGPL.js";import{a as X,c as A}from"./CFPJDLTZ.js";import{a as v}from"./VVAM3EAK.js";import{a as K}from"./SPJCSEKP.js";import{b as F}from"./SCG5HWMN.js";import{b as E}from"./IX3GZMTM.js";import{t as T}from"./MQ5F2VOK.js";import{b as m,c as l,d as G,e as k,j as h,k as q,l as W,q as B}from"./TI727O2H.js";import{a as c}from"./XSD5NL7J.js";import{a as D,b as R}from"./JXOEJPJ4.js";import{getAddress as p,isAddress as se,parseAbi as me,zeroAddress as oe}from"viem";var ae=[{inputs:[],name:"available",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"ethUsdE18",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"liquidityUsdgE6",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"phase",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"priceSigner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"signer",type:"address"}],name:"setPriceSigner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"spotOakPerEthE18",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"supplyNet",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"syncPhase",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"wallet",type:"address"},{internalType:"uint256",name:"oakPerEthE18",type:"uint256"},{internalType:"uint64",name:"timestamp",type:"uint64"},{internalType:"bytes32",name:"nonce",type:"bytes32"}],internalType:"struct PriceNote",name:"n",type:"tuple"},{internalType:"bytes",name:"sig",type:"bytes"},{internalType:"address",name:"boundWallet",type:"address"}],name:"verifyNote",outputs:[{internalType:"uint256",name:"oakPerEthE18",type:"uint256"}],stateMutability:"view",type:"function"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"signer",type:"address"}],name:"PriceSignerSet",type:"event"},{inputs:[],name:"NotReady",type:"error"},{inputs:[],name:"NoteBadSignature",type:"error"},{inputs:[],name:"NoteExpired",type:"error"},{inputs:[],name:"NoteNotYetValid",type:"error"},{inputs:[{internalType:"uint256",name:"spot",type:"uint256"},{internalType:"uint256",name:"note",type:"uint256"}],name:"NoteOutsideGuard",type:"error"},{inputs:[],name:"NoteWrongWallet",type:"error"},{inputs:[{internalType:"address",name:"source",type:"address"}],name:"OracleUnreadable",type:"error"}];function Qe(n){return"source"in n&&n.source==="pool-spot-estimate"?void 0:n}var M=300,Te="1000000000000000000",le=p(h[m].tokens.USDG.address),fe=p(h[l].deployments.test_USDG.address),_=p(h[m].tokens.WETH.address),L=p(h[l].deployments.test_WETH.address),I=p(X.chop);function pe(n){return n.chainId===m&&n.address.toLowerCase()===I.toLowerCase()}async function Ye(n,e,t,o){let s=o?.find(b=>b.measuredAtBlock===t.toString()&&[b.log.address,b.staking.address].some(y=>y.toLowerCase()===n.address.toLowerCase())),i=n.address;try{s||(i=p(await $(e,n.address,"INDEX_FUND",[],t)))}catch{}let a=s??await V(e,i,"read",t);if(a.drift.length)throw new c("Chop code changed; share backing cannot be estimated.");let r=10n**BigInt(n.decimals),d=n.address.toLowerCase()===a.log.address.toLowerCase(),u=n.address.toLowerCase()===a.staking.address.toLowerCase();if(!d&&!u||n.chainId!==m||n.decimals!==(d?a.log.decimals:a.staking.decimals))throw new c("Chop share identity does not match the verified log.");let f=d?[(await z(e,a,oe,r,t)).net]:(await j(e,a,oe,r,t)).assets;if(!f.length)throw new c("Chop LP reserves or net log backing could not be verified.");return{assets:f,isLog:d}}function be(n){let e=n.address.toLowerCase();return n.chainId===m?e===le.toLowerCase():n.chainId===l?e===fe.toLowerCase():!1}function ye(n){return n.chainId!==m&&n.chainId!==l?!1:C(n.address)===g}function we(n){let e=n.address.toLowerCase();return n.chainId===m?e===_.toLowerCase():n.chainId===l?e===L.toLowerCase():!1}function Se(n){return ye(n)||we(n)}var ge=-887272,he=887272,Pe=(1n<<256n)-1n,Ce=me(["function observe(uint32[] secondsAgos) view returns (int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s)","function slot0() view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)"]),de=me(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),xe=1n<<192n;async function De(n,e){let t=p(A.stateView),o=A.poolId,[s,i]=await Promise.all([n.readContract({address:t,abi:de,functionName:"getSlot0",args:[o],blockNumber:e}),n.readContract({address:t,abi:de,functionName:"getLiquidity",args:[o],blockNumber:e})]),a=s[0],r=Number(s[1]);if(a<=0n||i<=0n||!Number.isInteger(r)||r<ge||r>he)throw new c("The pinned Uniswap v4 WETH/CHOP pool has no active liquidity, and the only other route is a near-empty pool.");return{numerator:xe,denominator:a*a}}function H(n,e){if(typeof n=="bigint")return n;if(typeof n=="number"){if(!Number.isSafeInteger(n))throw new c(`Invalid ${e} timestamp.`);return BigInt(n)}if(typeof n=="string"&&/^-?\d+$/.test(n.trim()))return BigInt(n.trim());throw new c(`Invalid ${e} timestamp.`)}function Je(n,e=BigInt(Math.floor(Date.now()/1e3)),t=M){try{return w(n,e,t),!0}catch{return!1}}function w(n,e=BigInt(Math.floor(Date.now()/1e3)),t=M){if(!Number.isInteger(t)||t<0)throw new c("Maximum price age must be a non-negative integer.");let o=H(n,"price"),s=H(e,"current");if(o<=0n)throw new c("Price timestamp must be positive.");if(o>s)throw new c("Price timestamp is in the future.");let i=s-o;if(i>BigInt(t))throw new c(`Price is stale: age ${i}s exceeds ${t}s.`);return o.toString()}function ke(n){if(!Number.isInteger(n)||n<ge||n>he)throw new c(`Tick ${n} is outside valid Uniswap bounds.`);let e=BigInt(n<0?-n:n),t=(e&0x1n)!==0n?0xfffcb933bd6fad37aa2d162d1a594001n:0x100000000000000000000000000000000n;return(e&0x2n)!==0n&&(t=t*0xfff97272373d413259a46990580e213an>>128n),(e&0x4n)!==0n&&(t=t*0xfff2e50f5f656932ef12357cf3c7fdccn>>128n),(e&0x8n)!==0n&&(t=t*0xffe5caca7e10e4e61c3624eaa0941cd0n>>128n),(e&0x10n)!==0n&&(t=t*0xffcb9843d60f6159c9db58835c926644n>>128n),(e&0x20n)!==0n&&(t=t*0xff973b41fa98c081472e6896dfb254c0n>>128n),(e&0x40n)!==0n&&(t=t*0xff2ea16466c96a3843ec78b326b52861n>>128n),(e&0x80n)!==0n&&(t=t*0xfe5dee046a99a2a811c461f1969c3053n>>128n),(e&0x100n)!==0n&&(t=t*0xfcbe86c7900a88aedcffc83b479aa3a4n>>128n),(e&0x200n)!==0n&&(t=t*0xf987a7253ac413176f2b074cf7815e54n>>128n),(e&0x400n)!==0n&&(t=t*0xf3392b0822b70005940c7a398e4b70f3n>>128n),(e&0x800n)!==0n&&(t=t*0xe7159475a2c29b7443b29c7fa6e889d9n>>128n),(e&0x1000n)!==0n&&(t=t*0xd097f3bdfd2022b8845ad8f792aa5825n>>128n),(e&0x2000n)!==0n&&(t=t*0xa9f746462d870fdf8a65dc1f90e061e5n>>128n),(e&0x4000n)!==0n&&(t=t*0x70d869a156d2a1b890bb3df62baf32f7n>>128n),(e&0x8000n)!==0n&&(t=t*0x31be135f97d08fd981231505542fcfa6n>>128n),(e&0x10000n)!==0n&&(t=t*0x9aa508b5b7a84e1c677de54f3e99bc9n>>128n),(e&0x20000n)!==0n&&(t=t*0x5d6af8dedb81196699c329225ee604n>>128n),(e&0x40000n)!==0n&&(t=t*0x2216e584f5fa1ea926041bedfe98n>>128n),(e&0x80000n)!==0n&&(t=t*0x48a170391f7dc42444e8fa2n>>128n),n>0&&(t=Pe/t),(t>>32n)+(t%(1n<<32n)===0n?0n:1n)}async function ce(n,e,t,o){let s=async()=>{throw new c("Price identity resolution is read-only.")},i=K({network:e===l?"testnet":"mainnet",clientFor:r=>t.client??T(t.rpcUrl,r),http:t.http??F(),preview:s,quoteSwap:s,buildSwap:s}),a=await ie(n,{context:i,oakTokenAddress:t.oakTokenAddress??process.env.OAK_TOKEN_ADDRESS,officialStockTokens:t.officialStockTokens,tokenMetadata:o,blockNumber:t.blockNumber,readMetadata:async r=>{let d=t.client??T(t.rpcUrl,e),[u,f]=await Promise.all([v(d,e,r,"symbol",t.blockNumber),v(d,e,r,"decimals",t.blockNumber)]);return{address:r,symbol:u,decimals:f,chainId:e}}});return{address:a.address,symbol:a.kind==="erc20"&&o?o.symbol:a.symbol,decimals:a.decimals,chainId:a.chainId}}async function ve(n,e,t){if(typeof n=="object"&&n!==null){let r=n.chainId??e,d=C(n.address)===g?g:p(n.address),u={address:d,symbol:n.symbol,decimals:n.decimals,chainId:r};return be(u)?{address:d,symbol:"USDG",decimals:k,chainId:r}:ye(u)?{address:g,symbol:"ETH",decimals:18,chainId:r}:we(u)?{address:d,symbol:"WETH",decimals:18,chainId:r}:pe(u)?{address:d,symbol:"CHOP",decimals:18,chainId:r}:ce(u.address,r,t,u)}let o=n.trim(),s=o.toUpperCase(),i=o.toLowerCase();if(s==="ETH"||se(o,{strict:!1})&&C(o)===g)return{...re,chainId:e};if(s==="WETH"||e===m&&i===_.toLowerCase()||e===l&&i===L.toLowerCase()){if(e!==m&&e!==l)throw new c(`No canonical WETH address configured for chain ${e}.`);return{address:e===l?L:_,symbol:"WETH",decimals:18,chainId:e}}if(s==="USDG"||e===m&&i===q.toLowerCase()||e===l&&i===W.toLowerCase()){if(e!==m&&e!==l)throw new c(`No canonical USDG address configured for chain ${e}.`);return{address:e===l?fe:le,symbol:"USDG",decimals:k,chainId:e}}if(e===m&&(s==="USDE"||i===O.address.toLowerCase()))return{...O,chainId:e};if(e===m&&(s==="CHOP"||i===I.toLowerCase()))return{address:I,symbol:"CHOP",decimals:18,chainId:e};let a=t.oakTokenAddress??process.env.OAK_TOKEN_ADDRESS;if(s==="OAK"||a&&o.toLowerCase()===a.toLowerCase()){if(!a&&!se(o,{strict:!1}))throw new c("OAK token address is required to price OAK.");return{address:p(a??o),symbol:"OAK",decimals:G,chainId:e}}return ce(n,e,t)}async function x(n,e,t){if(e)return(await n.readContract({address:e,abi:ae,functionName:"ethUsdE18",blockNumber:t})).toString();let s=(await n.readContract({address:p(B),abi:Ce,functionName:"observe",args:[[U,0]],blockNumber:t}))[0];if(!s||s.length<2)throw new c("ETH/USDG pool observation returned insufficient tick cumulatives.");let i=ee(s[0],s[1],U),a=ke(i);return te(a)}async function S(n,e,t,o){if(n.timestamp!==void 0)return w(n.timestamp,t(),o);if(e&&typeof e.getBlock=="function"){let i=await P(e,n.blockNumber);return w(i.timestamp,t(),o)}let s=t();return w(s,s,o)}function ue(n){if(n.startsWith("untrusted "))try{let e=JSON.parse(n.slice(10));if(typeof e=="string"&&D(e)===n)return n}catch{}return D(n)}async function Ze(n,e={}){let t=e.chainId??m,o=e.maxAgeSeconds??M,s=()=>e.now!==void 0?H(e.now,"current"):BigInt(Math.floor(Date.now()/1e3)),i=await ve(n,t,e);if((R(i.symbol)||i.symbol.length>256)&&(i.symbol=ue(i.symbol)),e.trades){let r=await S(e,e.client,s,o),d=ne(e.trades,{now:s(),windowStart:e.windowStart,windowEnd:e.windowEnd});if(e.spotOakPerEthE18!==void 0&&!J(d,e.spotOakPerEthE18))throw new c("30-minute average is outside the 50% spot guard band.");let u=e.ethUsdE18!==void 0?e.ethUsdE18.toString():await x(e.client??T(e.rpcUrl,t),e.oracleAddress);return{token:i,usdE18:Z(u,d),timestamp:r}}if(e.usdE18!==void 0){let r=await S(e,e.client,s,o),d=E(e.usdE18.toString());if(d<=0n)throw new c("USD price must be positive.");return{token:i,usdE18:d.toString(),timestamp:r}}if(e.resolver){let r=await e.resolver(i),d=w(r.timestamp,s(),o),u=E(r.usdE18);if(u<=0n)throw new c("USD price must be positive.");return{token:i,usdE18:u.toString(),timestamp:d,...r.source==="pool-spot-estimate"?{source:r.source,sourceLabel:N}:{}}}let a=e.client??T(e.rpcUrl,t);if(be(i)){let r=await S(e,a,s,o);return{token:i,usdE18:Te,timestamp:r}}if(Se(i)){let r=await S(e,a,s,o),d=await x(a,e.oracleAddress,e.blockNumber);return{token:i,usdE18:d,timestamp:r}}if(pe(i)){let r=e.timestamp===void 0&&a&&typeof a.getBlock=="function"?await P(a,e.blockNumber):void 0,d=r?w(r.timestamp,s(),o):await S(e,a,s,o);if(r&&r.number===null)throw new c("CHOP reference requires a mined block.");let u=r?.number??e.blockNumber,[f,b]=await Promise.all([De(a,u),e.ethUsdE18!==void 0?Promise.resolve(e.ethUsdE18.toString()):x(a,e.oracleAddress,u)]),y=E(b)*f.numerator/f.denominator;if(y<=0n)throw new c("CHOP USD reference price must be positive.");return{token:i,usdE18:y.toString(),timestamp:d}}if(i.chainId===m)try{let r=await P(a,e.blockNumber),d=w(r.timestamp,s(),o);if(r.number===null)throw new c("Pons reference requires a mined block.");let u=await Q(i,a,r.number);if(u!==void 0&&u>0n)return{token:i,usdE18:u.toString(),timestamp:d,source:"pool-spot-estimate",sourceLabel:N};let[f,b]=await Promise.all([Y(i,a,r.number),x(a,e.oracleAddress,r.number)]),y=E(b)*f.numerator/f.denominator;if(y<=0n)throw new c("Pons USD reference price must be positive.");return{token:i,usdE18:y.toString(),timestamp:d}}catch{}throw new c(`Oak has no fresh on-chain trade price for ${ue(i.symbol)}, so it shows no price. balances and positions show a labeled estimate where one exists; an estimate is not a quote.`)}export{Qe as a,M as b,Te as c,pe as d,Ye as e,be as f,ye as g,we as h,Se as i,De as j,Je as k,w as l,ke as m,x as n,Ze as o};
@@ -1 +0,0 @@
1
- import{c as Q}from"./SUNTJ6IU.js";import{b as X}from"./ADIPEGNN.js";import{b as Z}from"./OB7BFDOV.js";import{i as ee}from"./ANIF3JMV.js";import{a as Y}from"./E76Z2TT4.js";import{b as z}from"./GBIBRYOV.js";import{a as D,b as k,c as R,d as N,g as V,h as I,k as _,l as x,n as B,p as W,r as $,s as U,t as q,v as E,x as J,y as G}from"./3A2IKFTV.js";import{a as y}from"./X5V2Z2NM.js";import{b as K}from"./SPJCSEKP.js";import{a as O}from"./43LI5NKJ.js";import{c as L,e as T,g as w}from"./NWNYJ26T.js";import{a as g,d as j}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{Buffer as te}from"node:buffer";import{decodeEventLog as re,encodeFunctionData as H,getAddress as se,hexToString as de,parseAbiItem as ce,toEventSelector as ie}from"viem";var Ke={register:"erc8004_register"},ge="Oak now always adds the public oak.registrar marker when it registers an agent, so tag: false and --no-tag are no longer available. Remove the option and register again. To use an agent ID you already own without the marker, link it with oak setup link <agentId>.",fe="The registration went through, but Oak could not find its oak.registrar marker on Robinhood Chain. Nothing else was sent. Ask me to check the agent with erc8004_identity.",le="One transaction registers your agent and writes the public marker oak.registrar = oak. Anyone can see on Robinhood Chain that this agent was registered through Oak. The marker is self-reported, not proof of anything, and the transaction stays in the public history even if the marker is changed later. It needs gas.",F="https://eips.ethereum.org/EIPS/eip-8004#registration-v1",ue={type:"object",required:["type","name","description","image","services","x402Support","active","registrations"],properties:{type:{const:F,description:"ERC-8004 registration-v1 profile type URI."},name:{type:"string",minLength:1,description:"Short public name for the agent."},description:{type:"string",description:"Public text describing what the agent does; may be empty."},image:{type:"string",description:"Public HTTPS or IPFS image URI without credentials."},services:{type:"array",items:{type:"object",required:["name","endpoint"]},description:"Service endpoint objects with name and endpoint; use an empty list for none."},x402Support:{type:"boolean",description:"Whether the agent supports x402 payments."},active:{type:"boolean",description:"Whether this agent is active."},registrations:{type:"array",description:"Registry references with agentRegistry and agentId; leave empty before first registration."},tags:{type:"array",items:{type:"string"},description:"Optional public text labels for the agent."},supportedTrust:{type:"array",items:{type:"string"},description:"Optional trust mechanism labels supported by the agent."}}};function pe(e){if(typeof e!="string"||!e.trim())return!1;try{let t=new URL(e);return["https:","ipfs:"].includes(t.protocol)&&!!t.hostname&&!t.username&&!t.password}catch{return!1}}var me=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"&&t.trim()),he=e=>e.replace(/\.$/,"");function ye(e,t,a,n){let{registryId:d}=I(e);if(!T(t))throw new g("Provide a registration-v1 profile object.");if(a!==void 0&&typeof a!="boolean")throw new g("The tag option must be a boolean.");let o=[],r=(i,c)=>o.push(`${i}: ${c}`);t.type!==F&&r("type",`use "${F}"`),(typeof t.name!="string"||!t.name.trim())&&r("name",'a short name for your agent, such as "Oak Agent 1"'),typeof t.description!="string"&&r("description","a sentence about what your agent does (it may be empty text)"),pe(t.image)||r("image","an HTTPS or IPFS link to a picture, with no username or password in it"),typeof t.active!="boolean"&&r("active","true or false"),typeof t.x402Support!="boolean"&&r("x402Support","true or false"),Array.isArray(t.services)?t.services.forEach((i,c)=>{try{Z(i)}catch(p){if(!(p instanceof g))throw p;r(`services item ${c+1}`,he(p.message))}}):r("services","a list of endpoints, or [] for none");for(let i of["tags","supportedTrust"])t[i]!==void 0&&!me(t[i])&&r(i,"a list of nonempty text labels, or leave it out");if(Array.isArray(t.registrations)?t.registrations.forEach((i,c)=>{let p=`registrations item ${c+1}`;if(!T(i)||typeof i.agentRegistry!="string"||!/^eip155:[1-9][0-9]*:0x[0-9a-fA-F]{40}$/.test(i.agentRegistry))return r(p,"an agentRegistry such as eip155:4663:0x\u2026 and its agentId");let f=typeof i.agentId=="number"&&Number.isSafeInteger(i.agentId)?String(i.agentId):i.agentId,b;try{b=x(f)}catch{return r(p,'an agentId as a whole number, such as "1"')}w(i.agentRegistry,d)&&(n===void 0?r(p,"remove the entry for this registry; its ID comes from the mined Registered receipt, and erc8004_update adds it afterwards"):b!==n&&r(p,`the agentId does not match the agent being updated; use "${n}" or remove the entry`))}):r("registrations","a list, or [] before the first registration"),o.length)throw new g(`This profile needs: ${o.join("; ")}. Fix all of these and try again.`);let u=t.registrations.map(i=>({...i}));n!==void 0&&!u.some(i=>w(i.agentRegistry,d))&&u.push({agentId:n.toString(),agentRegistry:d});let s=[...new Set((t.tags??[]).filter(i=>i!==k))];a!==!1&&s.push(k);let m={...t,registrations:u,...s.length?{tags:s}:{}};s.length||delete m.tags;let l;try{if(l=JSON.stringify(m),te.byteLength(l)>65536)throw new Error;JSON.parse(l)}catch{throw new g("Profile must be JSON data no larger than 64 KiB.")}return`data:application/json;base64,${te.from(l,"utf8").toString("base64")}`}async function M(e,t){try{let{chainId:a,registry:n}=I(e),d=x(t),o=e.clientFor(a),r=await o.readContract({address:n,abi:y,functionName:"ownerOf",args:[d]}).catch(l=>{throw j(l)?new g(`Agent ${d} does not exist in this ERC-8004 registry: the owner lookup reverted. Check the agent ID.`):l});O(r);let[u,s,m]=await Promise.all([o.readContract({address:n,abi:y,functionName:"tokenURI",args:[d]}),o.readContract({address:n,abi:y,functionName:"getAgentWallet",args:[d]}),o.readContract({address:n,abi:y,functionName:"getMetadata",args:[d,k]})]);if(O(s),typeof u!="string"||typeof m!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(m))throw new g("The registry returned invalid identity data.");return{agentId:d.toString(),chainId:a,registry:n,owner:r,uri:u,agentWallet:s,registrarMetadata:m,registryValidated:!1,summary:D}}catch(a){throw new g(e.plainError(a))}}async function De(e,t){let a=await M(e,t);return{...a,uri:A(a.uri)}}async function we(e,t,a,n,d,o){let{registry:r}=I(e),u=await E(e,t,a,d),s=o===void 0?"Registered":"URIUpdated",m=ie(o===void 0?"Registered(uint256,string,address)":"URIUpdated(uint256,string,address)"),l=u.logs.filter(v=>w(v.address,r)&&v.topics[0]===m&&!v.removed);if(l.length!==1)throw new g(`The receipt must contain one matching ${s} event.`);let i=l[0],c=re({abi:y,eventName:s,topics:i.topics,data:i.data,strict:!0}),p=c.args.agentId,f=c.eventName==="Registered"?c.args.agentURI:c.args.newURI,b=c.eventName==="Registered"?c.args.owner:c.args.updatedBy;if(o!==void 0&&p!==o||f!==n||!w(b,a))throw new g("The registry event does not match the expected agent, URI and wallet.");let h=await M(e,p.toString());if(h.uri!==n||o===void 0&&!w(h.owner,a))throw new g("The current agent owner or URI does not match the confirmed operation.");return h}function be(e,t){let{chainId:a,registry:n}=I(e);return e.unsignedTx({to:n,chainId:a,value:"0",data:H({abi:y,functionName:"setMetadata",args:[t,k,R]}),description:`Set mutable oak.registrar metadata to oak for agent ${t}.`})}async function ae(e,t,a,n){let{registry:d}=I(e),o=x(n.agentId),r=await E(e,t,a,H({abi:y,functionName:"setMetadata",args:[o,k,R]})),u=ie("MetadataSet(uint256,string,string,bytes)"),s=r.logs.filter(c=>w(c.address,d)&&c.topics[0]===u&&!c.removed);if(s.length!==1)throw new g("The receipt must contain one matching MetadataSet event.");let m=s[0],{args:l}=re({abi:y,eventName:"MetadataSet",topics:m.topics,data:m.data,strict:!0});if(l.agentId!==o||l.metadataKey!==k||l.metadataValue!==R)throw new g("The metadata event does not match this agent and registrar marker.");let i=await M(e,n.agentId);if(i.registrarMetadata!==R||i.uri!==n.uri||!w(i.owner,n.owner))throw new g("The current agent metadata, owner or URI does not match the confirmed operation.");return i}async function ke(e,t){let{chainId:a,registry:n}=I(e),d=e.clientFor(a),o=await d.readContract({address:n,abi:y,functionName:"balanceOf",args:[t]});if(o===0n)return;if(typeof o!="bigint"||o<0n)throw new g("Registry balance is unavailable; registration was not built.");let r=await d.getBlockNumber({cacheTime:0}),u=new Set;for(;;){let s=r>9999999n?r-9999999n:0n,m=await d.getLogs({address:n,event:ce("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:t},fromBlock:s,toBlock:r,strict:!0});for(let l of m){let i=l.args.tokenId.toString();if(l.removed||u.has(i))continue;u.add(i);let c=await M(e,i);if(w(c.owner,t))return c}if(s===0n)throw new g("Owned identity could not be located; registration was not built. Run oak setup link <agentId>.");r=s-1n}}function Ie(e){if(e===void 0)return[];if(!Array.isArray(e)||e.length>15)throw new g("Provide at most 15 user metadata entries as { key, value } with value as 0x hex or text.");let t=new Set;return e.map(a=>{if(!T(a))throw new g("Provide each metadata entry as { key, value } or { key, text }.");let n=J(a.key);if(n===k)throw new g("The key oak.registrar is reserved for the registration marker. Remove that metadata entry.");if(t.has(n))throw new g(`Metadata key ${A(n)} is repeated.`);return t.add(n),{metadataKey:n,metadataValue:G(a)}})}function oe(e,t,a){let n=$(t);if(!n)return;let{registryId:d}=I(e);return Array.isArray(n.registrations)&&n.registrations.some(o=>T(o)&&typeof o.agentRegistry=="string"&&w(o.agentRegistry,d)&&String(o.agentId)===a.toString())}function ve(e,t,a){let n=oe(e,t.uri,BigInt(t.agentId));return n===!0?{...t,profileComplete:!0}:{...t,profileComplete:n===void 0?null:!1,nextStep:{tool:"erc8004_update",arguments:{agentId:t.agentId,profile:a??"a registration-v1 profile object"},why:"The minted profile does not list its own registry and agent ID yet (registrations is empty). erc8004_update appends it automatically. It is a normal action: it needs a verified identity link and an active subscription, so link with oak_setup first."}}}async function ne(e,t,a,n){let{chainId:d,registry:o}=I(e);O(n),B(e,a.chainId);let r=t?x(a.agentId):void 0;if(!t&&(a.tag===!1||a.noTag!==void 0||a["--no-tag"]!==void 0))throw new g(ge);if(a.tag!==void 0&&typeof a.tag!="boolean")throw new g("The tag option must be a boolean.");let s=!t&&a.profile===void 0?"":ye(e,a.profile,a.tag,r),m=t?[]:Ie(a.metadata),l=a.tag!==!1;if(t&&a.metadataTransactionHash!==void 0&&(!l||a.transactionHash===void 0))throw new g("A metadata transaction hash requires tagging and the profile transaction hash.");let i=r!==void 0?H({abi:y,functionName:"setAgentURI",args:[r,s]}):H({abi:y,functionName:"register",args:[s,[...m,{metadataKey:k,metadataValue:R}]]}),c=f=>r===void 0?ve(e,f,a.profile):f;if(a.transactionHash!==void 0){let f=await we(e,a.transactionHash,n,s,i,r);if(!t){if(!w(f.registrarMetadata,R))throw new g(fe);if(a.metadataTransactionHash!==void 0)throw new g("Registration already writes oak.registrar in one transaction. Omit metadataTransactionHash.");return c(f)}return l&&a.metadataTransactionHash!==void 0?c(await ae(e,a.metadataTransactionHash,n,f)):c(f)}if(!t){let f=await ke(e,n);if(f){let b={...f,registrationResumed:!0},h=$(f.uri),v=Array.isArray(h?.tags)&&h.tags.includes(k);if(a.metadataTransactionHash!==void 0){if(!v)throw new g("Only a legacy Oak profile can resume its registrar metadata. Link this agent with oak setup link <agentId>.");return c({...await ae(e,a.metadataTransactionHash,n,f),registrationResumed:!0})}if(!v||f.registrarMetadata!=="0x")return c(b);let S=await U(e,[be(e,x(f.agentId))],n,`Resume registrar metadata for legacy Oak agent ${f.agentId}; no new identity will be minted. Submit locally, then repeat these arguments with metadataTransactionHash to verify the marker receipt.`);return{...b,...S}}if(a.metadataTransactionHash!==void 0)throw new g("No owned legacy Oak identity was found; no metadata transaction was built.")}r!==void 0&&await q(e,r,n);let p=[e.unsignedTx({to:o,data:i,value:"0",chainId:d,description:r===void 0?"Register an ERC-8004 agent profile.":`Update ERC-8004 agent ${r} profile.`})];return t?U(e,p,n,"Submit locally, then repeat the original arguments with transactionHash to verify the profile receipt and URI. The tag option changes the profile tag only; existing onchain metadata is unchanged."):U(e,p,n,`${le} Submit locally, then repeat the original arguments with transactionHash to verify the registration receipt, URI and marker. Update the profile registrations with the mined ID afterward.`)}async function Re(e,t){let a=await M(e,t.agentId),{chainId:n,registry:d}=I(e),o=e.clientFor(n),r=BigInt(a.agentId),u=t.metadataKeys===void 0?[]:(()=>{if(!Array.isArray(t.metadataKeys)||t.metadataKeys.length>16)throw new g("Provide at most 16 metadata keys.");return t.metadataKeys.map(h=>W(h,"metadata key",128,!1))})(),s=t.operator===void 0?void 0:se(String(t.operator)),[m,l,...i]=await Promise.allSettled([o.readContract({address:d,abi:y,functionName:"getApproved",args:[r]}),s?o.readContract({address:d,abi:y,functionName:"isApprovedForAll",args:[a.owner,s]}):Promise.resolve(void 0),...u.map(h=>o.readContract({address:d,abi:y,functionName:"getMetadata",args:[r,h]}))]),c=h=>h.status==="fulfilled"?h.value:void 0,p=c(m),f=_(a.agentWallet)?"unset":w(a.agentWallet,a.owner)?"owner":"verified-other",b=oe(e,a.uri,r);return{...a,approved:typeof p=="string"&&_(p)?null:p??"unavailable",...s?{operator:s,operatorApproved:c(l)??"unavailable"}:{},walletState:f,walletNote:f==="unset"?"No verified payment wallet: it starts as the minting owner, and any NFT transfer or erc8004_unset_wallet clears it. Re-verify with erc8004_wallet_proof then erc8004_set_wallet.":f==="owner"?"The payment wallet is the current owner.":"The payment wallet was proven by a signature from that wallet and is not the owner.",profile:{selfRegistered:b??null,fetched:!1,note:b===void 0?"The URI is external or not decodable; Oak does not fetch it.":void 0},...u.length?{metadata:Object.fromEntries(u.map((h,v)=>{let S=c(i[v]),P=typeof S=="string"&&/^0x([0-9a-fA-F]{2})*$/.test(S)?S:void 0,C;if(P&&P!=="0x")try{C=A(de(P))}catch{C=void 0}return[A(h),{hex:P??"unavailable",...C?{text:C}:{}}]}))}:{}}}var Ae={type:"object",additionalProperties:!1,required:["key"],properties:{key:{type:"string",minLength:1,maxLength:128,description:"Metadata key; agentWallet and oak.registrar are reserved during registration."},value:{...V,description:"Metadata bytes as 0x-prefixed hex; provide value or text."},text:{type:"string",description:"Metadata as UTF-8 text; provide text or value."}}},Te=e=>{let t=(n,d,o)=>({name:n,inputSchema:d,execute:async(r,u)=>{try{let s=await o(r,u);return T(s)&&typeof s.uri=="string"?{...s,uri:A(s.uri)}:s}catch(s){throw new g(e.plainError(s))}}}),a=n=>({type:"object",additionalProperties:!1,required:n?["agentId","profile"]:[],properties:{profile:{...ue,description:n?"Registration-v1 profile object to publish for this agent.":"Omit for an empty URI; register(uri, metadata[]) still writes the public oak.registrar marker. Attach a profile later with erc8004_update."},tag:{type:"boolean",default:!0,description:n?"Set false to remove the profile tag. Profile updates leave existing onchain metadata unchanged.":"Accepted only as true. Oak always adds the oak.registrar marker when it registers."},transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Verify the exact profile transaction, event and URI.":"After local submission, verify exact registration calldata, event, URI and oak.registrar marker."},metadataTransactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Optional legacy metadata transaction hash, supplied with transactionHash to verify a previously sent two-transaction update.":"Only for a resumed legacy Oak profile: verify its separate metadata transaction without transactionHash."},...n?{agentId:N}:{noTag:{type:"boolean",description:"Removed option: omit it and register again."},"--no-tag":{type:"boolean",description:"Removed option: omit it and register again."},metadata:{type:"array",maxItems:15,items:Ae,description:"Up to 15 user entries plus the mandatory oak.registrar marker. The keys agentWallet and oak.registrar are reserved."}}}});return{tools:[t("erc8004_register",a(!1),(n,d)=>ne(e,!1,n,d)),t("erc8004_update",a(!0),(n,d)=>ne(e,!0,n,d)),t("erc8004_identity",{type:"object",additionalProperties:!1,required:["agentId"],properties:{agentId:N,metadataKeys:{type:"array",maxItems:16,items:{type:"string",minLength:1,maxLength:128},description:"Also read these onchain metadata keys."},operator:{...L,description:"Also report whether this address is approved for all of the owner's agents."}}},n=>Re(e,n))]}},Ve=e=>K("erc8004",[Te(e),Q(e),X(e),Y(e),z(e),ee(e)]);export{Ke as a,De as b,oe as c,Te as d,Ve as e};
@@ -1 +0,0 @@
1
- var a={chainId:4663,usdg:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",v4:{poolManager:"0x8366a39CC670B4001A1121B8F6A443A643e40951",swapper:"0x7Cd4E04E433E69e588728c86A3832753B5F846d4",quoter:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b"},v3:{router:"0xCaf681a66D020601342297493863E78C959E5cb2",quoter:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA"},tokens:[{symbol:"AAPL",token:"0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",pools:[{v:3,fee:500,pool:"0xAae0d815EE56e4092a5E5C2911E676Fea50B2d6D"},{v:4,fee:3e3,tickSpacing:60,id:"0xc748f4671a867db48b552f6b7650bf3255e05f80f00e3f7aad1b17ccb7898fdb"},{v:3,fee:3e3,pool:"0x783C9bbB765047CFdD2b84b92b2Ca9F11D34b7Ed"}]},{symbol:"AMD",token:"0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",pools:[{v:3,fee:3e3,pool:"0x48D284A2A4d3DC1b3Da08231Fe44317e7e7Aa51f"}]},{symbol:"AMZN",token:"0x12f190a9F9d7D37a250758b26824B97CE941bF54",pools:[{v:3,fee:3e3,pool:"0x8AC92DA74AB5F3b1d024Dc1943Ad7e15Dc4179Ef"},{v:4,fee:2400,tickSpacing:24,id:"0xefc94885c96b02696b9b45de43eeeb8ac53c0199cab42b4daae4911b96fb8825"}]},{symbol:"ASML",token:"0x47F93d52cBeC7C6D2CfC080e154002370a60dAEA",pools:[{v:3,fee:1e4,pool:"0xedb22516B14Eb2d1C86927Db373B0E8bF70F5cD1"}]},{symbol:"BABA",token:"0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x1791fc651cc794a282e5dbcb56d0b2b38eff8754b677c8876e86901521ecc439"},{v:3,fee:3e3,pool:"0xa57ab582b310dd6f9e934EA1EEEa152741545E6A"}]},{symbol:"COIN",token:"0x6330D8C3178a418788dF01a47479c0ce7CCF450b",pools:[{v:4,fee:2500,tickSpacing:25,id:"0xe2e1a0e32205e854525e0fb1d3667a53bd3b4919f032b9bcd2a038b6b6dac314"},{v:4,fee:1e4,tickSpacing:200,id:"0x007a13fa152f6dc383cad20a8eaab4e1e2538b606936eae2a424f8aa47d6db31"}]},{symbol:"CRCL",token:"0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",pools:[{v:3,fee:3e3,pool:"0x654E4143e82a5824445Ade0824351C2A9ACD95a8"},{v:4,fee:3e3,tickSpacing:30,id:"0x628c98ab436ee34a6a7decd606242890582591bdf7c9a35d90e0d08021c31ea0"},{v:4,fee:1500,tickSpacing:15,id:"0x5177eac8c2176468bbf15e44081e151d35c2e7d068e96d3db94f496a4dc944b2"}]},{symbol:"CRWV",token:"0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x237014478f7ef98afbe7412ac35b6a3f96b8fb111de48b7c4dbf49dba4bd9c4b"}]},{symbol:"DELL",token:"0x941AE714EC6D8130c7B75d67160Ca08f1e7d11Dd",pools:[{v:3,fee:1e4,pool:"0xc30c89cB7815A1488b7998D15eEC73961707Fc5a"}]},{symbol:"GME",token:"0x1b0E319c6A659F002271B69dB8A7df2F911c153E",pools:[{v:3,fee:500,pool:"0xE2b46c905E12Ab8E2f864e4821a4325884C1B126"}]},{symbol:"GOOGL",token:"0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",pools:[{v:3,fee:500,pool:"0x34D0dC122CF9A8Eb296fC5e0D3A233625D7d19b7"},{v:4,fee:300,tickSpacing:3,id:"0x43fe16b75cabbf38f5b185d16142b02d1d9200d8f1ba17cb6cf899f562c6197f"},{v:4,fee:3e3,tickSpacing:60,id:"0xd4ecb79fdc521d7725d22b33ed43cb4e47aa96bfad76aa29577e3151f723ac5e"}]},{symbol:"INTC",token:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",pools:[{v:3,fee:3e3,pool:"0x2e5a92f5013a64661A49312111be2e8aBd33F56a"}]},{symbol:"META",token:"0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",pools:[{v:4,fee:310,tickSpacing:3,id:"0xc58bb68060bcb7b3ea0f6d4a4afef1e57f628722e808db12afb6d1733552872f"},{v:3,fee:3e3,pool:"0x107a7Cb40d8665360ba10E59471Af06150A50922"},{v:4,fee:3e3,tickSpacing:60,id:"0x5875d407a42965b0e768c8925cea290e06fa50603ef34fc99eb92a1050e6ae36"}]},{symbol:"MSFT",token:"0xe93237C50D904957Cf27E7B1133b510C669c2e74",pools:[{v:3,fee:3e3,pool:"0xeb60bCD1D920ad6E102690CCFC6fB488899E1510"},{v:4,fee:3e3,tickSpacing:60,id:"0x9194a557b6a6bb2236b49ea7e2bbccec5d3eeb705aef00903be4b3de1d949579"}]},{symbol:"MSTR",token:"0xec262a75e413fAfD0dF80480274532C79D42da09",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x319bac87e616a89e241c10aeb8afd4892a852cdd8b373cd9765ecddc40b87cfe"},{v:4,fee:2400,tickSpacing:24,id:"0xc105b8300ff65d750a0e4e63c7a879e20504069b770713464a5315e797735326"}]},{symbol:"MU",token:"0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD",pools:[{v:3,fee:3e3,pool:"0xd057B1Bc54917855BBee58eAd58647f47caB35E5"}]},{symbol:"NBIS",token:"0x9D9c6684F596F66a64C030B93A886D51Fd4D7931",pools:[{v:4,fee:9900,tickSpacing:99,id:"0x7c2f9ce1214ba9baf56d1b6a1fc640c1b63e9a711172c0c7d10e5a9c4a3d4f0c"}]},{symbol:"NVDA",token:"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",pools:[{v:3,fee:500,pool:"0xd4EB21209C4D6093f80B5b84f5C45cc093EA14a3"},{v:4,fee:100,tickSpacing:1,id:"0x6444a8e0b267406a15db74ca00c4a24bdfa81ed3180f5b6d0851f8ed6f4f29c5"},{v:4,fee:3e3,tickSpacing:60,id:"0x3bb34a44f1b2b5f32c034c38a53065a521a47b199700fa9bd19d60985ff24bf1"}]},{symbol:"ORCL",token:"0xb0992820E760d836549ba69BC7598b4af75dEE03",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0xc2ce4784e1e72cf0221b51b30c8aaadf6c0b12863cf03ab3687854fb7b1d850a"}]},{symbol:"PLTR",token:"0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",pools:[{v:4,fee:1500,tickSpacing:15,id:"0xc59eaeda6d1a6f031bc7e1d039772f2d675e7b4de2c8668610f4471bd60b3802"},{v:3,fee:3e3,pool:"0x851680416A4f4E1c463d45171d61ACDdBc8554c0"}]},{symbol:"QQQ",token:"0xD5f3879160bc7c32ebb4dC785F8a4F505888de68",pools:[{v:3,fee:500,pool:"0xD60A5d14dB690B7Afad71F76B108071D7175597d"}]},{symbol:"SGOV",token:"0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5",pools:[{v:3,fee:500,pool:"0x6Ba50150B17Ffd0972915Aaf04fFd5E8f4Fa49b4"},{v:3,fee:3e3,pool:"0xfAb520051f96F4D2a32c22B6a3dD7fFfdf231bFe"}]},{symbol:"SLV",token:"0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f",pools:[{v:3,fee:3e3,pool:"0x8cB787e6c315D464775289BaD00FDD67d53Ecb3D"},{v:3,fee:1e4,pool:"0x0Fa7BC480885DCf58Ad2ef63eC7289cF2481D51c"}]},{symbol:"SNDK",token:"0xB90A19fF0Af67f7779afF50A882A9CfF42446400",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0x2707cb88a6a40fa0f948f58958051ba097d6f6a3cf7f87929bd68ccc5becea24"}]},{symbol:"SPCX",token:"0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",pools:[{v:3,fee:500,pool:"0xc61284332117c3FB23A2A56cceFFD07F7aF60029"},{v:3,fee:3e3,pool:"0xEb07d9587eFD1778dFb9c385Ec43EF6d5F9fE401"}]},{symbol:"SPY",token:"0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",pools:[{v:4,fee:100,tickSpacing:1,id:"0xe1ae6a4c6ccc9f037389a8d50a4f577bde1a9fe01d85d88ecbbd39955ce53288"},{v:3,fee:500,pool:"0xa7Bb1AC63BBaB0C44316E6c8C455213441689167"},{v:4,fee:500,tickSpacing:5,id:"0xe5923c8a8be481ec89a2ca784a2bbfa4235de6d88f92260fd66b660c4babf907"}]},{symbol:"TSLA",token:"0x322F0929c4625eD5bAd873c95208D54E1c003b2d",pools:[{v:3,fee:3e3,pool:"0xf4ACdAEEB7022862A763C9B1B885e11191c889E3"},{v:4,fee:3e3,tickSpacing:60,id:"0x8517f8071ae5b831b738052f12125e8e3d6c158b78728aa44ce3b25e5104d32e"}]},{symbol:"TSM",token:"0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",pools:[{v:4,fee:7500,tickSpacing:75,id:"0x0ba5d53d2f6255f334b7c8ead4f56b6aef5af3402c5e4d11180afd38c6b85fb1"},{v:3,fee:1e4,pool:"0x07e8Ea83D4C1340774c8965125e26e12bf943bf1"}]},{symbol:"USAR",token:"0xd917B029C761D264c6A312BBbcDA868658eF86a6",pools:[{v:3,fee:3e3,pool:"0x04391780F519B7d3ba59c9590459D76e23d225C4"}]},{symbol:"USO",token:"0xa30FA36Db767ad9eD3f7a60fC79526fB4d56D344",pools:[{v:4,fee:1200,tickSpacing:15,id:"0x1f2ad5a274a776d8e1408292bde1d92d8fa7b6444acf14ad60b9c3e4e5b66420"},{v:3,fee:3e3,pool:"0x02175608F1b5E6b5ed221cCFdC7Be197D111D915"}]}],notOffered:{CLSK:"thin",EWY:"thin",IONQ:"thin",RGTI:"thin",RKLB:"thin"},sourceCommit:"02230282d8888e00794207ed271ee01b4ce30309"};export{a};
@@ -1 +0,0 @@
1
- import{g as V,k as T}from"./GDUKZYE2.js";import{t as R,y as A}from"./FRT6AC6M.js";import{e as O,h as D,i as M,j as S,m as U,o as _,p as q}from"./XRDLMTBJ.js";import{a as I,b as k,g as F,h as H,i as N}from"./MQK6OP7S.js";import{a as t}from"./XSD5NL7J.js";import{randomUUID as J}from"node:crypto";import{getAddress as g,parseAbiItem as E}from"viem";var Q=E("event FamilyLaunched(bytes32 indexed familyId,address indexed owner,address indexed subject,address root)"),Y=E("event FamilyTransferred(bytes32 indexed familyId,address indexed owner)"),j=100000n,Z=64,z=512,K=300*1e3;function ce(P){let l=new Map,h=[g(k.launcherLegacy),g(k.launcherV1)],L=I.launcherDeployments,W=h.reduce((r,d)=>BigInt(L[d].blockNumber)<r?BigInt(L[d].blockNumber):r,BigInt(I.blockNumber));return{name:"hookr_lp_positions",inputSchema:{type:"object",additionalProperties:!1,properties:{cursor:{type:"string",minLength:1,maxLength:64,description:"Opaque, wallet-bound cursor from the preceding page; expires after five minutes. Restart without it if expired."},limit:{type:"integer",minimum:1,maximum:20,description:"Position summaries per page; defaults to 10. A page scans at most 100000 blocks and 32 family checks."}}},execute:async(r,d)=>{if(O(r,["cursor","limit"]),P.network==="testnet")throw new t("Hookr LP reads are configured only on mainnet, chain 4663.");let u=r.limit??10;if(typeof u!="number"||!Number.isInteger(u)||u<1||u>20)throw new t("Provide a Hookr position page limit from 1 to 20.");for(let[o,s]of l)s.expires<=Date.now()&&l.delete(o);let f=P.clientFor(4663),e;if(r.cursor!==void 0){if(typeof r.cursor!="string"||!l.has(r.cursor))throw new t("Hookr position cursor is unknown or expired. Restart without cursor; completeness has not been established.");let o=l.get(r.cursor);if(o.wallet!==d)throw new t("Hookr position cursor belongs to a different wallet. Restart without cursor.");if((await H(f,o.block.number)).hash!==o.block.hash)throw new t("Hookr position snapshot changed. Restart without cursor.");e={...o,candidates:[...o.candidates],seen:new Set(o.seen)}}else{let o=await H(f);e={wallet:d,block:o,nextBlock:o.number,firstBlock:W,candidates:[],member:0,seen:new Set,expires:Date.now()+K}}await F(f,e.block.number,[...h,k.rootV1]);let b=[],y=[],w=!1;if(e.candidates.length===0&&e.nextBlock>=e.firstBlock){let o=e.nextBlock,s=o-j+1n>e.firstBlock?o-j+1n:e.firstBlock;try{let i=(await Promise.all(h.flatMap(n=>[Q,Y].map(c=>f.getLogs({address:n,event:c,args:{owner:d},fromBlock:s,toBlock:o,strict:!0}))))).flat();if(i.length>z*2)throw new t("Hookr event page exceeds the bounded discovery limit. A dedicated position index is required.");let m=new Map;for(let n of i){let c=g(n.address),p=D(n.args.familyId);if(n.removed||!n.blockNumber||n.blockNumber<s||n.blockNumber>o||!h.includes(c)||n.args.owner!==d)throw new t("Hookr event page is incomplete or inconsistent with the requested wallet and block range.");let a=`${c}:${p}`;e.seen.has(a)||m.set(a,{launcher:c,familyId:p})}if(e.seen.size+m.size>z)throw new t("Hookr wallet history exceeds the bounded discovery limit. Completeness requires a dedicated position index.");e.candidates=[...m.values()];for(let n of m.keys())e.seen.add(n);e.nextBlock=s-1n}catch(i){w=!0,b.push(i instanceof t?i.message:"Hookr event history is unavailable for this block range. Retry this cursor; an empty page does not establish no positions.")}}let X=0;for(;!w&&e.candidates.length&&y.length<u&&X++<32;){let o=e.candidates[0],s=(i,m)=>q(f,o.launcher,_(o.launcher===g(k.launcherV1)?"launcherV1":"launcher"),i,m,e.block.number);try{let[i,m]=await Promise.all([s("familyOwner",[o.familyId]),s("memberCount",[o.familyId])]),n=M(i);if(BigInt(n)===0n)throw new t("Hookr family owner is unavailable for an indexed family.");if(n!==d){e.candidates.shift(),e.member=0;continue}let c=Number(S(m,8));if(c<1||c>8)throw new t("Hookr family member count is invalid.");for(;e.member<c&&y.length<u;){let p=e.member,a=U(await s("position",[o.familyId,p])),v=T(a.key);if(typeof a.tickLower!="number"||typeof a.tickUpper!="number")throw new t("Hookr family range is incomplete.");A(a.tickLower,a.tickUpper,v.tickSpacing);let $=S(a.liquidity,128),C=R(v);if(await s("poolFamily",[C])!==o.familyId)throw new t("Hookr position does not belong to this family.");let G=V({kind:"family",...o,member:String(p)});y.push({position:G,poolId:C,owner:d,liquidity:$.toString(),range:{tickLower:a.tickLower,tickUpper:a.tickUpper},poolKey:v}),e.member++}e.member===c&&(e.candidates.shift(),e.member=0)}catch(i){w=!0,b.push(i instanceof t?i.message:"Hookr family state is unavailable. Retry this cursor; no zero position is inferred.")}}await N(f,e.block);let x=!w&&e.nextBlock<e.firstBlock&&e.candidates.length===0;x||b.push("Discovery is incomplete. Continue nextCursor, including after an empty page. Current ownership is checked at the fixed snapshot; history gaps are not evidence of no positions.");let B=null;if(!x){for(;l.size>=Z;)l.delete(l.keys().next().value);B=J(),e.expires=Date.now()+K,l.set(B,e)}return typeof r.cursor=="string"&&l.delete(r.cursor),{chainId:4663,blockNumber:e.block.number.toString(),blockHash:e.block.hash,positions:y,nextCursor:B,complete:x,warnings:b,coverage:{custody:"reviewed Launcher families only",historyStartBlock:e.firstBlock.toString(),scannedFromBlock:e.nextBlock<e.block.number?(e.nextBlock+1n).toString():null,scannedThroughBlock:e.nextBlock<e.block.number?e.block.number.toString():null,snapshotBlock:e.block.number.toString()}}}}}export{ce as a};
@@ -1 +0,0 @@
1
- import{B as se,t as W,y as G}from"./FRT6AC6M.js";import{d as ke}from"./OSMOBKRQ.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"./XRDLMTBJ.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 +0,0 @@
1
- import{b as N}from"./CQ5WRWV4.js";import{a as O,b as R,c as Z,d as ue}from"./IV4K7FMD.js";import{a as Ae,e as ge}from"./GK3D7OKG.js";import{d as he}from"./OIQTZOBN.js";import{b as x}from"./Z7FGEWO2.js";import{a as de,b as ce,d as le,f as V,g as J,h as M,j as me,k as pe,l as fe,m as we}from"./BSX4LFYI.js";import{a as f,b as X,c as ie}from"./43LI5NKJ.js";import{c as Y}from"./5TUXSOMI.js";import{g as G}from"./NWNYJ26T.js";import{b as r,e as ae}from"./IX3GZMTM.js";import{A as se,b as F,j as W,x as j,y as Q}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{decodeFunctionData as C,encodeFunctionData as U,parseAbi as Oe}from"viem";var Be=60,te=50,tt=200;var De="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",ne="0x0000000000000000000000000000000000000000",D=W[4663].routes.kyberswap.address,y=W[4663].routes.velora.address,oe=j[4663].kyberswap.toLowerCase(),Se=j[4663].velora.toLowerCase(),Te="0x0000000000000000000000000000000000000000000000000000000000000000",Re=[le.pons,...V],$=Oe(["function swap((address callTarget, address approveTarget, bytes targetData, (address srcToken, address dstToken, address[] srcReceivers, uint256[] srcAmounts, address[] feeReceivers, uint256[] feeAmounts, address dstReceiver, uint256 amount, uint256 minReturnAmount, uint256 flags, bytes permit) desc, bytes clientData) execution) payable returns (uint256 returnAmount, uint256 gasUsed)"]),H=Oe(["function swapExactAmountIn(address executor, (address srcToken, address destToken, uint256 fromAmount, uint256 toAmount, uint256 quotedAmount, bytes32 metadata, address beneficiary) swapData, uint256 partnerAndFee, bytes permit, bytes executorData) payable returns (uint256 receivedAmount, uint256 submittedAmount, uint256 augustusFeeAmount)"]),E=class extends o{name="NoRouteError";constructor(t="No swap route is available for this token pair and amount."){super(t)}},L=class extends o{name="ExpiredQuoteError";constructor(t="Quote has expired. Request a fresh quote."){super(t)}},Ce=1e3,I=new Map;function be(e){for(let[t,n]of I)BigInt(e)>=r(n.expiresAt)&&I.delete(t)}function ee(e){return{...e,...e.sourcePoolRoute!==void 0?{sourcePoolRoute:structuredClone(e.sourcePoolRoute)}:{},...e.txs?{txs:e.txs.map(t=>({...t}))}:{}}}function ve(e){let t=ee(e);return t.txs&&(t.txs.forEach(Object.freeze),Object.freeze(t.txs)),Object.freeze(t)}var ye=["router","from","to","wallet","amountIn","amountOut","minAmountOut","expiresAt","chainId","spender","value","ponsCurveToken","ponsPoolToken","blockNumber","calldataMinAmountOut","expectedSpend","expectedRefund","oakFee","oakFeeBps","oakFeeToken","grossAmountOut","venueFee","venueFeeBps"];function K(e,t,n=!1){for(let s of ye)if(!(s==="expiresAt"&&n&&r(e.expiresAt)<=r(t.expiresAt))&&e[s]!==void 0&&String(e[s]).toLowerCase()!==String(t[s]).toLowerCase())throw new o(`Quote ${s} does not match the accepted quote.`)}function z(e=Date.now){let t=e();if(!Number.isFinite(t)||t<0)throw new o("Clock must return a non-negative timestamp.");return t>1e11?Math.floor(t/1e3):Math.floor(t)}function _(e){let t=e.toLowerCase();return t===De.toLowerCase()||t===ne.toLowerCase()}function Le(e,t=te){if(!Number.isInteger(t)||t<0||t>=1e4)throw new o("Slippage must be an integer from 0 to 9999 bps.");return ae(e,String(1e4-t),"10000","floor")}var _e=200;function nt(e){if(typeof e!="number"||!Number.isFinite(e)||!/^\d+(?:\.\d{1,2})?$/.test(String(e)))throw new o("Velora returned an unsupported venue fee. Request a fresh quote.");let[t,n=""]=String(e).split("."),s=Number(t)*100+Number(n.padEnd(2,"0"));return re(s),s}function re(e){if(!Number.isInteger(e)||e<0||e>_e)throw new o("Velora returned an unsupported venue fee. Request a fresh quote.")}function ke(e,t=O.bps){return re(t),r(e)*10000n/BigInt(1e4-t)+1n}function Pe(e,t){if(re(t),t!==O.bps||e!==Z)throw new o("Velora partnerAndFee must match the pinned Oak fee, recipient and flags.")}function Ie(e){if(e.oakFeeBps===O.bps)return`${ue()} ${e.provider==="velora"?"Oak\u2019s share is paid to the Oak treasury.":"Paid to the Oak treasury."} Venue fee: ${e.venueFee} base units (${e.venueFeeBps} bps) retained by ${e.provider??"venue"}. Output and minimum are net.${e.provider==="velora"?" Velora retains 15% of the partner fee; Oak receives 85% (about 21.25 bps).":""}`;if(e.oakFee!==void 0&&r(e.oakFee)!==0n)throw new o("Oak fee requires the pinned rate and token; venue fees must never be counted as Oak income.");let t=e.provider??"venue";return`Venue fee: ${e.venueFee} base units (${e.venueFeeBps} bps) retained by ${t}; Oak swap fee: 0 (venue fee is never Oak income).`}function Qe(e){f(e.from),f(e.to),f(e.wallet);let t=e.callTarget??Q[F].kyberswap.address,n=e.approveTarget??ne;f(t),f(n);let s=r(e.amountIn),a=r(e.minAmountOut);return U({abi:$,functionName:"swap",args:[{callTarget:t,approveTarget:n,targetData:e.targetData??"0x",desc:{srcToken:e.from,dstToken:e.to,srcReceivers:_(e.from)?[]:[t],srcAmounts:_(e.from)?[]:[s-BigInt(R(e.amountIn))],feeReceivers:[O.recipient],feeAmounts:[BigInt(O.bps)],dstReceiver:e.wallet,amount:s,minReturnAmount:a,flags:640n,permit:"0x"},clientData:e.clientData??"0x"}]})}function Ne(e){f(e.from),f(e.to),f(e.wallet);let t=e.executor??Q[F].velora.address;return f(t),U({abi:H,functionName:"swapExactAmountIn",args:[t,{srcToken:e.from,destToken:e.to,fromAmount:r(e.amountIn),toAmount:r(e.minAmountOut),quotedAmount:r(e.amountOut),metadata:e.metadata??Te,beneficiary:e.wallet},e.partnerAndFee??Z,"0x",e.executorData??"0x"]})}function Ve(e){if(typeof e!="string"||!/^0x([0-9a-fA-F]{2})+$/.test(e)||e.length<10)throw new o("Swap calldata must contain a 4-byte function selector.");let t=e.slice(0,10).toLowerCase();if(t===oe)return C({abi:$,data:e}).args[0].desc.minReturnAmount;if(t===Se)return C({abi:H,data:e}).args[1].toAmount;if(t==="0x3593564c")return M(e,Re).amountOutMinimum;let n=C({abi:Ae,data:e});if(n.functionName==="buy"||n.functionName==="sell")return n.args[1];throw new o(`Unsupported swap router selector ${t}.`)}function Fe(e,t,n=!1){let s=r(t),a=Ve(e);if(a<=0n||s<=0n||a!==s&&!(n&&(a>s||e.slice(0,10).toLowerCase()===oe&&a+1n===s)))throw new o(`Built swap calldata minimum output (${a}) does not match the accepted quote minimum (${s}).`);return a}function xe(e,t){let{from:n,to:s,wallet:a,amountIn:d}=t;if(!n||!s||!a||d===void 0)throw new o("Accepted quote must include input, output, amount and wallet.");for(let u of[n,s,a,t.router,e.to])f(u);let m=(u,l,w)=>{if(u.toLowerCase()!==l.toLowerCase())throw new o(`Built swap ${w} does not match the accepted quote.`)};if(m(e.to,t.router,"router"),e.chainId!==(t.chainId??F))throw new o("Built swap chain does not match the accepted quote.");let A=_(n)?r(d):0n;if(r(e.value)!==A||t.value!==void 0&&r(t.value)!==A)throw new o("Built swap value does not match the accepted quote input.");let g=e.data.slice(0,10).toLowerCase(),i=t.router.toLowerCase();if(i===D.toLowerCase()||i===y.toLowerCase()){let u=i===D.toLowerCase(),l=u?d:t.grossAmountOut,w=u?n:s;if(t.oakFeeBps!==O.bps||l===void 0||t.oakFee!==R(l)||t.oakFeeToken?.toLowerCase()!==x(w).toLowerCase())throw new o("Oak fee must match the pinned rate, token and amount.")}let c;if(i===D.toLowerCase()&&g===oe){m(t.spender??t.router,D,"spender");let u=C({abi:$,data:e.data});if(U({abi:$,...u}).toLowerCase()!==e.data.toLowerCase())throw new o("KyberSwap calldata must be canonically decodable.");let{callTarget:l,approveTarget:w,desc:p}=u.args[0];m(l,Q[F].kyberswap.address,"executor"),m(w,ne,"executor approval target");let S=_(n);if(p.srcReceivers.length!==p.srcAmounts.length||(S?p.srcReceivers.length!==0:p.srcReceivers.length===0||p.srcAmounts.some(h=>h<=0n)||p.srcAmounts.reduce((h,b)=>h+b,0n)!==r(d)-BigInt(R(d))))throw new o("KyberSwap source transfers must send the exact input less the pinned fee to the pinned executor or verified input pool.");for(let h of p.srcReceivers)if(h.toLowerCase()!==l.toLowerCase()&&!he(n,h,e.data))throw new o(`KyberSwap source transfers: receiver ${h} is not a verified input pool or the pinned executor.`);if(p.feeReceivers.length!==1||p.feeAmounts.length!==1||p.feeReceivers[0].toLowerCase()!==O.recipient.toLowerCase()||p.feeAmounts[0]!==BigInt(O.bps)||p.flags!==640n||p.permit!=="0x")throw new o("KyberSwap fee recipients, fee amounts, flags and permit must match the pinned Oak input-fee policy.");c={from:p.srcToken,to:p.dstToken,wallet:p.dstReceiver,amount:p.amount}}else if(i===y.toLowerCase()&&g===Se){m(t.spender??t.router,y,"spender");let u=C({abi:H,data:e.data});if(U({abi:H,...u}).toLowerCase()!==e.data.toLowerCase())throw new o("Velora calldata must be canonically decodable.");let[l,w,p,S]=u.args;if(!se.some(h=>h.toLowerCase()===l.toLowerCase()))throw new o("Built swap executor does not match the accepted quote.");if(S!=="0x")throw new o("Velora permit must match the pinned empty-permit policy.");if(Pe(p,t.oakFeeBps??O.bps),t.calldataMinAmountOut!==void 0&&r(t.calldataMinAmountOut)!==ke(t.minAmountOut,O.bps))throw new o("Velora calldata minimum must cover the accepted net output, venue fee and router dust.");if(t.calldataMinAmountOut!==void 0&&(w.quotedAmount!==r(t.grossAmountOut??"0")||w.quotedAmount<r(t.calldataMinAmountOut)))throw new o("Velora quoted gross output must match the accepted quote and cover its calldata minimum.");if(p!==0n&&t.calldataMinAmountOut===void 0)throw new o("Velora venue fee requires a fee-adjusted calldata minimum.");c={from:w.srcToken,to:w.destToken,wallet:w.beneficiary,amount:w.fromAmount}}else if(t.provider==="pons"&&(t.ponsPoolToken||t.ponsCurveToken))c=ge(e,{...t,from:n,to:s,wallet:a});else if(t.provider==="fobo")c=Ue(e,{...t,from:n,to:s,wallet:a});else throw new o("Built swap selector does not match the accepted router.");if(m(c.from,n,"input token"),m(c.to,s,"output token"),m(c.wallet,a,"recipient"),c.amount!==r(d))throw new o("Built swap input amount does not match the accepted quote.");Fe(e.data,t.calldataMinAmountOut??t.minAmountOut,i===D.toLowerCase())}var Me="FOBO route: the quoted output is already net of FOBO's pool taxes (2.5% per pool after a coin's first minute, higher during it). Oak swap fee: 0 on FOBO's route.";function Ue(e,t){let n=(d,m,A)=>{if(!G(d,m))throw new o(`Built swap ${A} does not match the accepted quote.`)};if(n(t.router,de,"FOBO router"),n(t.spender??t.router,ce,"FOBO spender"),t.oakFeeBps!==void 0||t.oakFee!==void 0&&r(t.oakFee)!==0n)throw new o("FOBO route trades carry no Oak fee.");let s=M(e.data,V);we(s),n(s.currencyIn,J(t.from),"input token"),n(s.currencyOut,J(t.to),"output token");let a=r(t.expiresAt);if(s.deadline>a+BigInt(pe))throw new o("FOBO swap deadline is more than 20 minutes past the accepted quote. Request a fresh quote.");if(s.permit&&(s.permit.amount!==s.amountIn||BigInt(s.permit.expiration)>s.permit.sigDeadline||s.permit.sigDeadline>a+BigInt(fe)))throw new o("FOBO permit must be for the exact swap input, expire no later than its signature deadline, and end within 30 minutes of the quote.");if(t.data!==void 0&&!G(t.data,e.data)&&!me(M(t.data,V).legs,s.legs))throw new o("Built swap FOBO pools or direction differ from the accepted quote.");return{from:t.from,to:t.to,wallet:t.wallet,amount:s.amountIn}}function q(e,t={}){if(!e||typeof e.quoteId!="string"||!e.quoteId.trim())throw new o("Quote must include a non-empty quoteId.");if(f(e.router),e.oakFeeBps!==void 0){let v=t.provider??e.provider,k=v==="kyberswap"?t.amountIn??e.amountIn:e.grossAmountOut,P=v==="kyberswap"?t.from??e.from:t.to??e.to;if(!["kyberswap","velora"].includes(v??"")||e.oakFeeBps!==O.bps||k===void 0||e.oakFee!==R(k)||!P||e.oakFeeToken?.toLowerCase()!==x(P).toLowerCase())throw new o("Oak fee must match the pinned rate, token and amount.")}else if(e.oakFee!==void 0&&r(e.oakFee)!==0n)throw new o("Oak fee requires the pinned rate and token; venue fees must never be counted as Oak income.");let n=r(e.amountOut),s=e.destAmountAfterFee??e.netAmountOut,a,d,m;if(s!==void 0){if(d=r(s),a=e.grossAmountOut!==void 0?r(e.grossAmountOut):n>=d?n:d,a<d)throw new o("Gross output cannot be less than net output.");m=e.venueFee!==void 0?r(e.venueFee):a-d}else if(e.grossAmountOut!==void 0){if(a=r(e.grossAmountOut),d=n,a<d)throw new o("Gross output cannot be less than net output.");m=e.venueFee!==void 0?r(e.venueFee):a-d}else e.venueFee!==void 0?(m=r(e.venueFee),d=n,a=d+m):(d=n,a=n,m=0n);if(d<=0n)throw new E("Quote output amount must be positive.");let A=t.slippageBps??e.slippageBps??te,g=e.minAmountOut!==void 0?r(e.minAmountOut):r(Le(d.toString(),A));if(g<=0n||g>a)throw new o("Quote minAmountOut must be positive and not exceed gross output.");if((t.provider??e.provider)==="velora"&&e.calldataMinAmountOut!==void 0){if(r(e.calldataMinAmountOut)!==ke(g.toString(),O.bps)||r(e.calldataMinAmountOut)>a)throw new o("Velora calldata minimum must cover the accepted net output, venue fee and router dust.")}else if(e.calldataMinAmountOut!==void 0||e.ponsCurveToken!==void 0){if((t.provider??e.provider)!=="pons"||!e.ponsCurveToken)throw new o("Curve minimum requires a Pons curve quote.");f(e.ponsCurveToken);let v=r(t.amountIn??e.amountIn??"0"),k=r(e.expectedSpend??"0"),P=r(e.expectedRefund??"0"),Ee=r(e.calldataMinAmountOut??"0");if(v<=0n||k<=0n||k+P!==v||Ee*k/v!==g)throw new o("Pons actual minimum and refund do not match the encoded minimum.")}let i=z(t.now),c=BigInt(i+Be),u=e.expiresAt!==void 0?r(e.expiresAt):c,l=(u>c?c:u).toString(),w=m.toString(),p=e.venueFeeBps??(a>0n&&m>0n?Number((m*10000n+a/2n)/a):0),S=t.provider??e.provider??(e.router.toLowerCase()===y.toLowerCase()?"velora":"kyberswap"),h=S==="fobo"?Me:S==="pons"&&e.feeDisclosure?e.feeDisclosure:Ie({provider:S,venueFee:w,venueFeeBps:p,oakFee:e.oakFee??"0",oakFeeBps:e.oakFeeBps}),b={...e,quoteId:e.quoteId,amountOut:d.toString(),minAmountOut:g.toString(),router:e.router,expiresAt:l,provider:S,grossAmountOut:a.toString(),destAmountAfterFee:d.toString(),netAmountOut:d.toString(),venueFee:w,venueFeeBps:p,oakFee:e.oakFee??"0",feeDisclosure:h,...t.from??e.from?{from:x(t.from??e.from)}:{},...t.to??e.to?{to:x(t.to??e.to)}:{},...t.amountIn??e.amountIn?{amountIn:t.amountIn??e.amountIn}:{},...t.wallet??e.wallet?{wallet:t.wallet??e.wallet}:{},slippageBps:A,chainId:t.chainId??e.chainId??F,spender:e.spender??e.router,...t.allowance??e.allowance?{allowance:t.allowance??e.allowance}:{}};if(BigInt(i)>=r(l))throw new L;if(t.cache===!1)return b;if(be(i),BigInt(i)>=r(l))throw new L;let T=I.get(b.quoteId);if(T){K(b,T,!0);let v=ve({...T,expiresAt:b.expiresAt});return I.set(v.quoteId,v),ee(v)}for(;I.size>=Ce;)I.delete(I.keys().next().value);let B=ve(b);return I.set(B.quoteId,B),ee(B)}async function ot(e,t,n={}){e={...e},f(e.from),f(e.to),f(e.wallet),e.from=x(e.from),e.to=x(e.to);let s=r(e.amountIn);if(s<=0n)throw new o("Swap amountIn must be greater than zero.");let a=e.slippageBps??te;if(!Number.isInteger(a)||a<0||a>=1e4)throw new o("Slippage must be an integer from 0 to 9999 bps.");if(!Array.isArray(t)||t.length===0)throw new E;let d={from:e.from,to:e.to,amountIn:s.toString(),slippageBps:a},m=await Promise.allSettled(t.map(async i=>{let c=await(i.quotePrices??i.quote).call(i,{...d},e.wallet);return{quote:q(c,{provider:i.name,from:e.from,to:e.to,amountIn:s.toString(),wallet:e.wallet,slippageBps:a,chainId:e.chainId??F,allowance:e.allowance,now:e.now,cache:!1}),provider:i}})),A,g=[];for(let i of m)i.status==="rejected"&&(A??=Y(i.reason)),i.status==="fulfilled"&&r(i.value.quote.expiresAt)>BigInt(z(e.now))&&g.push(i.value);if(g.length===0){let i=m.some(c=>c.status==="rejected"&&c.reason instanceof Error&&c.reason.message===N)&&m.every(c=>c.status==="rejected"&&(c.reason instanceof E||c.reason instanceof Error&&c.reason.message===N));throw A??new E(i?N:void 0)}g.sort((i,c)=>{let l=r(c.quote.amountOut)-r(i.quote.amountOut)||r(c.quote.minAmountOut)-r(i.quote.minAmountOut);return l>0n?1:l<0n?-1:0});for(let{quote:i,provider:c}of g)try{if(BigInt(z(e.now))>=r(i.expiresAt))continue;if(n.deferBuild||!c.prepareQuote)return q(i,{now:e.now});let u=await c.prepareQuote(i.quoteId,e.wallet);if(u.quoteId!==i.quoteId)throw new o("Prepared quote ID does not match the selected route.");if(K(u,i,!0),!u.data)throw new o("Selected route did not return swap calldata.");let l={...i,expiresAt:u.expiresAt,data:u.data,value:u.value,allowance:u.allowance??i.allowance};return xe(X({to:l.router,data:u.data,value:u.value??"0",chainId:l.chainId??F,description:"Selected swap route"}),l),q(l,{now:e.now})}catch(u){A??=Y(u);continue}throw A??new E}function rt(e,t={}){if(!e||typeof e.quoteId!="string"||!e.quoteId.trim())throw new o("Provide a valid quote to build a swap.");f(e.router);let n=I.get(e.quoteId),s=z(t.now);if(be(s),!n||BigInt(s)>=r(n.expiresAt))throw I.delete(e.quoteId),new L;if(e.oakFeeBps===void 0&&e.oakFee!==void 0&&r(e.oakFee)!==0n)throw new o("Oak fee requires the pinned rate and token; venue fees must never be counted as Oak income.");K(e,n),K({...n,...t},n);let a=n.from,d=n.to,m=n.amountIn,A=n.wallet;if(!a||!d||!A||m===void 0)throw new o("Accepted quote must include input, output, amount and wallet.");let g=n.chainId??F,i=n.spender??n.router,c=t.allowance??e.allowance??n?.allowance??"0";f(a),f(d),f(A),f(i);let u=r(m);if(u<=0n)throw new o("Swap amountIn must be greater than zero.");let l=r(n.minAmountOut);if(l<=0n)throw new o("Swap minAmountOut must be greater than zero.");let w=e.router.toLowerCase()===y.toLowerCase(),p=t.data??e.data??n?.data??(w?Ne({from:a,to:d,amountIn:u.toString(),amountOut:n.grossAmountOut??n.amountOut,minAmountOut:n.calldataMinAmountOut??l.toString(),wallet:A}):Qe({from:a,to:d,amountIn:u.toString(),minAmountOut:l.toString(),wallet:A}));Fe(p,n.calldataMinAmountOut??l.toString(),n.router.toLowerCase()===D.toLowerCase());let S=n.venueFee??"0",h=n.venueFeeBps??0,b=n.provider??(w?"velora":"kyberswap"),T=n.feeDisclosure??Ie({provider:b,venueFee:S,venueFeeBps:h,oakFee:n.oakFee??"0",oakFeeBps:n.oakFeeBps}),B=_(a),v=t.value??e.value??n?.value??(B?u.toString():"0"),k=X({to:e.router,data:p,value:v,chainId:g,description:`Swap ${u} base units of ${a} for at least ${l} base units of ${d} via ${b} (${e.router}). ${T}`});return xe(k,n),B||r(c)>=u?[k]:[ie(a,i,u.toString(),g),k]}export{Be as a,te as b,tt as c,De as d,ne as e,$ as f,E as g,L as h,Ce as i,ee as j,ve as k,K as l,z as m,_ as n,Le as o,_e as p,nt as q,ke as r,Pe as s,Ie as t,Qe as u,Ne as v,Ve as w,Fe as x,xe as y,Me as z,q as A,ot as B,rt as C};
@@ -1 +0,0 @@
1
- import{a as x}from"./G2LAO23N.js";import{c as O,d as z,e as g}from"./4IOHSX3Z.js";import{a as m}from"./66F5ZH34.js";import{c as u,f as B,g as p,i as D}from"./NWNYJ26T.js";import{b as H}from"./TI727O2H.js";import{a as i}from"./XSD5NL7J.js";import{decodeEventLog as W,encodeFunctionData as Q,getAddress as V,hashStruct as Y,isHex as J,parseAbi as Z,zeroAddress as k}from"viem";var ee="struct HookrSwapIntent { PoolKey key; bool zeroForOne; int128 amountSpecified; uint128 amountBound; uint160 sqrtPriceLimitX96; address recipient; address relayer; uint256 relayerFee; address engagement; uint256[] campaigns; uint256 nonce; uint256 deadline; }",I=Z(["struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }",ee,"function execute(HookrSwapIntent intent, address owner, bytes signature) returns (uint256 amountIn, uint256 amountOut)","function hashIntent(HookrSwapIntent intent) pure returns (bytes32)","function pullOf(HookrSwapIntent intent) view returns (address token, uint256 amount, bool feeFromInput)","function isNonceUsed(address owner, uint256 intentNonce) view returns (bool)","function router() view returns (address)","function registry() view returns (address)","function permit2() view returns (address)","event IntentExecuted(bytes32 indexed intentHash,address indexed owner,address indexed relayer,bytes32 poolId,uint256 amountIn,uint256 amountOut,uint256 relayerFee,bool feeFromInput)"]),te={PoolKey:[{name:"currency0",type:"address"},{name:"currency1",type:"address"},{name:"fee",type:"uint24"},{name:"tickSpacing",type:"int24"},{name:"hooks",type:"address"}],HookrSwapIntent:[{name:"key",type:"PoolKey"},{name:"zeroForOne",type:"bool"},{name:"amountSpecified",type:"int128"},{name:"amountBound",type:"uint128"},{name:"sqrtPriceLimitX96",type:"uint160"},{name:"recipient",type:"address"},{name:"relayer",type:"address"},{name:"relayerFee",type:"uint256"},{name:"engagement",type:"address"},{name:"campaigns",type:"uint256[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},ne=V("0x000000000022D473030F116dDEE9F6B43aC78BA3"),P={key:{type:"object",description:"Uniswap v4 PoolKey of the pool to swap in.",properties:{currency0:{...u,description:"Lower-sorted pool token address; the zero address is native ETH, which cannot be the relay input."},currency1:{...u,description:"Higher-sorted pool token address; must be greater than currency0."},fee:{type:"integer",description:x.pips()},tickSpacing:{type:"integer",description:"Pool tick spacing, a positive integer."},hooks:{...u,description:"Address of the pool hook contract."}},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},zeroForOne:{type:"boolean",description:"True swaps currency0 for currency1 (input is currency0); false swaps currency1 for currency0."},amountSpecified:{type:"string",pattern:"^-?[0-9]+$",description:'Signed amount in base units: negative = exact input of the input token, positive = exact output of the output token. Example: "-1000000" = 1 USDG in, if USDG (6 decimals) is the input.'},amountBound:{...m(),description:"Slippage bound in base units: minimum output token if amountSpecified is negative, maximum input token if positive. Must be nonzero; read that token's decimals."},sqrtPriceLimitX96:{...m(),description:"Swap price limit as a Q64.96 sqrt price, decimal string."},recipient:{...u,description:x.recipient("account that receives the swap output")},relayer:{...u,description:"Address of the relayer allowed to submit this intent (must be the submitting wallet), or the zero address for an open relay with no fee."},relayerFee:{...m(),description:"Fee paid to the relayer in base units of the fee token (the input token if charged on input, else the output token); read its decimals. Must be 0 for an open relay."},engagement:{...u,description:"Address of the Hookr engagement contract for campaign credit, or the zero address when campaigns is empty."},campaigns:{type:"array",items:m(),maxItems:8,description:"Up to eight campaign IDs (decimal strings) to credit; empty when engagement is the zero address."},nonce:{...m(),description:"Unique Permit2-style intent nonce of the trader, a decimal string; each nonce can execute once."},deadline:{...m(),description:"Intent expiry as a Unix seconds timestamp; the relay fails after this time."}},F={owner:{...u,description:x.recipient("trader who signed the intent and supplies the input funds")},signature:{type:"string",pattern:"^0x[0-9a-fA-F]+$",description:"The trader's Permit2 witness signature over the intent, as 0x-prefixed hex."},intent:{type:"object",description:"The complete trader-signed Hookr swap intent.",properties:P,required:Object.keys(P),additionalProperties:!1}};function N(n){return B(n,"Provide a complete trader-signed Hookr intent.")}function l(n,o=256,e=!1){if(typeof n!="string"||!/^-?\d+$/.test(n)||n.length>79)throw new i("Hookr intent amounts, nonce and deadline must be decimal base-unit strings.");let t=BigInt(n);if(e?t<=-(1n<<BigInt(o-1))||t>=1n<<BigInt(o-1):t<0n||t>=1n<<BigInt(o))throw new i("Hookr intent integer is outside its ABI range.");return t}function y(n){return D(n,"Provide valid Hookr intent addresses.")}function q(n,o){if(Object.keys(n).some(s=>!Object.hasOwn(F,s)))throw new i("Provide only owner, intent and the trader signature for Hookr relay.");let e=N(n.intent);if(Object.keys(e).some(s=>!Object.hasOwn(P,s)))throw new i("Hookr intent contains an undocumented field.");let t=N(e.key);if(Object.keys(t).some(s=>!["currency0","currency1","fee","tickSpacing","hooks"].includes(s))||typeof t.fee!="number"||!Number.isInteger(t.fee)||t.fee<0||t.fee>16777215||typeof t.tickSpacing!="number"||!Number.isInteger(t.tickSpacing)||t.tickSpacing<=0||t.tickSpacing>8388607||typeof e.zeroForOne!="boolean")throw new i("Provide a valid canonical v4 pool key and direction.");let a={currency0:y(t.currency0),currency1:y(t.currency1),fee:t.fee,tickSpacing:t.tickSpacing,hooks:y(t.hooks)};if(BigInt(a.currency0)>=BigInt(a.currency1))throw new i("Hookr pool currencies must sort strictly by address.");let r=y(n.owner);if(r===k||p(r,o))throw new i("Hookr relay requires another trader as owner; the relayer funds gas only.");if(!Array.isArray(e.campaigns)||e.campaigns.length>8)throw new i("Provide at most eight Hookr campaign IDs.");let c={key:a,zeroForOne:e.zeroForOne,amountSpecified:l(e.amountSpecified,128,!0),amountBound:l(e.amountBound,128),sqrtPriceLimitX96:l(e.sqrtPriceLimitX96,160),recipient:y(e.recipient),relayer:y(e.relayer),relayerFee:l(e.relayerFee),engagement:y(e.engagement),campaigns:e.campaigns.map(s=>l(s)),nonce:l(e.nonce),deadline:l(e.deadline)};if(c.amountSpecified===0n||c.amountBound===0n)throw new i("Hookr intent input/output amounts and bound must be nonzero.");if([k,g,O].some(s=>p(s,c.recipient)))throw new i("Hookr intent recipient is reserved.");if(c.relayer!==k&&!p(c.relayer,o)||c.relayer===k&&c.relayerFee!==0n)throw new i("Hookr intent names a different relayer or an open relay with a fee.");if(c.engagement===k!=(c.campaigns.length===0))throw new i("Hookr engagement and campaigns must be supplied together.");let f=c.zeroForOne?a.currency0:a.currency1;if(f===k)throw new i("Hookr Permit2 relay cannot pull native ETH input.");if(typeof n.signature!="string"||!J(n.signature,{strict:!0})||n.signature.length<4||n.signature.length%2!==0||n.signature.length>16386)throw new i("Provide the trader-signed Permit2 witness signature, never a private key.");let S=n.signature,w=Y({data:c,primaryType:"HookrSwapIntent",types:te});return{owner:r,intent:c,signature:S,input:f,intentHash:w}}function U(n,o){let{owner:e,intent:t,signature:a}=q(n,o);return{chainId:H,to:g,value:"0",data:Q({abi:I,functionName:"execute",args:[t,e,a]}),description:`Relay Hookr trader ${e} to recipient ${t.recipient}; relayer fee ${t.relayerFee} in pool quote currency. Relayer pays gas; owner supplies Permit2 funds.`}}function ue(n,o,e){let t=U(o,e);if(n.length!==1||n[0].chainId!==t.chainId||!p(n[0].to,t.to)||n[0].value!=="0"||!p(n[0].data,t.data))throw new i("Hookr relay calldata differs from the locally requested signed intent.")}function pe(n){return[{name:"hookr_relay",inputSchema:{type:"object",description:"Preview a trader-signed Permit2 swap for local human-confirmed submission. Relayer pays gas; the trader supplies input. No signature is created by this tool.",properties:F,required:Object.keys(F),additionalProperties:!1},execute:async(o,e)=>{let t=q(o,e),{owner:a,intent:r,signature:c,input:f,intentHash:S}=t,w=n.clientFor(H),s=await w.getBlock();if(typeof s.number!="bigint"||typeof s.timestamp!="bigint"||s.timestamp<=0n||s.timestamp>r.deadline)throw new i("Hookr signed intent expired or the chain timestamp is unavailable.");let h=(X,G=[])=>w.readContract({address:g,abi:I,functionName:X,args:G,blockNumber:s.number}),[j,d,_,K,$,L]=await Promise.all([h("hashIntent",[r]),h("pullOf",[r]),h("isNonceUsed",[a,r.nonce]),h("router"),h("registry"),h("permit2")]);if(j!==S||_!==!1||K!==O||$!==z||L!==ne)throw new i("Hookr intent hash, nonce or forwarder deployment is invalid. Ask the trader for a fresh signed intent.");if(!Array.isArray(d)||d.length!==3||typeof d[0]!="string"||!p(d[0],f)||typeof d[1]!="bigint"||typeof d[2]!="boolean")throw new i("Hookr Permit2 pull could not be verified.");let b=d[2],A=r.amountSpecified<0n?-r.amountSpecified:r.amountBound;if(d[1]!==A+(b?r.relayerFee:0n)||r.amountSpecified>0n&&!b&&r.relayerFee>r.amountSpecified)throw new i("Hookr Permit2 pull or output-side fee differs from the signed terms.");let C=await w.simulateContract({address:g,abi:I,functionName:"execute",args:[r,a,c],account:e,blockNumber:s.number}),[R,T]=C.result,E=r.amountSpecified<0n?r.amountBound:r.amountSpecified-(b?0n:r.relayerFee);if(R>A||T<E)throw new i("Hookr relay simulation did not satisfy the signed input/output bounds.");let v=[n.unsignedTx(U(o,e))],M=await n.preview(v,e);return{txs:v,preview:M,summary:v[0].description,intentHash:S,owner:a,recipient:r.recipient,relayer:e,inputToken:f,maximumPull:d[1].toString(),feeToken:b?f:r.zeroForOne?r.key.currency1:r.key.currency0,relayerFee:r.relayerFee.toString(),feeFromInput:b,minimumOutput:E.toString(),simulatedAmountIn:R.toString(),simulatedAmountOut:T.toString(),note:"Verify IntentExecuted in the receipt and your fee balance after submission."}}},{name:"hookr_relay_receipt",inputSchema:{type:"object",description:"Read the executed intent and fee from a mined Hookr relay receipt.",properties:{transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Hash of the mined relay transaction: 32 bytes, 0x followed by 64 hex digits."}},required:["transactionHash"],additionalProperties:!1},execute:async o=>{if(Object.keys(o).some(a=>a!=="transactionHash")||typeof o.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(o.transactionHash))throw new i("Provide a Hookr relay transactionHash.");let e=await n.clientFor(H).getTransactionReceipt({hash:o.transactionHash});if(e.status!=="success")throw new i("Hookr relay reverted. No fee is proven paid.");let t=e.logs.filter(a=>p(a.address,g)).flatMap(a=>{try{let r=W({abi:I,eventName:"IntentExecuted",topics:a.topics,data:a.data});return[{...r.args,amountIn:r.args.amountIn.toString(),amountOut:r.args.amountOut.toString(),relayerFee:r.args.relayerFee.toString()}]}catch{return[]}});if(!t.length)throw new i("Receipt contains no verified Hookr IntentExecuted event.");return{chainId:H,transactionHash:e.transactionHash,blockNumber:e.blockNumber.toString(),intents:t,note:"Event evidence at this mined block; check balances and finality."}}}]}export{I as a,q as b,U as c,ue as d,pe as e};
@@ -1 +0,0 @@
1
- import{a as x}from"./XSD5NL7J.js";import{getAddress as F,parseAbi as k}from"viem";var f={chainId:4663,usdg:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",v4:{poolManager:"0x8366a39CC670B4001A1121B8F6A443A643e40951",swapper:"0x7Cd4E04E433E69e588728c86A3832753B5F846d4",quoter:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b"},v3:{router:"0xCaf681a66D020601342297493863E78C959E5cb2",quoter:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA"},tokens:[{symbol:"AAPL",token:"0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",pools:[{v:3,fee:500,pool:"0xAae0d815EE56e4092a5E5C2911E676Fea50B2d6D"},{v:4,fee:3e3,tickSpacing:60,id:"0xc748f4671a867db48b552f6b7650bf3255e05f80f00e3f7aad1b17ccb7898fdb"},{v:3,fee:3e3,pool:"0x783C9bbB765047CFdD2b84b92b2Ca9F11D34b7Ed"}]},{symbol:"AMD",token:"0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",pools:[{v:3,fee:3e3,pool:"0x48D284A2A4d3DC1b3Da08231Fe44317e7e7Aa51f"}]},{symbol:"AMZN",token:"0x12f190a9F9d7D37a250758b26824B97CE941bF54",pools:[{v:3,fee:3e3,pool:"0x8AC92DA74AB5F3b1d024Dc1943Ad7e15Dc4179Ef"},{v:4,fee:2400,tickSpacing:24,id:"0xefc94885c96b02696b9b45de43eeeb8ac53c0199cab42b4daae4911b96fb8825"}]},{symbol:"ASML",token:"0x47F93d52cBeC7C6D2CfC080e154002370a60dAEA",pools:[{v:3,fee:1e4,pool:"0xedb22516B14Eb2d1C86927Db373B0E8bF70F5cD1"}]},{symbol:"BABA",token:"0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x1791fc651cc794a282e5dbcb56d0b2b38eff8754b677c8876e86901521ecc439"},{v:3,fee:3e3,pool:"0xa57ab582b310dd6f9e934EA1EEEa152741545E6A"}]},{symbol:"COIN",token:"0x6330D8C3178a418788dF01a47479c0ce7CCF450b",pools:[{v:4,fee:2500,tickSpacing:25,id:"0xe2e1a0e32205e854525e0fb1d3667a53bd3b4919f032b9bcd2a038b6b6dac314"},{v:4,fee:1e4,tickSpacing:200,id:"0x007a13fa152f6dc383cad20a8eaab4e1e2538b606936eae2a424f8aa47d6db31"}]},{symbol:"CRCL",token:"0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",pools:[{v:3,fee:3e3,pool:"0x654E4143e82a5824445Ade0824351C2A9ACD95a8"},{v:4,fee:3e3,tickSpacing:30,id:"0x628c98ab436ee34a6a7decd606242890582591bdf7c9a35d90e0d08021c31ea0"},{v:4,fee:1500,tickSpacing:15,id:"0x5177eac8c2176468bbf15e44081e151d35c2e7d068e96d3db94f496a4dc944b2"}]},{symbol:"CRWV",token:"0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x237014478f7ef98afbe7412ac35b6a3f96b8fb111de48b7c4dbf49dba4bd9c4b"}]},{symbol:"DELL",token:"0x941AE714EC6D8130c7B75d67160Ca08f1e7d11Dd",pools:[{v:3,fee:1e4,pool:"0xc30c89cB7815A1488b7998D15eEC73961707Fc5a"}]},{symbol:"GME",token:"0x1b0E319c6A659F002271B69dB8A7df2F911c153E",pools:[{v:3,fee:500,pool:"0xE2b46c905E12Ab8E2f864e4821a4325884C1B126"}]},{symbol:"GOOGL",token:"0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",pools:[{v:3,fee:500,pool:"0x34D0dC122CF9A8Eb296fC5e0D3A233625D7d19b7"},{v:4,fee:300,tickSpacing:3,id:"0x43fe16b75cabbf38f5b185d16142b02d1d9200d8f1ba17cb6cf899f562c6197f"},{v:4,fee:3e3,tickSpacing:60,id:"0xd4ecb79fdc521d7725d22b33ed43cb4e47aa96bfad76aa29577e3151f723ac5e"}]},{symbol:"INTC",token:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",pools:[{v:3,fee:3e3,pool:"0x2e5a92f5013a64661A49312111be2e8aBd33F56a"}]},{symbol:"META",token:"0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",pools:[{v:4,fee:310,tickSpacing:3,id:"0xc58bb68060bcb7b3ea0f6d4a4afef1e57f628722e808db12afb6d1733552872f"},{v:3,fee:3e3,pool:"0x107a7Cb40d8665360ba10E59471Af06150A50922"},{v:4,fee:3e3,tickSpacing:60,id:"0x5875d407a42965b0e768c8925cea290e06fa50603ef34fc99eb92a1050e6ae36"}]},{symbol:"MSFT",token:"0xe93237C50D904957Cf27E7B1133b510C669c2e74",pools:[{v:3,fee:3e3,pool:"0xeb60bCD1D920ad6E102690CCFC6fB488899E1510"},{v:4,fee:3e3,tickSpacing:60,id:"0x9194a557b6a6bb2236b49ea7e2bbccec5d3eeb705aef00903be4b3de1d949579"}]},{symbol:"MSTR",token:"0xec262a75e413fAfD0dF80480274532C79D42da09",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x319bac87e616a89e241c10aeb8afd4892a852cdd8b373cd9765ecddc40b87cfe"},{v:4,fee:2400,tickSpacing:24,id:"0xc105b8300ff65d750a0e4e63c7a879e20504069b770713464a5315e797735326"}]},{symbol:"MU",token:"0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD",pools:[{v:3,fee:3e3,pool:"0xd057B1Bc54917855BBee58eAd58647f47caB35E5"}]},{symbol:"NBIS",token:"0x9D9c6684F596F66a64C030B93A886D51Fd4D7931",pools:[{v:4,fee:9900,tickSpacing:99,id:"0x7c2f9ce1214ba9baf56d1b6a1fc640c1b63e9a711172c0c7d10e5a9c4a3d4f0c"}]},{symbol:"NVDA",token:"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",pools:[{v:3,fee:500,pool:"0xd4EB21209C4D6093f80B5b84f5C45cc093EA14a3"},{v:4,fee:100,tickSpacing:1,id:"0x6444a8e0b267406a15db74ca00c4a24bdfa81ed3180f5b6d0851f8ed6f4f29c5"},{v:4,fee:3e3,tickSpacing:60,id:"0x3bb34a44f1b2b5f32c034c38a53065a521a47b199700fa9bd19d60985ff24bf1"}]},{symbol:"ORCL",token:"0xb0992820E760d836549ba69BC7598b4af75dEE03",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0xc2ce4784e1e72cf0221b51b30c8aaadf6c0b12863cf03ab3687854fb7b1d850a"}]},{symbol:"PLTR",token:"0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",pools:[{v:4,fee:1500,tickSpacing:15,id:"0xc59eaeda6d1a6f031bc7e1d039772f2d675e7b4de2c8668610f4471bd60b3802"},{v:3,fee:3e3,pool:"0x851680416A4f4E1c463d45171d61ACDdBc8554c0"}]},{symbol:"QQQ",token:"0xD5f3879160bc7c32ebb4dC785F8a4F505888de68",pools:[{v:3,fee:500,pool:"0xD60A5d14dB690B7Afad71F76B108071D7175597d"}]},{symbol:"SGOV",token:"0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5",pools:[{v:3,fee:500,pool:"0x6Ba50150B17Ffd0972915Aaf04fFd5E8f4Fa49b4"},{v:3,fee:3e3,pool:"0xfAb520051f96F4D2a32c22B6a3dD7fFfdf231bFe"}]},{symbol:"SLV",token:"0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f",pools:[{v:3,fee:3e3,pool:"0x8cB787e6c315D464775289BaD00FDD67d53Ecb3D"},{v:3,fee:1e4,pool:"0x0Fa7BC480885DCf58Ad2ef63eC7289cF2481D51c"}]},{symbol:"SNDK",token:"0xB90A19fF0Af67f7779afF50A882A9CfF42446400",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0x2707cb88a6a40fa0f948f58958051ba097d6f6a3cf7f87929bd68ccc5becea24"}]},{symbol:"SPCX",token:"0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",pools:[{v:3,fee:500,pool:"0xc61284332117c3FB23A2A56cceFFD07F7aF60029"},{v:3,fee:3e3,pool:"0xEb07d9587eFD1778dFb9c385Ec43EF6d5F9fE401"}]},{symbol:"SPY",token:"0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",pools:[{v:4,fee:100,tickSpacing:1,id:"0xe1ae6a4c6ccc9f037389a8d50a4f577bde1a9fe01d85d88ecbbd39955ce53288"},{v:3,fee:500,pool:"0xa7Bb1AC63BBaB0C44316E6c8C455213441689167"},{v:4,fee:500,tickSpacing:5,id:"0xe5923c8a8be481ec89a2ca784a2bbfa4235de6d88f92260fd66b660c4babf907"}]},{symbol:"TSLA",token:"0x322F0929c4625eD5bAd873c95208D54E1c003b2d",pools:[{v:3,fee:3e3,pool:"0xf4ACdAEEB7022862A763C9B1B885e11191c889E3"},{v:4,fee:3e3,tickSpacing:60,id:"0x8517f8071ae5b831b738052f12125e8e3d6c158b78728aa44ce3b25e5104d32e"}]},{symbol:"TSM",token:"0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",pools:[{v:4,fee:7500,tickSpacing:75,id:"0x0ba5d53d2f6255f334b7c8ead4f56b6aef5af3402c5e4d11180afd38c6b85fb1"},{v:3,fee:1e4,pool:"0x07e8Ea83D4C1340774c8965125e26e12bf943bf1"}]},{symbol:"USAR",token:"0xd917B029C761D264c6A312BBbcDA868658eF86a6",pools:[{v:3,fee:3e3,pool:"0x04391780F519B7d3ba59c9590459D76e23d225C4"}]},{symbol:"USO",token:"0xa30FA36Db767ad9eD3f7a60fC79526fB4d56D344",pools:[{v:4,fee:1200,tickSpacing:15,id:"0x1f2ad5a274a776d8e1408292bde1d92d8fa7b6444acf14ad60b9c3e4e5b66420"},{v:3,fee:3e3,pool:"0x02175608F1b5E6b5ed221cCFdC7Be197D111D915"}]}],notOffered:{CLSK:"thin",EWY:"thin",IONQ:"thin",RGTI:"thin",RKLB:"thin"},sourceCommit:"02230282d8888e00794207ed271ee01b4ce30309"};var E=k(["function slot0() view returns (uint160,int24,uint16,uint16,uint16,uint8,bool)","function liquidity() view returns (uint128)","function getSlot0(bytes32) view returns (uint160,int24,uint24,uint24)","function getLiquidity(bytes32) view returns (uint128)"]),s=1n<<96n,A=s*s,v=10000n*10n**6n,h="current price in the Uniswap USDG pool; on-chain trading can differ from the stock market";async function u(d,o,b){if(d.chainId!==f.chainId)return;let c=f.tokens.find(e=>e.token.toLowerCase()===d.address.toLowerCase());if(!c)return;let t=BigInt(d.address)<BigInt(f.usdg),n=(await Promise.all(c.pools.map(async e=>{let a=e.v===3,D=F(a?e.pool:f.v4.stateView),[r,l]=await Promise.all([o.readContract({address:D,abi:E,functionName:a?"slot0":"getSlot0",args:a?[]:[e.id],blockNumber:b}),o.readContract({address:D,abi:E,functionName:a?"liquidity":"getLiquidity",args:a?[]:[e.id],blockNumber:b})]),i=r[0];if(i<=0n||l<=0n)return;let C=t?l*i/s:l*s/i;return C>=v?{sqrt:i,usdgDepth:C}:void 0}))).reduce((e,a)=>a&&(!e||a.usdgDepth>e.usdgDepth)?a:e,void 0);if(!n)throw new x("Pinned stock pools have insufficient in-range USDG depth for a display estimate.");return n}async function L(d,o,b){let c=await u(d,o,b);if(!c)return;let t=BigInt(d.address)<BigInt(f.usdg),p=t?c.sqrt**2n:A,n=t?A:c.sqrt**2n;return p*10n**BigInt(d.decimals)*10n**18n/(n*10n**6n)}export{f as a,v as b,h as c,u as d,L as e};
@@ -1 +0,0 @@
1
- function d(r,t){return r==="hoodlock_airdrop_claim"&&!Object.hasOwn(t,"id")}var h=new Map([]),_="find_tool",l="run_tool",w=["upoch_agent","upoch_explorer"],i=["oak_setup","oak_identity_unlink","send","hoodlock_feature_buy","hoodlock_feature_claim","hoodlock_referral_register","heyresearch_token_facts","heyresearch_feed","heyresearch_follow","heyresearch_unfollow","heyresearch_position_context"],p={oak:["account","balances","find_token","price","quote","swap","positions","send","oak_setup","oak_identity_unlink"],kyberswap:[],velora:[],steakhouse:["steakhouse_deposit","steakhouse_withdraw"],spark:["spark_deposit","spark_withdraw"],layerbank:["layerbank_deposit","layerbank_withdraw"],borro:["borro_deposit","borro_withdraw"],chop:["chop_wrap","chop_unwrap"],factor:["factor_sign_up","factor_open_jobs"],raeto:["raeto_status","raeto_join","raeto_ask"],gloam:["gloam_shield","gloam_pay","gloam_claim","gloam_cash_out"],pendle:["pendle_buy","pendle_sell","pendle_redeem"],earn:["earn_options"],netnet:["netnet_deposit","netnet_withdraw"],longbow:["longbow_list","longbow_deposit","longbow_withdraw"],grove:["grove_deposit","grove_withdraw"],beefy:["beefy_list","beefy_deposit","beefy_withdraw"],pons:["pons_browse","pons_buy","pons_sell","pons_launch"],orbio:["orbio_credit_status","orbio_buy_credit"],hoodlock:["hoodlock_list_locks","hoodlock_lock","hoodlock_withdraw"],merkl:["merkl_rewards","merkl_claim"],relay:["relay_bridge_in","relay_bridge_out","relay_status"],lighter:["lighter_funding"],wormhole:[],upoch:[],erc8004:["erc8004_identity"],hoodag:["hoodag_resolve","hoodag_register"],heyresearch:["heyresearch_research_project","heyresearch_token_facts","heyresearch_feed","heyresearch_follow","heyresearch_position_context"],priors:["priors_status","priors_lend","priors_withdraw","priors_borrow","priors_repay"],morpho:["morpho_status","morpho_supply","morpho_withdraw","morpho_supply_collateral","morpho_withdraw_collateral","morpho_borrow","morpho_repay"],uniswap:["uniswap_list_positions","uniswap_add","uniswap_remove","uniswap_collect"],hookr:["hookr_orders","hookr_create","hookr_cancel"],meridian:["meridian_browse","meridian_positions","meridian_sell","meridian_redeem"],tickerspring:["tickerspring_account","tickerspring_create","tickerspring_cancel","tickerspring_claim"],clanker:["clanker_browse","clanker_launch"],poolstrade:["poolstrade_status","poolstrade_buy","poolstrade_sell","poolstrade_launch"]};function u(r,t){let a=new Set(r),s=new Set;for(let[e,n]of Object.entries(p))for(let o of n){if(s.has(o))throw new Error(`Visible tool ${o} is listed twice.`);if(e!=="oak"&&!o.startsWith(`${e}_`))throw new Error(`Visible tool ${o} is filed under ${e}.`);if(i.includes(o)||a.has(o))s.add(o);else if(t==="mainnet")throw new Error(`Visible tool ${o} is not registered.`)}for(let e of[_,l,...i,"oak_playbook"])if(a.has(e))throw new Error(`Tool name ${e} is reserved for the add-on.`);return s}export{d as a,h as b,_ as c,l as d,w as e,i as f,p as g,u as h};
@@ -1 +0,0 @@
1
- import{c as t}from"./LCH6F5HT.js";import{c as o}from"./N624NR7Y.js";function s(e,n,a){return t(e,n,a,o)}export{s as a};
@@ -1 +0,0 @@
1
- import{B as Pe,t as re,y as qe}from"./FRT6AC6M.js";import{a as Re}from"./UHIJMDD2.js";import{a as y}from"./WWNAGOCD.js";import{a as k,b as ie,d as He,e as R,f as p,h as C,i as q,j as f,k as $,l as H,m as A,n as se,o as w,p as c,q as F,r as j,s as Se,t as Be}from"./XRDLMTBJ.js";import{b as K,f as ve,g as V,h as Te,i as Le}from"./MQK6OP7S.js";import{a as z}from"./G2LAO23N.js";import{m as oe}from"./7OOCAZBE.js";import{a as xe}from"./Z7FGEWO2.js";import{t as be}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as Qe,encodeFunctionData as We,erc20Abi as Ge,formatUnits as Ae,getAddress as ce,parseAbi as Q,zeroAddress as b,zeroHash as ae}from"viem";var Je="hookr_launch",g=ce(K.launcherV1),X=ce(K.rulesV1),Ye=[{type:"tuple",components:[{name:"flags",type:"uint16"},{name:"minScore",type:"uint32"},{name:"tierScore",type:"uint32"},{name:"tierPips",type:"uint24"},{name:"reviewers",type:"bytes32"}]}],_=(a,n=Object.keys(a))=>({type:"object",properties:a,required:n,additionalProperties:!1}),Fe={type:"string",pattern:"^0x[0-9a-fA-F]{40}$"},ue=_({token:{description:'Token to launch: kind "new" creates a fresh token; kind "existing" is reserved and currently refused.',oneOf:[_({kind:{const:"new",type:"string",description:z.enumValues({new:"create and launch a fresh token"})},name:{type:"string",minLength:1,maxLength:48,description:"Public token name, 1 to 48 UTF-8 bytes, no control characters."},symbol:{type:"string",minLength:1,maxLength:12,description:"Public token ticker symbol, 1 to 12 UTF-8 bytes, no control characters."},supply:{...k,description:'Total supply of the new token in base units (18 decimals: "1000000000000000000" = 1 token); positive, below 2^108.'},salt:{...ie,description:"Bytes32 hex salt (0x plus 64 hex digits) that fixes the new token address."}}),_({kind:{const:"existing",type:"string",description:z.enumValues({existing:"reserved for an already deployed token; launching it is not supported yet"})},address:{...Fe,description:z.address("existing token contract")}})]},quote:{...Fe,description:"Qualified ETH (zero address) or pinned USDG quote. Other quote funding routes await qualification."},sqrtPriceX96:{...k,description:"Integer sqrt(currency1/currency0) times 2^96 for the sorted PoolKey."},tickLower:{type:"integer",minimum:-887272,maximum:887272,description:"Lower tick of the launch range, a signed integer and a multiple of the tick spacing 200; below tickUpper."},tickUpper:{type:"integer",minimum:-887272,maximum:887272,description:"Upper tick of the launch range, a signed integer and a multiple of the tick spacing 200; above tickLower."},liquidity:{...k,description:"Initial liquidity in v4 liquidity base units (not a token amount), positive and below 2^127; its rounded-up token debts must fit amount0Max and amount1Max."},amount0Max:{...k,description:`Maximum of the pool's currency0 to fund, in base units of that token (18 decimals: "1000000000000000000" = 1 token).`},amount1Max:{...k,description:`Maximum of the pool's currency1 to fund, in base units of that token (18 decimals: "1000000000000000000" = 1 token).`},agentGate:{description:"Who may buy: all zeros means identity-only; nonzero minScore or tier values add a reputation gate checked by the reviewer set.",..._({minScore:{...k,description:"Minimum agent reputation score required to buy; 0 means no minimum."},tierScore:{...k,description:"Agent score at or above which the reduced tier fee applies; 0 only when tierPips is 0."},tierPips:{...k,description:"Reduced pool fee in pips for agents at tierScore (3000 = 0.3%); at most 50000, and 0 only when tierScore is 0."},reviewerSetId:{...ie,description:"Bytes32 id of a registered reviewer set that scores agents; all zeros unless the gate uses a score."}})},lpRewardsBps:{...k,description:"LP Rewards rate in basis points (50 = 0.5%); at most 1000. This launch profile has zero burn."},arbRecapture:{type:"boolean",description:"True turns on Hookr arb recapture, with recaptured value to LPs; refused while the recapture lane is unavailable. False leaves it off."},deadline:{...k,description:"Latest time this launch may execute, as Unix seconds; must be within the next 300 seconds of chain time."}});function Ze(a){let n=R(a,Object.keys(ue.properties),ue.required),r=A(n.token);if(r.kind==="existing")throw R(r,["kind","address"],["kind","address"]),q(r.address),new o("Existing-token Hookr launches await a qualified funding route. Use token.kind new.");if(R(r,["kind","name","symbol","supply","salt"],["kind","name","symbol","supply","salt"]),r.kind!=="new")throw new o("Choose token.kind new; existing tokens are not supported yet.");let e=(P,O)=>{if(typeof P!="string"||!P.trim()||new TextEncoder().encode(P).length>O||[...P].some(W=>W.codePointAt(0)<32)||/[\u007f-\u009f\u2028-\u202e\u2066-\u2069\ud800-\udfff]/u.test(P))throw new o(`Use nonempty public token text within ${O} UTF-8 bytes without control characters.`);return P},i=p(r.supply,108);if(!i)throw new o("Hookr new-token supply must be positive and at most 2^108-1 base units.");let t=q(n.quote);if(![b,ce(be.mainnet.usdg)].includes(t))throw new o("Use native ETH (zero address) or the pinned USDG quote; other quote funding routes await qualification.");let l=n.tickLower,u=n.tickUpper;if(typeof l!="number"||typeof u!="number")throw new o("Provide integer aligned Hookr ticks.");qe(l,u,y.tickSpacing);let s=p(n.sqrtPriceX96,160);if(s<=oe(l)||s>=oe(u))throw new o("Hookr opening price must be strictly inside the aligned tick range.");let d=p(n.liquidity,127);if(!d)throw new o("Hookr liquidity must be positive and at most int128 max.");let m=p(n.amount0Max,128),T=p(n.amount1Max,128),x=Pe({liquidity:d,tickLower:l,tickUpper:u,sqrtPriceX96:s,roundUp:!0});if(x.amount0>=1n<<127n||x.amount1>=1n<<127n||!x.amount0||!x.amount1||x.amount0>m||x.amount1>T)throw new o("Hookr exact rounded-up debts must be positive and fit both approved funding caps. Reduce liquidity or increase the caps.");let h=R(n.agentGate,["minScore","tierScore","tierPips","reviewerSetId"],["minScore","tierScore","tierPips","reviewerSetId"]),I=Number(p(h.minScore,32)),S=Number(p(h.tierScore,32)),B=Number(p(h.tierPips,24)),M=C(h.reviewerSetId);if(B>5e4||S===0!=(B===0)||(I!==0||S!==0)!=(M!==ae))throw new o("Use tierPips at most 50000, paired nonzero tier score/pips, and a registered reviewer set only for scored gates. Identity-only uses all zero values.");let N=Number(p(n.lpRewardsBps,16));if(N>1e3)throw new o("Hookr LP Rewards plus burn must not exceed 1000 bps; this profile has zero burn.");if(typeof n.arbRecapture!="boolean")throw new o("Choose arbRecapture true or false explicitly.");return{token:{existing:b,name:e(r.name,48),symbol:e(r.symbol,12),supply:i,salt:C(r.salt)},quote:t,sqrtPriceX96:s,tickLower:l,tickUpper:u,liquidity:d,amount0Max:m,amount1Max:T,debts:x,gateTerms:{flags:1,minScore:I,tierScore:S,tierPips:B,reviewers:M},lpRewardsBps:N,arbRecapture:n.arbRecapture,deadline:p(n.deadline,64)}}async function et(a,n,r,e){return q(await c(a,g,w("launcherV1"),"predictToken",[n,r],e))}async function tt(a,n,r,e,i){let t=r.gate;if(!t.walletAgent||!(e?t.healthyForScores:t.healthyIdentityOnly))throw new o("Hookr needs a healthy on-chain agent identity. Own an ERC-8004 identity or link its current agent wallet on the Hookr gate; Oak setup linking alone is insufficient.");let l=(d,m)=>c(a,t.identity,Q(["function balanceOf(address) view returns (uint256)","function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),d,m,i),u=f(await l("balanceOf",[n])),s=!1;if(t.link.linked){let d=BigInt(t.link.agentId);s=q(await l("getAgentWallet",[d]))===n,!s&&u>0n&&(s=q(await l("ownerOf",[d]))===n)}if(!u&&!s||e&&!s)throw new o("Hookr on-chain identity ownership or gate link is missing or stale. Link a current ERC-8004 agent ID on the Hookr gate before launching; scored gates require that link even for an NFT owner.")}async function nt(a,n,r){let e=Ze(n);if(a.network==="testnet")throw new o("Hookr launch requires Robinhood Chain 4663.");let i=a.clientFor(4663),t=await Te(i);if(e.deadline<=t.timestamp||e.deadline>t.timestamp+y.deadlineSeconds)throw new o("Set a fresh Hookr deadline within the next 300 seconds of chain time.");let l=e.gateTerms.reviewers!==ae,u=await Re(i,r,t.number,l?[e.gateTerms.reviewers]:[]);if(!u.rootOpenForWallet||u.newMarketsPaused||!u.launcherAdmitted)throw new o("Hookr new markets or the reviewed Launcher are closed. Retry only after registry admission is restored.");await tt(i,r,u,l,t.number);let s=await et(i,r,e.token,t.number);if(s===b||s===e.quote)throw new o("Hookr predicted token collides with its quote. Choose a fresh salt.");let d={currency0:BigInt(s)<BigInt(e.quote)?s:e.quote,currency1:BigInt(s)<BigInt(e.quote)?e.quote:s,fee:8388608,tickSpacing:y.tickSpacing,hooks:F},m=re(d),T=d.currency0===s,x=T?e.amount0Max:e.amount1Max,h=T?e.amount1Max:e.amount0Max,I=T?e.debts.amount0:e.debts.amount1,S=T?e.debts.amount1:e.debts.amount0;if(x>e.token.supply)throw new o("Hookr new-token deposit cap exceeds its fixed supply.");let[B,M,N,P,O,W,Ie,Ue]=await Promise.all([i.getCode({address:s,blockNumber:t.number}),i.getTransactionCount({address:s,blockNumber:t.number}),c(i,g,w("launcherV1"),"memberKey",[s,e.quote,y.tickSpacing,F],t.number),c(i,F,w("rootV1"),"knownPool",[m],t.number),c(i,g,w("launcherV1"),"SKIP_TAKEN",[],t.number),c(i,j,w("registry"),"isQuote",[e.quote],t.number),c(i,j,w("registry"),"quoteIsBraked",[e.quote],t.number),c(i,X,w("rulesV1"),"minProtocolShareBps",[],t.number)]),[Ce,$e]=H(N,2);if(e.token.salt===C(O))throw new o("SKIP_TAKEN is unsupported. Choose an ordinary new-token salt.");if(B&&B!=="0x"||M!==0||$(P)||!$($e)||re(A(Ce))!==m)throw new o("Hookr token address or pool is already taken or its predicted key differs. Choose a fresh salt and rebuild.");if(!$(W)||$(H(Ie,2)[0]))throw new o("The Hookr quote is not currently qualified or is braked. Choose an admitted quote.");let de=A(u.gate.admission),Me=A(de.caps),pe=p(Me.maxLpFeePips,24),Ne=BigInt(u.coreAdmission.caps.maxLpFeePips),G=BigInt(y.baseLpFeePips)+pe;if(BigInt(e.gateTerms.tierPips)>pe||G>Ne||G>600000n)throw new o("Hookr gate tier or total LP fee exceeds the live admission cap. Lower the tier or wait for compatible admission.");let le=q(await c(i,X,w("rulesV1"),"protocolRecipient",[],t.number));await V(i,t.number,[le]);let[Oe,Ee,De]=H(await c(i,le,Q(["function feeTerms(address,bool,bytes32) view returns (uint16,uint16,uint16)"]),"feeTerms",[b,e.arbRecapture,m],t.number),3),me=f(Oe,16),J=f(De,16);if(f(Ee,16)!==0n||J>10000n)throw new o("Hookr treasury minimum or integrator terms exceed the reviewed profile.");let he=f(Ue,16),E=me>he?me:he;if(E<2000n||E>5000n)throw new o("Hookr protocol share is outside the reviewed 2000\u20135000 bps profile.");let Y=BigInt(e.lpRewardsBps)*100n+(!e.arbRecapture&&e.lpRewardsBps===0?J:0n);if(Y>BigInt(u.coreAdmission.caps.maxQuoteTakePips))throw new o("Hookr LP Rewards and minimum quote charge exceed the live quote-take cap. Lower LP Rewards.");let Z={on:e.arbRecapture,traderBps:0,lpBps:e.arbRecapture?1e4:0,period:0,maxPrizeBps:0,potReleaseBps:0,minBuyQuote:0n,releaseBlocks:0},ke=null;if(e.arbRecapture){let[D,ge]=await Promise.all([c(i,X,Q(["function recaptureDefaults() view returns ((bool on,uint16 traderBps,uint16 lpBps,uint32 period,uint16 maxPrizeBps,uint16 potReleaseBps,uint128 minBuyQuote,uint32 releaseBlocks) rc,uint16 potBps)"]),"recaptureDefaults",[],t.number),c(i,j,w("registry"),"activeLaneOf",[F],t.number)]);Z.releaseBlocks=Number(f(A(H(D,2)[0]).releaseBlocks,32));let[Ve,je,Xe,_e]=H(ge,4),ne=q(Ve);if(await V(i,t.number,[ne]),ne===b||C(je)!==ve(ne).codeHash||f(Xe,32)===0n||f(_e,16)>10000n||!Z.releaseBlocks)throw new o("Hookr recapture lane is unavailable. Use arbRecapture false until its executor and gas floor are reviewed.");ke=se(ge)}let fe={quote:e.quote,tickSpacing:y.tickSpacing,sqrtPriceX96:e.sqrtPriceX96,tickLower:e.tickLower,tickUpper:e.tickUpper,liquidity:e.liquidity,amount0Max:e.amount0Max,amount1Max:e.amount1Max,config:{subject:s,quote:e.quote,rules:X,advisory:Be,liquidityOwner:g,baseLpFeePips:y.baseLpFeePips,caps:{maxLpFeePips:Number(G),maxQuoteTakePips:Number(Y),maxSubjectTakeBps:0},rulesGasLimit:Number(u.coreAdmission.gasLimit),advisoryGasLimit:Number(p(de.gasLimit,32)),advisoryPhases:1,advisoryFailOpen:!1,policyId:ae},rules:{guardEndBlock:0,maxFeePips:y.baseLpFeePips,snipeTaxPips:0,snipeFloorPips:0,snipeDecaySeconds:0,dynamicFeeSens:0,burnBps:0,lpBps:e.lpRewardsBps,potBps:0,royaltyBps:0,protocolShareBps:Number(E),potEveryNBuys:0,maxBuyQuoteAmount:0n,potMinBuyQuote:0n,royaltyTo:b,integrator:b},recapture:Z},L=BigInt(u.launchFee.amount);if(L>10000000000000000n)throw new o("Hookr launch fee exceeds the reviewed 0.01 ETH maximum.");let v=b;if(L&&(await V(i,t.number,[u.launchFee.treasury]),v=q(await c(i,u.launchFee.treasury,Q(["function target() view returns (address)"]),"target",[],t.number)),v===b||v===g||v===r||v===Se))throw new o("Hookr launch fee recipient is outside the reviewed payment profile.");let ee=L+(e.quote===b?h:0n),te=[],U=[];if(e.quote!==b){let D=f(await c(i,e.quote,Ge,"allowance",[r,g],t.number));D!==0n&&D!==h&&U.push(a.approval(e.quote,g,"0",4663)),U.push(a.approval(e.quote,g,h.toString(),4663)),te.push({token:e.quote,amount:h})}ee&&te.push({token:xe,amount:ee,to:g});let we=`Launch public, permanent token ${JSON.stringify(e.token.name)} (${JSON.stringify(e.token.symbol)}), fixed supply ${Ae(e.token.supply,18)} (18 decimals). Create one agents-only pool (identity check on every buy). Price currency1/currency0 = ${e.sqrtPriceX96*e.sqrtPriceX96}/${1n<<192n}; sqrtPriceX96 ${e.sqrtPriceX96}, ticks ${e.tickLower} to ${e.tickUpper}, spacing ${y.tickSpacing}. Deposit at most ${e.amount0Max} currency0 and ${e.amount1Max} currency1 base units; exact launch debts ${e.debts.amount0} and ${e.debts.amount1}. Currency0 ${d.currency0}; currency1 ${d.currency1}. Launch fee ${L} wei to ${v} (${Ae(L,18)} ETH). Unused quote funding (${h-S} base units) and retained token supply (${e.token.supply-I} base units) return to ${r} in this transaction. Family owner ${r}; token ${s}; pool ${m}. LP base fee 3000 pips; gate flags 1, scores ${e.gateTerms.minScore}/${e.gateTerms.tierScore}, tier ${e.gateTerms.tierPips} pips; LP Rewards ${e.lpRewardsBps} bps; burn 0; quote-take cap ${Y} pips (includes Hookr minimum); protocol share ${E} bps. Arb recapture ${e.arbRecapture}; deadline ${e.deadline}. No lock.`;U.push(a.unsignedTx({to:g,data:We({abi:w("launcherV1"),functionName:"launchAdvised",args:[e.token,F,[fe],[Qe(Ye,[e.gateTerms])],e.deadline]}),value:ee.toString(),chainId:4663,description:we}));let[ye,ze,Ke]=await Promise.all([i.getCode({address:s}),i.getTransactionCount({address:s}),i.readContract({address:g,abi:He,functionName:"launchFee"})]);if(ye&&ye!=="0x"||ze!==0||f(H(Ke,5)[0])!==L)throw new o("Hookr collision state or launch fee changed. Request a fresh launch preview.");return await Le(i,t),{txs:U,inputs:te,summary:we,tokenAddress:s,poolId:m,feeTarget:v,feeTreasury:u.launchFee.treasury,terms:se({request:n,blockNumber:t.number,blockHash:t.hash,owner:r,tokenAddress:s,poolId:m,poolKey:d,member:fe,gateTerms:e.gateTerms,launchFee:L,feeTarget:v,feeTreasury:u.launchFee.treasury,hookrMinimumPips:J,exactApprovals:U.slice(0,-1),refunds:{quote:h-S,retainedSupply:e.token.supply-I},gasEstimate:null,gasEstimateReason:"The local sender estimates the ordered exact calls after funding approvals and confirms the gas limit and maximum fee.",lane:ke,pins:K})}}function ot(a){if(!Array.isArray(a)||a.length<1||a.length>3)throw new o("Hookr launch requires only the locally reconstructed finite approvals and one launch transaction.");for(let n of a)R(n,["to","data","value","chainId","description"],["to","data","value","chainId","description"])}function kt(a,n){if(ot(a),a.length!==n.length||a.some((r,e)=>r.to.toLowerCase()!==n[e].to.toLowerCase()||r.data.toLowerCase()!==n[e].data.toLowerCase()||r.value!==n[e].value||r.chainId!==4663))throw new o("Hookr launch differs from the locally reconstructed exact parameters, approvals and funding.")}function ft(a){return[{name:Je,inputSchema:ue,execute:async(n,r)=>{let e=await nt(a,n,r);return{txs:e.txs,preview:await a.preview(e.txs,r),terms:e.terms,summary:e.summary}}}]}export{Je as a,g as b,X as c,ue as d,Ze as e,nt as f,ot as g,kt as h,ft as i};
@@ -1 +0,0 @@
1
- import{a as d}from"./XSD5NL7J.js";import{getAddress as F,keccak256 as x}from"viem";var A={version:"hookr-launcher-v1",chainId:4663,blockNumber:"104346779",blockHash:"0x1bdaca726ac3f0b1dd0d861edf9fa3774dc1765fb51771632c7a7ef9751900bc",roles:{launcherV1:"0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C",rootV1:"0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc",rulesV1:"0x342bAA22e202954593b04B7eD1663621E0565d46",agentGateV1:"0x3b1aC66a6Fd9e9d8F063d145003cf29eac4Fb0C9",familyRouterV1:"0xbc56F48f873841d26a5a02575263d82f68e12864",familyLockV1:"0x5248AF9139DaDEf0C5296342b7BE441deDf0adC2",launcherLegacy:"0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4",rulesPrevious:"0x8AD0aC66DbeBcc047e8d216666C925E797e5e52e",rulesLegacy:"0x4a71c270b1520F94064268102AebD744b0DE7942",registry:"0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602",poolManager:"0x8366a39CC670B4001A1121B8F6A443A643e40951",familyLockLegacy:"0xfAFEcE64099C1E791C4B46189c277f00c0c7e00b",HookrLaunchChecks_856736:"0x8567369a70100828611BB6F44ec051B48F10fb59",HookrTokenDeployer_e703f2:"0xE703F2Cd21A8dEE05dbC81b693201D602772B2d8",HookrTokenDeployer_1b23d6:"0x1B23D6d7beBcB61E39317E9F0Bc02AEB91aFCcAe",HookrRegistryAdmin_675ac2:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1",HookrRegistryChecks_b9f5c5:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},contracts:{"0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C":{role:"launcherV1",address:"0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C",codeHash:"0xf1a77b5576a56082679dc590f1a02dc4e834e91cc984e4996b8b08d0f11c1714",dependencies:["0x8567369a70100828611BB6F44ec051B48F10fb59","0xE703F2Cd21A8dEE05dbC81b693201D602772B2d8","0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602"],links:[{start:80,length:20,address:"0x8567369a70100828611BB6F44ec051B48F10fb59"},{start:19566,length:20,address:"0x8567369a70100828611BB6F44ec051B48F10fb59"},{start:4906,length:20,address:"0xE703F2Cd21A8dEE05dbC81b693201D602772B2d8"},{start:14065,length:20,address:"0xE703F2Cd21A8dEE05dbC81b693201D602772B2d8"}],source:"https://sourcify.dev/server/v2/contract/4663/0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C",match:"exact_match"},"0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc":{role:"rootV1",address:"0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc",codeHash:"0xd336de325837e60a74cea11d87b5ebd1cc8961911f611f38de0508d23b6e779f",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602","0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9","0x445D7891381Aa7F91F5048EdBC6a611ccBDe7865","0x8876789976dEcBfCbBbe364623C63652db8C0904","0x9A8a1006469BA196f8FEfc017a53505C83A060BB"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc",match:"exact_match"},"0x342bAA22e202954593b04B7eD1663621E0565d46":{role:"rulesV1",address:"0x342bAA22e202954593b04B7eD1663621E0565d46",codeHash:"0xd9562958e6ecb3bfea31590b1d0201c281365b2becc1924ac4c5419e9cc1c32f",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602","0x2242F7FC75606500503075f29ea8cDA684EfB4a9","0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc","0x97D440593912234b78432A030fb5186BD2A3Bc86","0x8D0583b408e2959FA0450c54F749C1A4Dad3d335","0x0B0f08c381ed6902FAb74b470fe7f8A58E8EA269","0xc42E47679dd06DDcC07acc72ca710f6E60ACC3A9","0xdA360B744F8C816acbb97fF65cC4Cd81e27Df375"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x342bAA22e202954593b04B7eD1663621E0565d46",match:"exact_match"},"0x3b1aC66a6Fd9e9d8F063d145003cf29eac4Fb0C9":{role:"agentGateV1",address:"0x3b1aC66a6Fd9e9d8F063d145003cf29eac4Fb0C9",codeHash:"0x9aa76e84dabf5fbc568f620c5a0ea9817d55ea74a75cb43adfe58847a7db8d7c",dependencies:["0x8004A169FB4a3325136EB29fA0ceB6D2e539a432","0x8004BAa17C55a88189AE136b182e5fdA19dE9b63","0x8366a39CC670B4001A1121B8F6A443A643e40951","0x8Fdfaa25e2E4dDa297F301ea06458f22186D6bE9"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x3b1aC66a6Fd9e9d8F063d145003cf29eac4Fb0C9",match:"exact_match"},"0xbc56F48f873841d26a5a02575263d82f68e12864":{role:"familyRouterV1",address:"0xbc56F48f873841d26a5a02575263d82f68e12864",codeHash:"0x9e5741dabd7ac598ea5f5cc618272189a27b09cdec02b9a5eed77dc95acf0eec",dependencies:["0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9","0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C","0x8366a39CC670B4001A1121B8F6A443A643e40951","0x000000000022D473030F116dDEE9F6B43aC78BA3","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xbc56F48f873841d26a5a02575263d82f68e12864",match:"exact_match"},"0x5248AF9139DaDEf0C5296342b7BE441deDf0adC2":{role:"familyLockV1",address:"0x5248AF9139DaDEf0C5296342b7BE441deDf0adC2",codeHash:"0x488b7321770121eb0edc0f4b393f077d19eb6403416ab392713b0c29009a5dc1",dependencies:["0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C","0x8366a39CC670B4001A1121B8F6A443A643e40951"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x5248AF9139DaDEf0C5296342b7BE441deDf0adC2",match:"exact_match"},"0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4":{role:"launcherLegacy",address:"0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4",codeHash:"0x96b8c338c38a072ceef8b947ad93d3d7a46d2d7c70189d2b4ee92efb2a5e1d5d",dependencies:["0x8567369a70100828611BB6F44ec051B48F10fb59","0x1B23D6d7beBcB61E39317E9F0Bc02AEB91aFCcAe","0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602"],links:[{start:80,length:20,address:"0x8567369a70100828611BB6F44ec051B48F10fb59"},{start:19515,length:20,address:"0x8567369a70100828611BB6F44ec051B48F10fb59"},{start:4884,length:20,address:"0x1B23D6d7beBcB61E39317E9F0Bc02AEB91aFCcAe"},{start:14014,length:20,address:"0x1B23D6d7beBcB61E39317E9F0Bc02AEB91aFCcAe"}],source:"https://sourcify.dev/server/v2/contract/4663/0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4",match:"exact_match"},"0x8AD0aC66DbeBcc047e8d216666C925E797e5e52e":{role:"rulesPrevious",address:"0x8AD0aC66DbeBcc047e8d216666C925E797e5e52e",codeHash:"0x26dc86731245621bc765a95ebee7636c4eb726c4e9bc8e8946294d223404a677",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602","0x2242F7FC75606500503075f29ea8cDA684EfB4a9","0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc","0x1172a3cC44ce8E8E3F1f0e58a9A0E9678b7118f8","0x8D0583b408e2959FA0450c54F749C1A4Dad3d335","0xe5FCbB899C95B4c7cd3afFfd1f4EB093138870A2","0xc42E47679dd06DDcC07acc72ca710f6E60ACC3A9","0xFA66c713bb10298B47E0afC43389212F279E8245"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8AD0aC66DbeBcc047e8d216666C925E797e5e52e",match:"exact_match"},"0x4a71c270b1520F94064268102AebD744b0DE7942":{role:"rulesLegacy",address:"0x4a71c270b1520F94064268102AebD744b0DE7942",codeHash:"0x4b6d50b40981b8082f3ee5a7ebf57e48489f71c94c2a3b94032a1d1a382b515b",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602","0x2242F7FC75606500503075f29ea8cDA684EfB4a9","0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc","0xF83569E564d70daebc35950f66a73f2e2B915583"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x4a71c270b1520F94064268102AebD744b0DE7942",match:"exact_match"},"0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602":{role:"registry",address:"0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602",codeHash:"0xc16e7681583d8d9af8e8c54962f7e890b967687dee4cf32dbd676d4d547d2359",dependencies:["0x675ac2102E8c69E2467F64656E3c235AF3901Ac1","0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98","0x8366a39CC670B4001A1121B8F6A443A643e40951"],links:[{start:1195,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:1812,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:2770,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:3016,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:4424,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:6120,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:7306,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:9294,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:9970,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:10351,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:12268,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:12965,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:13521,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:15721,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:16994,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:17547,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:18245,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:19037,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:20001,length:20,address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1"},{start:2190,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:4233,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:5155,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:5922,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:13380,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:13963,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:16828,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:17833,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:18079,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:19893,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"}],source:"https://sourcify.dev/server/v2/contract/4663/0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602",match:"exact_match"},"0x8366a39CC670B4001A1121B8F6A443A643e40951":{role:"poolManager",address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",codeHash:"0xbd3881180b547f5fe817545743cfb4343e96b1bc6640dcd70c106b0066e95626",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8366a39CC670B4001A1121B8F6A443A643e40951",match:"match"},"0xfAFEcE64099C1E791C4B46189c277f00c0c7e00b":{role:"familyLockLegacy",address:"0xfAFEcE64099C1E791C4B46189c277f00c0c7e00b",codeHash:"0x4204916844297bc548ef02a5d081effd33e31fc4a4fab0b34ced52c17e53e535",dependencies:["0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4","0x8366a39CC670B4001A1121B8F6A443A643e40951"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xfAFEcE64099C1E791C4B46189c277f00c0c7e00b",match:"exact_match"},"0x8567369a70100828611BB6F44ec051B48F10fb59":{role:"HookrLaunchChecks_856736",address:"0x8567369a70100828611BB6F44ec051B48F10fb59",codeHash:"0xb9f17232100ac1ac05e9b662e916abad854f650156c67585bde7e99237d3cfca",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8567369a70100828611BB6F44ec051B48F10fb59",match:"exact_match"},"0xE703F2Cd21A8dEE05dbC81b693201D602772B2d8":{role:"HookrTokenDeployer_e703f2",address:"0xE703F2Cd21A8dEE05dbC81b693201D602772B2d8",codeHash:"0xb54e618fb33b3fb0591e482cb878ef5d7fcc3758576f6b9840eeb6557fc063f8",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xE703F2Cd21A8dEE05dbC81b693201D602772B2d8",match:"exact_match"},"0x1B23D6d7beBcB61E39317E9F0Bc02AEB91aFCcAe":{role:"HookrTokenDeployer_1b23d6",address:"0x1B23D6d7beBcB61E39317E9F0Bc02AEB91aFCcAe",codeHash:"0x724642470fbeef5a98a04b009376e10af722b96f932d992b256e412c4ea989b5",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x1B23D6d7beBcB61E39317E9F0Bc02AEB91aFCcAe",match:"exact_match"},"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1":{role:"HookrRegistryAdmin_675ac2",address:"0x675ac2102E8c69E2467F64656E3c235AF3901Ac1",codeHash:"0x070ba14bedd7b9c3c259998af44032ace80a49dc5d741d604fa1b82fd7737abc",dependencies:["0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"],links:[{start:215,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:1054,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:2745,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"},{start:3987,length:20,address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98"}],source:"https://sourcify.dev/server/v2/contract/4663/0x675ac2102E8c69E2467F64656E3c235AF3901Ac1",match:"exact_match"},"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98":{role:"HookrRegistryChecks_b9f5c5",address:"0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98",codeHash:"0xbf12974a6e59bc744e8d29bf9308c888e97e562693324dca7e8bdf20e0f81349",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xB9F5c54E5Cc7ac6c7a96335E5A334Cf4eA496E98",match:"exact_match"},"0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9":{role:"immutable_C2Bc9a3f",address:"0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9",codeHash:"0x855177b2017e7b73a79cb0c7b3027044beb5e726fbdc0fd2937229e32ecd7e0b",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602","0xe7863CC0E2Fb783b44c279aB159bcD812c2ceA1c"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9",match:"exact_match"},"0x445D7891381Aa7F91F5048EdBC6a611ccBDe7865":{role:"immutable_445D7891",address:"0x445D7891381Aa7F91F5048EdBC6a611ccBDe7865",codeHash:"0x1623e56a309a31e3626b854cd87623d62e39f743e2943d1f36ba13d677cef67a",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x445D7891381Aa7F91F5048EdBC6a611ccBDe7865",match:"exact_match"},"0x8876789976dEcBfCbBbe364623C63652db8C0904":{role:"immutable_88767899",address:"0x8876789976dEcBfCbBbe364623C63652db8C0904",codeHash:"0x2ce6aaaf9f4151f5e1cbf774668772f17f532ae11b15e9284fd0a072a8b0fbde",dependencies:["0x7332D11BD10d18A04B119Cd4671a96f3148002c4","0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3","0x58daec3116aae6D93017bAAea7749052E8a04fA7","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x000000000022D473030F116dDEE9F6B43aC78BA3","0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f","0x1f7d7550B1b028f7571E69A784071F0205FD2EfA","0x8366a39CC670B4001A1121B8F6A443A643e40951"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8876789976dEcBfCbBbe364623C63652db8C0904",match:"match"},"0x9A8a1006469BA196f8FEfc017a53505C83A060BB":{role:"immutable_9A8a1006",address:"0x9A8a1006469BA196f8FEfc017a53505C83A060BB",codeHash:"0x0b71a0db955a7a000d3bd3cd721c74cbbf1870eaaf02c1274542c834f8591f1f",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x9A8a1006469BA196f8FEfc017a53505C83A060BB",match:"exact_match"},"0x2242F7FC75606500503075f29ea8cDA684EfB4a9":{role:"immutable_2242F7FC",address:"0x2242F7FC75606500503075f29ea8cDA684EfB4a9",codeHash:"0x95d1784c555685e9ccbc0ba9f6d1e6facea864fd1de77ebbc98862dcf2c13454",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x2242F7FC75606500503075f29ea8cDA684EfB4a9",match:"exact_match"},"0x97D440593912234b78432A030fb5186BD2A3Bc86":{role:"immutable_97D44059",address:"0x97D440593912234b78432A030fb5186BD2A3Bc86",codeHash:"0x1f622db841d81a460cced260dc6cc89810ea0b20d5ecaeaa12e170ba4d110823",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x2242F7FC75606500503075f29ea8cDA684EfB4a9"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x97D440593912234b78432A030fb5186BD2A3Bc86",match:"exact_match"},"0x8D0583b408e2959FA0450c54F749C1A4Dad3d335":{role:"immutable_8D0583b4",address:"0x8D0583b408e2959FA0450c54F749C1A4Dad3d335",codeHash:"0x1825f945ef04d5304707da468929c33dcf125db20d9c0292d98952455a393775",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x2242F7FC75606500503075f29ea8cDA684EfB4a9"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8D0583b408e2959FA0450c54F749C1A4Dad3d335",match:"exact_match"},"0x0B0f08c381ed6902FAb74b470fe7f8A58E8EA269":{role:"immutable_0B0f08c3",address:"0x0B0f08c381ed6902FAb74b470fe7f8A58E8EA269",codeHash:"0xd48b4c4fb93299f401452de225d70df49a903f4874bccb0b98f44f0951b1b5cb",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x0B0f08c381ed6902FAb74b470fe7f8A58E8EA269",match:"exact_match"},"0xc42E47679dd06DDcC07acc72ca710f6E60ACC3A9":{role:"immutable_c42E4767",address:"0xc42E47679dd06DDcC07acc72ca710f6E60ACC3A9",codeHash:"0x9f810ec150181c58ed3af00c5b1be7b5d974b5b34450c7d1918d0cf70c5ac2ae",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xc42E47679dd06DDcC07acc72ca710f6E60ACC3A9",match:"exact_match"},"0xdA360B744F8C816acbb97fF65cC4Cd81e27Df375":{role:"immutable_dA360B74",address:"0xdA360B744F8C816acbb97fF65cC4Cd81e27Df375",codeHash:"0xbc34e16733f65147eae2f6d5247847c19327ed4d2d40b84549b79ce17e40c450",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xdA360B744F8C816acbb97fF65cC4Cd81e27Df375",match:"exact_match"},"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432":{role:"immutable_8004A169",address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",codeHash:"0xd0e45b1d89fa9b6cc7e97c1f155d64180e5c232aaccf9900ef9d4fd738c02b41",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",match:"exact_match"},"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63":{role:"immutable_8004BAa1",address:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",codeHash:"0xd0e45b1d89fa9b6cc7e97c1f155d64180e5c232aaccf9900ef9d4fd738c02b41",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",match:"exact_match"},"0x8Fdfaa25e2E4dDa297F301ea06458f22186D6bE9":{role:"immutable_8Fdfaa25",address:"0x8Fdfaa25e2E4dDa297F301ea06458f22186D6bE9",codeHash:"0x4e381985ca68b3e5d27b4425fa581c19cf33146d3f887a3cfca96f55528ea46f",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8Fdfaa25e2E4dDa297F301ea06458f22186D6bE9",match:null},"0x000000000022D473030F116dDEE9F6B43aC78BA3":{role:"immutable_00000000",address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",codeHash:"0x5208783f52488f7d3493e5e38311ab707c1d75457fe472a19b0b4d57d66a7fca",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x000000000022D473030F116dDEE9F6B43aC78BA3",match:"match"},"0x1172a3cC44ce8E8E3F1f0e58a9A0E9678b7118f8":{role:"immutable_1172a3cC",address:"0x1172a3cC44ce8E8E3F1f0e58a9A0E9678b7118f8",codeHash:"0xb1d8b1d6a6626ee859cc0c5a2725078fb62245d730015b3405974928fba6e5c1",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x2242F7FC75606500503075f29ea8cDA684EfB4a9"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x1172a3cC44ce8E8E3F1f0e58a9A0E9678b7118f8",match:"exact_match"},"0xe5FCbB899C95B4c7cd3afFfd1f4EB093138870A2":{role:"immutable_e5FCbB89",address:"0xe5FCbB899C95B4c7cd3afFfd1f4EB093138870A2",codeHash:"0x479a933df7325219942f75f36046f731ed7409f96e0c279e9912e2d0ed5ee0ed",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xe5FCbB899C95B4c7cd3afFfd1f4EB093138870A2",match:"exact_match"},"0xFA66c713bb10298B47E0afC43389212F279E8245":{role:"immutable_FA66c713",address:"0xFA66c713bb10298B47E0afC43389212F279E8245",codeHash:"0x6731ed800a1eb9d083f640ad8c00f94dc0cb3461c3f5124a21349ad30c8e6e28",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xFA66c713bb10298B47E0afC43389212F279E8245",match:"exact_match"},"0xF83569E564d70daebc35950f66a73f2e2B915583":{role:"immutable_F83569E5",address:"0xF83569E564d70daebc35950f66a73f2e2B915583",codeHash:"0xb78c68d64388c9c0c4d20faa3d429309a6a025024c3eefc579831bb10de145ed",dependencies:["0x8366a39CC670B4001A1121B8F6A443A643e40951","0x2242F7FC75606500503075f29ea8cDA684EfB4a9","0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xF83569E564d70daebc35950f66a73f2e2B915583",match:"exact_match"},"0xe7863CC0E2Fb783b44c279aB159bcD812c2ceA1c":{role:"immutable_e7863CC0",address:"0xe7863CC0E2Fb783b44c279aB159bcD812c2ceA1c",codeHash:"0x3242bd3dea1be9c1ffd17b23475f2d1d11fb5ee9cdbe8328b309b7adb8427043",dependencies:["0x000000000022D473030F116dDEE9F6B43aC78BA3","0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602","0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0xe7863CC0E2Fb783b44c279aB159bcD812c2ceA1c",match:"exact_match"},"0x7332D11BD10d18A04B119Cd4671a96f3148002c4":{role:"immutable_7332D11B",address:"0x7332D11BD10d18A04B119Cd4671a96f3148002c4",codeHash:"0xb16b4aa5c5f14b9d186d48bb074c2d02a96e9e2e3aef74d0815f6d4a9a9f7bdd",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x7332D11BD10d18A04B119Cd4671a96f3148002c4",match:null},"0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3":{role:"immutable_73991a25",address:"0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3",codeHash:"0x0a493d1af3d0f25fed8efa205244ebee14114267a08647fc38c515c7cd6ead4f",dependencies:["0x6F84dAE9c064ff453E5C8af51EfB819f8f610225","0x1f7d7550B1b028f7571E69A784071F0205FD2EfA","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3",match:"match"},"0x58daec3116aae6D93017bAAea7749052E8a04fA7":{role:"immutable_58daec31",address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",codeHash:"0xc873e135dc9aaec88489cfbad146b4cb49d6a32e0d80326377784b7ba17670b2",dependencies:["0x9639443158E8C5efa35Bd45287bf2EFfd3D8dC06","0x8366a39CC670B4001A1121B8F6A443A643e40951","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x000000000022D473030F116dDEE9F6B43aC78BA3"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x58daec3116aae6D93017bAAea7749052E8a04fA7",match:"match"},"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73":{role:"immutable_0Bd7D308",address:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",codeHash:"0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",match:"exact_match"},"0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f":{role:"immutable_8bcEaA40",address:"0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f",codeHash:"0xbab145d02e7005f0d84c6c1639d39b799b0ea16df99ebbdaf5a14d9da820b4e0",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f",match:"exact_match"},"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA":{role:"immutable_1f7d7550",address:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA",codeHash:"0xec72b1abd1f2faee020cfea9c646bd8994f9fb389054f6e574f103a895091739",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x1f7d7550B1b028f7571E69A784071F0205FD2EfA",match:"match"},"0x6F84dAE9c064ff453E5C8af51EfB819f8f610225":{role:"immutable_6F84dAE9",address:"0x6F84dAE9c064ff453E5C8af51EfB819f8f610225",codeHash:"0x6c57ccabb87f0ac1de9a2115c27e517cc87c3c1e3dd3ac407d1a42d19a327c86",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x6F84dAE9c064ff453E5C8af51EfB819f8f610225",match:null},"0x9639443158E8C5efa35Bd45287bf2EFfd3D8dC06":{role:"immutable_96394431",address:"0x9639443158E8C5efa35Bd45287bf2EFfd3D8dC06",codeHash:"0x09d3b199609b46e8921e47c5d0d98ae083e70d2d3b63a6099dc7e947b2f58b20",dependencies:["0x525b4bd46d3A33F16ac815B4A303b3110fB9d10b"],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x9639443158E8C5efa35Bd45287bf2EFfd3D8dC06",match:"match"},"0x525b4bd46d3A33F16ac815B4A303b3110fB9d10b":{role:"immutable_525b4bd4",address:"0x525b4bd46d3A33F16ac815B4A303b3110fB9d10b",codeHash:"0x7664c06c3ff64366b0c870eb585d9d80aa5730441eccca3025054e0366a20d0b",dependencies:[],links:[],source:"https://sourcify.dev/server/v2/contract/4663/0x525b4bd46d3A33F16ac815B4A303b3110fB9d10b",match:"match"}},gateVersions:{identity:"0x9da4ea57e56972d6b59b74df977e55a996eba90167c2c0c7bb2e46873c9acc31",reputation:"0x9da4ea57e56972d6b59b74df977e55a996eba90167c2c0c7bb2e46873c9acc31"},launcherDeployments:{"0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C":{transactionHash:"0xdf5b507c60f4941edbc4666c624a900701631cac3ef06ab3756c28e5e3f60580",blockNumber:"103300226",transactionIndex:"4",deployer:"0x0c0967485A25F18E70262a2Ee80c7595CC64a5fC"},"0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4":{transactionHash:"0xa48e4cf08e0020fbfb40067a041fcacd3bb0bb4c6dcd3358c10d16021d49a31f",blockNumber:"82270054",transactionIndex:"3",deployer:"0x0c0967485A25F18E70262a2Ee80c7595CC64a5fC"}}};var o=A.roles,C=0x2accn,i=A.contracts;async function h(c,e,a){let b=F(e.address),s=await c.getCode({address:b,blockNumber:a});if(!s||s==="0x"||x(s)!==e.codeHash)throw new d(`Hookr runtime code is unknown or drifted at ${b}. Refresh the reviewed deployment pins before using this route.`);for(let t of e.links)if(t.length!==20||`0x${s.slice(2+t.start*2,2+(t.start+t.length)*2)}`.toLowerCase()!==t.address.toLowerCase())throw new d("Hookr linked library differs from its reviewed pin.")}function l(c){let e=i[F(c)];if(!e)throw new d("Unknown Hookr deployment. Use a locally reviewed Launcher, Root, core and gate.");return e}async function p(c,e,a,b=new Set){if(e<0n)throw new d("Provide a nonnegative named Hookr block.");if((BigInt(o.rootV1)&0x3fffn)!==C)throw new d("HookrRoot permission mask differs from 0x2acc.");let s=new Map,t=r=>{let f=l(r);if(!s.has(f.address)){s.set(f.address,f);for(let E of f.dependencies)t(E)}};a.forEach(t);let n=[...s.values()].filter(r=>!b.has(r.address));for(let r=0;r<n.length;r+=2)await Promise.all(n.slice(r,r+2).map(async f=>{await h(c,f,e),b.add(f.address)}))}async function k(c,e){if(await c.getChainId()!==4663)throw new d("Hookr reads require Robinhood Chain 4663.");let a=await c.getBlock(e===void 0?{}:{blockNumber:e});if(a.number===null||!a.hash||typeof a.timestamp!="bigint"||e!==void 0&&a.number!==e)throw new d("Hookr named block is unavailable. Retry against an available block.");return{number:a.number,hash:a.hash,timestamp:a.timestamp}}async function g(c,e){if((await c.getBlock({blockNumber:e.number})).hash!==e.hash)throw new d("Hookr named block changed during the read. Retry the complete read.")}function y(c){if(typeof c!="string"||![o.launcherV1,o.launcherLegacy].includes(c))throw new d("Use the checksummed current or previous reviewed Hookr Launcher address.");return F(c)}export{A as a,o as b,C as c,i as d,h as e,l as f,p as g,k as h,g as i,y as j};
@@ -1 +0,0 @@
1
- import{a as be}from"./DCGNVMKG.js";import{c as ye}from"./3PHJUFU2.js";import{a as J}from"./ZX43P4BK.js";import{a as _,b as E}from"./Z7FGEWO2.js";import{a as Q,b as ke}from"./CFPJDLTZ.js";import{a as N}from"./VVAM3EAK.js";import{a as he}from"./P4UQGWCP.js";import{a as R}from"./43LI5NKJ.js";import{b as me,c as fe}from"./SCG5HWMN.js";import{a as de,b as z,c as Y}from"./5HCXZWUH.js";import{q as le,s as P,t as ue}from"./MQ5F2VOK.js";import{b as T,c as U,d as F,e as ie,j as M,k as ce,t as D}from"./TI727O2H.js";import{a as h}from"./XSD5NL7J.js";import{a as w,b as j,c as Z}from"./JXOEJPJ4.js";import{decodeFunctionResult as Ee,encodeFunctionData as Me,erc20Abi as q,getAddress as p,isAddress as V,parseAbi as X}from"viem";var ee="https://api.robinhood.com/rhj/assets",_e={address:_,symbol:"ETH",decimals:18,chainId:T},te={address:p(ce),symbol:"USDG",decimals:ie,chainId:T},ne={address:p(M[4663].tokens.WETH.address),symbol:"WETH",decimals:18,chainId:T},Ce={address:p(M[4663].meridian.CollateralToken_USDe.address),symbol:"USDe",decimals:18,chainId:T},re=[{address:p(Q.chop),symbol:"CHOP",decimals:18,chainId:T},{address:p(Q.oakLog.address),symbol:"chOAK",decimals:18,chainId:T},{address:p(ke),symbol:"schOAK",decimals:18,chainId:T}],K=(e,n)=>re.find(s=>s.chainId===n&&s.address.toLowerCase()===e.toLowerCase());function $(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function H(e,n=T,s={}){let t=Array.isArray(e)?e:$(e)&&Array.isArray(e.assets)?e.assets:void 0;if(!t)throw new h("Official stock asset list response is malformed.");let a=new Map,c=new Map;if(t.length>1e4)throw new h("Official stock asset list exceeds the lookup limit.");for(let o of t){if(!$(o))continue;let r=o;if(typeof r.tokenSymbol!="string"||!r.tokenSymbol.trim()||!Array.isArray(r.deployments))continue;if(r.deployments.length>100)throw new h("Official stock deployment list exceeds the lookup limit.");let d=r.tokenSymbol;if(!/^[A-Za-z0-9.$_-]{1,32}$/.test(d))throw new h(`Invalid official stock ticker ${w(d)}.`);if(r.tokenDecimals!==void 0&&(typeof r.tokenDecimals!="number"||!Number.isInteger(r.tokenDecimals)||r.tokenDecimals<0||r.tokenDecimals>255))throw new h("Official stock asset has invalid token decimals.");let l=typeof r.tokenDecimals=="number"&&Number.isInteger(r.tokenDecimals)&&r.tokenDecimals>=0&&r.tokenDecimals<=255?r.tokenDecimals:18;for(let f of r.deployments){if(!$(f))continue;let y=f;if(y.chainId!==n)continue;if(typeof y.contractAddress!="string"||!V(y.contractAddress,{strict:!1}))throw new h("Official stock deployment has an invalid contract address.");let b=p(y.contractAddress),k=b.toLowerCase(),S=d.toUpperCase(),u=c.get(S);if(!s.allowAmbiguousSymbols&&u&&u!==k)throw new h(`Ambiguous official stock ticker ${w(d)} across multiple addresses.`);let i=a.get(k);if(i&&(i.symbol!==d||i.decimals!==l))throw new h(`Conflicting official stock identity at ${b}.`);c.set(S,k),a.set(k,{address:b,symbol:d,decimals:l,chainId:n,...s.includeNames&&typeof r.tokenName=="string"&&r.tokenName.trim()?{name:r.tokenName.trim()}:{}})}}return[...a.values()]}function Be(e,n){if(typeof e.address!="string"||!V(e.address,{strict:!1}))return!1;let s=e.chainId??T,t=e.address.toLowerCase();return n.some(a=>a.chainId===s&&a.address.toLowerCase()===t&&a.symbol===e.symbol)}function G(e,n){R(e.address);let s=e.chainId??T,t=p(e.address),a=t.toLowerCase(),c=C(e.symbol),o=n.find(d=>d.chainId===s&&d.address.toLowerCase()===a),r=n.find(d=>d.chainId===s&&C(d.symbol)===c);if(o){if(e.symbol!==o.symbol)throw new h(`Token at ${t} does not match official stock ticker ${w(o.symbol)} (received ${w(e.symbol)}).`);if(e.decimals!==void 0&&e.decimals!==o.decimals)throw new h(`Token ${w(o.symbol)} at ${t} does not match official decimals ${o.decimals}.`);return o}if(r)throw new h(`Token symbol ${w(e.symbol)} at ${t} does not match the official stock contract address ${r.address}.`);return{address:t,symbol:e.symbol.trim(),decimals:e.decimals??18,chainId:s}}var Ue=["AAOI","AAPL","ABCL","ADBE","AEHR","AEIS","ALAB","AMAT","AMBA","AMC","AMD","AMKR","AMZN","ANET","APLD","APP","ASML","ASTS","AUR","AVAV","AVGO","AXON","AXTI","BA","BABA","BB","BE","BMNR","BND","BULL","CBRS","CCL","CEG","CELH","CIEN","CLOV","CLS","CLSK","COHR","COIN","COST","CRCL","CRDO","CRM","CRWD","CRWV","CSCO","CTSH","CVNA","DDOG","DELL","DIS","DJT","DOCN","ELF","EWT","EWY","F","FICO","FIG","FISV","FIX","FLNC","FLY","FTNT","FUTU","GDX","GE","GEV","GLD","GLW","GLXY","GME","GOOGL","HII","HIMS","HPE","HWM","IBM","IBRX","INDA","INFQ","INOD","INTC","INTU","IONQ","IREN","JBL","JNJ","JOBY","JPM","KLAC","KSS","KTOS","LHX","LITE","LLY","LMT","LRCX","LULU","LUNR","MCD","MDB","META","MOD","MPWR","MRNA","MRVL","MSFT","MSTR","MTSI","MU","MXL","NAVN","NBIS","NET","NFLX","NNE","NOW","NU","NVDA","NVTS","OKLO","ON","ONTO","ORCL","OUST","P","PANW","PATH","PENG","PFE","PL","PLTR","POET","POWL","PR","PWR","PYPL","QBTS","QCOM","QQQ","QUBT","RBLX","RCAT","RDDT","RDW","RGTI","RIVN","RKLB","RUN","SATS","SCHD","SGOV","SHOP","SHY","SIMO","SKHY","SLS","SLV","SMCI","SMH","SMR","SNAP","SNDK","SNOW","SOFI","SOUN","SOXX","SPCX","SPMO","SPY","TE","TEAM","TEM","TER","TSEM","TSLA","TSM","TTD","TTWO","UBER","UMC","UNH","UPS","USAR","USO","V","VICR","VRT","VSAT","VST","VTI","WDAY","WDC","WULF","WYFI","XLK","XNDU","XOM","ZETA","ZM","ZS"],se=new WeakMap,pe=new WeakMap,ve=3e4,Te=Object.freeze([]),x;function dt(){if(!x)return Te;let e=Date.now()-x.started;return e>=0&&e<ve?x.tokens:Te}var oe=new WeakMap;function W(e,n){return(oe.get(e)??P)(n)}async function Ie(e){let n=e?.http??me(),s=e?.url??ee,t=e?.chainId??T,a=Y(n),c=pe.get(a);c||(c=new de(ve),pe.set(a,c));let{value:o,started:r}=await W(n,()=>c.read(`${t}:${s}`,async()=>{let l=await P(y=>fe(a,s,{method:"GET",signal:y},b=>$(b)||Array.isArray(b))),f=H(l,t,{allowAmbiguousSymbols:!0});if(t===T&&f.length===0)throw new h("Official stock asset list has no mainnet deployments; retry when the list is available.");return l})),d=H(o,t,e);if(t===T&&s===ee&&(!x||r>=x.started||Date.now()<x.started)&&(x={started:r,tokens:Object.freeze(H(o,t,{allowAmbiguousSymbols:!0}).map(l=>Object.freeze(l)))}),t===T){let l=se.get(a);l||(l=new Set,se.set(a,l));for(let f of d)l.add(C(f.symbol))}return d}var Fe=X(["function aggregate3((address target, bool allowFailure, bytes callData)[] calls) payable returns ((bool success, bytes returnData)[] returnData)"]);function we(e){let n=e,s=new Set;for(;n&&typeof n=="object"&&!s.has(n)&&s.size<10;){s.add(n);let t=n;if(t.name==="ContractFunctionZeroDataError"||t.name==="AbiDecodingZeroDataError")return!0;let a=`${typeof t.shortMessage=="string"?t.shortMessage:""} ${typeof t.message=="string"?t.message:""}`;if(/returned no data \("0x"\)|Cannot decode zero data/i.test(a))return!0;n=t.cause}return!1}function Ke(e){return e instanceof h?/RPC endpoint|too many requests|malformed JSON/i.test(e.message):e instanceof Error?/fetch failed|network|ECONNREFUSED|ETIMEDOUT|HTTP \d{3}|rate limit|too many requests/i.test(e.message):!1}async function $e(e,n,s){if(typeof e.getCode=="function")try{let t=await e.getCode({address:n});return!t||t==="0x"}catch{return we(s)}return we(s)}async function ge(e,n,s){if(n.length===0)return[];let t=await Promise.allSettled(n.map(a=>e.readContract({address:a.address,abi:q,functionName:"balanceOf",args:[s]})));if(t.every(a=>a.status==="rejected")&&t[0]?.status==="rejected"&&Ke(t[0].reason))throw t[0].reason;return t.map(a=>{if(a.status!=="fulfilled"||a.value===void 0||a.value===null)return{ok:!1};try{let c=typeof a.value=="bigint"?a.value:BigInt(a.value);return c>=0n?{ok:!0,amount:c}:{ok:!1}}catch{return{ok:!1}}})}async function Le(e,n,s,t){if(s.length===0)return[];let a=le(n,e);if(!a)return ge(e,s,t);let c=s.map(r=>({target:r.address,allowFailure:!0,callData:Me({abi:q,functionName:"balanceOf",args:[t]})})),o;try{o=await e.readContract({address:a,abi:Fe,functionName:"aggregate3",args:[c]})}catch(r){if(await $e(e,a,r))return ge(e,s,t);throw r}if(!Array.isArray(o)||o.length!==s.length)throw new h("Multicall3 aggregate3 returned an invalid result list.");return o.map(r=>{let d=r,l=Array.isArray(d)?d[0]:d?.success,f=Array.isArray(d)?d[1]:d?.returnData;if(!l||typeof f!="string"||f==="0x")return{ok:!1};try{let y=Ee({abi:q,functionName:"balanceOf",data:f}),b=typeof y=="bigint"?y:BigInt(y);return b>=0n?{ok:!0,amount:b}:{ok:!1}}catch{return{ok:!1}}})}async function lt(e,n={}){R(e);let s=p(e),t=n.chainId??T,a=n.client??ue(n.rpcUrl,t),c=[];if(n.stockTokens?c=[...n.stockTokens]:n.stockAssetsPayload!==void 0?c=H(n.stockAssetsPayload,t):n.includeStockTokens!==!1&&t!==U&&(c=await Ie({http:n.http,url:n.stockAssetsUrl,chainId:t})),n.tokens)for(let i of n.tokens)G(i,c);let o=t===T?[te,ne,Ce,...n.oakTokenAddress||process.env.OAK_TOKEN_ADDRESS?[{address:p(n.oakTokenAddress??process.env.OAK_TOKEN_ADDRESS),symbol:"OAK",decimals:F,chainId:t}]:[]]:t===U?[{...te,address:p(D.testnet.usdg),chainId:t},{...ne,address:p(D.testnet.weth),chainId:t},...n.oakTokenAddress?[{address:p(n.oakTokenAddress),symbol:"OAK",decimals:F,chainId:t}]:[]]:[],r=t===T&&n.includePoolTokens!==!1?[...re,...he.vaults.flatMap(i=>[{address:p(i.tokenAddress),symbol:p(i.tokenAddress),decimals:i.tokenDecimals,chainId:t},{address:p(i.earnContractAddress),symbol:p(i.earnContractAddress),decimals:18,chainId:t}])]:[],d=new Set(r.map(i=>i.address.toLowerCase())),l=[],f=new Set;for(let i of[...o,...c,...n.tokens??[],...r]){if(i.chainId!==t||E(i.address)===_)continue;let m=K(i.address,t)??G(i,c),A=m.address.toLowerCase();f.has(A)||(f.add(A),l.push(m))}let[y,b]=await Promise.all([a.getBalance({address:s}),Le(a,t,l,s)]),k=[],S={address:_,symbol:"ETH",decimals:18,chainId:t};(y>0n||n.includeZero)&&k.push({token:S,amount:y.toString()});for(let i=0;i<l.length;i++){let m=l[i],A=o.some(I=>v(I.address,m.address))||c.some(I=>v(I.address,m.address))||K(m.address,t)?m.symbol:w(m.symbol),g=b[i]??{ok:!1};if(!g.ok){k.push({token:{address:m.address,symbol:A,decimals:m.decimals,chainId:m.chainId},amount:"unavailable"});continue}let O=g.amount;if(O>0n&&d.has(m.address.toLowerCase())&&!K(m.address,t))try{let[I,L]=await Promise.all([N(a,t,m.address,"symbol"),N(a,t,m.address,"decimals")]);A=w(I),m.decimals=L}catch{}(O>0n||n.includeZero)&&k.push({token:{address:m.address,symbol:A,decimals:m.decimals,chainId:m.chainId},amount:O.toString()})}let u="Outside token discovery is disabled; no receipt time window was scanned. The local journal can include older receipts.";if(n.includeReceivedTokens===!0){let i=await He(s,{client:a});if(u=i.notice,!i.incomplete)try{let m=i.addresses.filter(g=>!f.has(g.toLowerCase())),A=await We(s,m,{client:a,chainId:t});k.push(...A.map(g=>({...g,verified:!1,note:"Received from outside Oak's lists; not verified."})))}catch{u+=" Discovery is incomplete: outside balances or token metadata are unavailable; known balances are retained."}}return k.length||k.push({token:S,amount:y.toString()}),k[0]={...k[0],discoveryNotice:u},k}async function He(e,n){R(e);let s,t,a="the last 10,000 blocks (approximately 17 minutes at 100 ms per block; UTC boundaries unavailable)",c=()=>`Outside token discovery covers only ERC-20 receipts in ${a}; older holdings may be missing. The local journal can include older receipts.`;try{if(t=await P(()=>n.client.getBlockNumber({cacheTime:0}),3e3),s=t>9999n?t-9999n:0n,typeof n.client.getBlock=="function")try{let l=await Promise.all([s,t].map(f=>P(()=>n.client.getBlock({blockNumber:f}),3e3)));a=`blocks ${s}\u2013${t}, from ${new Date(Number(l[0].timestamp)*1e3).toISOString()} to ${new Date(Number(l[1].timestamp)*1e3).toISOString()} (UTC)`}catch{}let o=X(["event Transfer(address indexed from,address indexed to,uint256 value)"])[0],r=await P(()=>n.client.getLogs({event:o,args:{to:p(e)},fromBlock:s,toBlock:t,strict:!0}),3e3),d=[...new Set(r.filter(l=>!l.removed&&typeof l.args.value=="bigint"&&l.args.value>0n).map(l=>p(l.address)))];return d.length>200?{addresses:[],fromBlock:s,toBlock:t,incomplete:!0,notice:`${c()} Discovery is incomplete: the 200-contract limit was exceeded; known balances are retained.`}:{addresses:d,fromBlock:s,toBlock:t,incomplete:!1,notice:c()}}catch{return{addresses:[],fromBlock:s,toBlock:t,incomplete:!0,notice:`${c()} Discovery is incomplete: RPC receipt reads are unavailable; known balances are retained. Retry balances when RPC logs are available.`}}}async function We(e,n,s){if(R(e),n.length>1e4)throw new h("Journal token discovery exceeds the balance lookup limit.");let t=[...new Set(n.map(o=>(R(o),p(o))))].filter(o=>E(o)!==_).map(o=>({address:o,symbol:o,decimals:0,chainId:s.chainId})),a=await Le(s.client,s.chainId,t,p(e)),c=t.flatMap((o,r)=>{let d=a[r];return d.ok&&d.amount===0n?[]:[{token:o,amount:d.ok?d.amount.toString():"unavailable"}]});return Promise.all(c.map(async({token:o,amount:r})=>{let d=K(o.address,s.chainId);if(d)return{token:{...d},amount:r};let[l,f]=await Promise.all([N(s.client,s.chainId,o.address,"symbol"),N(s.client,s.chainId,o.address,"decimals").catch(()=>{throw new h(`Token decimals are unavailable for journal-received token ${o.address}; retry balances when RPC metadata is available.`)})]);return{token:{...o,symbol:w(l),decimals:f},amount:r}}))}var v=(e,n)=>e.toLowerCase()===n.toLowerCase(),C=e=>Z(e.normalize("NFKC")).toLowerCase().replace(/[^\p{L}\p{N}]/gu,""),Ae=e=>Z(e.normalize("NFKC")).toLowerCase().match(/[\p{L}\p{N}]+/gu)?.join(" ")??"";function Ne(e){let n=e.context.network??"mainnet",{chainId:s,usdg:t,weth:a}=D[n],c=(o,r,d)=>({...o,address:E(p(o.address)),name:r,kind:d,verified:!0,source:"Oak fixed addresses",warnings:[]});return[c({..._e,chainId:s},"Ether","native"),c({...te,address:t,chainId:s},"Global Dollar","stablecoin"),c({...ne,address:a,chainId:s},"Wrapped Ether","wrapped"),...n==="mainnet"?[c(Ce,"USDe","stablecoin")]:[],...n==="mainnet"?re.map(o=>c(o,o.symbol==="CHOP"?"Chop":o.symbol==="chOAK"?"Chop OAK log":"Chop OAK staked LP",o.symbol==="CHOP"?"erc20":"wrapped")):[],...e.oakTokenAddress?[c({address:e.oakTokenAddress,symbol:"OAK",decimals:F,chainId:s},"Oak","oak")]:[]]}async function De(e){if(e.context.network==="testnet")return[];let n=e.officialStockTokens??await Ie({http:e.context.http,includeNames:!0,allowAmbiguousSymbols:!0});return n.filter(s=>Be(s,n)).map(s=>({...s,name:s.name??s.symbol,kind:"official_stock",verified:!0,source:ee,warnings:[],identityNote:"Official Robinhood stock token: this address matches Robinhood's published list. The quoted name is text from that list."}))}async function ae(e,n,s=!0){let{chainId:t}=D[n.context.network??"mainnet"],a=n.context.clientFor(t);if(await a.getChainId()!==t)throw new h(`Token lookup requires Robinhood Chain ${t}.`);let[c,o,r]=await Promise.all([W(a,()=>N(a,t,e,"name",n.blockNumber)).catch(d=>{if(s)throw d;return""}),W(a,()=>N(a,t,e,"symbol",n.blockNumber)),W(a,()=>N(a,t,e,"decimals",n.blockNumber))]);if(typeof c!="string"||s&&!c.trim()||typeof o!="string"||!o.trim()||!Number.isInteger(r)||r<0||r>255)throw new h("The contract returned invalid token metadata.");return{address:p(e),name:c||o,symbol:o,decimals:r,chainId:t}}async function Se(e,n){let s=await n.context.clientFor(T).readContract({address:M[T].clanker.factory.address,abi:X(["function tokenDeploymentInfo(address) view returns ((address,address,address,address[]))"]),functionName:"tokenDeploymentInfo",args:[e]});return Array.isArray(s)&&s.length===4&&typeof s[0]=="string"&&v(s[0],e)}async function Ge(e,n){let s=n.context.clientFor(T),t=M[T].poolsTrade,a=[t.instantLaunchStrategyFeesOn.address,t.instantLaunchStrategyFeesOff.address],c=X(["event TokenLaunched(bytes32 indexed poolId,address indexed token,address indexed feeSplitter,(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey)"])[0],o=await s.getBlockNumber(),r=new Set,d=0,l=0;for(let f=63127652n;f<=o;f+=10000000n){if(++d>Pe)throw new h("Token origin scan limit reached.");let y=f+9999999n>o?o:f+9999999n,b=await s.getLogs({address:a,event:c,args:{token:e},fromBlock:f,toBlock:y,strict:!0});for(let k of b){if(k.removed||!a.some(u=>v(u,k.address))||!k.args.token||!v(k.args.token,e)||!k.transactionHash||r.has(k.transactionHash))continue;if(r.add(k.transactionHash),++l>20)throw new h("Token origin receipt limit reached.");let S=await s.getTransactionReceipt({hash:k.transactionHash});if(be(S).some(u=>v(u.token,e)))return p(S.from)}}}var Pe=5,Ve=100,Xe=500,je=3e4;function xe(e){let n=Date.now()+je,s=0,t=new Map,a=o=>{let r=n-Date.now();if(r<=0)throw new h("Token lookup time budget reached; results are partial.");return P(o,Math.min(1e4,r))},c=z((o,r)=>a(async d=>{let l=await e.context.http(o,{...r,signal:d});return new Proxy(l,{get(f,y){if(y==="json")return()=>a(()=>f.json());let b=Reflect.get(f,y,f);return typeof b=="function"?b.bind(f):b}})}),e.context.http);return oe.set(c,a),{...e,context:{...e.context,http:c,clientFor:o=>{if(!t.has(o)){let r=e.context.clientFor(o),d=l=>{if(++s>Xe)throw new h("Token lookup RPC budget reached; results are partial.");return a(l)};t.set(o,z(new Proxy(r,{get(l,f){let y=Reflect.get(l,f);return typeof y!="function"?y:(...b)=>d(()=>y.apply(l,b))}}),r)),oe.set(t.get(o),d)}return t.get(o)}}}}function Oe(e){return e.source==="Oak fixed addresses"?e:{...e,symbol:w(e.symbol),name:w(e.name)}}async function ut(e,n){if(n=xe(n),typeof e!="string"||e.length>256||!C(e))throw new h("Provide a token name, symbol or address to find_token.");let s=C(e),t=V(e.trim(),{strict:!1})?E(p(e.trim())):void 0,{chainId:a}=D[n.context.network??"mainnet"],c=[],o=Ne(n),r=!1;try{o.push(...await De(n))}catch{r=!0,c.push("The official stock list is unavailable; results are partial and stock identities and lookalikes could not be checked.")}let d=u=>t?v(u.address,t):C(u.symbol).includes(s)||C(u.name).includes(s),l=o.filter(d),f=[],y=(u,i)=>[u.symbol,u.name??""].some(m=>[i.symbol,i.name].some(A=>{let g=C(m),O=C(A),I=Ae(m),L=Ae(A);return!!g&&!!O&&(g===O||(O.length>=3?g.includes(O):` ${I} `.includes(` ${L} `)))})),b=(u,i={})=>{if(f.some(g=>v(g.address,u.address)))return;let m=[`Token ${w(u.symbol)} at ${u.address} is an unverified ${i.launchpad?"launchpad token":"token"}. Use its address, not its name or symbol.`];(j(u.symbol)||j(u.name)||o.some(g=>!v(g.address,u.address)&&y(u,g)))&&m.push(`Lookalike warning: ${w(u.symbol)} at ${u.address} resembles a verified token's name or symbol.`);let A={...u,...i,kind:i.launchpad?"launchpad":"erc20",verified:!1,source:i.launchpad?`${i.launchpad} origin and on-chain metadata; not a verified token`:"On-chain metadata only",warnings:m};f.push(A),c.push(...m)};if(t&&!l.length){let u=await ae(t,n),i={};if(a===T){try{await Se(t,n)&&(i.launchpad="clanker")}catch{c.push("Clanker origin lookup was unavailable for this address.")}if(i.launchpad==="clanker")try{let A=(await J(n.context,{q:t,limit:20})).tokens.find(g=>v(g.contract_address,t));A&&(i.creator=p(A.msg_sender),i.creatorSource="Clanker indexer msg_sender")}catch{c.push("Clanker creator lookup is unavailable.")}else try{let m=await ye(n.context,t);i.launchpad="pons",i.creator=p(m.creator),i.creatorSource="Pons factory deployer"}catch{c.push("Pons launch origin could not be confirmed for this address.")}if(!i.launchpad)try{let m=await Ge(t,n);m&&(i.launchpad="pools.trade",i.creator=m,i.creatorSource="Launch transaction sender; may be a relayer")}catch{r=!0,c.push("pools.trade launch receipt lookup is unavailable; origin results are partial.")}}b(u,i)}else if(!t&&a===T){let u=new Set,i=new Set,m,A=0,g=0;try{do{if(++A>Pe)throw new h("Token search page limit reached.");let O=await J(n.context,{q:e.trim(),limit:20,...m?{cursor:m}:{}});for(let I of O.tokens){if(++g>Ve)throw new h("Token candidate limit reached.");let L=p(I.contract_address);if(!(i.has(L)||o.some(B=>v(B.address,L)))){i.add(L);try{let B=await ae(L,n);if(!d(B))continue;let Re=await Se(L,n)?{launchpad:"clanker",creator:p(I.msg_sender),creatorSource:"Clanker indexer msg_sender"}:{};b(B,Re)}catch{r=!0,c.push(`Could not read Clanker candidate ${L}; it was omitted from these partial results.`)}}}if(O.cursor&&u.has(O.cursor))throw new h("The Clanker indexer repeated a pagination cursor.");O.cursor&&u.add(O.cursor),m=O.cursor??void 0}while(m)}catch{r=!0,c.push("Clanker name search is unavailable, incomplete or reached its scan limit; results are partial.")}c.push("Pons and pools.trade require a token address; name search does not cover those launchpads.")}a===U&&c.push("Testnet lookup covers pinned tokens and explicit token addresses; stock and launchpad discovery are unavailable.");let k=u=>[...new Map(u.map(i=>[i.address.toLowerCase(),i])).values()],S=k([...l,...f]);for(let u of S)if(S.some(i=>!v(i.address,u.address)&&(C(u.symbol)===C(i.symbol)||C(u.name)===C(i.name)))){let i=`Duplicate warning: several tokens share the symbol or name of ${u.address}. Choose the intended address; do not guess from the name.`;u.warnings.push(i),c.push(i)}return l.length>1&&c.push("Several verified tokens match this search, including possible substring matches. Choose an exact address; the search does not select a quote token."),{query:w(e.trim()),chainId:a,partial:r,matches:k(l).map(Oe),unverified:k(f).map(Oe),warnings:c}}async function mt(e,n){if(typeof e!="string"||!e.trim())throw new h("Provide a token address or verified symbol; use find_token to look it up.");if(!/^[A-Za-z0-9.$_-]{1,42}$/.test(e))throw new h("Use an exact ASCII verified symbol or token address; use find_token to look it up.");let s=e,t=V(s,{strict:!1})?E(p(s)):void 0,a=Ne(n),c=t&&a.find(b=>v(b.address,t));if(c)return c;let o=s.toUpperCase()==="$OAK"?"OAK":s.toUpperCase(),r=!t&&a.find(b=>b.symbol.toUpperCase()===o),d=[],l=!1;try{d=await De(n)}catch{if(r)return r;if(!t)throw new h("The official stock list is unavailable; stock symbols cannot be checked. Use find_token and try again when the list is reachable.");l=!0}if(t){let b=d.find(u=>v(u.address,t));if(b)return n.tokenMetadata&&G(n.tokenMetadata,d),{...b,name:w(b.name)};let k=n.tokenMetadata??await n.readMetadata?.(t);if(k&&(!v(k.address,t)||k.chainId!==D[n.context.network??"mainnet"].chainId))throw new h("Token metadata does not match the requested address and chain.");if(k&&(typeof k.symbol!="string"||!k.symbol.trim()||!Number.isInteger(k.decimals)||k.decimals<0||k.decimals>255))throw new h("The contract returned invalid token metadata.");let S=k?{...k,name:k.symbol}:await ae(t,xe(n),!1);if(l){let u=C(S.symbol),i=se.get(Y(n.context.http));if(Ue.some(m=>C(m)===u)||i?.has(u))throw new h("The official stock list is unavailable; this address claims a stock ticker that cannot be checked. Try again when the list is reachable.")}return G(S,d),{...S,symbol:w(S.symbol),name:w(S.name),kind:"erc20",verified:!1,source:"On-chain metadata only",warnings:["This token address is unverified. On-chain names and symbols do not prove identity.",...l?["The official stock list is unavailable; stock identity could not be verified."]:[]]}}let f=[...a,...d].filter(b=>b.symbol.toUpperCase()===o);if(f.length!==1)throw new h(`Token symbol ${w(s)} is ${f.length?"ambiguous":"unverified"}; use find_token and choose an explicit address.`);let y=f[0];if(y.kind==="official_stock"&&s!==y.symbol)throw new h(`Use the exact official stock ticker ${w(y.symbol)}; case variants are refused.`);return y.source==="Oak fixed addresses"?y:{...y,name:w(y.name)}}export{ee as a,_e as b,te as c,ne as d,Ce as e,re as f,H as g,Be as h,G as i,dt as j,Ie as k,Fe as l,lt as m,He as n,We as o,ut as p,mt as q};
@@ -1 +0,0 @@
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"./XRDLMTBJ.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 +0,0 @@
1
- import{a as R}from"./G2LAO23N.js";import{C as W,H as X,I as q,L as Y,a as w,z as C}from"./4IOHSX3Z.js";import{a as V}from"./66F5ZH34.js";import{f as Q,g as D}from"./NWNYJ26T.js";import{b as K,d as J}from"./IX3GZMTM.js";import{b as k}from"./TI727O2H.js";import{a as i}from"./XSD5NL7J.js";import{encodeFunctionData as oe,erc20Abi as ne,getAddress as I,parseAbi as ie}from"viem";var P="https://hookr.fun/api/mcp",Z=ie(["function fill(uint256 orderId) returns (uint256)","function fillGasFloor(uint256 orderId) view returns (uint256)"]),N={type:"string",pattern:"^[1-9][0-9]*$"},ee={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Hookr v4 pool ID: 32 bytes, 0x followed by 64 hex digits."},te={type:"string",enum:["buy","sell"],description:R.enumValues({buy:"spend the pool quote token to receive the listed token",sell:"spend the listed token to receive the quote token"})},re={cursor:{...N,description:"Order ID to start from, scanning downward (newest first). Use nextCursor from the previous page; omit for the latest order."},limit:{type:"integer",minimum:1,maximum:32,description:"Maximum number of order IDs to scan in this page, 1 to 32. Default 16."}};function B(o,m){if(typeof o!="string"||!/^[1-9][0-9]*$/.test(o)||o.length>78||BigInt(o)>=1n<<256n)throw new i(`Provide ${m} as a positive decimal integer string.`);return BigInt(o)}function g(o){return Q(o,"Hookr returned an invalid read response. Retry later.")}function H(o,m,e,t){return{name:o,inputSchema:{type:"object",description:`Read ${o.replace("hookr_","Hookr ")}. No signature or transaction.`,properties:m,required:e,additionalProperties:!1},execute:async(n,s)=>{if(Object.keys(n).some(a=>!Object.hasOwn(m,a))||e.some(a=>n[a]===void 0))throw new i(`Provide the documented arguments for ${o}.`);return t(n,s)}}}function F(o){if(typeof o!="string"||!/^0x[0-9a-fA-F]{64}$/.test(o))throw new i("Provide a 32-byte Hookr poolId.");return o}function $(o,m){let e=g(o),t=g(e.key);if(typeof t.fee!="number"||!Number.isInteger(t.fee)||t.fee<0||t.fee>16777215||typeof t.tickSpacing!="number"||!Number.isInteger(t.tickSpacing)||t.tickSpacing<=0||t.tickSpacing>8388607)throw new i("Hookr pool key is invalid.");let n={currency0:I(String(t.currency0)),currency1:I(String(t.currency1)),fee:t.fee,tickSpacing:t.tickSpacing,hooks:I(String(t.hooks))},s=m??F(e.poolId);if(BigInt(n.currency0)>=BigInt(n.currency1)||!D(W(n),s))throw new i("Hookr pool key does not match its PoolId.");let a=g(e.token),u=g(e.quote),d=r=>{let b=I(String(r.address));if(typeof r.symbol!="string"||!r.symbol.trim()||typeof r.decimals!="number"||!Number.isInteger(r.decimals)||r.decimals<0||r.decimals>255||![n.currency0,n.currency1].includes(b))throw new i("Hookr listed token metadata is invalid.");return{...r,address:b,chainId:k}},c=d(a),l=d(u);if(c.address===l.address)throw new i("Hookr listed token pair is invalid.");return{...e,poolId:s,key:n,token:c,quote:l}}async function se(o,m,e){try{let t=await o.http(P,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:m,arguments:e}}),signal:AbortSignal.timeout(15e3),redirect:"error"});if(!t.ok)throw new Error(`HTTP ${t.status}`);let n=g(await t.json());if(n.error||n.id!==1)throw new Error("RPC failure");let s=g(n.result);if(s.isError)throw new Error("Tool failure");let a=g(s.structuredContent);if(a.status==="unavailable"||a.error)throw new Error("Unavailable");return a}catch{throw new i(`Hookr ${m} read is unavailable. Retry later; unavailable data is not an empty result.`)}}var O=se;function ke(o){let m=e=>H(e?"hookr_orders":"hookr_open_orders",re,[],async(t,n)=>{let s=t.limit??16;if(typeof s!="number"||!Number.isInteger(s)||s<1||s>32)throw new i("Hookr page limit must be an integer from 1 to 32.");let a=o.clientFor(k),u=await a.getBlock();if(typeof u.number!="bigint"||typeof u.timestamp!="bigint"||u.timestamp<=0n)throw new i("Hookr order reads need a valid chain block and timestamp.");let d=new Proxy(Y(a),{get(h,f,p){return f==="readContract"?y=>h.readContract({...y,blockNumber:u.number}):Reflect.get(h,f,p)}}),c={...o,clientFor:()=>d},l=await d.readContract({address:w,abi:C,functionName:"lastOrderId"});if(typeof l!="bigint"||l<0n)throw new i("Could not read the last Hookr order ID. Coverage is unknown.");let r=t.cursor===void 0?l:B(t.cursor,"cursor");if(r>l)throw new i("Hookr cursor exceeds the latest order ID. Restart pagination.");let b=[],A=new Map,x=r,S=r>BigInt(s)?r-BigInt(s):0n;for(;r>S;){let h=r--,f=X(await d.readContract({address:w,abi:C,functionName:"getOrder",args:[h]}));if(Number(f.status)===0||BigInt(f.owner)===0n)throw new i(`Hookr order #${h} is missing. Coverage is unknown.`);if(e?!D(f.owner,n):Number(f.status)!==1)continue;let p=await q(c,h,{order:f,tokens:A});if(e){b.push(p);continue}let y=null,M=null,G=null,j=null,z=BigInt(p.expiry)<u.timestamp,L=p.fillable&&!z;if(L)try{let _=await d.readContract({address:w,abi:Z,functionName:"fillGasFloor",args:[BigInt(p.orderId)]}),T=await a.estimateGas({account:n,to:w,data:oe({abi:Z,functionName:"fill",args:[BigInt(p.orderId)]}),blockNumber:u.number}),v=await a.getGasPrice();if(typeof _!="bigint"||_<0n||typeof T!="bigint"||T<=0n||typeof v!="bigint"||v<0n)throw new Error("Invalid gas data");let U=(_*6n+4n)/5n,E=T>U?T:U;y=E.toString(),M=v.toString(),G=(E*v).toString(),j=(BigInt(p.bounty)-E*v).toString()}catch{}b.push({...p,fillable:L,expired:z,economics:{gasLimit:y,gasPrice:M,estimatedGasCost:G,bountyLessEstimatedGas:j,note:"Estimate only; excludes bounty claim gas and competition. Recheck the fill preview."}})}return{chainId:k,book:w,blockNumber:u.number.toString(),chainTime:u.timestamp.toString(),orders:b,scanned:{from:x.toString(),through:(r+1n).toString()},nextCursor:r>0n?r.toString():null,complete:r===0n}});return[m(!1),m(!0),H("hookr_order",{orderId:{...N,description:R.id("Hookr limit order")}},["orderId"],async e=>q(o,B(e.orderId,"orderId"))),H("hookr_pools",{token:{type:"string",description:R.address("listed token whose pools to return")},limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of pools to return, 1 to 50."},cursor:{type:"string",pattern:"^[0-9]{1,6}$",description:"Paging cursor: the nextCursor from the previous pools page; omit for the first page."}},[],async e=>{if(e.token!==void 0)try{I(String(e.token))}catch{throw new i("Provide a valid token address.")}if(e.limit!==void 0&&(typeof e.limit!="number"||!Number.isInteger(e.limit)||e.limit<1||e.limit>50))throw new i("Pool page limit must be from 1 to 50.");if(e.cursor!==void 0&&(typeof e.cursor!="string"||!/^[0-9]{1,6}$/.test(e.cursor)))throw new i("Provide the pool nextCursor from the previous page.");let t=await O(o,"hookr_pools",e);if(!Array.isArray(t.pools))throw new i("Hookr pool coverage is unknown. Retry later.");return{...t,pools:t.pools.map(n=>$(n)),chainId:k,source:P}}),H("hookr_pool",{poolId:ee,side:te,amountIn:{...N,description:'Order input amount in base units of the input token (quote token for buy, listed token for sell); read its decimals. Example: "1000000". Give with side and minAmountOut.'},minAmountOut:{...N,description:'Minimum output in base units of the output token (listed token for buy, quote token for sell); read its decimals. Example: "1000000". Give with side and amountIn.'}},["poolId"],async e=>{let t=F(e.poolId),n=[e.side,e.amountIn,e.minAmountOut].some(y=>y!==void 0);if(n&&(e.side!=="buy"&&e.side!=="sell"||e.amountIn===void 0||e.minAmountOut===void 0))throw new i("Provide side, amountIn and minAmountOut together for order-specific bounty bounds.");let s=n?B(e.amountIn,"amountIn"):void 0,a=n?B(e.minAmountOut,"minAmountOut"):void 0;if(s!==void 0&&(s>=1n<<128n||a>=1n<<128n))throw new i("Hookr order amounts must fit uint128 base units.");let u=await O(o,"hookr_pool",{poolId:t}),d=u.listing?$(u.listing,t):void 0,c={...u,...d?{listing:d}:{},chainId:k,source:P};if(!n)return{...c,bountyBounds:{status:"requires-order-terms",note:"The keeper bounty floor depends on the order. Supply side, amountIn and minAmountOut in base units. The batch-1 0.0005 ETH observation is not a permanent floor."}};if(!d)throw new i("Hookr pool key is unavailable; bounty floor is unknown.");let l=d.key,r=g(e.side==="buy"?d.quote:d.token),b=I(String(r.address))===l.currency0,A=o.clientFor(k),x=await A.getBlock(),S=await A.readContract({address:w,abi:C,functionName:"bountyBounds",args:[l,b,s,a],blockNumber:x.number});if(!Array.isArray(S)||S.length!==3||S.some(y=>typeof y!="bigint"||y<0n||y>=1n<<128n))throw new i("Hookr bounty bounds are unavailable; the floor is unknown.");let[h,f,p]=S;return{...c,bountyBounds:{status:"available",blockNumber:x.number.toString(),token:{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",symbol:"ETH",decimals:18,chainId:k},minBounty:h.toString(),defaultBounty:f.toString(),maxBounty:p.toString(),effectiveFloor:(h>0n?h:f).toString(),note:"ETH wei for this order at this block. Oak create uses the positive minimum, or the default when minimum is zero; recheck at creation."}}}),H("hookr_quote",{poolId:ee,side:te,amountIn:{...V(),description:'Amount of the input token in base units (quote token for buy, listed token for sell); read its decimals. Example: "1000000" = 1 token with 6 decimals.'}},["poolId","side","amountIn"],async(e,t)=>{let n=F(e.poolId);if(e.side!=="buy"&&e.side!=="sell")throw new i("Hookr side must be buy or sell.");if(typeof e.amountIn!="string"||K(e.amountIn)<=0n)throw new i("Provide a positive amountIn in base units.");let s=await O(o,"hookr_pool",{poolId:n}),a=$(s.listing,n),u=g(e.side==="buy"?a.quote:a.token),d=I(String(u.address)),c=d==="0x0000000000000000000000000000000000000000"?18:await o.clientFor(k).readContract({address:d,abi:ne,functionName:"decimals"});if(typeof c!="number"||!Number.isInteger(c)||c<0||c>255||typeof u.symbol!="string")throw new i("Hookr input token metadata is unavailable.");let l=J(e.amountIn,c),r=await O(o,"hookr_quote",{poolId:n,side:e.side,amount:l,payer:t}),b=await O(o,"hookr_check_trade",{poolId:n,side:e.side,amount:l,wallet:t});return{chainId:k,source:P,input:{token:{address:d,symbol:u.symbol,decimals:c,chainId:k},amount:e.amountIn},quote:r,check:b,note:"Informational quote. Review pool rules; unknown trade checks do not authorize a trade."}})]}export{se as a,ke as b};
@@ -1 +0,0 @@
1
- import{a as O}from"./XADHV2DT.js";import{a as j}from"./USEF3QKG.js";import{j as E}from"./2GXHYI23.js";import{b as D}from"./SPJCSEKP.js";import{a as R}from"./43LI5NKJ.js";import{c as H}from"./SCG5HWMN.js";import{c as b,e as h,g as v,i as _,l as B}from"./NWNYJ26T.js";import{b as L}from"./IX3GZMTM.js";import{b as u,j as M}from"./TI727O2H.js";import{a as p}from"./XSD5NL7J.js";import{a as z}from"./JXOEJPJ4.js";import{encodeFunctionData as S,parseAbi as ne,zeroAddress as P}from"viem";import{encodeAbiParameters as F,encodeFunctionData as X,keccak256 as U,parseAbi as Y}from"viem";var I=M[u].merkl.distributor.address,A="Claim rewards on Merkl (Powered by Merkl \u2014 https://app.merkl.xyz)",W=`${A}. No claimable rewards on Robinhood Chain. Pending rewards must settle into a Merkle root before they can be claimed.`,C=Y(["function claimed(address user,address token) view returns (uint208 amount,uint48 timestamp,bytes32 merkleRoot)","function getMerkleRoot() view returns (bytes32)","function claim(address[] users,address[] tokens,uint256[] amounts,bytes32[][] proofs)"]);function J(s){return typeof s=="string"&&/^0x[0-9a-fA-F]{64}$/.test(s)}function k(){throw new p("Merkl returned an unexpected response. Please refetch rewards.")}function T(s){typeof s!="string"&&k();let d=L(s);if(d>=1n<<256n)throw new p("The Merkl reward amount exceeds the uint256 range.");return d.toString()}function ee(s){let d=[],m=new Set;for(let c of s)if((!h(c)||!h(c.chain)||!Number.isSafeInteger(c.chain.id))&&k(),c.chain.id===u){Array.isArray(c.rewards)||k();for(let r of c.rewards){if((!h(r)||typeof r.distributionLayer!="string"||!h(r.token))&&k(),r.distributionLayer!=="TREE"||(Number.isSafeInteger(r.token.chainId)||k(),r.token.chainId!==u)||(Array.isArray(r.proofs)||k(),!r.proofs.length))continue;(!r.proofs.every(J)||typeof r.token.address!="string"||typeof r.token.symbol!="string"||!r.token.symbol.trim()||typeof r.token.decimals!="number"||!Number.isInteger(r.token.decimals)||r.token.decimals<0||r.token.decimals>255)&&k(),R(r.token.address);let t=T(r.amount),n=T(r.pending);if(BigInt(t)===0n)continue;let e=r.token.address.toLowerCase();if(m.has(e))throw new p("Merkl returned duplicate token leaves. Please refetch rewards.");m.add(e),d.push({token:{address:r.token.address,chainId:u,decimals:r.token.decimals,symbol:r.token.symbol},amount:t,pending:n,proofs:r.proofs})}}return d}function re(s,d,m){let c=U(F([{type:"address"},{type:"address"},{type:"uint256"}],[s,d.token.address,BigInt(d.amount)]));for(let r of d.proofs){let t=BigInt(c)<BigInt(r)?[c,r]:[r,c];c=U(F([{type:"bytes32"},{type:"bytes32"}],t))}if(!v(c,m))throw new p("The Merkl proof does not match the active root. Please refetch rewards.")}function Z(s){if(!h(s)||Object.keys(s).length)throw new p("This Merkl tool takes no arguments and uses the connected wallet.")}async function q(s,d){let m=await K(s,d),c=new Map,r=[],t=new Set;for(let n of m)if((!h(n)||!h(n.chain)||!Number.isSafeInteger(n.chain.id))&&k(),n.chain.id===u){Array.isArray(n.rewards)||k();for(let e of n.rewards){if((!h(e)||typeof e.distributionLayer!="string"||!h(e.token)||!Number.isSafeInteger(e.token.chainId))&&k(),e.token.chainId!==u)continue;(typeof e.token.address!="string"||typeof e.token.symbol!="string"||!e.token.symbol.trim()||typeof e.token.decimals!="number"||!Number.isInteger(e.token.decimals)||e.token.decimals<0||e.token.decimals>255)&&k(),R(e.token.address);let a=T(e.amount),i=T(e.pending),o=`${e.distributionLayer}:${e.token.address.toLowerCase()}`;if(t.has(o))throw new p("Merkl returned duplicate earning rows. Please refetch rewards.");t.add(o);let l={address:e.token.address,symbol:e.token.symbol,decimals:e.token.decimals,chainId:u},f="0";if(e.distributionLayer==="TREE"){let g=await s.clientFor(u).readContract({address:I,abi:C,functionName:"claimed",args:[d,l.address]});(!Array.isArray(g)||typeof g[0]!="bigint"||g[0]<0n||g[0]>=1n<<208n)&&k(),f=g[0].toString(),c.set(l.address.toLowerCase(),f)}r.push({token:l,amount:a,pending:i,claimed:f,claimable:"0",distributionLayer:e.distributionLayer,status:e.distributionLayer!=="TREE"?"unsupported_distribution_layer":BigInt(a)>BigInt(f)?"awaiting_verified_proof":BigInt(i)>0n?"pending_settlement":"settled"})}}return{body:m,earnings:r,claimedSnapshot:c}}async function K(s,d){return R(d),H(s.http,`https://api.merkl.xyz/v4/users/${d}/rewards/summary?chainId=${u}`,{method:"GET",headers:{"User-Agent":"oak-core/merkl"}},m=>Array.isArray(m))}async function x(s,d,m){return N(s,d,m)}async function N(s,d,m,c){R(d);let r=ee(m??await K(s,d)),t=s.clientFor(u),n=[];for(let a of r){let i=c?.get(a.token.address.toLowerCase());if(i===void 0){let o=await t.readContract({address:I,abi:C,functionName:"claimed",args:[d,a.token.address]});if(!Array.isArray(o)||typeof o[0]!="bigint"||o[0]<0n||o[0]>=1n<<208n)throw new p("The Merkl claimed balance could not be read. Please try again.");i=o[0].toString()}BigInt(a.amount)<=BigInt(i)||n.push({...a,claimed:i,claimable:(BigInt(a.amount)-BigInt(i)).toString()})}if(!n.length)return[];let e=await t.readContract({address:I,abi:C,functionName:"getMerkleRoot"});if(!J(e))throw new p("The active Merkl root could not be read. Please try again.");for(let a of n)re(d,a,e);return n}var te=s=>{async function d(t){try{return await t()}catch(n){throw new p(s.plainError(n))}}function m(t){let n=t.amount.startsWith("-"),e=n?t.amount.slice(1):t.amount;return`${n?"-":""}${s.formatAmount(e,t.token.decimals)} ${z(t.token.symbol)} (${t.token.address}, chain ${t.token.chainId}, ${t.token.decimals} decimals)`}let c=t=>x(s,t);return{tools:[{name:"merkl_rewards",description:"Read claimable rewards (Powered by Merkl \u2014 https://app.merkl.xyz).",inputSchema:{type:"object",properties:{},additionalProperties:!1,description:"Read rewards (Powered by Merkl \u2014 https://app.merkl.xyz)."},execute:(t,n)=>d(async()=>{Z(t);let{body:e,earnings:a,claimedSnapshot:i}=await q(s,n),o=await N(s,n,e,i);for(let l of a){let f=o.find(g=>v(g.token.address,l.token.address)&&l.distributionLayer==="TREE");f&&(l.claimed=f.claimed,l.claimable=f.claimable,l.status="claimable")}return{earnings:a,rewards:o.map(({proofs:l,...f})=>f),summary:o.length?`${A}. Claimable reward leaves: ${o.map(l=>m({token:l.token,amount:l.claimable})).join("; ")}. Wrapped leaves may transfer underlying tokens; claim preview shows the received assets. Pending rewards appear separately in earnings and are excluded from claimable amounts.`:`${W} Earnings include pending-only and unsupported distribution layers; an unverified amount is never presented as claimable.`}})},{name:"merkl_claim",description:A,inputSchema:{type:"object",properties:{},additionalProperties:!1,description:A},execute:(t,n)=>d(async()=>{Z(t);let e=await c(n);if(!e.length)return{txs:[],summary:W};let a=[s.unsignedTx({to:I,chainId:u,value:"0",description:A,data:X({abi:C,functionName:"claim",args:[e.map(()=>n),e.map(o=>o.token.address),e.map(o=>BigInt(o.amount)),e.map(o=>o.proofs)]})})],i=await s.preview(a,n);return{txs:a,summary:`${A}. Prepared unsigned claim. Expected wallet changes: ${i.changes.length?i.changes.map(m).join("; "):"no token transfers in simulation"}. ${i.summary}`}})}],positions:t=>d(async()=>{let{body:n,earnings:e,claimedSnapshot:a}=await q(s,t),i=await N(s,t,n,a);return e.flatMap(o=>{let l=o.distributionLayer==="TREE"?i.find(V=>v(V.token.address,o.token.address)):void 0,f=BigInt(o.pending)>0n;if(!l&&!f)return[];let g="Merkl pending rewards are not yet claimable and are excluded from valuation.";return[{module:"merkl",id:`${u}:${o.token.address.toLowerCase()}${o.distributionLayer==="TREE"?"":`:${o.distributionLayer}`}`,chainId:u,assets:l?[{token:l.token,amount:l.claimable}]:[],economics:{principal:[],debt:[],backing:[],coverage:f?{complete:!1,reason:g}:{complete:!0},rewards:[...l?[E("claimable",{token:l.token,amount:l.claimable,source:"merkl.claimable",claim:{tool:"merkl_claim",args:{}}})]:[],...f?[E("unpaid",{token:o.token,amount:null,source:"merkl.pending",unknownReason:g})]:[]]},description:`${A}. Unclaimed reward leaf; wrapped rewards may transfer underlying assets. Pending rewards are excluded from valuation.`}]})})}},ge=s=>D("merkl",[te(s),O(s),G(s),j(s)]);var $=M[u].merkl.distributor.address,w=ne(["function operators(address,address) view returns (uint256)","function claimRecipient(address,address) view returns (address)","function toggleOperator(address,address)","function setClaimRecipient(address,address)","function claim(address[],address[],uint256[],bytes32[][])","function claimWithRecipient(address[],address[],uint256[],bytes32[][],address[],bytes[])"]),Q="Provide a valid address.";function y(s,d=!1){let m=_(s,Q);return d?m:B(m,Q)}var G=s=>{let d=()=>s.clientFor(u),m=async(r,t,n)=>{let e=[s.unsignedTx({to:$,chainId:u,value:"0",data:r,description:t})],a=await s.preview(e,n);return{txs:e,preview:a,summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${t} ${a.summary}`}},c=(r,t,n,e)=>({name:`merkl_${r}`,inputSchema:{type:"object",properties:t,required:n,additionalProperties:!1},execute:async(a,i)=>{try{let o=Object.keys(a).find(l=>!Object.hasOwn(t,l));if(o)throw new p(`Unsupported Merkl input: ${o}.`);return await e(a,y(i))}catch(o){throw new p(s.plainError(o))}}});return{tools:[c("claim_config",{token:{...b,description:"Reward token address; zero address selects the global setting where supported."},operator:{...b,description:"Address of the operator whose claim permission is read or changed."}},[],async(r,t)=>{let n=y(r.token??P,!0),e=y(await d().readContract({address:$,abi:w,functionName:"claimRecipient",args:[t,P]}),!0),a=y(await d().readContract({address:$,abi:w,functionName:"claimRecipient",args:[t,n]}),!0),i;if(r.operator!==void 0){let o=await d().readContract({address:$,abi:w,functionName:"operators",args:[t,y(r.operator,!0)]});if(o!==0n&&o!==1n)throw new p("Merkl returned invalid operator authorization.");i=o===1n}return{chainId:u,wallet:t,token:n,defaultRecipient:e,tokenRecipient:a,effectiveRecipient:a!==P?a:e!==P?e:t,...i===void 0?{}:{operatorEnabled:i},summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Zero recipient restores self-claims. Token overrides take precedence over the global recipient."}}),c("set_operator",{operator:{...b,description:"Address of the operator whose claim permission is read or changed."},enabled:{type:"boolean",description:"true grants claim permission; false revokes it."}},["operator","enabled"],async(r,t)=>{let n=y(r.operator,!0);if(typeof r.enabled!="boolean")throw new p("Provide enabled as boolean.");let e=await d().readContract({address:$,abi:w,functionName:"operators",args:[t,n]});if(e!==0n&&e!==1n)throw new p("Merkl returned invalid operator authorization.");return e===1n===r.enabled?{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Operator already has the requested state; no transaction needed."}:m(S({abi:w,functionName:"toggleOperator",args:[t,n]}),`${r.enabled?"Authorize":"Revoke"} Merkl claims by ${n} for ${t}. Zero operator grants permissionless claiming; configured recipients still apply. The contract toggles the observed state; preview and confirmation must remain current.`,t)}),c("set_recipient",{recipient:{...b,description:"Address to receive rewards; zero restores the default where supported."},token:{...b,description:"Reward token address; zero address selects the global setting where supported."}},["recipient"],async(r,t)=>{let n=y(r.recipient,!0),e=y(r.token??P,!0);return m(S({abi:w,functionName:"setClaimRecipient",args:[n,e]}),`Set Merkl reward recipient for ${e===P?"all tokens":e} to ${n===P?`self (${t})`:n}. This redirects future claims; token-specific overrides remain authoritative.`,t)}),c("claim_to",{recipient:{...b,description:"Address to receive rewards; zero restores the default where supported."},token:{...b,description:"Reward token address; zero address selects the global setting where supported."},data:{type:"string",pattern:"^0x([0-9a-fA-F]{2})*$",maxLength:16386,description:"Optional recipient callback data as 0x-prefixed hex bytes."}},["recipient"],async(r,t)=>{let n=y(r.recipient),e=r.token===void 0?void 0:y(r.token),a=r.data??"0x";if(typeof a!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(a)||a.length>16386)throw new p("Provide callback data as at most 8192 hexadecimal bytes.");let i=(await x(s,t)).filter(o=>!e||v(o.token.address,e));return i.length?m(S({abi:w,functionName:"claimWithRecipient",args:[i.map(()=>t),i.map(o=>o.token.address),i.map(o=>BigInt(o.amount)),i.map(o=>o.proofs),i.map(()=>n),i.map(()=>a)]}),`Claim ${i.map(o=>`${o.claimable} ${o.token.symbol} base units (token ${o.token.address}, decimals ${o.token.decimals})`).join("; ")} to ${n}, overriding saved claim recipients for this claim only. Callback data for each leaf: ${a}. Inspect all callback effects in preview.`,t):{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. No verified claimable rewards for the selected token."}}),c("claim_for",{user:{...b,description:"Address of the user whose rewards are claimed."},token:{...b,description:"Reward token address; zero address selects the global setting where supported."}},["user"],async(r,t)=>{let n=y(r.user),e=r.token===void 0?void 0:y(r.token),a=(await x(s,n)).filter(i=>!e||v(i.token.address,e));return a.length?m(S({abi:w,functionName:"claim",args:[a.map(()=>n),a.map(i=>i.token.address),a.map(i=>BigInt(i.amount)),a.map(i=>i.proofs)]}),`Claim Merkl rewards for ${n}; caller ${t} pays gas. The user's saved recipients control payment. Claim authorization and actual receipts must pass preview.`,t):{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. No verified claimable rewards for this user."}})]}};export{G as a,x as b,te as c,ge as d};
@@ -1 +0,0 @@
1
- import{a as f}from"./Q3Q3YHEX.js";import{a as k}from"./G2LAO23N.js";import{c as l}from"./NWNYJ26T.js";import{b as p}from"./TI727O2H.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};