@oakagentkit/core 0.2.1 → 0.2.2

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 (375) hide show
  1. package/build/dist/api/addresses.d.ts +93 -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.js +1 -1
  5. package/build/dist/api/identity-link.js +1 -1
  6. package/build/dist/api/metadata.js +1 -1
  7. package/build/dist/api/modules/beefy/boosts.js +1 -1
  8. package/build/dist/api/modules/beefy/clm.js +1 -1
  9. package/build/dist/api/modules/beefy/guard.js +1 -1
  10. package/build/dist/api/modules/beefy/index.js +1 -1
  11. package/build/dist/api/modules/beefy/liquidity.js +1 -1
  12. package/build/dist/api/modules/beefy/management.js +1 -1
  13. package/build/dist/api/modules/beefy/vaults.js +1 -1
  14. package/build/dist/api/modules/clanker/extensions.js +1 -1
  15. package/build/dist/api/modules/clanker/index.js +1 -1
  16. package/build/dist/api/modules/clanker/manage.js +1 -1
  17. package/build/dist/api/modules/clanker/pool-config.js +1 -1
  18. package/build/dist/api/modules/clanker/protocol.js +1 -1
  19. package/build/dist/api/modules/clanker/state.js +1 -1
  20. package/build/dist/api/modules/erc8004/common.js +1 -1
  21. package/build/dist/api/modules/erc8004/domain.js +1 -1
  22. package/build/dist/api/modules/erc8004/index.js +1 -1
  23. package/build/dist/api/modules/erc8004/management.js +1 -1
  24. package/build/dist/api/modules/erc8004/reputation.js +1 -1
  25. package/build/dist/api/modules/erc8004/services.js +1 -1
  26. package/build/dist/api/modules/erc8004/validation.js +1 -1
  27. package/build/dist/api/modules/grove/index.js +1 -1
  28. package/build/dist/api/modules/heyresearch/backoff.d.ts +6 -0
  29. package/build/dist/api/modules/heyresearch/backoff.js +1 -0
  30. package/build/dist/api/modules/heyresearch/builder-feed.d.ts +62 -0
  31. package/build/dist/api/modules/heyresearch/builder-feed.js +1 -0
  32. package/build/dist/api/modules/heyresearch/index.d.ts +3 -0
  33. package/build/dist/api/modules/heyresearch/index.js +1 -1
  34. package/build/dist/api/modules/heyresearch/proof-reads.d.ts +7 -0
  35. package/build/dist/api/modules/heyresearch/proof-reads.js +1 -0
  36. package/build/dist/api/modules/heyresearch/public-reads.d.ts +1 -0
  37. package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
  38. package/build/dist/api/modules/heyresearch/scan.d.ts +31 -0
  39. package/build/dist/api/modules/heyresearch/scan.js +1 -0
  40. package/build/dist/api/modules/heyresearch/status-labels.d.ts +5 -0
  41. package/build/dist/api/modules/heyresearch/status-labels.js +1 -0
  42. package/build/dist/api/modules/heyresearch/token-facts.d.ts +123 -0
  43. package/build/dist/api/modules/heyresearch/token-facts.js +1 -0
  44. package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
  45. package/build/dist/api/modules/hoodag/index.js +1 -1
  46. package/build/dist/api/modules/hoodag/management.js +1 -1
  47. package/build/dist/api/modules/hoodag/public-reads.js +1 -1
  48. package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
  49. package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
  50. package/build/dist/api/modules/hoodlock/buyback.js +1 -1
  51. package/build/dist/api/modules/hoodlock/commerce.js +1 -1
  52. package/build/dist/api/modules/hoodlock/fee.js +1 -1
  53. package/build/dist/api/modules/hoodlock/guard.js +1 -1
  54. package/build/dist/api/modules/hoodlock/index.js +1 -1
  55. package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
  56. package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
  57. package/build/dist/api/modules/hoodlock/public.js +1 -1
  58. package/build/dist/api/modules/hookr/actions.d.ts +1 -1
  59. package/build/dist/api/modules/hookr/actions.js +1 -1
  60. package/build/dist/api/modules/hookr/addons.js +1 -1
  61. package/build/dist/api/modules/hookr/agent-gate.d.ts +63 -0
  62. package/build/dist/api/modules/hookr/agent-gate.js +1 -0
  63. package/build/dist/api/modules/hookr/contracts.js +1 -1
  64. package/build/dist/api/modules/hookr/create-cancel.js +1 -1
  65. package/build/dist/api/modules/hookr/discovery.js +1 -1
  66. package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
  67. package/build/dist/api/modules/hookr/index.d.ts +1 -0
  68. package/build/dist/api/modules/hookr/index.js +1 -1
  69. package/build/dist/api/modules/hookr/launch-options.d.ts +119 -0
  70. package/build/dist/api/modules/hookr/launch-options.js +1 -0
  71. package/build/dist/api/modules/hookr/launch-profile.d.ts +5 -0
  72. package/build/dist/api/modules/hookr/launch-profile.js +1 -0
  73. package/build/dist/api/modules/hookr/launch-receipt.d.ts +144 -0
  74. package/build/dist/api/modules/hookr/launch-receipt.js +1 -0
  75. package/build/dist/api/modules/hookr/launch.d.ts +58 -0
  76. package/build/dist/api/modules/hookr/launch.js +1 -0
  77. package/build/dist/api/modules/hookr/liquidity.d.ts +48 -0
  78. package/build/dist/api/modules/hookr/liquidity.js +1 -0
  79. package/build/dist/api/modules/hookr/lp-positions.d.ts +2 -0
  80. package/build/dist/api/modules/hookr/lp-positions.js +1 -0
  81. package/build/dist/api/modules/hookr/lp-reads.d.ts +52 -0
  82. package/build/dist/api/modules/hookr/lp-reads.js +1 -0
  83. package/build/dist/api/modules/hookr/lp-receipt.d.ts +136 -0
  84. package/build/dist/api/modules/hookr/lp-receipt.js +1 -0
  85. package/build/dist/api/modules/hookr/lp-state.d.ts +33 -0
  86. package/build/dist/api/modules/hookr/lp-state.js +1 -0
  87. package/build/dist/api/modules/hookr/pins.d.ts +43 -0
  88. package/build/dist/api/modules/hookr/pins.js +1 -0
  89. package/build/dist/api/modules/hookr/public-reads.js +1 -1
  90. package/build/dist/api/modules/hookr/read-utils.d.ts +59 -0
  91. package/build/dist/api/modules/hookr/read-utils.js +1 -0
  92. package/build/dist/api/modules/hookr/relay.js +1 -1
  93. package/build/dist/api/modules/hookr/revenue.js +1 -1
  94. package/build/dist/api/modules/kyberswap/index.js +1 -1
  95. package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
  96. package/build/dist/api/modules/lighter/index.js +1 -1
  97. package/build/dist/api/modules/longbow/administration.js +1 -1
  98. package/build/dist/api/modules/longbow/analytics.js +1 -1
  99. package/build/dist/api/modules/longbow/fixed.js +1 -1
  100. package/build/dist/api/modules/longbow/index.js +1 -1
  101. package/build/dist/api/modules/longbow/nft.js +1 -1
  102. package/build/dist/api/modules/longbow/rebates.js +1 -1
  103. package/build/dist/api/modules/longbow/staking.js +1 -1
  104. package/build/dist/api/modules/meridian/index.js +1 -1
  105. package/build/dist/api/modules/meridian/markets.js +1 -1
  106. package/build/dist/api/modules/meridian/rfq.js +1 -1
  107. package/build/dist/api/modules/merkl/discovery.js +1 -1
  108. package/build/dist/api/modules/merkl/index.js +1 -1
  109. package/build/dist/api/modules/merkl/manage.js +1 -1
  110. package/build/dist/api/modules/merkl/protocol.js +1 -1
  111. package/build/dist/api/modules/morpho/allocator.js +1 -1
  112. package/build/dist/api/modules/morpho/bundles.js +1 -1
  113. package/build/dist/api/modules/morpho/in-kind.js +1 -1
  114. package/build/dist/api/modules/morpho/index.js +1 -1
  115. package/build/dist/api/modules/morpho/local-guard.js +1 -1
  116. package/build/dist/api/modules/morpho/midnight.js +1 -1
  117. package/build/dist/api/modules/morpho/protocol.js +1 -1
  118. package/build/dist/api/modules/morpho/vault-management.js +1 -1
  119. package/build/dist/api/modules/morpho/vault-tools.js +1 -1
  120. package/build/dist/api/modules/morpho/vault-v2.js +1 -1
  121. package/build/dist/api/modules/netnet/card-plan.js +1 -1
  122. package/build/dist/api/modules/netnet/card-read.js +1 -1
  123. package/build/dist/api/modules/netnet/card-recovery.js +1 -1
  124. package/build/dist/api/modules/netnet/desk-action.js +1 -1
  125. package/build/dist/api/modules/netnet/desk-read.js +1 -1
  126. package/build/dist/api/modules/netnet/financial.js +1 -1
  127. package/build/dist/api/modules/netnet/index.js +1 -1
  128. package/build/dist/api/modules/netnet/staking.js +1 -1
  129. package/build/dist/api/modules/orbio/index.js +1 -1
  130. package/build/dist/api/modules/pons/claim.js +1 -1
  131. package/build/dist/api/modules/pons/index.js +1 -1
  132. package/build/dist/api/modules/pons/launch-status.js +1 -1
  133. package/build/dist/api/modules/pons/prices.js +1 -1
  134. package/build/dist/api/modules/pons/reads.js +1 -1
  135. package/build/dist/api/modules/pons/swap-terms.js +1 -1
  136. package/build/dist/api/modules/pons/trade.js +1 -1
  137. package/build/dist/api/modules/poolstrade/index.js +1 -1
  138. package/build/dist/api/modules/priors/coverage.js +1 -1
  139. package/build/dist/api/modules/priors/discovery.js +1 -1
  140. package/build/dist/api/modules/priors/features.js +1 -1
  141. package/build/dist/api/modules/priors/index.js +1 -1
  142. package/build/dist/api/modules/priors/integration.js +1 -1
  143. package/build/dist/api/modules/priors/market.js +1 -1
  144. package/build/dist/api/modules/priors/pt.js +1 -1
  145. package/build/dist/api/modules/priors/savings-exit.js +1 -1
  146. package/build/dist/api/modules/priors/starter-line.js +1 -1
  147. package/build/dist/api/modules/priors/stock-swap.js +1 -1
  148. package/build/dist/api/modules/relay/bootstrap.js +1 -1
  149. package/build/dist/api/modules/relay/discovery.js +1 -1
  150. package/build/dist/api/modules/relay/inbound.js +1 -1
  151. package/build/dist/api/modules/relay/index.js +1 -1
  152. package/build/dist/api/modules/relay/outbound-status.js +1 -1
  153. package/build/dist/api/modules/relay/reads.js +1 -1
  154. package/build/dist/api/modules/spark/actions.js +1 -1
  155. package/build/dist/api/modules/spark/details.js +1 -1
  156. package/build/dist/api/modules/spark/index.js +1 -1
  157. package/build/dist/api/modules/spark/management.js +1 -1
  158. package/build/dist/api/modules/steakhouse/analytics.js +1 -1
  159. package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
  160. package/build/dist/api/modules/steakhouse/index.js +1 -1
  161. package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
  162. package/build/dist/api/modules/steakhouse/management.js +1 -1
  163. package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
  164. package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
  165. package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
  166. package/build/dist/api/modules/tickerspring/discovery.js +1 -1
  167. package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
  168. package/build/dist/api/modules/tickerspring/guards.js +1 -1
  169. package/build/dist/api/modules/tickerspring/index.js +1 -1
  170. package/build/dist/api/modules/tickerspring/journeys.js +1 -1
  171. package/build/dist/api/modules/tickerspring/ladder.js +1 -1
  172. package/build/dist/api/modules/tickerspring/maker.js +1 -1
  173. package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
  174. package/build/dist/api/modules/tickerspring/research.js +1 -1
  175. package/build/dist/api/modules/tickerspring/strategies.js +1 -1
  176. package/build/dist/api/modules/uniswap/auction-create.js +1 -1
  177. package/build/dist/api/modules/uniswap/auction.js +1 -1
  178. package/build/dist/api/modules/uniswap/batch.js +1 -1
  179. package/build/dist/api/modules/uniswap/common.js +1 -1
  180. package/build/dist/api/modules/uniswap/fees.js +1 -1
  181. package/build/dist/api/modules/uniswap/index.js +1 -1
  182. package/build/dist/api/modules/uniswap/local-guard.js +1 -1
  183. package/build/dist/api/modules/uniswap/oracle.js +1 -1
  184. package/build/dist/api/modules/uniswap/pool-math.js +1 -1
  185. package/build/dist/api/modules/uniswap/pools.js +1 -1
  186. package/build/dist/api/modules/uniswap/position.js +1 -1
  187. package/build/dist/api/modules/uniswap/protocol.js +1 -1
  188. package/build/dist/api/modules/uniswap/token-jar.js +1 -1
  189. package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
  190. package/build/dist/api/modules/uniswap/trade.js +1 -1
  191. package/build/dist/api/modules/uniswap/v2.js +1 -1
  192. package/build/dist/api/modules/uniswap/v3.js +1 -1
  193. package/build/dist/api/modules/uniswap/v4.js +1 -1
  194. package/build/dist/api/modules/uniswap/wrap.js +1 -1
  195. package/build/dist/api/modules/velora/claims.js +1 -1
  196. package/build/dist/api/modules/velora/delta-reads.js +1 -1
  197. package/build/dist/api/modules/velora/index.js +1 -1
  198. package/build/dist/api/modules/wormhole/index.d.ts +5 -0
  199. package/build/dist/api/modules/wormhole/index.js +1 -0
  200. package/build/dist/api/modules/wormhole/license.d.ts +2 -0
  201. package/build/dist/api/modules/wormhole/license.js +1 -0
  202. package/build/dist/api/modules/wormhole/quotetext.d.ts +36 -0
  203. package/build/dist/api/modules/wormhole/quotetext.js +1 -0
  204. package/build/dist/api/modules/wormhole/scan-text.d.ts +40 -0
  205. package/build/dist/api/modules/wormhole/scan-text.js +1 -0
  206. package/build/dist/api/modules/wormhole/token-check.d.ts +54 -0
  207. package/build/dist/api/modules/wormhole/token-check.js +1 -0
  208. package/build/dist/api/positions.js +1 -1
  209. package/build/dist/api/pricenote.js +1 -1
  210. package/build/dist/api/prices.js +1 -1
  211. package/build/dist/api/pricing.js +1 -1
  212. package/build/dist/api/rpc.js +1 -1
  213. package/build/dist/api/send.js +1 -1
  214. package/build/dist/api/signing-registry.js +1 -1
  215. package/build/dist/api/signing.js +1 -1
  216. package/build/dist/api/simulate.js +1 -1
  217. package/build/dist/api/swap.js +1 -1
  218. package/build/dist/api/tokens.js +1 -1
  219. package/build/dist/api/tool-policy.js +1 -1
  220. package/build/dist/api/types.d.ts +7 -0
  221. package/build/dist/chunks/{QHHZDXRG.js → 2FSX7MMR.js} +1 -1
  222. package/build/dist/chunks/{RTBOMWCB.js → 2LM7U4S7.js} +1 -1
  223. package/build/dist/chunks/{BBVKWG65.js → 2MSQ6JII.js} +1 -1
  224. package/build/dist/chunks/{T6MTTMLQ.js → 2UU5TBBB.js} +1 -1
  225. package/build/dist/chunks/{OW7GOYKA.js → 2W46IRX6.js} +1 -1
  226. package/build/dist/chunks/{6LLOTPH2.js → 3EFV4FQF.js} +1 -1
  227. package/build/dist/chunks/{IAXKPME3.js → 3NDVXEBR.js} +1 -1
  228. package/build/dist/chunks/3SC5UI35.js +1 -0
  229. package/build/dist/chunks/{TCS3ICNE.js → 3WBDHUV2.js} +1 -1
  230. package/build/dist/chunks/{UPPYXY74.js → 4AKIXLXH.js} +1 -1
  231. package/build/dist/chunks/{RRSODRGT.js → 4GAWMCQC.js} +1 -1
  232. package/build/dist/chunks/{ZGXNTWYG.js → 4GHVIBL5.js} +1 -1
  233. package/build/dist/chunks/{NHCRJC5X.js → 4KQZTPMS.js} +1 -1
  234. package/build/dist/chunks/{N77ANGBT.js → 4X2JOQ2L.js} +1 -1
  235. package/build/dist/chunks/{ZPM2MFXZ.js → 52DHGSG4.js} +1 -1
  236. package/build/dist/chunks/{2CS3M32D.js → 57HAXNQV.js} +1 -1
  237. package/build/dist/chunks/5IIR3GIN.js +1 -0
  238. package/build/dist/chunks/{CAU44UWP.js → 5O5ZE3ZV.js} +1 -1
  239. package/build/dist/chunks/5OEHZJ6X.js +1 -0
  240. package/build/dist/chunks/{CBA776XQ.js → 5VHH5PW3.js} +1 -1
  241. package/build/dist/chunks/{NCEJZWGX.js → 66VBACC2.js} +1 -1
  242. package/build/dist/chunks/{6HV5BR7P.js → 6AWTAE4Q.js} +1 -1
  243. package/build/dist/chunks/{JRVTSGAT.js → 6UPPUHCL.js} +1 -1
  244. package/build/dist/chunks/{MEMVFR7Z.js → 6ZYLNB2B.js} +1 -1
  245. package/build/dist/chunks/7XLEYOZH.js +1 -0
  246. package/build/dist/chunks/{Q4RZQCDS.js → AAGDMH54.js} +1 -1
  247. package/build/dist/chunks/ACN2BFMA.js +1 -0
  248. package/build/dist/chunks/{L24EOVLT.js → AJP5LDM2.js} +1 -1
  249. package/build/dist/chunks/{F2YH72GF.js → ALK6NKFP.js} +1 -1
  250. package/build/dist/chunks/{EC5W3UZD.js → AMICUXS6.js} +1 -1
  251. package/build/dist/chunks/{5LQBHXFA.js → BX7XQANB.js} +1 -1
  252. package/build/dist/chunks/{QNPEKNWM.js → CEIPDEXZ.js} +1 -1
  253. package/build/dist/chunks/{HFQS5344.js → CQCVFRQ5.js} +1 -1
  254. package/build/dist/chunks/{OJLMF5AR.js → CUNQ5RG5.js} +1 -1
  255. package/build/dist/chunks/{IWALIX7Q.js → CXLEQCP3.js} +1 -1
  256. package/build/dist/chunks/{VJ3W2V3B.js → CY75R4FK.js} +1 -1
  257. package/build/dist/chunks/{65QFM4JU.js → DCTUYDWF.js} +1 -1
  258. package/build/dist/chunks/DHOBTJRD.js +1 -0
  259. package/build/dist/chunks/{N37ZLNCT.js → DRWWPBOQ.js} +1 -1
  260. package/build/dist/chunks/{7B5UH2VS.js → DZGEQBO7.js} +1 -1
  261. package/build/dist/chunks/{RFJCG4NA.js → E7R3J4H7.js} +1 -1
  262. package/build/dist/chunks/{7T4BYFD4.js → EGUMOD3A.js} +1 -1
  263. package/build/dist/chunks/ELZNT5Q3.js +1 -0
  264. package/build/dist/chunks/EPZ7SWKM.js +1 -0
  265. package/build/dist/chunks/{IUETZH6I.js → EXRKBBX2.js} +1 -1
  266. package/build/dist/chunks/{K7HIKXNT.js → FBSUTF3B.js} +1 -1
  267. package/build/dist/chunks/{LFN3OODW.js → FUXT7GRK.js} +1 -1
  268. package/build/dist/chunks/G6HCV67X.js +1 -0
  269. package/build/dist/chunks/{HNMOB76J.js → GGUEKSR4.js} +1 -1
  270. package/build/dist/chunks/{GZ5TW3WB.js → GIV5JMTE.js} +1 -1
  271. package/build/dist/chunks/{OMTCWXQR.js → GJY3P6OG.js} +1 -1
  272. package/build/dist/chunks/HOEQVPY7.js +1 -0
  273. package/build/dist/chunks/{3R3C3CU5.js → IBXYIN7Q.js} +1 -1
  274. package/build/dist/chunks/{SXX52Y27.js → IUE6RASI.js} +1 -1
  275. package/build/dist/chunks/J2XAEVKC.js +1 -0
  276. package/build/dist/chunks/{AYM5L6L7.js → J3GFCBZZ.js} +1 -1
  277. package/build/dist/chunks/JNZZLA2A.js +1 -0
  278. package/build/dist/chunks/{T3MGNKA6.js → JPOYTTTW.js} +1 -1
  279. package/build/dist/chunks/{AZGMF26W.js → JST5JGAP.js} +1 -1
  280. package/build/dist/chunks/{BG4S6MSN.js → JVI26KQO.js} +1 -1
  281. package/build/dist/chunks/{FBQWTWPT.js → JWCOXLYA.js} +1 -1
  282. package/build/dist/chunks/{G7UKNO2I.js → KHJFXJBU.js} +1 -1
  283. package/build/dist/chunks/{HQVC6X3T.js → KSZMMNXK.js} +1 -1
  284. package/build/dist/chunks/{O7PQDUVT.js → L3ZM77SJ.js} +1 -1
  285. package/build/dist/chunks/{QRUC7EFE.js → L62M7LOB.js} +1 -1
  286. package/build/dist/chunks/{22S4SFD5.js → L7YBCMZU.js} +1 -1
  287. package/build/dist/chunks/{H6ED3RHF.js → LMVB3B6T.js} +1 -1
  288. package/build/dist/chunks/{UIIJWIR6.js → LQGPMOD2.js} +1 -1
  289. package/build/dist/chunks/{WLACEU2Y.js → LQUDJCAR.js} +1 -1
  290. package/build/dist/chunks/LT5P6PZW.js +1 -0
  291. package/build/dist/chunks/M7U3A4EH.js +3 -0
  292. package/build/dist/chunks/MFNP4KOK.js +1 -0
  293. package/build/dist/chunks/MKQVS3IO.js +1 -0
  294. package/build/dist/chunks/{7US6PD56.js → MLPWQTBS.js} +1 -1
  295. package/build/dist/chunks/{5XFXH2JT.js → NATG6YA6.js} +1 -1
  296. package/build/dist/chunks/{O47JXRXN.js → NAYRD43N.js} +1 -1
  297. package/build/dist/chunks/{6L6DSMCU.js → NMYGNJIJ.js} +1 -1
  298. package/build/dist/chunks/NRBIXV7V.js +1 -0
  299. package/build/dist/chunks/{D6VP3N27.js → NSOEDRBU.js} +1 -1
  300. package/build/dist/chunks/{HL2MLC3O.js → NU4K3TEZ.js} +1 -1
  301. package/build/dist/chunks/NWSPC3NH.js +1 -0
  302. package/build/dist/chunks/{I7NUTSSX.js → OE3CLZHR.js} +1 -1
  303. package/build/dist/chunks/{2NA6JLEC.js → OQVZVR2S.js} +1 -1
  304. package/build/dist/chunks/{D3OWLDVB.js → OVK4EEOD.js} +1 -1
  305. package/build/dist/chunks/{Q2VMH2LB.js → PARWLWXW.js} +1 -1
  306. package/build/dist/chunks/{DHXVYHT4.js → PTAWEHKB.js} +1 -1
  307. package/build/dist/chunks/{DVKDWXEJ.js → PWBL4WKB.js} +1 -1
  308. package/build/dist/chunks/{PR2QED25.js → PZHR4ITH.js} +1 -1
  309. package/build/dist/chunks/{JG24LNUI.js → Q356HHCL.js} +1 -1
  310. package/build/dist/chunks/{OG5HRQU4.js → QRDDKA4I.js} +1 -1
  311. package/build/dist/chunks/{YR3QJVJQ.js → QXNPPCOU.js} +1 -1
  312. package/build/dist/chunks/{6NR7SVRO.js → QYYFRAWY.js} +1 -1
  313. package/build/dist/chunks/{QR7ALOR4.js → R53P2K3C.js} +1 -1
  314. package/build/dist/chunks/{5RKWSFD2.js → R7FXNZRM.js} +1 -1
  315. package/build/dist/chunks/{CCEWSOBT.js → R7QPJQP6.js} +1 -1
  316. package/build/dist/chunks/{SLSPWXR6.js → R7SXC74O.js} +1 -1
  317. package/build/dist/chunks/{IHGVCPVA.js → RAKUK5VR.js} +1 -1
  318. package/build/dist/chunks/{7LDAJ6BM.js → S3HNPTXA.js} +1 -1
  319. package/build/dist/chunks/SI6GCOAS.js +1 -0
  320. package/build/dist/chunks/{WIDTTGSH.js → SJPM5ST4.js} +1 -1
  321. package/build/dist/chunks/{QYHJWU5T.js → SJPYXNOK.js} +1 -1
  322. package/build/dist/chunks/{VY3P34PY.js → SKQGLGES.js} +1 -1
  323. package/build/dist/chunks/{ZT67OMLW.js → SOYQOE5P.js} +1 -1
  324. package/build/dist/chunks/{GUBB5P6V.js → SQZRVIVF.js} +1 -1
  325. package/build/dist/chunks/{E24S22BZ.js → SSTROLQM.js} +1 -1
  326. package/build/dist/chunks/{DGGOO4RN.js → SXAIXD56.js} +1 -1
  327. package/build/dist/chunks/{D4WURN33.js → SXX3VTBP.js} +1 -1
  328. package/build/dist/chunks/{UXG67LH3.js → TCPPYBGQ.js} +1 -1
  329. package/build/dist/chunks/TFVWAYHY.js +1 -0
  330. package/build/dist/chunks/{67TJOOBI.js → TLJPVYRJ.js} +1 -1
  331. package/build/dist/chunks/{ULJ6E4HP.js → TMGWXDCZ.js} +1 -1
  332. package/build/dist/chunks/{NMFVXBTL.js → TNSKEHPC.js} +1 -1
  333. package/build/dist/chunks/{C2FEXLMA.js → TQL7UDFL.js} +1 -1
  334. package/build/dist/chunks/{QXFJZGVB.js → TWCSCRFS.js} +1 -1
  335. package/build/dist/chunks/{2EDXKJ3B.js → TWSTOFN3.js} +1 -1
  336. package/build/dist/chunks/{X6G4BD35.js → U3F6DDML.js} +1 -1
  337. package/build/dist/chunks/{XGUKLFBU.js → UFS2RVEZ.js} +1 -1
  338. package/build/dist/chunks/{RM5W63LO.js → UNZRE3YU.js} +1 -1
  339. package/build/dist/chunks/{GECX5U3F.js → USSOVTD5.js} +1 -1
  340. package/build/dist/chunks/V2OOOV6B.js +1 -0
  341. package/build/dist/chunks/{IRWEY7TQ.js → V5LTA42G.js} +1 -1
  342. package/build/dist/chunks/{TAI63P6E.js → VC2RCYQE.js} +1 -1
  343. package/build/dist/chunks/{3ZVGHC6S.js → VFSRRDLY.js} +1 -1
  344. package/build/dist/chunks/{XW7RH7YY.js → VVEUJ36E.js} +1 -1
  345. package/build/dist/chunks/{5EHQM6DM.js → WQ6H62DM.js} +1 -1
  346. package/build/dist/chunks/{TDN3C4IG.js → WQQJ7UPJ.js} +1 -1
  347. package/build/dist/chunks/{F3TJCOVV.js → WTSMPDT5.js} +1 -1
  348. package/build/dist/chunks/{BYXBS45D.js → WVXW6VL3.js} +1 -1
  349. package/build/dist/chunks/WWFOYZT2.js +1 -0
  350. package/build/dist/chunks/WWNAGOCD.js +1 -0
  351. package/build/dist/chunks/X2NJSQUY.js +203 -0
  352. package/build/dist/chunks/{FKAA7VUR.js → XMA25DXR.js} +1 -1
  353. package/build/dist/chunks/{C3ZZSGSP.js → XQUPZ3GU.js} +1 -1
  354. package/build/dist/chunks/XQXLFF7Y.js +1 -0
  355. package/build/dist/chunks/XV2HQKND.js +1 -0
  356. package/build/dist/chunks/{QZM7CWZW.js → XVFLT275.js} +1 -1
  357. package/build/dist/chunks/{BV3AHLH5.js → XWEFKXKA.js} +1 -1
  358. package/build/dist/chunks/{BEPSWFJX.js → Y2KH6DCE.js} +1 -1
  359. package/build/dist/chunks/{NKY3DT34.js → YA5WWDEW.js} +1 -1
  360. package/build/dist/chunks/YHB55C5T.js +1 -0
  361. package/build/dist/chunks/YQUKU2LS.js +1 -0
  362. package/build/dist/chunks/{72AWP4BM.js → YZSTP2E6.js} +1 -1
  363. package/build/dist/chunks/{T3NPRRTY.js → Z7RL4NGX.js} +1 -1
  364. package/build/dist/chunks/{YMB553OJ.js → ZT47KN7A.js} +1 -1
  365. package/build/dist/chunks/{NUTHT4FE.js → ZUG6MG46.js} +1 -1
  366. package/package.json +1 -1
  367. package/build/dist/chunks/6SCCW74G.js +0 -1
  368. package/build/dist/chunks/DD7755AW.js +0 -1
  369. package/build/dist/chunks/EYYUWFUR.js +0 -1
  370. package/build/dist/chunks/JRO6WTK4.js +0 -1
  371. package/build/dist/chunks/MNFU7PO3.js +0 -1
  372. package/build/dist/chunks/N3GWFLG6.js +0 -1
  373. package/build/dist/chunks/UMK564HS.js +0 -1
  374. package/build/dist/chunks/XPFVT2EA.js +0 -1
  375. package/build/dist/chunks/XUJSQV52.js +0 -1
