@oakagentkit/core 0.2.4 → 0.2.5

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 (448) hide show
  1. package/build/dist/api/amounts.d.ts +2 -0
  2. package/build/dist/api/amounts.js +1 -1
  3. package/build/dist/api/args.js +1 -1
  4. package/build/dist/api/gas.js +1 -1
  5. package/build/dist/api/grandfather.js +1 -1
  6. package/build/dist/api/guards.js +1 -1
  7. package/build/dist/api/history.js +1 -1
  8. package/build/dist/api/http.js +1 -1
  9. package/build/dist/api/merkle.js +1 -1
  10. package/build/dist/api/module.js +1 -1
  11. package/build/dist/api/modules/beefy/boosts.js +1 -1
  12. package/build/dist/api/modules/beefy/clm.js +1 -1
  13. package/build/dist/api/modules/beefy/guard.js +1 -1
  14. package/build/dist/api/modules/beefy/index.js +1 -1
  15. package/build/dist/api/modules/beefy/liquidity.js +1 -1
  16. package/build/dist/api/modules/beefy/management.js +1 -1
  17. package/build/dist/api/modules/beefy/vaults.js +1 -1
  18. package/build/dist/api/modules/borro/abi.d.ts +149 -0
  19. package/build/dist/api/modules/borro/abi.js +1 -0
  20. package/build/dist/api/modules/borro/actions.d.ts +2 -0
  21. package/build/dist/api/modules/borro/actions.js +1 -0
  22. package/build/dist/api/modules/borro/checks.d.ts +151 -0
  23. package/build/dist/api/modules/borro/checks.js +1 -0
  24. package/build/dist/api/modules/borro/copy.d.ts +174 -0
  25. package/build/dist/api/modules/borro/copy.js +1 -0
  26. package/build/dist/api/modules/borro/index.d.ts +13 -0
  27. package/build/dist/api/modules/borro/index.js +1 -0
  28. package/build/dist/api/modules/borro/liquidity.d.ts +4 -0
  29. package/build/dist/api/modules/borro/liquidity.js +1 -0
  30. package/build/dist/api/modules/borro/pins.d.ts +264 -0
  31. package/build/dist/api/modules/borro/pins.js +1 -0
  32. package/build/dist/api/modules/borro/positions.d.ts +8 -0
  33. package/build/dist/api/modules/borro/positions.js +1 -0
  34. package/build/dist/api/modules/borro/rates.d.ts +20 -0
  35. package/build/dist/api/modules/borro/rates.js +1 -0
  36. package/build/dist/api/modules/borro/reader.d.ts +32 -0
  37. package/build/dist/api/modules/borro/reader.js +1 -0
  38. package/build/dist/api/modules/borro/types.d.ts +120 -0
  39. package/build/dist/api/modules/borro/types.js +0 -0
  40. package/build/dist/api/modules/clanker/extensions.js +1 -1
  41. package/build/dist/api/modules/clanker/index.js +1 -1
  42. package/build/dist/api/modules/clanker/manage.js +1 -1
  43. package/build/dist/api/modules/clanker/pool-config.js +1 -1
  44. package/build/dist/api/modules/clanker/protocol.js +1 -1
  45. package/build/dist/api/modules/clanker/state.js +1 -1
  46. package/build/dist/api/modules/earn/copy.d.ts +2 -2
  47. package/build/dist/api/modules/earn/copy.js +1 -1
  48. package/build/dist/api/modules/earn/index.js +1 -1
  49. package/build/dist/api/modules/earn/lp.js +1 -1
  50. package/build/dist/api/modules/earn/options.js +1 -1
  51. package/build/dist/api/modules/erc8004/common.js +1 -1
  52. package/build/dist/api/modules/erc8004/domain.js +1 -1
  53. package/build/dist/api/modules/erc8004/index.js +1 -1
  54. package/build/dist/api/modules/erc8004/management.js +1 -1
  55. package/build/dist/api/modules/erc8004/reputation.js +1 -1
  56. package/build/dist/api/modules/erc8004/services.js +1 -1
  57. package/build/dist/api/modules/erc8004/validation.js +1 -1
  58. package/build/dist/api/modules/grove/index.js +1 -1
  59. package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
  60. package/build/dist/api/modules/heyresearch/index.js +1 -1
  61. package/build/dist/api/modules/heyresearch/proof-reads.js +1 -1
  62. package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
  63. package/build/dist/api/modules/heyresearch/scan.js +1 -1
  64. package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
  65. package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
  66. package/build/dist/api/modules/hoodag/index.js +1 -1
  67. package/build/dist/api/modules/hoodag/management.js +1 -1
  68. package/build/dist/api/modules/hoodag/public-reads.js +1 -1
  69. package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
  70. package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
  71. package/build/dist/api/modules/hoodlock/commerce.js +1 -1
  72. package/build/dist/api/modules/hoodlock/fee.js +1 -1
  73. package/build/dist/api/modules/hoodlock/guard.js +1 -1
  74. package/build/dist/api/modules/hoodlock/index.js +1 -1
  75. package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
  76. package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
  77. package/build/dist/api/modules/hoodlock/public.js +1 -1
  78. package/build/dist/api/modules/hookr/actions.js +1 -1
  79. package/build/dist/api/modules/hookr/addons.js +1 -1
  80. package/build/dist/api/modules/hookr/agent-gate.js +1 -1
  81. package/build/dist/api/modules/hookr/contracts.js +1 -1
  82. package/build/dist/api/modules/hookr/create-cancel.js +1 -1
  83. package/build/dist/api/modules/hookr/discovery.js +1 -1
  84. package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
  85. package/build/dist/api/modules/hookr/index.js +1 -1
  86. package/build/dist/api/modules/hookr/launch-options.js +1 -1
  87. package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
  88. package/build/dist/api/modules/hookr/launch.js +1 -1
  89. package/build/dist/api/modules/hookr/liquidity.js +1 -1
  90. package/build/dist/api/modules/hookr/lp-positions.js +1 -1
  91. package/build/dist/api/modules/hookr/lp-reads.js +1 -1
  92. package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
  93. package/build/dist/api/modules/hookr/lp-state.js +1 -1
  94. package/build/dist/api/modules/hookr/public-reads.js +1 -1
  95. package/build/dist/api/modules/hookr/read-utils.js +1 -1
  96. package/build/dist/api/modules/hookr/relay.js +1 -1
  97. package/build/dist/api/modules/hookr/revenue.js +1 -1
  98. package/build/dist/api/modules/kyberswap/index.js +1 -1
  99. package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
  100. package/build/dist/api/modules/layerbank/actions.js +1 -1
  101. package/build/dist/api/modules/layerbank/checks.js +1 -1
  102. package/build/dist/api/modules/layerbank/index.js +1 -1
  103. package/build/dist/api/modules/layerbank/merkl.js +1 -1
  104. package/build/dist/api/modules/layerbank/reader.js +1 -1
  105. package/build/dist/api/modules/layerbank/reserve.js +1 -1
  106. package/build/dist/api/modules/lighter/index.js +1 -1
  107. package/build/dist/api/modules/longbow/administration.js +1 -1
  108. package/build/dist/api/modules/longbow/analytics.js +1 -1
  109. package/build/dist/api/modules/longbow/fixed.js +1 -1
  110. package/build/dist/api/modules/longbow/index.js +1 -1
  111. package/build/dist/api/modules/longbow/nft.js +1 -1
  112. package/build/dist/api/modules/longbow/rebates.js +1 -1
  113. package/build/dist/api/modules/longbow/staking.js +1 -1
  114. package/build/dist/api/modules/meridian/index.js +1 -1
  115. package/build/dist/api/modules/meridian/markets.js +1 -1
  116. package/build/dist/api/modules/meridian/perps-batch.js +1 -1
  117. package/build/dist/api/modules/meridian/perps-common.js +1 -1
  118. package/build/dist/api/modules/meridian/perps-guards.js +1 -1
  119. package/build/dist/api/modules/meridian/perps-intents.js +1 -1
  120. package/build/dist/api/modules/meridian/perps-stream.js +1 -1
  121. package/build/dist/api/modules/meridian/perps.d.ts +1 -0
  122. package/build/dist/api/modules/meridian/perps.js +1 -1
  123. package/build/dist/api/modules/meridian/predict-read.js +1 -1
  124. package/build/dist/api/modules/meridian/rfq.js +1 -1
  125. package/build/dist/api/modules/merkl/discovery.js +1 -1
  126. package/build/dist/api/modules/merkl/index.js +1 -1
  127. package/build/dist/api/modules/merkl/manage.js +1 -1
  128. package/build/dist/api/modules/merkl/protocol.js +1 -1
  129. package/build/dist/api/modules/morpho/allocator.js +1 -1
  130. package/build/dist/api/modules/morpho/bundles.js +1 -1
  131. package/build/dist/api/modules/morpho/in-kind.js +1 -1
  132. package/build/dist/api/modules/morpho/index.js +1 -1
  133. package/build/dist/api/modules/morpho/local-guard.js +1 -1
  134. package/build/dist/api/modules/morpho/midnight.js +1 -1
  135. package/build/dist/api/modules/morpho/protocol.js +1 -1
  136. package/build/dist/api/modules/morpho/vault-management.js +1 -1
  137. package/build/dist/api/modules/morpho/vault-tools.js +1 -1
  138. package/build/dist/api/modules/morpho/vault-v2.js +1 -1
  139. package/build/dist/api/modules/netnet/card-plan.js +1 -1
  140. package/build/dist/api/modules/netnet/card-read.js +1 -1
  141. package/build/dist/api/modules/netnet/card-recovery.js +1 -1
  142. package/build/dist/api/modules/netnet/desk-action.js +1 -1
  143. package/build/dist/api/modules/netnet/financial.js +1 -1
  144. package/build/dist/api/modules/netnet/index.js +1 -1
  145. package/build/dist/api/modules/netnet/staking.js +1 -1
  146. package/build/dist/api/modules/orbio/gateway.js +1 -1
  147. package/build/dist/api/modules/orbio/index.js +1 -1
  148. package/build/dist/api/modules/orbio/positions.js +1 -1
  149. package/build/dist/api/modules/pendle/convert.js +1 -1
  150. package/build/dist/api/modules/pendle/costs.js +1 -1
  151. package/build/dist/api/modules/pendle/index.js +1 -1
  152. package/build/dist/api/modules/pendle/markets.js +1 -1
  153. package/build/dist/api/modules/pendle/positions.js +1 -1
  154. package/build/dist/api/modules/pendle/pricecheck.js +1 -1
  155. package/build/dist/api/modules/pendle/reader.js +1 -1
  156. package/build/dist/api/modules/pendle/redeem.js +1 -1
  157. package/build/dist/api/modules/pendle/trade.js +1 -1
  158. package/build/dist/api/modules/pendle/types.d.ts +16 -1
  159. package/build/dist/api/modules/pendle/validate.js +1 -1
  160. package/build/dist/api/modules/pendle/verify.js +1 -1
  161. package/build/dist/api/modules/pons/claim.js +1 -1
  162. package/build/dist/api/modules/pons/holder-directory.js +1 -1
  163. package/build/dist/api/modules/pons/index.js +1 -1
  164. package/build/dist/api/modules/pons/launch-status.js +1 -1
  165. package/build/dist/api/modules/pons/prices.js +1 -1
  166. package/build/dist/api/modules/pons/reads.js +1 -1
  167. package/build/dist/api/modules/pons/swap-terms.js +1 -1
  168. package/build/dist/api/modules/pons/trade.js +1 -1
  169. package/build/dist/api/modules/poolstrade/index.js +1 -1
  170. package/build/dist/api/modules/priors/coverage.js +1 -1
  171. package/build/dist/api/modules/priors/discovery.js +1 -1
  172. package/build/dist/api/modules/priors/features.js +1 -1
  173. package/build/dist/api/modules/priors/holdings.js +1 -1
  174. package/build/dist/api/modules/priors/index.js +1 -1
  175. package/build/dist/api/modules/priors/integration.js +1 -1
  176. package/build/dist/api/modules/priors/market.js +1 -1
  177. package/build/dist/api/modules/priors/pt.js +1 -1
  178. package/build/dist/api/modules/priors/savings-exit.js +1 -1
  179. package/build/dist/api/modules/priors/starter-line.js +1 -1
  180. package/build/dist/api/modules/priors/stock-swap.js +1 -1
  181. package/build/dist/api/modules/relay/api.js +1 -1
  182. package/build/dist/api/modules/relay/bootstrap.js +1 -1
  183. package/build/dist/api/modules/relay/discovery.js +1 -1
  184. package/build/dist/api/modules/relay/inbound.d.ts +2 -0
  185. package/build/dist/api/modules/relay/inbound.js +1 -1
  186. package/build/dist/api/modules/relay/index.js +1 -1
  187. package/build/dist/api/modules/relay/order.js +1 -1
  188. package/build/dist/api/modules/relay/outbound-status.js +1 -1
  189. package/build/dist/api/modules/relay/readiness.js +1 -1
  190. package/build/dist/api/modules/relay/reads.js +1 -1
  191. package/build/dist/api/modules/relay/vaults.js +1 -1
  192. package/build/dist/api/modules/spark/actions.js +1 -1
  193. package/build/dist/api/modules/spark/details.js +1 -1
  194. package/build/dist/api/modules/spark/index.js +1 -1
  195. package/build/dist/api/modules/spark/management.js +1 -1
  196. package/build/dist/api/modules/steakhouse/analytics.js +1 -1
  197. package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
  198. package/build/dist/api/modules/steakhouse/index.js +1 -1
  199. package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
  200. package/build/dist/api/modules/steakhouse/management.js +1 -1
  201. package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
  202. package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
  203. package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
  204. package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
  205. package/build/dist/api/modules/tickerspring/guards.js +1 -1
  206. package/build/dist/api/modules/tickerspring/index.js +1 -1
  207. package/build/dist/api/modules/tickerspring/journeys.js +1 -1
  208. package/build/dist/api/modules/tickerspring/ladder.js +1 -1
  209. package/build/dist/api/modules/tickerspring/maker.js +1 -1
  210. package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
  211. package/build/dist/api/modules/tickerspring/research.js +1 -1
  212. package/build/dist/api/modules/tickerspring/strategies.js +1 -1
  213. package/build/dist/api/modules/uniswap/auction-create.js +1 -1
  214. package/build/dist/api/modules/uniswap/auction.js +1 -1
  215. package/build/dist/api/modules/uniswap/batch.js +1 -1
  216. package/build/dist/api/modules/uniswap/common.js +1 -1
  217. package/build/dist/api/modules/uniswap/fees.js +1 -1
  218. package/build/dist/api/modules/uniswap/index.js +1 -1
  219. package/build/dist/api/modules/uniswap/local-guard.js +1 -1
  220. package/build/dist/api/modules/uniswap/oracle.js +1 -1
  221. package/build/dist/api/modules/uniswap/pool-math.js +1 -1
  222. package/build/dist/api/modules/uniswap/pools.js +1 -1
  223. package/build/dist/api/modules/uniswap/position.js +1 -1
  224. package/build/dist/api/modules/uniswap/protocol.js +1 -1
  225. package/build/dist/api/modules/uniswap/token-jar.js +1 -1
  226. package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
  227. package/build/dist/api/modules/uniswap/trade.js +1 -1
  228. package/build/dist/api/modules/uniswap/v2.js +1 -1
  229. package/build/dist/api/modules/uniswap/v3.d.ts +11 -1
  230. package/build/dist/api/modules/uniswap/v3.js +1 -1
  231. package/build/dist/api/modules/uniswap/v4.js +1 -1
  232. package/build/dist/api/modules/uniswap/wrap.js +1 -1
  233. package/build/dist/api/modules/velora/claims.js +1 -1
  234. package/build/dist/api/modules/velora/delta-reads.js +1 -1
  235. package/build/dist/api/modules/velora/index.js +1 -1
  236. package/build/dist/api/modules/wormhole/index.js +1 -1
  237. package/build/dist/api/modules/wormhole/scan-text.js +1 -1
  238. package/build/dist/api/modules/wormhole/token-check.js +1 -1
  239. package/build/dist/api/positions.js +1 -1
  240. package/build/dist/api/pricenote.js +1 -1
  241. package/build/dist/api/prices.js +1 -1
  242. package/build/dist/api/pricing.js +1 -1
  243. package/build/dist/api/routes.js +1 -1
  244. package/build/dist/api/send.js +1 -1
  245. package/build/dist/api/signing-registry.js +1 -1
  246. package/build/dist/api/simulate.js +1 -1
  247. package/build/dist/api/swap.js +1 -1
  248. package/build/dist/api/tokens.d.ts +1 -0
  249. package/build/dist/api/tokens.js +1 -1
  250. package/build/dist/api/tool-policy.js +1 -1
  251. package/build/dist/api/tx.js +1 -1
  252. package/build/dist/api/vendor-limits.js +1 -1
  253. package/build/dist/chunks/{BAAXGB4K.js → 2KYAMXTS.js} +1 -1
  254. package/build/dist/chunks/{WVONJOWN.js → 2MAMJJJC.js} +1 -1
  255. package/build/dist/chunks/{MKAPRRKF.js → 2TK3ETUO.js} +1 -1
  256. package/build/dist/chunks/{CTMA4BTM.js → 326QMOTR.js} +1 -1
  257. package/build/dist/chunks/{ALRRW7SF.js → 3FUVMSCF.js} +1 -1
  258. package/build/dist/chunks/{YPM2UITD.js → 3GOHSYHW.js} +1 -1
  259. package/build/dist/chunks/{HTXKERNS.js → 3MLUCYCB.js} +1 -1
  260. package/build/dist/chunks/{GHPREYQK.js → 3NJ5KQ3Q.js} +1 -1
  261. package/build/dist/chunks/{WPFAEBE7.js → 3XNZUIRU.js} +1 -1
  262. package/build/dist/chunks/3XXBLNEX.js +1 -0
  263. package/build/dist/chunks/{PBQSJSZO.js → 43LI5NKJ.js} +1 -1
  264. package/build/dist/chunks/{NZXQWDGF.js → 45BRW2ZF.js} +1 -1
  265. package/build/dist/chunks/{QVYCJ6WV.js → 46KWRAYK.js} +1 -1
  266. package/build/dist/chunks/{UHRCM7AG.js → 4HG6FRVH.js} +1 -1
  267. package/build/dist/chunks/{TBCSZDAF.js → 4MXM6Q4W.js} +1 -1
  268. package/build/dist/chunks/{ZCOFMGPS.js → 4PY3UFNR.js} +1 -1
  269. package/build/dist/chunks/{WIVYKLQM.js → 52ELWNXJ.js} +1 -1
  270. package/build/dist/chunks/{F3BSEE52.js → 553UE2ZQ.js} +1 -1
  271. package/build/dist/chunks/{S2TAJHHK.js → 57MEFFCU.js} +1 -1
  272. package/build/dist/chunks/{ENX72ARB.js → 5APS4T2D.js} +1 -1
  273. package/build/dist/chunks/{UA4O226F.js → 5SMVQCAP.js} +1 -1
  274. package/build/dist/chunks/{6PY3IRDS.js → 64GOINYS.js} +1 -1
  275. package/build/dist/chunks/{5ZLOCQA4.js → 66F5ZH34.js} +1 -1
  276. package/build/dist/chunks/{HVM2EEXB.js → 6B3VVISQ.js} +1 -1
  277. package/build/dist/chunks/{E6RRXNV2.js → 6D5DJA5B.js} +1 -1
  278. package/build/dist/chunks/{XDZRO5JQ.js → 6I4NTKB2.js} +1 -1
  279. package/build/dist/chunks/{MFCPL6LF.js → 6OGDTEGH.js} +1 -1
  280. package/build/dist/chunks/6PBGEPUK.js +20 -0
  281. package/build/dist/chunks/{43CSMYDO.js → 6WD4HHID.js} +1 -1
  282. package/build/dist/chunks/{XJEOEMDS.js → 6WZX7C4T.js} +1 -1
  283. package/build/dist/chunks/{NA7R6J5N.js → 74Y2KDNR.js} +1 -1
  284. package/build/dist/chunks/{IKEJCBYU.js → 7WSHW7KW.js} +1 -1
  285. package/build/dist/chunks/{UPMGGK34.js → AFBEZXNV.js} +1 -1
  286. package/build/dist/chunks/{AUOXDNUO.js → AKYF5264.js} +1 -1
  287. package/build/dist/chunks/{BXHNYCH2.js → APGLZXIW.js} +1 -1
  288. package/build/dist/chunks/{7UOOIDR3.js → AVG4W3Y7.js} +1 -1
  289. package/build/dist/chunks/{Y7PRJOIK.js → B3RXD5ET.js} +1 -1
  290. package/build/dist/chunks/{JPNYUEQP.js → BBS3ODWZ.js} +1 -1
  291. package/build/dist/chunks/{I4TGMF2C.js → BJ2VGRF4.js} +1 -1
  292. package/build/dist/chunks/{WD37MEMZ.js → BTD5SMOW.js} +1 -1
  293. package/build/dist/chunks/{57JFKIMK.js → BTPXJAUX.js} +1 -1
  294. package/build/dist/chunks/{BIRMUW7Z.js → C36BFZH6.js} +1 -1
  295. package/build/dist/chunks/{ZGKVXFM5.js → C7AXJHBT.js} +1 -1
  296. package/build/dist/chunks/{5U7TCKX2.js → CBG5HARQ.js} +1 -1
  297. package/build/dist/chunks/{ET23SES4.js → CCTXCMH4.js} +1 -1
  298. package/build/dist/chunks/{5N4A5XAW.js → CHXBOXOD.js} +1 -1
  299. package/build/dist/chunks/D3YLXQPW.js +1 -0
  300. package/build/dist/chunks/{L7OQUHM5.js → DJN3JAWB.js} +1 -1
  301. package/build/dist/chunks/{CERNEJ2F.js → DW4V5PUY.js} +1 -1
  302. package/build/dist/chunks/E3RACZUY.js +1 -0
  303. package/build/dist/chunks/{TPL4U3AQ.js → E674J2MD.js} +1 -1
  304. package/build/dist/chunks/EE64JSLY.js +1 -0
  305. package/build/dist/chunks/EJ7O75A7.js +1 -0
  306. package/build/dist/chunks/{3AXVB23N.js → ELSXLZN5.js} +1 -1
  307. package/build/dist/chunks/{IQGY5FW7.js → ER47KGRM.js} +1 -1
  308. package/build/dist/chunks/FQ6UZCM6.js +1 -0
  309. package/build/dist/chunks/{WPAF55SP.js → GEIFITAQ.js} +1 -1
  310. package/build/dist/chunks/{4ALMYJJV.js → GGSAKCND.js} +1 -1
  311. package/build/dist/chunks/{EKNSLLJK.js → GL4NCUMH.js} +1 -1
  312. package/build/dist/chunks/GNC6RXLT.js +1 -0
  313. package/build/dist/chunks/{VVA72C6O.js → GQ5GYUEH.js} +1 -1
  314. package/build/dist/chunks/{6AAARNZ3.js → GW626GG2.js} +1 -1
  315. package/build/dist/chunks/{LROVANUR.js → H2XDMFQQ.js} +1 -1
  316. package/build/dist/chunks/H43RNCX2.js +1 -0
  317. package/build/dist/chunks/{VHLINDDS.js → HAQPIBYR.js} +1 -1
  318. package/build/dist/chunks/{ZE7EU2CS.js → HCUHMCBW.js} +1 -1
  319. package/build/dist/chunks/{64WKYWZV.js → HKEMQBFA.js} +1 -1
  320. package/build/dist/chunks/{4YFVAYKR.js → HM72DH4V.js} +1 -1
  321. package/build/dist/chunks/HSCQZ66A.js +1 -0
  322. package/build/dist/chunks/{QRC4ZPDA.js → I26DMNJG.js} +1 -1
  323. package/build/dist/chunks/{S3FPF537.js → IMO3GDA5.js} +1 -1
  324. package/build/dist/chunks/{ECWGKLBW.js → INOZIE55.js} +1 -1
  325. package/build/dist/chunks/{BQICZFLR.js → IOYRL6AY.js} +1 -1
  326. package/build/dist/chunks/IX3GZMTM.js +1 -0
  327. package/build/dist/chunks/IY7BXLT4.js +1 -0
  328. package/build/dist/chunks/{NYNJITCM.js → J2OT4KAH.js} +1 -1
  329. package/build/dist/chunks/{Y7RPSDD2.js → JKD2B6OX.js} +1 -1
  330. package/build/dist/chunks/{PSVOVZH7.js → JUZ5JU6D.js} +5 -5
  331. package/build/dist/chunks/{YEXUSRIZ.js → JVLLVNF2.js} +1 -1
  332. package/build/dist/chunks/{SSIENQVU.js → K3RDPI5J.js} +1 -1
  333. package/build/dist/chunks/{PADWZX7J.js → K4DHHQBI.js} +1 -1
  334. package/build/dist/chunks/KIFSRO5K.js +1 -0
  335. package/build/dist/chunks/{NB3LYS3G.js → KIFZ5ZSK.js} +1 -1
  336. package/build/dist/chunks/{QSN6Y2K6.js → KPCY5V35.js} +1 -1
  337. package/build/dist/chunks/{3ESNHZT5.js → L4N2RSK2.js} +1 -1
  338. package/build/dist/chunks/{EYFBVQ46.js → L5BLHY34.js} +1 -1
  339. package/build/dist/chunks/{E6UU7DL2.js → LSXUAHOE.js} +1 -1
  340. package/build/dist/chunks/{BNG2IWZL.js → M37654RL.js} +1 -1
  341. package/build/dist/chunks/{XFKVU46U.js → MJ6WEWMI.js} +1 -1
  342. package/build/dist/chunks/{47YN4OUI.js → MR5L7V6Z.js} +1 -1
  343. package/build/dist/chunks/{DVVFT42J.js → MRMR4QHA.js} +1 -1
  344. package/build/dist/chunks/{WWHCEMNB.js → N4Q6GN65.js} +1 -1
  345. package/build/dist/chunks/{S5WICHIS.js → NAZPDRIF.js} +1 -1
  346. package/build/dist/chunks/{MKBNLGDD.js → NDCLTVIU.js} +1 -1
  347. package/build/dist/chunks/{5WUKOQIJ.js → NEEZBJBC.js} +1 -1
  348. package/build/dist/chunks/{HSFOWJ3Z.js → NKZKKCK2.js} +1 -1
  349. package/build/dist/chunks/{5KUWLUPM.js → NWNYJ26T.js} +1 -1
  350. package/build/dist/chunks/{KBXU7U6Q.js → O7HCEPQY.js} +1 -1
  351. package/build/dist/chunks/{LDT3QTSY.js → OJ4WJUPP.js} +1 -1
  352. package/build/dist/chunks/{QJFXLYZG.js → OJPG45AC.js} +1 -1
  353. package/build/dist/chunks/{5MQ5KSSV.js → OKUO3BVM.js} +1 -1
  354. package/build/dist/chunks/OTXSKFUD.js +1 -0
  355. package/build/dist/chunks/{4TQQH7N6.js → P3S4BR5G.js} +1 -1
  356. package/build/dist/chunks/P56RZC2M.js +1 -0
  357. package/build/dist/chunks/{BK23XJXE.js → P5PYFK7L.js} +1 -1
  358. package/build/dist/chunks/{ZYH4B2GR.js → P7I62KFR.js} +1 -1
  359. package/build/dist/chunks/{SQL6HD5E.js → PK66GCDT.js} +1 -1
  360. package/build/dist/chunks/{6FTYNYGF.js → PSBQWDYI.js} +1 -1
  361. package/build/dist/chunks/{W76QC2AW.js → PV5FDT6O.js} +1 -1
  362. package/build/dist/chunks/{42DQTKEO.js → PXT5YTWU.js} +1 -1
  363. package/build/dist/chunks/{IMRXZ7JB.js → Q42YI3EP.js} +1 -1
  364. package/build/dist/chunks/{ZBFKKUNP.js → QA3UHEO3.js} +1 -1
  365. package/build/dist/chunks/QC3HH5UD.js +3 -0
  366. package/build/dist/chunks/{MQYOG66Q.js → QF52OIBS.js} +1 -1
  367. package/build/dist/chunks/{7WQEPZJY.js → QO3KCJMP.js} +1 -1
  368. package/build/dist/chunks/QQECG3WP.js +1 -0
  369. package/build/dist/chunks/QSHCBASA.js +1 -0
  370. package/build/dist/chunks/{RVO3QK2B.js → QU5XKRGK.js} +1 -1
  371. package/build/dist/chunks/{GVPX5XCL.js → QZZ4O34L.js} +1 -1
  372. package/build/dist/chunks/{A6YQ5H24.js → RQ4GHJXE.js} +1 -1
  373. package/build/dist/chunks/{3WXK2FUA.js → RUC7KH7A.js} +1 -1
  374. package/build/dist/chunks/{MBTARLZQ.js → RUX3RY7Y.js} +1 -1
  375. package/build/dist/chunks/{3VAJW6TQ.js → RVDUSNWW.js} +1 -1
  376. package/build/dist/chunks/{SDHPFXRM.js → S47VUTHM.js} +1 -1
  377. package/build/dist/chunks/{OTIXQZ3X.js → S7IFAQPG.js} +1 -1
  378. package/build/dist/chunks/{WMNRP3YH.js → SIYUNOLI.js} +1 -1
  379. package/build/dist/chunks/{TNKVRVTH.js → SJJR4ZBZ.js} +1 -1
  380. package/build/dist/chunks/{UFVPMWPJ.js → SMYWWIE6.js} +1 -1
  381. package/build/dist/chunks/{Z4SRGAVL.js → SPJCSEKP.js} +1 -1
  382. package/build/dist/chunks/{IQIWASRD.js → SSHCD6RZ.js} +1 -1
  383. package/build/dist/chunks/{SGEZIYJW.js → T2WHOZXM.js} +1 -1
  384. package/build/dist/chunks/{WOEKXQAH.js → T3AJSQYT.js} +1 -1
  385. package/build/dist/chunks/{SKMPKAZI.js → TAEZTP4L.js} +1 -1
  386. package/build/dist/chunks/{E3UBHTJO.js → TEJ7W534.js} +1 -1
  387. package/build/dist/chunks/{AWXJV2YH.js → TFDPEAVZ.js} +1 -1
  388. package/build/dist/chunks/{MGPHD4VV.js → TM2XCRU7.js} +1 -1
  389. package/build/dist/chunks/{UOGHQLQX.js → TMVO2DAK.js} +1 -1
  390. package/build/dist/chunks/{MXW2TP5P.js → TVWMTMEF.js} +1 -1
  391. package/build/dist/chunks/{GRIGSPD4.js → TX2EOIRS.js} +1 -1
  392. package/build/dist/chunks/{VV2HEIFI.js → U5PMVP56.js} +1 -1
  393. package/build/dist/chunks/{K72EYD6R.js → U67J4BCH.js} +1 -1
  394. package/build/dist/chunks/{MDDHG34Y.js → UHTRW2R6.js} +1 -1
  395. package/build/dist/chunks/{PQC5635W.js → UHVSINR5.js} +1 -1
  396. package/build/dist/chunks/{MOPETB64.js → UMIZMJWW.js} +1 -1
  397. package/build/dist/chunks/{F26FK47J.js → UNJJRQIU.js} +1 -1
  398. package/build/dist/chunks/V74F6IDY.js +1 -0
  399. package/build/dist/chunks/{MYFAKCQI.js → VEQBHI6O.js} +1 -1
  400. package/build/dist/chunks/VHV6WQ5F.js +1 -0
  401. package/build/dist/chunks/{EOQYLFXA.js → VJS4DHQQ.js} +1 -1
  402. package/build/dist/chunks/{AG67Z3SC.js → VOMGT5SG.js} +1 -1
  403. package/build/dist/chunks/{D6ZJPNK7.js → VY7XRHZQ.js} +1 -1
  404. package/build/dist/chunks/{W2OJ57ZO.js → VYAJXLND.js} +1 -1
  405. package/build/dist/chunks/{LVLVP5KQ.js → VYN2NRAP.js} +1 -1
  406. package/build/dist/chunks/{MDV7GECM.js → VYYSL557.js} +1 -1
  407. package/build/dist/chunks/{KA7BPBCV.js → W2BYU5JQ.js} +1 -1
  408. package/build/dist/chunks/W6BS3T7S.js +1 -0
  409. package/build/dist/chunks/WCNHZYQQ.js +1 -0
  410. package/build/dist/chunks/{ALPYEM7B.js → WDK6VOG4.js} +1 -1
  411. package/build/dist/chunks/{K22EXPWN.js → WIRBCS4W.js} +1 -1
  412. package/build/dist/chunks/{YRXT3HTW.js → WLMWWEP7.js} +1 -1
  413. package/build/dist/chunks/{NDW5DAFL.js → WP6RHXGN.js} +1 -1
  414. package/build/dist/chunks/{PLZKXQ76.js → WTXC3XKW.js} +1 -1
  415. package/build/dist/chunks/{WGL46F3S.js → WU7XIAXB.js} +1 -1
  416. package/build/dist/chunks/{5OKJEGBH.js → WV3A3OUU.js} +1 -1
  417. package/build/dist/chunks/{4ISR2U72.js → X2KFXCVD.js} +1 -1
  418. package/build/dist/chunks/{RPNAFUM5.js → X3BYCOWS.js} +1 -1
  419. package/build/dist/chunks/{6L5KTE6Y.js → X3PQMS4N.js} +1 -1
  420. package/build/dist/chunks/{RNC463IM.js → XBE3B6Y2.js} +1 -1
  421. package/build/dist/chunks/XLOYBLFI.js +1 -0
  422. package/build/dist/chunks/{2ZUP7ZEV.js → XR7VK24E.js} +1 -1
  423. package/build/dist/chunks/{ZSQOMSOC.js → Y25EXZCO.js} +1 -1
  424. package/build/dist/chunks/{TJWVY4VO.js → YCZPSMZ5.js} +1 -1
  425. package/build/dist/chunks/{JZXYLHI7.js → YDNTY67T.js} +1 -1
  426. package/build/dist/chunks/{2DUCTO5C.js → YN56C7PN.js} +1 -1
  427. package/build/dist/chunks/{G7XSFUDL.js → YWRDZQI6.js} +1 -1
  428. package/build/dist/chunks/{DP2NIYBP.js → YXTSWRV5.js} +1 -1
  429. package/build/dist/chunks/{I6KUORFT.js → Z43BTOTE.js} +1 -1
  430. package/build/dist/chunks/{PWH464CJ.js → Z4FZVJ5Z.js} +1 -1
  431. package/build/dist/chunks/{YAJYDD6C.js → ZMFRMWHR.js} +1 -1
  432. package/build/dist/chunks/{OFI3Y55L.js → ZQAFFWDK.js} +1 -1
  433. package/build/dist/chunks/{TBIVTEP5.js → ZSN4IRI5.js} +1 -1
  434. package/build/dist/chunks/{ZET37EIG.js → ZV5HIQXC.js} +1 -1
  435. package/package.json +1 -1
  436. package/build/dist/chunks/24CQ2SPB.js +0 -1
  437. package/build/dist/chunks/2OJAOVMG.js +0 -1
  438. package/build/dist/chunks/65EQECL3.js +0 -1
  439. package/build/dist/chunks/6YYCGUCU.js +0 -1
  440. package/build/dist/chunks/EU3OAJU2.js +0 -1
  441. package/build/dist/chunks/H4NYYJ3Z.js +0 -1
  442. package/build/dist/chunks/JG27HM4P.js +0 -1
  443. package/build/dist/chunks/L6D26AMO.js +0 -1
  444. package/build/dist/chunks/O6L4BJP4.js +0 -1
  445. package/build/dist/chunks/SUFA2GKR.js +0 -1
  446. package/build/dist/chunks/UP7FBDMJ.js +0 -1
  447. package/build/dist/chunks/YHRUAQQK.js +0 -1
  448. package/build/dist/chunks/ZCUXM52B.js +0 -1
