@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
@@ -0,0 +1 @@
1
+ import{c as Q}from"./KYANIEPX.js";import{b as X}from"./5AO2QPWE.js";import{b as Z}from"./EYE3ZAJB.js";import{i as ee}from"./AG66NM3J.js";import{a as Y}from"./2QQ5CGQI.js";import{b as z}from"./B7HVPHSS.js";import{a as N,b as I,c as R,d as $,g as D,h as k,k as _,l as x,n as B,p as W,r as E,s as U,t as q,v as F,x as J,y as G}from"./BIFANUTV.js";import{a as y}from"./X5V2Z2NM.js";import{b as V}from"./SPJCSEKP.js";import{a as H}from"./43LI5NKJ.js";import{c as K,e as T,g as w}from"./NWNYJ26T.js";import{a as g,d as L}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{Buffer as te}from"node:buffer";import{decodeEventLog as re,encodeFunctionData as O,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. ${N} It needs gas.`,j="https://eips.ethereum.org/EIPS/eip-8004#registration-v1",ue={type:"object",required:["type","name","description","image","services","x402Support","active","registrations"],properties:{type:{const:j,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}=k(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!==j&&r("type",`use "${j}"`),(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!==I))];a!==!1&&s.push(I);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}=k(e),d=x(t),o=e.clientFor(a),r=await o.readContract({address:n,abi:y,functionName:"ownerOf",args:[d]}).catch(l=>{throw L(l)?new g(`Agent ${d} does not exist in this ERC-8004 registry: the owner lookup reverted. Check the agent ID.`):l});H(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,I]})]);if(H(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:N}}catch(a){throw new g(e.plainError(a))}}async function Ve(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}=k(e),u=await F(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}=k(e);return e.unsignedTx({to:n,chainId:a,value:"0",data:O({abi:y,functionName:"setMetadata",args:[t,I,R]}),description:`Set mutable oak.registrar metadata to oak for agent ${t}.`})}async function ae(e,t,a,n){let{registry:d}=k(e),o=x(n.agentId),r=await F(e,t,a,O({abi:y,functionName:"setMetadata",args:[o,I,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!==I||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 Ie(e,t){let{chainId:a,registry:n}=k(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 ke(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===I)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=E(t);if(!n)return;let{registryId:d}=k(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}=k(e);H(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?[]:ke(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?O({abi:y,functionName:"setAgentURI",args:[r,s]}):O({abi:y,functionName:"register",args:[s,[...m,{metadataKey:I,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,status:"verified",hashes:[a.transactionHash],summary:`Verified ERC-8004 registration for agent #${f.agentId}. Transaction checked: ${a.transactionHash}. ${f.summary}${f.uri===""?" Note: the profile URI is empty; the identity is valid. Attach a profile later with erc8004_update.":""}`})}return l&&a.metadataTransactionHash!==void 0?c(await ae(e,a.metadataTransactionHash,n,f)):c(f)}if(!t){let f=await Ie(e,n);if(f){let b={...f,registrationResumed:!0},h=E(f.uri),v=Array.isArray(h?.tags)&&h.tags.includes(I);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.`,!1)}async function Re(e,t){let a=await M(e,t.agentId),{chainId:n,registry:d}=k(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:{...D,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:$}:{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:$,metadataKeys:{type:"array",maxItems:16,items:{type:"string",minLength:1,maxLength:128},description:"Also read these onchain metadata keys."},operator:{...K,description:"Also report whether this address is approved for all of the owner's agents."}}},n=>Re(e,n))]}},De=e=>V("erc8004",[Te(e),Q(e),X(e),Y(e),z(e),ee(e)]);export{Ke as a,Ve as b,oe as c,Te as d,De as e};
@@ -1 +1 @@
1
- import{q as p}from"./3A2IKFTV.js";import{b as c,e as d}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{b as a}from"./JXOEJPJ4.js";var f=/^(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?\.)+[\p{L}]{2,}$/u,m=/^did:[a-z0-9]+:[A-Za-z0-9._%:;=@/?#-]{1,512}$/,u=/^[^\s@<>()[\]\\,;:"]{1,64}@[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?\.[A-Za-z]{2,}$/,w=/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}:[-.%a-zA-Z0-9]{1,128}$/,l=["web","a2a","mcp","oasf"],P=["web","A2A","MCP","OASF","ENS","DID","email","agentWallet"];function s(e,r){if(typeof e!="string"||!e.trim()||e.length>2048||a(e))throw new n(`Provide a valid profile ${r}.`);return e}function h(e){return/^[a-z][a-z0-9+.-]*:\/\//i.test(e)}function z(e){if(!d(e))throw new n("Provide valid profile services.");let r=s(e.name,"service name"),t=s(e.endpoint,"service endpoint");e.version!==void 0&&s(e.version,"service version");let i=r.toLowerCase(),o=()=>{try{p(t,"Profile service endpoint")}catch{throw new n("Profile service endpoint must be an HTTPS or IPFS URI without credentials.")}};if(l.includes(i))return o();if(i==="ens"){if(!f.test(t))throw new n("An ENS service endpoint must be an ENS name such as agent.eth.");return}if(i==="did"){if(!m.test(t))throw new n("A DID service endpoint must be a DID such as did:web:agent.example.");return}if(i==="email"){if(!u.test(t))throw new n("An email service endpoint must be an email address.");return}if(i==="agentwallet"||i==="wallet"){if(!w.test(t)&&!c.test(t))throw new n("A wallet service endpoint must be a CAIP-10 account such as eip155:4663:0x\u2026 or an 0x address.");return}if(h(t)||/^(?:ipfs|https):/.test(t))return o();if(!(f.test(t)||m.test(t)||u.test(t)||w.test(t)))throw new n("Profile service endpoint must be an HTTPS or IPFS URI, an ENS name, a DID, an email address or a CAIP-10 account.")}export{P as a,z as b};
1
+ import{q as p}from"./BIFANUTV.js";import{b as c,e as d}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{b as a}from"./JXOEJPJ4.js";var f=/^(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?\.)+[\p{L}]{2,}$/u,m=/^did:[a-z0-9]+:[A-Za-z0-9._%:;=@/?#-]{1,512}$/,u=/^[^\s@<>()[\]\\,;:"]{1,64}@[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?\.[A-Za-z]{2,}$/,w=/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}:[-.%a-zA-Z0-9]{1,128}$/,l=["web","a2a","mcp","oasf"],P=["web","A2A","MCP","OASF","ENS","DID","email","agentWallet"];function s(e,r){if(typeof e!="string"||!e.trim()||e.length>2048||a(e))throw new n(`Provide a valid profile ${r}.`);return e}function h(e){return/^[a-z][a-z0-9+.-]*:\/\//i.test(e)}function z(e){if(!d(e))throw new n("Provide valid profile services.");let r=s(e.name,"service name"),t=s(e.endpoint,"service endpoint");e.version!==void 0&&s(e.version,"service version");let i=r.toLowerCase(),o=()=>{try{p(t,"Profile service endpoint")}catch{throw new n("Profile service endpoint must be an HTTPS or IPFS URI without credentials.")}};if(l.includes(i))return o();if(i==="ens"){if(!f.test(t))throw new n("An ENS service endpoint must be an ENS name such as agent.eth.");return}if(i==="did"){if(!m.test(t))throw new n("A DID service endpoint must be a DID such as did:web:agent.example.");return}if(i==="email"){if(!u.test(t))throw new n("An email service endpoint must be an email address.");return}if(i==="agentwallet"||i==="wallet"){if(!w.test(t)&&!c.test(t))throw new n("A wallet service endpoint must be a CAIP-10 account such as eip155:4663:0x\u2026 or an 0x address.");return}if(h(t)||/^(?:ipfs|https):/.test(t))return o();if(!(f.test(t)||m.test(t)||u.test(t)||w.test(t)))throw new n("Profile service endpoint must be an HTTPS or IPFS URI, an ENS name, a DID, an email address or a CAIP-10 account.")}export{P as a,z as b};
@@ -1 +1 @@
1
- import{b as T}from"./5RXALTDT.js";import{b as p,c as C,j as S}from"./TI727O2H.js";import{a as l}from"./XSD5NL7J.js";import{AsyncLocalStorage as W}from"node:async_hooks";import{custom as X}from"viem";import{createPublicClient as U,custom as x,defineChain as q}from"viem";var A="https://rpc.mainnet.chain.robinhood.com",D="https://api.oakagentkit.org/v1/rpc",E=8453,ce=[p,E];function j(e){return e===p?A:e===E?D:void 0}var B="oak-core/0.1.0",z=S[4663].ponsClaims.multicall3.address,L=new Set(["eth_sendTransaction","eth_sendRawTransaction","eth_sign","personal_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","wallet_sendTransaction","wallet_sign"]);function O(e=p,t=A){if(!Number.isSafeInteger(e)||e<=0)throw new l("Provide a positive integer chain ID.");let n=e===p?"Robinhood Chain":e===C?"Robinhood Chain Testnet":`Chain ${e}`;return q({id:e,name:n,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:[t]}},...e===p?{contracts:{multicall3:{address:z}}}:{}})}function ue(e=p,t){if(t?.chain&&t.chain.id===e)return t.chain.contracts?.multicall3?.address;if(!(!Number.isSafeInteger(e)||e<=0))return O(e).contracts?.multicall3?.address}function G(e,t,n){let o=e?.trim()||n?.rpcUrl?.trim()||n?.rpcUrls?.[t]?.trim(),r=t===p?(process.env[`OAK_RPC_URL_${t}`]??process.env.OAK_RPC_URL)?.trim():t===C?(process.env.OAK_TESTNET_RPC_URL??process.env.OAK_RPC_URL)?.trim():process.env[`OAK_RPC_URL_${t}`]?.trim(),s=o||r||j(t);if(!s)throw new l(`No RPC URL configured for chain ${t}.`);if(s===D&&!n?.transport)throw new l(`Hosted RPC needs a local session transport; configure OAK_RPC_URL_${t} for a direct core/server client.`);if((n?.requireKeyedRpc??process.env.NODE_ENV==="production")&&t===p&&s===A)throw new l("Production requires a keyed OAK_RPC_URL.");return s}var J=1e4;async function v(e,t=J){if(!Number.isFinite(t)||t<=0||t>3e4)throw new l("RPC timeout must be greater than zero and at most 30000 ms.");let n=new AbortController,o;try{return await Promise.race([new Promise((r,s)=>{o=setTimeout(()=>{s(new l("The RPC request timed out. Please try again.")),n.abort()},t)}),e(n.signal)])}finally{clearTimeout(o)}}function V(e,t=p,n){let o=typeof e=="object"&&e!==null,r=o?e:n??{},s=typeof e=="string"?e:r.rpcUrl,i=o?r.chainId??t:t;if(!Number.isSafeInteger(i)||i<=0)throw new l("Provide a positive integer chain ID.");if(r.timeoutMs!==void 0&&(!Number.isFinite(r.timeoutMs)||r.timeoutMs<=0||r.timeoutMs>3e4))throw new l("RPC timeout must be greater than zero and at most 30000 ms.");let d=G(s,i,r),a=O(i,d);if(r.transport){let c=r.transport({chain:a,retryCount:0});return U({chain:a,transport:x({request:f=>{if(L.has(f.method)||/^(eth_send|eth_sign|personal_sign|wallet_)/i.test(f.method))throw new l("Read-only RPC client does not allow this method.");return v(()=>c.request(f),r.timeoutMs)}},{retryCount:0})})}let u=M({url:d,chainId:i,fetch:r.fetch,userAgent:r.userAgent?.trim()||B,retries:r.retries,retryDelayMs:r.retryDelayMs,maxRetryDelayMs:r.maxRetryDelayMs,timeoutMs:r.timeoutMs,fallbackUrls:r.rpcFallbackUrls?.[i]??r.fallbackRpcUrls??P(process.env[`OAK_RPC_FALLBACK_URLS_${i}`]??(i===p?process.env.OAK_RPC_FALLBACK_URLS:void 0))})({chain:a,retryCount:0}),b=x({request:c=>{if(L.has(c.method)||/^(eth_send|eth_sign|personal_sign|wallet_)/i.test(c.method))throw new l("Read-only RPC client does not allow this method.");return u.request(c)}},{retryCount:0});return U({chain:a,transport:b})}function le(e={}){let t=new Map;return n=>{let o=t.get(n);if(o)return o;let r=V(e.rpcUrls?.[n],n,e);return t.set(n,r),r}}var y=class extends l{},Q=16,k=new Map;async function Y(e,t,n){t.throwIfAborted();let o=new URL(e).origin,r=k.get(o);r||(r={active:0,waiters:new Set},k.set(o,r));let s=r;s.active<Q?s.active++:await new Promise((i,d)=>{let a=()=>{t.removeEventListener("abort",h),i()},h=()=>{s.waiters.delete(a),t.removeEventListener("abort",h),d(t.reason)};s.waiters.add(a),t.addEventListener("abort",h,{once:!0})});try{return t.throwIfAborted(),await n()}finally{let i=s.waiters.values().next().value;i?(s.waiters.delete(i),i()):--s.active===0&&k.delete(o)}}function I(e){let t=[];for(;e&&typeof e=="object"&&!t.includes(e);)t.push(e),e=e.cause;return t}function Z(e){return I(e).find(t=>t instanceof y)}function ee(e){if(!Z(e))for(let t of I(e)){let n=Number(t.status??t.code);if(n===429||n>=500&&n<=599)return{status:n,delay:typeof t.retryAfterMs=="number"?t.retryAfterMs:void 0};if(/rate.?limit|too many requests/i.test(String(t.message??"")))return{status:429}}}async function N(e,t,n={},o){let r=T();r&&r!==o&&(o=o?AbortSignal.any([r,o]):r);let s=n.retries??3,i=n.retryDelayMs??250,d=n.maxRetryDelayMs??2e3;if(!Number.isInteger(s)||s<0||s>5||!Number.isFinite(i)||i<0||!Number.isFinite(d)||d<0||d>3e4)throw new l("RPC retries must be 0 to 5; backoff must be non-negative and at most 30000 ms.");for(let a=0;;a++){o?.throwIfAborted();try{return await e()}catch(h){o?.throwIfAborted();let u=ee(h);if(!u)throw h;let b=Math.min(d,i*2**a),c=Math.max(Math.min(d,b+Math.floor(Math.random()*b/4)),u.delay??0);if(a>=s||c>d){let f=u.status===429?"public RPC rate-limited":`RPC returned HTTP ${u.status}`,m=u.delay?` Retry after ${Math.max(1,Math.ceil(u.delay/1e3))} seconds.`:"";throw new y(`${f}, retried ${a} times (${t}).${m} ${u.status===429?"The RPC rate limit remains active. ":""}Configure a keyed OAK_RPC_URL or comma-separated OAK_RPC_FALLBACK_URLS for this chain.`)}await new Promise((f,m)=>{let w=()=>{clearTimeout(R),m(o?.reason)},R=setTimeout(()=>{o?.removeEventListener("abort",w),f()},c);o?.addEventListener("abort",w,{once:!0}),o?.aborted&&w()})}}}function P(e){if(e===void 0||e.trim()==="")return[];let t=e.split(",").map(n=>n.trim());if(t.length>4)throw new l("Configure at most four ordered fallback RPC URLs.");for(let n of t){let o;try{o=new URL(n)}catch{throw new l("Fallback RPC URLs must use HTTP or HTTPS.")}if(!["http:","https:"].includes(o.protocol))throw new l("Fallback RPC URLs must use HTTP or HTTPS.")}return t}var g=new Map;async function te(e,t,n){let o=g.get(e)??Promise.resolve(),r,s=new Promise(d=>{r=d}),i=o.then(()=>s);g.set(e,i);try{return await o,n.throwIfAborted(),await t()}finally{r(),g.get(e)===i&&g.delete(e)}}var K=new W,F=new Map,H=e=>{let t=new URL(e).origin,n=F.get(t);return n||(n={interactive:0},F.set(t,n)),n};async function re(e,t){let n=K.getStore(),o=[...new Set(e.map(H))].filter(r=>!n?.has(r));o.forEach(r=>{r.interactive++});try{let r=o.flatMap(s=>s.background?[s.background.catch(()=>{})]:[]);return r.length&&await Promise.all(r),await t()}finally{o.forEach(r=>{r.interactive--})}}async function ye(e,t,n=o=>new Promise(r=>{setTimeout(r,o).unref()})){let o=H(e);for(;o.interactive||o.background;)await n(100);let r=Promise.resolve().then(()=>K.run(new Set([o]),t));o.background=r;try{return await r}finally{o.background===r&&(o.background=void 0)}}function M(e){let t=[...new Set([e.url,...e.fallbackUrls??[]])];P(t.slice(1).join(","));let n=new Set,o=0;return X({request:({method:r,params:s})=>re(t,()=>v(async i=>{let d=T(),a=d?AbortSignal.any([d,i]):i;a.throwIfAborted();let h;for(let u of t){a.throwIfAborted();let b=async(c,f=[])=>Y(u,a,async()=>{a.throwIfAborted();let m=await(e.fetch??globalThis.fetch)(u,{method:"POST",redirect:"error",signal:a,headers:{"content-type":"application/json","user-agent":e.userAgent??"oak-core/0.1.0"},body:JSON.stringify({jsonrpc:"2.0",id:++o,method:c,params:f})});if(!m.ok){let R=m.headers.get("retry-after"),_=R===null?void 0:/^\d+(\.\d+)?$/.test(R.trim())?Number(R)*1e3:Math.max(0,Date.parse(R)-Date.now()),$=typeof _=="number"&&Number.isFinite(_)?_:void 0;throw await m.body?.cancel(),m.status===429||m.status>=500?Object.assign(new Error("Transient RPC HTTP failure"),{status:m.status,retryAfterMs:$}):new y(`RPC returned HTTP ${m.status} (${c}).`)}let w;try{w=await m.json()}catch{throw new y("The RPC endpoint returned malformed JSON.")}if(w.error)throw Object.assign(new Error(w.error.message??"RPC error"),{code:w.error.code,data:w.error.data});return w.result});try{if(u!==t[0]&&r!=="eth_chainId"&&(!n.has(u)||r==="eth_sendRawTransaction")){let m=await N(()=>b("eth_chainId"),"eth_chainId",e,a);if(Number(m)!==e.chainId)throw new y("RPC chain does not match the requested chain.");n.add(u)}let c=()=>N(()=>b(r,s),r,e,a),f=await(r==="eth_simulateV1"?te(u,c,a):c());if(r==="eth_chainId")if(Number(f)!==e.chainId){if(u!==t[0])throw new y("RPC chain does not match the requested chain.")}else n.add(u);return f}catch(c){if(a.throwIfAborted(),h=c,!(c instanceof y)||!/rate-limited|HTTP 5\d\d|chain does not match/.test(c.message))throw c}}throw h},e.timeoutMs))},{retryCount:0})}export{y as a,Q as b,Z as c,N as d,P as e,re as f,ye as g,M as h,A as i,D as j,E as k,ce as l,j as m,B as n,z as o,O as p,ue as q,J as r,v as s,V as t,le as u};
1
+ import{b as T}from"./5RXALTDT.js";import{b as p,c as C,j as S}from"./EWZFZUVF.js";import{a as l}from"./XSD5NL7J.js";import{AsyncLocalStorage as W}from"node:async_hooks";import{custom as X}from"viem";import{createPublicClient as U,custom as x,defineChain as q}from"viem";var A="https://rpc.mainnet.chain.robinhood.com",D="https://api.oakagentkit.org/v1/rpc",E=8453,ce=[p,E];function j(e){return e===p?A:e===E?D:void 0}var B="oak-core/0.1.0",z=S[4663].ponsClaims.multicall3.address,L=new Set(["eth_sendTransaction","eth_sendRawTransaction","eth_sign","personal_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","wallet_sendTransaction","wallet_sign"]);function O(e=p,t=A){if(!Number.isSafeInteger(e)||e<=0)throw new l("Provide a positive integer chain ID.");let n=e===p?"Robinhood Chain":e===C?"Robinhood Chain Testnet":`Chain ${e}`;return q({id:e,name:n,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:[t]}},...e===p?{contracts:{multicall3:{address:z}}}:{}})}function ue(e=p,t){if(t?.chain&&t.chain.id===e)return t.chain.contracts?.multicall3?.address;if(!(!Number.isSafeInteger(e)||e<=0))return O(e).contracts?.multicall3?.address}function G(e,t,n){let o=e?.trim()||n?.rpcUrl?.trim()||n?.rpcUrls?.[t]?.trim(),r=t===p?(process.env[`OAK_RPC_URL_${t}`]??process.env.OAK_RPC_URL)?.trim():t===C?(process.env.OAK_TESTNET_RPC_URL??process.env.OAK_RPC_URL)?.trim():process.env[`OAK_RPC_URL_${t}`]?.trim(),s=o||r||j(t);if(!s)throw new l(`No RPC URL configured for chain ${t}.`);if(s===D&&!n?.transport)throw new l(`Hosted RPC needs a local session transport; configure OAK_RPC_URL_${t} for a direct core/server client.`);if((n?.requireKeyedRpc??process.env.NODE_ENV==="production")&&t===p&&s===A)throw new l("Production requires a keyed OAK_RPC_URL.");return s}var J=1e4;async function v(e,t=J){if(!Number.isFinite(t)||t<=0||t>3e4)throw new l("RPC timeout must be greater than zero and at most 30000 ms.");let n=new AbortController,o;try{return await Promise.race([new Promise((r,s)=>{o=setTimeout(()=>{s(new l("The RPC request timed out. Please try again.")),n.abort()},t)}),e(n.signal)])}finally{clearTimeout(o)}}function V(e,t=p,n){let o=typeof e=="object"&&e!==null,r=o?e:n??{},s=typeof e=="string"?e:r.rpcUrl,i=o?r.chainId??t:t;if(!Number.isSafeInteger(i)||i<=0)throw new l("Provide a positive integer chain ID.");if(r.timeoutMs!==void 0&&(!Number.isFinite(r.timeoutMs)||r.timeoutMs<=0||r.timeoutMs>3e4))throw new l("RPC timeout must be greater than zero and at most 30000 ms.");let d=G(s,i,r),a=O(i,d);if(r.transport){let c=r.transport({chain:a,retryCount:0});return U({chain:a,transport:x({request:f=>{if(L.has(f.method)||/^(eth_send|eth_sign|personal_sign|wallet_)/i.test(f.method))throw new l("Read-only RPC client does not allow this method.");return v(()=>c.request(f),r.timeoutMs)}},{retryCount:0})})}let u=M({url:d,chainId:i,fetch:r.fetch,userAgent:r.userAgent?.trim()||B,retries:r.retries,retryDelayMs:r.retryDelayMs,maxRetryDelayMs:r.maxRetryDelayMs,timeoutMs:r.timeoutMs,fallbackUrls:r.rpcFallbackUrls?.[i]??r.fallbackRpcUrls??P(process.env[`OAK_RPC_FALLBACK_URLS_${i}`]??(i===p?process.env.OAK_RPC_FALLBACK_URLS:void 0))})({chain:a,retryCount:0}),b=x({request:c=>{if(L.has(c.method)||/^(eth_send|eth_sign|personal_sign|wallet_)/i.test(c.method))throw new l("Read-only RPC client does not allow this method.");return u.request(c)}},{retryCount:0});return U({chain:a,transport:b})}function le(e={}){let t=new Map;return n=>{let o=t.get(n);if(o)return o;let r=V(e.rpcUrls?.[n],n,e);return t.set(n,r),r}}var y=class extends l{},Q=16,k=new Map;async function Y(e,t,n){t.throwIfAborted();let o=new URL(e).origin,r=k.get(o);r||(r={active:0,waiters:new Set},k.set(o,r));let s=r;s.active<Q?s.active++:await new Promise((i,d)=>{let a=()=>{t.removeEventListener("abort",h),i()},h=()=>{s.waiters.delete(a),t.removeEventListener("abort",h),d(t.reason)};s.waiters.add(a),t.addEventListener("abort",h,{once:!0})});try{return t.throwIfAborted(),await n()}finally{let i=s.waiters.values().next().value;i?(s.waiters.delete(i),i()):--s.active===0&&k.delete(o)}}function I(e){let t=[];for(;e&&typeof e=="object"&&!t.includes(e);)t.push(e),e=e.cause;return t}function Z(e){return I(e).find(t=>t instanceof y)}function ee(e){if(!Z(e))for(let t of I(e)){let n=Number(t.status??t.code);if(n===429||n>=500&&n<=599)return{status:n,delay:typeof t.retryAfterMs=="number"?t.retryAfterMs:void 0};if(/rate.?limit|too many requests/i.test(String(t.message??"")))return{status:429}}}async function N(e,t,n={},o){let r=T();r&&r!==o&&(o=o?AbortSignal.any([r,o]):r);let s=n.retries??3,i=n.retryDelayMs??250,d=n.maxRetryDelayMs??2e3;if(!Number.isInteger(s)||s<0||s>5||!Number.isFinite(i)||i<0||!Number.isFinite(d)||d<0||d>3e4)throw new l("RPC retries must be 0 to 5; backoff must be non-negative and at most 30000 ms.");for(let a=0;;a++){o?.throwIfAborted();try{return await e()}catch(h){o?.throwIfAborted();let u=ee(h);if(!u)throw h;let b=Math.min(d,i*2**a),c=Math.max(Math.min(d,b+Math.floor(Math.random()*b/4)),u.delay??0);if(a>=s||c>d){let f=u.status===429?"public RPC rate-limited":`RPC returned HTTP ${u.status}`,m=u.delay?` Retry after ${Math.max(1,Math.ceil(u.delay/1e3))} seconds.`:"";throw new y(`${f}, retried ${a} times (${t}).${m} ${u.status===429?"The RPC rate limit remains active. ":""}Configure a keyed OAK_RPC_URL or comma-separated OAK_RPC_FALLBACK_URLS for this chain.`)}await new Promise((f,m)=>{let w=()=>{clearTimeout(R),m(o?.reason)},R=setTimeout(()=>{o?.removeEventListener("abort",w),f()},c);o?.addEventListener("abort",w,{once:!0}),o?.aborted&&w()})}}}function P(e){if(e===void 0||e.trim()==="")return[];let t=e.split(",").map(n=>n.trim());if(t.length>4)throw new l("Configure at most four ordered fallback RPC URLs.");for(let n of t){let o;try{o=new URL(n)}catch{throw new l("Fallback RPC URLs must use HTTP or HTTPS.")}if(!["http:","https:"].includes(o.protocol))throw new l("Fallback RPC URLs must use HTTP or HTTPS.")}return t}var g=new Map;async function te(e,t,n){let o=g.get(e)??Promise.resolve(),r,s=new Promise(d=>{r=d}),i=o.then(()=>s);g.set(e,i);try{return await o,n.throwIfAborted(),await t()}finally{r(),g.get(e)===i&&g.delete(e)}}var K=new W,F=new Map,H=e=>{let t=new URL(e).origin,n=F.get(t);return n||(n={interactive:0},F.set(t,n)),n};async function re(e,t){let n=K.getStore(),o=[...new Set(e.map(H))].filter(r=>!n?.has(r));o.forEach(r=>{r.interactive++});try{let r=o.flatMap(s=>s.background?[s.background.catch(()=>{})]:[]);return r.length&&await Promise.all(r),await t()}finally{o.forEach(r=>{r.interactive--})}}async function ye(e,t,n=o=>new Promise(r=>{setTimeout(r,o).unref()})){let o=H(e);for(;o.interactive||o.background;)await n(100);let r=Promise.resolve().then(()=>K.run(new Set([o]),t));o.background=r;try{return await r}finally{o.background===r&&(o.background=void 0)}}function M(e){let t=[...new Set([e.url,...e.fallbackUrls??[]])];P(t.slice(1).join(","));let n=new Set,o=0;return X({request:({method:r,params:s})=>re(t,()=>v(async i=>{let d=T(),a=d?AbortSignal.any([d,i]):i;a.throwIfAborted();let h;for(let u of t){a.throwIfAborted();let b=async(c,f=[])=>Y(u,a,async()=>{a.throwIfAborted();let m=await(e.fetch??globalThis.fetch)(u,{method:"POST",redirect:"error",signal:a,headers:{"content-type":"application/json","user-agent":e.userAgent??"oak-core/0.1.0"},body:JSON.stringify({jsonrpc:"2.0",id:++o,method:c,params:f})});if(!m.ok){let R=m.headers.get("retry-after"),_=R===null?void 0:/^\d+(\.\d+)?$/.test(R.trim())?Number(R)*1e3:Math.max(0,Date.parse(R)-Date.now()),$=typeof _=="number"&&Number.isFinite(_)?_:void 0;throw await m.body?.cancel(),m.status===429||m.status>=500?Object.assign(new Error("Transient RPC HTTP failure"),{status:m.status,retryAfterMs:$}):new y(`RPC returned HTTP ${m.status} (${c}).`)}let w;try{w=await m.json()}catch{throw new y("The RPC endpoint returned malformed JSON.")}if(w.error)throw Object.assign(new Error(w.error.message??"RPC error"),{code:w.error.code,data:w.error.data});return w.result});try{if(u!==t[0]&&r!=="eth_chainId"&&(!n.has(u)||r==="eth_sendRawTransaction")){let m=await N(()=>b("eth_chainId"),"eth_chainId",e,a);if(Number(m)!==e.chainId)throw new y("RPC chain does not match the requested chain.");n.add(u)}let c=()=>N(()=>b(r,s),r,e,a),f=await(r==="eth_simulateV1"?te(u,c,a):c());if(r==="eth_chainId")if(Number(f)!==e.chainId){if(u!==t[0])throw new y("RPC chain does not match the requested chain.")}else n.add(u);return f}catch(c){if(a.throwIfAborted(),h=c,!(c instanceof y)||!/rate-limited|HTTP 5\d\d|chain does not match/.test(c.message))throw c}}throw h},e.timeoutMs))},{retryCount:0})}export{y as a,Q as b,Z as c,N as d,P as e,re as f,ye as g,M as h,A as i,D as j,E as k,ce as l,j as m,B as n,z as o,O as p,ue as q,J as r,v as s,V as t,le as u};
@@ -0,0 +1 @@
1
+ import{e as u,f as a,i as n}from"./UMY6SP7C.js";import{a as i}from"./XSD5NL7J.js";import{zeroAddress as c}from"viem";function d(e,o){if(u(o,["id","buy","sell","recipient"],["id","buy","sell","recipient"]),o.id!=="swap-cut")throw new i("Choose Hook Block swap-cut.");let r=a(o.buy,8),t=a(o.sell,8),s=n(o.recipient);if(!r&&!t||r>100n||t>100n||s===c||e.royaltyTo!==c&&e.royaltyTo.toLowerCase()!==s.toLowerCase()||(e.potEveryNBuys&(131071|7<<24))!==0)throw new i("Swap Cut requires rates 0\u2013100 with at least one positive rate, an unoccupied carrier and one compatible nonzero recipient.");return{...e,royaltyTo:s,potEveryNBuys:e.potEveryNBuys|1<<30|Number(r)|Number(t<<7n)|65536}}function m(e,o){return`Swap Cut: buy ${(e.potEveryNBuys&127)*1e3} and sell ${(e.potEveryNBuys>>7&127)*1e3} gross quote pips; Hookr ${o} receives ceil(carved charge * ${e.protocolShareBps}/10000) quote base units; ${e.royaltyTo} receives the carved charge minus that share as a claim. Each carved charge is floor(total collected Rules quote fee * this charge pips / final quote-take pips); residual rounding stays with Hookr.`}export{d as a,m as b};
@@ -1 +1 @@
1
- import{e as g,f as T,g as k,i as E}from"./MQXSCNUL.js";import{c as _,d as S}from"./N624NR7Y.js";import{g as h}from"./NWNYJ26T.js";import{b as f}from"./TI727O2H.js";import{a as i}from"./XSD5NL7J.js";import{decodeAbiParameters as P,encodeAbiParameters as B,getAddress as d}from"viem";var D=d("0xcEF685D4796FA80F71a97e803D2c0b6719F1b4E2"),H=[{name:"items",type:"tuple[]",components:[{...k[0],name:"offer"},{name:"ratifierData",type:"bytes"}]}],G=l=>({tools:[{name:"longbow_fixed_offers",inputSchema:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of offers to return, 1 to 50 (default 20). Newest-expiring offers come first."},marketId:{type:"string",description:"Optional Midnight market id as 0x followed by 64 hex digits (bytes32); only offers in that market are returned."}}},execute:async o=>{try{let a=o.limit??20;if(Object.keys(o).some(s=>!["limit","marketId"].includes(s))||!Number.isInteger(a)||Number(a)<1||Number(a)>50||o.marketId!==void 0&&(typeof o.marketId!="string"||!/^0x[0-9a-f]{64}$/i.test(o.marketId)))throw new i("Use limit 1..50 and an optional exact bytes32 marketId.");let p=await l.http("https://longbow.credit/api/fixed/offers",{method:"GET",redirect:"error"});if(!p.ok)throw new i(`Longbow fixed order book returned HTTP ${p.status}; offers are unavailable.`);let x=await p.text();if(x.length>2e6)throw new i("Longbow fixed order book exceeds the supported response size.");let t=JSON.parse(x);if(!t||t.chainId!==f||typeof t.mempool!="string"||d(t.mempool)!==D||!Array.isArray(t.publications)||t.publications.length>1e3||!Number.isSafeInteger(t.head)||Number(t.head)<0)throw new i("Longbow fixed indexer does not match the pinned chain, mempool or publication schema.");let c=[],u=[],y=0;for(let[s,m]of t.publications.entries())try{if(!m||typeof m!="object")throw new i("Invalid publication.");let r=m,n=r.itemsAbi;if(!Number.isSafeInteger(r.blockNumber)||Number(r.blockNumber)<0||Number(r.blockNumber)>Number(t.head))throw new i("Invalid publication block.");if(typeof n!="string"||!/^0x[0-9a-f]+$/i.test(n)||n.length>1e6||n.length<130||BigInt(`0x${n.slice(2,66)}`)!==32n||BigInt(`0x${n.slice(66,130)}`)>512n)throw new i("Invalid or oversized publication encoding.");let[w]=P(H,n);if(w.length!==r.items)throw new i("Publication count mismatch.");for(let b of w){y++;let e=b.offer;if(e.market.chainId!==BigInt(f)||d(e.market.midnight)!==g||b.ratifierData.length>32770)throw new i("Publication market or proof is unqualified.");let I=E(e.market);if(o.marketId!==void 0&&!h(I,String(o.marketId)))continue;let N=[_,S].find(O=>h(O.address,e.market.loanToken));c.push({marketId:I,offer:B(k,[e]),ratifierData:b.ratifierData,maker:d(e.maker),buy:e.buy,maturity:e.market.maturity.toString(),start:e.start.toString(),expiry:e.expiry.toString(),tick:e.tick.toString(),loanToken:N??null,directBuilderSupported:!!N&&/^0x0{40}$/i.test(e.callback)&&e.callbackData==="0x"&&T.includes(d(e.ratifier)),sourceBlock:String(r.blockNumber)})}}catch(r){u.push({publication:s,reason:l.plainError(r)})}return c.sort((s,m)=>BigInt(s.expiry)>BigInt(m.expiry)?-1:BigInt(s.expiry)<BigInt(m.expiry)?1:0),{chainId:f,midnight:g,mempool:D,indexedHead:String(t.head),decodedCount:y,matchingCount:c.length,offers:c.slice(0,Number(a)),incomplete:u.length>0||t.skipped!==0,rejected:u,warning:"Historical off-chain publications, not executable quotes. Expiry, consumption, authorization, signatures and liquidity are not verified here. Use morpho_midnight_status and preview morpho_midnight_take with the returned exact offer/proof; callback offers need a separately qualified builder. This read publishes nothing and creates no signature."}}catch(a){throw new i(l.plainError(a))}}}]});export{D as a,H as b,G as c};
1
+ import{e as g,f as T,g as k,i as E}from"./R5UOFPDO.js";import{c as _,d as S}from"./GV6FZ6UG.js";import{g as h}from"./NWNYJ26T.js";import{b as f}from"./EWZFZUVF.js";import{a as i}from"./XSD5NL7J.js";import{decodeAbiParameters as P,encodeAbiParameters as B,getAddress as d}from"viem";var D=d("0xcEF685D4796FA80F71a97e803D2c0b6719F1b4E2"),H=[{name:"items",type:"tuple[]",components:[{...k[0],name:"offer"},{name:"ratifierData",type:"bytes"}]}],G=l=>({tools:[{name:"longbow_fixed_offers",inputSchema:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of offers to return, 1 to 50 (default 20). Newest-expiring offers come first."},marketId:{type:"string",description:"Optional Midnight market id as 0x followed by 64 hex digits (bytes32); only offers in that market are returned."}}},execute:async o=>{try{let a=o.limit??20;if(Object.keys(o).some(s=>!["limit","marketId"].includes(s))||!Number.isInteger(a)||Number(a)<1||Number(a)>50||o.marketId!==void 0&&(typeof o.marketId!="string"||!/^0x[0-9a-f]{64}$/i.test(o.marketId)))throw new i("Use limit 1..50 and an optional exact bytes32 marketId.");let p=await l.http("https://longbow.credit/api/fixed/offers",{method:"GET",redirect:"error"});if(!p.ok)throw new i(`Longbow fixed order book returned HTTP ${p.status}; offers are unavailable.`);let x=await p.text();if(x.length>2e6)throw new i("Longbow fixed order book exceeds the supported response size.");let t=JSON.parse(x);if(!t||t.chainId!==f||typeof t.mempool!="string"||d(t.mempool)!==D||!Array.isArray(t.publications)||t.publications.length>1e3||!Number.isSafeInteger(t.head)||Number(t.head)<0)throw new i("Longbow fixed indexer does not match the pinned chain, mempool or publication schema.");let c=[],u=[],y=0;for(let[s,m]of t.publications.entries())try{if(!m||typeof m!="object")throw new i("Invalid publication.");let r=m,n=r.itemsAbi;if(!Number.isSafeInteger(r.blockNumber)||Number(r.blockNumber)<0||Number(r.blockNumber)>Number(t.head))throw new i("Invalid publication block.");if(typeof n!="string"||!/^0x[0-9a-f]+$/i.test(n)||n.length>1e6||n.length<130||BigInt(`0x${n.slice(2,66)}`)!==32n||BigInt(`0x${n.slice(66,130)}`)>512n)throw new i("Invalid or oversized publication encoding.");let[w]=P(H,n);if(w.length!==r.items)throw new i("Publication count mismatch.");for(let b of w){y++;let e=b.offer;if(e.market.chainId!==BigInt(f)||d(e.market.midnight)!==g||b.ratifierData.length>32770)throw new i("Publication market or proof is unqualified.");let I=E(e.market);if(o.marketId!==void 0&&!h(I,String(o.marketId)))continue;let N=[_,S].find(O=>h(O.address,e.market.loanToken));c.push({marketId:I,offer:B(k,[e]),ratifierData:b.ratifierData,maker:d(e.maker),buy:e.buy,maturity:e.market.maturity.toString(),start:e.start.toString(),expiry:e.expiry.toString(),tick:e.tick.toString(),loanToken:N??null,directBuilderSupported:!!N&&/^0x0{40}$/i.test(e.callback)&&e.callbackData==="0x"&&T.includes(d(e.ratifier)),sourceBlock:String(r.blockNumber)})}}catch(r){u.push({publication:s,reason:l.plainError(r)})}return c.sort((s,m)=>BigInt(s.expiry)>BigInt(m.expiry)?-1:BigInt(s.expiry)<BigInt(m.expiry)?1:0),{chainId:f,midnight:g,mempool:D,indexedHead:String(t.head),decodedCount:y,matchingCount:c.length,offers:c.slice(0,Number(a)),incomplete:u.length>0||t.skipped!==0,rejected:u,warning:"Historical off-chain publications, not executable quotes. Expiry, consumption, authorization, signatures and liquidity are not verified here. Use morpho_midnight_status and preview morpho_midnight_take with the returned exact offer/proof; callback offers need a separately qualified builder. This read publishes nothing and creates no signature."}}catch(a){throw new i(l.plainError(a))}}}]});export{D as a,H as b,G as c};
@@ -0,0 +1 @@
1
+ import{e as s,f as i}from"./UMY6SP7C.js";import{a as t}from"./XSD5NL7J.js";function p(o,n){if(s(n,["id","ceiling","floor"],["id","ceiling","floor"]),n.id!=="storm-fee")throw new t("Choose Hook Block storm-fee.");let e=i(n.ceiling,8),r=i(n.floor,8);if(!e||e>200n||r>e||e*500n*BigInt(o.protocolShareBps)<10000n||o.potEveryNBuys&1<<22||o.potMinBuyQuote>>63n&(1n<<22n)-1n)throw new t("Storm Fee needs a ceiling of 1\u2013200, floor no higher than ceiling, and an unoccupied field with a nonzero protocol slice.");return{...o,potEveryNBuys:o.potEveryNBuys|1<<30|1<<22,potMinBuyQuote:o.potMinBuyQuote|e<<63n|r<<71n}}function l(o,n){let e=o.potMinBuyQuote>>63n&255n;return`Storm Fee: ${(o.potMinBuyQuote>>71n&255n)*500n}\u2013${e*500n} gross pips, tempo 0; Hookr ${n} receives floor(charged pips * ${o.protocolShareBps}/10000) in quote and in-range LPs receive the remainder as LP fee, subject to LP fee room.`}export{p as a,l as b};
@@ -1 +1 @@
1
- import{a as u,f as I,g}from"./6JCEJ66K.js";import{a as P}from"./43LI5NKJ.js";import{m as B}from"./NWNYJ26T.js";import{b as e,j as _}from"./TI727O2H.js";import{a as m}from"./XSD5NL7J.js";import{erc20Abi as C,getAddress as l}from"viem";var b=l(u.staking),f=l(u.agentVault),p=l(u.orbio),w={address:l(_[e].orbio.credit.address),chainId:e,symbol:"CREDIT",decimals:6},D=g.find(o=>o.type==="event"&&o.name==="AgentLaunched"),$=10000000n,A=o=>B(o,"Orbio returned an invalid on-chain amount.");async function F(o,N){try{P(N);let i=l(N),n=o.clientFor(e);if(await n.getChainId()!==e)throw new m(`Orbio requires chain ${e}.`);let a=await n.getBlockNumber(),[s,v,E,S,T]=await Promise.all([n.readContract({address:p,abi:C,functionName:"decimals",blockNumber:a}),n.readContract({address:b,abi:I,functionName:"positionOf",args:[i],blockNumber:a}),n.readContract({address:b,abi:I,functionName:"settledOf",args:[i],blockNumber:a}),n.readContract({address:p,abi:C,functionName:"balanceOf",args:[i],blockNumber:a}),n.readContract({address:w.address,abi:C,functionName:"balanceOf",args:[i],blockNumber:a})]);if(typeof s!="number"||!Number.isInteger(s)||s<0||s>36)throw new m("Orbio returned invalid ORBIO decimals.");let h={address:p,chainId:e,symbol:"ORBIO",decimals:s},R=[],d=(t,r,c,k)=>{let O=A(c);O!==0n&&R.push({module:"orbio",id:`${e}:${t}`,chainId:e,assets:[{token:{...r},amount:O.toString()}],description:`${k}: ${O} ${r.symbol} base units (${r.decimals} decimals).`})};d(`${b}:principal`,h,v,"Staked ORBIO principal; withdraw with orbio_unstake"),d(`${b}:credit`,w,E,"Claim settled staking CREDIT with orbio_claim_staking"),d(`${p}:held`,h,S,"Held ORBIO in this wallet"),d(`${w.address}:held`,w,T,"Held unactivated CREDIT in this wallet");let y=new Set;for(let t=0n;t<=a;t+=$){let r=t+$-1n<a?t+$-1n:a,c=await n.getLogs({address:f,event:D,args:{owner:i},fromBlock:t,toBlock:r,strict:!0});for(let k of c)y.add(A(k.args.agentId))}for(let t of y){let[r,c]=await Promise.all([n.readContract({address:f,abi:g,functionName:"stakeOf",args:[t],blockNumber:a}),n.readContract({address:f,abi:g,functionName:"unlocksAt",args:[t],blockNumber:a})]);d(`${f}:agent:${t}`,h,r,`ORBIO principal staked for owned agent ${t}; principal unlock time ${A(c)} (Unix seconds); withdraw with orbio_agent_withdraw_principal`)}return R}catch(i){throw new m(o.plainError(i))}}export{F as a};
1
+ import{a as u,f as I,g}from"./6JCEJ66K.js";import{a as P}from"./43LI5NKJ.js";import{m as B}from"./NWNYJ26T.js";import{b as e,j as _}from"./EWZFZUVF.js";import{a as m}from"./XSD5NL7J.js";import{erc20Abi as C,getAddress as l}from"viem";var b=l(u.staking),f=l(u.agentVault),p=l(u.orbio),w={address:l(_[e].orbio.credit.address),chainId:e,symbol:"CREDIT",decimals:6},D=g.find(o=>o.type==="event"&&o.name==="AgentLaunched"),$=10000000n,A=o=>B(o,"Orbio returned an invalid on-chain amount.");async function F(o,N){try{P(N);let i=l(N),n=o.clientFor(e);if(await n.getChainId()!==e)throw new m(`Orbio requires chain ${e}.`);let a=await n.getBlockNumber(),[s,v,E,S,T]=await Promise.all([n.readContract({address:p,abi:C,functionName:"decimals",blockNumber:a}),n.readContract({address:b,abi:I,functionName:"positionOf",args:[i],blockNumber:a}),n.readContract({address:b,abi:I,functionName:"settledOf",args:[i],blockNumber:a}),n.readContract({address:p,abi:C,functionName:"balanceOf",args:[i],blockNumber:a}),n.readContract({address:w.address,abi:C,functionName:"balanceOf",args:[i],blockNumber:a})]);if(typeof s!="number"||!Number.isInteger(s)||s<0||s>36)throw new m("Orbio returned invalid ORBIO decimals.");let h={address:p,chainId:e,symbol:"ORBIO",decimals:s},R=[],d=(t,r,c,k)=>{let O=A(c);O!==0n&&R.push({module:"orbio",id:`${e}:${t}`,chainId:e,assets:[{token:{...r},amount:O.toString()}],description:`${k}: ${O} ${r.symbol} base units (${r.decimals} decimals).`})};d(`${b}:principal`,h,v,"Staked ORBIO principal; withdraw with orbio_unstake"),d(`${b}:credit`,w,E,"Claim settled staking CREDIT with orbio_claim_staking"),d(`${p}:held`,h,S,"Held ORBIO in this wallet"),d(`${w.address}:held`,w,T,"Held unactivated CREDIT in this wallet");let y=new Set;for(let t=0n;t<=a;t+=$){let r=t+$-1n<a?t+$-1n:a,c=await n.getLogs({address:f,event:D,args:{owner:i},fromBlock:t,toBlock:r,strict:!0});for(let k of c)y.add(A(k.args.agentId))}for(let t of y){let[r,c]=await Promise.all([n.readContract({address:f,abi:g,functionName:"stakeOf",args:[t],blockNumber:a}),n.readContract({address:f,abi:g,functionName:"unlocksAt",args:[t],blockNumber:a})]);d(`${f}:agent:${t}`,h,r,`ORBIO principal staked for owned agent ${t}; principal unlock time ${A(c)} (Unix seconds); withdraw with orbio_agent_withdraw_principal`)}return R}catch(i){throw new m(o.plainError(i))}}export{F as a};
@@ -0,0 +1 @@
1
+ import{a as we}from"./HC3QFA5I.js";import{c as pe}from"./QFUSCK5C.js";import{a as te}from"./B75SS7H6.js";import{a as F,b as M}from"./7WXAS54T.js";import{a as ee,b as ye}from"./CFPJDLTZ.js";import{a as L}from"./5N6YJFFA.js";import{a as Te}from"./P4UQGWCP.js";import{a as x}from"./43LI5NKJ.js";import{b as he,c as be}from"./SCG5HWMN.js";import{a as me,b as J,c as q}from"./5HCXZWUH.js";import{q as fe,s as P,t as ke}from"./EZUQMTLE.js";import{b as w,c as K,d as H,e as le,j as U,k as ue,t as D}from"./EWZFZUVF.js";import{a as b}from"./XSD5NL7J.js";import{a as A,b as $,c as Q}from"./JXOEJPJ4.js";import{decodeFunctionResult as Be,encodeFunctionData as Ue,erc20Abi as ne,getAddress as T,isAddress as z,parseAbi as Y}from"viem";var X="https://api.robinhood.com/rhj/assets",Fe={address:F,symbol:"ETH",decimals:18,chainId:w},se={address:T(ue),symbol:"USDG",decimals:le,chainId:w},oe={address:T(U[4663].tokens.WETH.address),symbol:"WETH",decimals:18,chainId:w},Ie={address:T(U[4663].meridian.CollateralToken_USDe.address),symbol:"USDe",decimals:18,chainId:w},de=[{address:T(ee.chop),symbol:"CHOP",decimals:18,chainId:w},{address:T(ee.oakLog.address),symbol:"chOAK",decimals:18,chainId:w},{address:T(ye),symbol:"schOAK",decimals:18,chainId:w}],W=(e,n)=>de.find(s=>s.chainId===n&&s.address.toLowerCase()===e.toLowerCase());function B(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var $e="ASSET_STATUS_ACTIVE",ge="TRADING_STATUS_UNTRADABLE";function Ke(e){if(e.status!==void 0&&e.status!==$e)return`the issuer lists it as ${typeof e.status=="string"&&/^[A-Z_]{1,64}$/.test(e.status)?e.status:"not active"}`;if(!B(e.tradingCapabilities))return;let n=Object.values(e.tradingCapabilities).filter(B);return n.length>0&&n.every(s=>s.whole===ge&&s.fractional===ge)?"the issuer lists it as untradable in every session":void 0}function He(e,n,s){if(!B(e))return[];let t=e;if(typeof t.tokenSymbol!="string"||!t.tokenSymbol.trim())return[];if(!Array.isArray(t.deployments))return[];if(t.deployments.length>100)throw new b("Official stock deployment list exceeds the lookup limit.");let a=t.tokenSymbol;if(!/^[A-Za-z0-9.$_-]{1,32}$/.test(a))throw new b(`Invalid official stock ticker ${A(a)}.`);if(t.tokenDecimals!==void 0&&(typeof t.tokenDecimals!="number"||!Number.isInteger(t.tokenDecimals)||t.tokenDecimals<0||t.tokenDecimals>255))throw new b("Official stock asset has invalid token decimals.");let r=typeof t.tokenDecimals=="number"?t.tokenDecimals:18,o=Ke(t),c=[];for(let i of t.deployments){if(!B(i))continue;let d=i;if(d.chainId===n){if(typeof d.contractAddress!="string"||!z(d.contractAddress,{strict:!1}))throw new b("Official stock deployment has an invalid contract address.");c.push({address:T(d.contractAddress),symbol:a,decimals:r,chainId:n,...s.includeNames&&typeof t.tokenName=="string"&&t.tokenName.trim()?{name:t.tokenName.trim()}:{},...o?{notTradable:o}:{}})}}return c}function G(e,n=w,s={}){let t=Array.isArray(e)?e:B(e)&&Array.isArray(e.assets)?e.assets:void 0;if(!t)throw new b("Official stock asset list response is malformed.");let a=new Map,r=new Map;if(t.length>1e4)throw new b("Official stock asset list exceeds the lookup limit.");for(let o of t){let c;try{c=He(o,n,s)}catch{continue}for(let i of c){let d=i.address.toLowerCase(),m=i.symbol.toUpperCase(),l=r.get(m);if(!s.allowAmbiguousSymbols&&l&&l!==d)throw new b(`Ambiguous official stock ticker ${A(i.symbol)} across multiple addresses.`);let u=a.get(d);if(u&&(u.symbol!==i.symbol||u.decimals!==i.decimals))throw new b(`Conflicting official stock identity at ${i.address}.`);r.set(m,d),a.set(d,u?.notTradable&&!i.notTradable?{...i,notTradable:u.notTradable}:i)}}return[...a.values()]}function We(e,n){if(typeof e.address!="string"||!z(e.address,{strict:!1}))return!1;let s=e.chainId??w,t=e.address.toLowerCase();return n.some(a=>a.chainId===s&&a.address.toLowerCase()===t&&a.symbol===e.symbol)}function j(e,n){x(e.address);let s=e.chainId??w,t=T(e.address),a=t.toLowerCase(),r=N(e.symbol),o=n.find(i=>i.chainId===s&&i.address.toLowerCase()===a),c=n.find(i=>i.chainId===s&&N(i.symbol)===r);if(o){if(e.symbol!==o.symbol)throw new b(`Token at ${t} does not match official stock ticker ${A(o.symbol)} (received ${A(e.symbol)}).`);if(e.decimals!==void 0&&e.decimals!==o.decimals)throw new b(`Token ${A(o.symbol)} at ${t} does not match official decimals ${o.decimals}.`);return o}if(c)throw new b(`Token symbol ${A(e.symbol)} at ${t} does not match the official stock contract address ${c.address}.`);return{address:t,symbol:e.symbol.trim(),decimals:e.decimals??18,chainId:s}}var Ge=["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"],ae=new WeakMap,Ae=new WeakMap,Le=3e4,Se=Object.freeze([]),E;function bt(){if(!E)return Se;let e=Date.now()-E.started;return e>=0&&e<Le?E.tokens:Se}var re=new WeakMap;function V(e,n){return(re.get(e)??P)(n)}async function De(e){let n=e?.http??he(),s=e?.url??X,t=e?.chainId??w,a=q(n),r=Ae.get(a);r||(r=new me(Le),Ae.set(a,r));let{value:o,started:c}=await V(n,()=>r.read(`${t}:${s}`,async()=>{let d=await P(l=>be(a,s,{method:"GET",signal:l},u=>B(u)||Array.isArray(u))),m=G(d,t,{allowAmbiguousSymbols:!0});if(t===w&&m.length===0)throw new b("Official stock asset list has no mainnet deployments; retry when the list is available.");return d})),i=G(o,t,e);if(t===w&&s===X&&(!E||c>=E.started||Date.now()<E.started)&&(E={started:c,tokens:Object.freeze(G(o,t,{allowAmbiguousSymbols:!0}).map(d=>Object.freeze(d)))}),t===w){let d=ae.get(a);d||(d=new Set,ae.set(a,d));for(let m of i)d.add(N(m.symbol))}return i}var Ve=Y(["function aggregate3((address target, bool allowFailure, bytes callData)[] calls) payable returns ((bool success, bytes returnData)[] returnData)"]);function Ce(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 Xe(e){return e instanceof b?/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 je(e,n,s){if(typeof e.getCode=="function")try{let t=await e.getCode({address:n});return!t||t==="0x"}catch{return Ce(s)}return Ce(s)}async function ie(e,n,s){if(n.length===0)return[];let t=await Promise.allSettled(n.map(a=>e.readContract({address:a.address,abi:ne,functionName:"balanceOf",args:[s]})));if(t.every(a=>a.status==="rejected")&&t[0]?.status==="rejected"&&Xe(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 r=typeof a.value=="bigint"?a.value:BigInt(a.value);return r>=0n?{ok:!0,amount:r}:{ok:!1}}catch{return{ok:!1}}})}async function Pe(e,n,s,t){if(s.length===0)return[];let a=fe(n,e);if(!a)return ie(e,s,t);let r=s.map(c=>({target:c.address,allowFailure:!0,callData:Ue({abi:ne,functionName:"balanceOf",args:[t]})})),o;try{o=await e.readContract({address:a,abi:Ve,functionName:"aggregate3",args:[r]})}catch(c){if(await je(e,a,c))return ie(e,s,t);throw c}if(!Array.isArray(o)||o.length!==s.length)throw new b("Multicall3 aggregate3 returned an invalid result list.");return o.map(c=>{let i=c,d=Array.isArray(i)?i[0]:i?.success,m=Array.isArray(i)?i[1]:i?.returnData;if(!d||typeof m!="string"||m==="0x")return{ok:!1};try{let l=Be({abi:ne,functionName:"balanceOf",data:m}),u=typeof l=="bigint"?l:BigInt(l);return u>=0n?{ok:!0,amount:u}:{ok:!1}}catch{return{ok:!1}}})}async function yt(e,n={}){x(e);let s=T(e),t=n.chainId??w,a=n.client??ke(n.rpcUrl,t),r=[],o;if(n.stockTokens)r=[...n.stockTokens];else if(n.stockAssetsPayload!==void 0)r=G(n.stockAssetsPayload,t,{allowAmbiguousSymbols:!0});else if(n.includeStockTokens!==!1&&t!==K)try{r=await De({http:n.http,url:n.stockAssetsUrl,chainId:t,allowAmbiguousSymbols:!0})}catch(f){if(n.tokens)throw f;o="Stock token balances are unavailable right now: Oak could not read the official stock list. ETH and the other tokens shown are current. Stock tokens are missing from this list, not zero; ask for balances again shortly."}if(n.tokens)for(let f of n.tokens)j(f,r);let c=t===w?[se,oe,Ie,...n.oakTokenAddress||process.env.OAK_TOKEN_ADDRESS?[{address:T(n.oakTokenAddress??process.env.OAK_TOKEN_ADDRESS),symbol:"OAK",decimals:H,chainId:t}]:[]]:t===K?[{...se,address:T(D.testnet.usdg),chainId:t},{...oe,address:T(D.testnet.weth),chainId:t},...n.oakTokenAddress?[{address:T(n.oakTokenAddress),symbol:"OAK",decimals:H,chainId:t}]:[]]:[],i=t===w&&n.includePoolTokens!==!1?[...de,...Te.vaults.flatMap(f=>[{address:T(f.tokenAddress),symbol:T(f.tokenAddress),decimals:f.tokenDecimals,chainId:t},{address:T(f.earnContractAddress),symbol:T(f.earnContractAddress),decimals:18,chainId:t}])]:[],d=new Set(i.map(f=>f.address.toLowerCase())),m=[],l=new Set;for(let f of[...c,...r,...n.tokens??[],...i]){if(f.chainId!==t||M(f.address)===F)continue;let y=W(f.address,t)??j(f,r),g=y.address.toLowerCase();l.has(g)||(l.add(g),m.push(y))}let[u,p]=await Promise.all([a.getBalance({address:s}),Pe(a,t,m,s)]),S=[],k={address:F,symbol:"ETH",decimals:18,chainId:t};(u>0n||n.includeZero)&&S.push({token:k,amount:u.toString()});for(let f=0;f<m.length;f++){let y=m[f],g=c.some(O=>v(O.address,y.address))||r.some(O=>v(O.address,y.address))||W(y.address,t)?y.symbol:A(y.symbol),C=p[f]??{ok:!1};if(!C.ok){S.push({token:{address:y.address,symbol:g,decimals:y.decimals,chainId:y.chainId},amount:"unavailable"});continue}let I=C.amount;if(I>0n&&d.has(y.address.toLowerCase())&&!W(y.address,t))try{let[O,R]=await Promise.all([L(a,t,y.address,"symbol"),L(a,t,y.address,"decimals")]);g=A(O),y.decimals=R}catch{}(I>0n||n.includeZero)&&S.push({token:{address:y.address,symbol:g,decimals:y.decimals,chainId:y.chainId},amount:I.toString()})}let h="Outside token discovery is disabled; no receipt time window was scanned, so only ETH, pinned tokens and official stock tokens are listed here.";if(n.includeReceivedTokens===!0){let f=await Ze(s,{client:a});h=f.notice;try{let y=f.addresses.filter(C=>!l.has(C.toLowerCase())),g=await Ye(s,y,{client:a,chainId:t});S.push(...g.map(({token:C,amount:I,note:O})=>({token:C,amount:I,verified:!1,note:`Received from outside Oak's lists; not verified.${O?` ${O}`:""}`}))),h+=ze(g)}catch{h+=" Discovery is incomplete: outside balances or token metadata are unavailable; known balances are retained."}}return S.length||S.push({token:k,amount:u.toString()}),S[0]={...S[0],discoveryNotice:h,...o?{stockNotice:o}:{}},S}var _=200;async function Ze(e,n){x(e);let s,t,a="the last 10,000 blocks (approximately 17 minutes at 100 ms per block; UTC boundaries unavailable)",r=()=>`Outside token discovery covers only ERC-20 receipts in ${a}; older holdings may be missing.`;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(u=>P(()=>n.client.getBlock({blockNumber:u}),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=Y(["event Transfer(address indexed from,address indexed to,uint256 value)"])[0],i=(await P(()=>n.client.getLogs({event:o,args:{to:T(e)},fromBlock:s,toBlock:t,strict:!0}),3e3)).filter(l=>!l.removed&&typeof l.args.value=="bigint"&&l.args.value>0n);i.every(l=>typeof l.blockNumber=="bigint")&&i.sort((l,u)=>l.blockNumber<u.blockNumber?-1:l.blockNumber>u.blockNumber?1:Number(l.logIndex??0)-Number(u.logIndex??0));let d=new Set;for(let l of i){let u=T(l.address);d.delete(u),d.add(u)}let m=[...d];return m.length>_?{addresses:m.slice(-_),fromBlock:s,toBlock:t,incomplete:!0,notice:`${r()} Discovery is incomplete: more than ${_} token contracts sent to this wallet in that window, so only the ${_} most recent are checked.`}:{addresses:m,fromBlock:s,toBlock:t,incomplete:!1,notice:r()}}catch{return{addresses:[],fromBlock:s,toBlock:t,incomplete:!0,notice:`${r()} Discovery is incomplete: RPC receipt reads are unavailable; known balances are retained. Retry balances when RPC logs are available.`}}}function ze(e){let n=e.filter(s=>s.unreadable).length;return n?n===1?" 1 token's symbol or decimals could not be read; its note says what is missing.":` ${n} tokens' symbols or decimals could not be read; their notes say what is missing.`:""}async function Ye(e,n,s){if(x(e),n.length>1e4)throw new b("Journal token discovery exceeds the balance lookup limit.");let t=[...new Set(n.map(o=>(x(o),T(o))))].filter(o=>M(o)!==F).map(o=>({address:o,symbol:o,decimals:0,chainId:s.chainId})),a=[];for(let o=0;o<t.length;o+=_){let c=t.slice(o,o+_);try{a.push(...await Pe(s.client,s.chainId,c,T(e)))}catch{a.push(...await ie(s.client,c,T(e)))}}let r=t.flatMap((o,c)=>{let i=a[c];return i.ok&&i.amount===0n?[]:[{token:o,amount:i.ok?i.amount.toString():"unavailable"}]});return Promise.all(r.map(async({token:o,amount:c})=>{let i=W(o.address,s.chainId);if(i)return{token:{...i},amount:c};let[d,m]=await Promise.all([L(s.client,s.chainId,o.address,"symbol").catch(()=>{}),L(s.client,s.chainId,o.address,"decimals").catch(()=>{})]);if(d!==void 0&&m!==void 0)return{token:{...o,symbol:A(d),decimals:m},amount:c};let l=[...d===void 0?["symbol"]:[],...m===void 0?["decimals"]:[]],u=l.length===2?"This token's symbol and decimals could not be read. It is shown by its contract address, and the amount is in raw base units.":d===void 0?"This token's symbol could not be read. It is shown by its contract address.":"This token's decimals could not be read. The amount is in raw base units.";return{token:{...o,symbol:d===void 0?o.address:A(d),decimals:m??0},amount:c,unreadable:l,note:u}}))}var v=(e,n)=>e.toLowerCase()===n.toLowerCase(),N=e=>Q(e.normalize("NFKC")).toLowerCase().replace(/[^\p{L}\p{N}]/gu,""),Oe=e=>Q(e.normalize("NFKC")).toLowerCase().match(/[\p{L}\p{N}]+/gu)?.join(" ")??"";function Ee(e){let n=e.context.network??"mainnet",{chainId:s,usdg:t,weth:a}=D[n],r=(o,c,i)=>({...o,address:M(T(o.address)),name:c,kind:i,verified:!0,source:"Oak fixed addresses",warnings:[]});return[r({...Fe,chainId:s},"Ether","native"),r({...se,address:t,chainId:s},"Global Dollar","stablecoin"),r({...oe,address:a,chainId:s},"Wrapped Ether","wrapped"),...n==="mainnet"?[r(Ie,"USDe","stablecoin")]:[],...n==="mainnet"?de.map(o=>r(o,o.symbol==="CHOP"?"Chop":o.symbol==="chOAK"?"Chop OAK log":"Chop OAK staked LP",o.symbol==="CHOP"?"erc20":"wrapped")):[],...e.oakTokenAddress?[r({address:e.oakTokenAddress,symbol:"OAK",decimals:H,chainId:s},"Oak","oak")]:[]]}async function Re(e){if(e.context.network==="testnet")return[];let n=e.officialStockTokens??await De({http:e.context.http,includeNames:!0,allowAmbiguousSymbols:!0});return n.filter(s=>We(s,n)).map(s=>({...s,name:s.name??s.symbol,kind:"official_stock",verified:!0,source:X,warnings:[],identityNote:"Official Robinhood stock token: this address matches Robinhood's published list. The name and symbol are text from that list."}))}async function ce(e,n,s=!0){let{chainId:t}=D[n.context.network??"mainnet"],a=n.context.clientFor(t);if(await a.getChainId()!==t)throw new b(`Token lookup requires Robinhood Chain ${t}.`);let[r,o,c]=await Promise.all([V(a,()=>L(a,t,e,"name",n.blockNumber)).catch(i=>{if(s)throw i;return""}),V(a,()=>L(a,t,e,"symbol",n.blockNumber)),V(a,()=>L(a,t,e,"decimals",n.blockNumber))]);if(typeof r!="string"||s&&!r.trim()||typeof o!="string"||!o.trim()||!Number.isInteger(c)||c<0||c>255)throw new b("The contract returned invalid token metadata.");return{address:T(e),name:r||o,symbol:o,decimals:c,chainId:t}}async function Ne(e,n){let s=await n.context.clientFor(w).readContract({address:U[w].clanker.factory.address,abi:Y(["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 Qe(e,n){let s=n.context.clientFor(w),t=U[w].poolsTrade,a=[t.instantLaunchStrategyFeesOn.address,t.instantLaunchStrategyFeesOff.address],r=Y(["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(),c=new Set,i=0,d=0;for(let m=63127652n;m<=o;m+=10000000n){if(++i>xe)throw new b("Token origin scan limit reached.");let l=m+9999999n>o?o:m+9999999n,u=await s.getLogs({address:a,event:r,args:{token:e},fromBlock:m,toBlock:l,strict:!0});for(let p of u){if(p.removed||!a.some(k=>v(k,p.address))||!p.args.token||!v(p.args.token,e)||!p.transactionHash||c.has(p.transactionHash))continue;if(c.add(p.transactionHash),++d>20)throw new b("Token origin receipt limit reached.");let S=await s.getTransactionReceipt({hash:p.transactionHash});if(we(S).some(k=>v(k.token,e)))return T(S.from)}}}var xe=5,Je=100,qe=500,et=3e4;function Me(e){let n=Date.now()+et,s=0,t=new Map,a=o=>{let c=n-Date.now();if(c<=0)throw new b("Token lookup time budget reached; results are partial.");return P(o,Math.min(1e4,c))},r=J((o,c)=>a(async i=>{let d=await e.context.http(o,{...c,signal:i});return new Proxy(d,{get(m,l){if(l==="json")return()=>a(()=>m.json());let u=Reflect.get(m,l,m);return typeof u=="function"?u.bind(m):u}})}),e.context.http);return re.set(r,a),{...e,context:{...e.context,http:r,clientFor:o=>{if(!t.has(o)){let c=e.context.clientFor(o),i=d=>{if(++s>qe)throw new b("Token lookup RPC budget reached; results are partial.");return a(d)};t.set(o,J(new Proxy(c,{get(d,m){let l=Reflect.get(d,m);return typeof l!="function"?l:(...u)=>i(()=>l.apply(d,u))}}),c)),re.set(t.get(o),i)}return t.get(o)}}}}function Z(e){return e.source==="Oak fixed addresses"?e:e.kind==="official_stock"&&e.verified&&e.source===X?{...e,name:$(e.name)?A(e.name):e.name}:{...e,symbol:A(e.symbol),name:A(e.name)}}async function Tt(e,n){if(n=Me(n),typeof e!="string"||e.length>256||!N(e))throw new b("Provide a token name, symbol or address to find_token.");let s=N(e),t=z(e.trim(),{strict:!1})?M(T(e.trim())):void 0,{chainId:a}=D[n.context.network??"mainnet"],r=[],o=Ee(n),c=!1;try{o.push(...await Re(n))}catch{c=!0,r.push("The official stock list is unavailable; results are partial and stock identities and lookalikes could not be checked.")}let i=k=>t?v(k.address,t):N(k.symbol).includes(s)||N(k.name).includes(s),d=o.filter(i),m=[],l=(k,h)=>[k.symbol,k.name??""].some(f=>[h.symbol,h.name].some(y=>{let g=N(f),C=N(y),I=Oe(f),O=Oe(y);return!!g&&!!C&&(g===C||(C.length>=3?g.includes(C):` ${I} `.includes(` ${O} `)))})),u=(k,h={})=>{if(m.some(g=>v(g.address,k.address)))return;let f=[`Token ${A(k.symbol)} at ${k.address} is an unverified ${h.launchpad?"launchpad token":"token"}. Use its address, not its name or symbol.`];($(k.symbol)||$(k.name)||o.some(g=>!v(g.address,k.address)&&l(k,g)))&&f.push(`Lookalike warning: ${A(k.symbol)} at ${k.address} resembles a verified token's name or symbol.`);let y={...k,...h,kind:h.launchpad?"launchpad":"erc20",verified:!1,source:h.launchpad?`${h.launchpad} origin and on-chain metadata; not a verified token`:"On-chain metadata only",warnings:f};m.push(y),r.push(...f)};if(t&&!d.length){let k=await ce(t,n),h={};if(a===w){try{await Ne(t,n)&&(h.launchpad="clanker")}catch{r.push("Clanker origin lookup was unavailable for this address.")}if(h.launchpad==="clanker")try{let y=(await te(n.context,{q:t,limit:20})).tokens.find(g=>v(g.contract_address,t));y&&(h.creator=T(y.msg_sender),h.creatorSource="Clanker indexer msg_sender")}catch{r.push("Clanker creator lookup is unavailable.")}else try{let f=await pe(n.context,t);h.launchpad="pons",h.creator=T(f.creator),h.creatorSource="Pons factory deployer"}catch{r.push("Pons launch origin could not be confirmed for this address.")}if(!h.launchpad)try{let f=await Qe(t,n);f&&(h.launchpad="pools.trade",h.creator=f,h.creatorSource="Launch transaction sender; may be a relayer")}catch{c=!0,r.push("pools.trade launch receipt lookup is unavailable; origin results are partial.")}}u(k,h)}else if(!t&&a===w){let k=new Set,h=new Set,f,y=0,g=0;try{do{if(++y>xe)throw new b("Token search page limit reached.");let C=await te(n.context,{q:e.trim(),limit:20,...f?{cursor:f}:{}});for(let I of C.tokens){if(++g>Je)throw new b("Token candidate limit reached.");let O=T(I.contract_address);if(!(h.has(O)||o.some(R=>v(R.address,O)))){h.add(O);try{let R=await ce(O,n);if(!i(R))continue;let _e=await Ne(O,n)?{launchpad:"clanker",creator:T(I.msg_sender),creatorSource:"Clanker indexer msg_sender"}:{};u(R,_e)}catch{c=!0,r.push(`Could not read Clanker candidate ${O}; it was omitted from these partial results.`)}}}if(C.cursor&&k.has(C.cursor))throw new b("The Clanker indexer repeated a pagination cursor.");C.cursor&&k.add(C.cursor),f=C.cursor??void 0}while(f)}catch{c=!0,r.push("Clanker name search is unavailable, incomplete or reached its scan limit; results are partial.")}r.push("Pons and pools.trade require a token address; name search does not cover those launchpads.")}a===K&&r.push("Testnet lookup covers pinned tokens and explicit token addresses; stock and launchpad discovery are unavailable.");let p=k=>[...new Map(k.map(h=>[h.address.toLowerCase(),h])).values()],S=p([...d,...m]);for(let k of S)if(S.some(h=>!v(h.address,k.address)&&(N(k.symbol)===N(h.symbol)||N(k.name)===N(h.name)))){let h=`Duplicate warning: several tokens share the symbol or name of ${k.address}. Choose the intended address; do not guess from the name.`;k.warnings.push(h),r.push(h)}return d.length>1&&r.push("Several verified tokens match this search, including possible substring matches. Choose an exact address; the search does not select a quote token."),{query:A(e.trim()),chainId:a,partial:c,matches:p(d).map(Z),unverified:p(m).map(Z),warnings:r}}var ve=e=>`${A(e.symbol)} is not tradable right now: ${e.notTradable}. Oak will not quote it; a balance you hold still shows and can still be sent.`;async function pt(e,n){if(typeof e!="string"||!e.trim())throw new b("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 b("Use an exact ASCII verified symbol or token address; use find_token to look it up.");let s=e,t=z(s,{strict:!1})?M(T(s)):void 0,a=Ee(n),r=t&&a.find(u=>v(u.address,t));if(r)return r;let o=s.toUpperCase()==="$OAK"?"OAK":s.toUpperCase(),c=!t&&a.find(u=>u.symbol.toUpperCase()===o),i=[],d=!1;try{i=await Re(n)}catch{if(c)return c;if(!t)throw new b("The official stock list is unavailable; stock symbols cannot be checked. Use find_token and try again when the list is reachable.");d=!0}if(t){let u=i.find(k=>v(k.address,t));if(u){if(u.notTradable)throw new b(ve(u));return n.tokenMetadata&&j(n.tokenMetadata,i),Z(u)}let p=n.tokenMetadata??await n.readMetadata?.(t);if(p&&(!v(p.address,t)||p.chainId!==D[n.context.network??"mainnet"].chainId))throw new b("Token metadata does not match the requested address and chain.");if(p&&(typeof p.symbol!="string"||!p.symbol.trim()||!Number.isInteger(p.decimals)||p.decimals<0||p.decimals>255))throw new b("The contract returned invalid token metadata.");let S=p?{...p,name:p.symbol}:await ce(t,Me(n),!1);if(d){let k=N(S.symbol),h=ae.get(q(n.context.http));if(Ge.some(f=>N(f)===k)||h?.has(k))throw new b("The official stock list is unavailable; this address claims a stock ticker that cannot be checked. Try again when the list is reachable.")}return j(S,i),{...S,symbol:A(S.symbol),name:A(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.",...d?["The official stock list is unavailable; stock identity could not be verified."]:[]]}}let m=[...a,...i].filter(u=>u.symbol.toUpperCase()===o);if(m.length!==1)throw new b(`Token symbol ${A(s)} is ${m.length?"ambiguous":"unverified"}; use find_token and choose an explicit address.`);let l=m[0];if(l.kind==="official_stock"&&s!==l.symbol)throw new b(`Use the exact official stock ticker ${A(l.symbol)}; case variants are refused.`);if(l.notTradable)throw new b(ve(l));return Z(l)}export{X as a,Fe as b,se as c,oe as d,Ie as e,de as f,G as g,We as h,j as i,bt as j,De as k,Ve as l,yt as m,Ze as n,ze as o,Ye as p,Tt as q,pt as r};
@@ -0,0 +1 @@
1
+ import{a as B}from"./XSD5NL7J.js";import{getAddress as S,parseAbi as u}from"viem";var b={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"}]}],priceReferences:[{symbol:"AMC",token:"0x05a3d1Cd21d0C88145E82600E62e7E496e0F222B",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x7499938c352d5b5b8f0c648722aca5ee964ef9b85c3a3041f1ec379726291d9d"},{v:3,fee:3e3,pool:"0xaA34feA710a1A737840329051D81D3B0B7C564d5"},{v:4,fee:500,tickSpacing:5,id:"0x06b9732431bd134599dd112a93c708fe80cadd2fb7dc750fe632e1cbf49fd8c0"}]},{symbol:"AVGO",token:"0x156E175DD063a8cE274C50654eF40e0032b3fbcF",pools:[{v:3,fee:3e3,pool:"0x5B7C404f1d7d77F9f3885aB13d7764F8a173028c"}]},{symbol:"AXON",token:"0xC27dBD474aF5181c5A8777903690D8D262D12648",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x76e3dd1779473383d64c232fd03862f3d8c31136141ab1aae52bcdf2ce897b6e"}]},{symbol:"BA",token:"0x4D21483a44Bf67a86b77E3dA301411880797D452",pools:[{v:3,fee:3e3,pool:"0xc6517047b189c72D3bAa9eF37D1d28F27a63638a"}]},{symbol:"BB",token:"0x48E39E56aCdbA37b09020C0b734A613C9a2f100A",pools:[{v:3,fee:1e4,pool:"0xc424e56e816F148a8B30ccbde2128e04d21f51e9"}]},{symbol:"BE",token:"0x822CC93fFD030293E9842c30BBD678F530701867",pools:[{v:3,fee:3e3,pool:"0x1baD145C8F06444E0dF81c28257cd20231Bd1f16"}]},{symbol:"CEG",token:"0xaE517A2903E68bd929Dfd15be875F8369D53e94a",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x21e190d0a42ad1b36f957bf2490eef78825d13a579d3a326bf10aadc1d634f4f"},{v:3,fee:1e4,pool:"0xc9529b7dc74BF15da6Cee01a282908E8C7aB6BA3"}]},{symbol:"COST",token:"0x4EA005168D7F09a7A0Ba9D1DEf21a479950E44C2",pools:[{v:3,fee:3e3,pool:"0x0a2121A50A09eD0796ae81F9c53fF9398355a398"}]},{symbol:"CRWD",token:"0xea72Ecca2d0f6bFA1394DBBCff85b52CD4233931",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0xb11086b1ff40749a1e619c0f87299e5c67ac84a8feceee0c039d574e5cd4c520"}]},{symbol:"DIS",token:"0x501B1B3B79750313AD2C4CcCD08586c4C17d7283",pools:[{v:3,fee:3e3,pool:"0x75F7109Eb00Eab50426f19b00Fb05783bD1a0501"}]},{symbol:"DJT",token:"0x1D11f0496982706C5e14A514D4E79F2e6BdE4516",pools:[{v:3,fee:1e4,pool:"0x31a89afd92F9397465649AD03226c52292fc1ae5"}]},{symbol:"F",token:"0x25C288E6D899b9BC30160965aD9644c67e73bE0C",pools:[{v:3,fee:3e3,pool:"0x4dbAC19E895322ac5b93abad9008691632bFFC05"}]},{symbol:"FIG",token:"0x41F4267525a8AFf329540eF24fD83d9044758B33",pools:[{v:3,fee:3e3,pool:"0xca5904C0a9d42F0Ec1Bf760FDf779907877144fD"}]},{symbol:"GLD",token:"0xC9a981FEE1F9DEc688bb123ccDeCc63D0deBFC4e",pools:[{v:3,fee:3e3,pool:"0x7A6A053eCCf1446A2633E05aA6D40D09381997ec"},{v:3,fee:500,pool:"0xBA2f1ed4cEB2169D538d1e614D847E83C5A55913"},{v:3,fee:1e4,pool:"0x32cb909aCF78354E08aa45639Ff5CD33767E730a"}]},{symbol:"GLXY",token:"0x2D427692E928fa156ec22acfaBaFA0447C5805B7",pools:[{v:3,fee:3e3,pool:"0xC67C2D200E0b7E5D99F4CFBede8CB09B48892f2c"}]},{symbol:"HIMS",token:"0xCceE82fE024c36fA15E1005edE3E9e4787e23D09",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x68d4f28f1432e0ad714658853edb2e6b0b1ac4060355ff3d169fea656b1d1c52"},{v:3,fee:3e3,pool:"0xC8C90d3a1c1a24967E773ac2aD0d456BA3E31F64"}]},{symbol:"IBM",token:"0x980dcf6766FA79f5Cf0c4AAdb3ab477ff15a9619",pools:[{v:3,fee:3e3,pool:"0x8cD848ce18b829C5c769AFf27164078bB52e0E97"},{v:3,fee:1e4,pool:"0xA0A79bC62fC822f3bcDF0EBbc586031781c53a5B"},{v:4,fee:1500,tickSpacing:15,id:"0xfefcd3697193dacac74626b2c8ca15937479605b4ee074670186f746b448028a"},{v:4,fee:9e3,tickSpacing:90,id:"0xd43a51c85ca0b12309a46a8b6c68dd76837fbd3dba5d413cd4686b85a52f9081"}]},{symbol:"INDA",token:"0xACEF2e09adb47aD6aBeBAD9fF06689E60615C2B6",pools:[{v:4,fee:2e3,tickSpacing:20,id:"0x7d0895d8162b0be326ef944faeb5a84f4a08377b9bc9f010e38fa4d268a94469"},{v:3,fee:3e3,pool:"0x2171c94d8073C4913f4653a0766D18aA8A29D1f6"}]},{symbol:"JBL",token:"0xEAf2512dFC1bEAc608F8794B3793CD4E02894Aa6",pools:[{v:4,fee:2500,tickSpacing:25,id:"0xe0c9d8c4ca2e0f2435bb7d07ed6c9a4273397dd097e72fa4d9ba4ee476abfd3f"}]},{symbol:"JNJ",token:"0x03DfbBE0AC4E7bCDaFd08eD41A400326B77D8c80",pools:[{v:3,fee:3e3,pool:"0x7F0aCE18D1dCEd47063CF26e649bc8AB14D09e67"},{v:3,fee:1e4,pool:"0x8d39388EF11Bb78843130Bd74AB0e5d89fA76b30"}]},{symbol:"JPM",token:"0x07c44dA0848960bFf894F17584dB8B2F60B2409E",pools:[{v:3,fee:3e3,pool:"0x3ebDBc2a316F87BaeD3A9d1229E03b0a49A27eC3"}]},{symbol:"KTOS",token:"0x7FD06a4d81cCfA3F351394E144d5191874C31313",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x2204b8dffc2cf19091c5fb124ca745459e41ba5bf6db69f3723c7f5908688819"}]},{symbol:"LLY",token:"0x8005d266423c7ea827372c9c864491e5786600ea",pools:[{v:3,fee:500,pool:"0xF212D02146a897F5F686E9d629F6A73da534324a"},{v:3,fee:3e3,pool:"0xD2038788ebe1e0BFd7C0A6112f09778F3aeAecA6"},{v:3,fee:1e4,pool:"0xF4274130137eeE20bAD928B593d992716516CEB9"}]},{symbol:"LMT",token:"0x329fcACEb9AD6F9580DD5F643fed0646900D043c",pools:[{v:3,fee:3e3,pool:"0x54f160Bea60EC5207918C539d86E0b906b4DA297"},{v:4,fee:5e3,tickSpacing:50,id:"0x0b118d2480ebdb11374d3ad2ea1b935e9458a9f704222004b3b8de07bc98f1eb"}]},{symbol:"LULU",token:"0x4e62068525Ab11FE768e29dfD00ef909B9803016",pools:[{v:3,fee:3e3,pool:"0x0F4227D27082B3BCA6818381b9ea6460275e49f4"}]},{symbol:"MCD",token:"0x2fdaa4604F10F4AE7f66fa48A174bCd25b1ece20",pools:[{v:3,fee:3e3,pool:"0x2e97F9Ec9C6BAC972aB5BC1b8a1A7973B701dd97"}]},{symbol:"MRNA",token:"0x43B07D15cE533bEc5476d70C22a78a1B2B662155",pools:[{v:3,fee:3e3,pool:"0xB40196272A6d2EB5edF6d93bc4DC39856AD95E0E"},{v:3,fee:1e4,pool:"0xA34d0667334074DF2d5BfD259e79E6B9cf1fA8Bf"}]},{symbol:"MRVL",token:"0x62fd0668e10D8B72339BE2DCF7643001688ff13B",pools:[{v:3,fee:3e3,pool:"0xb5E892F0fC6dAAdDA5b927266FE7907e623e4843"}]},{symbol:"NET",token:"0x116F00968269B7bfbaD4109cE591d6E74c0601d4",pools:[{v:3,fee:3e3,pool:"0xA9Caebb1b2fB2b954F192572b309aEf1cAf6a330"}]},{symbol:"NFLX",token:"0xE0444EF8BF4eD74f74FD73686e2ddF4C1c5591E8",pools:[{v:3,fee:3e3,pool:"0x59895C0302F41aEaa129D2fa2442CEc01E7eF45E"},{v:4,fee:1e4,tickSpacing:100,id:"0xe4930a6215f21aa3b37c01adbded3362f56ae31b9a60066f5f9641e601d5111f"}]},{symbol:"NU",token:"0x408c14038a04f7bD235329E26d2bf569ee20e250",pools:[{v:3,fee:1e4,pool:"0xb6d047637151f6De1d02028acdd187Aa9cb7AFE3"},{v:3,fee:3e3,pool:"0x0E3FaEd512E7909758EB924E6919e0057Bd6b45E"}]},{symbol:"ON",token:"0xbBD09F72b025360FeE5C928053Dca6248d35be54",pools:[{v:3,fee:1e4,pool:"0xfcE637eeAd7D62d9ED27F81D9767de03e9E534Cf"}]},{symbol:"P",token:"0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D",pools:[{v:4,fee:1e4,tickSpacing:100,id:"0x2300c9273ea3f89e86787cfb01d522ca36be342d40ed754c15feca69f3afbe6a"}]},{symbol:"PANW",token:"0xB039597eD45CBa7B6E2fb9E8BE51802969CEe5Be",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0xb544fd24f37f3d7a6ee3c20e4b4f7797807d92603ccae703149e374337d5013a"}]},{symbol:"PFE",token:"0x7066A64c24e4206CD62E83bf198c1E7EB361F51e",pools:[{v:3,fee:3e3,pool:"0xC7d573Fcda6D2107C97fb582ae18411F9Db32E7f"},{v:4,fee:1500,tickSpacing:15,id:"0x632d9bdccf26e13dbf23b185f29cba47e237371010e1abf7aceaeff653f66be4"},{v:3,fee:1e4,pool:"0xA26dF7296ef5DFc727f3bc6F1E9050E6B62e6abF"}]},{symbol:"POET",token:"0xcf6B2D875361be807EAfa57458c80f28521F9333",pools:[{v:3,fee:1e4,pool:"0xa1C781ed62AC2d0283f50fF5A843647a56ddd80a"}]},{symbol:"PYPL",token:"0xa45aBDc77918F7B9199b022eEe400C0BC5712BD2",pools:[{v:3,fee:3e3,pool:"0x4F59397a5F742dcF91C69763de550f406af7EbfF"}]},{symbol:"QUBT",token:"0x59818904ab4cE163b3cE4FfB64f2D6Ca02c434B4",pools:[{v:3,fee:1e4,pool:"0x2E2a857C08aD6C09f1d1EC4FDB4Cc7cd06cF17f4"},{v:3,fee:3e3,pool:"0x227Bbce9A81B3694b01754298a983Be3F9E44A93"}]},{symbol:"RBLX",token:"0xF0C4BF4C582cb3836e98394b1d4e7B7281101bE8",pools:[{v:3,fee:3e3,pool:"0x1BDB8e3A79Cb1a7F228808739311E23098D33d43"},{v:3,fee:1e4,pool:"0x2ef5945cd5664876b6481FdacFaA2942995a4DA8"},{v:4,fee:1e3,tickSpacing:10,id:"0xf807376333cd408c36d48a11a96309b92c5bd2bca9ba9f0b21800636cb3a30da"}]},{symbol:"RCAT",token:"0xFDE6b5d9BB419B10C23268c74e369AbFF39C0460",pools:[{v:3,fee:1e4,pool:"0x64710a70839585Af718e1B1FAEf9E7f1665F1116"}]},{symbol:"RDDT",token:"0x05b37Fb53A299a1b874A619e1c4C404D52C36F4C",pools:[{v:3,fee:1e4,pool:"0xa8744E76aED23B05F0126335E7BD38f7935D19fe"},{v:4,fee:1e4,tickSpacing:200,id:"0xec481672a94cfe42e2d8c996b7eaeee8a93093d56bd01c1714341971e3f406c1"}]},{symbol:"RIVN",token:"0xB1BF26c1D20ff267A4f93550d1E0d06ac40a114B",pools:[{v:3,fee:3e3,pool:"0xF9e71558eEf115b6C8fbFc9ad5fda00033E9d69C"},{v:3,fee:1e4,pool:"0xb30A75B200D98A600a3766869344928E35823E23"}]},{symbol:"RKLB",token:"0x3b14C39E89D60D627b42a1A4CA45b5bb45Fc12e2",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0xbbc15d66fef8391f53569e19016e86545be9de3f302b82db93ed6165236d22f3"}]},{symbol:"SHOP",token:"0xF53F66751B1Eff985311b693531E3290F600c410",pools:[{v:3,fee:1e4,pool:"0x18A1aFa849A6940870c2163B7ECBCC85d455Ad99"},{v:4,fee:1e4,tickSpacing:100,id:"0x8baff387b51c50e2747e85bcddf87da78fee6efb45629743e1af4dfb07ad13ee"}]},{symbol:"SKHY",token:"0x84CAb63bc87912E71ad199ff14A0bA45de68FeF8",pools:[{v:3,fee:3e3,pool:"0x5F2a5025feb93a4C44DA4E3B37e4fD3Fb0ab5171"}]},{symbol:"SNAP",token:"0xF6589F11Bc40b669e584073F428B05562F568733",pools:[{v:3,fee:3e3,pool:"0x0EbD4650C9e641E9745b5A508A2D46935DFE753E"}]},{symbol:"SNOW",token:"0xBa0CAB75495255d0cB58E22B648bFED4ECD1F47E",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0xac720e95589b7124f0affbdb9e66c7ec6e824c68eae00dc54f9e11b0b294bac8"}]},{symbol:"TE",token:"0xb1969f6604CA1AE7a2cD3F1827876e914594CA2D",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x87d302c27b610c19114a51f848ba27acd197933493458bea30c558df5cae6cd8"}]},{symbol:"TTWO",token:"0x5e81213613b6B86EaB4c6c50d718d34359459786",pools:[{v:3,fee:3e3,pool:"0xD9Ab4b7fAe6DC2f7020134Ec744A8F53Ef3E5E24"},{v:4,fee:1e4,tickSpacing:200,id:"0x131e6ebeeedb524a1e7590aa3eea3bc8782b5425a78d5128c0ca955190d0ea69"}]},{symbol:"UBER",token:"0xbd335Aa5A1693F0121A5c0Ef18A080E9958DA78b",pools:[{v:3,fee:3e3,pool:"0x0DF328152A3708F99f6cf13fb3c820BbBF9115C1"}]},{symbol:"UPS",token:"0xf23250dac154D05Bb671CB0d0eBEf3c635c79CE2",pools:[{v:3,fee:1e4,pool:"0x3Ab74C45DceCC6A62898204Dd42143a816B44CB1"},{v:3,fee:3e3,pool:"0x5c67a84Ec5494ffE24E217B28dEbb96341014c86"}]},{symbol:"V",token:"0x9BFF87700337babF5099e99F322F888DafB1d551",pools:[{v:3,fee:3e3,pool:"0xfE67885765C29C25A589d99003C19C082664c26f"}]},{symbol:"VTI",token:"0x0594134DF3f171a354D9C85eBD65b7A6148F6D09",pools:[{v:3,fee:1e4,pool:"0xb78DD1A97fa544c65d7D1f12453EcaAF1e05c36d"}]}],unpriced:{AAOI:{token:"0x521Cf887E6531c6F667b5BC4D896E5d9bfE8EB2E",reason:"thin"},ABCL:{token:"0x3139D77Ace0cbAA5bDfD38bD1F1911a794AF0B0e",reason:"no-pool"},ADBE:{token:"0x232B8ed6377BE97813853B0Ac104c4Cda8378d1B",reason:"thin"},AEHR:{token:"0x5F604fBA1162193A4388A5DFa56F556f3E133cC2",reason:"no-pool"},AEIS:{token:"0xfAf9cb261B5FCC1f404Bb10CD39C5c6C1974E612",reason:"no-pool"},ALAB:{token:"0x748c32c3ca24eDf31ea597Db1F3d330a7a6DA3Dc",reason:"no-pool"},AMAT:{token:"0x36046893810a7E7fCE501229d57dc3FC8c8716d0",reason:"thin"},AMBA:{token:"0x99D9D8663545151603863C5AcbD6FC3218899009",reason:"no-pool"},AMKR:{token:"0xDd356AA38F40A7b7076755aC854B6FBb1F0D305B",reason:"thin"},ANET:{token:"0x28bABD556b60E53663B8615036479a29c2CDd1Bf",reason:"thin"},APLD:{token:"0xb8DBf92F9741c9ac1c32115E78581f23509916FD",reason:"thin"},APP:{token:"0xA249BAF1063Af884807C1E1400AEf7784836917E",reason:"no-pool"},ASTS:{token:"0x1AF6446f07eb1d97c546AFC8c9544cBDF3AD5137",reason:"no-pool"},AUR:{token:"0x373C06c4f7BDe527D7Dae4BA169E42b55E393CeD",reason:"no-pool"},AVAV:{token:"0xF6290b5e7C26502e2dA514C31509849718EA76A5",reason:"no-pool"},AXTI:{token:"0x141eEa040c2250eEc0314e336975e81f85f6585e",reason:"no-pool"},BMNR:{token:"0x9a7842EDed60b0FE1e03eEc342C82A397c821eD0",reason:"no-pool"},BND:{token:"0x2F62fC9fAbb470C690f141c28340eD832bB27020",reason:"no-pool"},BULL:{token:"0xceF9027c7d6985b85f0BA431125073529A947A68",reason:"no-pool"},CBRS:{token:"0x5c90450Bbb4273D7b2f17CF6917AEB237A569679",reason:"thin"},CCL:{token:"0x9651342CeA770aE9a2969Ba2A52611523146aef9",reason:"thin"},CELH:{token:"0x8cF07C5A878945185d327aAa6e33FAa95F95e7bF",reason:"no-pool"},CIEN:{token:"0x44f6D488021f8233B9416294d1FE9b1fEe28382d",reason:"no-pool"},CLOV:{token:"0x62200915e7DEab1eC7f79fb246daDbB80eACdDd0",reason:"thin"},CLS:{token:"0xBf449977089c718C004a66C554B26B94ef3Ad4De",reason:"thin"},CLSK:{token:"0xcBB95BBF36099d34dA091dc6Fa6F49EfA257Cee3",reason:"no-pool"},COHR:{token:"0x92F9F459F1a9a5AD266b182BE7Bffd1C6c666894",reason:"no-pool"},CRDO:{token:"0x4D67253bc223e6b0e104F1084c1fb2b669dDC41b",reason:"no-pool"},CRM:{token:"0xd95B44124e475743a7589e68F3D74008A5536D44",reason:"thin"},CSCO:{token:"0xF543967EEBB6f1917992eF0E68De63ab07a5a0dA",reason:"no-pool"},CTSH:{token:"0x63D5a3b6939a33f1e75d8Bcd85759858239600DB",reason:"no-pool"},CVNA:{token:"0xa4f319104089FE321dc8093C6E707d4fE190A988",reason:"no-pool"},DDOG:{token:"0x27c99fBde9D0d2AA4f4Bfb4943f237843DdF6958",reason:"thin"},DOCN:{token:"0xc02f12B9fe9E707079EC0d546f3050d3F6C1F8bD",reason:"no-pool"},ELF:{token:"0x39EC44Bee4F6A116c6F9B8De566848a985C53C60",reason:"quote-failed"},EWT:{token:"0x1c690498150252222C275A5CEd69d3A6b1f52D5E",reason:"no-pool"},EWY:{token:"0x7f0aBeF0C07280F82c6a08ead09dEd6BAE2C13Fc",reason:"thin"},FICO:{token:"0xa48F22A46C0F1C46CA7D111CB6c137c271987180",reason:"no-pool"},FISV:{token:"0x9ECe29A4A2397C0a35fb5fA8EE2b9509130a98cc",reason:"no-pool"},FIX:{token:"0x93Dbb1d2Dc5D63F4abACFF30485273f538Df68Ac",reason:"thin"},FLNC:{token:"0x282e87451E10fA6679BC7D76C69BE44cD3fC777C",reason:"no-pool"},FLY:{token:"0x03BC731Ffb162cdd7B98D3C6542bFC291126075d",reason:"thin"},FTNT:{token:"0x3FB8976980d486084b2eb4a404BD12e72823958f",reason:"thin"},FUTU:{token:"0xeB30663bDFf0622Ef4e4E5cBb4E975F19f33f51D",reason:"no-pool"},GDX:{token:"0xBDFa7A06458Aa26b8E736E0fC87aD37C3BB8Ac2e",reason:"no-pool"},GE:{token:"0x63b814DDBd6BF339f25Fed8c36158a008D5B373e",reason:"no-pool"},GEV:{token:"0x94B8AAE43A1cCc08Aa64B7D1F29b4D920aF4a0C9",reason:"no-pool"},GLW:{token:"0x7c04E6A3368F2A1DE3874f0e80d2e0A1a9915da6",reason:"no-pool"},HII:{token:"0xEB61c0Ed490A367d4E3631cCf8a74B3bfc7E775D",reason:"no-pool"},HPE:{token:"0x59dd09d4900C2E4B5F75b7c0d4E6796fcc234Cb1",reason:"thin"},HWM:{token:"0xAEa445c5F3DB1a462998ccC422A875A361ee5d99",reason:"thin"},IBRX:{token:"0x7c148F74ac7445D1F28366b7FcDC6792a9Fcd0Cf",reason:"no-pool"},INFQ:{token:"0xB853bC83a753342a4f8320ea680b4B1E84118D21",reason:"no-pool"},INOD:{token:"0xf1953DAB6FaD537488d5A022361FfAa8B4c95eC6",reason:"no-pool"},INTU:{token:"0x56d23beE5f41A7120170b0c603Dae30128e460e9",reason:"no-pool"},IONQ:{token:"0x558378E000D634A36593E338eBacdd6207640EfE",reason:"thin"},IREN:{token:"0xF0AB0c93bE6F41369d302e55db1A96b3c430212D",reason:"thin"},JOBY:{token:"0xb334C5cE741B80B5B671F47F5C269Cb193fe8E24",reason:"no-pool"},KLAC:{token:"0x96b933C74eCB4A0926b9210cef7b743EF46be2E9",reason:"no-pool"},KSS:{token:"0x12e3c047bf9AeCAF9dDC98c05C31BFD1dd043993",reason:"no-pool"},LHX:{token:"0x48d60243c66437c6ac3c2495Be94747aEd5Dfe25",reason:"no-pool"},LITE:{token:"0x8eF20885F94e3D9bc7eB3080279188Bd5ED7c08C",reason:"thin"},LRCX:{token:"0x57b0030166DB0C31690d1A5aA167e2e26e2C29a4",reason:"no-pool"},LUNR:{token:"0xa5D4968421bA94814Be3B136b15cf422101aC1a3",reason:"no-pool"},MDB:{token:"0xDdf2266b79abf0B48898959B0ed6E6adf512be74",reason:"no-pool"},MOD:{token:"0xc6Cbad1016b38B797610c25E1dc7D95988B1f362",reason:"no-pool"},MPWR:{token:"0x52D50D0280AD1054b43f052bD70a49a212A1b128",reason:"thin"},MTSI:{token:"0xC93f4d80e268AB922e871bd169156C3CC41894e6",reason:"no-pool"},MXL:{token:"0x48961813349333209994750ffA89b3c5C22eC969",reason:"no-pool"},NAVN:{token:"0xf7181b63Fdb858558A74ba96BC42732684cd7965",reason:"no-pool"},NNE:{token:"0xBEF75684C43c4ea7BD18Dd532a2244674Ee8b926",reason:"thin"},NOW:{token:"0x0C3260aF4B8f13a69c4c2dFb84fD667890CDFa14",reason:"thin"},NVTS:{token:"0xbE6702d7b70315376dC48a3293f24f0982F86386",reason:"no-pool"},OKLO:{token:"0x8B2f88497f15A18E9D4FFa1a8fFB8538399aE774",reason:"no-pool"},ONTO:{token:"0x8ff63eAeEe3fE54Ba450c4F5538064Ec5A893Aef",reason:"no-pool"},OUST:{token:"0x40E7a279850e443f582059ae5dC1c3b6563E6395",reason:"no-pool"},PATH:{token:"0xfb2664f07B6Aadd29ea7a59D8859b1AeB8645cDa",reason:"thin"},PENG:{token:"0x9b23573b156B52565012F5cE02CDF60AFBaa70Be",reason:"no-pool"},PL:{token:"0xAA4d64474c172010aB57719cb9951E6142a100d3",reason:"no-pool"},POWL:{token:"0x237c16D66590F67B886d978ACD362EAeaD8B18c7",reason:"no-pool"},PR:{token:"0x4189F0c66EBBB0bfeF1C31f763131361EF32f77C",reason:"no-pool"},PWR:{token:"0x9Ab02Ead789b6903c3c44d0ED32F9c707CDF12FD",reason:"thin"},QBTS:{token:"0xC583c60aeF9Dc401Da72cEC1B404743a93cea1Cc",reason:"no-pool"},QCOM:{token:"0x0f17206447090e464C277571124dD2688E48AEA9",reason:"no-pool"},RDW:{token:"0x92Ef19E82bD8fF36661DE838D5eaE7e5CEF0EfFE",reason:"no-pool"},RGTI:{token:"0x284358abc07F9359f19f4b5b4aC91901Be2597Ba",reason:"no-pool"},RUN:{token:"0x756Bc80af765C82da966a788858d65aDF14f3793",reason:"thin"},SATS:{token:"0x95052ddcd5DC25641657424A8Cf04834997E1730",reason:"no-pool"},SCHD:{token:"0xd63ABB2C13d7a8421a8017a712802053568e3C1D",reason:"thin"},SHY:{token:"0xBE274710Bf3d9567e1B290eF6a5F9f90ca016FD8",reason:"no-pool"},SIMO:{token:"0x77E655E37F4d913fB9540e0d541D824171a60e81",reason:"no-pool"},SLS:{token:"0x285b231728c7E4333799183DF1094d775246a535",reason:"no-pool"},SMCI:{token:"0xc01aA1fECeC0605b13bc84874ff7256C0f5F562a",reason:"no-pool"},SMH:{token:"0x072f979c2CAc8e1391B0162a87Fee094bF8744a0",reason:"thin"},SMR:{token:"0x1Eebee7F74517e0279dFb09d25B0407bEEc3FDd6",reason:"no-pool"},SOFI:{token:"0x98E75885157C80992A8D41b696D8c9C6Fb30A926",reason:"thin"},SOUN:{token:"0x6E3Dfd9f7e1649BaA14D25cac18C94d62dB10A54",reason:"no-pool"},SOXX:{token:"0x75742c18BC1f1C5c5f448f4C9D9C6F66dafAAa38",reason:"thin"},SPMO:{token:"0xAd622320e520de39e72d41EF07438C3Fd3354875",reason:"no-pool"},TEAM:{token:"0x5B97476b922F3305131B8f0B9D333172E87f4aaE",reason:"no-pool"},TEM:{token:"0xB1CC0EC7Db69Cf43539119814df40071b9d61793",reason:"no-pool"},TER:{token:"0x2778C5024D5cA2CdB0f8eAD671ffc69963AdCD9C",reason:"no-pool"},TSEM:{token:"0x89776d4Cd68193597A2fC132cfaC1fDe36CCeA8a",reason:"no-pool"},TTD:{token:"0x0b5fb4031cae9163db10B169Ee72685F0EdC8545",reason:"no-pool"},UMC:{token:"0x0E6e67Ba88e7b5d9B67636A215c76779B948dE79",reason:"thin"},UNH:{token:"0xcF364ea52787e289De6F32077834056E3E70D6A8",reason:"no-pool"},VICR:{token:"0x6006ed4B2F94110851ff7509D97D034f0EeD9226",reason:"no-pool"},VRT:{token:"0xFA78C12E6488814A0262E4e802749a4a737d5fB7",reason:"thin"},VSAT:{token:"0x26dCbfb34FC83CAbD6990f449674efDc6097fF85",reason:"no-pool"},VST:{token:"0x561e2a49212b7cCF47f2744Ccb83e200722fADBc",reason:"no-pool"},WDAY:{token:"0x82DA4646242e1D962e96e932269Dc644c94a9CaA",reason:"quote-failed"},WDC:{token:"0xF52597345A8Edf418bc4071b4a35112472277D3e",reason:"no-pool"},WULF:{token:"0x348Be1A8663f15edDe5CDf8A96BB69078f7aB6Fd",reason:"thin"},WYFI:{token:"0x9e7ABD3C9139D14E4c86DcE0e455AAB7A0C2FB3E",reason:"thin"},XLK:{token:"0x15Cd20759CE7F3285c29A319dE2D1A2e098c6f43",reason:"thin"},XNDU:{token:"0xA8eB3BCcbf2017eE7CBfb652eB51CF2E1B153289",reason:"no-pool"},XOM:{token:"0xf9B46d3D1B22199D4D1025a9cEDB540A33F1a2d5",reason:"thin"},ZETA:{token:"0xE674C5c071821f48BB2d12CAdb83617Eff438f9e",reason:"no-pool"},ZM:{token:"0x44c4F142009036cF477eD2d09932051843137CF1",reason:"thin"},ZS:{token:"0x7dc013eB55e436f30d7ED1AFE4E36d6e45e3c3f7",reason:"no-pool"}},census:{block:111456101,measuredAt:"2026-11-11T05:12:11.414Z",file:"ops/qa/2026-11-11-stock-census.json",rule:"priceReferences: hookless Uniswap USDG pools with at least 10,000 USDG in range whose 10 USDG quote executed within 2% of the pool spot. unpriced: every other official stock, with the reason: no-pool (no live USDG pool), thin (under 10,000 USDG in range) or quote-failed (enough depth, but the 10 USDG quote failed, so the price is unverified)."},notOffered:{CLSK:"thin",EWY:"thin",IONQ:"thin",RGTI:"thin",RKLB:"thin"},sourceCommit:"02230282d8888e00794207ed271ee01b4ce30309"};var F=u(["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)"]),C=1n<<96n,p=C*C,m=10000n*10n**6n,I="current price in the Uniswap USDG pool; on-chain trading can differ from the stock market",y=[...b.tokens,...b.priceReferences],g=Object.entries(b.unpriced);function h(o){if(o.chainId!==b.chainId)return;let n=o.address.toLowerCase(),e=y.find(f=>f.token.toLowerCase()===n);if(e)return{symbol:e.symbol,pools:e.pools};let a=g.find(([,f])=>f.token.toLowerCase()===n);return a?{symbol:a[0],pools:[],gap:a[1].reason==="no-pool"||a[1].reason==="quote-failed"?a[1].reason:"thin"}:void 0}var i=class extends B{constructor(e,a){super("Pinned stock pools have insufficient in-range USDG depth for a display estimate.");this.symbol=e;this.gap=a}symbol;gap},N=(o,n)=>n==="no-pool"?`no Uniswap USDG pool with liquidity exists for ${o}`:n==="quote-failed"?`Oak's 10 USDG test quote in the Uniswap USDG pool for ${o} failed, so its price is unverified`:`the Uniswap USDG pools for ${o} are too thin to trust (under $10,000 in range)`,M="the RPC did not answer and may be rate limited; try again shortly";function U(o){let n=new Set;for(let e=o;e&&typeof e=="object"&&!n.has(e);e=e.cause){n.add(e);let{status:a,code:f,message:d,name:t}=e,c=Number(a??f);if(c===429||c>=500&&c<=599||t==="RpcFailure"||t==="TimeoutError"||t==="HttpRequestError"||/rate.?limit|too many requests|\b429\b|timed? ?out|fetch failed|RPC endpoint is busy/i.test(String(d??"")))return!0}return!1}async function x(o,n,e){let a=h(o);if(!a)return;if(a.gap)throw new i(a.symbol,a.gap);let f=BigInt(o.address)<BigInt(b.usdg),t=(await Promise.all(a.pools.map(async c=>{let s=c.v===3,l=S(s?c.pool:b.v4.stateView),[k,E]=await Promise.all([n.readContract({address:l,abi:F,functionName:s?"slot0":"getSlot0",args:s?[]:[c.id],blockNumber:e}),n.readContract({address:l,abi:F,functionName:s?"liquidity":"getLiquidity",args:s?[]:[c.id],blockNumber:e})]),D=k[0];if(D<=0n||E<=0n)return;let A=f?E*D/C:E*C/D;return A>=m?{sqrt:D,usdgDepth:A}:void 0}))).filter(c=>c!==void 0);if(!t.length)throw new i(a.symbol,"thin");return t}async function T(o,n,e){return(await x(o,n,e))?.reduce((f,d)=>d.usdgDepth>f.usdgDepth?d:f)}function r(o,n){let e=BigInt(o.address)<BigInt(b.usdg),a=e?n**2n:p,f=e?p:n**2n;return a*10n**BigInt(o.decimals)*10n**18n/(f*10n**6n)}async function w(o,n,e){let a=await T(o,n,e);return a?r(o,a.sqrt):void 0}async function G(o,n,e){return(await x(o,n,e))?.map(f=>r(o,f.sqrt)).reduce((f,d)=>d>f?d:f)}export{b as a,m as b,I as c,h as d,i as e,N as f,M as g,U as h,T as i,w as j,G as k};
@@ -1 +1 @@
1
- import{g as k,h as A}from"./BSX4LFYI.js";import{g as i}from"./NWNYJ26T.js";import{b as l,j as m,n as y}from"./TI727O2H.js";import{a as r}from"./XSD5NL7J.js";import{decodeFunctionData as P,parseAbi as g}from"viem";var x=g(["function buy(uint256 quoteIn,uint256 minTokensOut,address recipient) payable returns (uint256)","function sell(uint256 tokensIn,uint256 minQuoteOut,address recipient) returns (uint256)"]);function f(s){return k(s)}function K(s,e,o,t){let d=f(s),c=f(e),[p,n]=BigInt(d)<BigInt(c)?[d,c]:[c,d];return{currency0:p,currency1:n,fee:o,tickSpacing:t,hooks:m[l].pons.memeHook.address}}function h(s){let e=A(s,[y]),o=e.legs[0];if(e.permit||e.legs.length!==1||!o)throw new r("Pons router must contain one canonical v4 swap command.");return{swap:{poolKey:o.poolKey,zeroForOne:o.zeroForOne,amountIn:e.amountIn,amountOutMinimum:e.amountOutMinimum,minHopPriceX36:0n,hookData:"0x"},deadline:e.deadline}}function H(s,e){let o=(n,w,a)=>{if(!i(n,w))throw new r(`Built swap ${a} does not match the accepted quote.`)},t=e.ponsPoolToken??e.ponsCurveToken;if(!t||e.ponsPoolToken&&e.ponsCurveToken)throw new r("Pons quote must name exactly one curve or pool token.");let d=i(e.to,t);if(!d&&!i(e.from,t))throw new r("Pons quote must trade its launch token.");let c=d?e.from:e.to;if(i(f(c),t))throw new r("Pons quote pair must differ from its launch token.");if(e.ponsPoolToken){if(o(e.router,m[l].ponsTrade.universal_router.address,"Pons router"),o(e.spender??e.router,m[l].ponsTrade.permit2.address,"Pons spender"),!e.data)throw new r("Pons pool quote must include locally reconstructed calldata.");let{swap:n,deadline:w}=h(s.data),a=h(e.data),u=K(c,t,a.swap.poolKey.fee,a.swap.poolKey.tickSpacing);if(o(n.poolKey.currency0,u.currency0,"pool currency0"),o(n.poolKey.currency1,u.currency1,"pool currency1"),o(n.poolKey.hooks,u.hooks,"pool hook"),n.zeroForOne!==i(f(e.from),u.currency0)||n.poolKey.fee!==a.swap.poolKey.fee||n.poolKey.tickSpacing!==a.swap.poolKey.tickSpacing||w!==a.deadline)throw new r("Pons pool direction, parameters or deadline differ from the accepted quote.");return{from:e.from,to:e.to,wallet:e.wallet,amount:n.amountIn}}let p=P({abi:x,data:s.data});if(p.functionName!==(d?"buy":"sell"))throw new r("Pons curve direction does not match the accepted quote.");return o(e.spender??e.router,e.router,"curve spender"),{from:e.from,to:e.to,wallet:p.args[2],amount:p.args[0]}}export{x as a,f as b,K as c,h as d,H as e};
1
+ import{g as k,h as A}from"./TNHU5UBQ.js";import{g as i}from"./NWNYJ26T.js";import{b as l,j as m,n as y}from"./EWZFZUVF.js";import{a as r}from"./XSD5NL7J.js";import{decodeFunctionData as P,parseAbi as g}from"viem";var x=g(["function buy(uint256 quoteIn,uint256 minTokensOut,address recipient) payable returns (uint256)","function sell(uint256 tokensIn,uint256 minQuoteOut,address recipient) returns (uint256)"]);function f(s){return k(s)}function K(s,e,o,t){let d=f(s),c=f(e),[p,n]=BigInt(d)<BigInt(c)?[d,c]:[c,d];return{currency0:p,currency1:n,fee:o,tickSpacing:t,hooks:m[l].pons.memeHook.address}}function h(s){let e=A(s,[y]),o=e.legs[0];if(e.permit||e.legs.length!==1||!o)throw new r("Pons router must contain one canonical v4 swap command.");return{swap:{poolKey:o.poolKey,zeroForOne:o.zeroForOne,amountIn:e.amountIn,amountOutMinimum:e.amountOutMinimum,minHopPriceX36:0n,hookData:"0x"},deadline:e.deadline}}function H(s,e){let o=(n,w,a)=>{if(!i(n,w))throw new r(`Built swap ${a} does not match the accepted quote.`)},t=e.ponsPoolToken??e.ponsCurveToken;if(!t||e.ponsPoolToken&&e.ponsCurveToken)throw new r("Pons quote must name exactly one curve or pool token.");let d=i(e.to,t);if(!d&&!i(e.from,t))throw new r("Pons quote must trade its launch token.");let c=d?e.from:e.to;if(i(f(c),t))throw new r("Pons quote pair must differ from its launch token.");if(e.ponsPoolToken){if(o(e.router,m[l].ponsTrade.universal_router.address,"Pons router"),o(e.spender??e.router,m[l].ponsTrade.permit2.address,"Pons spender"),!e.data)throw new r("Pons pool quote must include locally reconstructed calldata.");let{swap:n,deadline:w}=h(s.data),a=h(e.data),u=K(c,t,a.swap.poolKey.fee,a.swap.poolKey.tickSpacing);if(o(n.poolKey.currency0,u.currency0,"pool currency0"),o(n.poolKey.currency1,u.currency1,"pool currency1"),o(n.poolKey.hooks,u.hooks,"pool hook"),n.zeroForOne!==i(f(e.from),u.currency0)||n.poolKey.fee!==a.swap.poolKey.fee||n.poolKey.tickSpacing!==a.swap.poolKey.tickSpacing||w!==a.deadline)throw new r("Pons pool direction, parameters or deadline differ from the accepted quote.");return{from:e.from,to:e.to,wallet:e.wallet,amount:n.amountIn}}let p=P({abi:x,data:s.data});if(p.functionName!==(d?"buy":"sell"))throw new r("Pons curve direction does not match the accepted quote.");return o(e.spender??e.router,e.router,"curve spender"),{from:e.from,to:e.to,wallet:p.args[2],amount:p.args[0]}}export{x as a,f as b,K as c,h as d,H as e};
@@ -0,0 +1 @@
1
+ import{h as Le}from"./5Y457HYC.js";import{m as le}from"./OUXPOFY2.js";import{e as Z,f as O,h as H,i as y,j as d,k as de,l as ke,m as W,o as U,p as u}from"./UMY6SP7C.js";import{b as q,i as Pe,j as ue,k as X}from"./CJMVRV34.js";import{a as c}from"./XSD5NL7J.js";import{decodeAbiParameters as Ge,decodeFunctionResult as We,encodeAbiParameters as z,encodeFunctionData as M,getAddress as D,keccak256 as N,parseAbi as _,parseAbiParameters as ze,toHex as _e,zeroAddress as x}from"viem";var mt="Pay Later requires a separate vault and family custody with beneficiary and premium terms; this launch does not create or fund that vault.",R=["premiumBps","strikeMarkupBps","tenor","priceWindowBlocks","maxBlockDepthBps","anchorDecayBlocks","topGuardBps","minOrderUnits","maxOrderUnits","maxUnitsPerBlock","maxActiveUnits","maxInventory","minPremium"],ie=[16,16,32,16,16,32,16,128,128,128,128,128,128],ye={type:"tuple",components:R.map((e,t)=>({name:e,type:`uint${ie[t]}`}))},Be=_(["function createVault(bytes32 familyId, uint8 member, (uint16 premiumBps,uint16 strikeMarkupBps,uint32 tenor,uint16 priceWindowBlocks,uint16 maxBlockDepthBps,uint32 anchorDecayBlocks,uint16 topGuardBps,uint128 minOrderUnits,uint128 maxOrderUnits,uint128 maxUnitsPerBlock,uint128 maxActiveUnits,uint128 maxInventory,uint128 minPremium) terms) returns (address vault)"]);function ee(e){let t=Z(e,R,R),r=R.map((o,i)=>O(t[o],ie[i]));if(r[0]<100n||r[0]>5000n||r[1]>5000n||r[2]<300n||r[2]>604800n||r[3]<1n||r[3]>64n||r[4]<1n||r[4]>100n||r[5]<300n||r[5]>50400n||r[6]>5000n||r[7]<1n||r[7]>r[8]||r[8]>r[9]||r[9]>r[10]||r[10]>r[11]||r[11]>10n**36n)throw new c("Pay Later terms violate the immutable economic bounds or nested inventory limits.");return Object.fromEntries(R.map((o,i)=>[o,String(r[i])]))}function $e(e){return Object.fromEntries(R.map((t,r)=>[t,ie[r]<=32?Number(e[t]):BigInt(e[t])]))}function fe(e){return z([ye],[$e(ee(e))])}function Qe(e){if(e.length!==834)throw new c("Pay Later requires exactly thirteen ABI words.");let[t]=Ge([ye],e),r=ee(Object.fromEntries(R.map(o=>[o,String(t[o])])));if(fe(r).toLowerCase()!==e.toLowerCase())throw new c("Pay Later terms are not canonical.");return r}function Ce(e,t,r){let o=H(e),i=O(t,8),n=ee(r);return M({abi:Be,functionName:"createVault",args:[o,Number(i),$e(n)]})}function Oe(e,t,r,o){let i=Qe(e);if(!/^0x[0-9a-fA-F]{40}$/.test(t)||!/^0x[0-9a-fA-F]{40}$/.test(r)||/^0x0{40}$/i.test(t)||/^0x0{40}$/i.test(r)||!Number.isInteger(o)||o<2e3||o>5e3)throw new c("Pay Later requires nonzero beneficiary and protocol recipient and a protocol share of 2000\u20135000 bps.");return`Pay Later: beneficiary ${t}, protocol recipient ${r}, protocol premium share ${o} bps. Immutable terms: ${R.map(n=>`${n} ${i[n]}`).join(", ")}. After the owner transfers the entire family and the beneficiary accepts, the vault owns the LP family through the Launcher; its LP principal cannot be removed while held by the vault. The beneficiary can start a two-step release of the family. Harvested subject-token fees become vault inventory up to maxInventory; excess subject and other-currency fees are owed to the beneficiary. The beneficiary can withdraw free inventory and earnings; reserved inventory remains in the vault to cover open orders, including after a family release. At order opening the buyer pays the quote-currency premium to the vault and its subject inventory is reserved: premium = max(ceil(strike \xD7 premiumBps / 10000), minPremium). The vault credits floor(premium \xD7 ${o} / 10000) to the protocol recipient, payable by anyone through payProtocol, and the rest to beneficiary earnings, withdrawable by the beneficiary. The buyer may exercise in a later block strictly before expiry (open timestamp plus tenor), in full or in parts, paying the cumulative pro-rata strike rounded up in quote; the vault credits the strike to beneficiary earnings and delivers the exercised subject tokens to the buyer's chosen recipient. At expiry anyone may return unexercised units to free inventory; the premium is not refunded. Token resale or profit is not guaranteed. Creation, transfer and acceptance are separate actions requiring fresh chain checks and confirmations.`}var we=_(["function transferFamily(bytes32 familyId,address newOwner,uint16 claims)","function acceptFamily(bytes32 familyId)"]),oe=_(["function acceptFamily()","function releaseFamily()","function withdrawEarnings(address currency,address to,uint256 amount)","function withdrawInventory(address to,uint128 amount)"]);function Ye(e,t,r){let o=H(e),i=y(t),n=O(r,16);if(i===x)throw new c("Pay Later vault must be nonzero.");return M({abi:we,functionName:"transferFamily",args:[o,i,Number(n)]})}function Ke(e){return M({abi:we,functionName:"transferFamily",args:[H(e),x,0]})}function Je(){return M({abi:oe,functionName:"acceptFamily"})}function Xe(){return M({abi:oe,functionName:"releaseFamily"})}function Ze(e){return M({abi:we,functionName:"acceptFamily",args:[H(e)]})}function Se(e){let t=y(e);if(t===x)throw new c("Pay Later withdrawal recipient must be nonzero.");return t}function Ne(e,t,r){return M({abi:oe,functionName:"withdrawEarnings",args:[y(e),Se(t),O(r)]})}function et(e,t){return M({abi:oe,functionName:"withdrawInventory",args:[Se(e),O(t,128)]})}var L="0xFc3e9e435C79e1712CF949C6ea921fA165cadEf3",Re="0x2f66c525278406c6261d911135b17bd618578a9bf910aff17d426e438180e050",B=_(["function launcher() view returns (address)","function registry() view returns (address)","function protocolShareBps() view returns (uint16)","function minTopGuardBps() view returns (uint16)","function minDynamicFeeSpanPips() view returns (uint24)","function bandReachBps(bytes32,uint8) view returns (uint256)","function vaultOf(bytes32,address) view returns (address)","function isVault(address) view returns (bool)"]),S=(e,t)=>String(e).toLowerCase()===String(t).toLowerCase(),ae=e=>e===x?"native ETH":e;async function je(e,t,r,o){let i=D(q.launcherV1),n=W(await u(e,i,U("launcherV1"),"position",[r,o],t)),l=W(n.key),m=y(l.currency0),f=y(l.currency1),a=y(l.hooks),P=Number(d(l.fee,24)),{tickSpacing:v}=l,{tickLower:b,tickUpper:j}=n;if(typeof v!="number"||!Number.isInteger(v)||typeof b!="number"||typeof j!="number")throw new c("Pay Later reference position is incomplete.");if(a!==D(q.rootV1))throw new c("Pay Later reference root is not the reviewed current root.");let $=N(z(ze("address,address,uint24,int24,address"),[m,f,P,v,a])),C=W(await u(e,a,U("rootV1"),"poolConfig",[$],t)),A=y(C.rules);await Pe(e,t,[i,a,A]);let g=y(await u(e,A,_(["function protocolRecipient() view returns (address)"]),"protocolRecipient",[],t));return{currency0:m,currency1:f,root:a,poolId:$,rules:A,subject:y(C.subject),quote:y(C.quote),baseLpFeePips:d(C.baseLpFeePips,24),liquidity:d(n.liquidity,128),tickLower:b,tickUpper:j,protocolRecipient:g}}async function he(e,t,r,o){let i=D(q.launcherV1);return Promise.all(Array.from({length:o},async(n,l)=>{let m=W(await u(e,i,U("launcherV1"),"position",[r,l],t)),f=W(m.key);return{member:l,currency0:y(f.currency0),currency1:y(f.currency1),liquidity:d(m.liquidity,128),tickLower:m.tickLower,tickUpper:m.tickUpper}}))}function re(e){return e.map(t=>`member ${t.member}, currencies ${t.currency0}/${t.currency1}, liquidity ${t.liquidity}, ticks ${t.tickLower}/${t.tickUpper}`).join("; ")}function pe(e,t){let r=o=>(t>>o&1)===1?"as a PoolManager claim":"as tokens";return e.map(o=>`member ${o.member}: ${ae(o.currency0)} ${r(2*o.member)}, ${ae(o.currency1)} ${r(2*o.member+1)}`).join("; ")}var xe="A PoolManager claim is a balance recorded inside the Uniswap PoolManager, not tokens in the wallet. Oak has no tool to redeem PoolManager claims.";async function tt(e,t,r,o){let i=Z(r,["familyId","member","terms","protocolRecipient","protocolShareBps"],["familyId","member","terms","protocolRecipient","protocolShareBps"]),n=y(o),l=H(i.familyId),m=Number(O(i.member,8)),f=ee(i.terms),a=y(i.protocolRecipient),P=Number(O(i.protocolShareBps,16));if(n===x||a===x||P<2e3||P>5e3)throw new c("Pay Later needs nonzero owner and protocol recipient and a protocol share of 2000\u20135000 bps.");let v=await ue(e,t),b=D(q.launcherV1),j=D(q.registry),[$,C,A,g,E,Q,I,s,p,F,se]=await Promise.all([e.getCode({address:L,blockNumber:t}),u(e,L,B,"launcher",[],t),u(e,L,B,"registry",[],t),u(e,L,B,"protocolShareBps",[],t),u(e,L,B,"minTopGuardBps",[],t),u(e,L,B,"minDynamicFeeSpanPips",[],t),u(e,L,B,"bandReachBps",[l,m],t),u(e,L,B,"vaultOf",[l,n],t),u(e,b,U("launcherV1"),"familyOwner",[l],t),u(e,b,U("launcherV1"),"pendingFamilyOwner",[l],t),u(e,b,U("launcherV1"),"memberCount",[l],t)]);if(!$||N($)!==Re||!S(C,b)||!S(A,j))throw new c("Pay Later factory runtime, launcher or registry does not match the reviewed deployment.");if(!S(p,n)||!S(s,x)||!Array.isArray(F)||!S(F[0],x))throw new c("Pay Later needs the current family owner, no existing beneficiary vault and no pending family transfer.");let Y=d(se,8);if(Y<1n||Y>8n||BigInt(m)>=Y)throw new c("Pay Later member exceeds the live family member count.");if(d(g,16)!==BigInt(P)||BigInt(f.topGuardBps)<d(E,16)||d(I)<100000n)throw new c("Pay Later protocol share, top guard floor or band reach differs from the requested listing.");let k=await je(e,t,l,m);if(k.liquidity===0n)throw new c("Pay Later reference position is incomplete or has no liquidity.");if(k.protocolRecipient!==a||BigInt(f.maxBlockDepthBps)*400n>k.baseLpFeePips)throw new c("Pay Later protocol recipient or depth share does not match the reference pool.");let K=await he(e,t,l,Number(Y)),G=Ce(l,String(m),f),w;try{let te=await e.call({account:n,to:L,data:G,blockNumber:t});if(!te.data)throw new Error("empty");w=te.data}catch{throw new c("Pay Later createVault simulation failed at the named block; listing, dynamic fee, family or custody requirements are not satisfied.")}let J=We({abi:Be,functionName:"createVault",data:w});if(J===x)throw new c("Pay Later factory predicted a zero vault.");return await X(e,v),{block:v,familyId:l,member:m,owner:n,vault:J,poolId:k.poolId,root:k.root,rules:k.rules,familyPositions:K,subject:k.subject,quote:k.quote,liquidity:k.liquidity,terms:f,protocolRecipient:a,protocolShareBps:P,minDynamicFeeSpanPips:d(Q,24),bandReachBps:d(I),summary:`${Oe(fe(f),n,a,P)} Family ${l}, member ${m}, vault ${J}. Creating the vault moves nothing. Positions that would later enter vault custody: ${re(K)}. Whether fees already accrued are paid as tokens or as PoolManager claims is chosen at the transfer step. Creation, transfer and acceptance are separate confirmations; repeat checks and simulate each immediately before signing.`}}var Ae={launcher:[3354,4191,5647,9253,9716,11135,11275,12237],poolManager:[1327,1907,2912,3967,5926,7408,9165,10771,13734,14082],root:[1139],familyId:[3315,4150,5603,8928,9654,11234,12196],member:[1212,12340],memberCount:[3267,11748],poolId:[2879,3934,5893,7375,9055,10738,13701,14049],subject:[4333,5106,7974,11416,12058,13931,14697,15021,16987],quote:[3690,6644,7850,11912,13993,14776,15260],subjectIsCurrency0:[2680,15880],beneficiary:[1772,3212,4920,5279,10829,12135],termsHash:[3016],bandLiquidity:[8995,12429,16471],bandTickLower:[5969,8866],bandTickUpper:[7077,10959],anchorCeiling:[2741,13779,14140,16409],anchorDecayBlocks:[2258,13832],topGuardBps:[3830],guardPrice:[2800,6988],protocolRecipient:[3759,11874],protocolShareBps:[6583,10900]};function nt(e,t){Le(e,17333,"0x2d650492c4352eebba37441fa43b06ca3c8c9f0aa7106c806c9f6ab44162f45b",Ae,t)}var rt=_(["function poolManager() view returns (address)","function memberCount() view returns (uint8)","function subjectIsCurrency0() view returns (bool)","function termsHash() view returns (bytes32)","function bandTickLower() view returns (int24)","function bandTickUpper() view returns (int24)","function anchorCeiling() view returns (uint256)","function anchorDecayBlocks() view returns (uint256)","function topGuardBps() view returns (uint256)","function guardPrice() view returns (uint256)","function root() view returns (address)","function poolId() view returns (bytes32)","function subject() view returns (address)","function quote() view returns (address)","function beneficiary() view returns (address)","function launcher() view returns (address)","function familyId() view returns (bytes32)","function member() view returns (uint8)","function protocolRecipient() view returns (address)","function protocolShareBps() view returns (uint256)","function bandLiquidity() view returns (uint128)","function custodyReachBps() view returns (uint256)","function terms() view returns ((uint16 premiumBps,uint16 strikeMarkupBps,uint32 tenor,uint16 priceWindowBlocks,uint16 maxBlockDepthBps,uint32 anchorDecayBlocks,uint16 topGuardBps,uint128 minOrderUnits,uint128 maxOrderUnits,uint128 maxUnitsPerBlock,uint128 maxActiveUnits,uint128 maxInventory,uint128 minPremium))"]),Ie=["poolManager","memberCount","subjectIsCurrency0","termsHash","bandTickLower","bandTickUpper","anchorCeiling","anchorDecayBlocks","topGuardBps","guardPrice","root","poolId","subject","quote","beneficiary","launcher","familyId","member","protocolRecipient","protocolShareBps","bandLiquidity","custodyReachBps","terms"],V=_(["function accountedFree() view returns (uint128)","function accountedReserved() view returns (uint128)","function owed(address) view returns (uint256)","function protocolOwed() view returns (uint256)","function nextPositionId() view returns (uint256)","function accountingInvariant() view returns (bool)"]);function at(e,t,r){if(e)return le(r);let o=le(t);return((1n<<192n)+o-1n)/o}async function qe(e,t,r,o){let i=y(o),n=H(r);if(i===x)throw new c("Pay Later custody needs the beneficiary wallet.");let l=await ue(e,t),m=D(q.launcherV1),f=U("launcherV1"),[a,P,v,b,j,$,C,A]=await Promise.all([e.getCode({address:L,blockNumber:t}),u(e,L,B,"launcher",[],t),u(e,L,B,"registry",[],t),u(e,L,B,"protocolShareBps",[],t),u(e,L,B,"vaultOf",[n,i],t),u(e,m,f,"familyOwner",[n],t),u(e,m,f,"pendingFamilyOwner",[n],t),u(e,m,f,"memberCount",[n],t)]);if(!a||N(a)!==Re||!S(P,m)||!S(v,q.registry))throw new c("Pay Later factory runtime, launcher or registry does not match the reviewed deployment.");let g=y(j);if(g===x)throw new c("This wallet has no Pay Later vault for this family; only the beneficiary that created a vault can act on it.");let[E,Q,...I]=await Promise.all([e.getCode({address:g,blockNumber:t}),u(e,L,B,"isVault",[g],t),...Ie.map(h=>u(e,g,rt,h,[],t))]);if(!E)throw new c("Pay Later vault has not been created.");let s=Object.fromEntries(Ie.map((h,T)=>[h,I[T]])),p=W(s.terms),F=ee(Object.fromEntries(R.map(h=>[h,String(p[h])]))),se=["launcher","poolManager","root","subject","quote","beneficiary","protocolRecipient"],Y=["familyId","poolId","termsHash"],k={};for(let h of Object.keys(Ae))if(se.includes(h))k[h]=z([{type:"address"}],[y(s[h])]);else if(Y.includes(h))k[h]=H(s[h]);else if(h==="subjectIsCurrency0")k[h]=z([{type:"bool"}],[de(s[h])]);else if(h==="bandTickLower"||h==="bandTickUpper"){let T=s[h];if(typeof T!="number"||!Number.isInteger(T)||T<-8388608||T>8388607)throw new c("Pay Later vault tick is invalid.");k[h]=z([{type:"int24"}],[T])}else k[h]=z([{type:"uint256"}],[d(s[h])]);if(nt(E,k),Q!==!0||y(s.beneficiary)!==i||!S(s.launcher,m)||!S(s.familyId,n))throw new c("Pay Later vault beneficiary, family or factory attestation does not match this wallet and family.");let K=Number(d(s.member,8)),G=d(A,8);if(G<1n||G>8n||BigInt(K)>=G||d(s.memberCount,8)!==G)throw new c("Pay Later vault member does not fit the live family member count.");let w=await je(e,t,n,K),[J,te,Te,He,Ue,Ve,De]=await Promise.all([u(e,g,V,"accountedFree",[],t),u(e,g,V,"accountedReserved",[],t),u(e,g,V,"owed",[w.subject],t),u(e,g,V,"owed",[w.quote],t),u(e,g,V,"protocolOwed",[],t),u(e,g,V,"nextPositionId",[],t),u(e,g,V,"accountingInvariant",[],t)]),Me=N(_e("Terms(uint16 premiumBps,uint16 strikeMarkupBps,uint32 tenor,uint16 priceWindowBlocks,uint16 maxBlockDepthBps,uint32 anchorDecayBlocks,uint16 topGuardBps,uint128 minOrderUnits,uint128 maxOrderUnits,uint128 maxUnitsPerBlock,uint128 maxActiveUnits,uint128 maxInventory,uint128 minPremium)")),Ee=N(z([{type:"bytes32"},...ye.components],[Me,...R.map((h,T)=>ie[T]<=32?Number(F[h]):BigInt(F[h]))])),ce=w.subject===w.currency0,ne=at(ce,w.tickLower,w.tickUpper),be=ne*ne/(1n<<96n)*(10000n-BigInt(F.topGuardBps))/10000n,ge=d(b,16);if(y(s.poolManager)!==D(q.poolManager)||y(s.root)!==w.root||!S(s.poolId,w.poolId)||y(s.subject)!==w.subject||y(s.quote)!==w.quote||s.subjectIsCurrency0!==ce||s.bandTickLower!==w.tickLower||s.bandTickUpper!==w.tickUpper||!S(s.termsHash,Ee)||d(s.anchorDecayBlocks)!==BigInt(F.anchorDecayBlocks)||d(s.topGuardBps)!==BigInt(F.topGuardBps)||d(s.anchorCeiling)!==ne||d(s.guardPrice)!==be||y(s.protocolRecipient)!==w.protocolRecipient||d(s.protocolShareBps)!==ge)throw new c("Pay Later vault immutables differ from the pool, band, terms or protocol recipient derived from the chain for this family.");let ve=ke(C,2);return await X(e,l),{block:l,familyId:n,owner:i,vault:g,member:K,memberCount:Number(G),poolId:w.poolId,root:w.root,rules:w.rules,subject:w.subject,quote:w.quote,subjectIsCurrency0:ce,terms:F,protocolRecipient:w.protocolRecipient,protocolShareBps:Number(ge),familyOwner:y($),pendingOwner:y(ve[0]),pendingClaims:Number(d(ve[1],16)),liquidity:w.liquidity,bandLiquidity:d(s.bandLiquidity,128),bandTickLower:w.tickLower,bandTickUpper:w.tickUpper,anchorCeiling:ne,guardPrice:be,custodyReachBps:d(s.custodyReachBps),accountedFree:d(J,128),accountedReserved:d(te,128),owedSubject:d(Te),owedQuote:d(He),protocolOwed:d(Ue),nextPositionId:d(Ve),accountingInvariant:de(De)}}var Fe=e=>`Pay Later family ${e.familyId}, reference member ${e.member}, vault ${e.vault}, beneficiary ${e.owner}.`,me={transfer:["familyId","claims"],cancel:["familyId"],accept:["familyId"],release:["familyId"],"accept-back":["familyId"],"withdraw-earnings":["familyId","currency","amount"],"withdraw-inventory":["familyId","amount"]};async function pt(e,t,r,o,i){if(i==="create"){let p=await tt(e,t,r,o);return{step:i,action:{to:L,data:Ce(p.familyId,String(p.member),p.terms)},block:p.block,familyId:p.familyId,member:p.member,vault:p.vault,beneficiary:p.owner,summary:p.summary,plan:p}}if(!Object.hasOwn(me,i))throw new c("Choose a Pay Later step: create, transfer, cancel, accept, release, accept-back, withdraw-earnings or withdraw-inventory.");let n=Z(r,me[i],me[i]),l=i==="transfer"?Number(O(n.claims,16)):0,m=i==="withdraw-earnings"?y(n.currency):x,f=i==="withdraw-earnings"?O(n.amount):i==="withdraw-inventory"?O(n.amount,128):0n,a=await qe(e,t,n.familyId,o),{familyId:P,owner:v,vault:b}=a,j=D(q.launcherV1),$=a.familyOwner===v,C=a.familyOwner===b,A=(1<<2*a.memberCount)-1,g=()=>he(e,t,P,a.memberCount),E=()=>{if(a.liquidity<a.bandLiquidity||a.custodyReachBps<100000n)throw new c("Pay Later vault custody requires the frozen band liquidity and at least 100000 bps reach.")},Q=p=>{if(f===0n||f>p)throw new c(`Pay Later ${i} amount must be above zero and at most ${p}, the amount available at the named block.`)},I,s;if(i==="transfer"){if(l>>2*a.memberCount!==0)throw new c(`Pay Later claims mask ${l} selects a member beyond the ${a.memberCount} in this family.`);if(!$||a.pendingOwner!==x)throw new c("Pay Later transfer needs this wallet to own the family with no pending transfer; cancel a pending transfer first.");E();let p=await g();I={to:j,data:Ye(P,b,String(l))},s=`Start the transfer of the entire family to the vault. Nothing moves until the separate accept step. Positions: ${re(p)}. When the vault accepts, fees already accrued are paid to this wallet, the current owner: ${pe(p,l)}. ${xe} To change this choice before acceptance, use the cancel step and start the transfer again.`}else if(i==="cancel"){if(!$)throw new c("Pay Later cancel needs this wallet to own the family.");if(a.pendingOwner===x)throw new c("Pay Later cancel found no pending family transfer to cancel.");I={to:j,data:Ke(P)},s=`Cancel the pending transfer to ${a.pendingOwner}${a.pendingOwner===b?" (the vault)":""}. The pending owner is set to the zero address, so nobody can accept it and this wallet keeps the family. A new transfer can then be started with a different choice of how accrued fees are paid.`}else if(i==="accept"){if(!$||a.pendingOwner!==b)throw new c("Pay Later accept needs this wallet to own the family and a pending transfer to the vault.");E();let p=await g();I={to:b,data:Je()},s=`Accept custody of the entire family into the vault. Positions: ${re(p)}. Fees already accrued are paid to this wallet, the previous owner, as set when the transfer was started: ${pe(p,a.pendingClaims)}. ${xe} ${Oe(fe(a.terms),v,a.protocolRecipient,a.protocolShareBps)}`}else if(i==="release"){if(!C)throw new c("Pay Later release needs the vault to own the family.");if(a.pendingOwner!==x)throw new c("Pay Later release is already pending back to the beneficiary; the next step is accept-back.");I={to:b,data:Xe()},s=`Release the family from vault custody. This starts a two-step hand-back to the beneficiary ${v} with every fee-claim bit set (mask ${A}). The vault still owns the family until the next step, accept-back, is sent by this wallet; reserved inventory stays in the vault to cover open orders (${a.accountedReserved} subject base units reserved at this block). Free inventory and earnings remain withdrawable by the beneficiary.`}else if(i==="accept-back"){if(!C||a.pendingOwner!==v||a.pendingClaims!==A)throw new c("Pay Later accept-back needs the vault to own the family and the released family pending back to this wallet with every fee-claim bit set.");let p=await g();I={to:j,data:Ze(P)},s=`Accept the released family back from the vault: this wallet becomes the owner of every family position again. Positions: ${re(p)}. Fees accrued at acceptance are paid to the previous owner, which is the vault ${b}, as PoolManager claims. They are not paid to this wallet; the vault's redeemClaims, which anyone may call, turns them into vault inventory or beneficiary earnings. Oak has no tool to redeem PoolManager claims. Reserved inventory (${a.accountedReserved} subject base units) stays in the vault to cover open orders.`}else if(i==="withdraw-earnings"){let p=m===a.subject?a.owedSubject:m===a.quote?a.owedQuote:d(await u(e,b,V,"owed",[m],t));Q(p),I={to:b,data:Ne(m,v,String(f))},s=`Withdraw ${f} base units of ${ae(m)} from the earnings the vault owes its beneficiary (${p} owed at this block) to the beneficiary wallet ${v}. No other recipient can be chosen.`}else Q(a.accountedFree),I={to:b,data:et(v,String(f))},s=`Withdraw ${f} base units of the subject token ${a.subject} from the vault's free inventory (${a.accountedFree} free at this block; ${a.accountedReserved} reserved for open orders and not withdrawable) to the beneficiary wallet ${v}. No other recipient can be chosen.`;try{await e.call({account:v,to:I.to,data:I.data,blockNumber:t})}catch{throw new c(`Pay Later ${i} simulation failed at the named block; refresh the custody conditions.`)}return await X(e,a.block),{step:i,action:I,block:a.block,familyId:P,member:a.member,vault:b,beneficiary:v,summary:`${Fe(a)} ${s}`}}function it(e){return e.familyOwner===e.vault?e.pendingOwner===e.owner?"released, pending back to beneficiary":"in custody":e.familyOwner===e.owner?e.pendingOwner===e.vault?"transfer pending to vault":"not transferred":"family held by another owner"}async function yt(e,t,r,o){let i=Z(r,["familyId"],["familyId"]),n=await qe(e,t,i.familyId,o),l=await he(e,t,n.familyId,n.memberCount);await X(e,n.block);let m=it(n),f=n.pendingOwner===x?"no transfer is pending":`on acceptance by ${n.pendingOwner}, accrued fees are paid to the current owner ${n.familyOwner}: ${pe(l,n.pendingClaims)}`,a=`${Fe(n)} Custody: ${m}. Family owner ${n.familyOwner}; pending owner ${n.pendingOwner}; ${f}. Subject ${n.subject}, quote ${ae(n.quote)}, pool ${n.poolId}. Inventory in subject base units: ${n.accountedFree} free and withdrawable, ${n.accountedReserved} reserved for open orders. Owed to the beneficiary in base units: ${n.owedSubject} subject, ${n.owedQuote} quote. Owed to the protocol recipient ${n.protocolRecipient}: ${n.protocolOwed} quote. Next position ID ${n.nextPositionId}. Band reach ${n.custodyReachBps} bps; the vault accepts custody only at 100000 or more. The vault's accounting invariant ${n.accountingInvariant?"holds":"DOES NOT hold: its balances are below what it has accounted"}. Protocol premium share ${n.protocolShareBps} bps. Immutable terms: ${R.map(P=>`${P} ${n.terms[P]}`).join(", ")}.`;return{block:{number:String(n.block.number),hash:n.block.hash,timestamp:String(n.block.timestamp)},vault:n.vault,beneficiary:n.owner,familyId:n.familyId,member:String(n.member),memberCount:String(n.memberCount),custody:m,familyOwner:n.familyOwner,pendingOwner:n.pendingOwner,pendingClaims:String(n.pendingClaims),pendingClaimsWords:f,poolId:n.poolId,root:n.root,rules:n.rules,subject:n.subject,quote:n.quote,protocolRecipient:n.protocolRecipient,protocolShareBps:String(n.protocolShareBps),accountedFree:String(n.accountedFree),accountedReserved:String(n.accountedReserved),owedSubject:String(n.owedSubject),owedQuote:String(n.owedQuote),protocolOwed:String(n.protocolOwed),nextPositionId:String(n.nextPositionId),custodyReachBps:String(n.custodyReachBps),accountingInvariant:n.accountingInvariant,bandLiquidity:String(n.bandLiquidity),liveBandLiquidity:String(n.liquidity),bandTickLower:String(n.bandTickLower),bandTickUpper:String(n.bandTickUpper),anchorCeiling:String(n.anchorCeiling),guardPrice:String(n.guardPrice),terms:n.terms,summary:a}}export{mt as a,fe as b,Qe as c,Ce as d,Oe as e,Ye as f,Ke as g,Je as h,Xe as i,Ze as j,Ne as k,et as l,L as m,Re as n,tt as o,Ae as p,nt as q,at as r,qe as s,pt as t,yt as u};
@@ -1 +1 @@
1
- import{b as Ce,o as le}from"./GYPMUYB5.js";import{a as ue}from"./Z7FGEWO2.js";import{b as Ne}from"./SPJCSEKP.js";import{a as Ae}from"./IOYRL6AY.js";import{a as ve}from"./66F5ZH34.js";import{e as X,g as p,i as xe,n as Ie}from"./NWNYJ26T.js";import{b as A,j as Te}from"./TI727O2H.js";import{a as r}from"./XSD5NL7J.js";import{a as de}from"./JXOEJPJ4.js";import{decodeErrorResult as Me,decodeEventLog as ce,encodeAbiParameters as U,encodeFunctionData as C,erc20Abi as J,parseAbi as $e,parseAbiParameters as q,toHex as Be,zeroAddress as F}from"viem";var g=Te[A].poolsTrade,Y=g.liquidityLauncher.address,B=g.uerc20BeneficiaryVault.address,fe=g.universalRouter.address,ie=10n**27n,j=(1n<<128n)-1n,Se=`0x${"00".repeat(32)}`,D=63127652n,pe=100000n,ae=10000000n,Ue=2000n,me={address:ue,symbol:"ETH",decimals:18,chainId:A},h=$e(["function multicall(bytes[] data) payable returns (bytes[])","function createToken(address factory,string name,string symbol,uint8 decimals,uint128 initialSupply,address recipient,bytes tokenData) payable returns (address)","function distributeToken(address token,(address strategy,uint128 amount,bytes configData) distribution,bytes32 salt) payable","function distributeWithNative(address strategy,bytes configData,bytes32 salt,uint256 nativeAmount) payable","function getGraffiti(address sender) view returns (bytes32)","function getUERC20Address(string name,string symbol,uint8 decimals,address recipient,bytes32 graffiti) view returns (address)","function execute(bytes commands,bytes[] inputs,uint256 deadline) payable","function collectFees(uint256[] ids)","function claim(uint256 id,uint256 minCurrency0Amount,uint256 minCurrency1Amount)","function amounts(uint256 id) view returns (uint128 eth,uint128 token)","function ownerOf(uint256 id) view returns (address)","function getApproved(uint256 id) view returns (address)","function approve(address spender,uint256 id)","function safeTransferFrom(address from,address to,uint256 id)","function approve(address token,address spender,uint160 amount,uint48 expiration)","error V4TooLittleReceived(uint256 minAmountOut,uint256 amountOut)"]),K=$e(["event TokenLaunched(bytes32 indexed poolId,address indexed token,address indexed feeSplitter,(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey)","event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"]),V=[g.instantLaunchStrategyFeesOn.address,g.instantLaunchStrategyFeesOff.address];function re(l){if(l.status!=="success")throw new r("The launch receipt did not succeed.");let c=[];for(let k of l.logs){let H=V.findIndex(L=>p(L,k.address));if(H===-1||k.topics[0]!=="0x3b3d2bafdcae274a232217e1f80ee4305d3af6aa25c8b14b1681bd68d18042a4")continue;let G=ce({abi:K,eventName:"TokenLaunched",data:k.data,topics:[...k.topics]}),{token:x,poolId:ee,poolKey:M,feeSplitter:te}=G.args,_=H===0?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address;if(!p(te,_)||!p(M.currency0,F)||!p(M.currency1,x)||M.fee!==2500||M.tickSpacing!==25||!p(M.hooks,F))throw new r("The launch does not match the current native ETH strategy.");let ne=l.logs.filter(L=>p(L.address,g.v4PositionManager.address)).flatMap(L=>{if(L.topics[0]!=="0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")return[];let O=ce({abi:K,eventName:"Transfer",data:L.data,topics:[...L.topics]}).args;return p(O.from,F)&&p(O.to,V[H])?[O.tokenId]:[]});if(ne.length!==1)throw new r("The launch receipt must identify one matching position mint.");c.push({token:x,poolId:ee,positionId:ne[0].toString(),creatorFees:H===0})}return c}function S(l){return xe(l,"Provide a valid wallet or token address.")}function P(l,c,k=!1){return Ie(l,`${c} is outside its supported range.`,{notString:`${c} must be an integer string in base units.`,positive:!k})}function Z(l,c,k=!1){if(k&&l===void 0)return"";if(typeof l!="string"||!k&&!l.trim()||l.length>4096)throw new r(`Provide a valid ${c}.`);return l}function he(l){if(typeof l!="string"||!/^0x[0-9a-fA-F]{64}$/.test(l))throw new r("Provide a valid launch transaction hash.");return l}function ge(l,c,k="minAmountOut"){let H=c.slippageBps??Ce;if(typeof H!="number")throw new r("Slippage must be an integer in basis points.");let G=le(l.toString(),H),x=c[k]===void 0?BigInt(G):P(c[k],k,l===0n);if(x>l||l>0n&&x===0n||x>j)throw new r("The minimum output must be positive and no larger than the simulated output.");return x}var qe=l=>{let c=l.clientFor(A),k=(e,o,n,s)=>l.unsignedTx({to:e,data:o,value:n.toString(),chainId:A,description:s}),H=e=>{throw new r(l.plainError(e))};async function G(){if(await c.getChainId()!==A)throw new r("pools.trade requires Robinhood Chain 4663.")}async function x(e,o,n){let s=await l.preview(e,o),t=s.changes.map(({token:a,amount:d})=>{let i=d.startsWith("-");return`${i?"-":""}${l.formatAmount(i?d.slice(1):d,a.decimals)} ${de(a.symbol)} (${a.address}, chain ${a.chainId})`});return{txs:e,summary:[n,s.summary,...t].join(" ")}}async function ee(){return(await c.getBlock()).timestamp+600n}function M(e,o,n,s,t,a){let d=[F,e,2500,25,F],i=[U(q("((address,address,uint24,int24,address),bool,uint128,uint128,uint256,bytes)"),[[d,o,n,s,0n,"0x"]]),U(q("address,uint256"),[o?F:e,n]),U(q("address,address,uint256"),[o?e:F,t,0n])],m=[U(q("bytes,bytes[]"),["0x060c0e",i])];return{inputs:m,encoded:U(q("bytes,bytes[],uint256"),["0x10",m,a])}}async function te(e,o){let n=await c.request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:e.map(i=>({from:o,gas:Be(Ae),to:i.to,data:i.data,value:Be(BigInt(i.value))}))}],validation:!1,traceTransfers:!1},"latest"]},{retryCount:0});if(!Array.isArray(n)||n.length!==1||!X(n[0])||!Array.isArray(n[0].calls)||n[0].calls.length!==e.length)throw new r("The output simulation returned a malformed response.");let s=n[0].calls;if(!s.slice(0,-1).every(i=>X(i)&&i.status==="0x1"&&!i.error))throw new r("A prerequisite failed during the output simulation.");let t=s.at(-1);if(!X(t)||t.status!=="0x0")throw new r("The output simulation did not return the expected minimum-output control.");let a=typeof t.returnData=="string"&&t.returnData!=="0x"?t.returnData:X(t.error)?t.error.data:void 0;if(typeof a!="string"||!/^0x[0-9a-fA-F]+$/.test(a))throw new r("The output simulation did not report an expected amount.");let d=Me({abi:h,data:a});if(d.errorName!=="V4TooLittleReceived"||d.args[0]!==j||d.args[1]<=0n||d.args[1]>=j)throw new r("The output simulation did not report a valid amount.");return d.args[1]}let _=new Map,ne=2e3;async function L(e,o,n,s=()=>!0){let t=await c.getBlockNumber(),a=t<D?0n:(t-D)/ae+1n,d=1n,i=(u=1n)=>{if(d+=u,d>Ue)throw new r("Pools.trade scan exceeds the 2000-request limit. Use launchTx for a specific launch; positions coverage is incomplete.")};i(a*BigInt(V.length+(e&&!n?1:0)));let m=new Map,b=new Set;for(let u=D;u<=t&&s();u+=ae){let f=u+ae-1n>t?t:u+ae-1n,y=(await Promise.all(V.map(T=>c.getLogs({address:T,event:K[0],...o?{args:{token:o}}:{},fromBlock:u,toBlock:f,strict:!0})))).flat(),$=[...new Set(y.map(T=>T.transactionHash))].filter(T=>!T||!m.has(T));for(let T=0;T<$.length&&s();T+=8)await Promise.all($.slice(T,T+8).map(async E=>{if(!E)throw new r("A launch log is missing its transaction hash.");let R=_.get(E);R||(i(),R=await c.getTransactionReceipt({hash:E}),_.size>=ne&&_.delete(_.keys().next().value),_.set(E,R)),m.set(E,R),s()&&await n?.(R)}));if(!s())break;if(e&&!n){let T=await c.getLogs({address:B,event:K[1],args:{to:e},fromBlock:u,toBlock:f,strict:!0});for(let E of T){let R=ce({abi:K,eventName:"Transfer",data:E.data,topics:E.topics}).args;b.add(R.tokenId.toString())}}}return{receipts:[...m.values()],feeIds:b}}async function O(e){let n=(e.launchTx!==void 0?[await c.getTransactionReceipt({hash:he(e.launchTx)})]:(await L(void 0,e.token===void 0?void 0:S(e.token))).receipts).flatMap(re).filter(s=>e.positionId!==void 0?s.positionId===P(e.positionId,"positionId").toString():p(s.token,S(e.token)));if(n.length!==1)throw new r("No unique current-strategy launch was found. Older strategy generations are unsupported.");return n[0]}async function Ee(e,o){if(typeof e.creatorFees!="boolean")throw new r("creatorFees must be an explicit boolean; the choice is permanent.");if(e.pair!==void 0&&!p(S(e.pair),F)&&!p(S(e.pair),ue))throw new r("Only the native ETH pair is supported.");if(e.decimals!==void 0&&e.decimals!==18)throw new r("Instant Launch requires 18 decimals.");if(e.supply!==void 0&&P(e.supply,"supply")!==ie)throw new r("Instant Launch requires a supply of one billion tokens.");let n=S(e.feeBeneficiary);if(p(n,F)||p(n,Y))throw new r("The fee beneficiary must be a wallet other than the launcher or zero address.");let s=Z(e.name,"name"),t=Z(e.symbol,"symbol"),a=e.initialBuy===void 0?0n:P(e.initialBuy,"initialBuy",!0);if(a>j)throw new r("The initial buy exceeds uint128.");if(a===0n&&e.minAmountOut!==void 0)throw new r("A minimum output requires an initial buy.");let d=await c.readContract({address:Y,abi:h,functionName:"getGraffiti",args:[o]}),i=S(await c.readContract({address:g.uerc20Factory.address,abi:h,functionName:"getUERC20Address",args:[s,t,18,Y,d]})),m=await c.getCode({address:i});if(m&&m!=="0x")throw new r("This wallet already launched that name and symbol.");let b=U(q("(string,string,string,bytes)"),[[Z(e.description,"description",!0),Z(e.website,"website",!0),Z(e.imageUri,"image URI",!0),"0x"]]),u=e.creatorFees?V[0]:V[1],f=[C({abi:h,functionName:"createToken",args:[g.uerc20Factory.address,s,t,18,ie,Y,b]}),C({abi:h,functionName:"distributeToken",args:[i,{strategy:u,amount:ie,configData:U(q("address"),[n])},Se]})],y=await ee(),v=T=>{let E=[...f];if(a>0n){let R=U(q("(address,address,bytes)"),[[fe,o,M(i,!0,a,T,o,y).encoded]]);E.push(C({abi:h,functionName:"distributeWithNative",args:[g.universalRouterStrategyApp.address,R,Se,a]}))}return k(Y,C({abi:h,functionName:"multicall",args:[E]}),a,`Atomic Instant Launch: creator fees ${e.creatorFees?"on":"off"} (permanent); beneficiary ${n}.`)},$=a>0n?ge(await te([v(j)],o),e):0n;return x([v($)],o,`Launch ${s} (${i}, chain 4663), supply 1000000000, decimals 18. Creator fees ${e.creatorFees?"on":"off"} are permanent; fee beneficiary ${n}. Creator ETH fees come from buys only (recorded 0.09996%); sells compound into locked liquidity. Initial-buy minimum ${$} token base units. Off-chain image/display unproven; no private metadata registration. No transaction sent.`)}async function Fe(e,o,n){let s=P(e.amountIn,"amountIn");if(s>j)throw new r("The trade amount exceeds uint128.");let t=S(e.token);await O(e);let a=await ee(),d=[];n||(await c.readContract({address:t,abi:J,functionName:"allowance",args:[o,g.permit2.address]})<s&&d.push(l.approval(t,g.permit2.address,s.toString(),A)),d.push(k(g.permit2.address,C({abi:h,functionName:"approve",args:[t,fe,s,Number(a)]}),0n,`Permit the exact ${s} token base units until ${a}.`)));let i=u=>[...d,k(fe,C({abi:h,functionName:"execute",args:["0x10",M(t,n,s,u,o,a).inputs,a]}),n?s:0n,`${n?"Buy":"Sell"} ${t} with minimum output ${u}.`)],m=await te(i(j),o),b=ge(m,e);return x(i(b),o,`${n?"Buy":"Sell"} token ${t} (chain 4663, 18 decimals), amountIn ${s}, minimum output ${b} ${n?"token":"ETH"} base units (18 decimals). Recorded swap fee 0.2899%; creator ETH fees from buys only, none from sells. No transaction sent.`)}async function we(e,o,n){let s=await O(e),t=BigInt(s.positionId),a=s.creatorFees?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address,d=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[t]});if(!p(d,a))throw new r("The position is not locked in its current-strategy splitter.");if(!n)return x([k(a,C({abi:h,functionName:"collectFees",args:[[t]]}),0n,`Collect fees for position ${t}; permissionless.`)],o,"Collect fees for the entitled recipients; collection does not transfer creator fees to the collector. No transaction sent.");if(!s.creatorFees)throw new r("Creator fees are permanently disabled for this position.");let i=await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[t]});if(!p(i,o))throw new r("Only the current fee NFT holder is entitled to claim.");let m=await c.readContract({address:B,abi:h,functionName:"amounts",args:[t]}),b=ge(m[0],e,"minEth");if(m[1]!==0n)throw new r("The current buy-only creator fee configuration returned unexpected token fees.");return x([k(B,C({abi:h,functionName:"claim",args:[t,b,0n]}),0n,`Claim collected ETH fees for position ${t} to ${o}.`)],o,`Claim collected fees: ${m[0]} ETH base units (18 decimals), minimum ${b}. Uncollected fees require poolstrade_collect first. No transaction sent.`)}async function Le(e,o){let n=await O(e),s=S(e.to);if(p(s,F))throw new r("The token recipient cannot be the zero address.");let t=P(e.amount,"amount"),a=await oe(n.token,await c.getBlockNumber());return x([k(a.address,C({abi:J,functionName:"transfer",args:[s,t]}),0n,`Transfer exactly ${t} ${de(a.symbol)} base units to ${s}.`)],o,`Transfer ${t} token base units (token ${a.address}, decimals ${a.decimals}, chain ${a.chainId}) to ${s}. No approval; no transaction sent.`)}async function Oe(e,o){if(!Array.isArray(e.positionIds)||e.positionIds.length<1||e.positionIds.length>20||!Array.isArray(e.launchTxs)||e.launchTxs.length!==e.positionIds.length)throw new r("Provide 1 to 20 positionIds and one matching launchTxs entry for each.");let n=e.positionIds.map(d=>P(d,"positionId").toString());if(new Set(n).size!==n.length)throw new r("Each position ID must appear once.");let s=e.launchTxs.map(he),t=new Map;for(let[d,i]of n.entries()){let b=(await O({positionId:i,launchTx:s[d]})).creatorFees?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address,u=BigInt(i),f=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[u]});if(!p(f,b))throw new r("The position is not locked in its current-strategy splitter.");t.set(b,[...t.get(b)??[],u])}let a=[...t].map(([d,i])=>k(d,C({abi:h,functionName:"collectFees",args:[i]}),0n,`Collect fees for positions ${i.join(", ")}; permissionless.`));return x(a,o,"Collect fees in batches for the fixed entitled recipients. Collection does not pay the collector. No transaction sent.")}let Q="Current native ETH Instant Launch strategies only. Crowd Launch and older deployments are not covered.";async function oe(e,o){let[n,s]=await Promise.all([c.readContract({address:e,abi:J,functionName:"symbol",blockNumber:o}),c.readContract({address:e,abi:J,functionName:"decimals",blockNumber:o})]);if(typeof n!="string"||!n||n.length>256||s!==18)throw new r("The current launch token returned invalid metadata.");return{address:e,symbol:n,decimals:s,chainId:A}}async function be(e,o,n,s){let t=s??await oe(e.token,n),a=await c.readContract({address:t.address,abi:J,functionName:"balanceOf",args:[o],blockNumber:n});return{token:t,amount:a.toString(),humanAmount:l.formatAmount(a.toString(),t.decimals)}}async function Pe(e,o){let n=await O(e),s=await c.getBlockNumber();return{wallet:o,...await be(n,o,s),blockNumber:s.toString(),coverage:Q}}async function He(e,o){let n=he(e.launchTx),s=await c.getTransactionReceipt({hash:n}),t=re(s);if(e.token!==void 0&&(t=t.filter(i=>p(i.token,S(e.token)))),e.positionId!==void 0&&(t=t.filter(i=>i.positionId===P(e.positionId,"positionId").toString())),!t.length)throw new r("The receipt contains no matching current Instant Launch. Crowd Launch and older strategies are not covered.");let a=await c.getBlockNumber(),d=await Promise.all(t.map(async i=>{let m=i.creatorFees?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address,b=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:a});if(!p(b,m))throw new r("The position is not locked in its current-strategy splitter.");let u=i.creatorFees?{owner:await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:a}),approved:await c.readContract({address:B,abi:h,functionName:"getApproved",args:[BigInt(i.positionId)],blockNumber:a}),collected:await c.readContract({address:B,abi:h,functionName:"amounts",args:[BigInt(i.positionId)],blockNumber:a})}:void 0,f=await oe(i.token,a);return{...i,token:f,custodian:b,holding:await be(i,o,a,f),...u?{feeEntitlement:{owner:u.owner,approved:u.approved,collected:[{token:me,amount:u.collected[0].toString()},{token:f,amount:u.collected[1].toString()}],uncollectedFeesIncluded:!1}}:{}}}));return{launchTx:n,wallet:o,creator:s.from,blockNumber:a.toString(),launches:d,coverage:Q}}async function Re(e){let o=await c.getBlockNumber(),n=e.limit??20;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>50)throw new r("limit must be an integer from 1 to 50.");let s=e.fromBlock===void 0?o>=D+pe?o-pe+1n:D:P(e.fromBlock,"fromBlock",!0),t=e.toBlock===void 0?o:P(e.toBlock,"toBlock",!0),a=0;if(e.cursor!==void 0){if(typeof e.cursor!="string"||!/^[0-9]{1,78}:[0-9]{1,78}:[0-9]{1,10}$/.test(e.cursor))throw new r("Provide the browse cursor exactly as returned.");let u=e.cursor.split(":"),f=BigInt(u[0]),y=BigInt(u[1]);if(e.fromBlock!==void 0&&s!==f||e.toBlock!==void 0&&t!==y)throw new r("The cursor does not match this block range.");s=f,t=y,a=Number(u[2])}if(o<D&&e.fromBlock===void 0&&e.toBlock===void 0&&e.cursor===void 0)return{launches:[],cursor:null,fromBlock:D.toString(),toBlock:o.toString(),coverage:Q,predeployment:!0};if(s<D||t<s||t>o||t-s>=pe)throw new r("Choose a deployed block range of at most 100000 blocks, ending no later than the current head.");let d=await c.getLogs({address:V,event:K[0],fromBlock:s,toBlock:t,strict:!0});if(d.some(u=>u.blockNumber===null||u.logIndex===null||!u.transactionHash))throw new r("The launch feed returned an incomplete log.");if(d.sort((u,f)=>u.blockNumber===f.blockNumber?f.logIndex-u.logIndex:u.blockNumber>f.blockNumber?-1:1),a>d.length)throw new r("The browse cursor is outside the launch feed.");let i=new Map,m=[];for(let u of d.slice(a,a+n)){let f=u.transactionHash,y=i.get(f);y||(y=await c.getTransactionReceipt({hash:f}),i.set(f,y));let v=ce({abi:K,eventName:"TokenLaunched",data:u.data,topics:u.topics}).args,$=re(y).filter(T=>p(T.token,v.token)&&p(T.poolId,v.poolId));if($.length!==1)throw new r("The launch feed log does not match one verified receipt launch.");m.push({...$[0],launchTx:f,blockNumber:u.blockNumber.toString(),token:await oe($[0].token,t),creator:y.from})}let b=a+n;return{launches:m,cursor:b<d.length?`${s}:${t}:${b}`:null,fromBlock:s.toString(),toBlock:t.toString(),coverage:Q,previousToBlock:s>D?(s-1n).toString():null,summary:"Newest launches first within this fixed block range. Empty does not establish absence outside the range or covered strategies."}}async function ye(e,o,n){let s=await O(e);if(!s.creatorFees)throw new r("Creator fees are permanently disabled for this position.");let t=BigInt(s.positionId),a=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[t]});if(!p(a,g.feeSplitterFeesOn.address))throw new r("The position is not locked in its current-strategy splitter.");let d=await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[t]});if(!p(d,o))throw new r("Only the current fee NFT holder can change this entitlement.");let i=S(n?e.to:e.spender);if(p(i,B)||n&&p(i,F))throw new r("The fee NFT recipient cannot be the vault or zero address.");let m=n?C({abi:h,functionName:"safeTransferFrom",args:[o,i,t]}):C({abi:h,functionName:"approve",args:[i,t]});return x([k(B,m,0n,n?`Transfer fee NFT ${t} to ${i}, including accrued and future fees.`:`Approve ${i} for fee NFT ${t} only; zero address revokes approval.`)],o,n?`Transfer the entire fee entitlement for position ${t} to ${i}. This includes collected and future fees; locked LP remains in its splitter. No transaction sent.`:`Set the exact single-NFT approval for position ${t} to ${i}. This permits transfer of that fee entitlement; zero address revokes. No transaction sent.`)}async function De(){return{chainId:A,instant:{supported:!0,supply:ie.toString(),decimals:18,currency:me,permanentCreatorFeeChoice:!0},crowd:{status:"BLOCKED",strategy:"0xbf1aB81f7d534b2CC0Da76fcf4d541322bB0e000",factory:"0x000000001F26a0044BaA66024e7b6599c61963F8",missing:"A verified Pools-specific auction configuration (BlockNumberish timing, reserve allocation, Q96 floor/tick, USD FDV conversion, issuance steps, locked LP plan) and a bytecode-matched factory-created auction ABI with success/refund fixtures. Generic CCA parameters are not a verified Pools Crowd Launch.",source:"https://github.com/Uniswap/sdks/blob/main/sdks/liquidity-launcher-sdk/src/addresses.ts"},coverage:Q}}let w=e=>({type:"string",description:e}),I=e=>ve(e),se="Launched token contract address (0x + 40 hex digits).",z="Transaction hash (0x + 64 hex digits) of the token launch; lets the tool find the launch without scanning. Optional where the token or position is given.",W='Liquidity position NFT id for the launch, as a decimal string. Example: "1".',ke={chainId:{type:"integer",const:A,description:"Chain id; only 4663 (Robinhood Chain mainnet) is accepted. Optional."},slippageBps:{type:"integer",minimum:0,maximum:9999,description:"Slippage tolerance in basis points (50 = 0.5%) used to derive minimum outputs when none is given. Optional."}};function N(e,o,n,s){return{name:`poolstrade_${e}`,inputSchema:{type:"object",additionalProperties:!1,properties:{...ke,...o},required:n},execute:async(t,a)=>{try{let d=new Set([...Object.keys(ke),...Object.keys(o)]);if(Object.keys(t).some(i=>!d.has(i)))throw new r("Unsupported input for this pools.trade tool.");if(t.chainId!==void 0&&t.chainId!==A)throw new r("pools.trade requires chain 4663.");if(S(a),t.slippageBps!==void 0){if(typeof t.slippageBps!="number")throw new r("Slippage must be an integer in basis points.");le("10000",t.slippageBps)}return await G(),await s(t,a)}catch(d){H(d)}}}}return{tools:[N("launch",{name:w("Token name, shown in wallets and explorers."),symbol:w("Token ticker symbol."),creatorFees:{type:"boolean",description:"Permanent choice; must be explicit. true enables creator fees paid to feeBeneficiary from buys; false disables them forever."},feeBeneficiary:w("Address that receives creator fees; must not be the zero address or the launcher."),pair:w("Optional pair currency; only native ETH is supported (the zero address or the native ETH sentinel)."),decimals:{type:"integer",const:18,description:"Token decimals; must be 18 for an Instant Launch."},supply:I("Total token supply in base units (18 decimals); must be 1000000000000000000000000000 = one billion tokens."),initialBuy:I('ETH to spend on an initial buy in the same transaction, in wei base units (ETH has 18 decimals). Example: "1000000000000000" = 0.001 ETH.'),minAmountOut:I('Least new tokens to receive from the initial buy, in token base units (18 decimals). Requires initialBuy. Example: "1000000000000000000" = 1 token.'),description:w("Optional token description stored in token metadata."),website:w("Optional website URL stored in token metadata."),imageUri:w("Optional image URI stored in token metadata.")},["name","symbol","creatorFees","feeBeneficiary"],Ee),...["buy","sell"].map(e=>N(e,{token:w(se),amountIn:I(e==="buy"?'ETH to spend, in wei base units (ETH has 18 decimals). Example: "1000000000000000" = 0.001 ETH.':'Tokens to sell, in token base units (launched tokens have 18 decimals). Example: "1000000000000000000" = 1 token.'),minAmountOut:I(e==="buy"?'Least tokens to receive, in token base units (18 decimals). Example: "1000000000000000000" = 1 token. Defaults from slippageBps.':'Least ETH to receive, in wei base units (18 decimals). Example: "1000000000000000" = 0.001 ETH. Defaults from slippageBps.'),launchTx:w(z)},["token","amountIn"],(o,n)=>Fe(o,n,e==="buy"))),N("collect",{positionId:I(W),launchTx:w(z)},["positionId"],(e,o)=>we(e,o,!1)),N("claim",{positionId:I(W),launchTx:w(z),minEth:I('Least ETH you must receive from the claim, in wei base units (ETH has 18 decimals). Example: "1000000000000000" = 0.001 ETH.')},["positionId"],(e,o)=>we(e,o,!0)),N("browse",{fromBlock:I("First block number of the scan range, as a decimal string. Defaults to the most recent 100000 blocks."),toBlock:I("Last block number of the scan range, as a decimal string. Defaults to the latest block."),limit:{type:"integer",minimum:1,maximum:50,description:"Launches per page, 1 to 50 (default 20)."},cursor:w("Opaque pagination cursor exactly as returned by the previous browse call.")},[],Re),N("balance",{token:w(se),launchTx:w(z)},["token"],Pe),N("status",{launchTx:w("Transaction hash (0x + 64 hex digits) of the token launch to inspect."),token:w(se),positionId:I(W)},["launchTx"],He),N("launch_options",{},[],De),N("fee_transfer",{positionId:I(W),launchTx:w(z),to:w("Address that will become the new holder of the fee NFT and its future creator fees. Use the intended address.")},["positionId","to"],(e,o)=>ye(e,o,!0)),N("fee_approve",{positionId:I(W),launchTx:w(z),spender:w("Address approved to move the fee NFT. Use the intended address.")},["positionId","spender"],(e,o)=>ye(e,o,!1)),N("transfer",{token:w(se),amount:I('Tokens to send, in token base units (launched tokens have 18 decimals). Example: "1000000000000000000" = 1 token.'),to:w("Recipient address of the tokens; must not be the zero address. Use the intended address."),launchTx:w(z)},["token","amount","to"],Le),N("collect_many",{positionIds:{type:"array",items:I(W),minItems:1,maxItems:20,description:"Position NFT ids to collect fees for, decimal strings; same order as launchTxs."},launchTxs:{type:"array",items:w("Launch transaction hash (0x + 64 hex digits) matching the position id at the same index."),minItems:1,maxItems:20,description:"Launch transaction hashes, one per position id, in the same order."}},["positionIds","launchTxs"],Oe)],positions:async(e,o)=>{S(e);let n=[],s=0,t=!0,a=o?.deepScan?2e4:6e3,d=o?.signal,i,m,b=f=>({module:"poolstrade",id:"poolstrade-discovery-incomplete",chainId:A,assets:[],incomplete:!0,description:`${f} Checked ${s} launch receipts. Readable holdings are retained. Check a known launch with poolstrade_status {"launchTx":"<hash>"} or its token holding with poolstrade_balance {"token":"<address>","launchTx":"<hash>"}. Crowd Launch and older deployments are outside this reader's coverage.`}),u=async()=>{await G(),t&&await L(e,void 0,async f=>{s++;for(let y of re(f)){if(!t)return;let v=y.creatorFees&&p(await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[BigInt(y.positionId)]}),e);if(!t)return;if(!v&&!p(f.from,e))continue;let $=v?[{token:me,amount:(await c.readContract({address:B,abi:h,functionName:"amounts",args:[BigInt(y.positionId)]}))[0].toString()}]:[];t&&n.push({module:"poolstrade",id:y.positionId,chainId:A,assets:$,description:`Current Instant Launch ${y.token} (18 decimals, supply 1000000000), pool ${y.poolId}; creator fees ${y.creatorFees?"on":"off"} (permanent). ${v?"Collected ETH fees only; uncollected fees excluded.":"Launch record; no fee entitlement held."} Liquidity is permanently locked.`})}},()=>t)};try{if(d?.aborted)return[b("Pools.trade discovery was cancelled; the historical scan is incomplete.")];let f=new Promise(v=>{i=()=>{t=!1,v("aborted")},d?.addEventListener("abort",i,{once:!0}),m=setTimeout(()=>{t=!1,v("budget")},a)}),y=await Promise.race([u().then(()=>"complete"),f]);return y==="complete"?n:[...n,b(y==="aborted"?"Pools.trade discovery was cancelled; the historical scan is incomplete.":`Pools.trade global launch discovery reached its ${a} ms read budget; the historical scan is incomplete.`)]}catch(f){return[...n,b(`Pools.trade discovery could not finish: ${l.plainError(f)}`)]}finally{t=!1,m!==void 0&&clearTimeout(m),i&&d?.removeEventListener("abort",i)}}}};function Ye(l){return Ne("poolstrade",[qe(l)])}export{re as a,qe as b,Ye as c};
1
+ import{b as Ce,o as le}from"./TTBB6EFN.js";import{a as ue}from"./7WXAS54T.js";import{b as Ne}from"./SPJCSEKP.js";import{a as Ae}from"./IOYRL6AY.js";import{a as ve}from"./66F5ZH34.js";import{e as X,g as p,i as xe,n as Ie}from"./NWNYJ26T.js";import{b as A,j as Te}from"./EWZFZUVF.js";import{a as r}from"./XSD5NL7J.js";import{a as de}from"./JXOEJPJ4.js";import{decodeErrorResult as Me,decodeEventLog as ce,encodeAbiParameters as U,encodeFunctionData as C,erc20Abi as J,parseAbi as $e,parseAbiParameters as q,toHex as Be,zeroAddress as F}from"viem";var g=Te[A].poolsTrade,Y=g.liquidityLauncher.address,B=g.uerc20BeneficiaryVault.address,fe=g.universalRouter.address,ie=10n**27n,j=(1n<<128n)-1n,Se=`0x${"00".repeat(32)}`,D=63127652n,pe=100000n,ae=10000000n,Ue=2000n,me={address:ue,symbol:"ETH",decimals:18,chainId:A},h=$e(["function multicall(bytes[] data) payable returns (bytes[])","function createToken(address factory,string name,string symbol,uint8 decimals,uint128 initialSupply,address recipient,bytes tokenData) payable returns (address)","function distributeToken(address token,(address strategy,uint128 amount,bytes configData) distribution,bytes32 salt) payable","function distributeWithNative(address strategy,bytes configData,bytes32 salt,uint256 nativeAmount) payable","function getGraffiti(address sender) view returns (bytes32)","function getUERC20Address(string name,string symbol,uint8 decimals,address recipient,bytes32 graffiti) view returns (address)","function execute(bytes commands,bytes[] inputs,uint256 deadline) payable","function collectFees(uint256[] ids)","function claim(uint256 id,uint256 minCurrency0Amount,uint256 minCurrency1Amount)","function amounts(uint256 id) view returns (uint128 eth,uint128 token)","function ownerOf(uint256 id) view returns (address)","function getApproved(uint256 id) view returns (address)","function approve(address spender,uint256 id)","function safeTransferFrom(address from,address to,uint256 id)","function approve(address token,address spender,uint160 amount,uint48 expiration)","error V4TooLittleReceived(uint256 minAmountOut,uint256 amountOut)"]),K=$e(["event TokenLaunched(bytes32 indexed poolId,address indexed token,address indexed feeSplitter,(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey)","event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"]),V=[g.instantLaunchStrategyFeesOn.address,g.instantLaunchStrategyFeesOff.address];function re(l){if(l.status!=="success")throw new r("The launch receipt did not succeed.");let c=[];for(let k of l.logs){let H=V.findIndex(L=>p(L,k.address));if(H===-1||k.topics[0]!=="0x3b3d2bafdcae274a232217e1f80ee4305d3af6aa25c8b14b1681bd68d18042a4")continue;let G=ce({abi:K,eventName:"TokenLaunched",data:k.data,topics:[...k.topics]}),{token:x,poolId:ee,poolKey:M,feeSplitter:te}=G.args,_=H===0?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address;if(!p(te,_)||!p(M.currency0,F)||!p(M.currency1,x)||M.fee!==2500||M.tickSpacing!==25||!p(M.hooks,F))throw new r("The launch does not match the current native ETH strategy.");let ne=l.logs.filter(L=>p(L.address,g.v4PositionManager.address)).flatMap(L=>{if(L.topics[0]!=="0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")return[];let O=ce({abi:K,eventName:"Transfer",data:L.data,topics:[...L.topics]}).args;return p(O.from,F)&&p(O.to,V[H])?[O.tokenId]:[]});if(ne.length!==1)throw new r("The launch receipt must identify one matching position mint.");c.push({token:x,poolId:ee,positionId:ne[0].toString(),creatorFees:H===0})}return c}function S(l){return xe(l,"Provide a valid wallet or token address.")}function P(l,c,k=!1){return Ie(l,`${c} is outside its supported range.`,{notString:`${c} must be an integer string in base units.`,positive:!k})}function Z(l,c,k=!1){if(k&&l===void 0)return"";if(typeof l!="string"||!k&&!l.trim()||l.length>4096)throw new r(`Provide a valid ${c}.`);return l}function he(l){if(typeof l!="string"||!/^0x[0-9a-fA-F]{64}$/.test(l))throw new r("Provide a valid launch transaction hash.");return l}function ge(l,c,k="minAmountOut"){let H=c.slippageBps??Ce;if(typeof H!="number")throw new r("Slippage must be an integer in basis points.");let G=le(l.toString(),H),x=c[k]===void 0?BigInt(G):P(c[k],k,l===0n);if(x>l||l>0n&&x===0n||x>j)throw new r("The minimum output must be positive and no larger than the simulated output.");return x}var qe=l=>{let c=l.clientFor(A),k=(e,o,n,s)=>l.unsignedTx({to:e,data:o,value:n.toString(),chainId:A,description:s}),H=e=>{throw new r(l.plainError(e))};async function G(){if(await c.getChainId()!==A)throw new r("pools.trade requires Robinhood Chain 4663.")}async function x(e,o,n){let s=await l.preview(e,o),t=s.changes.map(({token:a,amount:d})=>{let i=d.startsWith("-");return`${i?"-":""}${l.formatAmount(i?d.slice(1):d,a.decimals)} ${de(a.symbol)} (${a.address}, chain ${a.chainId})`});return{txs:e,summary:[n,s.summary,...t].join(" ")}}async function ee(){return(await c.getBlock()).timestamp+600n}function M(e,o,n,s,t,a){let d=[F,e,2500,25,F],i=[U(q("((address,address,uint24,int24,address),bool,uint128,uint128,uint256,bytes)"),[[d,o,n,s,0n,"0x"]]),U(q("address,uint256"),[o?F:e,n]),U(q("address,address,uint256"),[o?e:F,t,0n])],m=[U(q("bytes,bytes[]"),["0x060c0e",i])];return{inputs:m,encoded:U(q("bytes,bytes[],uint256"),["0x10",m,a])}}async function te(e,o){let n=await c.request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:e.map(i=>({from:o,gas:Be(Ae),to:i.to,data:i.data,value:Be(BigInt(i.value))}))}],validation:!1,traceTransfers:!1},"latest"]},{retryCount:0});if(!Array.isArray(n)||n.length!==1||!X(n[0])||!Array.isArray(n[0].calls)||n[0].calls.length!==e.length)throw new r("The output simulation returned a malformed response.");let s=n[0].calls;if(!s.slice(0,-1).every(i=>X(i)&&i.status==="0x1"&&!i.error))throw new r("A prerequisite failed during the output simulation.");let t=s.at(-1);if(!X(t)||t.status!=="0x0")throw new r("The output simulation did not return the expected minimum-output control.");let a=typeof t.returnData=="string"&&t.returnData!=="0x"?t.returnData:X(t.error)?t.error.data:void 0;if(typeof a!="string"||!/^0x[0-9a-fA-F]+$/.test(a))throw new r("The output simulation did not report an expected amount.");let d=Me({abi:h,data:a});if(d.errorName!=="V4TooLittleReceived"||d.args[0]!==j||d.args[1]<=0n||d.args[1]>=j)throw new r("The output simulation did not report a valid amount.");return d.args[1]}let _=new Map,ne=2e3;async function L(e,o,n,s=()=>!0){let t=await c.getBlockNumber(),a=t<D?0n:(t-D)/ae+1n,d=1n,i=(u=1n)=>{if(d+=u,d>Ue)throw new r("Pools.trade scan exceeds the 2000-request limit. Use launchTx for a specific launch; positions coverage is incomplete.")};i(a*BigInt(V.length+(e&&!n?1:0)));let m=new Map,b=new Set;for(let u=D;u<=t&&s();u+=ae){let f=u+ae-1n>t?t:u+ae-1n,y=(await Promise.all(V.map(T=>c.getLogs({address:T,event:K[0],...o?{args:{token:o}}:{},fromBlock:u,toBlock:f,strict:!0})))).flat(),$=[...new Set(y.map(T=>T.transactionHash))].filter(T=>!T||!m.has(T));for(let T=0;T<$.length&&s();T+=8)await Promise.all($.slice(T,T+8).map(async E=>{if(!E)throw new r("A launch log is missing its transaction hash.");let R=_.get(E);R||(i(),R=await c.getTransactionReceipt({hash:E}),_.size>=ne&&_.delete(_.keys().next().value),_.set(E,R)),m.set(E,R),s()&&await n?.(R)}));if(!s())break;if(e&&!n){let T=await c.getLogs({address:B,event:K[1],args:{to:e},fromBlock:u,toBlock:f,strict:!0});for(let E of T){let R=ce({abi:K,eventName:"Transfer",data:E.data,topics:E.topics}).args;b.add(R.tokenId.toString())}}}return{receipts:[...m.values()],feeIds:b}}async function O(e){let n=(e.launchTx!==void 0?[await c.getTransactionReceipt({hash:he(e.launchTx)})]:(await L(void 0,e.token===void 0?void 0:S(e.token))).receipts).flatMap(re).filter(s=>e.positionId!==void 0?s.positionId===P(e.positionId,"positionId").toString():p(s.token,S(e.token)));if(n.length!==1)throw new r("No unique current-strategy launch was found. Older strategy generations are unsupported.");return n[0]}async function Ee(e,o){if(typeof e.creatorFees!="boolean")throw new r("creatorFees must be an explicit boolean; the choice is permanent.");if(e.pair!==void 0&&!p(S(e.pair),F)&&!p(S(e.pair),ue))throw new r("Only the native ETH pair is supported.");if(e.decimals!==void 0&&e.decimals!==18)throw new r("Instant Launch requires 18 decimals.");if(e.supply!==void 0&&P(e.supply,"supply")!==ie)throw new r("Instant Launch requires a supply of one billion tokens.");let n=S(e.feeBeneficiary);if(p(n,F)||p(n,Y))throw new r("The fee beneficiary must be a wallet other than the launcher or zero address.");let s=Z(e.name,"name"),t=Z(e.symbol,"symbol"),a=e.initialBuy===void 0?0n:P(e.initialBuy,"initialBuy",!0);if(a>j)throw new r("The initial buy exceeds uint128.");if(a===0n&&e.minAmountOut!==void 0)throw new r("A minimum output requires an initial buy.");let d=await c.readContract({address:Y,abi:h,functionName:"getGraffiti",args:[o]}),i=S(await c.readContract({address:g.uerc20Factory.address,abi:h,functionName:"getUERC20Address",args:[s,t,18,Y,d]})),m=await c.getCode({address:i});if(m&&m!=="0x")throw new r("This wallet already launched that name and symbol.");let b=U(q("(string,string,string,bytes)"),[[Z(e.description,"description",!0),Z(e.website,"website",!0),Z(e.imageUri,"image URI",!0),"0x"]]),u=e.creatorFees?V[0]:V[1],f=[C({abi:h,functionName:"createToken",args:[g.uerc20Factory.address,s,t,18,ie,Y,b]}),C({abi:h,functionName:"distributeToken",args:[i,{strategy:u,amount:ie,configData:U(q("address"),[n])},Se]})],y=await ee(),v=T=>{let E=[...f];if(a>0n){let R=U(q("(address,address,bytes)"),[[fe,o,M(i,!0,a,T,o,y).encoded]]);E.push(C({abi:h,functionName:"distributeWithNative",args:[g.universalRouterStrategyApp.address,R,Se,a]}))}return k(Y,C({abi:h,functionName:"multicall",args:[E]}),a,`Atomic Instant Launch: creator fees ${e.creatorFees?"on":"off"} (permanent); beneficiary ${n}.`)},$=a>0n?ge(await te([v(j)],o),e):0n;return x([v($)],o,`Launch ${s} (${i}, chain 4663), supply 1000000000, decimals 18. Creator fees ${e.creatorFees?"on":"off"} are permanent; fee beneficiary ${n}. Creator ETH fees come from buys only (recorded 0.09996%); sells compound into locked liquidity. Initial-buy minimum ${$} token base units. Off-chain image/display unproven; no private metadata registration. No transaction sent.`)}async function Fe(e,o,n){let s=P(e.amountIn,"amountIn");if(s>j)throw new r("The trade amount exceeds uint128.");let t=S(e.token);await O(e);let a=await ee(),d=[];n||(await c.readContract({address:t,abi:J,functionName:"allowance",args:[o,g.permit2.address]})<s&&d.push(l.approval(t,g.permit2.address,s.toString(),A)),d.push(k(g.permit2.address,C({abi:h,functionName:"approve",args:[t,fe,s,Number(a)]}),0n,`Permit the exact ${s} token base units until ${a}.`)));let i=u=>[...d,k(fe,C({abi:h,functionName:"execute",args:["0x10",M(t,n,s,u,o,a).inputs,a]}),n?s:0n,`${n?"Buy":"Sell"} ${t} with minimum output ${u}.`)],m=await te(i(j),o),b=ge(m,e);return x(i(b),o,`${n?"Buy":"Sell"} token ${t} (chain 4663, 18 decimals), amountIn ${s}, minimum output ${b} ${n?"token":"ETH"} base units (18 decimals). Recorded swap fee 0.2899%; creator ETH fees from buys only, none from sells. No transaction sent.`)}async function we(e,o,n){let s=await O(e),t=BigInt(s.positionId),a=s.creatorFees?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address,d=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[t]});if(!p(d,a))throw new r("The position is not locked in its current-strategy splitter.");if(!n)return x([k(a,C({abi:h,functionName:"collectFees",args:[[t]]}),0n,`Collect fees for position ${t}; permissionless.`)],o,"Collect fees for the entitled recipients; collection does not transfer creator fees to the collector. No transaction sent.");if(!s.creatorFees)throw new r("Creator fees are permanently disabled for this position.");let i=await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[t]});if(!p(i,o))throw new r("Only the current fee NFT holder is entitled to claim.");let m=await c.readContract({address:B,abi:h,functionName:"amounts",args:[t]}),b=ge(m[0],e,"minEth");if(m[1]!==0n)throw new r("The current buy-only creator fee configuration returned unexpected token fees.");return x([k(B,C({abi:h,functionName:"claim",args:[t,b,0n]}),0n,`Claim collected ETH fees for position ${t} to ${o}.`)],o,`Claim collected fees: ${m[0]} ETH base units (18 decimals), minimum ${b}. Uncollected fees require poolstrade_collect first. No transaction sent.`)}async function Le(e,o){let n=await O(e),s=S(e.to);if(p(s,F))throw new r("The token recipient cannot be the zero address.");let t=P(e.amount,"amount"),a=await oe(n.token,await c.getBlockNumber());return x([k(a.address,C({abi:J,functionName:"transfer",args:[s,t]}),0n,`Transfer exactly ${t} ${de(a.symbol)} base units to ${s}.`)],o,`Transfer ${t} token base units (token ${a.address}, decimals ${a.decimals}, chain ${a.chainId}) to ${s}. No approval; no transaction sent.`)}async function Oe(e,o){if(!Array.isArray(e.positionIds)||e.positionIds.length<1||e.positionIds.length>20||!Array.isArray(e.launchTxs)||e.launchTxs.length!==e.positionIds.length)throw new r("Provide 1 to 20 positionIds and one matching launchTxs entry for each.");let n=e.positionIds.map(d=>P(d,"positionId").toString());if(new Set(n).size!==n.length)throw new r("Each position ID must appear once.");let s=e.launchTxs.map(he),t=new Map;for(let[d,i]of n.entries()){let b=(await O({positionId:i,launchTx:s[d]})).creatorFees?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address,u=BigInt(i),f=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[u]});if(!p(f,b))throw new r("The position is not locked in its current-strategy splitter.");t.set(b,[...t.get(b)??[],u])}let a=[...t].map(([d,i])=>k(d,C({abi:h,functionName:"collectFees",args:[i]}),0n,`Collect fees for positions ${i.join(", ")}; permissionless.`));return x(a,o,"Collect fees in batches for the fixed entitled recipients. Collection does not pay the collector. No transaction sent.")}let Q="Current native ETH Instant Launch strategies only. Crowd Launch and older deployments are not covered.";async function oe(e,o){let[n,s]=await Promise.all([c.readContract({address:e,abi:J,functionName:"symbol",blockNumber:o}),c.readContract({address:e,abi:J,functionName:"decimals",blockNumber:o})]);if(typeof n!="string"||!n||n.length>256||s!==18)throw new r("The current launch token returned invalid metadata.");return{address:e,symbol:n,decimals:s,chainId:A}}async function be(e,o,n,s){let t=s??await oe(e.token,n),a=await c.readContract({address:t.address,abi:J,functionName:"balanceOf",args:[o],blockNumber:n});return{token:t,amount:a.toString(),humanAmount:l.formatAmount(a.toString(),t.decimals)}}async function Pe(e,o){let n=await O(e),s=await c.getBlockNumber();return{wallet:o,...await be(n,o,s),blockNumber:s.toString(),coverage:Q}}async function He(e,o){let n=he(e.launchTx),s=await c.getTransactionReceipt({hash:n}),t=re(s);if(e.token!==void 0&&(t=t.filter(i=>p(i.token,S(e.token)))),e.positionId!==void 0&&(t=t.filter(i=>i.positionId===P(e.positionId,"positionId").toString())),!t.length)throw new r("The receipt contains no matching current Instant Launch. Crowd Launch and older strategies are not covered.");let a=await c.getBlockNumber(),d=await Promise.all(t.map(async i=>{let m=i.creatorFees?g.feeSplitterFeesOn.address:g.feeSplitterFeesOff.address,b=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:a});if(!p(b,m))throw new r("The position is not locked in its current-strategy splitter.");let u=i.creatorFees?{owner:await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[BigInt(i.positionId)],blockNumber:a}),approved:await c.readContract({address:B,abi:h,functionName:"getApproved",args:[BigInt(i.positionId)],blockNumber:a}),collected:await c.readContract({address:B,abi:h,functionName:"amounts",args:[BigInt(i.positionId)],blockNumber:a})}:void 0,f=await oe(i.token,a);return{...i,token:f,custodian:b,holding:await be(i,o,a,f),...u?{feeEntitlement:{owner:u.owner,approved:u.approved,collected:[{token:me,amount:u.collected[0].toString()},{token:f,amount:u.collected[1].toString()}],uncollectedFeesIncluded:!1}}:{}}}));return{launchTx:n,wallet:o,creator:s.from,blockNumber:a.toString(),launches:d,coverage:Q}}async function Re(e){let o=await c.getBlockNumber(),n=e.limit??20;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>50)throw new r("limit must be an integer from 1 to 50.");let s=e.fromBlock===void 0?o>=D+pe?o-pe+1n:D:P(e.fromBlock,"fromBlock",!0),t=e.toBlock===void 0?o:P(e.toBlock,"toBlock",!0),a=0;if(e.cursor!==void 0){if(typeof e.cursor!="string"||!/^[0-9]{1,78}:[0-9]{1,78}:[0-9]{1,10}$/.test(e.cursor))throw new r("Provide the browse cursor exactly as returned.");let u=e.cursor.split(":"),f=BigInt(u[0]),y=BigInt(u[1]);if(e.fromBlock!==void 0&&s!==f||e.toBlock!==void 0&&t!==y)throw new r("The cursor does not match this block range.");s=f,t=y,a=Number(u[2])}if(o<D&&e.fromBlock===void 0&&e.toBlock===void 0&&e.cursor===void 0)return{launches:[],cursor:null,fromBlock:D.toString(),toBlock:o.toString(),coverage:Q,predeployment:!0};if(s<D||t<s||t>o||t-s>=pe)throw new r("Choose a deployed block range of at most 100000 blocks, ending no later than the current head.");let d=await c.getLogs({address:V,event:K[0],fromBlock:s,toBlock:t,strict:!0});if(d.some(u=>u.blockNumber===null||u.logIndex===null||!u.transactionHash))throw new r("The launch feed returned an incomplete log.");if(d.sort((u,f)=>u.blockNumber===f.blockNumber?f.logIndex-u.logIndex:u.blockNumber>f.blockNumber?-1:1),a>d.length)throw new r("The browse cursor is outside the launch feed.");let i=new Map,m=[];for(let u of d.slice(a,a+n)){let f=u.transactionHash,y=i.get(f);y||(y=await c.getTransactionReceipt({hash:f}),i.set(f,y));let v=ce({abi:K,eventName:"TokenLaunched",data:u.data,topics:u.topics}).args,$=re(y).filter(T=>p(T.token,v.token)&&p(T.poolId,v.poolId));if($.length!==1)throw new r("The launch feed log does not match one verified receipt launch.");m.push({...$[0],launchTx:f,blockNumber:u.blockNumber.toString(),token:await oe($[0].token,t),creator:y.from})}let b=a+n;return{launches:m,cursor:b<d.length?`${s}:${t}:${b}`:null,fromBlock:s.toString(),toBlock:t.toString(),coverage:Q,previousToBlock:s>D?(s-1n).toString():null,summary:"Newest launches first within this fixed block range. Empty does not establish absence outside the range or covered strategies."}}async function ye(e,o,n){let s=await O(e);if(!s.creatorFees)throw new r("Creator fees are permanently disabled for this position.");let t=BigInt(s.positionId),a=await c.readContract({address:g.v4PositionManager.address,abi:h,functionName:"ownerOf",args:[t]});if(!p(a,g.feeSplitterFeesOn.address))throw new r("The position is not locked in its current-strategy splitter.");let d=await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[t]});if(!p(d,o))throw new r("Only the current fee NFT holder can change this entitlement.");let i=S(n?e.to:e.spender);if(p(i,B)||n&&p(i,F))throw new r("The fee NFT recipient cannot be the vault or zero address.");let m=n?C({abi:h,functionName:"safeTransferFrom",args:[o,i,t]}):C({abi:h,functionName:"approve",args:[i,t]});return x([k(B,m,0n,n?`Transfer fee NFT ${t} to ${i}, including accrued and future fees.`:`Approve ${i} for fee NFT ${t} only; zero address revokes approval.`)],o,n?`Transfer the entire fee entitlement for position ${t} to ${i}. This includes collected and future fees; locked LP remains in its splitter. No transaction sent.`:`Set the exact single-NFT approval for position ${t} to ${i}. This permits transfer of that fee entitlement; zero address revokes. No transaction sent.`)}async function De(){return{chainId:A,instant:{supported:!0,supply:ie.toString(),decimals:18,currency:me,permanentCreatorFeeChoice:!0},crowd:{status:"BLOCKED",strategy:"0xbf1aB81f7d534b2CC0Da76fcf4d541322bB0e000",factory:"0x000000001F26a0044BaA66024e7b6599c61963F8",missing:"A verified Pools-specific auction configuration (BlockNumberish timing, reserve allocation, Q96 floor/tick, USD FDV conversion, issuance steps, locked LP plan) and a bytecode-matched factory-created auction ABI with success/refund fixtures. Generic CCA parameters are not a verified Pools Crowd Launch.",source:"https://github.com/Uniswap/sdks/blob/main/sdks/liquidity-launcher-sdk/src/addresses.ts"},coverage:Q}}let w=e=>({type:"string",description:e}),I=e=>ve(e),se="Launched token contract address (0x + 40 hex digits).",z="Transaction hash (0x + 64 hex digits) of the token launch; lets the tool find the launch without scanning. Optional where the token or position is given.",W='Liquidity position NFT id for the launch, as a decimal string. Example: "1".',ke={chainId:{type:"integer",const:A,description:"Chain id; only 4663 (Robinhood Chain mainnet) is accepted. Optional."},slippageBps:{type:"integer",minimum:0,maximum:9999,description:"Slippage tolerance in basis points (50 = 0.5%) used to derive minimum outputs when none is given. Optional."}};function N(e,o,n,s){return{name:`poolstrade_${e}`,inputSchema:{type:"object",additionalProperties:!1,properties:{...ke,...o},required:n},execute:async(t,a)=>{try{let d=new Set([...Object.keys(ke),...Object.keys(o)]);if(Object.keys(t).some(i=>!d.has(i)))throw new r("Unsupported input for this pools.trade tool.");if(t.chainId!==void 0&&t.chainId!==A)throw new r("pools.trade requires chain 4663.");if(S(a),t.slippageBps!==void 0){if(typeof t.slippageBps!="number")throw new r("Slippage must be an integer in basis points.");le("10000",t.slippageBps)}return await G(),await s(t,a)}catch(d){H(d)}}}}return{tools:[N("launch",{name:w("Token name, shown in wallets and explorers."),symbol:w("Token ticker symbol."),creatorFees:{type:"boolean",description:"Permanent choice; must be explicit. true enables creator fees paid to feeBeneficiary from buys; false disables them forever."},feeBeneficiary:w("Address that receives creator fees; must not be the zero address or the launcher."),pair:w("Optional pair currency; only native ETH is supported (the zero address or the native ETH sentinel)."),decimals:{type:"integer",const:18,description:"Token decimals; must be 18 for an Instant Launch."},supply:I("Total token supply in base units (18 decimals); must be 1000000000000000000000000000 = one billion tokens."),initialBuy:I('ETH to spend on an initial buy in the same transaction, in wei base units (ETH has 18 decimals). Example: "1000000000000000" = 0.001 ETH.'),minAmountOut:I('Least new tokens to receive from the initial buy, in token base units (18 decimals). Requires initialBuy. Example: "1000000000000000000" = 1 token.'),description:w("Optional token description stored in token metadata."),website:w("Optional website URL stored in token metadata."),imageUri:w("Optional image URI stored in token metadata.")},["name","symbol","creatorFees","feeBeneficiary"],Ee),...["buy","sell"].map(e=>N(e,{token:w(se),amountIn:I(e==="buy"?'ETH to spend, in wei base units (ETH has 18 decimals). Example: "1000000000000000" = 0.001 ETH.':'Tokens to sell, in token base units (launched tokens have 18 decimals). Example: "1000000000000000000" = 1 token.'),minAmountOut:I(e==="buy"?'Least tokens to receive, in token base units (18 decimals). Example: "1000000000000000000" = 1 token. Defaults from slippageBps.':'Least ETH to receive, in wei base units (18 decimals). Example: "1000000000000000" = 0.001 ETH. Defaults from slippageBps.'),launchTx:w(z)},["token","amountIn"],(o,n)=>Fe(o,n,e==="buy"))),N("collect",{positionId:I(W),launchTx:w(z)},["positionId"],(e,o)=>we(e,o,!1)),N("claim",{positionId:I(W),launchTx:w(z),minEth:I('Least ETH you must receive from the claim, in wei base units (ETH has 18 decimals). Example: "1000000000000000" = 0.001 ETH.')},["positionId"],(e,o)=>we(e,o,!0)),N("browse",{fromBlock:I("First block number of the scan range, as a decimal string. Defaults to the most recent 100000 blocks."),toBlock:I("Last block number of the scan range, as a decimal string. Defaults to the latest block."),limit:{type:"integer",minimum:1,maximum:50,description:"Launches per page, 1 to 50 (default 20)."},cursor:w("Opaque pagination cursor exactly as returned by the previous browse call.")},[],Re),N("balance",{token:w(se),launchTx:w(z)},["token"],Pe),N("status",{launchTx:w("Transaction hash (0x + 64 hex digits) of the token launch to inspect."),token:w(se),positionId:I(W)},["launchTx"],He),N("launch_options",{},[],De),N("fee_transfer",{positionId:I(W),launchTx:w(z),to:w("Address that will become the new holder of the fee NFT and its future creator fees. Use the intended address.")},["positionId","to"],(e,o)=>ye(e,o,!0)),N("fee_approve",{positionId:I(W),launchTx:w(z),spender:w("Address approved to move the fee NFT. Use the intended address.")},["positionId","spender"],(e,o)=>ye(e,o,!1)),N("transfer",{token:w(se),amount:I('Tokens to send, in token base units (launched tokens have 18 decimals). Example: "1000000000000000000" = 1 token.'),to:w("Recipient address of the tokens; must not be the zero address. Use the intended address."),launchTx:w(z)},["token","amount","to"],Le),N("collect_many",{positionIds:{type:"array",items:I(W),minItems:1,maxItems:20,description:"Position NFT ids to collect fees for, decimal strings; same order as launchTxs."},launchTxs:{type:"array",items:w("Launch transaction hash (0x + 64 hex digits) matching the position id at the same index."),minItems:1,maxItems:20,description:"Launch transaction hashes, one per position id, in the same order."}},["positionIds","launchTxs"],Oe)],positions:async(e,o)=>{S(e);let n=[],s=0,t=!0,a=o?.deepScan?2e4:6e3,d=o?.signal,i,m,b=f=>({module:"poolstrade",id:"poolstrade-discovery-incomplete",chainId:A,assets:[],incomplete:!0,description:`${f} Checked ${s} launch receipts. Readable holdings are retained. Check a known launch with poolstrade_status {"launchTx":"<hash>"} or its token holding with poolstrade_balance {"token":"<address>","launchTx":"<hash>"}. Crowd Launch and older deployments are outside this reader's coverage.`}),u=async()=>{await G(),t&&await L(e,void 0,async f=>{s++;for(let y of re(f)){if(!t)return;let v=y.creatorFees&&p(await c.readContract({address:B,abi:h,functionName:"ownerOf",args:[BigInt(y.positionId)]}),e);if(!t)return;if(!v&&!p(f.from,e))continue;let $=v?[{token:me,amount:(await c.readContract({address:B,abi:h,functionName:"amounts",args:[BigInt(y.positionId)]}))[0].toString()}]:[];t&&n.push({module:"poolstrade",id:y.positionId,chainId:A,assets:$,description:`Current Instant Launch ${y.token} (18 decimals, supply 1000000000), pool ${y.poolId}; creator fees ${y.creatorFees?"on":"off"} (permanent). ${v?"Collected ETH fees only; uncollected fees excluded.":"Launch record; no fee entitlement held."} Liquidity is permanently locked.`})}},()=>t)};try{if(d?.aborted)return[b("Pools.trade discovery was cancelled; the historical scan is incomplete.")];let f=new Promise(v=>{i=()=>{t=!1,v("aborted")},d?.addEventListener("abort",i,{once:!0}),m=setTimeout(()=>{t=!1,v("budget")},a)}),y=await Promise.race([u().then(()=>"complete"),f]);return y==="complete"?n:[...n,b(y==="aborted"?"Pools.trade discovery was cancelled; the historical scan is incomplete.":`Pools.trade global launch discovery reached its ${a} ms read budget; the historical scan is incomplete.`)]}catch(f){return[...n,b(`Pools.trade discovery could not finish: ${l.plainError(f)}`)]}finally{t=!1,m!==void 0&&clearTimeout(m),i&&d?.removeEventListener("abort",i)}}}};function Ye(l){return Ne("poolstrade",[qe(l)])}export{re as a,qe as b,Ye as c};