@@ -1 +1 @@
1
- import{c as ee}from"./HQVC6X3T.js";import{a as B}from"./VJ3W2V3B.js";import{a as q}from"./EG6M6SSO.js";import{c as J,d as X,j as Y,l as Z}from"./73N3TOJL.js";import{a as w,i as G}from"./XPFVT2EA.js";import{a as f}from"./5YS5V2LK.js";import{a as Q}from"./JXOEJPJ4.js";import{encodeAbiParameters as de,encodeFunctionData as N,erc20Abi as ne,keccak256 as ue,parseAbi as oe,zeroAddress as le}from"viem";var s=oe(["function launchFactory() view returns (address)","function curve() view returns (address)","function factory() view returns (address)","function feeEscrow() view returns (address)","function memeHook() view returns (address)","function buybackVault() view returns (address)","function getLaunchedToken(address) view returns ((address token,address curve,address deployer,address creatorFeeRecipient,address pairToken,uint256 graduationThreshold,uint24 poolFee,int24 tickSpacing,uint16 creatorTaxBps,bool buybackEnabled,uint8 phase,uint256 sweptQuote,uint256 sweptTokens,uint256 sweptAt,bool exists))","function balanceOf(address) view returns (uint256)","function balanceOfToken(address account,address token) view returns (uint256)","function quoteFeeBalance() view returns (uint256)","function creatorTaxBalance() view returns (uint256)","function pendingFees(bytes32,address) view returns (uint256)","function pendingCreatorTax(bytes32,address) view returns (uint256)","function releasable(address token) view returns (uint256)","function vestedAmount(address token) view returns (uint256)"]),h=oe(["function sweepFees(uint256 minBuybackTokensOut)","function sweepPoolFees(bytes32 poolId,uint256 minConversionQuoteOut,uint256 minBuybackTokensOut)","function claim()","function claimToken(address token)","function release(address token)","error InternalSwapRequiresOperator()"]),ae={address:B,chainId:w,symbol:"ETH",decimals:18},te=G[w].pons;function c(o){let d=Y(o,"Provide a valid Pons coin address.",X);return Z(d,"Provide a nonzero Pons coin or contract address.")}function pe(o){let d=new Set;for(;o&&typeof o=="object"&&!d.has(o)&&d.size<16;){d.add(o);let l=o;if(l.data==="0x31cdb504"||l.data&&typeof l.data=="object"&&l.data.errorName==="InternalSwapRequiresOperator")return!0;o=l.cause}return!1}async function fe(o,d,l,k=!1,t){let i=c(d),b=c(l),e=o.clientFor(w);if(t===void 0&&await e.getChainId()!==w)throw new f(`Pons claims require chain ${w}.`);let n=t??await e.getBlockNumber(),[R,se]=await Promise.all([e.readContract({address:i,abi:s,functionName:"launchFactory",blockNumber:n}),e.readContract({address:i,abi:s,functionName:"curve",blockNumber:n})]),P=c(te.factory.address);if(c(R)!==P)throw new f("The coin must belong to the pinned Pons factory.");let y=c(se),[r,re,ie]=await Promise.all([e.readContract({address:P,abi:s,functionName:"getLaunchedToken",args:[i],blockNumber:n}),e.readContract({address:y,abi:s,functionName:"factory",blockNumber:n}),e.readContract({address:y,abi:s,functionName:"feeEscrow",blockNumber:n})]);if(!r.exists||c(r.token)!==i||c(r.curve)!==y||c(re)!==P)throw new f("The coin does not resolve to a consistent Pons launch.");if(r.phase<0||r.phase>3)throw new f("This Pons launch phase is unsupported.");let H=c(r.creatorFeeRecipient),A=H===b;if(k&&!A)throw new f("Only the current creator fee recipient can claim these fees. Use the recipient wallet or Safe.");let g=r.pairToken.toLowerCase(),S=g===le,m=c(ie),M=async a=>{let[u,p]=await Promise.all([e.readContract({address:a,abi:ne,functionName:"symbol",blockNumber:n}),e.readContract({address:a,abi:ne,functionName:"decimals",blockNumber:n})]);return{address:a,chainId:w,symbol:Q(u),decimals:p}},[v,T,_,j,$]=await Promise.all([M(i),S?ae:M(g),e.readContract({address:m,abi:s,functionName:"balanceOf",args:[b],blockNumber:n}),S?0n:e.readContract({address:m,abi:s,functionName:"balanceOfToken",args:[b,g],blockNumber:n}),e.readContract({address:m,abi:s,functionName:"balanceOfToken",args:[b,i],blockNumber:n})]),x=[],F=[],E,C=(a,u,p)=>o.unsignedTx({to:a,data:u,value:"0",chainId:w,description:p});if(r.phase===0){let[a,u]=await Promise.all([e.readContract({address:y,abi:s,functionName:"quoteFeeBalance",blockNumber:n}),e.readContract({address:y,abi:s,functionName:"creatorTaxBalance",blockNumber:n})]);a+u>0n&&(F.push({token:T,amount:(a+u).toString()}),r.buybackEnabled?E="buyback":A&&(await e.simulateContract({address:y,abi:h,functionName:"sweepFees",args:[0n],account:b,gas:q,blockNumber:n}),x.push(C(y,N({abi:h,functionName:"sweepFees",args:[0n]}),`Sweep ${T.symbol} curve fees into the recipient escrow.`))))}else if(r.phase===2){let a=c(await e.readContract({address:P,abi:s,functionName:"memeHook",blockNumber:n})),u=ee(g,i,r.poolFee,r.tickSpacing),p=ue(de([{type:"address"},{type:"address"},{type:"uint24"},{type:"int24"},{type:"address"}],[u.currency0,u.currency1,r.poolFee,r.tickSpacing,a])),[V,z,W,U]=await Promise.all([e.readContract({address:a,abi:s,functionName:"pendingFees",args:[p,g],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"pendingCreatorTax",args:[p,g],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"pendingFees",args:[p,i],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"pendingCreatorTax",args:[p,i],blockNumber:n})]);if(V+z>0n&&F.push({token:T,amount:(V+z).toString()}),W+U>0n&&F.push({token:v,amount:(W+U).toString()}),F.length)if(r.buybackEnabled)E="buyback";else if(A)try{await e.simulateContract({address:a,abi:h,functionName:"sweepPoolFees",args:[p,0n,0n],account:b,gas:q,blockNumber:n}),x.push(C(a,N({abi:h,functionName:"sweepPoolFees",args:[p,0n,0n]}),`Sweep ${T.symbol} pool fees into the recipient escrow.`))}catch(K){if(!pe(K))throw K;E="conversion"}else W+U>0n&&(E="conversion")}let I=0n,L=0n,D;if(r.buybackEnabled||$>0n||A){let a=c(await e.readContract({address:P,abi:s,functionName:"buybackVault",blockNumber:n}));if(a===c(te.buybackVault.address)){let[u,p,V]=await Promise.all([e.readContract({address:a,abi:s,functionName:"feeEscrow",blockNumber:n}),e.readContract({address:a,abi:s,functionName:"releasable",args:[i],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"vestedAmount",args:[i],blockNumber:n})]);if(c(u)!==m)throw new f("The Pons buyback vault credits a different escrow than this coin.");[D,I,L]=[a,p,V]}else if(k)throw new f("The Pons factory reports a buyback vault outside the pinned deployment.")}let O=[...x];if(k){I>0n&&O.push(C(D,N({abi:h,functionName:"release",args:[i]}),`Release the vested ${v.symbol} buyback into the recipient escrow.`));let a=S&&x.length>0,u=!S&&x.length>0;(_>0n||a)&&O.push(C(m,N({abi:h,functionName:"claim"}),"Claim the caller\u2019s full native ETH escrow balance across all coins.")),(j>0n||u)&&O.push(C(m,N({abi:h,functionName:"claimToken",args:[g]}),`Claim the caller\u2019s full ${T.symbol} escrow balance across all coins.`)),($>0n||I>0n)&&O.push(C(m,N({abi:h,functionName:"claimToken",args:[i]}),`Claim the caller\u2019s released ${v.symbol} escrow balance.`))}let ce=[{token:ae,amount:_.toString()},...S?[]:[{token:T,amount:j.toString()}],{token:v,amount:$.toString()}];return{coin:v,pair:T,phase:r.phase,recipient:H,holder:b,isRecipient:A,escrow:m,blockNumber:n.toString(),credited:ce,pendingBeforeSweep:F,operatorWait:E,txs:O,buybackVest:{enabled:r.buybackEnabled,vault:D??null,releasable:{token:v,amount:I.toString()},vested:{token:v,amount:L.toString()},note:"Releasable is the gross vested amount; the release splits it with the Pons protocol before crediting the recipient escrow, and the preview shows the net claim."}}}function be(o){return o==="buyback"?"Buyback-enabled fee sweeps are not built here; pending fees await Pons\u2019s operator.":o==="conversion"?"Pending token-side conversion is awaiting Pons\u2019s keeper; the hook sweep was skipped.":""}async function me(o,d,l){if(!d||Object.keys(d).some(R=>R!=="token"))throw new f("Unsupported input. Provide only the Pons coin token address.");let k=c(d.token),t=await fe(o,k,c(l),!0),{txs:i}=t,b=await o.preview(i,l),e=t.credited[t.pair.address===B?0:1],n=[i.length?`Unsigned Pons fee claim prepared for the current recipient. Claims withdraw every ${t.pair.address===B?"native ETH":`native ETH and ${t.pair.symbol}`} balance owed to this wallet on this escrow across its coins.`:"No claim is available from this escrow.",be(t.operatorWait),BigInt(t.buybackVest.releasable.amount)>0n?`The buyback vest has ${t.buybackVest.releasable.amount} ${t.coin.symbol} base units releasable (gross); the release credits the escrow and the claim withdraws it.`:"","Pending amounts are pre-sweep fee and tax totals, not a guaranteed creator payout. Preview excludes gas. No transaction was sent."].filter(Boolean).join(" ");return{txs:i,summary:n,preview:b,claimable:e,credited:t.credited,pendingBeforeSweep:t.pendingBeforeSweep,waitingForKeeper:t.operatorWait!==void 0,operatorWait:t.operatorWait??null,buybackVest:t.buybackVest,recipient:t.recipient,escrow:t.escrow,phase:t.phase,blockNumber:t.blockNumber}}var Ne=o=>({tools:[{name:"pons_claim",inputSchema:{type:"object",additionalProperties:!1,required:["token"],properties:{token:{...J,description:"Pons coin address on chain 4663."}}},execute:async(d,l)=>{try{return await me(o,d,l)}catch(k){throw new f(o.plainError(k))}}}]});export{fe as a,be as b,Ne as c};
1
+ import{c as ee}from"./KSZMMNXK.js";import{a as B}from"./CY75R4FK.js";import{a as q}from"./EG6M6SSO.js";import{c as J,d as X,j as Y,l as Z}from"./73N3TOJL.js";import{a as w,i as G}from"./G6HCV67X.js";import{a as f}from"./5YS5V2LK.js";import{a as Q}from"./JXOEJPJ4.js";import{encodeAbiParameters as de,encodeFunctionData as N,erc20Abi as ne,keccak256 as ue,parseAbi as oe,zeroAddress as le}from"viem";var s=oe(["function launchFactory() view returns (address)","function curve() view returns (address)","function factory() view returns (address)","function feeEscrow() view returns (address)","function memeHook() view returns (address)","function buybackVault() view returns (address)","function getLaunchedToken(address) view returns ((address token,address curve,address deployer,address creatorFeeRecipient,address pairToken,uint256 graduationThreshold,uint24 poolFee,int24 tickSpacing,uint16 creatorTaxBps,bool buybackEnabled,uint8 phase,uint256 sweptQuote,uint256 sweptTokens,uint256 sweptAt,bool exists))","function balanceOf(address) view returns (uint256)","function balanceOfToken(address account,address token) view returns (uint256)","function quoteFeeBalance() view returns (uint256)","function creatorTaxBalance() view returns (uint256)","function pendingFees(bytes32,address) view returns (uint256)","function pendingCreatorTax(bytes32,address) view returns (uint256)","function releasable(address token) view returns (uint256)","function vestedAmount(address token) view returns (uint256)"]),h=oe(["function sweepFees(uint256 minBuybackTokensOut)","function sweepPoolFees(bytes32 poolId,uint256 minConversionQuoteOut,uint256 minBuybackTokensOut)","function claim()","function claimToken(address token)","function release(address token)","error InternalSwapRequiresOperator()"]),ae={address:B,chainId:w,symbol:"ETH",decimals:18},te=G[w].pons;function c(o){let d=Y(o,"Provide a valid Pons coin address.",X);return Z(d,"Provide a nonzero Pons coin or contract address.")}function pe(o){let d=new Set;for(;o&&typeof o=="object"&&!d.has(o)&&d.size<16;){d.add(o);let l=o;if(l.data==="0x31cdb504"||l.data&&typeof l.data=="object"&&l.data.errorName==="InternalSwapRequiresOperator")return!0;o=l.cause}return!1}async function fe(o,d,l,k=!1,t){let i=c(d),b=c(l),e=o.clientFor(w);if(t===void 0&&await e.getChainId()!==w)throw new f(`Pons claims require chain ${w}.`);let n=t??await e.getBlockNumber(),[R,se]=await Promise.all([e.readContract({address:i,abi:s,functionName:"launchFactory",blockNumber:n}),e.readContract({address:i,abi:s,functionName:"curve",blockNumber:n})]),P=c(te.factory.address);if(c(R)!==P)throw new f("The coin must belong to the pinned Pons factory.");let y=c(se),[r,re,ie]=await Promise.all([e.readContract({address:P,abi:s,functionName:"getLaunchedToken",args:[i],blockNumber:n}),e.readContract({address:y,abi:s,functionName:"factory",blockNumber:n}),e.readContract({address:y,abi:s,functionName:"feeEscrow",blockNumber:n})]);if(!r.exists||c(r.token)!==i||c(r.curve)!==y||c(re)!==P)throw new f("The coin does not resolve to a consistent Pons launch.");if(r.phase<0||r.phase>3)throw new f("This Pons launch phase is unsupported.");let H=c(r.creatorFeeRecipient),A=H===b;if(k&&!A)throw new f("Only the current creator fee recipient can claim these fees. Use the recipient wallet or Safe.");let g=r.pairToken.toLowerCase(),S=g===le,m=c(ie),M=async a=>{let[u,p]=await Promise.all([e.readContract({address:a,abi:ne,functionName:"symbol",blockNumber:n}),e.readContract({address:a,abi:ne,functionName:"decimals",blockNumber:n})]);return{address:a,chainId:w,symbol:Q(u),decimals:p}},[v,T,_,j,$]=await Promise.all([M(i),S?ae:M(g),e.readContract({address:m,abi:s,functionName:"balanceOf",args:[b],blockNumber:n}),S?0n:e.readContract({address:m,abi:s,functionName:"balanceOfToken",args:[b,g],blockNumber:n}),e.readContract({address:m,abi:s,functionName:"balanceOfToken",args:[b,i],blockNumber:n})]),x=[],F=[],E,C=(a,u,p)=>o.unsignedTx({to:a,data:u,value:"0",chainId:w,description:p});if(r.phase===0){let[a,u]=await Promise.all([e.readContract({address:y,abi:s,functionName:"quoteFeeBalance",blockNumber:n}),e.readContract({address:y,abi:s,functionName:"creatorTaxBalance",blockNumber:n})]);a+u>0n&&(F.push({token:T,amount:(a+u).toString()}),r.buybackEnabled?E="buyback":A&&(await e.simulateContract({address:y,abi:h,functionName:"sweepFees",args:[0n],account:b,gas:q,blockNumber:n}),x.push(C(y,N({abi:h,functionName:"sweepFees",args:[0n]}),`Sweep ${T.symbol} curve fees into the recipient escrow.`))))}else if(r.phase===2){let a=c(await e.readContract({address:P,abi:s,functionName:"memeHook",blockNumber:n})),u=ee(g,i,r.poolFee,r.tickSpacing),p=ue(de([{type:"address"},{type:"address"},{type:"uint24"},{type:"int24"},{type:"address"}],[u.currency0,u.currency1,r.poolFee,r.tickSpacing,a])),[V,z,W,U]=await Promise.all([e.readContract({address:a,abi:s,functionName:"pendingFees",args:[p,g],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"pendingCreatorTax",args:[p,g],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"pendingFees",args:[p,i],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"pendingCreatorTax",args:[p,i],blockNumber:n})]);if(V+z>0n&&F.push({token:T,amount:(V+z).toString()}),W+U>0n&&F.push({token:v,amount:(W+U).toString()}),F.length)if(r.buybackEnabled)E="buyback";else if(A)try{await e.simulateContract({address:a,abi:h,functionName:"sweepPoolFees",args:[p,0n,0n],account:b,gas:q,blockNumber:n}),x.push(C(a,N({abi:h,functionName:"sweepPoolFees",args:[p,0n,0n]}),`Sweep ${T.symbol} pool fees into the recipient escrow.`))}catch(K){if(!pe(K))throw K;E="conversion"}else W+U>0n&&(E="conversion")}let I=0n,L=0n,D;if(r.buybackEnabled||$>0n||A){let a=c(await e.readContract({address:P,abi:s,functionName:"buybackVault",blockNumber:n}));if(a===c(te.buybackVault.address)){let[u,p,V]=await Promise.all([e.readContract({address:a,abi:s,functionName:"feeEscrow",blockNumber:n}),e.readContract({address:a,abi:s,functionName:"releasable",args:[i],blockNumber:n}),e.readContract({address:a,abi:s,functionName:"vestedAmount",args:[i],blockNumber:n})]);if(c(u)!==m)throw new f("The Pons buyback vault credits a different escrow than this coin.");[D,I,L]=[a,p,V]}else if(k)throw new f("The Pons factory reports a buyback vault outside the pinned deployment.")}let O=[...x];if(k){I>0n&&O.push(C(D,N({abi:h,functionName:"release",args:[i]}),`Release the vested ${v.symbol} buyback into the recipient escrow.`));let a=S&&x.length>0,u=!S&&x.length>0;(_>0n||a)&&O.push(C(m,N({abi:h,functionName:"claim"}),"Claim the caller\u2019s full native ETH escrow balance across all coins.")),(j>0n||u)&&O.push(C(m,N({abi:h,functionName:"claimToken",args:[g]}),`Claim the caller\u2019s full ${T.symbol} escrow balance across all coins.`)),($>0n||I>0n)&&O.push(C(m,N({abi:h,functionName:"claimToken",args:[i]}),`Claim the caller\u2019s released ${v.symbol} escrow balance.`))}let ce=[{token:ae,amount:_.toString()},...S?[]:[{token:T,amount:j.toString()}],{token:v,amount:$.toString()}];return{coin:v,pair:T,phase:r.phase,recipient:H,holder:b,isRecipient:A,escrow:m,blockNumber:n.toString(),credited:ce,pendingBeforeSweep:F,operatorWait:E,txs:O,buybackVest:{enabled:r.buybackEnabled,vault:D??null,releasable:{token:v,amount:I.toString()},vested:{token:v,amount:L.toString()},note:"Releasable is the gross vested amount; the release splits it with the Pons protocol before crediting the recipient escrow, and the preview shows the net claim."}}}function be(o){return o==="buyback"?"Buyback-enabled fee sweeps are not built here; pending fees await Pons\u2019s operator.":o==="conversion"?"Pending token-side conversion is awaiting Pons\u2019s keeper; the hook sweep was skipped.":""}async function me(o,d,l){if(!d||Object.keys(d).some(R=>R!=="token"))throw new f("Unsupported input. Provide only the Pons coin token address.");let k=c(d.token),t=await fe(o,k,c(l),!0),{txs:i}=t,b=await o.preview(i,l),e=t.credited[t.pair.address===B?0:1],n=[i.length?`Unsigned Pons fee claim prepared for the current recipient. Claims withdraw every ${t.pair.address===B?"native ETH":`native ETH and ${t.pair.symbol}`} balance owed to this wallet on this escrow across its coins.`:"No claim is available from this escrow.",be(t.operatorWait),BigInt(t.buybackVest.releasable.amount)>0n?`The buyback vest has ${t.buybackVest.releasable.amount} ${t.coin.symbol} base units releasable (gross); the release credits the escrow and the claim withdraws it.`:"","Pending amounts are pre-sweep fee and tax totals, not a guaranteed creator payout. Preview excludes gas. No transaction was sent."].filter(Boolean).join(" ");return{txs:i,summary:n,preview:b,claimable:e,credited:t.credited,pendingBeforeSweep:t.pendingBeforeSweep,waitingForKeeper:t.operatorWait!==void 0,operatorWait:t.operatorWait??null,buybackVest:t.buybackVest,recipient:t.recipient,escrow:t.escrow,phase:t.phase,blockNumber:t.blockNumber}}var Ne=o=>({tools:[{name:"pons_claim",inputSchema:{type:"object",additionalProperties:!1,required:["token"],properties:{token:{...J,description:"Pons coin address on chain 4663."}}},execute:async(d,l)=>{try{return await me(o,d,l)}catch(k){throw new f(o.plainError(k))}}}]});export{fe as a,be as b,Ne as c};
@@ -1 +1 @@
1
- import{j as p}from"./MEMVFR7Z.js";import{a as d}from"./VJ3W2V3B.js";import{a as f}from"./6IM6A5VA.js";import{d as a,i as c}from"./73N3TOJL.js";import{a as m}from"./RETS2ZEK.js";import{a as i}from"./XPFVT2EA.js";import{a as s}from"./5YS5V2LK.js";import{erc20Abi as u,zeroAddress as b}from"viem";function T(r,n,e=256,t=!1){if(typeof r!="string"||!/^[0-9]+$/.test(r))throw new s(`${n} must be a decimal base-unit string.`);let o=m(r);if(!t&&o===0n||o>=1n<<BigInt(e))throw new s(`${n} must be ${t?"a":"a positive"} uint${e}.`);return o}function g(r){return c(r,"Provide a token or contract address.",a)}function E(r){return typeof r=="string"&&["eth",d.toLowerCase()].includes(r.toLowerCase())?b:g(r)}function D(r){let n=r??50;if(typeof n!="number"||!Number.isInteger(n)||n<0||n>=1e4)throw new s("Slippage must be an integer from 0 to 9999 bps.");return n}async function N(r,n,e){if(n===b)return{address:d,symbol:"ETH",decimals:18,chainId:i};let t=r.clientFor(i),[o,w]=await Promise.all([t.readContract({address:n,abi:u,functionName:"symbol",blockNumber:e}),t.readContract({address:n,abi:u,functionName:"decimals",blockNumber:e})]);return{address:n,symbol:p(o,n),decimals:w,chainId:i}}async function S(r,n,e,t){return f(e),{txs:n,preview:await r.preview(n,e),summary:t}}function $(r,n){if(Object.keys(r).some(e=>!n.includes(e)))throw new s(`Provide only ${n.join(", ")}.`)}export{T as a,g as b,E as c,D as d,N as e,S as f,$ as g};
1
+ import{j as p}from"./6ZYLNB2B.js";import{a as d}from"./CY75R4FK.js";import{a as f}from"./6IM6A5VA.js";import{d as a,i as c}from"./73N3TOJL.js";import{a as m}from"./RETS2ZEK.js";import{a as i}from"./G6HCV67X.js";import{a as s}from"./5YS5V2LK.js";import{erc20Abi as u,zeroAddress as b}from"viem";function T(r,n,e=256,t=!1){if(typeof r!="string"||!/^[0-9]+$/.test(r))throw new s(`${n} must be a decimal base-unit string.`);let o=m(r);if(!t&&o===0n||o>=1n<<BigInt(e))throw new s(`${n} must be ${t?"a":"a positive"} uint${e}.`);return o}function g(r){return c(r,"Provide a token or contract address.",a)}function E(r){return typeof r=="string"&&["eth",d.toLowerCase()].includes(r.toLowerCase())?b:g(r)}function D(r){let n=r??50;if(typeof n!="number"||!Number.isInteger(n)||n<0||n>=1e4)throw new s("Slippage must be an integer from 0 to 9999 bps.");return n}async function N(r,n,e){if(n===b)return{address:d,symbol:"ETH",decimals:18,chainId:i};let t=r.clientFor(i),[o,w]=await Promise.all([t.readContract({address:n,abi:u,functionName:"symbol",blockNumber:e}),t.readContract({address:n,abi:u,functionName:"decimals",blockNumber:e})]);return{address:n,symbol:p(o,n),decimals:w,chainId:i}}async function S(r,n,e,t){return f(e),{txs:n,preview:await r.preview(n,e),summary:t}}function $(r,n){if(Object.keys(r).some(e=>!n.includes(e)))throw new s(`Provide only ${n.join(", ")}.`)}export{T as a,g as b,E as c,D as d,N as e,S as f,$ as g};
@@ -0,0 +1 @@
1
+ function p(r,s){return r==="hoodlock_airdrop_claim"&&!Object.hasOwn(s,"id")}var h=new Map([]),_="find_tool",l="run_tool",a=["oak_setup","oak_identity_unlink","oak_subscribe","oak_renew","oak_redeem","send","hoodlock_feature_buy","hoodlock_feature_claim","hoodlock_referral_register","heyresearch_token_facts","heyresearch_feed","heyresearch_follow","heyresearch_unfollow","heyresearch_position_context"],c={oak:["account","balances","find_token","price","quote","swap","positions","send","oak_setup","oak_subscribe","oak_renew","oak_identity_unlink","oak_redeem"],kyberswap:[],velora:[],steakhouse:["steakhouse_deposit","steakhouse_withdraw"],spark:["spark_deposit","spark_withdraw"],netnet:["netnet_deposit","netnet_withdraw"],longbow:["longbow_list","longbow_deposit","longbow_withdraw"],grove:["grove_deposit","grove_withdraw"],beefy:["beefy_list","beefy_deposit","beefy_withdraw"],pons:["pons_browse","pons_buy","pons_sell","pons_launch"],orbio:["orbio_credit_status","orbio_buy_credit"],hoodlock:["hoodlock_list_locks","hoodlock_lock","hoodlock_withdraw"],merkl:["merkl_rewards","merkl_claim"],relay:["relay_bridge_in","relay_bridge_out","relay_status"],lighter:["lighter_funding"],wormhole:[],erc8004:["erc8004_identity"],hoodag:["hoodag_resolve","hoodag_register"],heyresearch:["heyresearch_research_project","heyresearch_token_facts","heyresearch_feed","heyresearch_follow","heyresearch_position_context"],priors:["priors_status","priors_lend","priors_withdraw","priors_borrow","priors_repay"],morpho:["morpho_status","morpho_supply","morpho_withdraw","morpho_supply_collateral","morpho_withdraw_collateral","morpho_borrow","morpho_repay"],uniswap:["uniswap_list_positions","uniswap_add","uniswap_remove","uniswap_collect"],hookr:["hookr_orders","hookr_create","hookr_cancel"],meridian:["meridian_browse","meridian_positions","meridian_sell","meridian_redeem"],tickerspring:["tickerspring_account","tickerspring_create","tickerspring_cancel","tickerspring_claim"],clanker:["clanker_browse","clanker_launch"],poolstrade:["poolstrade_status","poolstrade_buy","poolstrade_sell","poolstrade_launch"]};function w(r,s){let i=new Set(r),t=new Set;for(let[o,n]of Object.entries(c))for(let e of n){if(t.has(e))throw new Error(`Visible tool ${e} is listed twice.`);if(o!=="oak"&&!e.startsWith(`${o}_`))throw new Error(`Visible tool ${e} is filed under ${o}.`);if(a.includes(e)||i.has(e))t.add(e);else if(s==="mainnet")throw new Error(`Visible tool ${e} is not registered.`)}for(let o of[_,l,...a])if(i.has(o))throw new Error(`Tool name ${o} is reserved for the add-on.`);return t}export{p as a,h as b,_ as c,l as d,a as e,c as f,w as g};
@@ -1,2 +1,2 @@
1
- import{g as c}from"./73N3TOJL.js";import{a,i as l}from"./XPFVT2EA.js";import{a as f}from"./5YS5V2LK.js";import{formatUnits as b,getAddress as d,hashTypedData as w,parseAbi as I}from"viem";var p=d("0x8BE478c754D9124D11e78dB20F5bf4dA45403275"),h=d("0x0c5091235A25bBFD3F5a009cBe04120D0CBAD573"),x=6228n,_="https://priors.trade/prove",$="https://priors.trade/invite",m=1800,k=3600,S=/^[0-9a-f]{32}$/,A=/^priors-invite:(\d{1,10}):(\d{1,12}):(0x[0-9a-fA-F]{130})$/,g=I(["function amount() view returns (uint256)","function unusedAfter() view returns (uint64)","function bonds(uint256 agentId) view returns ((address depositor, uint64 at, uint256 amount, uint256 qualifiedAt))","function releasable(uint256 agentId) view returns (bool)","function unusedReleaseAt(uint256 agentId) view returns (uint256)","function progress(uint256 agentId) view returns (uint256 repaid, uint256 needed)","function deposit(uint256 agentId)","function release(uint256 agentId)","error AlreadyBonded(uint256 agentId)","error NotOwner(uint256 agentId)","error AgentDefaulted(uint256 agentId)","error NoBond(uint256 agentId)","error NotReleasable(uint256 agentId)"]);async function E(e,t){let r=e.clientFor(a),n=await r.getBlockNumber({cacheTime:0}),[i,o,s]=await Promise.all([r.readContract({address:p,abi:g,functionName:"amount",blockNumber:n}),r.readContract({address:p,abi:g,functionName:"unusedAfter",blockNumber:n}),r.readContract({address:p,abi:g,functionName:"unusedReleaseAt",args:[t],blockNumber:n})]);if(typeof i!="bigint"||i<0n||typeof o!="bigint"||o<0n||typeof s!="bigint"||s<0n)throw new f("Priors bond terms are unavailable. Read amount, unusedAfter and unusedReleaseAt again before posting a bond.");return{amount:i.toString(),unusedAfter:o.toString(),unusedReleaseAt:s.toString(),blockNumber:n.toString(),summary:`Bond first: the starter line requires ${b(i,6)} USDG locked for at least ${o} seconds (${Number(o)/86400} days) after posting${s?`; unusedReleaseAt(${t}) is ${s} Unix seconds`:"; the exact release time is read after posting"}. Release requires no line and no open loan; default can forfeit the bond. Invites are not guaranteed. The credit score can lag qualifying repayments.`}}var R="(uint256 agentId, uint256 sponsorId, address owner, uint256 maxPremiumBps, uint256 nonce, uint256 deadline)",B=I(["function agentId() view returns (uint256)","function firstLined(uint256 id) view returns (bool)","function inviteDigest(uint256 id, uint64 expiry) view returns (bytes32)","function inviters(address who) view returns (bool)","function inviteUsed(bytes32 digest) view returns (bool)","function epochRoom() view returns (uint256)","function rules() view returns (uint256 reserveBps, uint256 firstLine, uint256 secondLine, uint256 epochCap, uint64 epochLength, uint64 minSeasoning, uint256 minQualified, uint256 minScore, uint64 idleAfter)",`function firstLine(uint256 id, uint64 expiry, bytes invite, ${R} c, bytes consentSig)`,"error NotAdopted()","error AlreadyLined(uint256 agentId)","error OwnerDefaulted(address owner)","error EpochCapReached(uint256 wanted, uint256 left)","error NotInvited(uint256 agentId, address signer)","error InviteExpired(uint256 agentId, uint64 expiry)","error InviteUsed(uint256 agentId)","error BadConsent()","error ConsentExpired()","error PremiumTooHigh(uint256 bps, uint256 cap)","error InsufficientBacking(uint256 rootId, uint256 requested, uint256 free)","error AgentDefaulted(uint256 agentId)","error IsRoot(uint256 agentId)","error V1Busy(uint256 agentId)","error LoanOpen(uint256 agentId)","error InvalidAgent(uint256 id)","error Paused()","error ECDSAInvalidSignature()","error ECDSAInvalidSignatureLength(uint256 length)","error ECDSAInvalidSignatureS(bytes32 s)"]),v={Consent:[{name:"agentId",type:"uint256"},{name:"sponsorId",type:"uint256"},{name:"owner",type:"address"},{name:"maxPremiumBps",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};function D(){return{name:"Priors Credit",version:"2",chainId:a,verifyingContract:d(l[4663].priors.pool.address)}}function q(e){return{domain:{...D()},types:{Consent:v.Consent.map(t=>({...t}))},primaryType:"Consent",message:{agentId:e.agentId,sponsorId:x.toString(),owner:d(e.owner),maxPremiumBps:"0",nonce:e.nonce,deadline:e.deadline}}}function L(e){return w(e)}function U(e,t){return w({domain:{name:"Priors Treasury",version:"4",chainId:a,verifyingContract:h},types:{Invite:[{name:"agentId",type:"uint256"},{name:"expiry",type:"uint64"}]},primaryType:"Invite",message:{agentId:e,expiry:t}})}function O(e,t,r){return["priors.trade seat request","",`I own agent #${e} on Robinhood Chain and I am asking for a seat.`,"Asked from the priors.trade start page","","This signature only proves ownership. It sends no transaction and moves no funds.","",`request: ${t}`,`expires: ${new Date(r*1e3).toISOString().replace(".000","")}`].join(`
1
+ import{g as c}from"./73N3TOJL.js";import{a,i as l}from"./G6HCV67X.js";import{a as f}from"./5YS5V2LK.js";import{formatUnits as b,getAddress as d,hashTypedData as w,parseAbi as I}from"viem";var p=d("0x8BE478c754D9124D11e78dB20F5bf4dA45403275"),h=d("0x0c5091235A25bBFD3F5a009cBe04120D0CBAD573"),x=6228n,_="https://priors.trade/prove",$="https://priors.trade/invite",m=1800,k=3600,S=/^[0-9a-f]{32}$/,A=/^priors-invite:(\d{1,10}):(\d{1,12}):(0x[0-9a-fA-F]{130})$/,g=I(["function amount() view returns (uint256)","function unusedAfter() view returns (uint64)","function bonds(uint256 agentId) view returns ((address depositor, uint64 at, uint256 amount, uint256 qualifiedAt))","function releasable(uint256 agentId) view returns (bool)","function unusedReleaseAt(uint256 agentId) view returns (uint256)","function progress(uint256 agentId) view returns (uint256 repaid, uint256 needed)","function deposit(uint256 agentId)","function release(uint256 agentId)","error AlreadyBonded(uint256 agentId)","error NotOwner(uint256 agentId)","error AgentDefaulted(uint256 agentId)","error NoBond(uint256 agentId)","error NotReleasable(uint256 agentId)"]);async function E(e,t){let r=e.clientFor(a),n=await r.getBlockNumber({cacheTime:0}),[i,o,s]=await Promise.all([r.readContract({address:p,abi:g,functionName:"amount",blockNumber:n}),r.readContract({address:p,abi:g,functionName:"unusedAfter",blockNumber:n}),r.readContract({address:p,abi:g,functionName:"unusedReleaseAt",args:[t],blockNumber:n})]);if(typeof i!="bigint"||i<0n||typeof o!="bigint"||o<0n||typeof s!="bigint"||s<0n)throw new f("Priors bond terms are unavailable. Read amount, unusedAfter and unusedReleaseAt again before posting a bond.");return{amount:i.toString(),unusedAfter:o.toString(),unusedReleaseAt:s.toString(),blockNumber:n.toString(),summary:`Bond first: the starter line requires ${b(i,6)} USDG locked for at least ${o} seconds (${Number(o)/86400} days) after posting${s?`; unusedReleaseAt(${t}) is ${s} Unix seconds`:"; the exact release time is read after posting"}. Release requires no line and no open loan; default can forfeit the bond. Invites are not guaranteed. The credit score can lag qualifying repayments.`}}var R="(uint256 agentId, uint256 sponsorId, address owner, uint256 maxPremiumBps, uint256 nonce, uint256 deadline)",B=I(["function agentId() view returns (uint256)","function firstLined(uint256 id) view returns (bool)","function inviteDigest(uint256 id, uint64 expiry) view returns (bytes32)","function inviters(address who) view returns (bool)","function inviteUsed(bytes32 digest) view returns (bool)","function epochRoom() view returns (uint256)","function rules() view returns (uint256 reserveBps, uint256 firstLine, uint256 secondLine, uint256 epochCap, uint64 epochLength, uint64 minSeasoning, uint256 minQualified, uint256 minScore, uint64 idleAfter)",`function firstLine(uint256 id, uint64 expiry, bytes invite, ${R} c, bytes consentSig)`,"error NotAdopted()","error AlreadyLined(uint256 agentId)","error OwnerDefaulted(address owner)","error EpochCapReached(uint256 wanted, uint256 left)","error NotInvited(uint256 agentId, address signer)","error InviteExpired(uint256 agentId, uint64 expiry)","error InviteUsed(uint256 agentId)","error BadConsent()","error ConsentExpired()","error PremiumTooHigh(uint256 bps, uint256 cap)","error InsufficientBacking(uint256 rootId, uint256 requested, uint256 free)","error AgentDefaulted(uint256 agentId)","error IsRoot(uint256 agentId)","error V1Busy(uint256 agentId)","error LoanOpen(uint256 agentId)","error InvalidAgent(uint256 id)","error Paused()","error ECDSAInvalidSignature()","error ECDSAInvalidSignatureLength(uint256 length)","error ECDSAInvalidSignatureS(bytes32 s)"]),v={Consent:[{name:"agentId",type:"uint256"},{name:"sponsorId",type:"uint256"},{name:"owner",type:"address"},{name:"maxPremiumBps",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};function D(){return{name:"Priors Credit",version:"2",chainId:a,verifyingContract:d(l[4663].priors.pool.address)}}function q(e){return{domain:{...D()},types:{Consent:v.Consent.map(t=>({...t}))},primaryType:"Consent",message:{agentId:e.agentId,sponsorId:x.toString(),owner:d(e.owner),maxPremiumBps:"0",nonce:e.nonce,deadline:e.deadline}}}function L(e){return w(e)}function U(e,t){return w({domain:{name:"Priors Treasury",version:"4",chainId:a,verifyingContract:h},types:{Invite:[{name:"agentId",type:"uint256"},{name:"expiry",type:"uint64"}]},primaryType:"Invite",message:{agentId:e,expiry:t}})}function O(e,t,r){return["priors.trade seat request","",`I own agent #${e} on Robinhood Chain and I am asking for a seat.`,"Asked from the priors.trade start page","","This signature only proves ownership. It sends no transaction and moves no funds.","",`request: ${t}`,`expires: ${new Date(r*1e3).toISOString().replace(".000","")}`].join(`
2
2
  `)}var u=e=>typeof e=="string"?JSON.stringify(e.length>80?`${e.slice(0,80)}...`:e):typeof e=="number"?String(e):e===null?"null":typeof e;function V(e,t){let r=o=>({ok:!1,why:o});if(!e||typeof e!="object"||Array.isArray(e))return r("its answer is not the bot's form");let n=e;if(n.ok!==!0)return{ok:!1,refused:!0,why:typeof n.error=="string"&&n.error?n.error:"it answered no, with no reason"};if(typeof n.agentId!="string"&&typeof n.agentId!="number"||String(n.agentId)!==t.agentId)return r(`it is for agent ${u(n.agentId)}, not agent #${t.agentId}`);if(typeof n.owner!="string"||!c(n.owner,t.owner))return r(`it names ${u(n.owner)} as the agent's owner, not this wallet (${t.owner})`);if(typeof n.n!="string"||!S.test(n.n))return r(`its request ${u(n.n)} is not the bot's form (32 hex digits)`);if(typeof n.exp!="number"||!Number.isSafeInteger(n.exp))return r(`its expiry ${u(n.exp)} is not a time`);if(n.exp<=t.now)return r(`its expiry (${new Date(n.exp*1e3).toISOString()}) has already passed`);if(n.exp>t.now+m+300)return r(`its expiry (${new Date(n.exp*1e3).toISOString()}) is further away than the bot's ${m/60} minutes`);let i=O(t.agentId,n.n,n.exp);if(typeof n.message!="string")return r("it carries no message");if(n.message!==i){let o=0;for(;o<i.length&&n.message[o]===i[o];)o++;return r(`its message is not the bot's own form for agent #${t.agentId}, request ${n.n} and that expiry: the two first differ at character ${o+1} of ${i.length}`)}return{ok:!0,n:n.n,exp:n.exp,message:i}}function H(e,t,r){let n=A.exec(typeof e=="string"?e:"");if(!n)return{ok:!1,why:"it is not an invite code (priors-invite:<id>:<expiry>:<signature>)"};if(n[1]!==t)return{ok:!1,why:`it is for agent #${n[1]}, not agent #${t}`};let i=Number(n[2]);return i<=r?{ok:!1,why:`it expired at ${new Date(i*1e3).toISOString()}`}:{ok:!0,expiry:BigInt(n[2]),signature:n[3]}}var y=e=>`${new Date(e*1e3).toISOString().slice(0,16).replace("T"," ")} UTC`;function F(e){let t=typeof e.reopensAt=="number"&&Number.isSafeInteger(e.reopensAt)&&e.reopensAt>0?e.reopensAt:null;switch(e.reason){case"default":return"A default on this wallet's record stops new lines for its agents, so a bond would bring no invite.";case"day":return"Today's automatic invites are taken. New ones open at 00:00 UTC: call priors_starter_line again after that.";case"room":return e.held===!0&&t?`This week's first lines are held by invites that haven't been used yet. One may be free after ${y(t)}: call priors_starter_line again then.`:`This week's first lines are taken.${t?` New ones open after ${y(t)}: call priors_starter_line again then.`:" Come back next week."}`;case"owner":return`This wallet already used its ${typeof e.perOwner=="number"&&Number.isSafeInteger(e.perOwner)&&e.perOwner>0?e.perOwner:2} automatic invites, so a bond would bring no invite.`;case"waiting":return"Another agent of this wallet has an invite waiting. Use it, or let it expire, before asking for this one.";case"backing":return"The treasury can't back a new line right now. Try again later.";default:return"Automatic invites aren't open right now, so a bond would bring no invite. Try again later."}}export{p as a,h as b,x as c,_ as d,$ as e,m as f,k as g,S as h,A as i,g as j,E as k,B as l,v as m,D as n,q as o,L as p,U as q,O as r,V as s,H as t,F as u};
@@ -1 +1 @@
1
- import{n as k}from"./CAU44UWP.js";import{a as y}from"./OG5HRQU4.js";import{b as T}from"./6IM6A5VA.js";import{b as R}from"./UWOFA6GV.js";import{c as _,d as I,g as v,i as $,n as V}from"./73N3TOJL.js";import{a as u}from"./XPFVT2EA.js";import{a as o}from"./5YS5V2LK.js";import{encodeFunctionData as D,erc20Abi as O,getAddress as C,parseAbi as S}from"viem";var N=C("0x0000000000bbf5c5fd284e657f01bd000933c96d"),b=C("0x0a0d53b6684c7b32b4cbef5fe8483bfcc8406742"),U=C("0x00700052c0608F670705380a4900e0a8080010CC"),x=S(["function getCollectedFees(address partner,address token) view returns (uint256)","function withdrawAllFees(address token,address recipient) returns (uint256 amount)","function getBalance(address token,address partner) view returns (uint256)","function withdrawAllERC20(address token,address recipient) returns (bool)","function withdrawNative(uint256 amount,address owner,address receiver)"]),H=(1n<<256n)-1n,P={type:"string",enum:["market","delta"]};function p(t){return $(t,"Provide a token or wallet address.",I)}function A(t){if(t!=="market"&&t!=="delta")throw new o("Choose market or delta fees.");return t}function B(t){return V(t,"Amount must be positive and within uint256.",{notString:"Amount must be a decimal base-unit string.",positive:!0}).toString()}function E(t,m,d){if(d=p(d),t==="velora_unwrap_deth"){for(let e of Object.keys(m))if(e!=="amount")throw new o(`Unsupported ${t} argument: ${e}.`);let a=B(m.amount);return{tx:T({to:b,chainId:u,value:"0",data:D({abi:x,functionName:"withdrawNative",args:[BigInt(a),d,d]}),description:`Unwrap ${a} dETH base units into the same amount of native ETH for ${d} on chain ${u}.`}),inputs:[{token:b,amount:a}]}}if(t!=="velora_claim_fees")throw new o("Unknown Velora claim action.");for(let a of Object.keys(m))if(!["token","kind"].includes(a))throw new o(`Unsupported ${t} argument: ${a}.`);let f=p(m.token);if(k(f))throw new o("Velora fee claims require an ERC-20 token address.");let c=A(m.kind);return{tx:T({to:c==="delta"?N:U,chainId:u,value:"0",data:D({abi:x,functionName:c==="delta"?"withdrawAllFees":"withdrawAllERC20",args:[f,d]}),description:`Claim the full accrued ${c} fee balance of ${f} to ${d} on chain ${u}. Receipt amount can change before mining; no minimum is encoded.`}),inputs:[]}}function Q(t,m,d,f){let{tx:c}=E(m,d,f),a=t[0];if(t.length!==1||!a||a.chainId!==c.chainId||!v(a.to,c.to)||!v(a.data,c.data)||a.value!==c.value)throw new o("Velora claim calldata, recipient, amount or destination differs from the request.")}function X(t){let m=async()=>{let e=t.clientFor(u);if(await e.getChainId()!==u)throw new o("Velora requires an RPC on chain 4663.");return e};async function d(e){if(e===b)return{address:e,symbol:"dETH",decimals:18,chainId:u};let n=await m(),[s,i]=await Promise.all([y(n,u,e,"symbol"),y(n,u,e,"decimals")]);if(typeof s!="string"||!s.trim()||!Number.isInteger(i)||i<0||i>255)throw new o("Velora fee token metadata is unavailable.");return{address:e,symbol:s,decimals:i,chainId:u}}async function f(e,n){let s=A(e.kind),i=p(e.token);if(k(i))throw new o("Velora fee claims require an ERC-20 token address.");let r=await(await m()).readContract({address:s==="delta"?N:U,abi:x,functionName:s==="delta"?"getCollectedFees":"getBalance",args:s==="delta"?[n,i]:[i,n]});if(typeof r!="bigint"||r<0n||r>H)throw new o("Velora fee balance is unavailable.");return r}function c(e,n,s,i){return{name:e,inputSchema:{type:"object",additionalProperties:!1,properties:n,required:s},execute:async(w,r)=>{try{r=p(r);for(let l of Object.keys(w))if(!Object.hasOwn(n,l))throw new o(`Unsupported ${e} argument: ${l}.`);return await i(w,r)}catch(l){throw new o(t.plainError(l))}}}}let a={token:_,kind:P};return[c("velora_fee_balance",a,["token","kind"],async(e,n)=>({kind:A(e.kind),token:await d(p(e.token)),amount:(await f(e,n)).toString()})),c("velora_claim_fees",a,["token","kind"],async(e,n)=>{let{tx:s}=E("velora_claim_fees",e,n),i=await f(e,n);if(i===0n)throw new o("No accrued Velora fees for this wallet and token.");let w=await d(p(e.token)),r=[s],l=await t.preview(r,n);return{txs:r,preview:l,estimatedReceipt:{token:w,amount:i.toString()},summary:`${s.description} ${l.summary}`}}),c("velora_unwrap_deth",{amount:R("Positive amount of wallet-held dETH in base units (18 decimals).")},["amount"],async(e,n)=>{let{tx:s,inputs:i}=E("velora_unwrap_deth",e,n),r=await(await m()).readContract({address:b,abi:O,functionName:"balanceOf",args:[n]});if(typeof r!="bigint"||r<0n||r>H)throw new o("Wallet dETH balance is unavailable.");if(r<BigInt(i[0].amount))throw new o("Insufficient wallet-held dETH. An active native Delta order must first settle, expire or cancel.");let l=[s],g=await t.preview(l,n);if(g.changes.filter(h=>h.token.chainId===u&&k(h.token.address)).reduce((h,F)=>h+BigInt(F.amount),0n)<BigInt(i[0].amount))throw new o("Velora dETH preview does not return the requested native ETH amount.");return{txs:l,preview:g,summary:`${s.description} ${g.summary}`}})]}export{N as a,b,U as c,x as d,E as e,Q as f,X as g};
1
+ import{n as k}from"./5O5ZE3ZV.js";import{a as y}from"./QRDDKA4I.js";import{b as T}from"./6IM6A5VA.js";import{b as R}from"./UWOFA6GV.js";import{c as _,d as I,g as v,i as $,n as V}from"./73N3TOJL.js";import{a as u}from"./G6HCV67X.js";import{a as o}from"./5YS5V2LK.js";import{encodeFunctionData as D,erc20Abi as O,getAddress as C,parseAbi as S}from"viem";var N=C("0x0000000000bbf5c5fd284e657f01bd000933c96d"),b=C("0x0a0d53b6684c7b32b4cbef5fe8483bfcc8406742"),U=C("0x00700052c0608F670705380a4900e0a8080010CC"),x=S(["function getCollectedFees(address partner,address token) view returns (uint256)","function withdrawAllFees(address token,address recipient) returns (uint256 amount)","function getBalance(address token,address partner) view returns (uint256)","function withdrawAllERC20(address token,address recipient) returns (bool)","function withdrawNative(uint256 amount,address owner,address receiver)"]),H=(1n<<256n)-1n,P={type:"string",enum:["market","delta"]};function p(t){return $(t,"Provide a token or wallet address.",I)}function A(t){if(t!=="market"&&t!=="delta")throw new o("Choose market or delta fees.");return t}function B(t){return V(t,"Amount must be positive and within uint256.",{notString:"Amount must be a decimal base-unit string.",positive:!0}).toString()}function E(t,m,d){if(d=p(d),t==="velora_unwrap_deth"){for(let e of Object.keys(m))if(e!=="amount")throw new o(`Unsupported ${t} argument: ${e}.`);let a=B(m.amount);return{tx:T({to:b,chainId:u,value:"0",data:D({abi:x,functionName:"withdrawNative",args:[BigInt(a),d,d]}),description:`Unwrap ${a} dETH base units into the same amount of native ETH for ${d} on chain ${u}.`}),inputs:[{token:b,amount:a}]}}if(t!=="velora_claim_fees")throw new o("Unknown Velora claim action.");for(let a of Object.keys(m))if(!["token","kind"].includes(a))throw new o(`Unsupported ${t} argument: ${a}.`);let f=p(m.token);if(k(f))throw new o("Velora fee claims require an ERC-20 token address.");let c=A(m.kind);return{tx:T({to:c==="delta"?N:U,chainId:u,value:"0",data:D({abi:x,functionName:c==="delta"?"withdrawAllFees":"withdrawAllERC20",args:[f,d]}),description:`Claim the full accrued ${c} fee balance of ${f} to ${d} on chain ${u}. Receipt amount can change before mining; no minimum is encoded.`}),inputs:[]}}function Q(t,m,d,f){let{tx:c}=E(m,d,f),a=t[0];if(t.length!==1||!a||a.chainId!==c.chainId||!v(a.to,c.to)||!v(a.data,c.data)||a.value!==c.value)throw new o("Velora claim calldata, recipient, amount or destination differs from the request.")}function X(t){let m=async()=>{let e=t.clientFor(u);if(await e.getChainId()!==u)throw new o("Velora requires an RPC on chain 4663.");return e};async function d(e){if(e===b)return{address:e,symbol:"dETH",decimals:18,chainId:u};let n=await m(),[s,i]=await Promise.all([y(n,u,e,"symbol"),y(n,u,e,"decimals")]);if(typeof s!="string"||!s.trim()||!Number.isInteger(i)||i<0||i>255)throw new o("Velora fee token metadata is unavailable.");return{address:e,symbol:s,decimals:i,chainId:u}}async function f(e,n){let s=A(e.kind),i=p(e.token);if(k(i))throw new o("Velora fee claims require an ERC-20 token address.");let r=await(await m()).readContract({address:s==="delta"?N:U,abi:x,functionName:s==="delta"?"getCollectedFees":"getBalance",args:s==="delta"?[n,i]:[i,n]});if(typeof r!="bigint"||r<0n||r>H)throw new o("Velora fee balance is unavailable.");return r}function c(e,n,s,i){return{name:e,inputSchema:{type:"object",additionalProperties:!1,properties:n,required:s},execute:async(w,r)=>{try{r=p(r);for(let l of Object.keys(w))if(!Object.hasOwn(n,l))throw new o(`Unsupported ${e} argument: ${l}.`);return await i(w,r)}catch(l){throw new o(t.plainError(l))}}}}let a={token:_,kind:P};return[c("velora_fee_balance",a,["token","kind"],async(e,n)=>({kind:A(e.kind),token:await d(p(e.token)),amount:(await f(e,n)).toString()})),c("velora_claim_fees",a,["token","kind"],async(e,n)=>{let{tx:s}=E("velora_claim_fees",e,n),i=await f(e,n);if(i===0n)throw new o("No accrued Velora fees for this wallet and token.");let w=await d(p(e.token)),r=[s],l=await t.preview(r,n);return{txs:r,preview:l,estimatedReceipt:{token:w,amount:i.toString()},summary:`${s.description} ${l.summary}`}}),c("velora_unwrap_deth",{amount:R("Positive amount of wallet-held dETH in base units (18 decimals).")},["amount"],async(e,n)=>{let{tx:s,inputs:i}=E("velora_unwrap_deth",e,n),r=await(await m()).readContract({address:b,abi:O,functionName:"balanceOf",args:[n]});if(typeof r!="bigint"||r<0n||r>H)throw new o("Wallet dETH balance is unavailable.");if(r<BigInt(i[0].amount))throw new o("Insufficient wallet-held dETH. An active native Delta order must first settle, expire or cancel.");let l=[s],g=await t.preview(l,n);if(g.changes.filter(h=>h.token.chainId===u&&k(h.token.address)).reduce((h,F)=>h+BigInt(F.amount),0n)<BigInt(i[0].amount))throw new o("Velora dETH preview does not return the requested native ETH amount.");return{txs:l,preview:g,summary:`${s.description} ${g.summary}`}})]}export{N as a,b,U as c,x as d,E as e,Q as f,X as g};
@@ -1 +1 @@
1
- import{c as k}from"./MYBDO5SA.js";import{e as h}from"./73N3TOJL.js";import{a as c}from"./XPFVT2EA.js";import{a}from"./5YS5V2LK.js";import{getAddress as A,isAddress as b}from"viem";function f(o){if(typeof o!="string"||!o.trim()||o.length>200)throw new a("Provide nonempty filter text of at most 200 characters.");return o}function x(o,m){if(typeof o!="number"||!Number.isSafeInteger(o)||o<0||o>m)throw new a(`Choose a pagination integer from 0 to ${m}.`);return o}var _={morpho:{assess:"morpho_status",enter:"morpho_supply",exit:"morpho_withdraw"},steakhouse:{assess:"steakhouse_list",enter:"steakhouse_deposit",exit:"steakhouse_withdraw"},spark:{assess:"spark_list",enter:"spark_deposit",exit:"spark_withdraw"},netnet:{assess:"netnet_list",enter:"netnet_deposit",exit:"netnet_withdraw"},longbow:{assess:"longbow_list",enter:"longbow_deposit",exit:"longbow_withdraw"},grove:{assess:"grove_list",enter:"grove_deposit",exit:"grove_withdraw"},beefy:{assess:"beefy_list",enter:"beefy_deposit",exit:"beefy_withdraw"},uniswap:{assess:"uniswap_list_positions",enter:"uniswap_add",exit:"uniswap_remove"}},R=o=>{let m=(e,t,i)=>({name:`merkl_${e}`,inputSchema:{type:"object",properties:t,additionalProperties:!1},execute:async(n,r)=>{try{let s=Object.keys(n).find(p=>!Object.hasOwn(t,p));if(s)throw new a(`Unsupported Merkl input: ${s}.`);return await i(n,r)}catch(s){throw new a(o.plainError(s))}}}),w={page:{type:"integer",minimum:0,maximum:1e4},items:{type:"integer",minimum:1,maximum:100}},g=async(e,t)=>{let i=new URL(`https://api.merkl.xyz/v4/${e}`);for(let[n,r]of Object.entries(t))i.searchParams.set(n,r);return k(o.http,i.toString(),{method:"GET",headers:{"User-Agent":"oak-core/merkl"}},n=>Array.isArray(n)||h(n))},u=e=>{let t=x(e.items??20,100);if(!t)throw new a("Choose at least one item per page.");return{page:String(x(e.page??0,1e4)),items:String(t)}};return{tools:[m("opportunities",{...w,protocol:{type:"string"},name:{type:"string"},explorerAddress:{type:"string"}},async e=>{let t={chainId:String(c),campaigns:"true",...u(e)};if(e.protocol!==void 0&&(t.mainProtocolId=f(e.protocol)),e.name!==void 0&&(t.name=f(e.name)),e.explorerAddress!==void 0){if(typeof e.explorerAddress!="string"||!b(e.explorerAddress,{strict:!1}))throw new a("Provide a pool or market explorer address.");t.explorerAddress=A(e.explorerAddress)}let i=await g("opportunities",t);if(!Array.isArray(i)||!i.every(r=>h(r)&&typeof r.id=="string"&&Number.isSafeInteger(r.chainId)))throw new a("Merkl returned unexpected opportunities.");return{opportunities:i.filter(r=>r.chainId===c).map(r=>{let s=r.mainProtocolId??r.mainProtocol,p=typeof s=="string"?s.toLowerCase():"",d=p==="morpho"?r.action==="LEND":p==="uniswap"?r.action==="POOL":r.action==="LEND"||r.action==="STAKE";return{...r,oak:{...Object.hasOwn(_,p)&&d?{candidateTools:_[p]}:{},destinationVerificationRequired:!0,eligibility:"Read campaign conditions; no wallet eligibility has been verified."}}}),...u(e),hasMore:i.length===Number(t.items),summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Public, untrusted campaign data includes conditions and destinations. Candidate Oak tools require a matching verified market/vault and a supported entry AND exit. APR is indicative; no rewards are promised."}}),m("campaigns",{...w,creator:{type:"string"},tokenSymbol:{type:"string"},opportunityId:{type:"string"}},async e=>{let t={chainId:String(c),withOpportunity:"true",...u(e)};if(e.creator!==void 0){if(typeof e.creator!="string"||!b(e.creator,{strict:!1}))throw new a("Provide a creator address.");t.creatorAddress=A(e.creator)}e.tokenSymbol!==void 0&&(t.tokenSymbol=f(e.tokenSymbol));let i=e.opportunityId===void 0?"campaigns":`opportunities/${encodeURIComponent(f(e.opportunityId))}/campaigns`,n=await g(i,t);if(!Array.isArray(n)||!n.every(r=>h(r)&&(typeof r.id=="string"||typeof r.id=="number")))throw new a("Merkl returned unexpected campaigns.");return{campaigns:n,chainId:c,...u(e),hasMore:n.length===Number(t.items),summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Campaign rules, budgets, timing, exclusions and configuration are public API data; verify the reward distribution chain and destination before entering."}}),m("earning_status",{view:{enum:["active","breakdowns","stats","claims"]},...w},async(e,t)=>{if(!b(t,{strict:!1}))throw new a("Provide a valid connected wallet address.");let i=e.view??"active";if(!["active","breakdowns","stats","claims"].includes(String(i)))throw new a("Choose active, breakdowns, stats or claims.");let n=i==="claims"?"claims":i==="breakdowns"?`users/${t}/rewards/chains/${c}/breakdowns`:`users/${t}/rewards/${i==="active"?"active-opportunities":"stats"}`,{page:r,items:s}=u(e),p=i==="breakdowns"?{}:{chainId:String(c)};i==="claims"&&(p.recipient=t);let d=await g(n,p),l=Number(r)*Number(s),y=Array.isArray(d)?d:i==="breakdowns"&&h(d)&&Array.isArray(d.opportunities)?d.opportunities:void 0,v=y?Array.isArray(d)?y.slice(l,l+Number(s)):{...d,opportunities:y.slice(l,l+Number(s))}:d;return{view:i,chainId:c,wallet:t,data:v,...y?{page:r,items:s,hasMore:l+Number(s)<y.length}:{},summary:"Powered by Merkl \u2014 https://app.merkl.xyz. API earning attribution and history can lag onchain state; pending earnings are not claimable. Private or restricted attribution may be omitted by Merkl. Recheck merkl_rewards before a claim."}})]}};export{R as a};
1
+ import{c as k}from"./MYBDO5SA.js";import{e as h}from"./73N3TOJL.js";import{a as c}from"./G6HCV67X.js";import{a}from"./5YS5V2LK.js";import{getAddress as A,isAddress as b}from"viem";function f(o){if(typeof o!="string"||!o.trim()||o.length>200)throw new a("Provide nonempty filter text of at most 200 characters.");return o}function x(o,m){if(typeof o!="number"||!Number.isSafeInteger(o)||o<0||o>m)throw new a(`Choose a pagination integer from 0 to ${m}.`);return o}var _={morpho:{assess:"morpho_status",enter:"morpho_supply",exit:"morpho_withdraw"},steakhouse:{assess:"steakhouse_list",enter:"steakhouse_deposit",exit:"steakhouse_withdraw"},spark:{assess:"spark_list",enter:"spark_deposit",exit:"spark_withdraw"},netnet:{assess:"netnet_list",enter:"netnet_deposit",exit:"netnet_withdraw"},longbow:{assess:"longbow_list",enter:"longbow_deposit",exit:"longbow_withdraw"},grove:{assess:"grove_list",enter:"grove_deposit",exit:"grove_withdraw"},beefy:{assess:"beefy_list",enter:"beefy_deposit",exit:"beefy_withdraw"},uniswap:{assess:"uniswap_list_positions",enter:"uniswap_add",exit:"uniswap_remove"}},R=o=>{let m=(e,t,i)=>({name:`merkl_${e}`,inputSchema:{type:"object",properties:t,additionalProperties:!1},execute:async(n,r)=>{try{let s=Object.keys(n).find(p=>!Object.hasOwn(t,p));if(s)throw new a(`Unsupported Merkl input: ${s}.`);return await i(n,r)}catch(s){throw new a(o.plainError(s))}}}),w={page:{type:"integer",minimum:0,maximum:1e4},items:{type:"integer",minimum:1,maximum:100}},g=async(e,t)=>{let i=new URL(`https://api.merkl.xyz/v4/${e}`);for(let[n,r]of Object.entries(t))i.searchParams.set(n,r);return k(o.http,i.toString(),{method:"GET",headers:{"User-Agent":"oak-core/merkl"}},n=>Array.isArray(n)||h(n))},u=e=>{let t=x(e.items??20,100);if(!t)throw new a("Choose at least one item per page.");return{page:String(x(e.page??0,1e4)),items:String(t)}};return{tools:[m("opportunities",{...w,protocol:{type:"string"},name:{type:"string"},explorerAddress:{type:"string"}},async e=>{let t={chainId:String(c),campaigns:"true",...u(e)};if(e.protocol!==void 0&&(t.mainProtocolId=f(e.protocol)),e.name!==void 0&&(t.name=f(e.name)),e.explorerAddress!==void 0){if(typeof e.explorerAddress!="string"||!b(e.explorerAddress,{strict:!1}))throw new a("Provide a pool or market explorer address.");t.explorerAddress=A(e.explorerAddress)}let i=await g("opportunities",t);if(!Array.isArray(i)||!i.every(r=>h(r)&&typeof r.id=="string"&&Number.isSafeInteger(r.chainId)))throw new a("Merkl returned unexpected opportunities.");return{opportunities:i.filter(r=>r.chainId===c).map(r=>{let s=r.mainProtocolId??r.mainProtocol,p=typeof s=="string"?s.toLowerCase():"",d=p==="morpho"?r.action==="LEND":p==="uniswap"?r.action==="POOL":r.action==="LEND"||r.action==="STAKE";return{...r,oak:{...Object.hasOwn(_,p)&&d?{candidateTools:_[p]}:{},destinationVerificationRequired:!0,eligibility:"Read campaign conditions; no wallet eligibility has been verified."}}}),...u(e),hasMore:i.length===Number(t.items),summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Public, untrusted campaign data includes conditions and destinations. Candidate Oak tools require a matching verified market/vault and a supported entry AND exit. APR is indicative; no rewards are promised."}}),m("campaigns",{...w,creator:{type:"string"},tokenSymbol:{type:"string"},opportunityId:{type:"string"}},async e=>{let t={chainId:String(c),withOpportunity:"true",...u(e)};if(e.creator!==void 0){if(typeof e.creator!="string"||!b(e.creator,{strict:!1}))throw new a("Provide a creator address.");t.creatorAddress=A(e.creator)}e.tokenSymbol!==void 0&&(t.tokenSymbol=f(e.tokenSymbol));let i=e.opportunityId===void 0?"campaigns":`opportunities/${encodeURIComponent(f(e.opportunityId))}/campaigns`,n=await g(i,t);if(!Array.isArray(n)||!n.every(r=>h(r)&&(typeof r.id=="string"||typeof r.id=="number")))throw new a("Merkl returned unexpected campaigns.");return{campaigns:n,chainId:c,...u(e),hasMore:n.length===Number(t.items),summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Campaign rules, budgets, timing, exclusions and configuration are public API data; verify the reward distribution chain and destination before entering."}}),m("earning_status",{view:{enum:["active","breakdowns","stats","claims"]},...w},async(e,t)=>{if(!b(t,{strict:!1}))throw new a("Provide a valid connected wallet address.");let i=e.view??"active";if(!["active","breakdowns","stats","claims"].includes(String(i)))throw new a("Choose active, breakdowns, stats or claims.");let n=i==="claims"?"claims":i==="breakdowns"?`users/${t}/rewards/chains/${c}/breakdowns`:`users/${t}/rewards/${i==="active"?"active-opportunities":"stats"}`,{page:r,items:s}=u(e),p=i==="breakdowns"?{}:{chainId:String(c)};i==="claims"&&(p.recipient=t);let d=await g(n,p),l=Number(r)*Number(s),y=Array.isArray(d)?d:i==="breakdowns"&&h(d)&&Array.isArray(d.opportunities)?d.opportunities:void 0,v=y?Array.isArray(d)?y.slice(l,l+Number(s)):{...d,opportunities:y.slice(l,l+Number(s))}:d;return{view:i,chainId:c,wallet:t,data:v,...y?{page:r,items:s,hasMore:l+Number(s)<y.length}:{},summary:"Powered by Merkl \u2014 https://app.merkl.xyz. API earning attribution and history can lag onchain state; pending earnings are not claimable. Private or restricted attribution may be omitted by Merkl. Recheck merkl_rewards before a claim."}})]}};export{R as a};
@@ -1 +1 @@
1
- import{a as ie,b as le,c as ce,d as Z}from"./AFHHRDPJ.js";import{a as E,b as Y}from"./D6VP3N27.js";import{c as ae}from"./MYBDO5SA.js";import{a as X}from"./UWOFA6GV.js";import{b as B,c as C,d as se,e as h,g as v,i as oe}from"./73N3TOJL.js";import{a as w,i as ne,l as F,n as re}from"./XPFVT2EA.js";import{a as T}from"./5YS5V2LK.js";import{a as I}from"./JXOEJPJ4.js";import{erc20Abi as M,getAddress as f,parseAbi as L,zeroAddress as ee}from"viem";var x="https://ponsfamily.com/api",de="https://balancesapi.ponsfamily.com/v1",Q=L(["function sellableTokens() view returns (uint256)","function reservedTokens() view returns (uint256)","function readyToGraduate() view returns (bool)","function graduated() view returns (bool)","function currentSnipeTaxBps(address) view returns (uint256)"]),be=L(["event CurveBuy(address indexed buyer, address indexed recipient, uint256 quoteIn, uint256 tokensOut, uint256 fee, uint256 tax)","event CurveSell(address indexed seller, address indexed recipient, uint256 tokensIn, uint256 quoteOut, uint256 fee, uint256 tax)"]),ye=L(["function pendingCreatorFeeRecipient(address) view returns (address,uint256,uint256)"]),he=L(["function getTokenInfo() view returns (address,string,string,(string,string,string,string,string))"]),ue=L(["function totalLocked(address) view returns (uint256)","function totalReleased(address) view returns (uint256)","function vestedAmount(address) view returns (uint256)","function releasable(address) view returns (uint256)","function vestingStart(address) view returns (uint256)","function VESTING_DURATION() view returns (uint256)"]),ge=10000n,me=2000n,ke=/^[0-9]{1,78}$/,m=e=>typeof e=="number"&&Number.isFinite(e)?e:null,$=(e,t=80)=>typeof e=="string"?I(e.slice(0,t)):null;function P(e,t="address"){return oe(e,`Provide a ${t}.`,se)}function j(e,t,o){let s=e??t;if(typeof s!="number"||!Number.isInteger(s)||s<1||s>o)throw new T(`Choose a limit from 1 to ${o}.`);return s}function O(e,t=0){return e===null||typeof e=="boolean"?e:typeof e=="number"?Number.isFinite(e)?e:null:typeof e=="string"?I(e.slice(0,80)):t>=3?null:Array.isArray(e)?{total:e.length,items:e.slice(0,10).map(o=>O(o,t+1))}:h(e)?Object.fromEntries(Object.entries(e).filter(([o])=>/^[A-Za-z0-9_]{1,40}$/.test(o)).slice(0,40).map(([o,s])=>[o,O(s,t+1)])):null}async function U(e,t,o){return ae(e.http,t,{method:"GET",redirect:"error",headers:{accept:"application/json"}},o)}async function J(e,t,o){let s=e.clientFor(w),[c,a]=await Promise.all([s.readContract({address:t,abi:M,functionName:"symbol",blockNumber:o}),s.readContract({address:t,abi:M,functionName:"decimals",blockNumber:o})]);return{address:t,chainId:w,symbol:I(c),decimals:a}}async function we(e,t){let o=P(t.token,"Pons launch token address"),s=t.holder===void 0?void 0:P(t.holder,"holder address"),c=j(t.limit,20,50),{offset:a,fingerprint:l}=ce(t.cursor),r=e.clientFor(w),p=await r.getBlockNumber({cacheTime:0}),g=await E(e,o,p),i=await le(e,o),n=await r.getBlockNumber({cacheTime:0});if(l&&l!==i.fingerprint)throw new T("The Pons holder index changed. Retry pons_holders without a cursor.");let u=i.body,k=[{wallet:ee,reason:"burn (zero address)"},{wallet:f("0x000000000000000000000000000000000000dead"),reason:"burn (dead address)"},{wallet:f(g.curve),reason:"Pons bonding curve"},{wallet:f(re),reason:"Uniswap v4 pool manager (shared pool custody)"}],N=new Map(k.map(d=>[d.wallet,d.reason])),R=i.rows.filter(d=>!N.has(f(d.wallet))),[G,q]=await Promise.all([J(e,o,n),r.readContract({address:o,abi:M,functionName:"totalSupply",blockNumber:n})]),W=d=>1+R.filter(b=>BigInt(b.balance)>BigInt(d)).length,_=async(d,b)=>{let D=await r.readContract({address:o,abi:M,functionName:"balanceOf",args:[d],blockNumber:n});return{wallet:d,indexedBalance:b,indexedRank:b===null||N.has(d)?null:W(b),indexedShareOfSupply:b===null?null:Z(b,u.supply),shareOfSupply:Z(D.toString(),q.toString()),balance:{token:G,amount:D.toString()},matchesIndex:b===null?null:D.toString()===b}},A=await Promise.all(R.slice(a,a+c).map(async d=>({...await _(f(d.wallet),d.balance),share:m(d.share),label:$(d.label,40)}))),V=s?i.rows.find(d=>v(d.wallet,s)):void 0,H=s?{...await _(s,V?.balance??null),excluded:N.get(s)??null,rankStatus:N.has(s)?"excluded":V?"ranked by indexed balance":"absent from index; rank unknown"}:void 0;return{token:G,statusBlock:n.toString(),totalSupply:q.toString(),holderCount:R.length,indexHolderCount:u.holders,indexSupply:u.supply,burned:u.burned,circulating:u.circulating,page:A,nextCursor:a+c<R.length?`holders_${a+c}_${i.fingerprint}`:null,...H?{wallet:H}:{},exclusions:k.map(d=>({...d,indexedBalance:i.rows.find(b=>v(b.wallet,d.wallet))?.balance??"0",countedInIndex:i.rows.some(b=>v(b.wallet,d.wallet))})),indexAsOf:{rollupBucket:u.as_of.rollup_bucket,tailFromBlock:u.as_of.tail_from_block},indexFetchedAt:i.fetchedAt,source:`${ie}/tokens/{token}/holders`,sources:{holderCount:"Pons balances index, excluding the labelled system addresses",rank:"Pons balances index, descending balance; equal balances share a rank, system addresses excluded",indexedShareOfSupply:"Pons indexed balance / indexed total supply",balance:`on-chain balanceOf at block ${n}`,totalSupply:`on-chain totalSupply at block ${n}`,shareOfSupply:`on-chain balanceOf / totalSupply at block ${n}`,burned:"Pons balances index",circulating:"Pons balances index"},note:"Counts, ranking, burned and circulating supply come from Pons\u2019s balances index, not on-chain truth. The API does not pin pages to a block; its rollup/tail markers are not an exact snapshot block. Each listed balance was re-read on chain at statusBlock. matchesIndex false indicates disagreement, not proof of which source is wrong. A wallet absent from the index has unknown rank even if its on-chain balance is positive. Labels are untrusted."}}var ve=e=>h(e)&&Array.isArray(e.items)&&e.items.length<=500&&e.items.every(t=>h(t)&&typeof t.token=="string"&&B.test(t.token)&&typeof t.amountTokens=="number");async function xe(e,t,o){let s=P(t.holder??o,"holder address"),c=j(t.limit,20,40),a=e.clientFor(w),l=await U(e,`${x}/profile/${s.toLowerCase()}?view=positions`,ve),r=await a.getBlockNumber({cacheTime:0}),p=[...new Map(l.items.filter(n=>n.amountTokens>0||n.state==="open").map(n=>[n.token.toLowerCase(),n])).values()],g=await Promise.all(p.slice(0,c).map(async n=>{let u=f(n.token);try{await E(e,u,r);let[k,N]=await Promise.all([J(e,u,r),a.readContract({address:u,abi:M,functionName:"balanceOf",args:[s],blockNumber:r})]);return{ok:!0,token:u,meta:k,balance:N,item:n}}catch{return{ok:!1}}})),i=g.filter(n=>n.ok);return{holder:s,statusBlock:r.toString(),source:`${x}/profile/{holder}?view=positions`,holdings:i.map(n=>({token:n.meta,balance:{token:n.meta,amount:n.balance.toString()},index:{state:$(n.item.state,20),valueUsd:m(n.item.valueUsd),investedUsd:m(n.item.investedUsd),totalPnlUsd:m(n.item.totalPnlUsd),totalPnlPct:m(n.item.totalPnlPct),buys:m(n.item.buys),sells:m(n.item.sells),lastTradeAt:m(n.item.lastTradeAt)}})),excludedUnverified:g.length-i.length,truncated:p.length>c,note:"Discovery through Pons\u2019s positions index; every launch was re-read from the pinned factory and every balance is an on-chain read. USD value and profit and loss are index estimates, not execution quotes. Sell the on-chain balance with pons_sell."}}var Ae=e=>h(e)&&Array.isArray(e.items)&&e.items.length<=100&&e.items.every(t=>h(t)&&h(t.launch)&&typeof t.launch.address=="string"&&B.test(t.launch.address)&&typeof t.launch.factory=="string"&&B.test(t.launch.factory));async function Se(e,t){let o=j(t.limit,10,20),s=await U(e,`${x}/launches/trending`,Ae),c=s.items.filter(r=>v(r.launch.factory,F)).slice(0,o),a=await e.clientFor(w).getBlockNumber({cacheTime:0});return{items:await Promise.all(c.map(async r=>({status:await Y(e,f(r.launch.address),a),index:{volumeUsd:m(r.volumeUsd),trades:m(r.trades),traders:m(r.traders),change:m(r.change)}}))),statusBlock:a.toString(),source:`${x}/launches/trending`,excludedOtherFactories:s.items.length-s.items.filter(r=>v(r.launch.factory,F)).length,note:"Ranking is Pons\u2019s own trending list (discovery only); each launch was re-read on chain from the pinned factory."}}var z={overview:"analytics",burn:"analytics/burn",buyback:"analytics/buyback"};async function Te(e,t){let o=t.view??"overview";if(typeof o!="string"||!Object.hasOwn(z,o))throw new T("Choose view overview, burn or buyback.");let s=await U(e,`${x}/${z[o]}`,h);if(o==="overview"){let c=Array.isArray(s.series)?s.series:[];return{view:o,source:`${x}/analytics`,generatedAt:m(s.generatedAt),latestDay:m(s.latestDay),latest:O(c.at(-1)),seriesDays:c.length,today:O(s.today),earnings:O(s.earnings),indexer:O(s.indexer),note:"Protocol-wide figures from Pons\u2019s analytics index; unaudited aggregates, not a quote."}}return{view:o,source:`${x}/${z[o]}`,data:O(s),note:"Protocol-wide figures from Pons\u2019s analytics index; unaudited aggregates, not a quote."}}var Ce=e=>h(e)&&typeof e.wallet=="string"&&Array.isArray(e.items)&&e.items.length<=100&&e.items.every(t=>h(t)&&typeof t.kind=="string")&&(e.next===null||e.next===void 0||typeof e.next=="string");async function Pe(e,t,o){let s=P(t.wallet??o,"wallet address"),c=`${de}/wallets/${s.toLowerCase()}/activity`;if(t.cursor!==void 0){if(typeof t.cursor!="string"||!/^[0-9]{1,12}-[0-9]{1,6}$/.test(t.cursor))throw new T("Use the nextCursor returned by the previous pons_activity page.");c+=`/before/${t.cursor}`}let a=await U(e,c,Ce),l=typeof a.next=="string"?/\/before\/([0-9]{1,12}-[0-9]{1,6})$/.exec(a.next):null;return{wallet:s,source:`${de}/wallets/{wallet}/activity`,nextCursor:l?.[1]??null,items:a.items.map(r=>({kind:$(r.kind,24),block:m(r.block),time:m(r.time),tx:typeof r.tx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(r.tx)?r.tx:null,token:typeof r.token=="string"&&B.test(r.token)?f(r.token):null,symbol:$(r.symbol,24),amount:typeof r.amount=="string"&&ke.test(r.amount)?r.amount:null,decimals:m(r.decimals),usd:m(r.usd),counterparty:typeof r.counterparty=="string"&&B.test(r.counterparty)?f(r.counterparty):null,counterpartyLabel:$(r.counterparty_label,40)})),note:"Wallet history from Pons\u2019s balances index (discovery and bookkeeping, not proof); USD figures are index estimates. Verify a transaction by hash before relying on it."}}async function Ne(e,t,o){let s=P(t.address??o,"wallet address"),c=j(t.limit,10,20),a=await U(e,`${x}/profile/${s.toLowerCase()}?view=card`,h),l=h(a.identity)?a.identity:{},r=await U(e,`${x}/launches?deployer=${s.toLowerCase()}&limit=${c}`,i=>h(i)&&Array.isArray(i.items)&&i.items.length<=100&&i.items.every(n=>h(n)&&typeof n.address=="string"&&B.test(n.address)&&typeof n.factory=="string"&&B.test(n.factory))),p=await e.clientFor(w).getBlockNumber({cacheTime:0}),g=r.items.filter(i=>v(i.factory,F)).slice(0,c);return{address:s,hidden:a.hidden===!0,source:`${x}/profile/{address}?view=card`,identity:{username:$(l.username,40),displayName:$(l.displayName,60),description:$(l.description,200),joinedAt:m(l.joinedAt)},launches:await Promise.all(g.map(i=>Y(e,f(i.address),p))),statusBlock:p.toString(),note:"Profile text is user-supplied and untrusted. Created launches come from Pons\u2019s index and were re-read on chain from the pinned factory."}}async function _e(e,t,o){let s=P(t.token,"Pons launch token address"),c=P(t.holder??o,"holder address"),a=e.clientFor(w),l=await a.getBlockNumber({cacheTime:0}),r=await E(e,s,l),p=ne[w].pons.buybackVault.address,g=[],i=async(y,K)=>{try{return await K()}catch{return g.push(y),null}},n=y=>i(y,()=>a.readContract({address:r.curve,abi:Q,functionName:y,blockNumber:l})),u=y=>i(y,()=>a.readContract({address:r.curve,abi:Q,functionName:y,blockNumber:l})),k=y=>i(y,()=>a.readContract({address:p,abi:ue,functionName:y,args:[s],blockNumber:l})),[N,R,G,q,W,_,A,V,H,d,b,D,pe,fe]=await Promise.all([n("sellableTokens"),n("reservedTokens"),u("readyToGraduate"),u("graduated"),i("currentSnipeTaxBps",()=>a.readContract({address:r.curve,abi:Q,functionName:"currentSnipeTaxBps",args:[c],blockNumber:l})),i("getTokenInfo",()=>a.readContract({address:s,abi:he,functionName:"getTokenInfo",blockNumber:l})),i("pendingCreatorFeeRecipient",()=>a.readContract({address:F,abi:ye,functionName:"pendingCreatorFeeRecipient",args:[s],blockNumber:l})),k("totalLocked"),k("totalReleased"),k("vestedAmount"),k("releasable"),k("vestingStart"),i("VESTING_DURATION",()=>a.readContract({address:p,abi:ue,functionName:"VESTING_DURATION",blockNumber:l})),J(e,s,l)]),S=y=>y===null?null:y.toString(),te=A&&!v(A[0],ee)&&A[1]>0n?{proposedRecipient:f(A[0]),effectiveAt:A[1].toString(),expiresAt:A[2].toString(),note:"A protocol-proposed creator fee recipient change. Holders may react before it takes effect; anyone can execute it after the timelock, within the window."}:A?null:void 0;return{token:fe,phase:r.phase,statusBlock:l.toString(),curve:r.curve,creatorFeeRecipient:r.creatorFeeRecipient,curveCapacity:{sellableTokens:S(N),reservedTokens:S(R),readyToGraduate:G,graduated:q},snipeTaxBps:{recipient:c,current:S(W),note:"Keyed to the wallet that receives the tokens; buys only, large in the opening seconds."},creatorMetadata:_?{deployer:f(_[0]),logo:I(_[1].slice(0,300)),description:I(_[2].slice(0,500)),socials:Object.fromEntries(["twitter","telegram","discord","website","farcaster"].map((y,K)=>[y,I(_[3][K].slice(0,300))]))}:null,pendingTakeover:te===void 0?"unavailable":te,buybackVest:{vault:p,enabled:r.buybackEnabled,locked:S(V),released:S(H),vested:S(d),releasable:S(b),vestingStart:S(D),vestingDurationSeconds:S(pe),note:"Amounts are launch-token base units; releasing is for the vest beneficiaries only (see pons_claim)."},unavailable:g}}async function Be(e,t){let o=P(t.token,"Pons launch token address"),s=j(t.limit,25,100),c=e.clientFor(w),a=await c.getBlockNumber({cacheTime:0}),l=await E(e,o,a),r=t.toBlock===void 0?a:BigInt(String(t.toBlock)),p=t.fromBlock===void 0?r>=me?r-me+1n:0n:BigInt(String(t.fromBlock));if(p<0n||p>r||r>a||r-p+1n>ge)throw new T("Choose an ordered range of at most 10000 mined blocks.");let i=(await c.getLogs({address:l.curve,events:be,fromBlock:p,toBlock:r,strict:!0})).filter(n=>v(n.address,l.curve)&&!n.removed&&n.blockNumber!==null).sort((n,u)=>n.blockNumber===u.blockNumber?(u.logIndex??0)-(n.logIndex??0):n.blockNumber>u.blockNumber?-1:1);return{token:await J(e,o,a),curve:l.curve,fromBlock:p.toString(),toBlock:r.toString(),statusBlock:a.toString(),truncated:i.length>s,total:i.length,trades:i.slice(0,s).map(n=>n.eventName==="CurveBuy"?{side:"buy",block:n.blockNumber.toString(),tx:n.transactionHash,trader:f(n.args.buyer),recipient:f(n.args.recipient),pairIn:n.args.quoteIn.toString(),tokensOut:n.args.tokensOut.toString(),fee:n.args.fee.toString(),creatorTax:n.args.tax.toString()}:{side:"sell",block:n.blockNumber.toString(),tx:n.transactionHash,trader:f(n.args.seller),recipient:f(n.args.recipient),tokensIn:n.args.tokensIn.toString(),pairOut:n.args.quoteOut.toString(),fee:n.args.fee.toString(),creatorTax:n.args.tax.toString()}),coverage:"Curve-phase trades in the requested block window only. Graduated-pool swaps are Uniswap v4 events and are not listed here; pons_activity and pons_status cover a wallet and the pool price."}}var Le=e=>{function t(o,s,c){return{name:o,inputSchema:{type:"object",properties:s,required:["pons_holders","pons_launch_info","pons_trades"].includes(o)?["token"]:[],additionalProperties:!1},execute:async(a,l)=>{try{if(!P(l)||v(l,ee))throw new T("Provide a wallet address.");for(let r of Object.keys(a))if(!(r in s))throw new T(`Unknown ${o} input: ${r}.`);return await c(a,l)}catch(r){throw new T(e.plainError(r))}}}}return{tools:[t("pons_holders",{token:C,holder:{...C,description:"Optional wallet for an on-chain balance and indexed rank after system exclusions."},limit:{type:"integer",minimum:1,maximum:50},cursor:{type:"string",maxLength:128,description:"Filtered-directory nextCursor from pons_holders; restart if the index changes."}},o=>we(e,o)),t("pons_holdings",{holder:C,limit:{type:"integer",minimum:1,maximum:40}},(o,s)=>xe(e,o,s)),t("pons_trending",{limit:{type:"integer",minimum:1,maximum:20}},o=>Se(e,o)),t("pons_analytics",{view:{type:"string",enum:Object.keys(z)}},o=>Te(e,o)),t("pons_activity",{wallet:C,cursor:{type:"string",maxLength:32}},(o,s)=>Pe(e,o,s)),t("pons_launch_info",{token:C,holder:C},(o,s)=>_e(e,o,s)),t("pons_trades",{token:C,fromBlock:X(),toBlock:X(),limit:{type:"integer",minimum:1,maximum:100}},o=>Be(e,o)),t("pons_profile",{address:C,limit:{type:"integer",minimum:1,maximum:20}},(o,s)=>Ne(e,o,s))]}};export{O as a,Le as b};
1
+ import{a as ie,b as le,c as ce,d as Z}from"./AFHHRDPJ.js";import{a as E,b as Y}from"./NSOEDRBU.js";import{c as ae}from"./MYBDO5SA.js";import{a as X}from"./UWOFA6GV.js";import{b as B,c as C,d as se,e as h,g as v,i as oe}from"./73N3TOJL.js";import{a as w,i as ne,l as F,n as re}from"./G6HCV67X.js";import{a as T}from"./5YS5V2LK.js";import{a as I}from"./JXOEJPJ4.js";import{erc20Abi as M,getAddress as f,parseAbi as L,zeroAddress as ee}from"viem";var x="https://ponsfamily.com/api",de="https://balancesapi.ponsfamily.com/v1",Q=L(["function sellableTokens() view returns (uint256)","function reservedTokens() view returns (uint256)","function readyToGraduate() view returns (bool)","function graduated() view returns (bool)","function currentSnipeTaxBps(address) view returns (uint256)"]),be=L(["event CurveBuy(address indexed buyer, address indexed recipient, uint256 quoteIn, uint256 tokensOut, uint256 fee, uint256 tax)","event CurveSell(address indexed seller, address indexed recipient, uint256 tokensIn, uint256 quoteOut, uint256 fee, uint256 tax)"]),ye=L(["function pendingCreatorFeeRecipient(address) view returns (address,uint256,uint256)"]),he=L(["function getTokenInfo() view returns (address,string,string,(string,string,string,string,string))"]),ue=L(["function totalLocked(address) view returns (uint256)","function totalReleased(address) view returns (uint256)","function vestedAmount(address) view returns (uint256)","function releasable(address) view returns (uint256)","function vestingStart(address) view returns (uint256)","function VESTING_DURATION() view returns (uint256)"]),ge=10000n,me=2000n,ke=/^[0-9]{1,78}$/,m=e=>typeof e=="number"&&Number.isFinite(e)?e:null,$=(e,t=80)=>typeof e=="string"?I(e.slice(0,t)):null;function P(e,t="address"){return oe(e,`Provide a ${t}.`,se)}function j(e,t,o){let s=e??t;if(typeof s!="number"||!Number.isInteger(s)||s<1||s>o)throw new T(`Choose a limit from 1 to ${o}.`);return s}function O(e,t=0){return e===null||typeof e=="boolean"?e:typeof e=="number"?Number.isFinite(e)?e:null:typeof e=="string"?I(e.slice(0,80)):t>=3?null:Array.isArray(e)?{total:e.length,items:e.slice(0,10).map(o=>O(o,t+1))}:h(e)?Object.fromEntries(Object.entries(e).filter(([o])=>/^[A-Za-z0-9_]{1,40}$/.test(o)).slice(0,40).map(([o,s])=>[o,O(s,t+1)])):null}async function U(e,t,o){return ae(e.http,t,{method:"GET",redirect:"error",headers:{accept:"application/json"}},o)}async function J(e,t,o){let s=e.clientFor(w),[c,a]=await Promise.all([s.readContract({address:t,abi:M,functionName:"symbol",blockNumber:o}),s.readContract({address:t,abi:M,functionName:"decimals",blockNumber:o})]);return{address:t,chainId:w,symbol:I(c),decimals:a}}async function we(e,t){let o=P(t.token,"Pons launch token address"),s=t.holder===void 0?void 0:P(t.holder,"holder address"),c=j(t.limit,20,50),{offset:a,fingerprint:l}=ce(t.cursor),r=e.clientFor(w),p=await r.getBlockNumber({cacheTime:0}),g=await E(e,o,p),i=await le(e,o),n=await r.getBlockNumber({cacheTime:0});if(l&&l!==i.fingerprint)throw new T("The Pons holder index changed. Retry pons_holders without a cursor.");let u=i.body,k=[{wallet:ee,reason:"burn (zero address)"},{wallet:f("0x000000000000000000000000000000000000dead"),reason:"burn (dead address)"},{wallet:f(g.curve),reason:"Pons bonding curve"},{wallet:f(re),reason:"Uniswap v4 pool manager (shared pool custody)"}],N=new Map(k.map(d=>[d.wallet,d.reason])),R=i.rows.filter(d=>!N.has(f(d.wallet))),[G,q]=await Promise.all([J(e,o,n),r.readContract({address:o,abi:M,functionName:"totalSupply",blockNumber:n})]),W=d=>1+R.filter(b=>BigInt(b.balance)>BigInt(d)).length,_=async(d,b)=>{let D=await r.readContract({address:o,abi:M,functionName:"balanceOf",args:[d],blockNumber:n});return{wallet:d,indexedBalance:b,indexedRank:b===null||N.has(d)?null:W(b),indexedShareOfSupply:b===null?null:Z(b,u.supply),shareOfSupply:Z(D.toString(),q.toString()),balance:{token:G,amount:D.toString()},matchesIndex:b===null?null:D.toString()===b}},A=await Promise.all(R.slice(a,a+c).map(async d=>({...await _(f(d.wallet),d.balance),share:m(d.share),label:$(d.label,40)}))),V=s?i.rows.find(d=>v(d.wallet,s)):void 0,H=s?{...await _(s,V?.balance??null),excluded:N.get(s)??null,rankStatus:N.has(s)?"excluded":V?"ranked by indexed balance":"absent from index; rank unknown"}:void 0;return{token:G,statusBlock:n.toString(),totalSupply:q.toString(),holderCount:R.length,indexHolderCount:u.holders,indexSupply:u.supply,burned:u.burned,circulating:u.circulating,page:A,nextCursor:a+c<R.length?`holders_${a+c}_${i.fingerprint}`:null,...H?{wallet:H}:{},exclusions:k.map(d=>({...d,indexedBalance:i.rows.find(b=>v(b.wallet,d.wallet))?.balance??"0",countedInIndex:i.rows.some(b=>v(b.wallet,d.wallet))})),indexAsOf:{rollupBucket:u.as_of.rollup_bucket,tailFromBlock:u.as_of.tail_from_block},indexFetchedAt:i.fetchedAt,source:`${ie}/tokens/{token}/holders`,sources:{holderCount:"Pons balances index, excluding the labelled system addresses",rank:"Pons balances index, descending balance; equal balances share a rank, system addresses excluded",indexedShareOfSupply:"Pons indexed balance / indexed total supply",balance:`on-chain balanceOf at block ${n}`,totalSupply:`on-chain totalSupply at block ${n}`,shareOfSupply:`on-chain balanceOf / totalSupply at block ${n}`,burned:"Pons balances index",circulating:"Pons balances index"},note:"Counts, ranking, burned and circulating supply come from Pons\u2019s balances index, not on-chain truth. The API does not pin pages to a block; its rollup/tail markers are not an exact snapshot block. Each listed balance was re-read on chain at statusBlock. matchesIndex false indicates disagreement, not proof of which source is wrong. A wallet absent from the index has unknown rank even if its on-chain balance is positive. Labels are untrusted."}}var ve=e=>h(e)&&Array.isArray(e.items)&&e.items.length<=500&&e.items.every(t=>h(t)&&typeof t.token=="string"&&B.test(t.token)&&typeof t.amountTokens=="number");async function xe(e,t,o){let s=P(t.holder??o,"holder address"),c=j(t.limit,20,40),a=e.clientFor(w),l=await U(e,`${x}/profile/${s.toLowerCase()}?view=positions`,ve),r=await a.getBlockNumber({cacheTime:0}),p=[...new Map(l.items.filter(n=>n.amountTokens>0||n.state==="open").map(n=>[n.token.toLowerCase(),n])).values()],g=await Promise.all(p.slice(0,c).map(async n=>{let u=f(n.token);try{await E(e,u,r);let[k,N]=await Promise.all([J(e,u,r),a.readContract({address:u,abi:M,functionName:"balanceOf",args:[s],blockNumber:r})]);return{ok:!0,token:u,meta:k,balance:N,item:n}}catch{return{ok:!1}}})),i=g.filter(n=>n.ok);return{holder:s,statusBlock:r.toString(),source:`${x}/profile/{holder}?view=positions`,holdings:i.map(n=>({token:n.meta,balance:{token:n.meta,amount:n.balance.toString()},index:{state:$(n.item.state,20),valueUsd:m(n.item.valueUsd),investedUsd:m(n.item.investedUsd),totalPnlUsd:m(n.item.totalPnlUsd),totalPnlPct:m(n.item.totalPnlPct),buys:m(n.item.buys),sells:m(n.item.sells),lastTradeAt:m(n.item.lastTradeAt)}})),excludedUnverified:g.length-i.length,truncated:p.length>c,note:"Discovery through Pons\u2019s positions index; every launch was re-read from the pinned factory and every balance is an on-chain read. USD value and profit and loss are index estimates, not execution quotes. Sell the on-chain balance with pons_sell."}}var Ae=e=>h(e)&&Array.isArray(e.items)&&e.items.length<=100&&e.items.every(t=>h(t)&&h(t.launch)&&typeof t.launch.address=="string"&&B.test(t.launch.address)&&typeof t.launch.factory=="string"&&B.test(t.launch.factory));async function Se(e,t){let o=j(t.limit,10,20),s=await U(e,`${x}/launches/trending`,Ae),c=s.items.filter(r=>v(r.launch.factory,F)).slice(0,o),a=await e.clientFor(w).getBlockNumber({cacheTime:0});return{items:await Promise.all(c.map(async r=>({status:await Y(e,f(r.launch.address),a),index:{volumeUsd:m(r.volumeUsd),trades:m(r.trades),traders:m(r.traders),change:m(r.change)}}))),statusBlock:a.toString(),source:`${x}/launches/trending`,excludedOtherFactories:s.items.length-s.items.filter(r=>v(r.launch.factory,F)).length,note:"Ranking is Pons\u2019s own trending list (discovery only); each launch was re-read on chain from the pinned factory."}}var z={overview:"analytics",burn:"analytics/burn",buyback:"analytics/buyback"};async function Te(e,t){let o=t.view??"overview";if(typeof o!="string"||!Object.hasOwn(z,o))throw new T("Choose view overview, burn or buyback.");let s=await U(e,`${x}/${z[o]}`,h);if(o==="overview"){let c=Array.isArray(s.series)?s.series:[];return{view:o,source:`${x}/analytics`,generatedAt:m(s.generatedAt),latestDay:m(s.latestDay),latest:O(c.at(-1)),seriesDays:c.length,today:O(s.today),earnings:O(s.earnings),indexer:O(s.indexer),note:"Protocol-wide figures from Pons\u2019s analytics index; unaudited aggregates, not a quote."}}return{view:o,source:`${x}/${z[o]}`,data:O(s),note:"Protocol-wide figures from Pons\u2019s analytics index; unaudited aggregates, not a quote."}}var Ce=e=>h(e)&&typeof e.wallet=="string"&&Array.isArray(e.items)&&e.items.length<=100&&e.items.every(t=>h(t)&&typeof t.kind=="string")&&(e.next===null||e.next===void 0||typeof e.next=="string");async function Pe(e,t,o){let s=P(t.wallet??o,"wallet address"),c=`${de}/wallets/${s.toLowerCase()}/activity`;if(t.cursor!==void 0){if(typeof t.cursor!="string"||!/^[0-9]{1,12}-[0-9]{1,6}$/.test(t.cursor))throw new T("Use the nextCursor returned by the previous pons_activity page.");c+=`/before/${t.cursor}`}let a=await U(e,c,Ce),l=typeof a.next=="string"?/\/before\/([0-9]{1,12}-[0-9]{1,6})$/.exec(a.next):null;return{wallet:s,source:`${de}/wallets/{wallet}/activity`,nextCursor:l?.[1]??null,items:a.items.map(r=>({kind:$(r.kind,24),block:m(r.block),time:m(r.time),tx:typeof r.tx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(r.tx)?r.tx:null,token:typeof r.token=="string"&&B.test(r.token)?f(r.token):null,symbol:$(r.symbol,24),amount:typeof r.amount=="string"&&ke.test(r.amount)?r.amount:null,decimals:m(r.decimals),usd:m(r.usd),counterparty:typeof r.counterparty=="string"&&B.test(r.counterparty)?f(r.counterparty):null,counterpartyLabel:$(r.counterparty_label,40)})),note:"Wallet history from Pons\u2019s balances index (discovery and bookkeeping, not proof); USD figures are index estimates. Verify a transaction by hash before relying on it."}}async function Ne(e,t,o){let s=P(t.address??o,"wallet address"),c=j(t.limit,10,20),a=await U(e,`${x}/profile/${s.toLowerCase()}?view=card`,h),l=h(a.identity)?a.identity:{},r=await U(e,`${x}/launches?deployer=${s.toLowerCase()}&limit=${c}`,i=>h(i)&&Array.isArray(i.items)&&i.items.length<=100&&i.items.every(n=>h(n)&&typeof n.address=="string"&&B.test(n.address)&&typeof n.factory=="string"&&B.test(n.factory))),p=await e.clientFor(w).getBlockNumber({cacheTime:0}),g=r.items.filter(i=>v(i.factory,F)).slice(0,c);return{address:s,hidden:a.hidden===!0,source:`${x}/profile/{address}?view=card`,identity:{username:$(l.username,40),displayName:$(l.displayName,60),description:$(l.description,200),joinedAt:m(l.joinedAt)},launches:await Promise.all(g.map(i=>Y(e,f(i.address),p))),statusBlock:p.toString(),note:"Profile text is user-supplied and untrusted. Created launches come from Pons\u2019s index and were re-read on chain from the pinned factory."}}async function _e(e,t,o){let s=P(t.token,"Pons launch token address"),c=P(t.holder??o,"holder address"),a=e.clientFor(w),l=await a.getBlockNumber({cacheTime:0}),r=await E(e,s,l),p=ne[w].pons.buybackVault.address,g=[],i=async(y,K)=>{try{return await K()}catch{return g.push(y),null}},n=y=>i(y,()=>a.readContract({address:r.curve,abi:Q,functionName:y,blockNumber:l})),u=y=>i(y,()=>a.readContract({address:r.curve,abi:Q,functionName:y,blockNumber:l})),k=y=>i(y,()=>a.readContract({address:p,abi:ue,functionName:y,args:[s],blockNumber:l})),[N,R,G,q,W,_,A,V,H,d,b,D,pe,fe]=await Promise.all([n("sellableTokens"),n("reservedTokens"),u("readyToGraduate"),u("graduated"),i("currentSnipeTaxBps",()=>a.readContract({address:r.curve,abi:Q,functionName:"currentSnipeTaxBps",args:[c],blockNumber:l})),i("getTokenInfo",()=>a.readContract({address:s,abi:he,functionName:"getTokenInfo",blockNumber:l})),i("pendingCreatorFeeRecipient",()=>a.readContract({address:F,abi:ye,functionName:"pendingCreatorFeeRecipient",args:[s],blockNumber:l})),k("totalLocked"),k("totalReleased"),k("vestedAmount"),k("releasable"),k("vestingStart"),i("VESTING_DURATION",()=>a.readContract({address:p,abi:ue,functionName:"VESTING_DURATION",blockNumber:l})),J(e,s,l)]),S=y=>y===null?null:y.toString(),te=A&&!v(A[0],ee)&&A[1]>0n?{proposedRecipient:f(A[0]),effectiveAt:A[1].toString(),expiresAt:A[2].toString(),note:"A protocol-proposed creator fee recipient change. Holders may react before it takes effect; anyone can execute it after the timelock, within the window."}:A?null:void 0;return{token:fe,phase:r.phase,statusBlock:l.toString(),curve:r.curve,creatorFeeRecipient:r.creatorFeeRecipient,curveCapacity:{sellableTokens:S(N),reservedTokens:S(R),readyToGraduate:G,graduated:q},snipeTaxBps:{recipient:c,current:S(W),note:"Keyed to the wallet that receives the tokens; buys only, large in the opening seconds."},creatorMetadata:_?{deployer:f(_[0]),logo:I(_[1].slice(0,300)),description:I(_[2].slice(0,500)),socials:Object.fromEntries(["twitter","telegram","discord","website","farcaster"].map((y,K)=>[y,I(_[3][K].slice(0,300))]))}:null,pendingTakeover:te===void 0?"unavailable":te,buybackVest:{vault:p,enabled:r.buybackEnabled,locked:S(V),released:S(H),vested:S(d),releasable:S(b),vestingStart:S(D),vestingDurationSeconds:S(pe),note:"Amounts are launch-token base units; releasing is for the vest beneficiaries only (see pons_claim)."},unavailable:g}}async function Be(e,t){let o=P(t.token,"Pons launch token address"),s=j(t.limit,25,100),c=e.clientFor(w),a=await c.getBlockNumber({cacheTime:0}),l=await E(e,o,a),r=t.toBlock===void 0?a:BigInt(String(t.toBlock)),p=t.fromBlock===void 0?r>=me?r-me+1n:0n:BigInt(String(t.fromBlock));if(p<0n||p>r||r>a||r-p+1n>ge)throw new T("Choose an ordered range of at most 10000 mined blocks.");let i=(await c.getLogs({address:l.curve,events:be,fromBlock:p,toBlock:r,strict:!0})).filter(n=>v(n.address,l.curve)&&!n.removed&&n.blockNumber!==null).sort((n,u)=>n.blockNumber===u.blockNumber?(u.logIndex??0)-(n.logIndex??0):n.blockNumber>u.blockNumber?-1:1);return{token:await J(e,o,a),curve:l.curve,fromBlock:p.toString(),toBlock:r.toString(),statusBlock:a.toString(),truncated:i.length>s,total:i.length,trades:i.slice(0,s).map(n=>n.eventName==="CurveBuy"?{side:"buy",block:n.blockNumber.toString(),tx:n.transactionHash,trader:f(n.args.buyer),recipient:f(n.args.recipient),pairIn:n.args.quoteIn.toString(),tokensOut:n.args.tokensOut.toString(),fee:n.args.fee.toString(),creatorTax:n.args.tax.toString()}:{side:"sell",block:n.blockNumber.toString(),tx:n.transactionHash,trader:f(n.args.seller),recipient:f(n.args.recipient),tokensIn:n.args.tokensIn.toString(),pairOut:n.args.quoteOut.toString(),fee:n.args.fee.toString(),creatorTax:n.args.tax.toString()}),coverage:"Curve-phase trades in the requested block window only. Graduated-pool swaps are Uniswap v4 events and are not listed here; pons_activity and pons_status cover a wallet and the pool price."}}var Le=e=>{function t(o,s,c){return{name:o,inputSchema:{type:"object",properties:s,required:["pons_holders","pons_launch_info","pons_trades"].includes(o)?["token"]:[],additionalProperties:!1},execute:async(a,l)=>{try{if(!P(l)||v(l,ee))throw new T("Provide a wallet address.");for(let r of Object.keys(a))if(!(r in s))throw new T(`Unknown ${o} input: ${r}.`);return await c(a,l)}catch(r){throw new T(e.plainError(r))}}}}return{tools:[t("pons_holders",{token:C,holder:{...C,description:"Optional wallet for an on-chain balance and indexed rank after system exclusions."},limit:{type:"integer",minimum:1,maximum:50},cursor:{type:"string",maxLength:128,description:"Filtered-directory nextCursor from pons_holders; restart if the index changes."}},o=>we(e,o)),t("pons_holdings",{holder:C,limit:{type:"integer",minimum:1,maximum:40}},(o,s)=>xe(e,o,s)),t("pons_trending",{limit:{type:"integer",minimum:1,maximum:20}},o=>Se(e,o)),t("pons_analytics",{view:{type:"string",enum:Object.keys(z)}},o=>Te(e,o)),t("pons_activity",{wallet:C,cursor:{type:"string",maxLength:32}},(o,s)=>Pe(e,o,s)),t("pons_launch_info",{token:C,holder:C},(o,s)=>_e(e,o,s)),t("pons_trades",{token:C,fromBlock:X(),toBlock:X(),limit:{type:"integer",minimum:1,maximum:100}},o=>Be(e,o)),t("pons_profile",{address:C,limit:{type:"integer",minimum:1,maximum:20}},(o,s)=>Ne(e,o,s))]}};export{O as a,Le as b};
@@ -1 +1 @@
1
- import{a as s,d as h,e as u}from"./HNMOB76J.js";import{a as l}from"./UWOFA6GV.js";import{a as c}from"./XPFVT2EA.js";import{a as d}from"./5YS5V2LK.js";import{concatHex as P,encodeAbiParameters as x,encodeFunctionData as w,getAddress as m,keccak256 as f,parseAbi as k,stringToHex as v}from"viem";var g=k(["function ownerOf(uint256) view returns (address)","function tokenURI(uint256) view returns (string)","function setMetadata(uint256,string,bytes)","function approve(address,uint256)"]),I=k(["function listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))","function recordHash(uint256) view returns (bytes32)"]),_=(t,r)=>f(P(BigInt(t)<BigInt(r)?[t,r]:[r,t]));function C(t){if(!Array.isArray(t)||t.length<1||t.length>1e4)throw new d("Provide 1 to 10000 identity IDs.");let r=[...new Set(t.map(e=>u(e,"agentIds").toString()))].sort((e,a)=>BigInt(e)<BigInt(a)?-1:1),n=[r.map(e=>f(f(x([{type:"uint256"}],[BigInt(e)]))))];for(;n.at(-1).length>1;){let e=n.at(-1),a=[];for(let o=0;o<e.length;o+=2)a.push(e[o+1]?_(e[o],e[o+1]):e[o]);n.push(a)}return{root:n.at(-1)[0],ids:r,proofs:r.map((e,a)=>{let o=[],p=a;for(let b of n.slice(0,-1)){let y=b[p^1];y&&o.push(y),p=Math.floor(p/2)}return{agentId:e,proof:o}})}}function A(t){return{tools:[{name:"priors_market_origin",inputSchema:{type:"object",properties:{agentIds:{type:"array",minItems:1,maxItems:1e4,items:l()}},required:["agentIds"],additionalProperties:!1},async execute(r){return{chainId:c,...C(r.agentIds),caveat:"Locally commits exactly these IDs. This does not verify third-party origin, quality, current owner or a seller claim."}}},{name:"priors_market_pins",inputSchema:{type:"object",properties:{agentId:l()},required:["agentId"],additionalProperties:!1},async execute(r){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let i=u(r.agentId,"agentId"),n=t.clientFor(c),e=await n.getBlockNumber({cacheTime:0}),[a,o,p]=await Promise.all([n.readContract({address:s.market,abi:I,functionName:"listingOf",args:[i],blockNumber:e}),n.readContract({address:s.market,abi:I,functionName:"recordHash",args:[i],blockNumber:e}),n.readContract({address:s.registry,abi:g,functionName:"tokenURI",args:[i],blockNumber:e})]);return{chainId:c,blockNumber:e.toString(),listing:h(a),recordHash:o,currentUriHash:f(v(p)),caveat:"Pins bind identity file and credit state, not included code, servers or keys. Listing and current URI hashes may differ; preview refuses an altered listing."}}},{name:"priors_market_clear_bid_budget",inputSchema:{type:"object",properties:{},additionalProperties:!1},async execute(r,i){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let n=[t.approval(s.usdg,s.bidSpender,"0",c)],e=await t.preview(n,m(i));return{txs:n,summary:`Clear all this wallet future bid spending allowance to ${s.bidSpender}. Existing bids cannot fill from it until approved again. ${e.summary}`}}},{name:"priors_market_revoke_nft",inputSchema:{type:"object",properties:{agentId:l()},required:["agentId"],additionalProperties:!1},async execute(r,i){let n=u(r.agentId,"agentId");if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");if(m(await t.clientFor(c).readContract({address:s.registry,abi:g,functionName:"ownerOf",args:[n]}))!==m(i))throw new d("Only current NFT owner may revoke this per-token approval.");let e=[t.unsignedTx({to:s.registry,data:w({abi:g,functionName:"approve",args:["0x0000000000000000000000000000000000000000",n]}),value:"0",chainId:c,description:`Revoke exact ERC-8004 NFT ${n} market approval.`})],a=await t.preview(e,i);return{txs:e,summary:`Clear this identity per-token transfer approval. Also cancel its listing before granting any new market approval. ${a.summary}`}}},{name:"priors_x_link",inputSchema:{type:"object",properties:{agentId:l(),postUrl:{type:"string",maxLength:160,description:"Canonical https://x.com/<handle>/status/<id> owner proof post URL, or empty to unlink. Owner creates the public post themselves."}},required:["agentId","postUrl"],additionalProperties:!1},async execute(r,i){if(t.network==="testnet")throw new d("Priors X metadata is mainnet only.");let n=u(r.agentId,"agentId");if(m(await t.clientFor(c).readContract({address:s.registry,abi:g,functionName:"ownerOf",args:[n]}))!==m(i))throw new d("Only the identity owner can link or clear X metadata.");if(typeof r.postUrl!="string"||r.postUrl!==""&&!/^https:\/\/x\.com\/[A-Za-z0-9_]{1,15}\/status\/[0-9]{1,30}$/.test(r.postUrl))throw new d("Provide a canonical X status URL or empty string to unlink.");let e=[t.unsignedTx({to:s.registry,data:w({abi:g,functionName:"setMetadata",args:[n,"x",v(r.postUrl)]}),value:"0",chainId:c,description:"Set/clear the owner identity X proof-post metadata."})],a=await t.preview(e,i);return{txs:e,summary:`Publish ${r.postUrl?"the specified X post URL":"empty X metadata"} on public ERC-8004 identity ${n}. Priors independently verifies the post; metadata alone does not prove the X account or affect credit terms. ${a.summary}`}}}]}}export{C as a,A as b};
1
+ import{a as s,d as h,e as u}from"./GGUEKSR4.js";import{a as l}from"./UWOFA6GV.js";import{a as c}from"./G6HCV67X.js";import{a as d}from"./5YS5V2LK.js";import{concatHex as P,encodeAbiParameters as x,encodeFunctionData as w,getAddress as m,keccak256 as f,parseAbi as k,stringToHex as v}from"viem";var g=k(["function ownerOf(uint256) view returns (address)","function tokenURI(uint256) view returns (string)","function setMetadata(uint256,string,bytes)","function approve(address,uint256)"]),I=k(["function listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))","function recordHash(uint256) view returns (bytes32)"]),_=(t,r)=>f(P(BigInt(t)<BigInt(r)?[t,r]:[r,t]));function C(t){if(!Array.isArray(t)||t.length<1||t.length>1e4)throw new d("Provide 1 to 10000 identity IDs.");let r=[...new Set(t.map(e=>u(e,"agentIds").toString()))].sort((e,a)=>BigInt(e)<BigInt(a)?-1:1),n=[r.map(e=>f(f(x([{type:"uint256"}],[BigInt(e)]))))];for(;n.at(-1).length>1;){let e=n.at(-1),a=[];for(let o=0;o<e.length;o+=2)a.push(e[o+1]?_(e[o],e[o+1]):e[o]);n.push(a)}return{root:n.at(-1)[0],ids:r,proofs:r.map((e,a)=>{let o=[],p=a;for(let b of n.slice(0,-1)){let y=b[p^1];y&&o.push(y),p=Math.floor(p/2)}return{agentId:e,proof:o}})}}function A(t){return{tools:[{name:"priors_market_origin",inputSchema:{type:"object",properties:{agentIds:{type:"array",minItems:1,maxItems:1e4,items:l()}},required:["agentIds"],additionalProperties:!1},async execute(r){return{chainId:c,...C(r.agentIds),caveat:"Locally commits exactly these IDs. This does not verify third-party origin, quality, current owner or a seller claim."}}},{name:"priors_market_pins",inputSchema:{type:"object",properties:{agentId:l()},required:["agentId"],additionalProperties:!1},async execute(r){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let i=u(r.agentId,"agentId"),n=t.clientFor(c),e=await n.getBlockNumber({cacheTime:0}),[a,o,p]=await Promise.all([n.readContract({address:s.market,abi:I,functionName:"listingOf",args:[i],blockNumber:e}),n.readContract({address:s.market,abi:I,functionName:"recordHash",args:[i],blockNumber:e}),n.readContract({address:s.registry,abi:g,functionName:"tokenURI",args:[i],blockNumber:e})]);return{chainId:c,blockNumber:e.toString(),listing:h(a),recordHash:o,currentUriHash:f(v(p)),caveat:"Pins bind identity file and credit state, not included code, servers or keys. Listing and current URI hashes may differ; preview refuses an altered listing."}}},{name:"priors_market_clear_bid_budget",inputSchema:{type:"object",properties:{},additionalProperties:!1},async execute(r,i){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let n=[t.approval(s.usdg,s.bidSpender,"0",c)],e=await t.preview(n,m(i));return{txs:n,summary:`Clear all this wallet future bid spending allowance to ${s.bidSpender}. Existing bids cannot fill from it until approved again. ${e.summary}`}}},{name:"priors_market_revoke_nft",inputSchema:{type:"object",properties:{agentId:l()},required:["agentId"],additionalProperties:!1},async execute(r,i){let n=u(r.agentId,"agentId");if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");if(m(await t.clientFor(c).readContract({address:s.registry,abi:g,functionName:"ownerOf",args:[n]}))!==m(i))throw new d("Only current NFT owner may revoke this per-token approval.");let e=[t.unsignedTx({to:s.registry,data:w({abi:g,functionName:"approve",args:["0x0000000000000000000000000000000000000000",n]}),value:"0",chainId:c,description:`Revoke exact ERC-8004 NFT ${n} market approval.`})],a=await t.preview(e,i);return{txs:e,summary:`Clear this identity per-token transfer approval. Also cancel its listing before granting any new market approval. ${a.summary}`}}},{name:"priors_x_link",inputSchema:{type:"object",properties:{agentId:l(),postUrl:{type:"string",maxLength:160,description:"Canonical https://x.com/<handle>/status/<id> owner proof post URL, or empty to unlink. Owner creates the public post themselves."}},required:["agentId","postUrl"],additionalProperties:!1},async execute(r,i){if(t.network==="testnet")throw new d("Priors X metadata is mainnet only.");let n=u(r.agentId,"agentId");if(m(await t.clientFor(c).readContract({address:s.registry,abi:g,functionName:"ownerOf",args:[n]}))!==m(i))throw new d("Only the identity owner can link or clear X metadata.");if(typeof r.postUrl!="string"||r.postUrl!==""&&!/^https:\/\/x\.com\/[A-Za-z0-9_]{1,15}\/status\/[0-9]{1,30}$/.test(r.postUrl))throw new d("Provide a canonical X status URL or empty string to unlink.");let e=[t.unsignedTx({to:s.registry,data:w({abi:g,functionName:"setMetadata",args:[n,"x",v(r.postUrl)]}),value:"0",chainId:c,description:"Set/clear the owner identity X proof-post metadata."})],a=await t.preview(e,i);return{txs:e,summary:`Publish ${r.postUrl?"the specified X post URL":"empty X metadata"} on public ERC-8004 identity ${n}. Priors independently verifies the post; metadata alone does not prove the X account or affect credit terms. ${a.summary}`}}}]}}export{C as a,A as b};
@@ -1 +1 @@
1
- import{c as k,i as T,l as S,m as O,n as R}from"./73N3TOJL.js";import{a as f,i as P}from"./XPFVT2EA.js";import{a as c}from"./5YS5V2LK.js";import{encodeFunctionData as $,erc20Abi as x,parseAbi as N,zeroAddress as U}from"viem";var g=P[f].merkl.distributor.address,j=["function accessControlManager() view returns (address)","function isGovernor(address) view returns (bool)","function isGovernorOrGuardian(address) view returns (bool)","function canUpdateMerkleRoot(address) view returns (uint256)","function mainOperators(address,address) view returns (uint256)","function disputeToken() view returns (address)","function disputeAmount() view returns (uint256)","function disputer() view returns (address)","function endOfDisputePeriod() view returns (uint48)","function getMerkleRoot() view returns (bytes32)","function getEpochDuration() view returns (uint32)","function disputePeriod() view returns (uint48)","function upgradeabilityDeactivated() view returns (uint256)","function disputeTree(string)","function updateTree((bytes32 merkleRoot,bytes32 ipfsHash))","function toggleTrusted(address)","function toggleMainOperatorStatus(address,address)","function revokeUpgradeability()","function setEpochDuration(uint32)","function resolveDispute(bool)","function revokeTree()","function recoverERC20(address,address,uint256)","function setDisputePeriod(uint48)","function setDisputeToken(address)","function setDisputeAmount(uint256)"],y=N(j),H={type:"string",pattern:"^\\d+$"},E={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},C="Provide a valid address.";function m(o,l=!1){let n=T(o,C);return l?n:S(n,C)}function F(o,l=256){return R(o,`Value exceeds uint${l}.`,{bits:l})}function b(o){return O(o,"Merkl returned invalid protocol state.")}function G(o){return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?String(o):b(o).toString()}var D={updateTree:["merkleRoot","ipfsHash"],toggleTrusted:["target","enabled"],toggleMainOperatorStatus:["target","token","enabled"],revokeUpgradeability:[],setEpochDuration:["amount"],resolveDispute:["valid"],revokeTree:[],recoverERC20:["token","recipient","amount"],setDisputePeriod:["amount"],setDisputeToken:["token"],setDisputeAmount:["amount"]},J=o=>{let l=()=>o.clientFor(f),n=(r,i=[],e=g)=>l().readContract({address:e,abi:y,functionName:r,args:i}),h=(r,i,e,p)=>({name:`merkl_${r}`,inputSchema:{type:"object",properties:i,required:e,additionalProperties:!1},execute:async(u,s)=>{try{let a=Object.keys(u).find(d=>!Object.hasOwn(i,d));if(a)throw new c(`Unsupported Merkl input: ${a}.`);return await p(u,m(s))}catch(a){throw new c(o.plainError(a))}}}),I=async(r,i,e,p)=>{let u=[o.unsignedTx({to:g,data:$({abi:y,functionName:r,args:i}),value:"0",chainId:f,description:e})],s=await o.preview(u,p);return{txs:u,preview:s,summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${e} ${s.summary}`}};return{tools:[h("distributor_status",{},[],async(r,i)=>{let[e,p,u,s,a,d,t,w,z]=await Promise.all([n("getMerkleRoot"),n("disputeToken"),n("disputeAmount"),n("disputer"),n("endOfDisputePeriod"),n("getEpochDuration"),n("disputePeriod"),n("upgradeabilityDeactivated"),n("accessControlManager")]);if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e)||typeof d!="number"||!Number.isInteger(d)||d<0||d>4294967295)throw new c("Merkl returned invalid Distributor state.");let v=m(z),[M,A]=await Promise.all([n("isGovernor",[i],v),n("isGovernorOrGuardian",[i],v)]);if(typeof M!="boolean"||typeof A!="boolean")throw new c("Merkl returned invalid governance roles.");return{chainId:f,distributor:g,root:e,disputeToken:m(p,!0),disputeAmount:b(u).toString(),disputer:m(s,!0),endOfDisputePeriod:G(a),epochDuration:String(d),disputePeriod:G(t),upgradeabilityDeactivated:b(w).toString(),accessControlManager:v,governor:M,governorOrGuardian:A,summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Dispute amounts are token base units. Opening a dispute locks collateral until governor resolution; a rejected dispute forfeits it."}}),h("dispute",{reason:{type:"string",minLength:1,maxLength:2e3}},["reason"],async(r,i)=>{if(typeof r.reason!="string"||!r.reason.trim()||r.reason.length>2e3)throw new c("Provide a public dispute reason of 1 to 2000 characters.");let e=m(await n("disputeToken")),p=b(await n("disputeAmount")),[u,s]=await Promise.all([l().readContract({address:e,abi:x,functionName:"symbol"}),l().readContract({address:e,abi:x,functionName:"decimals"})]);if(typeof u!="string"||!u.trim()||typeof s!="number"||!Number.isInteger(s)||s<0||s>255)throw new c("Merkl dispute token metadata is invalid.");let a=`Dispute Merkl's tree: ${r.reason}. Lock ${p} ${u} base units (token ${e}, decimals ${s}) until governor resolution; rejection forfeits the deposit. There is no unilateral withdrawal.`,d=[...p?[o.approval(e,g,p.toString(),f)]:[],o.unsignedTx({to:g,data:$({abi:y,functionName:"disputeTree",args:[r.reason]}),value:"0",chainId:f,description:a})],t=await o.preview(d,i);return{txs:d,preview:t,deposit:{token:{address:e,symbol:u,decimals:s,chainId:f},amount:p.toString()},summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${a} ${t.summary}`}}),h("distributor_admin",{operation:{enum:Object.keys(D)},target:k,token:k,recipient:k,amount:H,enabled:{type:"boolean"},valid:{type:"boolean"},merkleRoot:E,ipfsHash:E},["operation"],async(r,i)=>{let e=String(r.operation);if(!Object.hasOwn(D,e))throw new c("Choose a supported Distributor operation.");let p=D[e];for(let t of Object.keys(r))if(t!=="operation"&&!p.includes(t))throw new c(`Input ${t} does not match this Distributor operation.`);let u=m(await n("accessControlManager")),s=await n("isGovernor",[i],u);if(typeof s!="boolean")throw new c("Merkl returned invalid governor status.");if(!s&&!(e==="updateTree"?await n("canUpdateMerkleRoot",[i])===1n:e==="toggleMainOperatorStatus"&&r.token!==U?await n("isGovernorOrGuardian",[i],u)===!0:!1))throw new c("The connected wallet lacks the required Merkl governance role.");let a=p.map(t=>{if(t==="enabled"||t==="valid"){if(typeof r[t]!="boolean")throw new c(`Provide ${t} as boolean.`);return r[t]}if(t==="amount"){let w=F(r[t],e==="setEpochDuration"?32:e==="setDisputePeriod"?48:256);return e==="setEpochDuration"?Number(w):w}if(t==="merkleRoot"||t==="ipfsHash"){if(typeof r[t]!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r[t]))throw new c("Provide a bytes32 root and IPFS hash.");return r[t]}return m(r[t],t==="token"&&e==="toggleMainOperatorStatus")}),d=a;if(e==="updateTree"&&(d=[{merkleRoot:a[0],ipfsHash:a[1]}]),e==="toggleTrusted"||e==="toggleMainOperatorStatus"){let t=await n(e==="toggleTrusted"?"canUpdateMerkleRoot":"mainOperators",e==="toggleTrusted"?[a[0]]:a.slice(0,2));if(t!==0n&&t!==1n)throw new c("Merkl returned invalid authorization state.");if(t===1n===r.enabled)return{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Authorization already has the requested state."};d=a.slice(0,-1)}return I(e,d,`Merkl Distributor ${e} ${JSON.stringify(r)}. Governance affects every claimant. Upgradeability revocation is permanent; dispute resolution returns or forfeits collateral. Authorization operations toggle the observed state; re-preview if state changes.`,i)})]}};export{J as a};
1
+ import{c as k,i as T,l as S,m as O,n as R}from"./73N3TOJL.js";import{a as f,i as P}from"./G6HCV67X.js";import{a as c}from"./5YS5V2LK.js";import{encodeFunctionData as $,erc20Abi as x,parseAbi as N,zeroAddress as U}from"viem";var g=P[f].merkl.distributor.address,j=["function accessControlManager() view returns (address)","function isGovernor(address) view returns (bool)","function isGovernorOrGuardian(address) view returns (bool)","function canUpdateMerkleRoot(address) view returns (uint256)","function mainOperators(address,address) view returns (uint256)","function disputeToken() view returns (address)","function disputeAmount() view returns (uint256)","function disputer() view returns (address)","function endOfDisputePeriod() view returns (uint48)","function getMerkleRoot() view returns (bytes32)","function getEpochDuration() view returns (uint32)","function disputePeriod() view returns (uint48)","function upgradeabilityDeactivated() view returns (uint256)","function disputeTree(string)","function updateTree((bytes32 merkleRoot,bytes32 ipfsHash))","function toggleTrusted(address)","function toggleMainOperatorStatus(address,address)","function revokeUpgradeability()","function setEpochDuration(uint32)","function resolveDispute(bool)","function revokeTree()","function recoverERC20(address,address,uint256)","function setDisputePeriod(uint48)","function setDisputeToken(address)","function setDisputeAmount(uint256)"],y=N(j),H={type:"string",pattern:"^\\d+$"},E={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},C="Provide a valid address.";function m(o,l=!1){let n=T(o,C);return l?n:S(n,C)}function F(o,l=256){return R(o,`Value exceeds uint${l}.`,{bits:l})}function b(o){return O(o,"Merkl returned invalid protocol state.")}function G(o){return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?String(o):b(o).toString()}var D={updateTree:["merkleRoot","ipfsHash"],toggleTrusted:["target","enabled"],toggleMainOperatorStatus:["target","token","enabled"],revokeUpgradeability:[],setEpochDuration:["amount"],resolveDispute:["valid"],revokeTree:[],recoverERC20:["token","recipient","amount"],setDisputePeriod:["amount"],setDisputeToken:["token"],setDisputeAmount:["amount"]},J=o=>{let l=()=>o.clientFor(f),n=(r,i=[],e=g)=>l().readContract({address:e,abi:y,functionName:r,args:i}),h=(r,i,e,p)=>({name:`merkl_${r}`,inputSchema:{type:"object",properties:i,required:e,additionalProperties:!1},execute:async(u,s)=>{try{let a=Object.keys(u).find(d=>!Object.hasOwn(i,d));if(a)throw new c(`Unsupported Merkl input: ${a}.`);return await p(u,m(s))}catch(a){throw new c(o.plainError(a))}}}),I=async(r,i,e,p)=>{let u=[o.unsignedTx({to:g,data:$({abi:y,functionName:r,args:i}),value:"0",chainId:f,description:e})],s=await o.preview(u,p);return{txs:u,preview:s,summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${e} ${s.summary}`}};return{tools:[h("distributor_status",{},[],async(r,i)=>{let[e,p,u,s,a,d,t,w,z]=await Promise.all([n("getMerkleRoot"),n("disputeToken"),n("disputeAmount"),n("disputer"),n("endOfDisputePeriod"),n("getEpochDuration"),n("disputePeriod"),n("upgradeabilityDeactivated"),n("accessControlManager")]);if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e)||typeof d!="number"||!Number.isInteger(d)||d<0||d>4294967295)throw new c("Merkl returned invalid Distributor state.");let v=m(z),[M,A]=await Promise.all([n("isGovernor",[i],v),n("isGovernorOrGuardian",[i],v)]);if(typeof M!="boolean"||typeof A!="boolean")throw new c("Merkl returned invalid governance roles.");return{chainId:f,distributor:g,root:e,disputeToken:m(p,!0),disputeAmount:b(u).toString(),disputer:m(s,!0),endOfDisputePeriod:G(a),epochDuration:String(d),disputePeriod:G(t),upgradeabilityDeactivated:b(w).toString(),accessControlManager:v,governor:M,governorOrGuardian:A,summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Dispute amounts are token base units. Opening a dispute locks collateral until governor resolution; a rejected dispute forfeits it."}}),h("dispute",{reason:{type:"string",minLength:1,maxLength:2e3}},["reason"],async(r,i)=>{if(typeof r.reason!="string"||!r.reason.trim()||r.reason.length>2e3)throw new c("Provide a public dispute reason of 1 to 2000 characters.");let e=m(await n("disputeToken")),p=b(await n("disputeAmount")),[u,s]=await Promise.all([l().readContract({address:e,abi:x,functionName:"symbol"}),l().readContract({address:e,abi:x,functionName:"decimals"})]);if(typeof u!="string"||!u.trim()||typeof s!="number"||!Number.isInteger(s)||s<0||s>255)throw new c("Merkl dispute token metadata is invalid.");let a=`Dispute Merkl's tree: ${r.reason}. Lock ${p} ${u} base units (token ${e}, decimals ${s}) until governor resolution; rejection forfeits the deposit. There is no unilateral withdrawal.`,d=[...p?[o.approval(e,g,p.toString(),f)]:[],o.unsignedTx({to:g,data:$({abi:y,functionName:"disputeTree",args:[r.reason]}),value:"0",chainId:f,description:a})],t=await o.preview(d,i);return{txs:d,preview:t,deposit:{token:{address:e,symbol:u,decimals:s,chainId:f},amount:p.toString()},summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${a} ${t.summary}`}}),h("distributor_admin",{operation:{enum:Object.keys(D)},target:k,token:k,recipient:k,amount:H,enabled:{type:"boolean"},valid:{type:"boolean"},merkleRoot:E,ipfsHash:E},["operation"],async(r,i)=>{let e=String(r.operation);if(!Object.hasOwn(D,e))throw new c("Choose a supported Distributor operation.");let p=D[e];for(let t of Object.keys(r))if(t!=="operation"&&!p.includes(t))throw new c(`Input ${t} does not match this Distributor operation.`);let u=m(await n("accessControlManager")),s=await n("isGovernor",[i],u);if(typeof s!="boolean")throw new c("Merkl returned invalid governor status.");if(!s&&!(e==="updateTree"?await n("canUpdateMerkleRoot",[i])===1n:e==="toggleMainOperatorStatus"&&r.token!==U?await n("isGovernorOrGuardian",[i],u)===!0:!1))throw new c("The connected wallet lacks the required Merkl governance role.");let a=p.map(t=>{if(t==="enabled"||t==="valid"){if(typeof r[t]!="boolean")throw new c(`Provide ${t} as boolean.`);return r[t]}if(t==="amount"){let w=F(r[t],e==="setEpochDuration"?32:e==="setDisputePeriod"?48:256);return e==="setEpochDuration"?Number(w):w}if(t==="merkleRoot"||t==="ipfsHash"){if(typeof r[t]!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r[t]))throw new c("Provide a bytes32 root and IPFS hash.");return r[t]}return m(r[t],t==="token"&&e==="toggleMainOperatorStatus")}),d=a;if(e==="updateTree"&&(d=[{merkleRoot:a[0],ipfsHash:a[1]}]),e==="toggleTrusted"||e==="toggleMainOperatorStatus"){let t=await n(e==="toggleTrusted"?"canUpdateMerkleRoot":"mainOperators",e==="toggleTrusted"?[a[0]]:a.slice(0,2));if(t!==0n&&t!==1n)throw new c("Merkl returned invalid authorization state.");if(t===1n===r.enabled)return{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Authorization already has the requested state."};d=a.slice(0,-1)}return I(e,d,`Merkl Distributor ${e} ${JSON.stringify(r)}. Governance affects every claimant. Upgradeability revocation is permanent; dispute resolution returns or forfeits collateral. Authorization operations toggle the observed state; re-preview if state changes.`,i)})]}};export{J as a};
@@ -1 +1 @@
1
- import{a as y}from"./6IM6A5VA.js";import{m as b}from"./73N3TOJL.js";import{a as i,i as w,j as l}from"./XPFVT2EA.js";import{a as c}from"./5YS5V2LK.js";import{erc20Abi as v,getAddress as u,parseAbi as G}from"viem";var d=10n**27n,I=1000000021979553151239153027n,a=u(w[i].vaults.spark.address),U="https://docs.spark.finance/dev/savings/spark-vaults-v2",g=G(["function asset() view returns (address)","function vsr() view returns (uint256)","function totalAssets() view returns (uint256)","function depositCap() view returns (uint256)","function minVsr() view returns (uint256)","function maxVsr() view returns (uint256)","function convertToAssets(uint256) view returns (uint256)"]);function n(e){return b(e,"Spark returned an invalid unsigned integer.")}function q(e){if(e<d||e>I)throw new c("Spark savings rate is outside the documented bounds.");let r=31536000n,s=e,t=d;for(;r>0n;)r%2n&&(t=t*s/d),r/=2n,r>0n&&(s=s*s/d);return t-d}function j(e){return{name:"spark_details",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(r,s)=>{try{if(y(s),Object.keys(r).length)throw new c("Spark details takes no arguments.");let t=e.clientFor(i);if(await t.getChainId()!==i)throw new c("Spark details requires chain 4663.");let o=await t.getBlockNumber({cacheTime:0}),h=await t.readContract({address:a,abi:g,functionName:"asset",blockNumber:o});if(typeof h!="string"||u(h)!==u(l))throw new c("Spark does not report canonical USDG.");let[k,A,C,D,x,N,R]=await Promise.all([...["vsr","totalAssets","depositCap","minVsr","maxVsr"].map(V=>t.readContract({address:a,abi:g,functionName:V,blockNumber:o})),t.readContract({address:u(l),abi:v,functionName:"balanceOf",args:[a],blockNumber:o}),t.readContract({address:a,abi:v,functionName:"balanceOf",args:[s],blockNumber:o})]),f=n(k),p=n(A),m=n(N),S=n(R),T=n(await t.readContract({address:a,abi:g,functionName:"convertToAssets",args:[S],blockNumber:o}));return{chainId:i,vault:a,blockNumber:o.toString(),asset:{address:u(l),symbol:"USDG",decimals:6,chainId:i},shareToken:{address:a,symbol:"spUSDG",decimals:6,chainId:i},rate:{vsrRay:f.toString(),scale:d.toString(),annualYieldRay:q(f).toString(),secondsPerYear:"31536000",minVsrRay:n(D).toString(),maxVsrRay:n(x).toString(),caveat:"Projection with the current per-second rate held constant; governance can change it. Not a promised return."},totalAssets:p.toString(),idleAssets:m.toString(),depositCapAssets:n(C).toString(),outstandingAssets:(p>m?p-m:0n).toString(),heldShares:S.toString(),positionAssets:T.toString(),backing:{source:U,mechanism:"The permissioned taker deploys liquidity through the Spark Liquidity Layer. totalAssets is share-implied accounting; idle USDG alone funds immediate redemptions.",composition:null,compositionStatus:"Current strategy-by-strategy backing was not measured on this chain; inspect the official Spark app."},risk:["Liquidity deployed by the taker may be unavailable for immediate withdrawal.","Vault upgrades and role-controlled rate/cap changes affect behavior.","Share value and the USDG peg can change; conversion does not prove exit liquidity."]}}catch(t){throw new c(e.plainError(t))}}}}export{q as a,j as b};
1
+ import{a as y}from"./6IM6A5VA.js";import{m as b}from"./73N3TOJL.js";import{a as i,i as w,j as l}from"./G6HCV67X.js";import{a as c}from"./5YS5V2LK.js";import{erc20Abi as v,getAddress as u,parseAbi as G}from"viem";var d=10n**27n,I=1000000021979553151239153027n,a=u(w[i].vaults.spark.address),U="https://docs.spark.finance/dev/savings/spark-vaults-v2",g=G(["function asset() view returns (address)","function vsr() view returns (uint256)","function totalAssets() view returns (uint256)","function depositCap() view returns (uint256)","function minVsr() view returns (uint256)","function maxVsr() view returns (uint256)","function convertToAssets(uint256) view returns (uint256)"]);function n(e){return b(e,"Spark returned an invalid unsigned integer.")}function q(e){if(e<d||e>I)throw new c("Spark savings rate is outside the documented bounds.");let r=31536000n,s=e,t=d;for(;r>0n;)r%2n&&(t=t*s/d),r/=2n,r>0n&&(s=s*s/d);return t-d}function j(e){return{name:"spark_details",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(r,s)=>{try{if(y(s),Object.keys(r).length)throw new c("Spark details takes no arguments.");let t=e.clientFor(i);if(await t.getChainId()!==i)throw new c("Spark details requires chain 4663.");let o=await t.getBlockNumber({cacheTime:0}),h=await t.readContract({address:a,abi:g,functionName:"asset",blockNumber:o});if(typeof h!="string"||u(h)!==u(l))throw new c("Spark does not report canonical USDG.");let[k,A,C,D,x,N,R]=await Promise.all([...["vsr","totalAssets","depositCap","minVsr","maxVsr"].map(V=>t.readContract({address:a,abi:g,functionName:V,blockNumber:o})),t.readContract({address:u(l),abi:v,functionName:"balanceOf",args:[a],blockNumber:o}),t.readContract({address:a,abi:v,functionName:"balanceOf",args:[s],blockNumber:o})]),f=n(k),p=n(A),m=n(N),S=n(R),T=n(await t.readContract({address:a,abi:g,functionName:"convertToAssets",args:[S],blockNumber:o}));return{chainId:i,vault:a,blockNumber:o.toString(),asset:{address:u(l),symbol:"USDG",decimals:6,chainId:i},shareToken:{address:a,symbol:"spUSDG",decimals:6,chainId:i},rate:{vsrRay:f.toString(),scale:d.toString(),annualYieldRay:q(f).toString(),secondsPerYear:"31536000",minVsrRay:n(D).toString(),maxVsrRay:n(x).toString(),caveat:"Projection with the current per-second rate held constant; governance can change it. Not a promised return."},totalAssets:p.toString(),idleAssets:m.toString(),depositCapAssets:n(C).toString(),outstandingAssets:(p>m?p-m:0n).toString(),heldShares:S.toString(),positionAssets:T.toString(),backing:{source:U,mechanism:"The permissioned taker deploys liquidity through the Spark Liquidity Layer. totalAssets is share-implied accounting; idle USDG alone funds immediate redemptions.",composition:null,compositionStatus:"Current strategy-by-strategy backing was not measured on this chain; inspect the official Spark app."},risk:["Liquidity deployed by the taker may be unavailable for immediate withdrawal.","Vault upgrades and role-controlled rate/cap changes affect behavior.","Share value and the USDG peg can change; conversion does not prove exit liquidity."]}}catch(t){throw new c(e.plainError(t))}}}}export{q as a,j as b};
@@ -1 +1 @@
1
- import{d as y,h as A}from"./3R3C3CU5.js";import{b as p,e as f,g as v}from"./IAXKPME3.js";import{c as l}from"./73N3TOJL.js";import{a as g}from"./XPFVT2EA.js";import{a as r}from"./5YS5V2LK.js";import{parseAbi as I,zeroAddress as N}from"viem";var S=I(["function observe(uint32[] secondsAgos) view returns (int56[] tickCumulatives,uint160[] secondsPerLiquidityCumulativeX128s)"]);function j(s){return{tools:[{name:"uniswap_oracle",inputSchema:{type:"object",additionalProperties:!1,required:["token0","token1","fee","secondsAgo"],properties:{token0:l,token1:l,fee:{type:"integer",minimum:0,maximum:999999},secondsAgo:{type:"integer",minimum:1,maximum:4294967295}}},async execute(t){v(t,["token0","token1","fee","secondsAgo"]);let a=p(t.token0),c=p(t.token1),o=t.fee,e=t.secondsAgo;if(BigInt(a)>=BigInt(c))throw new r("Oracle tokens must be strictly sorted token0 < token1.");if(typeof o!="number"||!Number.isInteger(o)||o<0||o>=1e6||typeof e!="number"||!Number.isInteger(e)||e<=0||e>4294967295)throw new r("Provide integer fee pips and a positive uint32 secondsAgo.");let m=s.clientFor(g),i=await m.getBlockNumber(),u=await m.readContract({address:y.factory,abi:A,functionName:"getPool",args:[a,c,o],blockNumber:i});if(u===N)throw new r("No factory-verified v3 pool exists for this oracle.");let[[n,k],w,h]=await Promise.all([m.readContract({address:u,abi:S,functionName:"observe",args:[[e,0]],blockNumber:i}),f(s,a,i),f(s,c,i)]);if(n.length!==2||k.length!==2)throw new r("Oracle returned an unexpected observation count.");let d=n[1]-n[0],b=BigInt(e),P=d/b-(d<0n&&d%b!==0n?1n:0n);return{pool:u,token0:w,token1:h,secondsAgo:e,blockNumber:i.toString(),tickCumulatives:n.map(String),secondsPerLiquidityCumulativeX128s:k.map(String),arithmeticMeanTick:P.toString(),summary:"V3 time-weighted arithmetic mean tick, rounded toward negative infinity. Price is token1-base-units per token0-base-unit before decimal adjustment. Insufficient pool history reverts; an unavailable oracle is never reported as zero."}}}]}}export{j as a};
1
+ import{d as y,h as A}from"./IBXYIN7Q.js";import{b as p,e as f,g as v}from"./3NDVXEBR.js";import{c as l}from"./73N3TOJL.js";import{a as g}from"./G6HCV67X.js";import{a as r}from"./5YS5V2LK.js";import{parseAbi as I,zeroAddress as N}from"viem";var S=I(["function observe(uint32[] secondsAgos) view returns (int56[] tickCumulatives,uint160[] secondsPerLiquidityCumulativeX128s)"]);function j(s){return{tools:[{name:"uniswap_oracle",inputSchema:{type:"object",additionalProperties:!1,required:["token0","token1","fee","secondsAgo"],properties:{token0:l,token1:l,fee:{type:"integer",minimum:0,maximum:999999},secondsAgo:{type:"integer",minimum:1,maximum:4294967295}}},async execute(t){v(t,["token0","token1","fee","secondsAgo"]);let a=p(t.token0),c=p(t.token1),o=t.fee,e=t.secondsAgo;if(BigInt(a)>=BigInt(c))throw new r("Oracle tokens must be strictly sorted token0 < token1.");if(typeof o!="number"||!Number.isInteger(o)||o<0||o>=1e6||typeof e!="number"||!Number.isInteger(e)||e<=0||e>4294967295)throw new r("Provide integer fee pips and a positive uint32 secondsAgo.");let m=s.clientFor(g),i=await m.getBlockNumber(),u=await m.readContract({address:y.factory,abi:A,functionName:"getPool",args:[a,c,o],blockNumber:i});if(u===N)throw new r("No factory-verified v3 pool exists for this oracle.");let[[n,k],w,h]=await Promise.all([m.readContract({address:u,abi:S,functionName:"observe",args:[[e,0]],blockNumber:i}),f(s,a,i),f(s,c,i)]);if(n.length!==2||k.length!==2)throw new r("Oracle returned an unexpected observation count.");let d=n[1]-n[0],b=BigInt(e),P=d/b-(d<0n&&d%b!==0n?1n:0n);return{pool:u,token0:w,token1:h,secondsAgo:e,blockNumber:i.toString(),tickCumulatives:n.map(String),secondsPerLiquidityCumulativeX128s:k.map(String),arithmeticMeanTick:P.toString(),summary:"V3 time-weighted arithmetic mean tick, rounded toward negative infinity. Price is token1-base-units per token0-base-unit before decimal adjustment. Insufficient pool history reverts; an unavailable oracle is never reported as zero."}}}]}}export{j as a};
@@ -0,0 +1 @@
1
+ import{d as p}from"./M7U3A4EH.js";import{e as a}from"./73N3TOJL.js";import{a as l}from"./5YS5V2LK.js";import{createHash as x}from"node:crypto";var c=32768,g="wormhole-x402@0.11.0/603aba277a626630d9b9463f713121dc4327325c";function w(s){if(!a(s)||Object.keys(s).length!==1||typeof s.text!="string")throw new l("Provide only text as a string for the local Wormhole scan.");let n=s.text,f=n.length>c||Buffer.byteLength(n,"utf8")>c,i={local:!0,scannerVersion:g,attribution:{provider:"Agent Wormhole",source:"https://github.com/runningoffcode/agent-wormhole"},limitation:"Evadable English instruction-shape rules. Allow is not proof of safety, intent, or coverage of unknown attacks."};if(f)return{...i,decision:"abstain",codes:[],findings:[],scannedPaths:[],charsScanned:0,inputHash:null,reason:"Text exceeds the 32768-byte local scan limit; no text was scanned or hashed."};let u=x("sha256").update(n,"utf8").digest("hex"),m={maxFieldChars:c,maxDecodeDepth:3,maxDepth:12},d=t=>{try{return p(t,m)}catch{return{decision:"abstain",findings:[],scanned:[],charsScanned:0}}},e=[{path:"text",verdict:d(n)}];try{let t=JSON.parse(n);(typeof t=="string"||a(t)||Array.isArray(t))&&e.push({path:"text.json",verdict:d(t)})}catch{}let r=e.flatMap(t=>t.verdict.findings.map(o=>({code:o.code,severity:o.severity,path:t.path,offset:o.offset}))),h=e.some(t=>t.verdict.decision==="refuse")?"refuse":e.some(t=>t.verdict.decision==="abstain")?"abstain":"allow";return{...i,decision:h,codes:[...new Set(r.map(t=>t.code))],findings:r.slice(0,64),findingsTruncated:r.length>64,scannedPaths:e.filter(t=>t.verdict.scanned.length).map(t=>t.path),charsScanned:e.reduce((t,o)=>t+o.verdict.charsScanned,0),inputHash:u,...h==="abstain"?{reason:"The local scanner could not cover all supplied text. Treat the result as unknown."}:{}}}export{c as a,g as b,w as c};
@@ -1 +1 @@
1
- import{b as B}from"./EA6IYKIB.js";import{a as te,d as ne,e as oe}from"./HQVC6X3T.js";import{d as re}from"./NMFVXBTL.js";import{b as T}from"./VJ3W2V3B.js";import{a as f,b as H,c as ee}from"./6IM6A5VA.js";import{c as z}from"./HIMVOTIU.js";import{a as o,d as q}from"./RETS2ZEK.js";import{a as x,i as $,w as U,x as y,y as Z,z as J}from"./XPFVT2EA.js";import{a as r}from"./5YS5V2LK.js";import{decodeFunctionData as R,encodeFunctionData as L,parseAbi as se}from"viem";var we=60,G=50,Qe=200;var Ae="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",W="0x0000000000000000000000000000000000000000",P=$[4663].routes.kyberswap.address,Q=$[4663].routes.velora.address,X=U[4663].kyberswap.toLowerCase(),ie=U[4663].velora.toLowerCase(),ge="0x0000000000000000000000000000000000000000000000000000000000000000",_=se(["function swap((address callTarget, address approveTarget, bytes targetData, (address srcToken, address dstToken, address[] srcReceivers, uint256[] srcAmounts, address[] feeReceivers, uint256[] feeAmounts, address dstReceiver, uint256 amount, uint256 minReturnAmount, uint256 flags, bytes permit) desc, bytes clientData) execution) payable returns (uint256 returnAmount, uint256 gasUsed)"]),N=se(["function swapExactAmountIn(address executor, (address srcToken, address destToken, uint256 fromAmount, uint256 toAmount, uint256 quotedAmount, bytes32 metadata, address beneficiary) swapData, uint256 partnerAndFee, bytes permit, bytes executorData) payable returns (uint256 receivedAmount, uint256 submittedAmount, uint256 augustusFeeAmount)"]),D=class extends r{name="NoRouteError";constructor(t="No swap route is available for this token pair and amount."){super(t)}},F=class extends r{name="ExpiredQuoteError";constructor(t="Quote has expired. Request a fresh quote."){super(t)}},ve=1e3,h=new Map;function ue(e){for(let[t,n]of h)BigInt(e)>=o(n.expiresAt)&&h.delete(t)}function K(e){return{...e,...e.sourcePoolRoute!==void 0?{sourcePoolRoute:structuredClone(e.sourcePoolRoute)}:{},...e.txs?{txs:e.txs.map(t=>({...t}))}:{}}}function ae(e){let t=K(e);return t.txs&&(t.txs.forEach(Object.freeze),Object.freeze(t.txs)),Object.freeze(t)}var Se=["router","from","to","wallet","amountIn","amountOut","minAmountOut","expiresAt","chainId","spender","value","ponsCurveToken","ponsPoolToken","blockNumber","calldataMinAmountOut","expectedSpend","expectedRefund"];function M(e,t,n=!1){for(let s of Se)if(!(s==="expiresAt"&&n&&o(e.expiresAt)<=o(t.expiresAt))&&e[s]!==void 0&&String(e[s]).toLowerCase()!==String(t[s]).toLowerCase())throw new r(`Quote ${s} does not match the accepted quote.`)}function V(e=Date.now){let t=e();if(!Number.isFinite(t)||t<0)throw new r("Clock must return a non-negative timestamp.");return t>1e11?Math.floor(t/1e3):Math.floor(t)}function C(e){let t=e.toLowerCase();return t===Ae.toLowerCase()||t===W.toLowerCase()}function he(e,t=G){if(!Number.isInteger(t)||t<0||t>=1e4)throw new r("Slippage must be an integer from 0 to 9999 bps.");return q(e,String(1e4-t),"10000","floor")}var be=200;function _e(e){if(typeof e!="number"||!Number.isFinite(e)||!/^\d+(?:\.\d{1,2})?$/.test(String(e)))throw new r("Velora returned an unsupported venue fee. Request a fresh quote.");let[t,n=""]=String(e).split("."),s=Number(t)*100+Number(n.padEnd(2,"0"));return Y(s),s}function Y(e){if(!Number.isInteger(e)||e<0||e>be)throw new r("Velora returned an unsupported venue fee. Request a fresh quote.")}function de(e,t=1){return Y(t),o(e)*10000n/BigInt(1e4-t)+1n}function Oe(e,t){Y(t);let n=e>>96n,s=Z>>96n,a=0x3fffn,d=1n<<92n,l=e&(1n<<96n)-1n;if(n!==s&&!(n===0n&&t===0)||(l&a)!==BigInt(t)||(l&~(d|a))!==0n)throw new r("Velora partnerAndFee must match the accepted venue fee and recipient.")}function ce(e){if(e.oakFee!==void 0&&o(e.oakFee)!==0n)throw new r("Oak charges 0 swap fee; venue fees must never be counted as Oak income.");let t=e.provider??"venue";return`Venue fee: ${e.venueFee} base units (${e.venueFeeBps} bps) retained by ${t}; Oak swap fee: 0 (venue fee is never Oak income).`}function xe(e){f(e.from),f(e.to),f(e.wallet);let t=e.callTarget??y[x].kyberswap.address,n=e.approveTarget??W;f(t),f(n);let s=o(e.amountIn),a=o(e.minAmountOut);return L({abi:_,functionName:"swap",args:[{callTarget:t,approveTarget:n,targetData:e.targetData??"0x",desc:{srcToken:e.from,dstToken:e.to,srcReceivers:C(e.from)?[]:[t],srcAmounts:C(e.from)?[]:[s],feeReceivers:[],feeAmounts:[],dstReceiver:e.wallet,amount:s,minReturnAmount:a,flags:0n,permit:"0x"},clientData:e.clientData??"0x"}]})}function Ie(e){f(e.from),f(e.to),f(e.wallet);let t=e.executor??y[x].velora.address;return f(t),L({abi:N,functionName:"swapExactAmountIn",args:[t,{srcToken:e.from,destToken:e.to,fromAmount:o(e.amountIn),toAmount:o(e.minAmountOut),quotedAmount:o(e.amountOut),metadata:e.metadata??ge,beneficiary:e.wallet},e.partnerAndFee??0n,"0x",e.executorData??"0x"]})}function De(e){if(typeof e!="string"||!/^0x([0-9a-fA-F]{2})+$/.test(e)||e.length<10)throw new r("Swap calldata must contain a 4-byte function selector.");let t=e.slice(0,10).toLowerCase();if(t===X)return R({abi:_,data:e}).args[0].desc.minReturnAmount;if(t===ie)return R({abi:N,data:e}).args[1].toAmount;if(t==="0x3593564c")return ne(e).swap.amountOutMinimum;let n=R({abi:te,data:e});if(n.functionName==="buy"||n.functionName==="sell")return n.args[1];throw new r(`Unsupported swap router selector ${t}.`)}function le(e,t,n=!1){let s=o(t),a=De(e);if(a<=0n||s<=0n||a!==s&&!(n&&(a>s||e.slice(0,10).toLowerCase()===X&&a+1n===s)))throw new r(`Built swap calldata minimum output (${a}) does not match the accepted quote minimum (${s}).`);return a}function me(e,t){let{from:n,to:s,wallet:a,amountIn:d}=t;if(!n||!s||!a||d===void 0)throw new r("Accepted quote must include input, output, amount and wallet.");for(let u of[n,s,a,t.router,e.to])f(u);let l=(u,p,A)=>{if(u.toLowerCase()!==p.toLowerCase())throw new r(`Built swap ${A} does not match the accepted quote.`)};if(l(e.to,t.router,"router"),e.chainId!==(t.chainId??x))throw new r("Built swap chain does not match the accepted quote.");let g=C(n)?o(d):0n;if(o(e.value)!==g||t.value!==void 0&&o(t.value)!==g)throw new r("Built swap value does not match the accepted quote input.");let w=e.data.slice(0,10).toLowerCase(),i=t.router.toLowerCase(),c;if(i===P.toLowerCase()&&w===X){l(t.spender??t.router,P,"spender");let u=R({abi:_,data:e.data});if(L({abi:_,...u}).toLowerCase()!==e.data.toLowerCase())throw new r("KyberSwap calldata must be canonically decodable.");let{callTarget:p,approveTarget:A,desc:m}=u.args[0];l(p,y[x].kyberswap.address,"executor"),l(A,W,"executor approval target");let b=C(n);if(m.srcReceivers.length!==m.srcAmounts.length||(b?m.srcReceivers.length!==0:m.srcReceivers.length===0||m.srcAmounts.some(v=>v<=0n)||m.srcAmounts.reduce((v,S)=>v+S,0n)!==o(d)))throw new r("KyberSwap source transfers must send the exact input to the pinned executor or verified input pool.");for(let v of m.srcReceivers)if(v.toLowerCase()!==p.toLowerCase()&&!re(n,v,e.data))throw new r(`KyberSwap source transfers: receiver ${v} is not a verified input pool or the pinned executor.`);if(m.feeReceivers.length||m.feeAmounts.length||m.flags!==0n&&m.flags!==512n||m.permit!=="0x")throw new r("KyberSwap fee recipients, fee amounts, flags and permit must match the pinned zero-fee policy.");c={from:m.srcToken,to:m.dstToken,wallet:m.dstReceiver,amount:m.amount}}else if(i===Q.toLowerCase()&&w===ie){l(t.spender??t.router,Q,"spender");let u=R({abi:N,data:e.data});if(L({abi:N,...u}).toLowerCase()!==e.data.toLowerCase())throw new r("Velora calldata must be canonically decodable.");let[p,A,m,b]=u.args;if(!J.some(v=>v.toLowerCase()===p.toLowerCase()))throw new r("Built swap executor does not match the accepted quote.");if(b!=="0x")throw new r("Velora permit must match the pinned empty-permit policy.");if((t.calldataMinAmountOut!==void 0||m!==0n)&&Oe(m,t.venueFeeBps??0),t.calldataMinAmountOut!==void 0&&o(t.calldataMinAmountOut)!==de(t.minAmountOut,t.venueFeeBps??1))throw new r("Velora calldata minimum must cover the accepted net output, venue fee and router dust.");if(t.calldataMinAmountOut!==void 0&&(A.quotedAmount!==o(t.grossAmountOut??"0")||A.quotedAmount<o(t.calldataMinAmountOut)))throw new r("Velora quoted gross output must match the accepted quote and cover its calldata minimum.");if(m!==0n&&t.calldataMinAmountOut===void 0)throw new r("Velora venue fee requires a fee-adjusted calldata minimum.");c={from:A.srcToken,to:A.destToken,wallet:A.beneficiary,amount:A.fromAmount}}else if(t.provider==="pons"&&(t.ponsPoolToken||t.ponsCurveToken))c=oe(e,{...t,from:n,to:s,wallet:a});else throw new r("Built swap selector does not match the accepted router.");if(l(c.from,n,"input token"),l(c.to,s,"output token"),l(c.wallet,a,"recipient"),c.amount!==o(d))throw new r("Built swap input amount does not match the accepted quote.");le(e.data,t.calldataMinAmountOut??t.minAmountOut,i===P.toLowerCase())}function j(e,t={}){if(!e||typeof e.quoteId!="string"||!e.quoteId.trim())throw new r("Quote must include a non-empty quoteId.");if(f(e.router),e.oakFee!==void 0&&o(e.oakFee)!==0n)throw new r("Oak charges 0 swap fee; venue fees must never be counted as Oak income.");let n=o(e.amountOut),s=e.destAmountAfterFee??e.netAmountOut,a,d,l;if(s!==void 0){if(d=o(s),a=e.grossAmountOut!==void 0?o(e.grossAmountOut):n>=d?n:d,a<d)throw new r("Gross output cannot be less than net output.");l=e.venueFee!==void 0?o(e.venueFee):a-d}else if(e.grossAmountOut!==void 0){if(a=o(e.grossAmountOut),d=n,a<d)throw new r("Gross output cannot be less than net output.");l=e.venueFee!==void 0?o(e.venueFee):a-d}else e.venueFee!==void 0?(l=o(e.venueFee),d=n,a=d+l):(d=n,a=n,l=0n);if(d<=0n)throw new D("Quote output amount must be positive.");let g=t.slippageBps??e.slippageBps??G,w=e.minAmountOut!==void 0?o(e.minAmountOut):o(he(d.toString(),g));if(w<=0n||w>a)throw new r("Quote minAmountOut must be positive and not exceed gross output.");if((t.provider??e.provider)==="velora"&&e.calldataMinAmountOut!==void 0){if(o(e.calldataMinAmountOut)!==de(w.toString(),e.venueFeeBps??1)||o(e.calldataMinAmountOut)>a)throw new r("Velora calldata minimum must cover the accepted net output, venue fee and router dust.")}else if(e.calldataMinAmountOut!==void 0||e.ponsCurveToken!==void 0){if((t.provider??e.provider)!=="pons"||!e.ponsCurveToken)throw new r("Curve minimum requires a Pons curve quote.");f(e.ponsCurveToken);let O=o(t.amountIn??e.amountIn??"0"),I=o(e.expectedSpend??"0"),pe=o(e.expectedRefund??"0"),fe=o(e.calldataMinAmountOut??"0");if(O<=0n||I<=0n||I+pe!==O||fe*I/O!==w)throw new r("Pons actual minimum and refund do not match the encoded minimum.")}let i=V(t.now),c=BigInt(i+we),u=e.expiresAt!==void 0?o(e.expiresAt):c,p=(u>c?c:u).toString(),A=l.toString(),m=e.venueFeeBps??(a>0n&&l>0n?Number((l*10000n+a/2n)/a):0),b=t.provider??e.provider??(e.router.toLowerCase()===Q.toLowerCase()?"velora":"kyberswap"),v=b==="pons"&&e.feeDisclosure?e.feeDisclosure:ce({provider:b,venueFee:A,venueFeeBps:m,oakFee:"0"}),S={...e,quoteId:e.quoteId,amountOut:d.toString(),minAmountOut:w.toString(),router:e.router,expiresAt:p,provider:b,grossAmountOut:a.toString(),destAmountAfterFee:d.toString(),netAmountOut:d.toString(),venueFee:A,venueFeeBps:m,oakFee:"0",feeDisclosure:v,...t.from??e.from?{from:T(t.from??e.from)}:{},...t.to??e.to?{to:T(t.to??e.to)}:{},...t.amountIn??e.amountIn?{amountIn:t.amountIn??e.amountIn}:{},...t.wallet??e.wallet?{wallet:t.wallet??e.wallet}:{},slippageBps:g,chainId:t.chainId??e.chainId??x,spender:e.spender??e.router,...t.allowance??e.allowance?{allowance:t.allowance??e.allowance}:{}};if(BigInt(i)>=o(p))throw new F;if(t.cache===!1)return S;if(ue(i),BigInt(i)>=o(p))throw new F;let k=h.get(S.quoteId);if(k){M(S,k,!0);let O=ae({...k,expiresAt:S.expiresAt});return h.set(O.quoteId,O),K(O)}for(;h.size>=ve;)h.delete(h.keys().next().value);let E=ae(S);return h.set(E.quoteId,E),K(E)}async function Ne(e,t,n={}){e={...e},f(e.from),f(e.to),f(e.wallet),e.from=T(e.from),e.to=T(e.to);let s=o(e.amountIn);if(s<=0n)throw new r("Swap amountIn must be greater than zero.");let a=e.slippageBps??G;if(!Number.isInteger(a)||a<0||a>=1e4)throw new r("Slippage must be an integer from 0 to 9999 bps.");if(!Array.isArray(t)||t.length===0)throw new D;let d={from:e.from,to:e.to,amountIn:s.toString(),slippageBps:a},l=await Promise.allSettled(t.map(async i=>{let c=await(i.quotePrices??i.quote).call(i,{...d},e.wallet);return{quote:j(c,{provider:i.name,from:e.from,to:e.to,amountIn:s.toString(),wallet:e.wallet,slippageBps:a,chainId:e.chainId??x,allowance:e.allowance,now:e.now,cache:!1}),provider:i}})),g,w=[];for(let i of l)i.status==="rejected"&&(g??=z(i.reason)),i.status==="fulfilled"&&o(i.value.quote.expiresAt)>BigInt(V(e.now))&&w.push(i.value);if(w.length===0){let i=l.some(c=>c.status==="rejected"&&c.reason instanceof Error&&c.reason.message===B)&&l.every(c=>c.status==="rejected"&&(c.reason instanceof D||c.reason instanceof Error&&c.reason.message===B));throw g??new D(i?B:void 0)}w.sort((i,c)=>{let p=o(c.quote.amountOut)-o(i.quote.amountOut)||o(c.quote.minAmountOut)-o(i.quote.minAmountOut);return p>0n?1:p<0n?-1:0});for(let{quote:i,provider:c}of w)try{if(BigInt(V(e.now))>=o(i.expiresAt))continue;if(n.deferBuild||!c.prepareQuote)return j(i,{now:e.now});let u=await c.prepareQuote(i.quoteId,e.wallet);if(u.quoteId!==i.quoteId)throw new r("Prepared quote ID does not match the selected route.");if(M(u,i,!0),!u.data)throw new r("Selected route did not return swap calldata.");let p={...i,expiresAt:u.expiresAt,data:u.data,value:u.value,allowance:u.allowance??i.allowance};return me(H({to:p.router,data:u.data,value:u.value??"0",chainId:p.chainId??x,description:"Selected swap route"}),p),j(p,{now:e.now})}catch(u){g??=z(u);continue}throw g??new D}function Me(e,t={}){if(!e||typeof e.quoteId!="string"||!e.quoteId.trim())throw new r("Provide a valid quote to build a swap.");f(e.router);let n=h.get(e.quoteId),s=V(t.now);if(ue(s),!n||BigInt(s)>=o(n.expiresAt))throw h.delete(e.quoteId),new F;if(e.oakFee!==void 0&&o(e.oakFee)!==0n)throw new r("Oak charges 0 swap fee; venue fees must never be counted as Oak income.");M(e,n),M({...n,...t},n);let a=n.from,d=n.to,l=n.amountIn,g=n.wallet;if(!a||!d||!g||l===void 0)throw new r("Accepted quote must include input, output, amount and wallet.");let w=n.chainId??x,i=n.spender??n.router,c=t.allowance??e.allowance??n?.allowance??"0";f(a),f(d),f(g),f(i);let u=o(l);if(u<=0n)throw new r("Swap amountIn must be greater than zero.");let p=o(n.minAmountOut);if(p<=0n)throw new r("Swap minAmountOut must be greater than zero.");let A=e.router.toLowerCase()===Q.toLowerCase(),m=t.data??e.data??n?.data??(A?Ie({from:a,to:d,amountIn:u.toString(),amountOut:n.amountOut,minAmountOut:p.toString(),wallet:g}):xe({from:a,to:d,amountIn:u.toString(),minAmountOut:p.toString(),wallet:g}));le(m,n.calldataMinAmountOut??p.toString(),n.router.toLowerCase()===P.toLowerCase());let b=n.venueFee??"0",v=n.venueFeeBps??0,S=n.provider??(A?"velora":"kyberswap"),k=n.feeDisclosure??ce({provider:S,venueFee:b,venueFeeBps:v,oakFee:"0"}),E=C(a),O=t.value??e.value??n?.value??(E?u.toString():"0"),I=H({to:e.router,data:m,value:O,chainId:w,description:`Swap ${u} base units of ${a} for at least ${p} base units of ${d} via ${S} (${e.router}). ${k}`});return me(I,n),E||o(c)>=u?[I]:[ee(a,i,u.toString(),w),I]}export{we as a,G as b,Qe as c,Ae as d,W as e,_ as f,D as g,F as h,ve as i,K as j,ae as k,M as l,V as m,C as n,he as o,be as p,_e as q,de as r,Oe as s,ce as t,xe as u,Ie as v,De as w,le as x,me as y,j as z,Ne as A,Me as B};
1
+ import{b as B}from"./EA6IYKIB.js";import{a as te,d as ne,e as oe}from"./KSZMMNXK.js";import{d as re}from"./TNSKEHPC.js";import{b as T}from"./CY75R4FK.js";import{a as f,b as H,c as ee}from"./6IM6A5VA.js";import{c as z}from"./HIMVOTIU.js";import{a as o,d as q}from"./RETS2ZEK.js";import{a as x,i as $,w as U,x as y,y as Z,z as J}from"./G6HCV67X.js";import{a as r}from"./5YS5V2LK.js";import{decodeFunctionData as R,encodeFunctionData as L,parseAbi as se}from"viem";var we=60,G=50,Qe=200;var Ae="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",W="0x0000000000000000000000000000000000000000",P=$[4663].routes.kyberswap.address,Q=$[4663].routes.velora.address,X=U[4663].kyberswap.toLowerCase(),ie=U[4663].velora.toLowerCase(),ge="0x0000000000000000000000000000000000000000000000000000000000000000",_=se(["function swap((address callTarget, address approveTarget, bytes targetData, (address srcToken, address dstToken, address[] srcReceivers, uint256[] srcAmounts, address[] feeReceivers, uint256[] feeAmounts, address dstReceiver, uint256 amount, uint256 minReturnAmount, uint256 flags, bytes permit) desc, bytes clientData) execution) payable returns (uint256 returnAmount, uint256 gasUsed)"]),N=se(["function swapExactAmountIn(address executor, (address srcToken, address destToken, uint256 fromAmount, uint256 toAmount, uint256 quotedAmount, bytes32 metadata, address beneficiary) swapData, uint256 partnerAndFee, bytes permit, bytes executorData) payable returns (uint256 receivedAmount, uint256 submittedAmount, uint256 augustusFeeAmount)"]),D=class extends r{name="NoRouteError";constructor(t="No swap route is available for this token pair and amount."){super(t)}},F=class extends r{name="ExpiredQuoteError";constructor(t="Quote has expired. Request a fresh quote."){super(t)}},ve=1e3,h=new Map;function ue(e){for(let[t,n]of h)BigInt(e)>=o(n.expiresAt)&&h.delete(t)}function K(e){return{...e,...e.sourcePoolRoute!==void 0?{sourcePoolRoute:structuredClone(e.sourcePoolRoute)}:{},...e.txs?{txs:e.txs.map(t=>({...t}))}:{}}}function ae(e){let t=K(e);return t.txs&&(t.txs.forEach(Object.freeze),Object.freeze(t.txs)),Object.freeze(t)}var Se=["router","from","to","wallet","amountIn","amountOut","minAmountOut","expiresAt","chainId","spender","value","ponsCurveToken","ponsPoolToken","blockNumber","calldataMinAmountOut","expectedSpend","expectedRefund"];function M(e,t,n=!1){for(let s of Se)if(!(s==="expiresAt"&&n&&o(e.expiresAt)<=o(t.expiresAt))&&e[s]!==void 0&&String(e[s]).toLowerCase()!==String(t[s]).toLowerCase())throw new r(`Quote ${s} does not match the accepted quote.`)}function V(e=Date.now){let t=e();if(!Number.isFinite(t)||t<0)throw new r("Clock must return a non-negative timestamp.");return t>1e11?Math.floor(t/1e3):Math.floor(t)}function C(e){let t=e.toLowerCase();return t===Ae.toLowerCase()||t===W.toLowerCase()}function he(e,t=G){if(!Number.isInteger(t)||t<0||t>=1e4)throw new r("Slippage must be an integer from 0 to 9999 bps.");return q(e,String(1e4-t),"10000","floor")}var be=200;function _e(e){if(typeof e!="number"||!Number.isFinite(e)||!/^\d+(?:\.\d{1,2})?$/.test(String(e)))throw new r("Velora returned an unsupported venue fee. Request a fresh quote.");let[t,n=""]=String(e).split("."),s=Number(t)*100+Number(n.padEnd(2,"0"));return Y(s),s}function Y(e){if(!Number.isInteger(e)||e<0||e>be)throw new r("Velora returned an unsupported venue fee. Request a fresh quote.")}function de(e,t=1){return Y(t),o(e)*10000n/BigInt(1e4-t)+1n}function Oe(e,t){Y(t);let n=e>>96n,s=Z>>96n,a=0x3fffn,d=1n<<92n,l=e&(1n<<96n)-1n;if(n!==s&&!(n===0n&&t===0)||(l&a)!==BigInt(t)||(l&~(d|a))!==0n)throw new r("Velora partnerAndFee must match the accepted venue fee and recipient.")}function ce(e){if(e.oakFee!==void 0&&o(e.oakFee)!==0n)throw new r("Oak charges 0 swap fee; venue fees must never be counted as Oak income.");let t=e.provider??"venue";return`Venue fee: ${e.venueFee} base units (${e.venueFeeBps} bps) retained by ${t}; Oak swap fee: 0 (venue fee is never Oak income).`}function xe(e){f(e.from),f(e.to),f(e.wallet);let t=e.callTarget??y[x].kyberswap.address,n=e.approveTarget??W;f(t),f(n);let s=o(e.amountIn),a=o(e.minAmountOut);return L({abi:_,functionName:"swap",args:[{callTarget:t,approveTarget:n,targetData:e.targetData??"0x",desc:{srcToken:e.from,dstToken:e.to,srcReceivers:C(e.from)?[]:[t],srcAmounts:C(e.from)?[]:[s],feeReceivers:[],feeAmounts:[],dstReceiver:e.wallet,amount:s,minReturnAmount:a,flags:0n,permit:"0x"},clientData:e.clientData??"0x"}]})}function Ie(e){f(e.from),f(e.to),f(e.wallet);let t=e.executor??y[x].velora.address;return f(t),L({abi:N,functionName:"swapExactAmountIn",args:[t,{srcToken:e.from,destToken:e.to,fromAmount:o(e.amountIn),toAmount:o(e.minAmountOut),quotedAmount:o(e.amountOut),metadata:e.metadata??ge,beneficiary:e.wallet},e.partnerAndFee??0n,"0x",e.executorData??"0x"]})}function De(e){if(typeof e!="string"||!/^0x([0-9a-fA-F]{2})+$/.test(e)||e.length<10)throw new r("Swap calldata must contain a 4-byte function selector.");let t=e.slice(0,10).toLowerCase();if(t===X)return R({abi:_,data:e}).args[0].desc.minReturnAmount;if(t===ie)return R({abi:N,data:e}).args[1].toAmount;if(t==="0x3593564c")return ne(e).swap.amountOutMinimum;let n=R({abi:te,data:e});if(n.functionName==="buy"||n.functionName==="sell")return n.args[1];throw new r(`Unsupported swap router selector ${t}.`)}function le(e,t,n=!1){let s=o(t),a=De(e);if(a<=0n||s<=0n||a!==s&&!(n&&(a>s||e.slice(0,10).toLowerCase()===X&&a+1n===s)))throw new r(`Built swap calldata minimum output (${a}) does not match the accepted quote minimum (${s}).`);return a}function me(e,t){let{from:n,to:s,wallet:a,amountIn:d}=t;if(!n||!s||!a||d===void 0)throw new r("Accepted quote must include input, output, amount and wallet.");for(let u of[n,s,a,t.router,e.to])f(u);let l=(u,p,A)=>{if(u.toLowerCase()!==p.toLowerCase())throw new r(`Built swap ${A} does not match the accepted quote.`)};if(l(e.to,t.router,"router"),e.chainId!==(t.chainId??x))throw new r("Built swap chain does not match the accepted quote.");let g=C(n)?o(d):0n;if(o(e.value)!==g||t.value!==void 0&&o(t.value)!==g)throw new r("Built swap value does not match the accepted quote input.");let w=e.data.slice(0,10).toLowerCase(),i=t.router.toLowerCase(),c;if(i===P.toLowerCase()&&w===X){l(t.spender??t.router,P,"spender");let u=R({abi:_,data:e.data});if(L({abi:_,...u}).toLowerCase()!==e.data.toLowerCase())throw new r("KyberSwap calldata must be canonically decodable.");let{callTarget:p,approveTarget:A,desc:m}=u.args[0];l(p,y[x].kyberswap.address,"executor"),l(A,W,"executor approval target");let b=C(n);if(m.srcReceivers.length!==m.srcAmounts.length||(b?m.srcReceivers.length!==0:m.srcReceivers.length===0||m.srcAmounts.some(v=>v<=0n)||m.srcAmounts.reduce((v,S)=>v+S,0n)!==o(d)))throw new r("KyberSwap source transfers must send the exact input to the pinned executor or verified input pool.");for(let v of m.srcReceivers)if(v.toLowerCase()!==p.toLowerCase()&&!re(n,v,e.data))throw new r(`KyberSwap source transfers: receiver ${v} is not a verified input pool or the pinned executor.`);if(m.feeReceivers.length||m.feeAmounts.length||m.flags!==0n&&m.flags!==512n||m.permit!=="0x")throw new r("KyberSwap fee recipients, fee amounts, flags and permit must match the pinned zero-fee policy.");c={from:m.srcToken,to:m.dstToken,wallet:m.dstReceiver,amount:m.amount}}else if(i===Q.toLowerCase()&&w===ie){l(t.spender??t.router,Q,"spender");let u=R({abi:N,data:e.data});if(L({abi:N,...u}).toLowerCase()!==e.data.toLowerCase())throw new r("Velora calldata must be canonically decodable.");let[p,A,m,b]=u.args;if(!J.some(v=>v.toLowerCase()===p.toLowerCase()))throw new r("Built swap executor does not match the accepted quote.");if(b!=="0x")throw new r("Velora permit must match the pinned empty-permit policy.");if((t.calldataMinAmountOut!==void 0||m!==0n)&&Oe(m,t.venueFeeBps??0),t.calldataMinAmountOut!==void 0&&o(t.calldataMinAmountOut)!==de(t.minAmountOut,t.venueFeeBps??1))throw new r("Velora calldata minimum must cover the accepted net output, venue fee and router dust.");if(t.calldataMinAmountOut!==void 0&&(A.quotedAmount!==o(t.grossAmountOut??"0")||A.quotedAmount<o(t.calldataMinAmountOut)))throw new r("Velora quoted gross output must match the accepted quote and cover its calldata minimum.");if(m!==0n&&t.calldataMinAmountOut===void 0)throw new r("Velora venue fee requires a fee-adjusted calldata minimum.");c={from:A.srcToken,to:A.destToken,wallet:A.beneficiary,amount:A.fromAmount}}else if(t.provider==="pons"&&(t.ponsPoolToken||t.ponsCurveToken))c=oe(e,{...t,from:n,to:s,wallet:a});else throw new r("Built swap selector does not match the accepted router.");if(l(c.from,n,"input token"),l(c.to,s,"output token"),l(c.wallet,a,"recipient"),c.amount!==o(d))throw new r("Built swap input amount does not match the accepted quote.");le(e.data,t.calldataMinAmountOut??t.minAmountOut,i===P.toLowerCase())}function j(e,t={}){if(!e||typeof e.quoteId!="string"||!e.quoteId.trim())throw new r("Quote must include a non-empty quoteId.");if(f(e.router),e.oakFee!==void 0&&o(e.oakFee)!==0n)throw new r("Oak charges 0 swap fee; venue fees must never be counted as Oak income.");let n=o(e.amountOut),s=e.destAmountAfterFee??e.netAmountOut,a,d,l;if(s!==void 0){if(d=o(s),a=e.grossAmountOut!==void 0?o(e.grossAmountOut):n>=d?n:d,a<d)throw new r("Gross output cannot be less than net output.");l=e.venueFee!==void 0?o(e.venueFee):a-d}else if(e.grossAmountOut!==void 0){if(a=o(e.grossAmountOut),d=n,a<d)throw new r("Gross output cannot be less than net output.");l=e.venueFee!==void 0?o(e.venueFee):a-d}else e.venueFee!==void 0?(l=o(e.venueFee),d=n,a=d+l):(d=n,a=n,l=0n);if(d<=0n)throw new D("Quote output amount must be positive.");let g=t.slippageBps??e.slippageBps??G,w=e.minAmountOut!==void 0?o(e.minAmountOut):o(he(d.toString(),g));if(w<=0n||w>a)throw new r("Quote minAmountOut must be positive and not exceed gross output.");if((t.provider??e.provider)==="velora"&&e.calldataMinAmountOut!==void 0){if(o(e.calldataMinAmountOut)!==de(w.toString(),e.venueFeeBps??1)||o(e.calldataMinAmountOut)>a)throw new r("Velora calldata minimum must cover the accepted net output, venue fee and router dust.")}else if(e.calldataMinAmountOut!==void 0||e.ponsCurveToken!==void 0){if((t.provider??e.provider)!=="pons"||!e.ponsCurveToken)throw new r("Curve minimum requires a Pons curve quote.");f(e.ponsCurveToken);let O=o(t.amountIn??e.amountIn??"0"),I=o(e.expectedSpend??"0"),pe=o(e.expectedRefund??"0"),fe=o(e.calldataMinAmountOut??"0");if(O<=0n||I<=0n||I+pe!==O||fe*I/O!==w)throw new r("Pons actual minimum and refund do not match the encoded minimum.")}let i=V(t.now),c=BigInt(i+we),u=e.expiresAt!==void 0?o(e.expiresAt):c,p=(u>c?c:u).toString(),A=l.toString(),m=e.venueFeeBps??(a>0n&&l>0n?Number((l*10000n+a/2n)/a):0),b=t.provider??e.provider??(e.router.toLowerCase()===Q.toLowerCase()?"velora":"kyberswap"),v=b==="pons"&&e.feeDisclosure?e.feeDisclosure:ce({provider:b,venueFee:A,venueFeeBps:m,oakFee:"0"}),S={...e,quoteId:e.quoteId,amountOut:d.toString(),minAmountOut:w.toString(),router:e.router,expiresAt:p,provider:b,grossAmountOut:a.toString(),destAmountAfterFee:d.toString(),netAmountOut:d.toString(),venueFee:A,venueFeeBps:m,oakFee:"0",feeDisclosure:v,...t.from??e.from?{from:T(t.from??e.from)}:{},...t.to??e.to?{to:T(t.to??e.to)}:{},...t.amountIn??e.amountIn?{amountIn:t.amountIn??e.amountIn}:{},...t.wallet??e.wallet?{wallet:t.wallet??e.wallet}:{},slippageBps:g,chainId:t.chainId??e.chainId??x,spender:e.spender??e.router,...t.allowance??e.allowance?{allowance:t.allowance??e.allowance}:{}};if(BigInt(i)>=o(p))throw new F;if(t.cache===!1)return S;if(ue(i),BigInt(i)>=o(p))throw new F;let k=h.get(S.quoteId);if(k){M(S,k,!0);let O=ae({...k,expiresAt:S.expiresAt});return h.set(O.quoteId,O),K(O)}for(;h.size>=ve;)h.delete(h.keys().next().value);let E=ae(S);return h.set(E.quoteId,E),K(E)}async function Ne(e,t,n={}){e={...e},f(e.from),f(e.to),f(e.wallet),e.from=T(e.from),e.to=T(e.to);let s=o(e.amountIn);if(s<=0n)throw new r("Swap amountIn must be greater than zero.");let a=e.slippageBps??G;if(!Number.isInteger(a)||a<0||a>=1e4)throw new r("Slippage must be an integer from 0 to 9999 bps.");if(!Array.isArray(t)||t.length===0)throw new D;let d={from:e.from,to:e.to,amountIn:s.toString(),slippageBps:a},l=await Promise.allSettled(t.map(async i=>{let c=await(i.quotePrices??i.quote).call(i,{...d},e.wallet);return{quote:j(c,{provider:i.name,from:e.from,to:e.to,amountIn:s.toString(),wallet:e.wallet,slippageBps:a,chainId:e.chainId??x,allowance:e.allowance,now:e.now,cache:!1}),provider:i}})),g,w=[];for(let i of l)i.status==="rejected"&&(g??=z(i.reason)),i.status==="fulfilled"&&o(i.value.quote.expiresAt)>BigInt(V(e.now))&&w.push(i.value);if(w.length===0){let i=l.some(c=>c.status==="rejected"&&c.reason instanceof Error&&c.reason.message===B)&&l.every(c=>c.status==="rejected"&&(c.reason instanceof D||c.reason instanceof Error&&c.reason.message===B));throw g??new D(i?B:void 0)}w.sort((i,c)=>{let p=o(c.quote.amountOut)-o(i.quote.amountOut)||o(c.quote.minAmountOut)-o(i.quote.minAmountOut);return p>0n?1:p<0n?-1:0});for(let{quote:i,provider:c}of w)try{if(BigInt(V(e.now))>=o(i.expiresAt))continue;if(n.deferBuild||!c.prepareQuote)return j(i,{now:e.now});let u=await c.prepareQuote(i.quoteId,e.wallet);if(u.quoteId!==i.quoteId)throw new r("Prepared quote ID does not match the selected route.");if(M(u,i,!0),!u.data)throw new r("Selected route did not return swap calldata.");let p={...i,expiresAt:u.expiresAt,data:u.data,value:u.value,allowance:u.allowance??i.allowance};return me(H({to:p.router,data:u.data,value:u.value??"0",chainId:p.chainId??x,description:"Selected swap route"}),p),j(p,{now:e.now})}catch(u){g??=z(u);continue}throw g??new D}function Me(e,t={}){if(!e||typeof e.quoteId!="string"||!e.quoteId.trim())throw new r("Provide a valid quote to build a swap.");f(e.router);let n=h.get(e.quoteId),s=V(t.now);if(ue(s),!n||BigInt(s)>=o(n.expiresAt))throw h.delete(e.quoteId),new F;if(e.oakFee!==void 0&&o(e.oakFee)!==0n)throw new r("Oak charges 0 swap fee; venue fees must never be counted as Oak income.");M(e,n),M({...n,...t},n);let a=n.from,d=n.to,l=n.amountIn,g=n.wallet;if(!a||!d||!g||l===void 0)throw new r("Accepted quote must include input, output, amount and wallet.");let w=n.chainId??x,i=n.spender??n.router,c=t.allowance??e.allowance??n?.allowance??"0";f(a),f(d),f(g),f(i);let u=o(l);if(u<=0n)throw new r("Swap amountIn must be greater than zero.");let p=o(n.minAmountOut);if(p<=0n)throw new r("Swap minAmountOut must be greater than zero.");let A=e.router.toLowerCase()===Q.toLowerCase(),m=t.data??e.data??n?.data??(A?Ie({from:a,to:d,amountIn:u.toString(),amountOut:n.amountOut,minAmountOut:p.toString(),wallet:g}):xe({from:a,to:d,amountIn:u.toString(),minAmountOut:p.toString(),wallet:g}));le(m,n.calldataMinAmountOut??p.toString(),n.router.toLowerCase()===P.toLowerCase());let b=n.venueFee??"0",v=n.venueFeeBps??0,S=n.provider??(A?"velora":"kyberswap"),k=n.feeDisclosure??ce({provider:S,venueFee:b,venueFeeBps:v,oakFee:"0"}),E=C(a),O=t.value??e.value??n?.value??(E?u.toString():"0"),I=H({to:e.router,data:m,value:O,chainId:w,description:`Swap ${u} base units of ${a} for at least ${p} base units of ${d} via ${S} (${e.router}). ${k}`});return me(I,n),E||o(c)>=u?[I]:[ee(a,i,u.toString(),w),I]}export{we as a,G as b,Qe as c,Ae as d,W as e,_ as f,D as g,F as h,ve as i,K as j,ae as k,M as l,V as m,C as n,he as o,be as p,_e as q,de as r,Oe as s,ce as t,xe as u,Ie as v,De as w,le as x,me as y,j as z,Ne as A,Me as B};
@@ -0,0 +1 @@
1
+ import{b as s}from"./ACN2BFMA.js";import{a as p}from"./LT5P6PZW.js";import{a as u}from"./CY75R4FK.js";import{f as a}from"./73N3TOJL.js";import{a as r}from"./5YS5V2LK.js";import{erc20Abi as f,getAddress as i,parseAbi as g,zeroAddress as b}from"viem";var w={type:"string",pattern:"^(0|[1-9][0-9]*)$",maxLength:78},O={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},R={blockNumber:{...w,description:"Optional named chain-4663 block; defaults to the head captured once for this read."}},T=g(["function launchFee() view returns (uint256 fee,address treasury,uint256 pendingFee,address pendingTreasury,uint256 readyAt)"]),k=p;function B(e,n,t=[]){let o=a(e,"Provide the documented Hookr object.");if(Object.keys(o).some(d=>!n.includes(d))||t.some(d=>!Object.hasOwn(o,d)))throw new r("Provide exactly the documented Hookr fields; wallet overrides are not accepted.");return o}function l(e,n=256){if(typeof e!="string"||!/^(0|[1-9][0-9]*)$/.test(e)||e.length>78||BigInt(e)>=1n<<BigInt(n))throw new r(`Provide a decimal integer string within uint${n}.`);return BigInt(e)}function N(e){return e.blockNumber===void 0?void 0:l(e.blockNumber,64)}function S(e){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new r("Provide an exact bytes32 Hookr ID.");return e.toLowerCase()}function $(e){if(typeof e!="string"||!/^0x[0-9a-fA-F]{40}$/.test(e)||i(e)!==e)throw new r("Provide an EIP-55 checksummed address.");return i(e)}function y(e,n=256){if(typeof e!="bigint"&&(typeof e!="number"||!Number.isSafeInteger(e)))throw new r("Hookr integer read is incomplete. Retry the named-block read.");let t=BigInt(e);if(t<0n||t>=1n<<BigInt(n))throw new r("Hookr integer read is outside its ABI bounds.");return t}function E(e){if(typeof e!="boolean")throw new r("Hookr boolean read is incomplete.");return e}function j(e,n){if(!Array.isArray(e)||e.length!==n)throw new r("Hookr tuple read is incomplete.");return e}var C=e=>a(e,"Hookr struct read is incomplete.");function F(e){return JSON.parse(JSON.stringify(e,(n,t)=>typeof t=="bigint"||typeof t=="number"?String(t):t))}function V(e){return k[e].abi}function m(e,n,t,o,d,c){return e.readContract({address:n,abi:t,functionName:o,args:d,blockNumber:c})}var L=i(s.rootV1),_=i(s.registry),D=i(s.poolManager),J=i(s.agentGateV1);function K(e){if(e===i(s.rulesV1))return"rulesV1";if(e===i(s.rulesPrevious))return"rules";if(e===i(s.rulesLegacy))return"rulesLegacy";throw new r("Unknown Hookr core deployment. Review and pin it before reading this position.")}async function U(e,n,t){if(n===b)return{address:u,symbol:"ETH",decimals:18,chainId:4663};let[o,d]=await Promise.all([m(e,n,f,"symbol",[],t),m(e,n,f,"decimals",[],t)]),c=y(d,8);if(typeof o!="string"||o.length===0||new TextEncoder().encode(o).length>128)throw new r("Hookr token metadata is incomplete. Retry before valuing this currency.");return{address:n,symbol:o,decimals:Number(c),chainId:4663}}export{w as a,O as b,R as c,T as d,B as e,l as f,N as g,S as h,$ as i,y as j,E as k,j as l,C as m,F as n,V as o,m as p,L as q,_ as r,D as s,J as t,K as u,U as v};