@@ -1 +1 @@
1
- import{a as m,b as c,f as h,g as d,h as i,i as u}from"./W76QC2AW.js";import{c as T,e as a}from"./5KUWLUPM.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as y,parseAbiParameters as g,zeroAddress as B}from"viem";var C={type:"object",properties:{pairedToken:T,startingTick:{type:"integer",minimum:-887272,maximum:887272},tickSpacing:{type:"integer",minimum:1,maximum:32767},positions:{type:"array",minItems:1,maxItems:7,items:{type:"object",properties:{tickLower:{type:"integer"},tickUpper:{type:"integer"},bps:{type:"integer",minimum:1,maximum:1e4}},required:["tickLower","tickUpper","bps"],additionalProperties:!1}},dynamicFee:{type:"object",properties:{baseFeeBps:{type:"integer",minimum:25,maximum:1e3},maxFeeBps:{type:"integer",minimum:25,maximum:1e3},referenceTickFilterPeriod:c,resetPeriod:c,resetTickFilter:{type:"integer",minimum:-887272,maximum:887272},feeControlNumerator:c,decayFilterBps:{type:"integer",minimum:0,maximum:3e4}},required:["baseFeeBps","maxFeeBps","referenceTickFilterPeriod","resetPeriod","resetTickFilter","feeControlNumerator","decayFilterBps"],additionalProperties:!1}},additionalProperties:!1};function _(l){let r=l.pool??{};if(!a(r))throw new o("Provide pool configuration as an object.");u(r,["pairedToken","startingTick","tickSpacing","positions","dynamicFee"]);let x=h(r.pairedToken??m.paired_weth.address),b=i(r.startingTick??-230400,-887272,887272),f=i(r.tickSpacing??200,1,32767),n=r.positions??[{tickLower:-230400,tickUpper:-12e4,bps:1e4}];if(!Array.isArray(n)||!n.length||n.length>7)throw new o("Provide one to seven liquidity positions.");let p=n.map(e=>{if(!a(e))throw new o("Provide liquidity position objects.");u(e,["tickLower","tickUpper","bps"]);let t=i(e.tickLower,-887272,887272),s=i(e.tickUpper,-887272,887272);if(t>=s||t<b||t%f||s%f)throw new o("Liquidity ticks must ascend from the starting tick and be multiples of tick spacing.");return{lower:t,upper:s,bps:i(e.bps,1,1e4)}});if(p.reduce((e,t)=>e+t.bps,0)!==1e4)throw new o("Liquidity position allocations must total 10000 bps.");let k=i(l.feeBps??100,0,1e3)*100,F=m.fee_static_hook_v2.address,P=y(g("uint24,uint24"),[k,k]),w=`Static LP fee ${k/100} bps`;if(r.dynamicFee!==void 0){let e=r.dynamicFee;if(!a(e)||l.feeBps!==void 0)throw new o("Provide dynamic fee configuration without a static feeBps override.");u(e,["baseFeeBps","maxFeeBps","referenceTickFilterPeriod","resetPeriod","resetTickFilter","feeControlNumerator","decayFilterBps"]);let t=i(e.baseFeeBps,25,1e3),s=i(e.maxFeeBps,t,1e3);F=m.fee_dynamic_hook_v2.address,P=y(g("(uint24,uint24,uint256,uint256,int24,uint256,uint24)"),[[t*100,s*100,d(e.referenceTickFilterPeriod),d(e.resetPeriod),i(e.resetTickFilter,-887272,887272),d(e.feeControlNumerator),i(e.decayFilterBps,0,3e4)]]),w=`Dynamic LP fee ${t} to ${s} bps; parameters ${JSON.stringify(e)}`}return{feeSummary:w,poolConfig:{hook:F,pairedToken:x,tickIfToken0IsClanker:b,tickSpacing:f,poolData:y(g("(address,bytes,bytes)"),[[B,"0x",P]])},tickLower:p.map(e=>e.lower),tickUpper:p.map(e=>e.upper),positionBps:p.map(e=>e.bps)}}export{C as a,_ as b};
1
+ import{a as m,b as c,f as h,g as d,h as i,i as u}from"./PV5FDT6O.js";import{c as T,e as a}from"./NWNYJ26T.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as y,parseAbiParameters as g,zeroAddress as B}from"viem";var C={type:"object",properties:{pairedToken:T,startingTick:{type:"integer",minimum:-887272,maximum:887272},tickSpacing:{type:"integer",minimum:1,maximum:32767},positions:{type:"array",minItems:1,maxItems:7,items:{type:"object",properties:{tickLower:{type:"integer"},tickUpper:{type:"integer"},bps:{type:"integer",minimum:1,maximum:1e4}},required:["tickLower","tickUpper","bps"],additionalProperties:!1}},dynamicFee:{type:"object",properties:{baseFeeBps:{type:"integer",minimum:25,maximum:1e3},maxFeeBps:{type:"integer",minimum:25,maximum:1e3},referenceTickFilterPeriod:c,resetPeriod:c,resetTickFilter:{type:"integer",minimum:-887272,maximum:887272},feeControlNumerator:c,decayFilterBps:{type:"integer",minimum:0,maximum:3e4}},required:["baseFeeBps","maxFeeBps","referenceTickFilterPeriod","resetPeriod","resetTickFilter","feeControlNumerator","decayFilterBps"],additionalProperties:!1}},additionalProperties:!1};function _(l){let r=l.pool??{};if(!a(r))throw new o("Provide pool configuration as an object.");u(r,["pairedToken","startingTick","tickSpacing","positions","dynamicFee"]);let x=h(r.pairedToken??m.paired_weth.address),b=i(r.startingTick??-230400,-887272,887272),f=i(r.tickSpacing??200,1,32767),n=r.positions??[{tickLower:-230400,tickUpper:-12e4,bps:1e4}];if(!Array.isArray(n)||!n.length||n.length>7)throw new o("Provide one to seven liquidity positions.");let p=n.map(e=>{if(!a(e))throw new o("Provide liquidity position objects.");u(e,["tickLower","tickUpper","bps"]);let t=i(e.tickLower,-887272,887272),s=i(e.tickUpper,-887272,887272);if(t>=s||t<b||t%f||s%f)throw new o("Liquidity ticks must ascend from the starting tick and be multiples of tick spacing.");return{lower:t,upper:s,bps:i(e.bps,1,1e4)}});if(p.reduce((e,t)=>e+t.bps,0)!==1e4)throw new o("Liquidity position allocations must total 10000 bps.");let k=i(l.feeBps??100,0,1e3)*100,F=m.fee_static_hook_v2.address,P=y(g("uint24,uint24"),[k,k]),w=`Static LP fee ${k/100} bps`;if(r.dynamicFee!==void 0){let e=r.dynamicFee;if(!a(e)||l.feeBps!==void 0)throw new o("Provide dynamic fee configuration without a static feeBps override.");u(e,["baseFeeBps","maxFeeBps","referenceTickFilterPeriod","resetPeriod","resetTickFilter","feeControlNumerator","decayFilterBps"]);let t=i(e.baseFeeBps,25,1e3),s=i(e.maxFeeBps,t,1e3);F=m.fee_dynamic_hook_v2.address,P=y(g("(uint24,uint24,uint256,uint256,int24,uint256,uint24)"),[[t*100,s*100,d(e.referenceTickFilterPeriod),d(e.resetPeriod),i(e.resetTickFilter,-887272,887272),d(e.feeControlNumerator),i(e.decayFilterBps,0,3e4)]]),w=`Dynamic LP fee ${t} to ${s} bps; parameters ${JSON.stringify(e)}`}return{feeSummary:w,poolConfig:{hook:F,pairedToken:x,tickIfToken0IsClanker:b,tickSpacing:f,poolData:y(g("(address,bytes,bytes)"),[[B,"0x",P]])},tickLower:p.map(e=>e.lower),tickUpper:p.map(e=>e.upper),positionBps:p.map(e=>e.bps)}}export{C as a,_ as b};
@@ -0,0 +1 @@
1
+ import{c as t}from"./VYAJXLND.js";import{c as o}from"./P56RZC2M.js";function s(e,n,a){return t(e,n,a,o)}export{s as a};
@@ -1 +1 @@
1
- import{a as P}from"./UFVPMWPJ.js";import{a as y}from"./Y7RPSDD2.js";import{b as h,c as w,d as m}from"./2MZXTOZU.js";import{j as B}from"./S2TAJHHK.js";import{a as b}from"./PBQSJSZO.js";import{m as f,n as g}from"./5KUWLUPM.js";import{a as u}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{erc20Abi as L,formatUnits as R}from"viem";var A=70515n,U=250202n,C=568341n;function S(a,n){return{token:{...a},amount:n.toString()}}function v(a){if(a.network!==void 0&&a.network!=="mainnet")throw new o("LayerBank requires chain 4663.")}async function k(a,n,r,e){try{return f(await a.readContract({address:n.address,abi:L,functionName:"balanceOf",args:[r],blockNumber:e}),"LayerBank returned a malformed wallet balance read.")}catch(t){throw t instanceof o?t:new o("LayerBank wallet balance could not be read. Please try again.")}}async function T(a,n,r){try{let[e,t]=await Promise.all([n.getGasPrice(),B("ETH",{client:n,http:a.http,chainId:u,blockNumber:r})]),i=g(t.usdE18,"LayerBank gas reference is unavailable.",{positive:!0}),c=f(e,"LayerBank gas reference is unavailable.");if(c===0n)throw new o("LayerBank gas reference is unavailable.");let d=p=>Number(R(p*c*i/10n**18n,18)),s=d(A+U),l=d(C);if(![s,l].every(p=>Number.isFinite(p)&&p>0))throw new o("LayerBank gas reference is unavailable.");return{gasInUsd:s,gasOutUsd:l}}catch{throw new o("LayerBank gas costs could not be checked against a fresh ETH/USD reference. Please try again.")}}async function x(a,n){v(a),b(n);let r=a.clientFor(u),e=await y(r),[t,i,c,d]=await Promise.all([k(r,w,n,e.blockNumber),k(r,m,n,e.blockNumber),P(a.http),T(a,r,e.blockNumber)]),s=[...c.checks,"Gas costs use measured USDG calls plus 20% headroom; entry includes approval and supply."];e.active||s.push("LayerBank reserve is inactive."),e.frozen&&s.push("LayerBank reserve is frozen for deposits."),e.paused&&s.push("LayerBank reserve is paused."),e.capRoomBase===0n&&s.push("LayerBank supply cap has no room left.");let l={rateBasePct:e.rateBasePct,...c.bonus==="unavailable"?{}:{bonus:c.bonus},cashUsdgBase:e.cashUsdgBase,capRoomBase:e.capRoomBase,open:e.active&&!e.frozen&&!e.paused&&e.capRoomBase>0n,walletUsdgBase:t,walletReceiptBase:i,...d,checks:s};return{reserve:e,reading:l}}function H(a){return async n=>{try{return(await x(a,n)).reading}catch(r){return{rateBasePct:0,cashUsdgBase:0n,capRoomBase:0n,open:!1,walletUsdgBase:0n,walletReceiptBase:0n,gasInUsd:0,gasOutUsd:0,checks:[r instanceof o?a.plainError(r):"LayerBank could not be checked right now. Please try again."]}}}}async function z(a,n){v(a),b(n);let r=a.clientFor(u),e=await y(r),t=await k(r,m,n,e.blockNumber);if(t===0n)return[];let i=a.formatAmount(t.toString(),6);return[{module:"layerbank",id:`${u}:${h}`,chainId:u,assets:[S(m,t)],description:`${i} lRobUSDG = ${i} USDG; base supply rate ${e.rateBasePct}% a year, read now.`}]}export{A as a,U as b,C as c,S as d,v as e,k as f,x as g,H as h,z as i};
1
+ import{a as P}from"./SMYWWIE6.js";import{a as y}from"./JKD2B6OX.js";import{b as h,c as w,d as m}from"./2MZXTOZU.js";import{j as B}from"./57MEFFCU.js";import{a as b}from"./43LI5NKJ.js";import{m as f,n as g}from"./NWNYJ26T.js";import{a as u}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{erc20Abi as L,formatUnits as R}from"viem";var A=70515n,U=250202n,C=568341n;function S(a,n){return{token:{...a},amount:n.toString()}}function v(a){if(a.network!==void 0&&a.network!=="mainnet")throw new o("LayerBank requires chain 4663.")}async function k(a,n,r,e){try{return f(await a.readContract({address:n.address,abi:L,functionName:"balanceOf",args:[r],blockNumber:e}),"LayerBank returned a malformed wallet balance read.")}catch(t){throw t instanceof o?t:new o("LayerBank wallet balance could not be read. Please try again.")}}async function T(a,n,r){try{let[e,t]=await Promise.all([n.getGasPrice(),B("ETH",{client:n,http:a.http,chainId:u,blockNumber:r})]),i=g(t.usdE18,"LayerBank gas reference is unavailable.",{positive:!0}),c=f(e,"LayerBank gas reference is unavailable.");if(c===0n)throw new o("LayerBank gas reference is unavailable.");let d=p=>Number(R(p*c*i/10n**18n,18)),s=d(A+U),l=d(C);if(![s,l].every(p=>Number.isFinite(p)&&p>0))throw new o("LayerBank gas reference is unavailable.");return{gasInUsd:s,gasOutUsd:l}}catch{throw new o("LayerBank gas costs could not be checked against a fresh ETH/USD reference. Please try again.")}}async function x(a,n){v(a),b(n);let r=a.clientFor(u),e=await y(r),[t,i,c,d]=await Promise.all([k(r,w,n,e.blockNumber),k(r,m,n,e.blockNumber),P(a.http),T(a,r,e.blockNumber)]),s=[...c.checks,"Gas costs use measured USDG calls plus 20% headroom; entry includes approval and supply."];e.active||s.push("LayerBank reserve is inactive."),e.frozen&&s.push("LayerBank reserve is frozen for deposits."),e.paused&&s.push("LayerBank reserve is paused."),e.capRoomBase===0n&&s.push("LayerBank supply cap has no room left.");let l={rateBasePct:e.rateBasePct,...c.bonus==="unavailable"?{}:{bonus:c.bonus},cashUsdgBase:e.cashUsdgBase,capRoomBase:e.capRoomBase,open:e.active&&!e.frozen&&!e.paused&&e.capRoomBase>0n,walletUsdgBase:t,walletReceiptBase:i,...d,checks:s};return{reserve:e,reading:l}}function H(a){return async n=>{try{return(await x(a,n)).reading}catch(r){return{rateBasePct:0,cashUsdgBase:0n,capRoomBase:0n,open:!1,walletUsdgBase:0n,walletReceiptBase:0n,gasInUsd:0,gasOutUsd:0,checks:[r instanceof o?a.plainError(r):"LayerBank could not be checked right now. Please try again."]}}}}async function z(a,n){v(a),b(n);let r=a.clientFor(u),e=await y(r),t=await k(r,m,n,e.blockNumber);if(t===0n)return[];let i=a.formatAmount(t.toString(),6);return[{module:"layerbank",id:`${u}:${h}`,chainId:u,assets:[S(m,t)],description:`${i} lRobUSDG = ${i} USDG; base supply rate ${e.rateBasePct}% a year, read now.`}]}export{A as a,U as b,C as c,S as d,v as e,k as f,x as g,H as h,z as i};
@@ -1 +1 @@
1
- import{a as k,b as P,d as R,e as x,f as U,g as $}from"./SGEZIYJW.js";import{a as w}from"./5ZLOCQA4.js";import{c as y,g as D}from"./5KUWLUPM.js";import{a as f}from"./FWD4L3CJ.js";import{a as p}from"./XSD5NL7J.js";import{encodeFunctionData as O,erc20Abi as L,getAddress as E,parseAbi as I,zeroAddress as h}from"viem";var _=E("0x8bceaa40b9acdfaedf85adf4ff01f5ad6517937f"),g=E("0x89e5db8b5aa49aa85ac63f691524311aeb649eba"),F=I(["function getPair(address,address) view returns (address)"]),S=I(["function token0() view returns (address)","function token1() view returns (address)","function getReserves() view returns (uint112,uint112,uint32)","function totalSupply() view returns (uint256)","function balanceOf(address) view returns (uint256)"]),C=I(["function factory() view returns (address)","function addLiquidity(address tokenA,address tokenB,uint256 amountADesired,uint256 amountBDesired,uint256 amountAMin,uint256 amountBMin,address to,uint256 deadline) returns (uint256,uint256,uint256)","function removeLiquidity(address tokenA,address tokenB,uint256 liquidity,uint256 amountAMin,uint256 amountBMin,address to,uint256 deadline) returns (uint256,uint256)","function getAmountsOut(uint256 amountIn,address[] path) view returns (uint256[] amounts)","function getAmountsIn(uint256 amountOut,address[] path) view returns (uint256[] amounts)"]);async function z(s,c,t,n){if(c===h||t===h||c===t)throw new p("Provide two different ERC-20 tokens; use WETH for native ETH.");let o=s.clientFor(f),i=await o.getBlockNumber(),a=await o.readContract({address:_,abi:F,functionName:"getPair",args:[c,t],blockNumber:i}),[e,v]=await Promise.all([x(s,c,i),x(s,t,i)]);if(a===h)return{pair:a,tokenA:e,tokenB:v,reserveA:0n,reserveB:0n,supply:0n,balance:0n,blockNumber:i};let[M,l,A,B]=await Promise.all([o.readContract({address:a,abi:S,functionName:"token0",blockNumber:i}),o.readContract({address:a,abi:S,functionName:"getReserves",blockNumber:i}),o.readContract({address:a,abi:S,functionName:"totalSupply",blockNumber:i}),o.readContract({address:a,abi:L,functionName:"balanceOf",args:[n],blockNumber:i})]),[b,r]=D(M,c)?l:[l[1],l[0]];return{pair:a,tokenA:e,tokenB:v,reserveA:b,reserveB:r,supply:A,balance:B,blockNumber:i}}var H={tokenA:y,tokenB:y,amountADesired:w(),amountBDesired:w(),liquidity:{type:"string",pattern:"^(?:[0-9]+|all)$"},slippageBps:{type:"integer",minimum:0,maximum:9999},amountAMin:w(),amountBMin:w()};function J(s){let c=async(t,n,o)=>{$(n,t==="pool"?["tokenA","tokenB"]:["tokenA","tokenB","slippageBps","amountAMin","amountBMin",...t==="add"?["amountADesired","amountBDesired"]:["liquidity"]]);let i=P(n.tokenA),a=P(n.tokenB),e=await z(s,i,a,o);if(t==="pool")return{pair:e.pair,tokenA:e.tokenA,tokenB:e.tokenB,reserveA:e.reserveA.toString(),reserveB:e.reserveB.toString(),totalSupply:e.supply.toString(),balance:e.balance.toString(),blockNumber:e.blockNumber.toString(),initialized:e.pair!==h};let v=s.clientFor(f),M=R(n.slippageBps);if(!D(await v.readContract({address:g,abi:C,functionName:"factory"}),_))throw new p("Uniswap v2 router factory differs from its pinned deployment.");let l=(await v.getBlock()).timestamp+300n,A=[],B=(r,u,m)=>{let d=r===void 0?u*BigInt(1e4-M)/10000n:k(r,m,256,!0);if(d>u||u>0n&&d===0n)throw new p(`${m} must be positive and no more than the reserve-ratio estimate.`);return d},b;if(t==="add"){let r=k(n.amountADesired,"amountADesired"),u=k(n.amountBDesired,"amountBDesired");if(e.reserveA===0n!=(e.reserveB===0n))throw new p("Uniswap v2 pair reserves are inconsistent.");let m=r,d=u;if(e.reserveA>0n&&e.reserveB>0n){let T=r*e.reserveB/e.reserveA;T<=u?d=T:m=u*e.reserveA/e.reserveB}if(m===0n||d===0n)throw new p("Liquidity amounts round to zero at the pool reserve ratio.");let q=B(n.amountAMin,m,"amountAMin"),N=B(n.amountBMin,d,"amountBMin");A.push(s.approval(i,g,r.toString(),f),s.approval(a,g,u.toString(),f)),b=O({abi:C,functionName:"addLiquidity",args:[i,a,r,u,q,N,o,l]})}else{if(e.pair===h||e.supply===0n)throw new p("No Uniswap v2 liquidity exists for this pair.");let r=n.liquidity==="all"?e.balance:k(n.liquidity,"liquidity");if(r===0n||r>e.balance)throw new p("Removal exceeds the wallet LP token balance or is zero.");let[u,m]=await Promise.all([i,a].map(N=>v.readContract({address:N,abi:L,functionName:"balanceOf",args:[e.pair]}))),d=B(n.amountAMin,r*u/e.supply,"amountAMin"),q=B(n.amountBMin,r*m/e.supply,"amountBMin");A.push(s.approval(e.pair,g,r.toString(),f)),b=O({abi:C,functionName:"removeLiquidity",args:[i,a,r,d,q,o,l]})}return A.push(s.unsignedTx({to:g,data:b,value:"0",chainId:f,description:`${t} Uniswap v2 liquidity for ${i}/${a}; recipient ${o}; deadline ${l}.`})),U(s,A,o,`${t==="add"?"Add":"Remove"} v2 liquidity. Review exact approvals, token minimums and wallet recipient. The first deposit sets the price; v2 locks MINIMUM_LIQUIDITY permanently.`)};return{tools:["pool","add","remove"].map(t=>({name:`uniswap_v2_${t}`,inputSchema:{type:"object",additionalProperties:!1,required:["tokenA","tokenB",...t==="add"?["amountADesired","amountBDesired"]:t==="remove"?["liquidity"]:[]],properties:t==="pool"?{tokenA:y,tokenB:y}:H},execute:(n,o)=>c(t,n,o)}))}}export{_ as a,g as b,F as c,S as d,C as e,z as f,J as g};
1
+ import{a as k,b as P,d as R,e as x,f as U,g as $}from"./T2WHOZXM.js";import{a as w}from"./66F5ZH34.js";import{c as y,g as D}from"./NWNYJ26T.js";import{a as f}from"./FWD4L3CJ.js";import{a as p}from"./XSD5NL7J.js";import{encodeFunctionData as O,erc20Abi as L,getAddress as E,parseAbi as I,zeroAddress as h}from"viem";var _=E("0x8bceaa40b9acdfaedf85adf4ff01f5ad6517937f"),g=E("0x89e5db8b5aa49aa85ac63f691524311aeb649eba"),F=I(["function getPair(address,address) view returns (address)"]),S=I(["function token0() view returns (address)","function token1() view returns (address)","function getReserves() view returns (uint112,uint112,uint32)","function totalSupply() view returns (uint256)","function balanceOf(address) view returns (uint256)"]),C=I(["function factory() view returns (address)","function addLiquidity(address tokenA,address tokenB,uint256 amountADesired,uint256 amountBDesired,uint256 amountAMin,uint256 amountBMin,address to,uint256 deadline) returns (uint256,uint256,uint256)","function removeLiquidity(address tokenA,address tokenB,uint256 liquidity,uint256 amountAMin,uint256 amountBMin,address to,uint256 deadline) returns (uint256,uint256)","function getAmountsOut(uint256 amountIn,address[] path) view returns (uint256[] amounts)","function getAmountsIn(uint256 amountOut,address[] path) view returns (uint256[] amounts)"]);async function z(s,c,t,n){if(c===h||t===h||c===t)throw new p("Provide two different ERC-20 tokens; use WETH for native ETH.");let o=s.clientFor(f),i=await o.getBlockNumber(),a=await o.readContract({address:_,abi:F,functionName:"getPair",args:[c,t],blockNumber:i}),[e,v]=await Promise.all([x(s,c,i),x(s,t,i)]);if(a===h)return{pair:a,tokenA:e,tokenB:v,reserveA:0n,reserveB:0n,supply:0n,balance:0n,blockNumber:i};let[M,l,A,B]=await Promise.all([o.readContract({address:a,abi:S,functionName:"token0",blockNumber:i}),o.readContract({address:a,abi:S,functionName:"getReserves",blockNumber:i}),o.readContract({address:a,abi:S,functionName:"totalSupply",blockNumber:i}),o.readContract({address:a,abi:L,functionName:"balanceOf",args:[n],blockNumber:i})]),[b,r]=D(M,c)?l:[l[1],l[0]];return{pair:a,tokenA:e,tokenB:v,reserveA:b,reserveB:r,supply:A,balance:B,blockNumber:i}}var H={tokenA:y,tokenB:y,amountADesired:w(),amountBDesired:w(),liquidity:{type:"string",pattern:"^(?:[0-9]+|all)$"},slippageBps:{type:"integer",minimum:0,maximum:9999},amountAMin:w(),amountBMin:w()};function J(s){let c=async(t,n,o)=>{$(n,t==="pool"?["tokenA","tokenB"]:["tokenA","tokenB","slippageBps","amountAMin","amountBMin",...t==="add"?["amountADesired","amountBDesired"]:["liquidity"]]);let i=P(n.tokenA),a=P(n.tokenB),e=await z(s,i,a,o);if(t==="pool")return{pair:e.pair,tokenA:e.tokenA,tokenB:e.tokenB,reserveA:e.reserveA.toString(),reserveB:e.reserveB.toString(),totalSupply:e.supply.toString(),balance:e.balance.toString(),blockNumber:e.blockNumber.toString(),initialized:e.pair!==h};let v=s.clientFor(f),M=R(n.slippageBps);if(!D(await v.readContract({address:g,abi:C,functionName:"factory"}),_))throw new p("Uniswap v2 router factory differs from its pinned deployment.");let l=(await v.getBlock()).timestamp+300n,A=[],B=(r,u,m)=>{let d=r===void 0?u*BigInt(1e4-M)/10000n:k(r,m,256,!0);if(d>u||u>0n&&d===0n)throw new p(`${m} must be positive and no more than the reserve-ratio estimate.`);return d},b;if(t==="add"){let r=k(n.amountADesired,"amountADesired"),u=k(n.amountBDesired,"amountBDesired");if(e.reserveA===0n!=(e.reserveB===0n))throw new p("Uniswap v2 pair reserves are inconsistent.");let m=r,d=u;if(e.reserveA>0n&&e.reserveB>0n){let T=r*e.reserveB/e.reserveA;T<=u?d=T:m=u*e.reserveA/e.reserveB}if(m===0n||d===0n)throw new p("Liquidity amounts round to zero at the pool reserve ratio.");let q=B(n.amountAMin,m,"amountAMin"),N=B(n.amountBMin,d,"amountBMin");A.push(s.approval(i,g,r.toString(),f),s.approval(a,g,u.toString(),f)),b=O({abi:C,functionName:"addLiquidity",args:[i,a,r,u,q,N,o,l]})}else{if(e.pair===h||e.supply===0n)throw new p("No Uniswap v2 liquidity exists for this pair.");let r=n.liquidity==="all"?e.balance:k(n.liquidity,"liquidity");if(r===0n||r>e.balance)throw new p("Removal exceeds the wallet LP token balance or is zero.");let[u,m]=await Promise.all([i,a].map(N=>v.readContract({address:N,abi:L,functionName:"balanceOf",args:[e.pair]}))),d=B(n.amountAMin,r*u/e.supply,"amountAMin"),q=B(n.amountBMin,r*m/e.supply,"amountBMin");A.push(s.approval(e.pair,g,r.toString(),f)),b=O({abi:C,functionName:"removeLiquidity",args:[i,a,r,d,q,o,l]})}return A.push(s.unsignedTx({to:g,data:b,value:"0",chainId:f,description:`${t} Uniswap v2 liquidity for ${i}/${a}; recipient ${o}; deadline ${l}.`})),U(s,A,o,`${t==="add"?"Add":"Remove"} v2 liquidity. Review exact approvals, token minimums and wallet recipient. The first deposit sets the price; v2 locks MINIMUM_LIQUIDITY permanently.`)};return{tools:["pool","add","remove"].map(t=>({name:`uniswap_v2_${t}`,inputSchema:{type:"object",additionalProperties:!1,required:["tokenA","tokenB",...t==="add"?["amountADesired","amountBDesired"]:t==="remove"?["liquidity"]:[]],properties:t==="pool"?{tokenA:y,tokenB:y}:H},execute:(n,o)=>c(t,n,o)}))}}export{_ as a,g as b,F as c,S as d,C as e,z as f,J as g};
@@ -1 +1 @@
1
- import{a as E}from"./PBQSJSZO.js";import{c as N}from"./MYFAKCQI.js";import{c as C,e as u,g as I}from"./5KUWLUPM.js";import{a as m}from"./FWD4L3CJ.js";import{a as y}from"./XSD5NL7J.js";import{getAddress as k}from"viem";var D="https://api.velora.xyz/v2/delta",A=["PENDING","AWAITING_SIGNATURE","ACTIVE","SUSPENDED","CANCELLING","BRIDGING","COMPLETED","FAILED","EXPIRED","REFUNDING","CANCELLED","REFUNDED"],T=["Order","FillableOrder","ProductiveOrder","ExternalOrder","TWAPOrder","TWAPBuyOrder"],x="^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";function i(e){if(!e)throw new y("Velora Delta returned an unexpected response.")}function h(e){if(typeof e!="string")throw new y("Provide an address.");return E(e),k(e)}function O(e,p,o){if(e===void 0)return o;if(typeof e!="number"||!Number.isSafeInteger(e)||e<1||e>p)throw new y(`Provide an integer between 1 and ${p}.`);return e}function b(e,p){if(typeof e!="string"||!p.includes(e))throw new y(`Choose one of: ${p.join(", ")}.`);return e}function w(e){i(u(e)&&Number.isSafeInteger(e.chainId)&&Number(e.chainId)>0);let p=h(e.token);for(let o of["amount","expectedAmount","executedAmount"])i(e[o]===void 0||e[o]===null||typeof e[o]=="string"&&/^(0|[1-9][0-9]*)$/.test(e[o])&&BigInt(e[o])<1n<<256n);return i(typeof e.amount=="string"||typeof e.expectedAmount=="string"),{chainId:e.chainId,token:p,...Object.fromEntries(["amount","expectedAmount","executedAmount"].filter(o=>e[o]!==void 0).map(o=>[o,e[o]]))}}function P(e,p,o){i(u(e)&&typeof e.id=="string"&&new RegExp(x).test(e.id)),i(o===void 0||I(e.id,o));let l=h(e.owner);i(I(l,p)),i(typeof e.status=="string"&&A.includes(e.status)),i(e.side==="SELL"||e.side==="BUY"),i(e.type==="MARKET"||e.type==="LIMIT"),i(typeof e.onChainOrderType=="string"&&T.includes(e.onChainOrderType));let t=w(e.input);i(t.chainId===m);let a=w(e.output);i(typeof e.orderHash=="string"&&/^0x[0-9a-fA-F]{64}$/.test(e.orderHash)),i(Array.isArray(e.transactions)&&Array.isArray(e.refunds));for(let n of e.transactions){i(u(n)&&typeof n.originTx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(n.originTx)),i(n.destinationTx===void 0||n.destinationTx===null||typeof n.destinationTx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(n.destinationTx)),i(typeof n.filledPercent=="number"&&Number.isFinite(n.filledPercent)&&n.filledPercent>=0&&n.filledPercent<=100);for(let d of["spentAmount","receivedAmount"])i(n[d]===void 0||n[d]===null||typeof n[d]=="string"&&/^(0|[1-9][0-9]*)$/.test(n[d]))}let r=e.refunds.map(n=>(i(u(n)&&typeof n.tx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(n.tx)),{...w(n),tx:n.tx}));return{id:e.id,status:e.status,side:e.side,type:e.type,onChainOrderType:e.onChainOrderType,owner:l,beneficiary:h(e.beneficiary),orderHash:e.orderHash,input:t,output:a,transactions:structuredClone(e.transactions),refunds:r,...Object.fromEntries(["createdAt","updatedAt","expiresAt"].filter(n=>typeof e[n]=="string").map(n=>[n,e[n]]))}}function L(e){function p(t,a,r,n){return{name:t,inputSchema:{type:"object",additionalProperties:!1,properties:a,required:r},execute:async(d,s)=>{try{h(s);for(let c of Object.keys(d))if(!Object.hasOwn(a,c))throw new y(`Unsupported ${t} argument: ${c}.`);return await n(d,s)}catch(c){throw new y(e.plainError(c))}}}}let o=t=>N(e.http,`${D}/${t}`,{method:"GET"},u),l="Provider activity is not receipt proof. Token amounts are base units; resolve symbols and decimals with find_token. Delta signing and submission are not enabled in Oak.";return[p("velora_delta_token_support",{token:C},["token"],async t=>{let a=h(t.token),r=await o(`prices/is-token-supported?${new URLSearchParams({chainId:String(m),token:a})}`);return i(typeof r.supported=="boolean"),{token:a,chainId:m,supported:r.supported}}),p("velora_delta_orders",{page:{type:"integer",minimum:1},limit:{type:"integer",minimum:1,maximum:1e3},type:{type:"string",enum:["MARKET","LIMIT"]},status:{type:"array",minItems:1,maxItems:A.length,items:{type:"string",enum:A}},onChainOrderType:{type:"string",enum:T.filter(t=>t!=="FillableOrder")}},[],async(t,a)=>{let r=O(t.page,Number.MAX_SAFE_INTEGER,1),n=O(t.limit,1e3,100),d=new URLSearchParams({userAddress:a,chainId:String(m),page:String(r),limit:String(n)});if(t.type!==void 0&&d.set("type",b(t.type,["MARKET","LIMIT"])),t.onChainOrderType!==void 0&&d.set("onChainOrderType",b(t.onChainOrderType,T.filter(f=>f!=="FillableOrder"))),t.status!==void 0){if(!Array.isArray(t.status)||!t.status.length||t.status.length>A.length)throw new y("Provide a nonempty list of Delta statuses.");d.set("status",t.status.map(f=>b(f,A)).join(","))}let s=await o(`orders?${d}`);i(Array.isArray(s.data)&&s.data.length<=n),i(s.page===r&&s.limit===n&&Number.isSafeInteger(s.total)&&Number(s.total)>=0&&typeof s.hasMore=="boolean");let c=(r-1)*n+s.data.length;i(Number.isSafeInteger(c)&&c<=Math.max(Number(s.total),(r-1)*n)),i(s.hasMore===c<Number(s.total)&&(!s.hasMore||s.data.length>0));let g=s.data.map(f=>P(f,a));return i(new Set(g.map(f=>f.id.toLowerCase())).size===g.length),i(g.every(f=>(t.type===void 0||f.type===t.type)&&(t.onChainOrderType===void 0||f.onChainOrderType===t.onChainOrderType)&&(t.status===void 0||t.status.includes(f.status)))),{data:g,total:s.total,page:r,limit:n,hasMore:s.hasMore,notice:l}}),p("velora_delta_order",{orderId:{type:"string",pattern:x}},["orderId"],async(t,a)=>{if(typeof t.orderId!="string"||!new RegExp(x).test(t.orderId))throw new y("Provide a Delta order UUID.");let r=await o(`orders/${t.orderId}`);return{order:P(r,a,t.orderId),notice:l}}),p("velora_delta_bridge_routes",{},[],async()=>{let t=await o("prices/bridge-routes");i(Array.isArray(t.routes));let a=t.routes.map(r=>(i(u(r)&&Number.isSafeInteger(r.srcChainId)&&Number(r.srcChainId)>0&&Number.isSafeInteger(r.destChainId)&&Number(r.destChainId)>0&&Array.isArray(r.tokens)),{srcChainId:r.srcChainId,destChainId:r.destChainId,tokens:r.tokens.map(h)})).filter(r=>r.srcChainId===m||r.destChainId===m);return{chainId:m,routes:a,executionAvailable:!1}}),p("velora_delta_bridge_protocols",{},[],async()=>{let t=await o("prices/bridge-protocols");return i(Array.isArray(t.bridgeProtocols)),{bridgeProtocols:t.bridgeProtocols.map(r=>(i(u(r)&&typeof r.protocol=="string"&&typeof r.displayName=="string"),{protocol:r.protocol,displayName:r.displayName})),executionAvailable:!1}}),p("velora_delta_strategies",{},[],async()=>{let t=await o(`prices/strategies/${m}`),a=Object.entries(t).map(([r,n])=>(i(u(n)&&Array.isArray(n.strategies)),{underlying:h(r),address:h(n.address),strategies:n.strategies.map(d=>{i(u(d)&&typeof d.name=="string");let s=d.apr;return i(s===null||u(s)&&["gross","net"].every(c=>typeof s[c]=="string"&&/^(0|[1-9][0-9]*)(\.[0-9]+)?$/.test(s[c]))),{vault:h(d.vault),name:d.name,apr:structuredClone(d.apr)}})}));return{chainId:m,strategies:a,executionAvailable:!1,notice:"APRs are provider estimates refreshed every three hours, not promised returns. Verify each vault and its exit before depositing."}})]}export{L as a};
1
+ import{a as E}from"./43LI5NKJ.js";import{c as N}from"./VEQBHI6O.js";import{c as C,e as u,g as I}from"./NWNYJ26T.js";import{a as m}from"./FWD4L3CJ.js";import{a as y}from"./XSD5NL7J.js";import{getAddress as k}from"viem";var D="https://api.velora.xyz/v2/delta",A=["PENDING","AWAITING_SIGNATURE","ACTIVE","SUSPENDED","CANCELLING","BRIDGING","COMPLETED","FAILED","EXPIRED","REFUNDING","CANCELLED","REFUNDED"],T=["Order","FillableOrder","ProductiveOrder","ExternalOrder","TWAPOrder","TWAPBuyOrder"],x="^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";function i(e){if(!e)throw new y("Velora Delta returned an unexpected response.")}function h(e){if(typeof e!="string")throw new y("Provide an address.");return E(e),k(e)}function O(e,p,o){if(e===void 0)return o;if(typeof e!="number"||!Number.isSafeInteger(e)||e<1||e>p)throw new y(`Provide an integer between 1 and ${p}.`);return e}function b(e,p){if(typeof e!="string"||!p.includes(e))throw new y(`Choose one of: ${p.join(", ")}.`);return e}function w(e){i(u(e)&&Number.isSafeInteger(e.chainId)&&Number(e.chainId)>0);let p=h(e.token);for(let o of["amount","expectedAmount","executedAmount"])i(e[o]===void 0||e[o]===null||typeof e[o]=="string"&&/^(0|[1-9][0-9]*)$/.test(e[o])&&BigInt(e[o])<1n<<256n);return i(typeof e.amount=="string"||typeof e.expectedAmount=="string"),{chainId:e.chainId,token:p,...Object.fromEntries(["amount","expectedAmount","executedAmount"].filter(o=>e[o]!==void 0).map(o=>[o,e[o]]))}}function P(e,p,o){i(u(e)&&typeof e.id=="string"&&new RegExp(x).test(e.id)),i(o===void 0||I(e.id,o));let l=h(e.owner);i(I(l,p)),i(typeof e.status=="string"&&A.includes(e.status)),i(e.side==="SELL"||e.side==="BUY"),i(e.type==="MARKET"||e.type==="LIMIT"),i(typeof e.onChainOrderType=="string"&&T.includes(e.onChainOrderType));let t=w(e.input);i(t.chainId===m);let a=w(e.output);i(typeof e.orderHash=="string"&&/^0x[0-9a-fA-F]{64}$/.test(e.orderHash)),i(Array.isArray(e.transactions)&&Array.isArray(e.refunds));for(let n of e.transactions){i(u(n)&&typeof n.originTx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(n.originTx)),i(n.destinationTx===void 0||n.destinationTx===null||typeof n.destinationTx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(n.destinationTx)),i(typeof n.filledPercent=="number"&&Number.isFinite(n.filledPercent)&&n.filledPercent>=0&&n.filledPercent<=100);for(let d of["spentAmount","receivedAmount"])i(n[d]===void 0||n[d]===null||typeof n[d]=="string"&&/^(0|[1-9][0-9]*)$/.test(n[d]))}let r=e.refunds.map(n=>(i(u(n)&&typeof n.tx=="string"&&/^0x[0-9a-fA-F]{64}$/.test(n.tx)),{...w(n),tx:n.tx}));return{id:e.id,status:e.status,side:e.side,type:e.type,onChainOrderType:e.onChainOrderType,owner:l,beneficiary:h(e.beneficiary),orderHash:e.orderHash,input:t,output:a,transactions:structuredClone(e.transactions),refunds:r,...Object.fromEntries(["createdAt","updatedAt","expiresAt"].filter(n=>typeof e[n]=="string").map(n=>[n,e[n]]))}}function L(e){function p(t,a,r,n){return{name:t,inputSchema:{type:"object",additionalProperties:!1,properties:a,required:r},execute:async(d,s)=>{try{h(s);for(let c of Object.keys(d))if(!Object.hasOwn(a,c))throw new y(`Unsupported ${t} argument: ${c}.`);return await n(d,s)}catch(c){throw new y(e.plainError(c))}}}}let o=t=>N(e.http,`${D}/${t}`,{method:"GET"},u),l="Provider activity is not receipt proof. Token amounts are base units; resolve symbols and decimals with find_token. Delta signing and submission are not enabled in Oak.";return[p("velora_delta_token_support",{token:C},["token"],async t=>{let a=h(t.token),r=await o(`prices/is-token-supported?${new URLSearchParams({chainId:String(m),token:a})}`);return i(typeof r.supported=="boolean"),{token:a,chainId:m,supported:r.supported}}),p("velora_delta_orders",{page:{type:"integer",minimum:1},limit:{type:"integer",minimum:1,maximum:1e3},type:{type:"string",enum:["MARKET","LIMIT"]},status:{type:"array",minItems:1,maxItems:A.length,items:{type:"string",enum:A}},onChainOrderType:{type:"string",enum:T.filter(t=>t!=="FillableOrder")}},[],async(t,a)=>{let r=O(t.page,Number.MAX_SAFE_INTEGER,1),n=O(t.limit,1e3,100),d=new URLSearchParams({userAddress:a,chainId:String(m),page:String(r),limit:String(n)});if(t.type!==void 0&&d.set("type",b(t.type,["MARKET","LIMIT"])),t.onChainOrderType!==void 0&&d.set("onChainOrderType",b(t.onChainOrderType,T.filter(f=>f!=="FillableOrder"))),t.status!==void 0){if(!Array.isArray(t.status)||!t.status.length||t.status.length>A.length)throw new y("Provide a nonempty list of Delta statuses.");d.set("status",t.status.map(f=>b(f,A)).join(","))}let s=await o(`orders?${d}`);i(Array.isArray(s.data)&&s.data.length<=n),i(s.page===r&&s.limit===n&&Number.isSafeInteger(s.total)&&Number(s.total)>=0&&typeof s.hasMore=="boolean");let c=(r-1)*n+s.data.length;i(Number.isSafeInteger(c)&&c<=Math.max(Number(s.total),(r-1)*n)),i(s.hasMore===c<Number(s.total)&&(!s.hasMore||s.data.length>0));let g=s.data.map(f=>P(f,a));return i(new Set(g.map(f=>f.id.toLowerCase())).size===g.length),i(g.every(f=>(t.type===void 0||f.type===t.type)&&(t.onChainOrderType===void 0||f.onChainOrderType===t.onChainOrderType)&&(t.status===void 0||t.status.includes(f.status)))),{data:g,total:s.total,page:r,limit:n,hasMore:s.hasMore,notice:l}}),p("velora_delta_order",{orderId:{type:"string",pattern:x}},["orderId"],async(t,a)=>{if(typeof t.orderId!="string"||!new RegExp(x).test(t.orderId))throw new y("Provide a Delta order UUID.");let r=await o(`orders/${t.orderId}`);return{order:P(r,a,t.orderId),notice:l}}),p("velora_delta_bridge_routes",{},[],async()=>{let t=await o("prices/bridge-routes");i(Array.isArray(t.routes));let a=t.routes.map(r=>(i(u(r)&&Number.isSafeInteger(r.srcChainId)&&Number(r.srcChainId)>0&&Number.isSafeInteger(r.destChainId)&&Number(r.destChainId)>0&&Array.isArray(r.tokens)),{srcChainId:r.srcChainId,destChainId:r.destChainId,tokens:r.tokens.map(h)})).filter(r=>r.srcChainId===m||r.destChainId===m);return{chainId:m,routes:a,executionAvailable:!1}}),p("velora_delta_bridge_protocols",{},[],async()=>{let t=await o("prices/bridge-protocols");return i(Array.isArray(t.bridgeProtocols)),{bridgeProtocols:t.bridgeProtocols.map(r=>(i(u(r)&&typeof r.protocol=="string"&&typeof r.displayName=="string"),{protocol:r.protocol,displayName:r.displayName})),executionAvailable:!1}}),p("velora_delta_strategies",{},[],async()=>{let t=await o(`prices/strategies/${m}`),a=Object.entries(t).map(([r,n])=>(i(u(n)&&Array.isArray(n.strategies)),{underlying:h(r),address:h(n.address),strategies:n.strategies.map(d=>{i(u(d)&&typeof d.name=="string");let s=d.apr;return i(s===null||u(s)&&["gross","net"].every(c=>typeof s[c]=="string"&&/^(0|[1-9][0-9]*)(\.[0-9]+)?$/.test(s[c]))),{vault:h(d.vault),name:d.name,apr:structuredClone(d.apr)}})}));return{chainId:m,strategies:a,executionAvailable:!1,notice:"APRs are provider estimates refreshed every three hours, not promised returns. Verify each vault and its exit before depositing."}})]}export{L as a};
@@ -1 +1 @@
1
- import{a as k}from"./A3PN3PK3.js";import{g as P}from"./5KUWLUPM.js";import{a as b}from"./FWD4L3CJ.js";import{a as t}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{getAddress as w,parseAbi as L}from"viem";var v={one_hour:3600n,six_hours:21600n,one_day:86400n,seven_days:604800n,thirty_days:2592000n,ninety_days:7776000n,one_year:31536000n},g=L(["function asset() view returns (address)","function decimals() view returns (uint8)","function previewRedeem(uint256) view returns (uint256)"]);async function C(u,o,i){let a=0n,s=i.number,e=await u.getBlock({blockNumber:a});if(e.timestamp>o)throw new t("Longbow has insufficient chain history for this window.");for(let n=0;a+1n<s&&n<64;n++){let r=(a+s)/2n,c=await u.getBlock({blockNumber:r});if(c.number!==r||c.timestamp<e.timestamp||c.timestamp>i.timestamp)throw new t("Longbow historical block response is inconsistent.");c.timestamp<=o?(a=r,e=c):s=r}if(a+1n<s||e.number!==a)throw new t("Longbow historical block search exceeded its bound.");return e}async function _(u,o,i,a="six_hours"){let s=v[a];if(!Object.hasOwn(v,a)||!s)throw new t("Choose a finite Longbow APY lookback from one_hour to one_year; inception is unavailable.");let e=u.clientFor(b);if(await e.getChainId()!==b)throw new t("Longbow APY assessment requires chain 4663.");let n=await e.getBlock({blockTag:"latest"});if(n.number===null||n.timestamp<s)throw new t("Longbow has insufficient chain history for this window.");let r=await C(e,n.timestamp-s,{number:n.number,timestamp:n.timestamp}),c=10n**27n,d=await Promise.all([r,n].map(async m=>{let[S,N,Y,f]=await Promise.all([e.readContract({address:o,abi:g,functionName:"asset",blockNumber:m.number}),e.readContract({address:o,abi:g,functionName:"decimals",blockNumber:m.number}),e.readContract({address:i.address,abi:g,functionName:"decimals",blockNumber:m.number}),e.readContract({address:o,abi:g,functionName:"previewRedeem",args:[c],blockNumber:m.number})]);if(w(S)!==w(i.address)||N!==18||Y!==i.decimals||typeof f!="bigint"||f<0n||f>=1n<<256n)throw new t("Longbow historical share price or token metadata is unavailable or invalid. No zero rate was inferred.");return f})),h=n.timestamp-r.timestamp;if(h<=0n||h>s+300n)throw new t("Longbow historical blocks do not cover the requested APY window within 300 seconds.");if(d[0]===0n)throw new t("Longbow starting share price is zero; a realized APY cannot be calculated.");let l=Number(d[1]-d[0])/Number(d[0]),p=Math.expm1(Math.log1p(l)*31536e3/Number(h));if(!Number.isFinite(p))throw new t("Longbow annualized share-price change is outside the supported numeric range.");let y=await k(e,o,n.number);return{chainId:b,vault:o,asset:{...i,address:w(i.address)},shareToken:{address:o,symbol:y,decimals:18,chainId:b},source:"Oak-computed on-chain",view:"apy",stale:!1,window:{lookback:a,requestedSeconds:s.toString(),elapsedSeconds:h.toString(),fromTimestamp:r.timestamp.toString(),toTimestamp:n.timestamp.toString(),fromBlock:r.number.toString(),toBlock:n.number.toString()},sharePrice:{shareUnits:c.toString(),startAssets:d[0].toString(),endAssets:d[1].toString(),assetDecimals:i.decimals},data:{annualYieldFraction:String(p),annualYieldPercent:String(p*100),lookback:a,basis:"Oak-computed realized APY: (end share price / start share price)^(31536000 / elapsed seconds) - 1, using ERC-4626 previewRedeem at two pinned blocks."},caveat:"Historical share-price change includes what the vault accounts for in previewRedeem, excludes external rewards and gas, and is not a promised return. Archive RPC history is required; missing history is not zero APY."}}async function I(u,o,i,a){if(Object.keys(a).some(d=>!["view","lookback"].includes(d)))throw new t("Longbow APY takes a lookback, not pagination.");let s=a.lookback??"six_hours";if(typeof s!="string"||!Object.hasOwn(v,s))throw new t("Choose a finite Longbow APY lookback from one_hour to one_year; inception is unavailable.");let[e,n]=await Promise.allSettled([O(u,o,i,{view:"published_apy"}),_(u,o,i,s)]),r=e.status==="fulfilled"&&!e.value.stale?e.value:void 0;if(!r&&n.status==="rejected")throw new t(`Longbow APY is unavailable: the vendor figure is unavailable or stale, and the on-chain window could not be measured. ${u.plainError(n.reason)}`);return{...r??(n.status==="fulfilled"?n.value:void 0),view:"apy",shown:r?"Longbow vendor":"Oak-computed on-chain",realized:n.status==="fulfilled"?n.value:null,published:e.status==="fulfilled"?e.value:null,warnings:[...r?[]:["Longbow vendor APY is unavailable or stale; showing Oak-computed realized APY."],...n.status==="rejected"?["Oak-computed APY is unavailable: the archive RPC window could not be measured."]:[]]}}async function O(u,o,i,a){if(Object.keys(a).some(m=>m!=="view")||a.view!=="published_apy")throw new t("published_apy takes no historical lookback, cursor or limit.");let s=u.clientFor(b);if(await s.getChainId()!==b)throw new t("Longbow APY assessment requires chain 4663.");let[e,n]=await Promise.all([s.getBlock(),s.readContract({address:o,abi:L(["function asset() view returns (address)"]),functionName:"asset"})]);if(w(n)!==w(i.address))throw new t("Longbow vault does not use the pinned asset.");let r="https://longbow.credit/api/v2/vaults",c=await u.http(r,{method:"GET",headers:{accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(15e3)});if(!c.ok)throw new t(`Longbow published APY HTTP ${c.status}; the rate is unavailable.`);let d=await c.json();if(!d||typeof d!="object"||!Number.isSafeInteger(d.asOf)||Number(d.asOf)<0||!Array.isArray(d.vaults)||d.vaults.length>100)throw new t("Longbow published APY response has an invalid timestamp or vault inventory.");let h=d.vaults.filter(m=>m&&typeof m=="object"&&typeof m.address=="string"&&P(String(m.address),o));if(h.length!==1)throw new t("Longbow published APY omitted or duplicated this vault; no zero rate is inferred.");let l=h[0];if(l.error||typeof l.asset!="string"||w(l.asset)!==w(i.address)||l.decimals!==i.decimals||typeof l.apy!="number"||!Number.isFinite(l.apy)||l.apy<-100||typeof l.apyBasis!="string"||l.apyBasis.length>64)throw new t("Longbow published APY asset, units, basis or rate is invalid.");let p=BigInt(Number(d.asOf)),y=await k(s,o,e.number);return{chainId:b,vault:o,asset:{...i,address:w(i.address)},shareToken:{address:o,symbol:y,decimals:18,chainId:b},sourceUrl:r,view:"published_apy",asOf:p.toString(),stale:e.timestamp>p+900n||p>e.timestamp+60n,data:{annualYieldPercent:String(l.apy),annualYieldFraction:String(l.apy/100),basis:A(l.apyBasis)},caveat:"Longbow publisher quote, not a realized Morpho lookback series or a promised return. The app formats this field directly as percent (0.03 means 0.03%, not 3%). No bonus, future payout or fee inclusion is inferred. Onchain book and fees remain available through longbow_details."}}export{_ as a,I as b,O as c};
1
+ import{a as k}from"./A3PN3PK3.js";import{g as P}from"./NWNYJ26T.js";import{a as b}from"./FWD4L3CJ.js";import{a as t}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{getAddress as w,parseAbi as L}from"viem";var v={one_hour:3600n,six_hours:21600n,one_day:86400n,seven_days:604800n,thirty_days:2592000n,ninety_days:7776000n,one_year:31536000n},g=L(["function asset() view returns (address)","function decimals() view returns (uint8)","function previewRedeem(uint256) view returns (uint256)"]);async function C(u,o,i){let a=0n,s=i.number,e=await u.getBlock({blockNumber:a});if(e.timestamp>o)throw new t("Longbow has insufficient chain history for this window.");for(let n=0;a+1n<s&&n<64;n++){let r=(a+s)/2n,c=await u.getBlock({blockNumber:r});if(c.number!==r||c.timestamp<e.timestamp||c.timestamp>i.timestamp)throw new t("Longbow historical block response is inconsistent.");c.timestamp<=o?(a=r,e=c):s=r}if(a+1n<s||e.number!==a)throw new t("Longbow historical block search exceeded its bound.");return e}async function _(u,o,i,a="six_hours"){let s=v[a];if(!Object.hasOwn(v,a)||!s)throw new t("Choose a finite Longbow APY lookback from one_hour to one_year; inception is unavailable.");let e=u.clientFor(b);if(await e.getChainId()!==b)throw new t("Longbow APY assessment requires chain 4663.");let n=await e.getBlock({blockTag:"latest"});if(n.number===null||n.timestamp<s)throw new t("Longbow has insufficient chain history for this window.");let r=await C(e,n.timestamp-s,{number:n.number,timestamp:n.timestamp}),c=10n**27n,d=await Promise.all([r,n].map(async m=>{let[S,N,Y,f]=await Promise.all([e.readContract({address:o,abi:g,functionName:"asset",blockNumber:m.number}),e.readContract({address:o,abi:g,functionName:"decimals",blockNumber:m.number}),e.readContract({address:i.address,abi:g,functionName:"decimals",blockNumber:m.number}),e.readContract({address:o,abi:g,functionName:"previewRedeem",args:[c],blockNumber:m.number})]);if(w(S)!==w(i.address)||N!==18||Y!==i.decimals||typeof f!="bigint"||f<0n||f>=1n<<256n)throw new t("Longbow historical share price or token metadata is unavailable or invalid. No zero rate was inferred.");return f})),h=n.timestamp-r.timestamp;if(h<=0n||h>s+300n)throw new t("Longbow historical blocks do not cover the requested APY window within 300 seconds.");if(d[0]===0n)throw new t("Longbow starting share price is zero; a realized APY cannot be calculated.");let l=Number(d[1]-d[0])/Number(d[0]),p=Math.expm1(Math.log1p(l)*31536e3/Number(h));if(!Number.isFinite(p))throw new t("Longbow annualized share-price change is outside the supported numeric range.");let y=await k(e,o,n.number);return{chainId:b,vault:o,asset:{...i,address:w(i.address)},shareToken:{address:o,symbol:y,decimals:18,chainId:b},source:"Oak-computed on-chain",view:"apy",stale:!1,window:{lookback:a,requestedSeconds:s.toString(),elapsedSeconds:h.toString(),fromTimestamp:r.timestamp.toString(),toTimestamp:n.timestamp.toString(),fromBlock:r.number.toString(),toBlock:n.number.toString()},sharePrice:{shareUnits:c.toString(),startAssets:d[0].toString(),endAssets:d[1].toString(),assetDecimals:i.decimals},data:{annualYieldFraction:String(p),annualYieldPercent:String(p*100),lookback:a,basis:"Oak-computed realized APY: (end share price / start share price)^(31536000 / elapsed seconds) - 1, using ERC-4626 previewRedeem at two pinned blocks."},caveat:"Historical share-price change includes what the vault accounts for in previewRedeem, excludes external rewards and gas, and is not a promised return. Archive RPC history is required; missing history is not zero APY."}}async function I(u,o,i,a){if(Object.keys(a).some(d=>!["view","lookback"].includes(d)))throw new t("Longbow APY takes a lookback, not pagination.");let s=a.lookback??"six_hours";if(typeof s!="string"||!Object.hasOwn(v,s))throw new t("Choose a finite Longbow APY lookback from one_hour to one_year; inception is unavailable.");let[e,n]=await Promise.allSettled([O(u,o,i,{view:"published_apy"}),_(u,o,i,s)]),r=e.status==="fulfilled"&&!e.value.stale?e.value:void 0;if(!r&&n.status==="rejected")throw new t(`Longbow APY is unavailable: the vendor figure is unavailable or stale, and the on-chain window could not be measured. ${u.plainError(n.reason)}`);return{...r??(n.status==="fulfilled"?n.value:void 0),view:"apy",shown:r?"Longbow vendor":"Oak-computed on-chain",realized:n.status==="fulfilled"?n.value:null,published:e.status==="fulfilled"?e.value:null,warnings:[...r?[]:["Longbow vendor APY is unavailable or stale; showing Oak-computed realized APY."],...n.status==="rejected"?["Oak-computed APY is unavailable: the archive RPC window could not be measured."]:[]]}}async function O(u,o,i,a){if(Object.keys(a).some(m=>m!=="view")||a.view!=="published_apy")throw new t("published_apy takes no historical lookback, cursor or limit.");let s=u.clientFor(b);if(await s.getChainId()!==b)throw new t("Longbow APY assessment requires chain 4663.");let[e,n]=await Promise.all([s.getBlock(),s.readContract({address:o,abi:L(["function asset() view returns (address)"]),functionName:"asset"})]);if(w(n)!==w(i.address))throw new t("Longbow vault does not use the pinned asset.");let r="https://longbow.credit/api/v2/vaults",c=await u.http(r,{method:"GET",headers:{accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(15e3)});if(!c.ok)throw new t(`Longbow published APY HTTP ${c.status}; the rate is unavailable.`);let d=await c.json();if(!d||typeof d!="object"||!Number.isSafeInteger(d.asOf)||Number(d.asOf)<0||!Array.isArray(d.vaults)||d.vaults.length>100)throw new t("Longbow published APY response has an invalid timestamp or vault inventory.");let h=d.vaults.filter(m=>m&&typeof m=="object"&&typeof m.address=="string"&&P(String(m.address),o));if(h.length!==1)throw new t("Longbow published APY omitted or duplicated this vault; no zero rate is inferred.");let l=h[0];if(l.error||typeof l.asset!="string"||w(l.asset)!==w(i.address)||l.decimals!==i.decimals||typeof l.apy!="number"||!Number.isFinite(l.apy)||l.apy<-100||typeof l.apyBasis!="string"||l.apyBasis.length>64)throw new t("Longbow published APY asset, units, basis or rate is invalid.");let p=BigInt(Number(d.asOf)),y=await k(s,o,e.number);return{chainId:b,vault:o,asset:{...i,address:w(i.address)},shareToken:{address:o,symbol:y,decimals:18,chainId:b},sourceUrl:r,view:"published_apy",asOf:p.toString(),stale:e.timestamp>p+900n||p>e.timestamp+60n,data:{annualYieldPercent:String(l.apy),annualYieldFraction:String(l.apy/100),basis:A(l.apyBasis)},caveat:"Longbow publisher quote, not a realized Morpho lookback series or a promised return. The app formats this field directly as percent (0.03 means 0.03%, not 3%). No bonus, future payout or fee inclusion is inferred. Onchain book and fees remain available through longbow_details."}}export{_ as a,I as b,O as c};
@@ -1 +1 @@
1
- import{d as ee}from"./MKAPRRKF.js";import{e as ie}from"./BNG2IWZL.js";import{a as ne,h as re,k as se}from"./6YYCGUCU.js";import{a as ae,b as O,c as F}from"./5OKJEGBH.js";import{e as te}from"./WMNRP3YH.js";import{b as Z}from"./Z4SRGAVL.js";import{a as B}from"./PBQSJSZO.js";import{c as _}from"./MYFAKCQI.js";import{b as X}from"./5ZLOCQA4.js";import{c as A,d as z,e as b,g as D,j as J,m as Q,n as K}from"./5KUWLUPM.js";import{a as l,i as R}from"./FWD4L3CJ.js";import{a as u}from"./XSD5NL7J.js";import{a as g}from"./JXOEJPJ4.js";import{encodeFunctionData as oe,erc20Abi as M,parseAbi as ce}from"viem";var I="https://api.beefy.finance/vaults",de="https://api.beefy.finance/fees",le="https://api.beefy.finance/apy/breakdown",pe="https://api.beefy.finance/tvl",me="https://databarn.beefy.finance/api/v1/price",V=R[l].vaults.beefyTestedLpVault,q=ce(["function want() view returns (address)","function balance() view returns (uint256)","function getPricePerFullShare() view returns (uint256)","function strategy() view returns (address)","function paused() view returns (bool)","function deposit(uint256 amount)","function withdraw(uint256 shares)"]),E=X("Positive integer string in base units. Send quoted digits, never a JSON number.");function v(a){return J(a,"Provide a valid contract or wallet address.",z)}function T(a){return Q(a,"The contract returned an invalid integer.")}function U(a){return K(a,"Amount must be positive and fit in uint256.",{notString:"Amount must be a positive integer string in base units.",positive:!0})}function ue(a){if(typeof a!="number"||!Number.isInteger(a)||a<0||a>255)throw new u("Invalid token decimals.");return a}function N(a){return D(a,V.address)}function P(a){return ne.some(f=>D(f.vault,a))}function L(a,f=!0){return P(a)&&f?"Use beefy_withdraw to exchange vault shares for CLM shares, redeem them into pair tokens with beefy_clm_withdraw, then convert the tokens to USDG with beefy_clm_swap.":"Use beefy_withdraw to exchange vault shares for the want token. Redeem that want into its pair tokens through a qualified Oak route or the Beefy app, then swap the received tokens to USDG."}function fe(a){return!b(a)||!b(a.performance)?!1:[a.deposit,a.withdraw,a.performance.total].every(f=>typeof f=="number"&&Number.isFinite(f)&&f>=0&&f<=1)&&typeof a.lastUpdated=="number"&&Number.isSafeInteger(a.lastUpdated)&&a.lastUpdated>=0}var he=a=>{async function f(r){try{return await r()}catch(i){throw new u(a.plainError(i))}}function S(r,i){if(r.chainId!==void 0&&r.chainId!==l)throw new u("Beefy requires chain 4663.");for(let d of Object.keys(r))if(!["chainId",...i].includes(d))throw new u(`Unsupported Beefy input: ${d}.`)}async function C(){let r=await _(a.http,I,{headers:{"User-Agent":"Oak-Beefy/1.0"}},e=>Array.isArray(e)&&e.every(n=>b(n)&&typeof n.chain=="string")),i=new Set,d=new Set;return r.filter(e=>e.chain==="robinhood").map(e=>{if(typeof e.id!="string"||!e.id||typeof e.name!="string"||!e.name||e.type!=="standard"||!["active","paused","eol"].includes(String(e.status)))throw new u("The Beefy API returned an unexpected vault record.");let n=v(e.earnContractAddress);if(i.has(e.id)||d.has(n))throw new u("The Beefy API returned duplicate vault records.");return i.add(e.id),d.add(n),{id:e.id,name:e.name,type:"standard",chain:"robinhood",status:e.status,tokenAddress:v(e.tokenAddress),tokenDecimals:ue(e.tokenDecimals),earnContractAddress:n,assets:Array.isArray(e.assets)&&e.assets.every(o=>typeof o=="string")?e.assets:[],strategyType:typeof e.strategyTypeId=="string"?e.strategyTypeId:null,risks:b(e.risks)?Object.fromEntries(Object.entries(e.risks).filter(o=>typeof o[1]=="boolean")):{},lastHarvest:typeof e.lastHarvest=="number"&&Number.isSafeInteger(e.lastHarvest)&&e.lastHarvest>=0?e.lastHarvest:null}})}async function H(){return _(a.http,de,{headers:{"User-Agent":"Oak-Beefy/1.0"}},b)}function j(r,i){let d=r[i.id];if(!fe(d))throw new u(`Beefy fees are unavailable for ${i.id}.`);return d}async function k(){let r=a.clientFor(l);if(await r.getChainId()!==l)throw new u("The Beefy endpoint must report chain 4663.");let i=T(await r.getBlockNumber()),d=(t,s)=>r.readContract({address:t,abi:q,functionName:s,blockNumber:i}),e=async(t,s)=>T(await r.readContract({address:t,abi:M,functionName:"balanceOf",args:[s],blockNumber:i}));async function n(t){let[s,p]=await Promise.all([r.readContract({address:t,abi:M,functionName:"symbol",blockNumber:i}),r.readContract({address:t,abi:M,functionName:"decimals",blockNumber:i})]);if(typeof s!="string"||!s.trim())throw new u("The contract returned invalid token metadata.");return{address:t,chainId:l,symbol:s,decimals:ue(p)}}async function o(t){let s=t.earnContractAddress,p=v(await d(s,"want"));if(p!==t.tokenAddress)throw new u(`Beefy API token and want() disagree for ${t.id}.`);let[h,y,m,c,w]=await Promise.all([n(p),n(s),d(s,"strategy"),d(s,"balance"),d(s,"getPricePerFullShare")]);if(h.decimals!==t.tokenDecimals)throw new u(`Beefy API and want decimals disagree for ${t.id}.`);let $=v(m),G=await d($,"paused");if(typeof G!="boolean")throw new u("The strategy returned an invalid pause flag.");let x=T(w);if(x===0n)throw new u("The Beefy share price is zero.");return{want:h,shares:y,strategy:$,paused:G,managed:T(c),pricePerFullShare:x}}return{blockNumber:i,balanceOf:e,vaultState:o}}async function W(r){let i=v(r.vault),d=O(i),n=(await C()).find(o=>o.earnContractAddress===i);if(!n)throw new u("The selected vault is missing from the current Beefy inventory.");if(n.id!==d.id||n.tokenAddress!==d.tokenAddress.toLowerCase()||n.tokenDecimals!==d.tokenDecimals||n.type!==d.type)throw new u("The Beefy API and pinned vault type or want disagree.");return n}async function Y(r,i,d,e){let n=j(await H(),e),o=await a.preview(r,i),t=o.changes.map(s=>{let p=s.amount.startsWith("-"),h=p?s.amount.slice(1):s.amount;return`${p?"-":"+"}${a.formatAmount(h,s.token.decimals)} ${g(s.token.symbol)} (${s.token.address}, chain ${s.token.chainId})`}).join("; ");return{txs:r,preview:o,summary:`${d} ${g(e.name)}. ${t}. ${o.summary} Beefy API fees: deposit ${n.deposit*100}%, withdrawal ${n.withdraw*100}%, performance ${n.performance.total*100}% (updated ${n.lastUpdated} ms). These calls have no on-chain minimum output parameter; preview is an estimate, not a guaranteed amount. LP acquisition and conversion to USDG are separate.`}}return{tools:[{name:"beefy_list",inputSchema:{type:"object",properties:{chainId:{const:l}},additionalProperties:!1},execute:(r,i)=>f(async()=>{S(r,[]);let[d,e,n]=await Promise.all([C(),H(),k()]),o=[];for(let t of d){let s=await n.vaultState(t),p=!1,h=null;if(P(t.earnContractAddress))try{await re(a).tools[0].execute({vault:t.earnContractAddress},i),p=!0}catch(y){h=a.plainError(y)}o.push({id:t.id,name:t.name,vault:t.earnContractAddress,chainId:l,want:s.want,shares:s.shares,vaultTotalWant:{token:s.want,amount:s.managed.toString()},pricePerFullShare:{token:s.want,amount:s.pricePerFullShare.toString(),scale:"1000000000000000000",source:"getPricePerFullShare()"},apiStatus:{value:t.status,source:I},strategyPaused:{value:s.paused,source:"strategy.paused()",address:s.strategy,block:n.blockNumber.toString()},fees:{...j(e,t),source:de},forkQualified:N(t.earnContractAddress),qualification:N(t.earnContractAddress)?{source:V.source,block:V.block}:null,depositAvailable:O(t.earnContractAddress,!1)!==void 0&&t.status==="active"&&!s.paused&&(!P(t.earnContractAddress)||p),underlyingRoute:p?{kind:"clm",read:"beefy_lp",acquire:"beefy_clm_deposit",redeem:"beefy_clm_withdraw",swap:"beefy_clm_swap"}:null,underlyingRouteError:h,exitPath:L(t.earnContractAddress,p),block:n.blockNumber.toString()})}return{vaults:o,summary:"Direct want/LP vaults, not ERC-4626 or direct USDG. Use beefy_withdraw to return vault shares to want tokens. CLM routes and deposit availability require a successful live qualification read; unavailable routes require the Beefy app for want redemption. Fork qualification, API status and strategy pause are separate observations."}})},{name:"beefy_vault_info",inputSchema:{type:"object",properties:{vault:A,chainId:{const:l},historyBucket:{enum:["1h_1d","1h_1w","1h_1M","1d_1M","1d_1Y","1d_all"]}},required:["vault"],additionalProperties:!1},execute:r=>f(async()=>{S(r,["vault","historyBucket"]);let i=r.historyBucket??"1d_1M";if(!["1h_1d","1h_1w","1h_1M","1d_1M","1d_1Y","1d_all"].includes(String(i)))throw new u("Provide a supported Beefy historyBucket.");let d=v(r.vault),e=(await C()).find(m=>m.earnContractAddress===d);if(!e)throw new u("The selected vault is missing from the current Beefy inventory.");let n=new URL(me);n.searchParams.set("product_key",`beefy:vault:robinhood:${d}`),n.searchParams.set("price_type","share_to_underlying"),n.searchParams.set("time_bucket",String(i));async function o(m,c){try{let w=await _(a.http,m,{headers:{"User-Agent":"Oak-Beefy/1.0"}},$=>$!==void 0);return{status:"available",source:m,value:c(w)}}catch(w){return{status:"unavailable",source:m,error:a.plainError(w)}}}let[t,s,p,h]=await Promise.all([o(le,m=>{if(!b(m))throw new u("Beefy APY is unavailable for this vault.");let c=m[e.id];if(!b(c))throw new u("Beefy APY is unavailable for this vault.");if(!Object.hasOwn(c,"totalApy")||Object.values(c).some(w=>typeof w!="number"||!Number.isFinite(w)||w<0))throw new u("Beefy returned invalid APY data.");return c}),o(pe,m=>{let c=b(m)?m[e.id]:void 0;if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new u("Beefy TVL is unavailable for this vault.");return c}),o(n.toString(),m=>{if(!Array.isArray(m)||m.some(c=>!Array.isArray(c)||c.length<2||typeof c[0]!="string"||!Number.isFinite(Date.parse(c[0]))||typeof c[1]!="string"||!/^\d+(\.\d+)?$/.test(c[1])))throw new u("Beefy returned invalid share-price history.");return m.map(c=>({timestamp:c[0],shareToUnderlying:c[1]}))}),k()]),y=await h.vaultState(e);return{id:e.id,name:e.name,vault:e.earnContractAddress,chainId:l,want:y.want,strategy:{address:y.strategy,type:e.strategyType,assets:e.assets,paused:y.paused,lastHarvest:e.lastHarvest,source:I},risk:{status:Object.keys(e.risks).length?"available":"unavailable",flags:e.risks,source:I,guide:"https://docs.beefy.finance/safety/risk-checklist",summary:"API risk flags are assessments, not guarantees. Uncorrelated LP assets can suffer impermanent loss; vaults also expose strategy, token and contract risks."},apy:t,tvl:{...s,currency:"USD"},history:p,forkQualified:N(e.earnContractAddress),block:h.blockNumber.toString(),app:`https://app.beefy.finance/vault/${encodeURIComponent(e.id)}`,summary:"APY is a fractional annual estimate, not a promised return. Share-price history is not a wallet profit calculation. Missing analytics remain unavailable."}})},{name:"beefy_deposit",inputSchema:{type:"object",description:"Deposit the listed want/LP token to receive vault shares. Exit with beefy_withdraw to receive want tokens; convert them separately using a qualified route or the Beefy app. Check positions after confirmation.",properties:{vault:A,token:A,amount:E,minSharesOut:E,slippageBps:{type:"integer",minimum:0,maximum:9999},chainId:{const:l}},required:["vault","token","amount"],additionalProperties:!1},execute:(r,i)=>f(async()=>{if(S(r,["vault","token","amount","minSharesOut","slippageBps"]),B(i),r.slippageBps!==void 0&&(!Number.isInteger(r.slippageBps)||Number(r.slippageBps)<0||Number(r.slippageBps)>9999))throw new u("slippageBps must be an integer from 0 to 9999.");r.minSharesOut!==void 0&&U(r.minSharesOut);let d=U(r.amount),e=v(r.token),n=await W(r),o=await k();await F(a.clientFor(l),n.earnContractAddress,o.blockNumber);let t=await o.vaultState(n);if(n.status!=="active")throw new u(`The Beefy API marks this vault ${n.status}; deposits are unavailable. ${L(n.earnContractAddress)}`);if(t.paused)throw new u(`The Beefy strategy is paused; deposits are unavailable. ${L(n.earnContractAddress)}`);if(e!==t.want.address)throw new u(`This vault needs ${g(t.want.symbol)} (${t.want.address}, chain 4663), not the supplied token. ${P(n.earnContractAddress)?"Read beefy_lp, acquire the pair tokens with beefy_clm_swap and mint the want with beefy_clm_deposit first.":"No USDG zap is provided."}`);if(await o.balanceOf(t.want.address,i)<d)throw new u(`Insufficient ${g(t.want.symbol)} want balance.`);let s=[a.approval(t.want.address,n.earnContractAddress,d.toString(),l),a.unsignedTx({to:n.earnContractAddress,data:oe({abi:q,functionName:"deposit",args:[d]}),value:"0",chainId:l,description:`Deposit ${d} want base units into ${n.name}.`})],p=await Y(s,i,"Deposit into",n),h=d*10n**18n/t.pricePerFullShare,y=r.minSharesOut===void 0?h*BigInt(1e4-Number(r.slippageBps??50))/10000n:U(r.minSharesOut);if(y<=0n||y>h)throw new u("Minimum shares must be positive and no greater than the current forecast.");let m={token:{address:R[l].tokens.WETH.address,symbol:"WETH",decimals:18,chainId:l},from:t.strategy,recipient:i,optional:!0,includedInMinimumShares:!1},c=`Share forecast ${h}; minimum ${y} share base units (local pre-sign simulation check only; deposit(uint256) has no on-chain minimum). Optional WETH harvest rewards from strategy ${t.strategy} may vary or be zero and are not part of that floor.`;return{...p,harvestReward:m,minimumShares:y.toString(),summary:`${p.summary} ${c}`,preview:{...p.preview,summary:`${p.preview.summary} ${c}`}}})},{name:"beefy_withdraw",inputSchema:{type:"object",description:"Withdraw shares in base units, or shares all for a full exit. Returns want/LP tokens; redemption to pair tokens and conversion to USDG are separate steps.",properties:{vault:A,shares:{anyOf:[E,{const:"all"}]},chainId:{const:l}},required:["vault","shares"],additionalProperties:!1},execute:(r,i)=>f(async()=>{S(r,["vault","shares"]),B(i);let d=r.shares==="all"?void 0:U(r.shares),e=await W(r),n=await k();await F(a.clientFor(l),e.earnContractAddress,n.blockNumber),await n.vaultState(e);let o=await n.balanceOf(e.earnContractAddress,i),t=d??o;if(t===0n||t>o)throw new u("Provide a positive share amount no greater than your current Beefy share balance.");let s=[a.unsignedTx({to:e.earnContractAddress,data:oe({abi:q,functionName:"withdraw",args:[t]}),value:"0",chainId:l,description:`Withdraw ${t} share base units from ${e.name} to the calling wallet.`})];return Y(s,i,"Withdraw from",e)})}],positions:r=>f(async()=>{B(r);let i,[d,e]=await Promise.all([C().catch(o=>(i=a.plainError(o),ae.map(t=>({...t,type:"standard",chain:"robinhood",status:t.status,tokenAddress:v(t.tokenAddress),earnContractAddress:v(t.earnContractAddress),assets:[],strategyType:null,risks:{},lastHarvest:null})))),k()]),n=[];for(let o of d){let t;try{if(t=await e.balanceOf(o.earnContractAddress,r),t===0n)continue;let s=await e.vaultState(o);n.push({module:"beefy",id:o.earnContractAddress,chainId:l,assets:[{token:s.want,amount:(t*s.pricePerFullShare/10n**18n).toString()}],description:`${g(o.name)}: ${a.formatAmount(t.toString(),s.shares.decimals)} ${g(s.shares.symbol)} shares (${o.earnContractAddress}); want estimate before withdrawal fees at block ${e.blockNumber}. ${i?"API unavailable; inventory from pinned vault table, current API status unknown":`API ${o.status}`}; strategy paused ${s.paused}. ${N(o.earnContractAddress)?"Recorded fork-qualified vault.":P(o.earnContractAddress)?"Direct want/share writes supported; CLM acquisition and redemption have separate qualification.":"Direct want/share writes supported after code/type checks; no recorded fork round trip yet."}`})}catch(s){n.push({module:"beefy",id:`${o.earnContractAddress}:unreadable`,chainId:l,incomplete:!0,assets:[],description:`${g(o.name)} position unreadable: ${a.plainError(s)}${t===void 0?" Share balance is unknown.":` Observed ${t} share base units; want valuation is unavailable.`} No zero holding was inferred.`})}}return i&&n.push({module:"beefy",id:"pinned-inventory-coverage",chainId:l,incomplete:!0,assets:[],description:`Beefy API unavailable: ${i} Checked on-chain balances for ${d.length} pinned vaults only; newer or unpinned vaults may be missing.`}),n})}};function Te(a){return Z("beefy",[he(a),ie(a),se(a),ee(a),te(a)])}export{he as a,Te as b};
1
+ import{d as ee}from"./2TK3ETUO.js";import{e as ie}from"./M37654RL.js";import{a as ne,h as re,k as se}from"./QQECG3WP.js";import{a as ae,b as O,c as F}from"./WV3A3OUU.js";import{e as te}from"./SIYUNOLI.js";import{b as Z}from"./SPJCSEKP.js";import{a as B}from"./43LI5NKJ.js";import{c as _}from"./VEQBHI6O.js";import{b as X}from"./66F5ZH34.js";import{c as A,d as z,e as b,g as D,j as J,m as Q,n as K}from"./NWNYJ26T.js";import{a as l,i as R}from"./FWD4L3CJ.js";import{a as u}from"./XSD5NL7J.js";import{a as g}from"./JXOEJPJ4.js";import{encodeFunctionData as oe,erc20Abi as M,parseAbi as ce}from"viem";var I="https://api.beefy.finance/vaults",de="https://api.beefy.finance/fees",le="https://api.beefy.finance/apy/breakdown",pe="https://api.beefy.finance/tvl",me="https://databarn.beefy.finance/api/v1/price",V=R[l].vaults.beefyTestedLpVault,q=ce(["function want() view returns (address)","function balance() view returns (uint256)","function getPricePerFullShare() view returns (uint256)","function strategy() view returns (address)","function paused() view returns (bool)","function deposit(uint256 amount)","function withdraw(uint256 shares)"]),E=X("Positive integer string in base units. Send quoted digits, never a JSON number.");function v(a){return J(a,"Provide a valid contract or wallet address.",z)}function T(a){return Q(a,"The contract returned an invalid integer.")}function U(a){return K(a,"Amount must be positive and fit in uint256.",{notString:"Amount must be a positive integer string in base units.",positive:!0})}function ue(a){if(typeof a!="number"||!Number.isInteger(a)||a<0||a>255)throw new u("Invalid token decimals.");return a}function N(a){return D(a,V.address)}function P(a){return ne.some(f=>D(f.vault,a))}function L(a,f=!0){return P(a)&&f?"Use beefy_withdraw to exchange vault shares for CLM shares, redeem them into pair tokens with beefy_clm_withdraw, then convert the tokens to USDG with beefy_clm_swap.":"Use beefy_withdraw to exchange vault shares for the want token. Redeem that want into its pair tokens through a qualified Oak route or the Beefy app, then swap the received tokens to USDG."}function fe(a){return!b(a)||!b(a.performance)?!1:[a.deposit,a.withdraw,a.performance.total].every(f=>typeof f=="number"&&Number.isFinite(f)&&f>=0&&f<=1)&&typeof a.lastUpdated=="number"&&Number.isSafeInteger(a.lastUpdated)&&a.lastUpdated>=0}var he=a=>{async function f(r){try{return await r()}catch(i){throw new u(a.plainError(i))}}function S(r,i){if(r.chainId!==void 0&&r.chainId!==l)throw new u("Beefy requires chain 4663.");for(let d of Object.keys(r))if(!["chainId",...i].includes(d))throw new u(`Unsupported Beefy input: ${d}.`)}async function C(){let r=await _(a.http,I,{headers:{"User-Agent":"Oak-Beefy/1.0"}},e=>Array.isArray(e)&&e.every(n=>b(n)&&typeof n.chain=="string")),i=new Set,d=new Set;return r.filter(e=>e.chain==="robinhood").map(e=>{if(typeof e.id!="string"||!e.id||typeof e.name!="string"||!e.name||e.type!=="standard"||!["active","paused","eol"].includes(String(e.status)))throw new u("The Beefy API returned an unexpected vault record.");let n=v(e.earnContractAddress);if(i.has(e.id)||d.has(n))throw new u("The Beefy API returned duplicate vault records.");return i.add(e.id),d.add(n),{id:e.id,name:e.name,type:"standard",chain:"robinhood",status:e.status,tokenAddress:v(e.tokenAddress),tokenDecimals:ue(e.tokenDecimals),earnContractAddress:n,assets:Array.isArray(e.assets)&&e.assets.every(o=>typeof o=="string")?e.assets:[],strategyType:typeof e.strategyTypeId=="string"?e.strategyTypeId:null,risks:b(e.risks)?Object.fromEntries(Object.entries(e.risks).filter(o=>typeof o[1]=="boolean")):{},lastHarvest:typeof e.lastHarvest=="number"&&Number.isSafeInteger(e.lastHarvest)&&e.lastHarvest>=0?e.lastHarvest:null}})}async function H(){return _(a.http,de,{headers:{"User-Agent":"Oak-Beefy/1.0"}},b)}function j(r,i){let d=r[i.id];if(!fe(d))throw new u(`Beefy fees are unavailable for ${i.id}.`);return d}async function k(){let r=a.clientFor(l);if(await r.getChainId()!==l)throw new u("The Beefy endpoint must report chain 4663.");let i=T(await r.getBlockNumber()),d=(t,s)=>r.readContract({address:t,abi:q,functionName:s,blockNumber:i}),e=async(t,s)=>T(await r.readContract({address:t,abi:M,functionName:"balanceOf",args:[s],blockNumber:i}));async function n(t){let[s,p]=await Promise.all([r.readContract({address:t,abi:M,functionName:"symbol",blockNumber:i}),r.readContract({address:t,abi:M,functionName:"decimals",blockNumber:i})]);if(typeof s!="string"||!s.trim())throw new u("The contract returned invalid token metadata.");return{address:t,chainId:l,symbol:s,decimals:ue(p)}}async function o(t){let s=t.earnContractAddress,p=v(await d(s,"want"));if(p!==t.tokenAddress)throw new u(`Beefy API token and want() disagree for ${t.id}.`);let[h,y,m,c,w]=await Promise.all([n(p),n(s),d(s,"strategy"),d(s,"balance"),d(s,"getPricePerFullShare")]);if(h.decimals!==t.tokenDecimals)throw new u(`Beefy API and want decimals disagree for ${t.id}.`);let $=v(m),G=await d($,"paused");if(typeof G!="boolean")throw new u("The strategy returned an invalid pause flag.");let x=T(w);if(x===0n)throw new u("The Beefy share price is zero.");return{want:h,shares:y,strategy:$,paused:G,managed:T(c),pricePerFullShare:x}}return{blockNumber:i,balanceOf:e,vaultState:o}}async function W(r){let i=v(r.vault),d=O(i),n=(await C()).find(o=>o.earnContractAddress===i);if(!n)throw new u("The selected vault is missing from the current Beefy inventory.");if(n.id!==d.id||n.tokenAddress!==d.tokenAddress.toLowerCase()||n.tokenDecimals!==d.tokenDecimals||n.type!==d.type)throw new u("The Beefy API and pinned vault type or want disagree.");return n}async function Y(r,i,d,e){let n=j(await H(),e),o=await a.preview(r,i),t=o.changes.map(s=>{let p=s.amount.startsWith("-"),h=p?s.amount.slice(1):s.amount;return`${p?"-":"+"}${a.formatAmount(h,s.token.decimals)} ${g(s.token.symbol)} (${s.token.address}, chain ${s.token.chainId})`}).join("; ");return{txs:r,preview:o,summary:`${d} ${g(e.name)}. ${t}. ${o.summary} Beefy API fees: deposit ${n.deposit*100}%, withdrawal ${n.withdraw*100}%, performance ${n.performance.total*100}% (updated ${n.lastUpdated} ms). These calls have no on-chain minimum output parameter; preview is an estimate, not a guaranteed amount. LP acquisition and conversion to USDG are separate.`}}return{tools:[{name:"beefy_list",inputSchema:{type:"object",properties:{chainId:{const:l}},additionalProperties:!1},execute:(r,i)=>f(async()=>{S(r,[]);let[d,e,n]=await Promise.all([C(),H(),k()]),o=[];for(let t of d){let s=await n.vaultState(t),p=!1,h=null;if(P(t.earnContractAddress))try{await re(a).tools[0].execute({vault:t.earnContractAddress},i),p=!0}catch(y){h=a.plainError(y)}o.push({id:t.id,name:t.name,vault:t.earnContractAddress,chainId:l,want:s.want,shares:s.shares,vaultTotalWant:{token:s.want,amount:s.managed.toString()},pricePerFullShare:{token:s.want,amount:s.pricePerFullShare.toString(),scale:"1000000000000000000",source:"getPricePerFullShare()"},apiStatus:{value:t.status,source:I},strategyPaused:{value:s.paused,source:"strategy.paused()",address:s.strategy,block:n.blockNumber.toString()},fees:{...j(e,t),source:de},forkQualified:N(t.earnContractAddress),qualification:N(t.earnContractAddress)?{source:V.source,block:V.block}:null,depositAvailable:O(t.earnContractAddress,!1)!==void 0&&t.status==="active"&&!s.paused&&(!P(t.earnContractAddress)||p),underlyingRoute:p?{kind:"clm",read:"beefy_lp",acquire:"beefy_clm_deposit",redeem:"beefy_clm_withdraw",swap:"beefy_clm_swap"}:null,underlyingRouteError:h,exitPath:L(t.earnContractAddress,p),block:n.blockNumber.toString()})}return{vaults:o,summary:"Direct want/LP vaults, not ERC-4626 or direct USDG. Use beefy_withdraw to return vault shares to want tokens. CLM routes and deposit availability require a successful live qualification read; unavailable routes require the Beefy app for want redemption. Fork qualification, API status and strategy pause are separate observations."}})},{name:"beefy_vault_info",inputSchema:{type:"object",properties:{vault:A,chainId:{const:l},historyBucket:{enum:["1h_1d","1h_1w","1h_1M","1d_1M","1d_1Y","1d_all"]}},required:["vault"],additionalProperties:!1},execute:r=>f(async()=>{S(r,["vault","historyBucket"]);let i=r.historyBucket??"1d_1M";if(!["1h_1d","1h_1w","1h_1M","1d_1M","1d_1Y","1d_all"].includes(String(i)))throw new u("Provide a supported Beefy historyBucket.");let d=v(r.vault),e=(await C()).find(m=>m.earnContractAddress===d);if(!e)throw new u("The selected vault is missing from the current Beefy inventory.");let n=new URL(me);n.searchParams.set("product_key",`beefy:vault:robinhood:${d}`),n.searchParams.set("price_type","share_to_underlying"),n.searchParams.set("time_bucket",String(i));async function o(m,c){try{let w=await _(a.http,m,{headers:{"User-Agent":"Oak-Beefy/1.0"}},$=>$!==void 0);return{status:"available",source:m,value:c(w)}}catch(w){return{status:"unavailable",source:m,error:a.plainError(w)}}}let[t,s,p,h]=await Promise.all([o(le,m=>{if(!b(m))throw new u("Beefy APY is unavailable for this vault.");let c=m[e.id];if(!b(c))throw new u("Beefy APY is unavailable for this vault.");if(!Object.hasOwn(c,"totalApy")||Object.values(c).some(w=>typeof w!="number"||!Number.isFinite(w)||w<0))throw new u("Beefy returned invalid APY data.");return c}),o(pe,m=>{let c=b(m)?m[e.id]:void 0;if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new u("Beefy TVL is unavailable for this vault.");return c}),o(n.toString(),m=>{if(!Array.isArray(m)||m.some(c=>!Array.isArray(c)||c.length<2||typeof c[0]!="string"||!Number.isFinite(Date.parse(c[0]))||typeof c[1]!="string"||!/^\d+(\.\d+)?$/.test(c[1])))throw new u("Beefy returned invalid share-price history.");return m.map(c=>({timestamp:c[0],shareToUnderlying:c[1]}))}),k()]),y=await h.vaultState(e);return{id:e.id,name:e.name,vault:e.earnContractAddress,chainId:l,want:y.want,strategy:{address:y.strategy,type:e.strategyType,assets:e.assets,paused:y.paused,lastHarvest:e.lastHarvest,source:I},risk:{status:Object.keys(e.risks).length?"available":"unavailable",flags:e.risks,source:I,guide:"https://docs.beefy.finance/safety/risk-checklist",summary:"API risk flags are assessments, not guarantees. Uncorrelated LP assets can suffer impermanent loss; vaults also expose strategy, token and contract risks."},apy:t,tvl:{...s,currency:"USD"},history:p,forkQualified:N(e.earnContractAddress),block:h.blockNumber.toString(),app:`https://app.beefy.finance/vault/${encodeURIComponent(e.id)}`,summary:"APY is a fractional annual estimate, not a promised return. Share-price history is not a wallet profit calculation. Missing analytics remain unavailable."}})},{name:"beefy_deposit",inputSchema:{type:"object",description:"Deposit the listed want/LP token to receive vault shares. Exit with beefy_withdraw to receive want tokens; convert them separately using a qualified route or the Beefy app. Check positions after confirmation.",properties:{vault:A,token:A,amount:E,minSharesOut:E,slippageBps:{type:"integer",minimum:0,maximum:9999},chainId:{const:l}},required:["vault","token","amount"],additionalProperties:!1},execute:(r,i)=>f(async()=>{if(S(r,["vault","token","amount","minSharesOut","slippageBps"]),B(i),r.slippageBps!==void 0&&(!Number.isInteger(r.slippageBps)||Number(r.slippageBps)<0||Number(r.slippageBps)>9999))throw new u("slippageBps must be an integer from 0 to 9999.");r.minSharesOut!==void 0&&U(r.minSharesOut);let d=U(r.amount),e=v(r.token),n=await W(r),o=await k();await F(a.clientFor(l),n.earnContractAddress,o.blockNumber);let t=await o.vaultState(n);if(n.status!=="active")throw new u(`The Beefy API marks this vault ${n.status}; deposits are unavailable. ${L(n.earnContractAddress)}`);if(t.paused)throw new u(`The Beefy strategy is paused; deposits are unavailable. ${L(n.earnContractAddress)}`);if(e!==t.want.address)throw new u(`This vault needs ${g(t.want.symbol)} (${t.want.address}, chain 4663), not the supplied token. ${P(n.earnContractAddress)?"Read beefy_lp, acquire the pair tokens with beefy_clm_swap and mint the want with beefy_clm_deposit first.":"No USDG zap is provided."}`);if(await o.balanceOf(t.want.address,i)<d)throw new u(`Insufficient ${g(t.want.symbol)} want balance.`);let s=[a.approval(t.want.address,n.earnContractAddress,d.toString(),l),a.unsignedTx({to:n.earnContractAddress,data:oe({abi:q,functionName:"deposit",args:[d]}),value:"0",chainId:l,description:`Deposit ${d} want base units into ${n.name}.`})],p=await Y(s,i,"Deposit into",n),h=d*10n**18n/t.pricePerFullShare,y=r.minSharesOut===void 0?h*BigInt(1e4-Number(r.slippageBps??50))/10000n:U(r.minSharesOut);if(y<=0n||y>h)throw new u("Minimum shares must be positive and no greater than the current forecast.");let m={token:{address:R[l].tokens.WETH.address,symbol:"WETH",decimals:18,chainId:l},from:t.strategy,recipient:i,optional:!0,includedInMinimumShares:!1},c=`Share forecast ${h}; minimum ${y} share base units (local pre-sign simulation check only; deposit(uint256) has no on-chain minimum). Optional WETH harvest rewards from strategy ${t.strategy} may vary or be zero and are not part of that floor.`;return{...p,harvestReward:m,minimumShares:y.toString(),summary:`${p.summary} ${c}`,preview:{...p.preview,summary:`${p.preview.summary} ${c}`}}})},{name:"beefy_withdraw",inputSchema:{type:"object",description:"Withdraw shares in base units, or shares all for a full exit. Returns want/LP tokens; redemption to pair tokens and conversion to USDG are separate steps.",properties:{vault:A,shares:{anyOf:[E,{const:"all"}]},chainId:{const:l}},required:["vault","shares"],additionalProperties:!1},execute:(r,i)=>f(async()=>{S(r,["vault","shares"]),B(i);let d=r.shares==="all"?void 0:U(r.shares),e=await W(r),n=await k();await F(a.clientFor(l),e.earnContractAddress,n.blockNumber),await n.vaultState(e);let o=await n.balanceOf(e.earnContractAddress,i),t=d??o;if(t===0n||t>o)throw new u("Provide a positive share amount no greater than your current Beefy share balance.");let s=[a.unsignedTx({to:e.earnContractAddress,data:oe({abi:q,functionName:"withdraw",args:[t]}),value:"0",chainId:l,description:`Withdraw ${t} share base units from ${e.name} to the calling wallet.`})];return Y(s,i,"Withdraw from",e)})}],positions:r=>f(async()=>{B(r);let i,[d,e]=await Promise.all([C().catch(o=>(i=a.plainError(o),ae.map(t=>({...t,type:"standard",chain:"robinhood",status:t.status,tokenAddress:v(t.tokenAddress),earnContractAddress:v(t.earnContractAddress),assets:[],strategyType:null,risks:{},lastHarvest:null})))),k()]),n=[];for(let o of d){let t;try{if(t=await e.balanceOf(o.earnContractAddress,r),t===0n)continue;let s=await e.vaultState(o);n.push({module:"beefy",id:o.earnContractAddress,chainId:l,assets:[{token:s.want,amount:(t*s.pricePerFullShare/10n**18n).toString()}],description:`${g(o.name)}: ${a.formatAmount(t.toString(),s.shares.decimals)} ${g(s.shares.symbol)} shares (${o.earnContractAddress}); want estimate before withdrawal fees at block ${e.blockNumber}. ${i?"API unavailable; inventory from pinned vault table, current API status unknown":`API ${o.status}`}; strategy paused ${s.paused}. ${N(o.earnContractAddress)?"Recorded fork-qualified vault.":P(o.earnContractAddress)?"Direct want/share writes supported; CLM acquisition and redemption have separate qualification.":"Direct want/share writes supported after code/type checks; no recorded fork round trip yet."}`})}catch(s){n.push({module:"beefy",id:`${o.earnContractAddress}:unreadable`,chainId:l,incomplete:!0,assets:[],description:`${g(o.name)} position unreadable: ${a.plainError(s)}${t===void 0?" Share balance is unknown.":` Observed ${t} share base units; want valuation is unavailable.`} No zero holding was inferred.`})}}return i&&n.push({module:"beefy",id:"pinned-inventory-coverage",chainId:l,incomplete:!0,assets:[],description:`Beefy API unavailable: ${i} Checked on-chain balances for ${d.length} pinned vaults only; newer or unpinned vaults may be missing.`}),n})}};function Te(a){return Z("beefy",[he(a),ie(a),se(a),ee(a),te(a)])}export{he as a,Te as b};
@@ -1 +1 @@
1
- import{a as m}from"./DFM4T6ZE.js";import{a as p,e as b}from"./L7OQUHM5.js";import{n as O}from"./65EQECL3.js";import{a as y}from"./5ZLOCQA4.js";import{a as l}from"./FWD4L3CJ.js";import{a as u}from"./XSD5NL7J.js";import{encodeFunctionData as g,getAddress as a,parseAbi as I}from"viem";var x="(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks)",A="(address tokenIn,address tokenOut,uint24 fee,address recipient,uint256 amountIn,uint256 amountOutMinimum,uint160 sqrtPriceLimitX96)",h=I([`function swapExactIn(${x} key,bool zeroForOne,uint128 amountIn,uint256 minOut,uint160 sqrtPriceLimitX96,address to,uint256 deadline) returns (uint256 paid,uint256 out)`,`function exactInputSingle(${A} params) payable returns (uint256 amountOut)`,"function multicall(uint256 deadline,bytes[] data) payable returns (bytes[] results)"]),E=I(["function quoteExactInputSingle((address tokenIn,address tokenOut,uint256 amountIn,uint24 fee,uint160 sqrtPriceLimitX96) params) returns (uint256 amountOut,uint160 sqrtPriceX96After,uint32 initializedTicksCrossed,uint256 gasEstimate)"]),N=I([`function quoteExactInputSingle((${x} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountOut,uint256 gasEstimate)`]),_="0x0000000000000000000000000000000000000000",w={symbol:{type:"string",enum:m.tokens.map(e=>e.symbol)},side:{type:"string",enum:["buy","sell"]},amountIn:y()};async function S(e,o){let n=m.tokens.find(s=>s.symbol===e.symbol);if(!n||e.side!=="buy"&&e.side!=="sell")throw new u("Choose a published stock symbol and buy or sell.");let t=await O(String(e.symbol),{context:o});if(t.kind!=="official_stock"||t.address!==a(n.token))throw new u("Published Priors stock pool does not match the official stock contract address. Retry after the pool mapping is updated.");let r=b(e.amountIn,"amountIn",128);if(r===0n)throw new u("amountIn must be positive base units.");return{token:n,identity:t,amount:r,input:e.side==="buy"?p.usdg:a(n.token),output:e.side==="buy"?a(n.token):p.usdg}}function P(e,o,n){let[t,r]=BigInt(p.usdg)<BigInt(e)?[p.usdg,e]:[e,p.usdg];return{currency0:t,currency1:r,fee:o,tickSpacing:n,hooks:_}}function X(e){return{tools:[{name:"priors_stock_quote",inputSchema:{type:"object",properties:w,required:Object.keys(w),additionalProperties:!1},async execute(o,n){if(e.network==="testnet")throw new u("Priors stock swaps require mainnet chain 4663.");let t=await S(o,e),r=e.clientFor(l),s=await r.getBlockNumber({cacheTime:0}),k=await Promise.all(t.token.pools.map(async(i,d)=>{try{let c=P(a(t.token.token),i.fee,"tickSpacing"in i?i.tickSpacing:0),f=i.v===3?await r.simulateContract({address:a(m.v3.quoter),abi:E,functionName:"quoteExactInputSingle",args:[{tokenIn:t.input,tokenOut:t.output,amountIn:t.amount,fee:i.fee,sqrtPriceLimitX96:0n}],account:n,blockNumber:s}):await r.simulateContract({address:a(m.v4.quoter),abi:N,functionName:"quoteExactInputSingle",args:[{poolKey:c,zeroForOne:t.input===c.currency0,exactAmount:t.amount,hookData:"0x"}],account:n,blockNumber:s});return{poolIndex:d,version:i.v,amountOut:f.result[0].toString()}}catch(c){return{poolIndex:d,version:i.v,error:e.plainError(c)}}}));return{chainId:l,blockNumber:s.toString(),token:t.identity,quotes:k,warning:"Use explicit minimum output with priors_stock_swap and inspect its preview. Issuer restrictions can prevent sale. Quote is no promise of an exit; local regional eligibility remains required."}}},{name:"priors_stock_swap",inputSchema:{type:"object",properties:{...w,poolIndex:{type:"integer",minimum:0,maximum:2},minOut:y(),deadline:y(),eligible:{type:"boolean",description:"Operator/user affirms eligibility for this stock-token trade in their jurisdiction."}},required:[...Object.keys(w),"poolIndex","minOut","deadline","eligible"],additionalProperties:!1},async execute(o,n){if(e.network==="testnet")throw new u("Priors stock swaps require mainnet chain 4663.");if(n=a(n),o.eligible!==!0)throw new u("Confirm local eligibility for Robinhood stock tokens before trading.");let t=await S(o,e),r=b(o.minOut,"minOut"),s=b(o.deadline,"deadline"),k=BigInt(Math.floor(Date.now()/1e3));if(r===0n||s<=k||s>k+1800n||!Number.isSafeInteger(o.poolIndex))throw new u("Provide positive minOut, poolIndex and a deadline within 30 minutes.");let i=t.token.pools[o.poolIndex];if(!i)throw new u("No published pool at that index. Read priors_stock_quote.");let d=P(a(t.token.token),i.fee,"tickSpacing"in i?i.tickSpacing:0),c=t.input===d.currency0,f=a(i.v===3?m.v3.router:m.v4.swapper),q=i.v===3?g({abi:h,functionName:"multicall",args:[s,[g({abi:h,functionName:"exactInputSingle",args:[{tokenIn:t.input,tokenOut:t.output,fee:i.fee,recipient:n,amountIn:t.amount,amountOutMinimum:r,sqrtPriceLimitX96:0n}]})]]}):g({abi:h,functionName:"swapExactIn",args:[d,c,t.amount,r,c?4295128740n:1461446703485210103287273052203988822378723970341n,n,s]}),v=[e.approval(t.input,f,t.amount.toString(),l),e.unsignedTx({to:f,data:q,value:"0",chainId:l,description:`Priors stock ${o.side}: ${t.amount} input base units; minimum ${r}; pinned V${i.v} pool.`})],$=await e.preview(v,n);return{txs:v,expiresAt:s.toString(),summary:`Stock ${o.side} ${o.symbol}: input ${t.amount} base units (${t.input}), minimum output ${r} (${t.output}), receiver ${n}, deadline ${s}. Issuer transfer/sale restrictions apply. Price impact is not measured by this builder; inspect minOut and the preview. ${$.summary}`}}}]}}export{h as a,X as b};
1
+ import{a as m}from"./DFM4T6ZE.js";import{a as p,e as b}from"./DJN3JAWB.js";import{o as O}from"./P56RZC2M.js";import{a as y}from"./66F5ZH34.js";import{a as l}from"./FWD4L3CJ.js";import{a as u}from"./XSD5NL7J.js";import{encodeFunctionData as g,getAddress as a,parseAbi as I}from"viem";var x="(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks)",A="(address tokenIn,address tokenOut,uint24 fee,address recipient,uint256 amountIn,uint256 amountOutMinimum,uint160 sqrtPriceLimitX96)",h=I([`function swapExactIn(${x} key,bool zeroForOne,uint128 amountIn,uint256 minOut,uint160 sqrtPriceLimitX96,address to,uint256 deadline) returns (uint256 paid,uint256 out)`,`function exactInputSingle(${A} params) payable returns (uint256 amountOut)`,"function multicall(uint256 deadline,bytes[] data) payable returns (bytes[] results)"]),E=I(["function quoteExactInputSingle((address tokenIn,address tokenOut,uint256 amountIn,uint24 fee,uint160 sqrtPriceLimitX96) params) returns (uint256 amountOut,uint160 sqrtPriceX96After,uint32 initializedTicksCrossed,uint256 gasEstimate)"]),N=I([`function quoteExactInputSingle((${x} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountOut,uint256 gasEstimate)`]),_="0x0000000000000000000000000000000000000000",w={symbol:{type:"string",enum:m.tokens.map(e=>e.symbol)},side:{type:"string",enum:["buy","sell"]},amountIn:y()};async function S(e,o){let n=m.tokens.find(s=>s.symbol===e.symbol);if(!n||e.side!=="buy"&&e.side!=="sell")throw new u("Choose a published stock symbol and buy or sell.");let t=await O(String(e.symbol),{context:o});if(t.kind!=="official_stock"||t.address!==a(n.token))throw new u("Published Priors stock pool does not match the official stock contract address. Retry after the pool mapping is updated.");let r=b(e.amountIn,"amountIn",128);if(r===0n)throw new u("amountIn must be positive base units.");return{token:n,identity:t,amount:r,input:e.side==="buy"?p.usdg:a(n.token),output:e.side==="buy"?a(n.token):p.usdg}}function P(e,o,n){let[t,r]=BigInt(p.usdg)<BigInt(e)?[p.usdg,e]:[e,p.usdg];return{currency0:t,currency1:r,fee:o,tickSpacing:n,hooks:_}}function X(e){return{tools:[{name:"priors_stock_quote",inputSchema:{type:"object",properties:w,required:Object.keys(w),additionalProperties:!1},async execute(o,n){if(e.network==="testnet")throw new u("Priors stock swaps require mainnet chain 4663.");let t=await S(o,e),r=e.clientFor(l),s=await r.getBlockNumber({cacheTime:0}),k=await Promise.all(t.token.pools.map(async(i,d)=>{try{let c=P(a(t.token.token),i.fee,"tickSpacing"in i?i.tickSpacing:0),f=i.v===3?await r.simulateContract({address:a(m.v3.quoter),abi:E,functionName:"quoteExactInputSingle",args:[{tokenIn:t.input,tokenOut:t.output,amountIn:t.amount,fee:i.fee,sqrtPriceLimitX96:0n}],account:n,blockNumber:s}):await r.simulateContract({address:a(m.v4.quoter),abi:N,functionName:"quoteExactInputSingle",args:[{poolKey:c,zeroForOne:t.input===c.currency0,exactAmount:t.amount,hookData:"0x"}],account:n,blockNumber:s});return{poolIndex:d,version:i.v,amountOut:f.result[0].toString()}}catch(c){return{poolIndex:d,version:i.v,error:e.plainError(c)}}}));return{chainId:l,blockNumber:s.toString(),token:t.identity,quotes:k,warning:"Use explicit minimum output with priors_stock_swap and inspect its preview. Issuer restrictions can prevent sale. Quote is no promise of an exit; local regional eligibility remains required."}}},{name:"priors_stock_swap",inputSchema:{type:"object",properties:{...w,poolIndex:{type:"integer",minimum:0,maximum:2},minOut:y(),deadline:y(),eligible:{type:"boolean",description:"Operator/user affirms eligibility for this stock-token trade in their jurisdiction."}},required:[...Object.keys(w),"poolIndex","minOut","deadline","eligible"],additionalProperties:!1},async execute(o,n){if(e.network==="testnet")throw new u("Priors stock swaps require mainnet chain 4663.");if(n=a(n),o.eligible!==!0)throw new u("Confirm local eligibility for Robinhood stock tokens before trading.");let t=await S(o,e),r=b(o.minOut,"minOut"),s=b(o.deadline,"deadline"),k=BigInt(Math.floor(Date.now()/1e3));if(r===0n||s<=k||s>k+1800n||!Number.isSafeInteger(o.poolIndex))throw new u("Provide positive minOut, poolIndex and a deadline within 30 minutes.");let i=t.token.pools[o.poolIndex];if(!i)throw new u("No published pool at that index. Read priors_stock_quote.");let d=P(a(t.token.token),i.fee,"tickSpacing"in i?i.tickSpacing:0),c=t.input===d.currency0,f=a(i.v===3?m.v3.router:m.v4.swapper),q=i.v===3?g({abi:h,functionName:"multicall",args:[s,[g({abi:h,functionName:"exactInputSingle",args:[{tokenIn:t.input,tokenOut:t.output,fee:i.fee,recipient:n,amountIn:t.amount,amountOutMinimum:r,sqrtPriceLimitX96:0n}]})]]}):g({abi:h,functionName:"swapExactIn",args:[d,c,t.amount,r,c?4295128740n:1461446703485210103287273052203988822378723970341n,n,s]}),v=[e.approval(t.input,f,t.amount.toString(),l),e.unsignedTx({to:f,data:q,value:"0",chainId:l,description:`Priors stock ${o.side}: ${t.amount} input base units; minimum ${r}; pinned V${i.v} pool.`})],$=await e.preview(v,n);return{txs:v,expiresAt:s.toString(),summary:`Stock ${o.side} ${o.symbol}: input ${t.amount} base units (${t.input}), minimum output ${r} (${t.output}), receiver ${n}, deadline ${s}. Issuer transfer/sale restrictions apply. Price impact is not measured by this builder; inspect minOut and the preview. ${$.summary}`}}}]}}export{h as a,X as b};
@@ -1 +1 @@
1
- import{d as s,e as h,f as y,h as O,i as q,k as T,m as L,q as w,t as D}from"./6PY3IRDS.js";import{b as E,c as I,e as x,g as S}from"./5KUWLUPM.js";import{a as P}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{a as $}from"./JXOEJPJ4.js";import{getAddress as k}from"viem";var u={type:"integer",minimum:1},l={type:"string",minLength:1,maxLength:512},_={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},g={type:"integer",minimum:1,maximum:100},v={limit:g,cursor:l},j={relay_chain_health:"Read Relay service health. chainId is required.",relay_requests:"Page this wallet\u2019s requests. Requires server OAK_RELAY_API_KEY; the wallet filter is automatic. Optional id, chain and status filters narrow results.",relay_balance_events:"Page this wallet\u2019s balance events. Requires server OAK_RELAY_API_KEY with access to this resource.",relay_exchange_rates:"Read reference rates without a freshness guarantee. Relay may be unavailable; use relay_token_price for an individual token."};function C(n,r){if(r.type==="string"){if(typeof n!="string"||n.length<Number(r.minLength??0)||n.length>Number(r.maxLength??1024)||typeof r.pattern=="string"&&!new RegExp(r.pattern).test(n))throw new d("Provide a valid Relay search, address or cursor.")}else if(r.type==="integer"){if(typeof n!="number"||!Number.isSafeInteger(n)||n<Number(r.minimum??0)||n>Number(r.maximum??Number.MAX_SAFE_INTEGER))throw new d("Provide an integer within the Relay parameter bounds.")}else{if(r.type==="boolean"&&typeof n!="boolean")throw new d("Provide a boolean Relay filter.");if(r.type==="array"){if(!Array.isArray(n)||n.length>100)throw new d("Provide at most 100 Relay search values.");for(let a of n)C(a,s(r.items))}}if(Array.isArray(r.enum)&&!r.enum.includes(n))throw new d("Choose a supported Relay filter.")}function m(n){return new URLSearchParams(Object.entries(n).map(([r,a])=>[r==="cursor"?"continuation":r,String(a)])).toString()}function R(n){if(n!=null)return C(n,l),n}function p(n){return typeof n=="string"?E.test(n)?k(n.toLowerCase()):/^(?:0x[0-9a-fA-F]{64}|-?\d+(?:\.\d+)?)$/.test(n)?n:$(n):Array.isArray(n)?n.map(p):x(n)?Object.fromEntries(Object.entries(n).filter(([r])=>!/api.?key|signature|authorization|secret/i.test(r)).map(([r,a])=>[r,p(a)])):n}function A(n){return h(n).map(r=>{let a=s(r),e=a.decimals;if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255||typeof a.address!="string")throw new d("Relay returned invalid currency metadata.");let t=a.vmType===void 0||a.vmType==="evm";return{chainId:O(a.chainId),address:t?k(y(a.address)):$(a.address),symbol:w(a.symbol)??"unknown",decimals:e,vmType:w(a.vmType),verified:x(a.metadata)&&a.metadata.verified===!0}})}var F=["relay_vault_status","relay_currencies","relay_token_price","relay_currency_classifications","relay_liquidity","relay_swap_sources","relay_requests","relay_app_fee_balance","relay_app_fee_claims","relay_balance_events","relay_deposit_address","relay_recovery_balances","relay_withdrawal_status","relay_chain_health","relay_token_details","relay_token_chart","relay_trending","relay_exchange_rates","relay_protocol_execution"],X=n=>{let r=D(n);function a(e,t,i,o){return{name:e,inputSchema:{type:"object",...j[e]?{description:j[e]}:{},additionalProperties:!1,properties:t,required:i},execute:async(c,b)=>{for(let f of i)if(c[f]===void 0)throw new d(`Provide ${f} for ${e}.`);for(let[f,N]of Object.entries(c)){if(!Object.hasOwn(t,f))throw new d(`Unsupported ${e} parameter ${f}.`);C(N,t[f])}return o(c,y(b))}}}return{tools:[a("relay_chain_health",{chainId:u},["chainId"],async e=>{let t=s(await r(`/chains/health?${m(e)}`));if(typeof t.healthy!="boolean")throw new d("Relay returned invalid chain health.");return{healthy:t.healthy,chainId:e.chainId}}),a("relay_token_details",{chainId:u,address:I},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${y(e.address)}`));if(t.chainId!==e.chainId||y(t.address)!==y(e.address))throw new d("Relay returned another token.");return{token:A([t])[0],data:p(t)}}),a("relay_token_chart",{chainId:u,address:I,timeframe:{type:"string",enum:["5M","1H","4H","24H","7D","30D","MAX"]}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${y(e.address)}/chart?${m(e.timeframe===void 0?{}:{timeframe:e.timeframe})}`));return{chainId:e.chainId,address:k(y(e.address)),data:p(t),summary:"Relay historical market data. Chart prices and volumes are not token base-unit balances."}}),a("relay_trending",{chainId:u,limit:{...g,maximum:20},sortBy:{type:"string",enum:["relay24hBuyTxCount","relay24hBuyUsdVolume","coingecko6hTrending"]}},[],async e=>({currencies:A(await r(`/currencies/trending?${m(e)}`))})),a("relay_exchange_rates",{},[],async()=>({rates:p(s(await r("/prices/rates"))),summary:"Relay reference rates; timestamps are not supplied. These are prices, not token base-unit amounts."})),a("relay_protocol_execution",{id:_},["id"],async e=>{let t=s(await r(`/protocol/executions/${e.id}`)),i=s(t.execution);if(!S(T(i.idempotencyKey),String(e.id)))throw new d("Relay returned another protocol execution.");return{data:p(t),summary:"Oracle execution status only; this does not prove a destination bridge fill."}}),a("relay_currencies",{chainIds:{type:"array",items:u},term:{...l,maxLength:256},address:l,currencyId:l,symbol:l,groupID:l,tokens:{type:"array",items:l},verified:{type:"boolean"},defaultList:{type:"boolean"},includeAllChains:{type:"boolean"},useExternalSearch:{type:"boolean"},depositAddressOnly:{type:"boolean"},limit:g},[],async e=>({currencies:A(await r("/currencies/v2",{chainIds:[P],...e})),summary:"Relay currency search. Provider verification is not an Oak token endorsement; obtain a quote to check route availability."})),a("relay_token_price",{chainId:u,address:I},["chainId","address"],async e=>{let t=s(await r(`/currencies/token/price/v2?${m(e)}`));if(typeof t.price!="string"||!/^\d+(?:\.\d+)?$/.test(t.price))throw new d("Relay returned an invalid USD price.");return{chainId:e.chainId,address:k(y(e.address)),priceUsd:t.price,summary:"Relay USD price; freshness is not supplied by this endpoint."}}),a("relay_currency_classifications",{},[],async()=>{let e=s(await r("/currencies/classifications"));return{major:h(e.major).map(t=>w(t)??"unknown"),stable:h(e.stable).map(t=>w(t)??"unknown")}}),a("relay_liquidity",{chainId:u},["chainId"],async e=>{let t=s(await r(`/chains/liquidity?${m(e)}`));return{liquidity:h(t.liquidity).map(i=>{let o=s(i);if(o.chainId!==e.chainId)throw new d("Relay liquidity chain does not match the request.");return{...A([o])[0],amount:q(o.balance)}}),summary:"Relay solver balances are indicative capacity, not a reserved route or user funds."}}),a("relay_swap_sources",{chainId:u},[],async e=>({sources:h(s(await r(`/swap-sources?${m(e)}`)).sources).map(t=>w(t,"name")??"unknown")})),a("relay_requests",{...v,originChainId:u,destinationChainId:u,chainId:u,id:_,orderId:_,depositTxHash:_,fillTxHash:_,refundTxHash:_,status:{type:"string",enum:["success","failure","refund","pending","depositing"]},includeChildRequests:{type:"boolean"}},[],async(e,t)=>{let i=s(await r(`/requests/v3?${m({...e,user:t,includePendingRequests:!0})}`)),o=h(i.requests).map(s);for(let c of o){let b=x(c.depositAddress)?c.depositAddress.depositor:void 0;if(![c.user,c.sender,b].some(f=>typeof f=="string"&&f.toLowerCase()===t))throw new d("Relay returned a request for another wallet.");T(c.id)}return{requests:p(o),nextCursor:R(i.continuation),summary:"One page of this wallet\u2019s Relay requests, including pending requests. Pass nextCursor as cursor to resume; provider success is not destination receipt verification."}}),a("relay_app_fee_balance",{},[],async(e,t)=>{let i=s(await r(`/app-fees/${t}/balances`));return{balances:h(i.balances).map(o=>{let c=L(o);return{...c,token:{...c.token,address:k(c.token.address),symbol:w(c.token.symbol)??"unknown"}}}),summary:"Off-chain Relay app fee credits for this wallet. Claiming requires separate local signature integration."}}),a("relay_app_fee_claims",v,[],async(e,t)=>{let i=s(await r(`/app-fees/${t}/claims?${m(e)}`)),o=h(i.claims).map(s);for(let c of o)if(y(c.wallet)!==t)throw new d("Relay returned a fee claim for another wallet.");return{claims:p(o),nextCursor:R(i.continuation)}}),a("relay_balance_events",{...v,limit:{...g,maximum:50},requestId:_,chainId:u,currency:I,startTimestamp:{type:"integer",minimum:0},endTimestamp:{type:"integer",minimum:0},type:l},[],async(e,t)=>{let i=s(await r(`/balance/${t}/events?${m(e)}`));if(y(i.wallet)!==t)throw new d("Relay returned balance events for another wallet.");let o=h(i.events).map(s);for(let c of o)if(y(c.wallet)!==t)throw new d("Relay returned a balance event for another wallet.");return{events:p(o),nextCursor:R(i.continuation)}}),a("relay_deposit_address",{address:l,depositAddressId:l,pageSize:{...g,maximum:50},pageToken:l},[],async e=>{if(e.address===void 0==(e.depositAddressId===void 0))throw new d("Provide exactly one deposit address or depositAddressId.");let t=s(await r(`/deposit-addresses/v2?${m(e)}`)),i=s(t.data),o=s(i.depositAddress);if(e.address!==void 0&&o.address!==e.address||e.depositAddressId!==void 0&&o.id!==e.depositAddressId)throw new d("Relay returned another deposit address.");return{data:p(i),nextPageToken:R(i.nextPageToken),summary:"Deposit address monitoring only. Reading an address does not create, change, fund or recover it."}}),a("relay_recovery_balances",{...v,limit:{...g,maximum:50},ownerChainId:u},["ownerChainId"],async(e,t)=>{let i=s(await r(`/withdrawals/balances?${m({...e,recoveryAddress:t})}`)),o=h(i.balances).map(c=>{let b=s(c);return q(b.amount),b});return{balances:p(o),nextCursor:R(i.continuation),summary:"Credited recovery balances only. Empty balances do not prove that an unattested deposit has no recoverable funds. Withdrawal signing remains a separate action."}}),a("relay_withdrawal_status",{id:l},["id"],async e=>{let t=s(await r(`/withdrawals/status?${m(e)}`));if(typeof t.status!="string")throw new d("Relay returned an invalid withdrawal status.");return{status:w(t.status)??"unknown",data:p(t),summary:"Relay withdrawal job status; verify any reported transaction on its chain before treating funds as received."}})]}};export{F as a,X as b};
1
+ import{d as s,e as h,f as y,h as O,i as q,k as T,m as L,q as w,t as D}from"./64GOINYS.js";import{b as E,c as I,e as x,g as S}from"./NWNYJ26T.js";import{a as P}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{a as $}from"./JXOEJPJ4.js";import{getAddress as k}from"viem";var u={type:"integer",minimum:1},l={type:"string",minLength:1,maxLength:512},_={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},g={type:"integer",minimum:1,maximum:100},v={limit:g,cursor:l},j={relay_chain_health:"Read Relay service health. chainId is required.",relay_requests:"Page this wallet\u2019s requests. Requires server OAK_RELAY_API_KEY; the wallet filter is automatic. Optional id, chain and status filters narrow results.",relay_balance_events:"Page this wallet\u2019s balance events. Requires server OAK_RELAY_API_KEY with access to this resource.",relay_exchange_rates:"Read reference rates without a freshness guarantee. Relay may be unavailable; use relay_token_price for an individual token."};function C(n,r){if(r.type==="string"){if(typeof n!="string"||n.length<Number(r.minLength??0)||n.length>Number(r.maxLength??1024)||typeof r.pattern=="string"&&!new RegExp(r.pattern).test(n))throw new d("Provide a valid Relay search, address or cursor.")}else if(r.type==="integer"){if(typeof n!="number"||!Number.isSafeInteger(n)||n<Number(r.minimum??0)||n>Number(r.maximum??Number.MAX_SAFE_INTEGER))throw new d("Provide an integer within the Relay parameter bounds.")}else{if(r.type==="boolean"&&typeof n!="boolean")throw new d("Provide a boolean Relay filter.");if(r.type==="array"){if(!Array.isArray(n)||n.length>100)throw new d("Provide at most 100 Relay search values.");for(let a of n)C(a,s(r.items))}}if(Array.isArray(r.enum)&&!r.enum.includes(n))throw new d("Choose a supported Relay filter.")}function m(n){return new URLSearchParams(Object.entries(n).map(([r,a])=>[r==="cursor"?"continuation":r,String(a)])).toString()}function R(n){if(n!=null)return C(n,l),n}function p(n){return typeof n=="string"?E.test(n)?k(n.toLowerCase()):/^(?:0x[0-9a-fA-F]{64}|-?\d+(?:\.\d+)?)$/.test(n)?n:$(n):Array.isArray(n)?n.map(p):x(n)?Object.fromEntries(Object.entries(n).filter(([r])=>!/api.?key|signature|authorization|secret/i.test(r)).map(([r,a])=>[r,p(a)])):n}function A(n){return h(n).map(r=>{let a=s(r),e=a.decimals;if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255||typeof a.address!="string")throw new d("Relay returned invalid currency metadata.");let t=a.vmType===void 0||a.vmType==="evm";return{chainId:O(a.chainId),address:t?k(y(a.address)):$(a.address),symbol:w(a.symbol)??"unknown",decimals:e,vmType:w(a.vmType),verified:x(a.metadata)&&a.metadata.verified===!0}})}var F=["relay_vault_status","relay_currencies","relay_token_price","relay_currency_classifications","relay_liquidity","relay_swap_sources","relay_requests","relay_app_fee_balance","relay_app_fee_claims","relay_balance_events","relay_deposit_address","relay_recovery_balances","relay_withdrawal_status","relay_chain_health","relay_token_details","relay_token_chart","relay_trending","relay_exchange_rates","relay_protocol_execution"],X=n=>{let r=D(n);function a(e,t,i,o){return{name:e,inputSchema:{type:"object",...j[e]?{description:j[e]}:{},additionalProperties:!1,properties:t,required:i},execute:async(c,b)=>{for(let f of i)if(c[f]===void 0)throw new d(`Provide ${f} for ${e}.`);for(let[f,N]of Object.entries(c)){if(!Object.hasOwn(t,f))throw new d(`Unsupported ${e} parameter ${f}.`);C(N,t[f])}return o(c,y(b))}}}return{tools:[a("relay_chain_health",{chainId:u},["chainId"],async e=>{let t=s(await r(`/chains/health?${m(e)}`));if(typeof t.healthy!="boolean")throw new d("Relay returned invalid chain health.");return{healthy:t.healthy,chainId:e.chainId}}),a("relay_token_details",{chainId:u,address:I},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${y(e.address)}`));if(t.chainId!==e.chainId||y(t.address)!==y(e.address))throw new d("Relay returned another token.");return{token:A([t])[0],data:p(t)}}),a("relay_token_chart",{chainId:u,address:I,timeframe:{type:"string",enum:["5M","1H","4H","24H","7D","30D","MAX"]}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${y(e.address)}/chart?${m(e.timeframe===void 0?{}:{timeframe:e.timeframe})}`));return{chainId:e.chainId,address:k(y(e.address)),data:p(t),summary:"Relay historical market data. Chart prices and volumes are not token base-unit balances."}}),a("relay_trending",{chainId:u,limit:{...g,maximum:20},sortBy:{type:"string",enum:["relay24hBuyTxCount","relay24hBuyUsdVolume","coingecko6hTrending"]}},[],async e=>({currencies:A(await r(`/currencies/trending?${m(e)}`))})),a("relay_exchange_rates",{},[],async()=>({rates:p(s(await r("/prices/rates"))),summary:"Relay reference rates; timestamps are not supplied. These are prices, not token base-unit amounts."})),a("relay_protocol_execution",{id:_},["id"],async e=>{let t=s(await r(`/protocol/executions/${e.id}`)),i=s(t.execution);if(!S(T(i.idempotencyKey),String(e.id)))throw new d("Relay returned another protocol execution.");return{data:p(t),summary:"Oracle execution status only; this does not prove a destination bridge fill."}}),a("relay_currencies",{chainIds:{type:"array",items:u},term:{...l,maxLength:256},address:l,currencyId:l,symbol:l,groupID:l,tokens:{type:"array",items:l},verified:{type:"boolean"},defaultList:{type:"boolean"},includeAllChains:{type:"boolean"},useExternalSearch:{type:"boolean"},depositAddressOnly:{type:"boolean"},limit:g},[],async e=>({currencies:A(await r("/currencies/v2",{chainIds:[P],...e})),summary:"Relay currency search. Provider verification is not an Oak token endorsement; obtain a quote to check route availability."})),a("relay_token_price",{chainId:u,address:I},["chainId","address"],async e=>{let t=s(await r(`/currencies/token/price/v2?${m(e)}`));if(typeof t.price!="string"||!/^\d+(?:\.\d+)?$/.test(t.price))throw new d("Relay returned an invalid USD price.");return{chainId:e.chainId,address:k(y(e.address)),priceUsd:t.price,summary:"Relay USD price; freshness is not supplied by this endpoint."}}),a("relay_currency_classifications",{},[],async()=>{let e=s(await r("/currencies/classifications"));return{major:h(e.major).map(t=>w(t)??"unknown"),stable:h(e.stable).map(t=>w(t)??"unknown")}}),a("relay_liquidity",{chainId:u},["chainId"],async e=>{let t=s(await r(`/chains/liquidity?${m(e)}`));return{liquidity:h(t.liquidity).map(i=>{let o=s(i);if(o.chainId!==e.chainId)throw new d("Relay liquidity chain does not match the request.");return{...A([o])[0],amount:q(o.balance)}}),summary:"Relay solver balances are indicative capacity, not a reserved route or user funds."}}),a("relay_swap_sources",{chainId:u},[],async e=>({sources:h(s(await r(`/swap-sources?${m(e)}`)).sources).map(t=>w(t,"name")??"unknown")})),a("relay_requests",{...v,originChainId:u,destinationChainId:u,chainId:u,id:_,orderId:_,depositTxHash:_,fillTxHash:_,refundTxHash:_,status:{type:"string",enum:["success","failure","refund","pending","depositing"]},includeChildRequests:{type:"boolean"}},[],async(e,t)=>{let i=s(await r(`/requests/v3?${m({...e,user:t,includePendingRequests:!0})}`)),o=h(i.requests).map(s);for(let c of o){let b=x(c.depositAddress)?c.depositAddress.depositor:void 0;if(![c.user,c.sender,b].some(f=>typeof f=="string"&&f.toLowerCase()===t))throw new d("Relay returned a request for another wallet.");T(c.id)}return{requests:p(o),nextCursor:R(i.continuation),summary:"One page of this wallet\u2019s Relay requests, including pending requests. Pass nextCursor as cursor to resume; provider success is not destination receipt verification."}}),a("relay_app_fee_balance",{},[],async(e,t)=>{let i=s(await r(`/app-fees/${t}/balances`));return{balances:h(i.balances).map(o=>{let c=L(o);return{...c,token:{...c.token,address:k(c.token.address),symbol:w(c.token.symbol)??"unknown"}}}),summary:"Off-chain Relay app fee credits for this wallet. Claiming requires separate local signature integration."}}),a("relay_app_fee_claims",v,[],async(e,t)=>{let i=s(await r(`/app-fees/${t}/claims?${m(e)}`)),o=h(i.claims).map(s);for(let c of o)if(y(c.wallet)!==t)throw new d("Relay returned a fee claim for another wallet.");return{claims:p(o),nextCursor:R(i.continuation)}}),a("relay_balance_events",{...v,limit:{...g,maximum:50},requestId:_,chainId:u,currency:I,startTimestamp:{type:"integer",minimum:0},endTimestamp:{type:"integer",minimum:0},type:l},[],async(e,t)=>{let i=s(await r(`/balance/${t}/events?${m(e)}`));if(y(i.wallet)!==t)throw new d("Relay returned balance events for another wallet.");let o=h(i.events).map(s);for(let c of o)if(y(c.wallet)!==t)throw new d("Relay returned a balance event for another wallet.");return{events:p(o),nextCursor:R(i.continuation)}}),a("relay_deposit_address",{address:l,depositAddressId:l,pageSize:{...g,maximum:50},pageToken:l},[],async e=>{if(e.address===void 0==(e.depositAddressId===void 0))throw new d("Provide exactly one deposit address or depositAddressId.");let t=s(await r(`/deposit-addresses/v2?${m(e)}`)),i=s(t.data),o=s(i.depositAddress);if(e.address!==void 0&&o.address!==e.address||e.depositAddressId!==void 0&&o.id!==e.depositAddressId)throw new d("Relay returned another deposit address.");return{data:p(i),nextPageToken:R(i.nextPageToken),summary:"Deposit address monitoring only. Reading an address does not create, change, fund or recover it."}}),a("relay_recovery_balances",{...v,limit:{...g,maximum:50},ownerChainId:u},["ownerChainId"],async(e,t)=>{let i=s(await r(`/withdrawals/balances?${m({...e,recoveryAddress:t})}`)),o=h(i.balances).map(c=>{let b=s(c);return q(b.amount),b});return{balances:p(o),nextCursor:R(i.continuation),summary:"Credited recovery balances only. Empty balances do not prove that an unattested deposit has no recoverable funds. Withdrawal signing remains a separate action."}}),a("relay_withdrawal_status",{id:l},["id"],async e=>{let t=s(await r(`/withdrawals/status?${m(e)}`));if(typeof t.status!="string")throw new d("Relay returned an invalid withdrawal status.");return{status:w(t.status)??"unknown",data:p(t),summary:"Relay withdrawal job status; verify any reported transaction on its chain before treating funds as received."}})]}};export{F as a,X as b};
@@ -1 +1 @@
1
- import{d as B,e as te,f as W,h as se,i as T}from"./JG27HM4P.js";import{E as A,a as J,b as Q,c as C,f as _,h as v,m as b,q as U,s as ee,u as oe}from"./WPAF55SP.js";import{f as K,g as Z}from"./HVM2EEXB.js";import{a as F}from"./HTXKERNS.js";import{a as Y}from"./PBQSJSZO.js";import{g as E}from"./5KUWLUPM.js";import{a as y}from"./FWD4L3CJ.js";import{a as w,b as M,e as j}from"./XSD5NL7J.js";import{decodeAbiParameters as fe,getAddress as I,pad as ne,parseAbi as de,parseAbiParameters as me,toEventSelector as he,toHex as ie,zeroAddress as ce}from"viem";var ge=he("Initialize(bytes32,address,address,uint24,int24,address,uint160,int24)"),ke=me("uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick"),we=10000000n,ye=10000n,le=25,z=200,R=16,Pe=3e3,be=500,Ae=500n,q=100,O=de(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Ie=de(["function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)"]);function ve(o){let e=o.trim().toLowerCase();return e==="eth"||e==="native"||e===ce||e===F.toLowerCase()}function re(o,e){if(o!=null){if(typeof o!="string")throw new w(`${e} must be a token address, or "eth" for native ETH.`);return ve(o)?{eth:!0}:(Y(o),{eth:!1,address:I(o)})}}var ue=(o,e)=>BigInt(o)<BigInt(e)?-1:BigInt(o)>BigInt(e)?1:0;function $(o){return{address:o.address,symbol:o.symbol,decimals:o.decimals}}async function pe(o,e,a,r,c){let[t,s,p]=await Promise.all([o.readContract({address:e,abi:T,functionName:"slot0"}),o.readContract({address:e,abi:T,functionName:"liquidity"}),o.readContract({address:e,abi:T,functionName:"tickSpacing"})]),n=BigInt(t[0]);return{version:"v3",id:e,token0:$(a),token1:$(r),fee:c,tickSpacing:Number(p),initialized:n>0n,liquidity:BigInt(s).toString(),sqrtPriceX96:n.toString(),tick:Number(t[1]),price:n>0n?K(n,a.decimals,r.decimals):"0",addSupported:!0}}async function x(o,e,a){let r=a??ee(e),[c,t]=await Promise.all([A(o,e.currency0,y),A(o,e.currency1,y)]),[s,p]=await Promise.all([o.readContract({address:C,abi:O,functionName:"getSlot0",args:[r]}),o.readContract({address:C,abi:O,functionName:"getLiquidity",args:[r]})]),n=BigInt(s[0]),k=oe(e,Number(s[3]));return{version:"v4",id:r,token0:$(c),token1:$(t),fee:e.fee,tickSpacing:e.tickSpacing,hooks:I(e.hooks),initialized:n>0n,liquidity:BigInt(p).toString(),sqrtPriceX96:n.toString(),tick:Number(s[1]),price:n>0n?K(n,c.decimals,t.decimals):"0",addSupported:U.has(e.hooks.toLowerCase()),feeNote:k.feeNote,...U.has(e.hooks.toLowerCase())?{}:{note:`Hook ${I(e.hooks)} is not one Oak has measured, so uniswap_add will refuse this pool.`}}}async function Se(o,e,a,r){let c=await o.getBlockNumber(),t=[],s=new Set,p=!1,n=we;for(let i=c;;){let l=i+1n>n?i-n+1n:0n,h;try{h=await o.request({method:"eth_getLogs",params:[{address:J.toLowerCase(),topics:[ge,null,e?ne(e):null,a?ne(a):null],fromBlock:ie(l),toBlock:ie(i)}]})}catch(m){if(M(m,-32601)||n<=ye)throw m;n/=2n;continue}if(!Array.isArray(h))throw new w("Invalid v4 Initialize log response.");let P=[];for(let m of h){if(!Array.isArray(m.topics)||m.topics.length!==4||typeof m.data!="string")throw new w("Invalid v4 Initialize log.");let[S,L,N]=fe(ke,m.data),D={currency0:I(`0x${m.topics[2].slice(-40)}`),currency1:I(`0x${m.topics[3].slice(-40)}`),fee:Number(S),tickSpacing:Number(L),hooks:I(N)};P.push({key:D,id:m.topics[1]}),s.add(m.topics[1].toLowerCase())}if(t.push(P),l===0n)break;if(s.size>=r){p=!0;break}i=l-1n}let k=new Map;for(let i of t.reverse())for(let l of i)k.set(l.id.toLowerCase(),l);return{pools:[...k.values()],cut:p}}async function Ce(o,e,a){let r=e.eth?B.weth:e.address,c=a.eth?B.weth:a.address;if(r===c)return[];let[t,s]=ue(r,c)<0?[r,c]:[c,r],[p,n]=await Promise.all([A(o,t,y),A(o,s,y)]),k=[];for(let i of Object.keys(te).map(Number)){let l=I(String(await o.readContract({address:B.factory,abi:se,functionName:"getPool",args:[t,s,i]})));l!==ce&&k.push(await pe(o,l,p,n,i))}return k}function ae(o){return o?o.eth?[v,_]:o.address===_?[_,v]:[o.address]:null}async function _e(o,e){let a=new Map;if(e.length===0)return a;if(typeof o.multicall=="function"&&o.chain?.contracts?.multicall3)try{return(await o.multicall({allowFailure:!0,contracts:e.map(c=>({address:C,abi:O,functionName:"getLiquidity",args:[c]}))})).forEach((c,t)=>a.set(e[t].toLowerCase(),c.status==="success"?BigInt(c.result):0n)),a}catch{}for(let r=0;r<e.length;r+=R)(await Promise.allSettled(e.slice(r,r+R).map(async t=>BigInt(await o.readContract({address:C,abi:O,functionName:"getLiquidity",args:[t]}))))).forEach((t,s)=>a.set(e[r+s].toLowerCase(),t.status==="fulfilled"?t.value:0n));return a}async function Le(o,e,a,r){let c=ae(e),t=ae(a),s=new Map,p=(d,f)=>{if(d&&f){if(d===f)return;let[u,g]=ue(d,f)<0?[d,f]:[f,d];s.set(`${u}/${g}`,[u,g])}else if(d||f){let u=d??f;s.set(`${u}/*0`,[u,null]),s.set(`${u}/*1`,[null,u])}};for(let d of c??[null])for(let f of t??[null])p(d,f);let n=new Map;for(let d of b)[...s.values()].some(([u,g])=>(!u||E(d.key.currency0,u))&&(!g||E(d.key.currency1,g)))&&n.set(d.poolId.toLowerCase(),{key:d.key,id:d.poolId});let i=typeof o.multicall=="function"&&!!o.chain?.contracts?.multicall3?Pe:be,l=!1;for(let[d,f]of s.values()){let u=await Se(o,d,f,i+b.length);l||=u.cut;for(let g of u.pools)n.set(g.id.toLowerCase(),g)}let h=new Set(b.map(d=>d.poolId.toLowerCase())),P=[...n.values()],m=P.filter(d=>h.has(d.id.toLowerCase())),S=P.filter(d=>!h.has(d.id.toLowerCase())).reverse();(S.length>i||l)&&r.push(`${l?"At least ":""}${S.length} v4 pools match; only the newest ${i} non-measured ones were considered. Pass both tokens, or a poolId, to narrow.`);let L=S.slice(0,i),N=await _e(o,L.map(d=>d.id)),D=L.sort((d,f)=>{let u=N.get(d.id.toLowerCase())??0n,g=N.get(f.id.toLowerCase())??0n;return u===g?0:u<g?1:-1}),H=[...m,...D];H.length>z&&r.push(`${H.length} v4 pools match; full state was read for Oak's measured pools plus the deepest of the rest (${z} total). Pass both tokens, or a poolId, to narrow.`);let X=[],V=0,G=H.slice(0,z);for(let d=0;d<G.length;d+=R){let f=await Promise.allSettled(G.slice(d,d+R).map(({key:u,id:g})=>x(o,u,g)));for(let u of f)u.status==="fulfilled"?X.push(u.value):V++}return V>0&&r.push(`${V} pool(s) were skipped because a token or pool state could not be read.`),X}async function Ne(o,e){let a=b.find(n=>E(n.poolId,e));if(a)return x(o,a.key,a.poolId);let[r,c,t,s,p]=await o.readContract({address:Q,abi:Ie,functionName:"poolKeys",args:[e.slice(0,52)]});if(r===v&&c===v&&Number(s)===0)throw new w(`No Uniswap v4 pool ${e} is known to the PositionManager (no position was ever minted in it, or it is not initialized). Search by token pair instead.`);return x(o,{currency0:r,currency1:c,fee:Number(t),tickSpacing:Number(s),hooks:p},e)}function Ee(o){let e=new Set([...b.map(t=>t.poolId.toLowerCase()),...W.map(t=>t.address.toLowerCase())]),a=new Set([v,F.toLowerCase(),_.toLowerCase()]),r=t=>a.has(t.address.toLowerCase())?"ETH":t.address.toLowerCase(),c=new Map;for(let t of o.filter(s=>s.initialized&&BigInt(s.liquidity)>0n)){let s=`${r(t.token0)}/${r(t.token1)}`;c.set(s,[...c.get(s)??[],t])}for(let t of c.values()){let s=t.filter(i=>e.has(i.id.toLowerCase()));if(s.length===0&&t.length<3)continue;let n=(s.length>0?s:t).map(i=>BigInt(i.sqrtPriceX96)).sort((i,l)=>i<l?-1:i>l?1:0),k=n[Math.floor(n.length/2)];for(let i of t){if(e.has(i.id.toLowerCase()))continue;let l=Z(BigInt(i.sqrtPriceX96),k);l>Ae&&(i.priceOutlierBps=Number(l),i.note=`${i.note?`${i.note} `:""}Price differs ${l} bps from the ${s.length>0?"Oak-measured":"median"} price for this pair; do not treat this pool as the market price.`)}}}async function Be(o,e){let a=e.version;if(a!==void 0&&a!=="v3"&&a!=="v4")throw new w('version must be "v3" or "v4"; omit it to search both.');let r=e.limit===void 0?le:Number(e.limit);if(!Number.isInteger(r)||r<1||r>q)throw new w(`limit must be an integer from 1 to ${q}.`);let c=re(e.tokenA,"tokenA"),t=re(e.tokenB,"tokenB");if(!c&&t)throw new w("Provide tokenA when searching by token; tokenB narrows the search to a pair.");let s=o.clientFor(y),p=[],n=[];if(e.poolId!==void 0){if(typeof e.poolId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.poolId))throw new w("poolId must be a 32-byte hex v4 poolId. For v3 search by tokenA/tokenB.");n=[await Ne(s,e.poolId)]}else if(c){if(a!=="v4"&&(t?n.push(...await Ce(s,c,t)):p.push("v3 pools are looked up per pair; pass tokenB to include them.")),a!=="v3")try{n.push(...await Le(s,c,t,p))}catch(i){throw M(i,-32601)?i:new w(`Could not search v4 pools. ${j(i)}`)}}else{p.push("No token filter given: showing the pools Oak has measured. Pass tokenA (and tokenB) to search the chain for every pool of a pair.");let i=await Promise.all(W.map(async h=>{let[P,m]=await Promise.all([A(s,h.token0,y),A(s,h.token1,y)]);return pe(s,h.address,P,m,h.fee)})),l=await Promise.all(b.map(h=>x(s,h.key,h.poolId)));n=[...a==="v4"?[]:i,...a==="v3"?[]:l]}Ee(n),n.sort((i,l)=>BigInt(l.liquidity)>BigInt(i.liquidity)?1:BigInt(l.liquidity)<BigInt(i.liquidity)?-1:0),n.length>r&&p.push(`Showing the ${r} deepest of ${n.length} pools found; raise limit (max ${q}) to see more.`),n=n.slice(0,r);let k=n.filter(i=>i.initialized&&BigInt(i.liquidity)>0n).length;return n.length===0&&p.push("No pool exists for this pair. Create one with uniswap_create_pool, or create it and add the first liquidity together with uniswap_add plus initialPrice."),{pools:n,notes:p,summary:`Found ${n.length} Uniswap pool(s), ${k} with active liquidity. price is token1 per 1 token0.`}}function Me(o){return{tools:[{name:"uniswap_pools",inputSchema:{type:"object",description:"Read-only pool discovery on Robinhood Chain (4663): every Uniswap v3 and v4 pool for a token pair with fee, tick spacing, hook, liquidity and price, or one v4 pool by poolId. No tokens given: the measured pools.",properties:{version:{type:"string",enum:["v3","v4"],description:"Limit to one version; omit to search both."},tokenA:{type:"string",description:'Token address, or "eth" for native ETH (searches v3 WETH and v4 native/WETH pools).'},tokenB:{type:"string",description:"Second token of the pair. Required for v3 lookups."},poolId:{type:"string",description:"32-byte v4 poolId to inspect."},limit:{type:"integer",minimum:1,maximum:q,default:le}}},execute:async a=>Be(o,a)}]}}export{Be as a,Me as b};
1
+ import{e as B,f as te,g as W,i as se,j as T}from"./KIFSRO5K.js";import{E as A,a as J,b as Q,c as C,f as _,h as v,m as b,q as U,s as ee,u as oe}from"./GEIFITAQ.js";import{f as K,g as Z}from"./6B3VVISQ.js";import{a as F}from"./3MLUCYCB.js";import{a as Y}from"./43LI5NKJ.js";import{g as E}from"./NWNYJ26T.js";import{a as y}from"./FWD4L3CJ.js";import{a as w,b as M,e as j}from"./XSD5NL7J.js";import{decodeAbiParameters as fe,getAddress as I,pad as ne,parseAbi as de,parseAbiParameters as me,toEventSelector as he,toHex as ie,zeroAddress as ce}from"viem";var ge=he("Initialize(bytes32,address,address,uint24,int24,address,uint160,int24)"),ke=me("uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick"),we=10000000n,ye=10000n,le=25,z=200,R=16,Pe=3e3,be=500,Ae=500n,q=100,O=de(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Ie=de(["function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)"]);function ve(o){let e=o.trim().toLowerCase();return e==="eth"||e==="native"||e===ce||e===F.toLowerCase()}function re(o,e){if(o!=null){if(typeof o!="string")throw new w(`${e} must be a token address, or "eth" for native ETH.`);return ve(o)?{eth:!0}:(Y(o),{eth:!1,address:I(o)})}}var ue=(o,e)=>BigInt(o)<BigInt(e)?-1:BigInt(o)>BigInt(e)?1:0;function $(o){return{address:o.address,symbol:o.symbol,decimals:o.decimals}}async function pe(o,e,a,r,c){let[t,s,p]=await Promise.all([o.readContract({address:e,abi:T,functionName:"slot0"}),o.readContract({address:e,abi:T,functionName:"liquidity"}),o.readContract({address:e,abi:T,functionName:"tickSpacing"})]),n=BigInt(t[0]);return{version:"v3",id:e,token0:$(a),token1:$(r),fee:c,tickSpacing:Number(p),initialized:n>0n,liquidity:BigInt(s).toString(),sqrtPriceX96:n.toString(),tick:Number(t[1]),price:n>0n?K(n,a.decimals,r.decimals):"0",addSupported:!0}}async function x(o,e,a){let r=a??ee(e),[c,t]=await Promise.all([A(o,e.currency0,y),A(o,e.currency1,y)]),[s,p]=await Promise.all([o.readContract({address:C,abi:O,functionName:"getSlot0",args:[r]}),o.readContract({address:C,abi:O,functionName:"getLiquidity",args:[r]})]),n=BigInt(s[0]),k=oe(e,Number(s[3]));return{version:"v4",id:r,token0:$(c),token1:$(t),fee:e.fee,tickSpacing:e.tickSpacing,hooks:I(e.hooks),initialized:n>0n,liquidity:BigInt(p).toString(),sqrtPriceX96:n.toString(),tick:Number(s[1]),price:n>0n?K(n,c.decimals,t.decimals):"0",addSupported:U.has(e.hooks.toLowerCase()),feeNote:k.feeNote,...U.has(e.hooks.toLowerCase())?{}:{note:`Hook ${I(e.hooks)} is not one Oak has measured, so uniswap_add will refuse this pool.`}}}async function Se(o,e,a,r){let c=await o.getBlockNumber(),t=[],s=new Set,p=!1,n=we;for(let i=c;;){let l=i+1n>n?i-n+1n:0n,h;try{h=await o.request({method:"eth_getLogs",params:[{address:J.toLowerCase(),topics:[ge,null,e?ne(e):null,a?ne(a):null],fromBlock:ie(l),toBlock:ie(i)}]})}catch(m){if(M(m,-32601)||n<=ye)throw m;n/=2n;continue}if(!Array.isArray(h))throw new w("Invalid v4 Initialize log response.");let P=[];for(let m of h){if(!Array.isArray(m.topics)||m.topics.length!==4||typeof m.data!="string")throw new w("Invalid v4 Initialize log.");let[S,L,N]=fe(ke,m.data),D={currency0:I(`0x${m.topics[2].slice(-40)}`),currency1:I(`0x${m.topics[3].slice(-40)}`),fee:Number(S),tickSpacing:Number(L),hooks:I(N)};P.push({key:D,id:m.topics[1]}),s.add(m.topics[1].toLowerCase())}if(t.push(P),l===0n)break;if(s.size>=r){p=!0;break}i=l-1n}let k=new Map;for(let i of t.reverse())for(let l of i)k.set(l.id.toLowerCase(),l);return{pools:[...k.values()],cut:p}}async function Ce(o,e,a){let r=e.eth?B.weth:e.address,c=a.eth?B.weth:a.address;if(r===c)return[];let[t,s]=ue(r,c)<0?[r,c]:[c,r],[p,n]=await Promise.all([A(o,t,y),A(o,s,y)]),k=[];for(let i of Object.keys(te).map(Number)){let l=I(String(await o.readContract({address:B.factory,abi:se,functionName:"getPool",args:[t,s,i]})));l!==ce&&k.push(await pe(o,l,p,n,i))}return k}function ae(o){return o?o.eth?[v,_]:o.address===_?[_,v]:[o.address]:null}async function _e(o,e){let a=new Map;if(e.length===0)return a;if(typeof o.multicall=="function"&&o.chain?.contracts?.multicall3)try{return(await o.multicall({allowFailure:!0,contracts:e.map(c=>({address:C,abi:O,functionName:"getLiquidity",args:[c]}))})).forEach((c,t)=>a.set(e[t].toLowerCase(),c.status==="success"?BigInt(c.result):0n)),a}catch{}for(let r=0;r<e.length;r+=R)(await Promise.allSettled(e.slice(r,r+R).map(async t=>BigInt(await o.readContract({address:C,abi:O,functionName:"getLiquidity",args:[t]}))))).forEach((t,s)=>a.set(e[r+s].toLowerCase(),t.status==="fulfilled"?t.value:0n));return a}async function Le(o,e,a,r){let c=ae(e),t=ae(a),s=new Map,p=(d,f)=>{if(d&&f){if(d===f)return;let[u,g]=ue(d,f)<0?[d,f]:[f,d];s.set(`${u}/${g}`,[u,g])}else if(d||f){let u=d??f;s.set(`${u}/*0`,[u,null]),s.set(`${u}/*1`,[null,u])}};for(let d of c??[null])for(let f of t??[null])p(d,f);let n=new Map;for(let d of b)[...s.values()].some(([u,g])=>(!u||E(d.key.currency0,u))&&(!g||E(d.key.currency1,g)))&&n.set(d.poolId.toLowerCase(),{key:d.key,id:d.poolId});let i=typeof o.multicall=="function"&&!!o.chain?.contracts?.multicall3?Pe:be,l=!1;for(let[d,f]of s.values()){let u=await Se(o,d,f,i+b.length);l||=u.cut;for(let g of u.pools)n.set(g.id.toLowerCase(),g)}let h=new Set(b.map(d=>d.poolId.toLowerCase())),P=[...n.values()],m=P.filter(d=>h.has(d.id.toLowerCase())),S=P.filter(d=>!h.has(d.id.toLowerCase())).reverse();(S.length>i||l)&&r.push(`${l?"At least ":""}${S.length} v4 pools match; only the newest ${i} non-measured ones were considered. Pass both tokens, or a poolId, to narrow.`);let L=S.slice(0,i),N=await _e(o,L.map(d=>d.id)),D=L.sort((d,f)=>{let u=N.get(d.id.toLowerCase())??0n,g=N.get(f.id.toLowerCase())??0n;return u===g?0:u<g?1:-1}),H=[...m,...D];H.length>z&&r.push(`${H.length} v4 pools match; full state was read for Oak's measured pools plus the deepest of the rest (${z} total). Pass both tokens, or a poolId, to narrow.`);let X=[],V=0,G=H.slice(0,z);for(let d=0;d<G.length;d+=R){let f=await Promise.allSettled(G.slice(d,d+R).map(({key:u,id:g})=>x(o,u,g)));for(let u of f)u.status==="fulfilled"?X.push(u.value):V++}return V>0&&r.push(`${V} pool(s) were skipped because a token or pool state could not be read.`),X}async function Ne(o,e){let a=b.find(n=>E(n.poolId,e));if(a)return x(o,a.key,a.poolId);let[r,c,t,s,p]=await o.readContract({address:Q,abi:Ie,functionName:"poolKeys",args:[e.slice(0,52)]});if(r===v&&c===v&&Number(s)===0)throw new w(`No Uniswap v4 pool ${e} is known to the PositionManager (no position was ever minted in it, or it is not initialized). Search by token pair instead.`);return x(o,{currency0:r,currency1:c,fee:Number(t),tickSpacing:Number(s),hooks:p},e)}function Ee(o){let e=new Set([...b.map(t=>t.poolId.toLowerCase()),...W.map(t=>t.address.toLowerCase())]),a=new Set([v,F.toLowerCase(),_.toLowerCase()]),r=t=>a.has(t.address.toLowerCase())?"ETH":t.address.toLowerCase(),c=new Map;for(let t of o.filter(s=>s.initialized&&BigInt(s.liquidity)>0n)){let s=`${r(t.token0)}/${r(t.token1)}`;c.set(s,[...c.get(s)??[],t])}for(let t of c.values()){let s=t.filter(i=>e.has(i.id.toLowerCase()));if(s.length===0&&t.length<3)continue;let n=(s.length>0?s:t).map(i=>BigInt(i.sqrtPriceX96)).sort((i,l)=>i<l?-1:i>l?1:0),k=n[Math.floor(n.length/2)];for(let i of t){if(e.has(i.id.toLowerCase()))continue;let l=Z(BigInt(i.sqrtPriceX96),k);l>Ae&&(i.priceOutlierBps=Number(l),i.note=`${i.note?`${i.note} `:""}Price differs ${l} bps from the ${s.length>0?"Oak-measured":"median"} price for this pair; do not treat this pool as the market price.`)}}}async function Be(o,e){let a=e.version;if(a!==void 0&&a!=="v3"&&a!=="v4")throw new w('version must be "v3" or "v4"; omit it to search both.');let r=e.limit===void 0?le:Number(e.limit);if(!Number.isInteger(r)||r<1||r>q)throw new w(`limit must be an integer from 1 to ${q}.`);let c=re(e.tokenA,"tokenA"),t=re(e.tokenB,"tokenB");if(!c&&t)throw new w("Provide tokenA when searching by token; tokenB narrows the search to a pair.");let s=o.clientFor(y),p=[],n=[];if(e.poolId!==void 0){if(typeof e.poolId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.poolId))throw new w("poolId must be a 32-byte hex v4 poolId. For v3 search by tokenA/tokenB.");n=[await Ne(s,e.poolId)]}else if(c){if(a!=="v4"&&(t?n.push(...await Ce(s,c,t)):p.push("v3 pools are looked up per pair; pass tokenB to include them.")),a!=="v3")try{n.push(...await Le(s,c,t,p))}catch(i){throw M(i,-32601)?i:new w(`Could not search v4 pools. ${j(i)}`)}}else{p.push("No token filter given: showing the pools Oak has measured. Pass tokenA (and tokenB) to search the chain for every pool of a pair.");let i=await Promise.all(W.map(async h=>{let[P,m]=await Promise.all([A(s,h.token0,y),A(s,h.token1,y)]);return pe(s,h.address,P,m,h.fee)})),l=await Promise.all(b.map(h=>x(s,h.key,h.poolId)));n=[...a==="v4"?[]:i,...a==="v3"?[]:l]}Ee(n),n.sort((i,l)=>BigInt(l.liquidity)>BigInt(i.liquidity)?1:BigInt(l.liquidity)<BigInt(i.liquidity)?-1:0),n.length>r&&p.push(`Showing the ${r} deepest of ${n.length} pools found; raise limit (max ${q}) to see more.`),n=n.slice(0,r);let k=n.filter(i=>i.initialized&&BigInt(i.liquidity)>0n).length;return n.length===0&&p.push("No pool exists for this pair. Create one with uniswap_create_pool, or create it and add the first liquidity together with uniswap_add plus initialPrice."),{pools:n,notes:p,summary:`Found ${n.length} Uniswap pool(s), ${k} with active liquidity. price is token1 per 1 token0.`}}function Me(o){return{tools:[{name:"uniswap_pools",inputSchema:{type:"object",description:"Read-only pool discovery on Robinhood Chain (4663): every Uniswap v3 and v4 pool for a token pair with fee, tick spacing, hook, liquidity and price, or one v4 pool by poolId. No tokens given: the measured pools.",properties:{version:{type:"string",enum:["v3","v4"],description:"Limit to one version; omit to search both."},tokenA:{type:"string",description:'Token address, or "eth" for native ETH (searches v3 WETH and v4 native/WETH pools).'},tokenB:{type:"string",description:"Second token of the pair. Required for v3 lookups."},poolId:{type:"string",description:"32-byte v4 poolId to inspect."},limit:{type:"integer",minimum:1,maximum:q,default:le}}},execute:async a=>Be(o,a)}]}}export{Be as a,Me as b};
@@ -1 +1 @@
1
- import{d as n,f as a,g as s,h as l,i as u}from"./IKEJCBYU.js";import{c as e}from"./65EQECL3.js";var m="In-kind exits are a separate unsupported flow.";function b(t,i){return n(t,i,e)}function V(t,i,o,r,x,p){return a(t,i,o,r,x,p,e)}function A(t,i,o){return s(t,i,o,e,m)}function P(t){return l(t,e.symbol)}function S(t,i,o,r){u(t,i,o,r,e)}export{b as a,V as b,A as c,P as d,S as e};
1
+ import{d as n,f as a,g as s,h as l,i as u}from"./7WSHW7KW.js";import{c as e}from"./P56RZC2M.js";var m="In-kind exits are a separate unsupported flow.";function b(t,i){return n(t,i,e)}function V(t,i,o,r,x,p){return a(t,i,o,r,x,p,e)}function A(t,i,o){return s(t,i,o,e,m)}function P(t){return l(t,e.symbol)}function S(t,i,o,r){u(t,i,o,r,e)}export{b as a,V as b,A as c,P as d,S as e};