@oakagentkit/core 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (651) hide show
  1. package/build/dist/api/abort-scope.d.ts +2 -0
  2. package/build/dist/api/abort-scope.js +1 -0
  3. package/build/dist/api/chain.js +1 -1
  4. package/build/dist/api/history.js +1 -1
  5. package/build/dist/api/http.js +1 -1
  6. package/build/dist/api/metadata.js +1 -1
  7. package/build/dist/api/modules/beefy/boosts.js +1 -1
  8. package/build/dist/api/modules/beefy/clm.js +1 -1
  9. package/build/dist/api/modules/beefy/guard.js +1 -1
  10. package/build/dist/api/modules/beefy/index.js +1 -1
  11. package/build/dist/api/modules/beefy/liquidity.js +1 -1
  12. package/build/dist/api/modules/beefy/management.js +1 -1
  13. package/build/dist/api/modules/beefy/vaults.js +1 -1
  14. package/build/dist/api/modules/borro/actions.js +1 -1
  15. package/build/dist/api/modules/borro/checks.js +1 -1
  16. package/build/dist/api/modules/borro/copy.d.ts +15 -10
  17. package/build/dist/api/modules/borro/copy.js +1 -1
  18. package/build/dist/api/modules/borro/index.js +1 -1
  19. package/build/dist/api/modules/borro/liquidity.js +1 -1
  20. package/build/dist/api/modules/borro/positions.js +1 -1
  21. package/build/dist/api/modules/borro/reader.js +1 -1
  22. package/build/dist/api/modules/chop/abi.d.ts +31 -0
  23. package/build/dist/api/modules/chop/abi.js +1 -1
  24. package/build/dist/api/modules/chop/actions.js +1 -1
  25. package/build/dist/api/modules/chop/checks.d.ts +13 -5
  26. package/build/dist/api/modules/chop/checks.js +1 -1
  27. package/build/dist/api/modules/chop/copy.d.ts +11 -1
  28. package/build/dist/api/modules/chop/copy.js +1 -1
  29. package/build/dist/api/modules/chop/guard.js +1 -1
  30. package/build/dist/api/modules/chop/index.js +1 -1
  31. package/build/dist/api/modules/chop/positions.js +1 -1
  32. package/build/dist/api/modules/chop/reader.d.ts +132 -7
  33. package/build/dist/api/modules/chop/reader.js +1 -1
  34. package/build/dist/api/modules/chop/types.d.ts +12 -0
  35. package/build/dist/api/modules/clanker/extensions.d.ts +9 -0
  36. package/build/dist/api/modules/clanker/extensions.js +1 -1
  37. package/build/dist/api/modules/clanker/index.js +1 -1
  38. package/build/dist/api/modules/clanker/manage.js +1 -1
  39. package/build/dist/api/modules/clanker/pool-config.d.ts +15 -0
  40. package/build/dist/api/modules/clanker/pool-config.js +1 -1
  41. package/build/dist/api/modules/clanker/protocol.js +1 -1
  42. package/build/dist/api/modules/earn/copy.d.ts +32 -10
  43. package/build/dist/api/modules/earn/copy.js +1 -1
  44. package/build/dist/api/modules/earn/cost.d.ts +11 -1
  45. package/build/dist/api/modules/earn/cost.js +1 -1
  46. package/build/dist/api/modules/earn/index.js +1 -1
  47. package/build/dist/api/modules/earn/lp.d.ts +14 -1
  48. package/build/dist/api/modules/earn/lp.js +1 -1
  49. package/build/dist/api/modules/earn/options.d.ts +6 -4
  50. package/build/dist/api/modules/earn/options.js +1 -1
  51. package/build/dist/api/modules/erc8004/common.d.ts +1 -1
  52. package/build/dist/api/modules/erc8004/common.js +1 -1
  53. package/build/dist/api/modules/erc8004/domain.js +1 -1
  54. package/build/dist/api/modules/erc8004/index.js +1 -1
  55. package/build/dist/api/modules/erc8004/management.js +1 -1
  56. package/build/dist/api/modules/erc8004/reputation.js +1 -1
  57. package/build/dist/api/modules/erc8004/services.js +1 -1
  58. package/build/dist/api/modules/erc8004/validation.js +1 -1
  59. package/build/dist/api/modules/factor/abi.d.ts +642 -0
  60. package/build/dist/api/modules/factor/abi.js +1 -0
  61. package/build/dist/api/modules/factor/actions.d.ts +15 -0
  62. package/build/dist/api/modules/factor/actions.js +1 -0
  63. package/build/dist/api/modules/factor/api.d.ts +7 -0
  64. package/build/dist/api/modules/factor/api.js +1 -0
  65. package/build/dist/api/modules/factor/checks.d.ts +11 -0
  66. package/build/dist/api/modules/factor/checks.js +1 -0
  67. package/build/dist/api/modules/factor/copy.d.ts +33 -0
  68. package/build/dist/api/modules/factor/copy.js +1 -0
  69. package/build/dist/api/modules/factor/guard.d.ts +12 -0
  70. package/build/dist/api/modules/factor/guard.js +1 -0
  71. package/build/dist/api/modules/factor/index.d.ts +16 -0
  72. package/build/dist/api/modules/factor/index.js +8 -0
  73. package/build/dist/api/modules/factor/messages.d.ts +46 -0
  74. package/build/dist/api/modules/factor/messages.js +1 -0
  75. package/build/dist/api/modules/factor/pins.d.ts +64 -0
  76. package/build/dist/api/modules/factor/pins.js +1 -0
  77. package/build/dist/api/modules/factor/reader.d.ts +17 -0
  78. package/build/dist/api/modules/factor/reader.js +1 -0
  79. package/build/dist/api/modules/factor/types.d.ts +18 -0
  80. package/build/dist/api/modules/factor/types.js +0 -0
  81. package/build/dist/api/modules/gloam/copy.d.ts +4 -3
  82. package/build/dist/api/modules/gloam/copy.js +2 -2
  83. package/build/dist/api/modules/gloam/index.js +1 -1
  84. package/build/dist/api/modules/grove/index.js +1 -1
  85. package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
  86. package/build/dist/api/modules/heyresearch/index.js +1 -1
  87. package/build/dist/api/modules/heyresearch/public-reads.d.ts +29 -1
  88. package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
  89. package/build/dist/api/modules/heyresearch/scan.js +1 -1
  90. package/build/dist/api/modules/heyresearch/status-labels.d.ts +2 -0
  91. package/build/dist/api/modules/heyresearch/status-labels.js +1 -1
  92. package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
  93. package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
  94. package/build/dist/api/modules/hoodag/index.js +1 -1
  95. package/build/dist/api/modules/hoodag/management.js +1 -1
  96. package/build/dist/api/modules/hoodag/public-reads.js +1 -1
  97. package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
  98. package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
  99. package/build/dist/api/modules/hoodlock/commerce.js +1 -1
  100. package/build/dist/api/modules/hoodlock/fee.js +1 -1
  101. package/build/dist/api/modules/hoodlock/guard.js +1 -1
  102. package/build/dist/api/modules/hoodlock/index.js +1 -1
  103. package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
  104. package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
  105. package/build/dist/api/modules/hoodlock/public.js +1 -1
  106. package/build/dist/api/modules/hookr/actions.js +1 -1
  107. package/build/dist/api/modules/hookr/addons.js +1 -1
  108. package/build/dist/api/modules/hookr/agent-gate.js +1 -1
  109. package/build/dist/api/modules/hookr/contracts.d.ts +2 -1
  110. package/build/dist/api/modules/hookr/contracts.js +1 -1
  111. package/build/dist/api/modules/hookr/create-cancel.js +1 -1
  112. package/build/dist/api/modules/hookr/discovery.js +1 -1
  113. package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
  114. package/build/dist/api/modules/hookr/index.js +1 -1
  115. package/build/dist/api/modules/hookr/launch-options.js +1 -1
  116. package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
  117. package/build/dist/api/modules/hookr/launch.js +1 -1
  118. package/build/dist/api/modules/hookr/liquidity.js +1 -1
  119. package/build/dist/api/modules/hookr/lp-positions.js +1 -1
  120. package/build/dist/api/modules/hookr/lp-reads.d.ts +2 -0
  121. package/build/dist/api/modules/hookr/lp-reads.js +1 -1
  122. package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
  123. package/build/dist/api/modules/hookr/lp-state.js +1 -1
  124. package/build/dist/api/modules/hookr/public-reads.js +1 -1
  125. package/build/dist/api/modules/hookr/read-utils.js +1 -1
  126. package/build/dist/api/modules/hookr/relay.js +1 -1
  127. package/build/dist/api/modules/hookr/revenue.js +1 -1
  128. package/build/dist/api/modules/kyberswap/index.js +1 -1
  129. package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
  130. package/build/dist/api/modules/layerbank/actions.js +1 -1
  131. package/build/dist/api/modules/layerbank/index.js +1 -1
  132. package/build/dist/api/modules/layerbank/merkl.js +1 -1
  133. package/build/dist/api/modules/layerbank/reader.js +1 -1
  134. package/build/dist/api/modules/lighter/index.js +1 -1
  135. package/build/dist/api/modules/longbow/administration.js +1 -1
  136. package/build/dist/api/modules/longbow/fixed.js +1 -1
  137. package/build/dist/api/modules/longbow/index.js +1 -1
  138. package/build/dist/api/modules/longbow/nft.js +1 -1
  139. package/build/dist/api/modules/longbow/rebates.js +1 -1
  140. package/build/dist/api/modules/longbow/staking.js +1 -1
  141. package/build/dist/api/modules/meridian/index.js +1 -1
  142. package/build/dist/api/modules/meridian/markets.js +1 -1
  143. package/build/dist/api/modules/meridian/perps-batch.js +1 -1
  144. package/build/dist/api/modules/meridian/perps-stream.js +1 -1
  145. package/build/dist/api/modules/meridian/perps.js +1 -1
  146. package/build/dist/api/modules/meridian/predict-read.js +1 -1
  147. package/build/dist/api/modules/meridian/rfq.js +1 -1
  148. package/build/dist/api/modules/merkl/discovery.js +1 -1
  149. package/build/dist/api/modules/merkl/index.js +1 -1
  150. package/build/dist/api/modules/merkl/manage.js +1 -1
  151. package/build/dist/api/modules/merkl/protocol.js +1 -1
  152. package/build/dist/api/modules/morpho/allocator.js +1 -1
  153. package/build/dist/api/modules/morpho/bundles.js +1 -1
  154. package/build/dist/api/modules/morpho/in-kind.js +1 -1
  155. package/build/dist/api/modules/morpho/index.js +1 -1
  156. package/build/dist/api/modules/morpho/local-guard.js +1 -1
  157. package/build/dist/api/modules/morpho/midnight.js +1 -1
  158. package/build/dist/api/modules/morpho/protocol.js +1 -1
  159. package/build/dist/api/modules/morpho/vault-management.js +1 -1
  160. package/build/dist/api/modules/morpho/vault-tools.js +1 -1
  161. package/build/dist/api/modules/morpho/vault-v2.d.ts +2 -0
  162. package/build/dist/api/modules/morpho/vault-v2.js +1 -1
  163. package/build/dist/api/modules/netnet/card-plan.js +1 -1
  164. package/build/dist/api/modules/netnet/card-read.js +1 -1
  165. package/build/dist/api/modules/netnet/card-recovery.js +1 -1
  166. package/build/dist/api/modules/netnet/desk-action.js +1 -1
  167. package/build/dist/api/modules/netnet/desk-read.js +1 -1
  168. package/build/dist/api/modules/netnet/financial.js +1 -1
  169. package/build/dist/api/modules/netnet/index.js +1 -1
  170. package/build/dist/api/modules/netnet/staking.js +1 -1
  171. package/build/dist/api/modules/orbio/gateway.js +1 -1
  172. package/build/dist/api/modules/orbio/index.js +1 -1
  173. package/build/dist/api/modules/pendle/convert.js +1 -1
  174. package/build/dist/api/modules/pendle/costs.js +1 -1
  175. package/build/dist/api/modules/pendle/index.js +1 -1
  176. package/build/dist/api/modules/pendle/markets.js +1 -1
  177. package/build/dist/api/modules/pendle/positions.js +1 -1
  178. package/build/dist/api/modules/pendle/pricecheck.js +1 -1
  179. package/build/dist/api/modules/pendle/reader.js +1 -1
  180. package/build/dist/api/modules/pendle/redeem.js +1 -1
  181. package/build/dist/api/modules/pendle/trade.js +1 -1
  182. package/build/dist/api/modules/pendle/validate.js +1 -1
  183. package/build/dist/api/modules/pons/claim.js +1 -1
  184. package/build/dist/api/modules/pons/holder-directory.js +1 -1
  185. package/build/dist/api/modules/pons/index.js +1 -1
  186. package/build/dist/api/modules/pons/launch-status.js +1 -1
  187. package/build/dist/api/modules/pons/reads.js +1 -1
  188. package/build/dist/api/modules/pons/trade.d.ts +3 -2
  189. package/build/dist/api/modules/pons/trade.js +1 -1
  190. package/build/dist/api/modules/poolstrade/index.js +1 -1
  191. package/build/dist/api/modules/priors/coverage.js +1 -1
  192. package/build/dist/api/modules/priors/discovery.js +1 -1
  193. package/build/dist/api/modules/priors/features.js +1 -1
  194. package/build/dist/api/modules/priors/holdings.js +1 -1
  195. package/build/dist/api/modules/priors/index.js +1 -1
  196. package/build/dist/api/modules/priors/integration.d.ts +1 -0
  197. package/build/dist/api/modules/priors/integration.js +1 -1
  198. package/build/dist/api/modules/priors/market.js +1 -1
  199. package/build/dist/api/modules/priors/pt.js +1 -1
  200. package/build/dist/api/modules/priors/savings-exit.js +1 -1
  201. package/build/dist/api/modules/priors/stock-swap.js +1 -1
  202. package/build/dist/api/modules/raeto/authorization.d.ts +30 -0
  203. package/build/dist/api/modules/raeto/authorization.js +1 -0
  204. package/build/dist/api/modules/raeto/copy.d.ts +46 -0
  205. package/build/dist/api/modules/raeto/copy.js +1 -0
  206. package/build/dist/api/modules/raeto/errors.d.ts +4 -0
  207. package/build/dist/api/modules/raeto/errors.js +1 -0
  208. package/build/dist/api/modules/raeto/estimate.d.ts +2 -0
  209. package/build/dist/api/modules/raeto/estimate.js +1 -0
  210. package/build/dist/api/modules/raeto/index.d.ts +16 -0
  211. package/build/dist/api/modules/raeto/index.js +1 -0
  212. package/build/dist/api/modules/raeto/pairing.d.ts +40 -0
  213. package/build/dist/api/modules/raeto/pairing.js +1 -0
  214. package/build/dist/api/modules/raeto/pins.d.ts +24 -0
  215. package/build/dist/api/modules/raeto/pins.js +1 -0
  216. package/build/dist/api/modules/raeto/templates.d.ts +22 -0
  217. package/build/dist/api/modules/raeto/templates.js +1 -0
  218. package/build/dist/api/modules/raeto/terms.d.ts +8 -0
  219. package/build/dist/api/modules/raeto/terms.js +1 -0
  220. package/build/dist/api/modules/raeto/types.d.ts +64 -0
  221. package/build/dist/api/modules/raeto/types.js +0 -0
  222. package/build/dist/api/modules/relay/api.d.ts +16 -0
  223. package/build/dist/api/modules/relay/api.js +1 -1
  224. package/build/dist/api/modules/relay/discovery.js +1 -1
  225. package/build/dist/api/modules/relay/inbound.js +1 -1
  226. package/build/dist/api/modules/relay/index.d.ts +1 -0
  227. package/build/dist/api/modules/relay/index.js +1 -1
  228. package/build/dist/api/modules/relay/order.js +1 -1
  229. package/build/dist/api/modules/relay/outbound-status.js +1 -1
  230. package/build/dist/api/modules/relay/readiness.d.ts +1 -0
  231. package/build/dist/api/modules/relay/readiness.js +1 -1
  232. package/build/dist/api/modules/relay/reads.js +1 -1
  233. package/build/dist/api/modules/relay/vaults.js +1 -1
  234. package/build/dist/api/modules/spark/actions.js +1 -1
  235. package/build/dist/api/modules/spark/index.js +1 -1
  236. package/build/dist/api/modules/spark/management.js +1 -1
  237. package/build/dist/api/modules/steakhouse/analytics.js +1 -1
  238. package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
  239. package/build/dist/api/modules/steakhouse/index.js +1 -1
  240. package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
  241. package/build/dist/api/modules/steakhouse/management.js +1 -1
  242. package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
  243. package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
  244. package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
  245. package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
  246. package/build/dist/api/modules/tickerspring/guards.js +1 -1
  247. package/build/dist/api/modules/tickerspring/index.js +1 -1
  248. package/build/dist/api/modules/tickerspring/journeys.d.ts +1 -0
  249. package/build/dist/api/modules/tickerspring/journeys.js +1 -1
  250. package/build/dist/api/modules/tickerspring/ladder.js +1 -1
  251. package/build/dist/api/modules/tickerspring/maker.js +1 -1
  252. package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
  253. package/build/dist/api/modules/tickerspring/research.js +1 -1
  254. package/build/dist/api/modules/tickerspring/strategies.js +1 -1
  255. package/build/dist/api/modules/uniswap/auction-create.js +1 -1
  256. package/build/dist/api/modules/uniswap/auction.js +1 -1
  257. package/build/dist/api/modules/uniswap/batch.js +1 -1
  258. package/build/dist/api/modules/uniswap/common.js +1 -1
  259. package/build/dist/api/modules/uniswap/fee-percent.d.ts +4 -0
  260. package/build/dist/api/modules/uniswap/fee-percent.js +1 -0
  261. package/build/dist/api/modules/uniswap/fees.js +1 -1
  262. package/build/dist/api/modules/uniswap/index.js +1 -1
  263. package/build/dist/api/modules/uniswap/local-guard.d.ts +2 -0
  264. package/build/dist/api/modules/uniswap/local-guard.js +1 -1
  265. package/build/dist/api/modules/uniswap/oracle.js +1 -1
  266. package/build/dist/api/modules/uniswap/pool-math.js +1 -1
  267. package/build/dist/api/modules/uniswap/pools.d.ts +2 -0
  268. package/build/dist/api/modules/uniswap/pools.js +1 -1
  269. package/build/dist/api/modules/uniswap/position.js +1 -1
  270. package/build/dist/api/modules/uniswap/protocol.js +1 -1
  271. package/build/dist/api/modules/uniswap/quote-guard.d.ts +38 -0
  272. package/build/dist/api/modules/uniswap/quote-guard.js +1 -0
  273. package/build/dist/api/modules/uniswap/token-jar.js +1 -1
  274. package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
  275. package/build/dist/api/modules/uniswap/trade.d.ts +10 -3
  276. package/build/dist/api/modules/uniswap/trade.js +1 -1
  277. package/build/dist/api/modules/uniswap/v2.js +1 -1
  278. package/build/dist/api/modules/uniswap/v3.js +1 -1
  279. package/build/dist/api/modules/uniswap/v4.d.ts +6 -0
  280. package/build/dist/api/modules/uniswap/v4.js +1 -1
  281. package/build/dist/api/modules/uniswap/wrap.js +1 -1
  282. package/build/dist/api/modules/velora/claims.js +1 -1
  283. package/build/dist/api/modules/velora/delta-reads.js +1 -1
  284. package/build/dist/api/modules/velora/index.js +1 -1
  285. package/build/dist/api/modules/wormhole/index.js +1 -1
  286. package/build/dist/api/modules/wormhole/scan-text.js +1 -1
  287. package/build/dist/api/modules/wormhole/swap-token-verdict.js +1 -1
  288. package/build/dist/api/modules/wormhole/third-party-text.d.ts +14 -3
  289. package/build/dist/api/modules/wormhole/third-party-text.js +1 -1
  290. package/build/dist/api/modules/wormhole/token-check.js +1 -1
  291. package/build/dist/api/modules/wormhole/x402-client.js +1 -1
  292. package/build/dist/api/oak-fee.d.ts +12 -0
  293. package/build/dist/api/oak-fee.js +1 -0
  294. package/build/dist/api/param-text.d.ts +22 -0
  295. package/build/dist/api/param-text.js +1 -0
  296. package/build/dist/api/position-economics.d.ts +70 -0
  297. package/build/dist/api/position-economics.js +1 -0
  298. package/build/dist/api/positions.d.ts +8 -5
  299. package/build/dist/api/positions.js +1 -1
  300. package/build/dist/api/prices.d.ts +3 -0
  301. package/build/dist/api/prices.js +1 -1
  302. package/build/dist/api/progress.d.ts +7 -0
  303. package/build/dist/api/progress.js +1 -0
  304. package/build/dist/api/read-budgets.d.ts +4 -0
  305. package/build/dist/api/read-budgets.js +1 -0
  306. package/build/dist/api/read-shape.d.ts +45 -0
  307. package/build/dist/api/read-shape.js +1 -0
  308. package/build/dist/api/revert.d.ts +23 -0
  309. package/build/dist/api/revert.js +1 -0
  310. package/build/dist/api/routes.js +1 -1
  311. package/build/dist/api/rpc.d.ts +1 -0
  312. package/build/dist/api/rpc.js +1 -1
  313. package/build/dist/api/secret-fields.js +1 -1
  314. package/build/dist/api/send.js +1 -1
  315. package/build/dist/api/signing-registry.d.ts +8 -0
  316. package/build/dist/api/signing-registry.js +1 -1
  317. package/build/dist/api/simulate.js +1 -1
  318. package/build/dist/api/swap.d.ts +4 -0
  319. package/build/dist/api/swap.js +1 -1
  320. package/build/dist/api/tokens.d.ts +1 -0
  321. package/build/dist/api/tokens.js +1 -1
  322. package/build/dist/api/tool-policy.js +1 -1
  323. package/build/dist/api/types.d.ts +3 -0
  324. package/build/dist/api/untrusted-unwrap.d.ts +1 -0
  325. package/build/dist/api/untrusted-unwrap.js +1 -0
  326. package/build/dist/api/usd-estimate.d.ts +23 -0
  327. package/build/dist/api/usd-estimate.js +1 -0
  328. package/build/dist/api/vendor-limits.js +1 -1
  329. package/build/dist/chunks/{T7TFUH5K.js → 2E4I7CJ7.js} +1 -1
  330. package/build/dist/chunks/2FHELZ7Y.js +1 -0
  331. package/build/dist/chunks/2GXHYI23.js +1 -0
  332. package/build/dist/chunks/2LWBN35N.js +1 -0
  333. package/build/dist/chunks/{4HG6FRVH.js → 2OKYXT25.js} +1 -1
  334. package/build/dist/chunks/2SUHQWND.js +1 -0
  335. package/build/dist/chunks/2ZWKIBJT.js +1 -0
  336. package/build/dist/chunks/32RXFUOH.js +1 -0
  337. package/build/dist/chunks/3CH2IPQL.js +1 -0
  338. package/build/dist/chunks/3DNJTJ2X.js +1 -0
  339. package/build/dist/chunks/3K2N5VFH.js +1 -0
  340. package/build/dist/chunks/3VBIRLU3.js +1 -0
  341. package/build/dist/chunks/3ZABD6ZF.js +2 -0
  342. package/build/dist/chunks/44MB6SA6.js +1 -0
  343. package/build/dist/chunks/4D4ZRZUW.js +1 -0
  344. package/build/dist/chunks/{IPN6Z4JM.js → 4FPV4CRC.js} +1 -1
  345. package/build/dist/chunks/4GNUXN4K.js +1 -0
  346. package/build/dist/chunks/{K4DHHQBI.js → 4JRXEN7C.js} +2 -2
  347. package/build/dist/chunks/4JTTA3BX.js +1 -0
  348. package/build/dist/chunks/4OVIMYNH.js +2 -0
  349. package/build/dist/chunks/{7QIO77VE.js → 4Q2ZBZXM.js} +1 -1
  350. package/build/dist/chunks/4RQAOOO2.js +1 -0
  351. package/build/dist/chunks/4TTDAF4B.js +1 -0
  352. package/build/dist/chunks/523ZIR3J.js +1 -0
  353. package/build/dist/chunks/5DPJQCKJ.js +68 -0
  354. package/build/dist/chunks/5HIHUYA4.js +1 -0
  355. package/build/dist/chunks/5PI57UC2.js +1 -0
  356. package/build/dist/chunks/5RXALTDT.js +1 -0
  357. package/build/dist/chunks/5TUXSOMI.js +1 -0
  358. package/build/dist/chunks/5UAXLWJ2.js +1 -0
  359. package/build/dist/chunks/5XAXJEWM.js +5 -0
  360. package/build/dist/chunks/67BWOVET.js +1 -0
  361. package/build/dist/chunks/6NUNCD5J.js +1 -0
  362. package/build/dist/chunks/{FJ4S4GHY.js → 6PZGDVHV.js} +1 -1
  363. package/build/dist/chunks/{RTAHNWHN.js → 6UVGQYZ3.js} +1 -1
  364. package/build/dist/chunks/753HZZTY.js +1 -0
  365. package/build/dist/chunks/7D73A6KS.js +1 -0
  366. package/build/dist/chunks/7MBVTNLU.js +1 -0
  367. package/build/dist/chunks/7QKYDNF6.js +18 -0
  368. package/build/dist/chunks/7VC53B5X.js +70 -0
  369. package/build/dist/chunks/7VNO46LV.js +1 -0
  370. package/build/dist/chunks/ACH4BSME.js +3 -0
  371. package/build/dist/chunks/AHUCYDBC.js +1 -0
  372. package/build/dist/chunks/AI3VAPA3.js +1 -0
  373. package/build/dist/chunks/AMTRDPVO.js +1 -0
  374. package/build/dist/chunks/APHNOGNS.js +1 -0
  375. package/build/dist/chunks/{BND2UFVW.js → ARI72OYT.js} +1 -1
  376. package/build/dist/chunks/ARLGF5MU.js +1 -0
  377. package/build/dist/chunks/BAIY32AV.js +1 -0
  378. package/build/dist/chunks/BB765L75.js +3 -0
  379. package/build/dist/chunks/BE3A7677.js +1 -0
  380. package/build/dist/chunks/{PAY5PD4H.js → BX46C5ZP.js} +1 -1
  381. package/build/dist/chunks/{XL3LLGIR.js → BZ34ZR65.js} +1 -1
  382. package/build/dist/chunks/C3WBHFLX.js +1 -0
  383. package/build/dist/chunks/C75MT5SD.js +1 -0
  384. package/build/dist/chunks/CAWTAR5V.js +1 -0
  385. package/build/dist/chunks/CNLL4NCR.js +1 -0
  386. package/build/dist/chunks/CO4GCF4L.js +1 -0
  387. package/build/dist/chunks/{P5PYFK7L.js → CQ5WRWV4.js} +1 -1
  388. package/build/dist/chunks/{SJJR4ZBZ.js → CSDN4MYP.js} +1 -1
  389. package/build/dist/chunks/CSOO4SW7.js +1 -0
  390. package/build/dist/chunks/CZL6T2ZQ.js +1 -0
  391. package/build/dist/chunks/D742AYEV.js +1 -0
  392. package/build/dist/chunks/DGCJZ3HO.js +1 -0
  393. package/build/dist/chunks/DNNFKDZR.js +1 -0
  394. package/build/dist/chunks/DPE7SPW7.js +1 -0
  395. package/build/dist/chunks/DSTMEY5F.js +1 -0
  396. package/build/dist/chunks/{FUDAXV5X.js → DYYEA5HB.js} +1 -1
  397. package/build/dist/chunks/EFESPGA2.js +1 -0
  398. package/build/dist/chunks/EGZREEG2.js +1 -0
  399. package/build/dist/chunks/EH5G4O3U.js +1 -0
  400. package/build/dist/chunks/EI6GGPDS.js +20 -0
  401. package/build/dist/chunks/EVBHQQQG.js +1 -0
  402. package/build/dist/chunks/EZZM2GQT.js +2 -0
  403. package/build/dist/chunks/F3VDVTMS.js +1 -0
  404. package/build/dist/chunks/F4UQEPJT.js +1 -0
  405. package/build/dist/chunks/FHTNMGFR.js +1 -0
  406. package/build/dist/chunks/FJLJ7ZQ5.js +1 -0
  407. package/build/dist/chunks/{WP6RHXGN.js → FL5SSHUL.js} +1 -1
  408. package/build/dist/chunks/FNGIJKMZ.js +1 -0
  409. package/build/dist/chunks/{KIFZ5ZSK.js → FOD34G2H.js} +1 -1
  410. package/build/dist/chunks/{WV3A3OUU.js → FOKEFXGP.js} +1 -1
  411. package/build/dist/chunks/FV4WZOTD.js +1 -0
  412. package/build/dist/chunks/FWIFTPSE.js +2 -0
  413. package/build/dist/chunks/FZ6IJZZM.js +1 -0
  414. package/build/dist/chunks/G2LAO23N.js +1 -0
  415. package/build/dist/chunks/GDRQ2ANN.js +1 -0
  416. package/build/dist/chunks/GG24LO2R.js +1 -0
  417. package/build/dist/chunks/GLF7WEY2.js +1 -0
  418. package/build/dist/chunks/GQ3XZFRL.js +1 -0
  419. package/build/dist/chunks/{QU5XKRGK.js → GQYV4TFO.js} +1 -1
  420. package/build/dist/chunks/GRSXWQWD.js +1 -0
  421. package/build/dist/chunks/{DL6AEWEM.js → GSFHM5L3.js} +1 -1
  422. package/build/dist/chunks/{QHBS3PVU.js → H5DY7CNB.js} +1 -1
  423. package/build/dist/chunks/HCBX4NFM.js +1 -0
  424. package/build/dist/chunks/HHO5ISMM.js +1 -0
  425. package/build/dist/chunks/HIX5N25Z.js +1 -0
  426. package/build/dist/chunks/HKVQ646Q.js +1 -0
  427. package/build/dist/chunks/IEG6GLFR.js +1 -0
  428. package/build/dist/chunks/INOYMBWE.js +1 -0
  429. package/build/dist/chunks/IV4K7FMD.js +1 -0
  430. package/build/dist/chunks/{PIIHOXWF.js → J73ATSEQ.js} +1 -1
  431. package/build/dist/chunks/JBTOZ6IH.js +1 -0
  432. package/build/dist/chunks/JESMX2UC.js +1 -0
  433. package/build/dist/chunks/JJGZ7W3V.js +1 -0
  434. package/build/dist/chunks/JKRBGAX2.js +1 -0
  435. package/build/dist/chunks/JLRHM2DQ.js +1 -0
  436. package/build/dist/chunks/JOKL5L6X.js +1 -0
  437. package/build/dist/chunks/JS53DQVT.js +1 -0
  438. package/build/dist/chunks/{WIRBCS4W.js → JWR5XVP2.js} +1 -1
  439. package/build/dist/chunks/{JFYBH3DX.js → K6D6SDIG.js} +1 -1
  440. package/build/dist/chunks/K7HTDKAT.js +1 -0
  441. package/build/dist/chunks/{2VXLVXIB.js → KDGSYNOP.js} +1 -1
  442. package/build/dist/chunks/KKPMOAVI.js +1 -0
  443. package/build/dist/chunks/KREBNL2D.js +1 -0
  444. package/build/dist/chunks/L646YWDP.js +1 -0
  445. package/build/dist/chunks/{GSBIERZD.js → LR4XTZ37.js} +1 -1
  446. package/build/dist/chunks/LVFI74ST.js +1 -0
  447. package/build/dist/chunks/{QBIY6FQN.js → M7ZXDLKM.js} +1 -1
  448. package/build/dist/chunks/MVD3KWPP.js +1 -0
  449. package/build/dist/chunks/N245WC5R.js +1 -0
  450. package/build/dist/chunks/{WTXC3XKW.js → N4XNNXOJ.js} +1 -1
  451. package/build/dist/chunks/N6GIC7HJ.js +1 -0
  452. package/build/dist/chunks/{RUC7KH7A.js → NA424YAL.js} +1 -1
  453. package/build/dist/chunks/NUFZUKYS.js +1 -0
  454. package/build/dist/chunks/{XD6X3KTC.js → O3JWCJIF.js} +1 -1
  455. package/build/dist/chunks/OARVU3RC.js +1 -0
  456. package/build/dist/chunks/OEZ7FCLF.js +1 -0
  457. package/build/dist/chunks/{H43RNCX2.js → OUROA7XR.js} +1 -1
  458. package/build/dist/chunks/{2MT3G7YZ.js → OYJFXEDU.js} +1 -1
  459. package/build/dist/chunks/OYPAVXGQ.js +1 -0
  460. package/build/dist/chunks/{SMYWWIE6.js → OZ5MDUD2.js} +1 -1
  461. package/build/dist/chunks/P6OMKZMR.js +3 -0
  462. package/build/dist/chunks/PV4AK32X.js +1 -0
  463. package/build/dist/chunks/{HKEMQBFA.js → PXVREXCS.js} +1 -1
  464. package/build/dist/chunks/PZEF5LBL.js +2 -0
  465. package/build/dist/chunks/Q2ACLVWR.js +1 -0
  466. package/build/dist/chunks/QFSBDPLN.js +1 -0
  467. package/build/dist/chunks/QJNLLI6N.js +1 -0
  468. package/build/dist/chunks/QMZEGT5B.js +1 -0
  469. package/build/dist/chunks/{PNA6UIE5.js → REWXG6X6.js} +1 -1
  470. package/build/dist/chunks/{ALLLYOUG.js → RLI4JDOL.js} +1 -1
  471. package/build/dist/chunks/{UD2XMNIT.js → RLMVA575.js} +1 -1
  472. package/build/dist/chunks/RPB46QAC.js +1 -0
  473. package/build/dist/chunks/{Q42YI3EP.js → RT7IU6TI.js} +1 -1
  474. package/build/dist/chunks/{ER47KGRM.js → SBY4RJ7I.js} +1 -1
  475. package/build/dist/chunks/SCG5HWMN.js +1 -0
  476. package/build/dist/chunks/{XQA5LCL6.js → SENOU5JR.js} +1 -1
  477. package/build/dist/chunks/SKEKXEUU.js +1 -0
  478. package/build/dist/chunks/SOTYQGPT.js +1 -0
  479. package/build/dist/chunks/SZ466I5X.js +1 -0
  480. package/build/dist/chunks/{GNC6RXLT.js → TDZTC5WR.js} +1 -1
  481. package/build/dist/chunks/TE6D3OIX.js +1 -0
  482. package/build/dist/chunks/TID4C2KC.js +1 -0
  483. package/build/dist/chunks/TK55VASJ.js +2 -0
  484. package/build/dist/chunks/TM7Z5SA4.js +1 -0
  485. package/build/dist/chunks/TNJTET4G.js +1 -0
  486. package/build/dist/chunks/TPEKCXVE.js +1 -0
  487. package/build/dist/chunks/TVIMP5CK.js +1 -0
  488. package/build/dist/chunks/U2YCQWZK.js +1 -0
  489. package/build/dist/chunks/U363GQTF.js +1 -0
  490. package/build/dist/chunks/{U4JGEMKT.js → UEDGYZOC.js} +1 -1
  491. package/build/dist/chunks/UOCRYXAB.js +1 -0
  492. package/build/dist/chunks/UQEEF5W5.js +1 -0
  493. package/build/dist/chunks/{QQECG3WP.js → UUID2E22.js} +1 -1
  494. package/build/dist/chunks/UWBKAWX3.js +7 -0
  495. package/build/dist/chunks/V37L4DU4.js +1 -0
  496. package/build/dist/chunks/VR344DAZ.js +1 -0
  497. package/build/dist/chunks/{TX2EOIRS.js → VST6LFUB.js} +1 -1
  498. package/build/dist/chunks/VTPT5544.js +1 -0
  499. package/build/dist/chunks/VVWFB53Q.js +1 -0
  500. package/build/dist/chunks/WHTRPRRD.js +1 -0
  501. package/build/dist/chunks/WHVZ372B.js +1 -0
  502. package/build/dist/chunks/{AFBEZXNV.js → WNWRF4HE.js} +1 -1
  503. package/build/dist/chunks/{4DP2VPXR.js → WOGWLFAL.js} +1 -1
  504. package/build/dist/chunks/WUT7TZYM.js +1 -0
  505. package/build/dist/chunks/XCKTE4ON.js +1 -0
  506. package/build/dist/chunks/XEPCDGN2.js +1 -0
  507. package/build/dist/chunks/XHYFISVV.js +1 -0
  508. package/build/dist/chunks/XPEDQBLI.js +1 -0
  509. package/build/dist/chunks/{QFNT73OF.js → XQ24RSEI.js} +1 -1
  510. package/build/dist/chunks/XRDXFHIK.js +1 -0
  511. package/build/dist/chunks/XTFRPI4G.js +1 -0
  512. package/build/dist/chunks/XVJ7ILKK.js +1 -0
  513. package/build/dist/chunks/XWKK75TO.js +1 -0
  514. package/build/dist/chunks/{CBLMQ5UU.js → XYPGLG6A.js} +1 -1
  515. package/build/dist/chunks/Y77EVVT4.js +1 -0
  516. package/build/dist/chunks/YEIM6BZQ.js +1 -0
  517. package/build/dist/chunks/{XSKFKBDR.js → YMV5TL5C.js} +1 -1
  518. package/build/dist/chunks/YSMWCKIX.js +1 -0
  519. package/build/dist/chunks/YTLH4M4Y.js +1 -0
  520. package/build/dist/chunks/YUHNPUNK.js +1 -0
  521. package/build/dist/chunks/YWZQJJYY.js +1 -0
  522. package/build/dist/chunks/{EGYVRQUR.js → ZF2VPDRQ.js} +1 -1
  523. package/build/dist/chunks/ZFU65MB4.js +1 -0
  524. package/build/dist/chunks/ZKZUS3QU.js +1 -0
  525. package/build/dist/chunks/ZOMFHTB2.js +1 -0
  526. package/build/dist/chunks/{OLSP46ZD.js → ZP36DSOD.js} +1 -1
  527. package/build/dist/chunks/ZQ6AF3VX.js +1 -0
  528. package/package.json +1 -1
  529. package/build/dist/chunks/2THSW4QN.js +0 -1
  530. package/build/dist/chunks/2TK3ETUO.js +0 -1
  531. package/build/dist/chunks/35KR3VSS.js +0 -1
  532. package/build/dist/chunks/3GQ7A3VB.js +0 -1
  533. package/build/dist/chunks/3XNZUIRU.js +0 -1
  534. package/build/dist/chunks/46547QT3.js +0 -1
  535. package/build/dist/chunks/4EN6MQEI.js +0 -1
  536. package/build/dist/chunks/4I3OU56B.js +0 -1
  537. package/build/dist/chunks/52ELWNXJ.js +0 -2
  538. package/build/dist/chunks/5AXWBSPG.js +0 -1
  539. package/build/dist/chunks/5N3O42X6.js +0 -1
  540. package/build/dist/chunks/5SMVQCAP.js +0 -1
  541. package/build/dist/chunks/5SZPNZG4.js +0 -1
  542. package/build/dist/chunks/64GOINYS.js +0 -1
  543. package/build/dist/chunks/6I4NTKB2.js +0 -1
  544. package/build/dist/chunks/6JAXZNZ3.js +0 -1
  545. package/build/dist/chunks/6O3Q5B6M.js +0 -1
  546. package/build/dist/chunks/6OGDTEGH.js +0 -1
  547. package/build/dist/chunks/6WZX7C4T.js +0 -2
  548. package/build/dist/chunks/6YB3VOUL.js +0 -1
  549. package/build/dist/chunks/7GJ6SLEV.js +0 -1
  550. package/build/dist/chunks/7KWZ5QJU.js +0 -1
  551. package/build/dist/chunks/7QZOTRSA.js +0 -2
  552. package/build/dist/chunks/7WSHW7KW.js +0 -1
  553. package/build/dist/chunks/A7I4IWUB.js +0 -1
  554. package/build/dist/chunks/ABPL3ZZI.js +0 -1
  555. package/build/dist/chunks/ACW63WIL.js +0 -20
  556. package/build/dist/chunks/AEL62KCG.js +0 -1
  557. package/build/dist/chunks/AKYF5264.js +0 -7
  558. package/build/dist/chunks/AW7AXQCZ.js +0 -1
  559. package/build/dist/chunks/AXRL3REN.js +0 -1
  560. package/build/dist/chunks/BBTPRZ6T.js +0 -1
  561. package/build/dist/chunks/BOVMED7R.js +0 -1
  562. package/build/dist/chunks/BTPXJAUX.js +0 -1
  563. package/build/dist/chunks/C7AXJHBT.js +0 -1
  564. package/build/dist/chunks/CBG5HARQ.js +0 -2
  565. package/build/dist/chunks/CDPSMI3Z.js +0 -1
  566. package/build/dist/chunks/CHXBOXOD.js +0 -1
  567. package/build/dist/chunks/CQEJSCFQ.js +0 -1
  568. package/build/dist/chunks/DBNTZEAJ.js +0 -1
  569. package/build/dist/chunks/DHUDSOGR.js +0 -18
  570. package/build/dist/chunks/DJN3JAWB.js +0 -1
  571. package/build/dist/chunks/FEYAY6OZ.js +0 -1
  572. package/build/dist/chunks/GG6Y4OCJ.js +0 -1
  573. package/build/dist/chunks/GGHBFLRC.js +0 -1
  574. package/build/dist/chunks/GGSAKCND.js +0 -1
  575. package/build/dist/chunks/GRQYTVNT.js +0 -1
  576. package/build/dist/chunks/H6T5FXEX.js +0 -1
  577. package/build/dist/chunks/HHXBUYHO.js +0 -1
  578. package/build/dist/chunks/HQUVB7Z5.js +0 -3
  579. package/build/dist/chunks/HU7IMNBI.js +0 -1
  580. package/build/dist/chunks/HWX36XJI.js +0 -1
  581. package/build/dist/chunks/I26DMNJG.js +0 -1
  582. package/build/dist/chunks/I55MURSJ.js +0 -1
  583. package/build/dist/chunks/IMO3GDA5.js +0 -1
  584. package/build/dist/chunks/IPRVIKYC.js +0 -1
  585. package/build/dist/chunks/IVX4R5OL.js +0 -1
  586. package/build/dist/chunks/JQOQMFWD.js +0 -3
  587. package/build/dist/chunks/JUZ5JU6D.js +0 -70
  588. package/build/dist/chunks/JZS3E66E.js +0 -1
  589. package/build/dist/chunks/K3RDPI5J.js +0 -1
  590. package/build/dist/chunks/KBKK7UNY.js +0 -1
  591. package/build/dist/chunks/KVFZKPJT.js +0 -1
  592. package/build/dist/chunks/L5BLHY34.js +0 -1
  593. package/build/dist/chunks/LKXO2BQS.js +0 -1
  594. package/build/dist/chunks/LKZX4CAA.js +0 -1
  595. package/build/dist/chunks/LYMNHO5T.js +0 -1
  596. package/build/dist/chunks/M2UXYCKH.js +0 -1
  597. package/build/dist/chunks/M37654RL.js +0 -1
  598. package/build/dist/chunks/M6LC6DRE.js +0 -1
  599. package/build/dist/chunks/MOE3EVAL.js +0 -1
  600. package/build/dist/chunks/N4Q6GN65.js +0 -1
  601. package/build/dist/chunks/NAZPDRIF.js +0 -1
  602. package/build/dist/chunks/NKX3FE34.js +0 -1
  603. package/build/dist/chunks/NKZKKCK2.js +0 -1
  604. package/build/dist/chunks/NOFUKKP5.js +0 -1
  605. package/build/dist/chunks/O6ROOKY2.js +0 -1
  606. package/build/dist/chunks/OJ4WJUPP.js +0 -1
  607. package/build/dist/chunks/OOZSE2R7.js +0 -1
  608. package/build/dist/chunks/OTXSKFUD.js +0 -1
  609. package/build/dist/chunks/P5AJSLZ7.js +0 -1
  610. package/build/dist/chunks/PACN53TR.js +0 -1
  611. package/build/dist/chunks/PAHXBLCS.js +0 -1
  612. package/build/dist/chunks/PK66GCDT.js +0 -1
  613. package/build/dist/chunks/PSBQWDYI.js +0 -1
  614. package/build/dist/chunks/PXT5YTWU.js +0 -1
  615. package/build/dist/chunks/PZGGE5D3.js +0 -1
  616. package/build/dist/chunks/QA2RRIES.js +0 -1
  617. package/build/dist/chunks/QA3UHEO3.js +0 -1
  618. package/build/dist/chunks/QW2OPEYJ.js +0 -1
  619. package/build/dist/chunks/QYVREJYC.js +0 -1
  620. package/build/dist/chunks/ROFPXEQ5.js +0 -2
  621. package/build/dist/chunks/RTGS7RIO.js +0 -1
  622. package/build/dist/chunks/RUX3RY7Y.js +0 -1
  623. package/build/dist/chunks/RVDUSNWW.js +0 -1
  624. package/build/dist/chunks/S5CBVFHY.js +0 -1
  625. package/build/dist/chunks/SIYUNOLI.js +0 -1
  626. package/build/dist/chunks/TEJ7W534.js +0 -1
  627. package/build/dist/chunks/TPBAFS7K.js +0 -1
  628. package/build/dist/chunks/TVWMTMEF.js +0 -1
  629. package/build/dist/chunks/U2RMUVVY.js +0 -1
  630. package/build/dist/chunks/U5PMVP56.js +0 -1
  631. package/build/dist/chunks/V5JWGWXC.js +0 -1
  632. package/build/dist/chunks/VCOTCVKN.js +0 -1
  633. package/build/dist/chunks/VEQBHI6O.js +0 -1
  634. package/build/dist/chunks/VNV6ZISN.js +0 -1
  635. package/build/dist/chunks/VYAJXLND.js +0 -1
  636. package/build/dist/chunks/WCNHZYQQ.js +0 -1
  637. package/build/dist/chunks/X2P55AC3.js +0 -1
  638. package/build/dist/chunks/XBE3B6Y2.js +0 -1
  639. package/build/dist/chunks/XKSVTN5X.js +0 -1
  640. package/build/dist/chunks/XSRIJUFU.js +0 -1
  641. package/build/dist/chunks/YCZPSMZ5.js +0 -1
  642. package/build/dist/chunks/YN56C7PN.js +0 -1
  643. package/build/dist/chunks/YRNXGQJC.js +0 -1
  644. package/build/dist/chunks/YWRLY5EA.js +0 -1
  645. package/build/dist/chunks/YWSX6IE6.js +0 -1
  646. package/build/dist/chunks/YXTSWRV5.js +0 -1
  647. package/build/dist/chunks/Z6LZGCVW.js +0 -1
  648. package/build/dist/chunks/ZQWZGH7V.js +0 -1
  649. package/build/dist/chunks/ZSN4IRI5.js +0 -1
  650. package/build/dist/chunks/ZV5HIQXC.js +0 -1
  651. package/build/dist/chunks/ZXJ24B4L.js +0 -1
@@ -1 +0,0 @@
1
- import{a as k,b as P,d as R,e as x,f as U,g as $}from"./PIIHOXWF.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 +0,0 @@
1
- import{e as B,f as te,g as W,i as se,j as T}from"./IPN6Z4JM.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"./2THSW4QN.js";import{f as K,g as Z}from"./ALLLYOUG.js";import{a as F}from"./QHBS3PVU.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 +0,0 @@
1
- import{a as Be}from"./EGYVRQUR.js";import{a as y}from"./WWNAGOCD.js";import{A as qe,s as oe,x as xe}from"./2THSW4QN.js";import{a as w,b as re,d as ve,e as A,f as d,h as $,i as q,j as k,k as N,l as H,m as R,n as ie,o as f,p as c,q as I,r as j,s as He,t as Se}from"./T7TFUH5K.js";import{b as K,f as Pe,g as V,h as Te,i as Le}from"./MQK6OP7S.js";import{i as ne}from"./7KWZ5QJU.js";import{a as be}from"./QHBS3PVU.js";import{s as ge}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as _e,encodeFunctionData as Qe,erc20Abi as We,formatUnits as Ae,getAddress as ue,parseAbi as _,zeroAddress as b,zeroHash as se}from"viem";var Ge="hookr_launch",g=ue(K.launcherV1),z=ue(K.rulesV1),Je=[{type:"tuple",components:[{name:"flags",type:"uint16"},{name:"minScore",type:"uint32"},{name:"tierScore",type:"uint32"},{name:"tierPips",type:"uint24"},{name:"reviewers",type:"bytes32"}]}],X=(a,n=Object.keys(a))=>({type:"object",properties:a,required:n,additionalProperties:!1}),Re={type:"string",pattern:"^0x[0-9a-fA-F]{40}$"},ae=X({token:{oneOf:[X({kind:{const:"new",type:"string"},name:{type:"string",minLength:1,maxLength:48},symbol:{type:"string",minLength:1,maxLength:12},supply:w,salt:re}),X({kind:{const:"existing",type:"string"},address:Re})]},quote:{...Re,description:"Qualified ETH (zero address) or pinned USDG quote. Other quote funding routes await qualification."},sqrtPriceX96:{...w,description:"Integer sqrt(currency1/currency0) times 2^96 for the sorted PoolKey."},tickLower:{type:"integer",minimum:-887272,maximum:887272},tickUpper:{type:"integer",minimum:-887272,maximum:887272},liquidity:w,amount0Max:w,amount1Max:w,agentGate:X({minScore:w,tierScore:w,tierPips:w,reviewerSetId:re}),lpRewardsBps:w,arbRecapture:{type:"boolean"},deadline:w});function Ye(a){let n=A(a,Object.keys(ae.properties),ae.required),r=R(n.token);if(r.kind==="existing")throw A(r,["kind","address"],["kind","address"]),q(r.address),new o("Existing-token Hookr launches await a qualified funding route. Use token.kind new.");if(A(r,["kind","name","symbol","supply","salt"],["kind","name","symbol","supply","salt"]),r.kind!=="new")throw new o("Choose token.kind new; existing tokens are not supported yet.");let e=(P,M)=>{if(typeof P!="string"||!P.trim()||new TextEncoder().encode(P).length>M||[...P].some(Q=>Q.codePointAt(0)<32)||/[\u007f-\u009f\u2028-\u202e\u2066-\u2069\ud800-\udfff]/u.test(P))throw new o(`Use nonempty public token text within ${M} UTF-8 bytes without control characters.`);return P},i=d(r.supply,108);if(!i)throw new o("Hookr new-token supply must be positive and at most 2^108-1 base units.");let t=q(n.quote);if(![b,ue(ge.mainnet.usdg)].includes(t))throw new o("Use native ETH (zero address) or the pinned USDG quote; other quote funding routes await qualification.");let l=n.tickLower,u=n.tickUpper;if(typeof l!="number"||typeof u!="number")throw new o("Provide integer aligned Hookr ticks.");xe(l,u,y.tickSpacing);let s=d(n.sqrtPriceX96,160);if(s<=ne(l)||s>=ne(u))throw new o("Hookr opening price must be strictly inside the aligned tick range.");let p=d(n.liquidity,127);if(!p)throw new o("Hookr liquidity must be positive and at most int128 max.");let m=d(n.amount0Max,128),L=d(n.amount1Max,128),x=qe({liquidity:p,tickLower:l,tickUpper:u,sqrtPriceX96:s,roundUp:!0});if(x.amount0>=1n<<127n||x.amount1>=1n<<127n||!x.amount0||!x.amount1||x.amount0>m||x.amount1>L)throw new o("Hookr exact rounded-up debts must be positive and fit both approved funding caps. Reduce liquidity or increase the caps.");let h=A(n.agentGate,["minScore","tierScore","tierPips","reviewerSetId"],["minScore","tierScore","tierPips","reviewerSetId"]),F=Number(d(h.minScore,32)),S=Number(d(h.tierScore,32)),B=Number(d(h.tierPips,24)),O=$(h.reviewerSetId);if(B>5e4||S===0!=(B===0)||(F!==0||S!==0)!=(O!==se))throw new o("Use tierPips at most 50000, paired nonzero tier score/pips, and a registered reviewer set only for scored gates. Identity-only uses all zero values.");let U=Number(d(n.lpRewardsBps,16));if(U>1e3)throw new o("Hookr LP Rewards plus burn must not exceed 1000 bps; this profile has zero burn.");if(typeof n.arbRecapture!="boolean")throw new o("Choose arbRecapture true or false explicitly.");return{token:{existing:b,name:e(r.name,48),symbol:e(r.symbol,12),supply:i,salt:$(r.salt)},quote:t,sqrtPriceX96:s,tickLower:l,tickUpper:u,liquidity:p,amount0Max:m,amount1Max:L,debts:x,gateTerms:{flags:1,minScore:F,tierScore:S,tierPips:B,reviewers:O},lpRewardsBps:U,arbRecapture:n.arbRecapture,deadline:d(n.deadline,64)}}async function Ze(a,n,r,e){return q(await c(a,g,f("launcherV1"),"predictToken",[n,r],e))}async function et(a,n,r,e,i){let t=r.gate;if(!t.walletAgent||!(e?t.healthyForScores:t.healthyIdentityOnly))throw new o("Hookr needs a healthy on-chain agent identity. Own an ERC-8004 identity or link its current agent wallet on the Hookr gate; Oak setup linking alone is insufficient.");let l=(p,m)=>c(a,t.identity,_(["function balanceOf(address) view returns (uint256)","function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),p,m,i),u=k(await l("balanceOf",[n])),s=!1;if(t.link.linked){let p=BigInt(t.link.agentId);s=q(await l("getAgentWallet",[p]))===n,!s&&u>0n&&(s=q(await l("ownerOf",[p]))===n)}if(!u&&!s||e&&!s)throw new o("Hookr on-chain identity ownership or gate link is missing or stale. Link a current ERC-8004 agent ID on the Hookr gate before launching; scored gates require that link even for an NFT owner.")}async function tt(a,n,r){let e=Ye(n);if(a.network==="testnet")throw new o("Hookr launch requires Robinhood Chain 4663.");let i=a.clientFor(4663),t=await Te(i);if(e.deadline<=t.timestamp||e.deadline>t.timestamp+y.deadlineSeconds)throw new o("Set a fresh Hookr deadline within the next 300 seconds of chain time.");let l=e.gateTerms.reviewers!==se,u=await Be(i,r,t.number,l?[e.gateTerms.reviewers]:[]);if(!u.rootOpenForWallet||u.newMarketsPaused||!u.launcherAdmitted)throw new o("Hookr new markets or the reviewed Launcher are closed. Retry only after registry admission is restored.");await et(i,r,u,l,t.number);let s=await Ze(i,r,e.token,t.number);if(s===b||s===e.quote)throw new o("Hookr predicted token collides with its quote. Choose a fresh salt.");let p={currency0:BigInt(s)<BigInt(e.quote)?s:e.quote,currency1:BigInt(s)<BigInt(e.quote)?e.quote:s,fee:8388608,tickSpacing:y.tickSpacing,hooks:I},m=oe(p),L=p.currency0===s,x=L?e.amount0Max:e.amount1Max,h=L?e.amount1Max:e.amount0Max,F=L?e.debts.amount0:e.debts.amount1,S=L?e.debts.amount1:e.debts.amount0;if(x>e.token.supply)throw new o("Hookr new-token deposit cap exceeds its fixed supply.");let[B,O,U,P,M,Q,Ie,Fe]=await Promise.all([i.getCode({address:s,blockNumber:t.number}),i.getTransactionCount({address:s,blockNumber:t.number}),c(i,g,f("launcherV1"),"memberKey",[s,e.quote,y.tickSpacing,I],t.number),c(i,I,f("rootV1"),"knownPool",[m],t.number),c(i,g,f("launcherV1"),"SKIP_TAKEN",[],t.number),c(i,j,f("registry"),"isQuote",[e.quote],t.number),c(i,j,f("registry"),"quoteIsBraked",[e.quote],t.number),c(i,z,f("rulesV1"),"minProtocolShareBps",[],t.number)]),[Ce,$e]=H(U,2);if(e.token.salt===$(M))throw new o("SKIP_TAKEN is unsupported. Choose an ordinary new-token salt.");if(B&&B!=="0x"||O!==0||N(P)||!N($e)||oe(R(Ce))!==m)throw new o("Hookr token address or pool is already taken or its predicted key differs. Choose a fresh salt and rebuild.");if(!N(Q)||N(H(Ie,2)[0]))throw new o("The Hookr quote is not currently qualified or is braked. Choose an admitted quote.");let ce=R(u.gate.admission),Ne=R(ce.caps),pe=d(Ne.maxLpFeePips,24),Oe=BigInt(u.coreAdmission.caps.maxLpFeePips),W=BigInt(y.baseLpFeePips)+pe;if(BigInt(e.gateTerms.tierPips)>pe||W>Oe||W>600000n)throw new o("Hookr gate tier or total LP fee exceeds the live admission cap. Lower the tier or wait for compatible admission.");let de=q(await c(i,z,f("rulesV1"),"protocolRecipient",[],t.number));await V(i,t.number,[de]);let[Ue,Me,Ee]=H(await c(i,de,_(["function feeTerms(address,bool,bytes32) view returns (uint16,uint16,uint16)"]),"feeTerms",[b,e.arbRecapture,m],t.number),3),le=k(Ue,16),G=k(Ee,16);if(k(Me,16)!==0n||G>10000n)throw new o("Hookr treasury minimum or integrator terms exceed the reviewed profile.");let me=k(Fe,16),E=le>me?le:me;if(E<2000n||E>5000n)throw new o("Hookr protocol share is outside the reviewed 2000\u20135000 bps profile.");let J=BigInt(e.lpRewardsBps)*100n+(!e.arbRecapture&&e.lpRewardsBps===0?G:0n);if(J>BigInt(u.coreAdmission.caps.maxQuoteTakePips))throw new o("Hookr LP Rewards and minimum quote charge exceed the live quote-take cap. Lower LP Rewards.");let Y={on:e.arbRecapture,traderBps:0,lpBps:e.arbRecapture?1e4:0,period:0,maxPrizeBps:0,potReleaseBps:0,minBuyQuote:0n,releaseBlocks:0},he=null;if(e.arbRecapture){let[D,ye]=await Promise.all([c(i,z,_(["function recaptureDefaults() view returns ((bool on,uint16 traderBps,uint16 lpBps,uint32 period,uint16 maxPrizeBps,uint16 potReleaseBps,uint128 minBuyQuote,uint32 releaseBlocks) rc,uint16 potBps)"]),"recaptureDefaults",[],t.number),c(i,j,f("registry"),"activeLaneOf",[I],t.number)]);Y.releaseBlocks=Number(k(R(H(D,2)[0]).releaseBlocks,32));let[Ve,je,ze,Xe]=H(ye,4),te=q(Ve);if(await V(i,t.number,[te]),te===b||$(je)!==Pe(te).codeHash||k(ze,32)===0n||k(Xe,16)>10000n||!Y.releaseBlocks)throw new o("Hookr recapture lane is unavailable. Use arbRecapture false until its executor and gas floor are reviewed.");he=ie(ye)}let we={quote:e.quote,tickSpacing:y.tickSpacing,sqrtPriceX96:e.sqrtPriceX96,tickLower:e.tickLower,tickUpper:e.tickUpper,liquidity:e.liquidity,amount0Max:e.amount0Max,amount1Max:e.amount1Max,config:{subject:s,quote:e.quote,rules:z,advisory:Se,liquidityOwner:g,baseLpFeePips:y.baseLpFeePips,caps:{maxLpFeePips:Number(W),maxQuoteTakePips:Number(J),maxSubjectTakeBps:0},rulesGasLimit:Number(u.coreAdmission.gasLimit),advisoryGasLimit:Number(d(ce.gasLimit,32)),advisoryPhases:1,advisoryFailOpen:!1,policyId:se},rules:{guardEndBlock:0,maxFeePips:y.baseLpFeePips,snipeTaxPips:0,snipeFloorPips:0,snipeDecaySeconds:0,dynamicFeeSens:0,burnBps:0,lpBps:e.lpRewardsBps,potBps:0,royaltyBps:0,protocolShareBps:Number(E),potEveryNBuys:0,maxBuyQuoteAmount:0n,potMinBuyQuote:0n,royaltyTo:b,integrator:b},recapture:Y},v=BigInt(u.launchFee.amount);if(v>10000000000000000n)throw new o("Hookr launch fee exceeds the reviewed 0.01 ETH maximum.");let T=b;if(v&&(await V(i,t.number,[u.launchFee.treasury]),T=q(await c(i,u.launchFee.treasury,_(["function target() view returns (address)"]),"target",[],t.number)),T===b||T===g||T===r||T===He))throw new o("Hookr launch fee recipient is outside the reviewed payment profile.");let Z=v+(e.quote===b?h:0n),ee=[],C=[];if(e.quote!==b){let D=k(await c(i,e.quote,We,"allowance",[r,g],t.number));D!==0n&&D!==h&&C.push(a.approval(e.quote,g,"0",4663)),C.push(a.approval(e.quote,g,h.toString(),4663)),ee.push({token:e.quote,amount:h})}Z&&ee.push({token:be,amount:Z,to:g});let ke=`Launch public, permanent token ${JSON.stringify(e.token.name)} (${JSON.stringify(e.token.symbol)}), fixed supply ${Ae(e.token.supply,18)} (18 decimals). Create one agents-only pool (identity check on every buy). Price currency1/currency0 = ${e.sqrtPriceX96*e.sqrtPriceX96}/${1n<<192n}; sqrtPriceX96 ${e.sqrtPriceX96}, ticks ${e.tickLower} to ${e.tickUpper}, spacing ${y.tickSpacing}. Deposit at most ${e.amount0Max} currency0 and ${e.amount1Max} currency1 base units; exact launch debts ${e.debts.amount0} and ${e.debts.amount1}. Currency0 ${p.currency0}; currency1 ${p.currency1}. Launch fee ${v} wei to ${T} (${Ae(v,18)} ETH). Unused quote funding (${h-S} base units) and retained token supply (${e.token.supply-F} base units) return to ${r} in this transaction. Family owner ${r}; token ${s}; pool ${m}. LP base fee 3000 pips; gate flags 1, scores ${e.gateTerms.minScore}/${e.gateTerms.tierScore}, tier ${e.gateTerms.tierPips} pips; LP Rewards ${e.lpRewardsBps} bps; burn 0; quote-take cap ${J} pips (includes Hookr minimum); protocol share ${E} bps. Arb recapture ${e.arbRecapture}; deadline ${e.deadline}. No lock.`;C.push(a.unsignedTx({to:g,data:Qe({abi:f("launcherV1"),functionName:"launchAdvised",args:[e.token,I,[we],[_e(Je,[e.gateTerms])],e.deadline]}),value:Z.toString(),chainId:4663,description:ke}));let[fe,De,Ke]=await Promise.all([i.getCode({address:s}),i.getTransactionCount({address:s}),i.readContract({address:g,abi:ve,functionName:"launchFee"})]);if(fe&&fe!=="0x"||De!==0||k(H(Ke,5)[0])!==v)throw new o("Hookr collision state or launch fee changed. Request a fresh launch preview.");return await Le(i,t),{txs:C,inputs:ee,summary:ke,tokenAddress:s,poolId:m,feeTarget:T,feeTreasury:u.launchFee.treasury,terms:ie({request:n,blockNumber:t.number,blockHash:t.hash,owner:r,tokenAddress:s,poolId:m,poolKey:p,member:we,gateTerms:e.gateTerms,launchFee:v,feeTarget:T,feeTreasury:u.launchFee.treasury,hookrMinimumPips:G,exactApprovals:C.slice(0,-1),refunds:{quote:h-S,retainedSupply:e.token.supply-F},gasEstimate:null,gasEstimateReason:"The local sender estimates the ordered exact calls after funding approvals and confirms the gas limit and maximum fee.",lane:he,pins:K})}}function nt(a){if(!Array.isArray(a)||a.length<1||a.length>3)throw new o("Hookr launch requires only the locally reconstructed finite approvals and one launch transaction.");for(let n of a)A(n,["to","data","value","chainId","description"],["to","data","value","chainId","description"])}function mt(a,n){if(nt(a),a.length!==n.length||a.some((r,e)=>r.to.toLowerCase()!==n[e].to.toLowerCase()||r.data.toLowerCase()!==n[e].data.toLowerCase()||r.value!==n[e].value||r.chainId!==4663))throw new o("Hookr launch differs from the locally reconstructed exact parameters, approvals and funding.")}function ht(a){return[{name:Ge,inputSchema:ae,execute:async(n,r)=>{let e=await tt(a,n,r);return{txs:e.txs,preview:await a.preview(e.txs,r),terms:e.terms,summary:e.summary}}}]}export{Ge as a,g as b,z as c,ae as d,Ye as e,tt as f,nt as g,mt as h,ht as i};
@@ -1 +0,0 @@
1
- import{b as R}from"./VYAJXLND.js";import{a as w}from"./43LI5NKJ.js";import{g as S}from"./NWNYJ26T.js";import{a as o,i as k,j as v}from"./FWD4L3CJ.js";import{a as t}from"./XSD5NL7J.js";import{encodeFunctionData as x,getAddress as h,keccak256 as A,parseAbi as O,parseAbiItem as T,toHex as C,zeroHash as E}from"viem";var i=h(k[o].vaults.spark.address),g={admin:E,setter:A(C("SETTER_ROLE")),taker:A(C("TAKER_ROLE"))},D=[["drip()","any"],["setVsr(uint256 rate)","setter"],["setVsrBounds(uint256 minimum,uint256 maximum)","admin"],["setDepositCap(uint256 cap)","admin"],["take(uint256 assets)","taker"],["grantRole(bytes32 role,address account)","admin"],["revokeRole(bytes32 role,address account)","admin"],["renounceRole(bytes32 role,address account)","any"],["upgradeToAndCall(address implementation,bytes data)","admin"]],N=D.map(([r,a])=>({abi:T(`function ${r}`),authority:a})),p=O(["function asset() view returns (address)","function hasRole(bytes32,address) view returns (bool)","function getRoleMemberCount(bytes32) view returns (uint256)","function getRoleMember(bytes32,uint256) view returns (address)"]);function _(r){return[{name:"spark_roles",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(a,s)=>{try{if(w(s),Object.keys(a).length)throw new t("Spark roles takes no arguments.");let e=r.clientFor(o);if(await e.getChainId()!==o)throw new t("Spark requires chain 4663.");let u=await e.getBlockNumber({cacheTime:0}),c=await Promise.all(Object.entries(g).map(async([f,d])=>{let l=await e.readContract({address:i,abi:p,functionName:"getRoleMemberCount",args:[d],blockNumber:u});if(l>256n)throw new t("Spark role membership exceeds this reader\u2019s supported size.");let[b,n]=await Promise.all([e.readContract({address:i,abi:p,functionName:"hasRole",args:[d,s],blockNumber:u}),Promise.all(Array.from({length:Number(l)},(y,m)=>e.readContract({address:i,abi:p,functionName:"getRoleMember",args:[d,BigInt(m)],blockNumber:u})))]);return{name:f,role:d,heldByWallet:b,members:n.map(y=>h(y))}}));return{vault:i,chainId:o,blockNumber:u.toString(),roles:c}}catch(e){throw new t(r.plainError(e))}}},{name:"spark_manage",inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:N.map(a=>a.abi.name)},values:{type:"array",maxItems:2,items:{type:"string"},description:"Ordered contract inputs; all integers are decimal base-unit strings."}}},execute:async(a,s)=>{try{if(w(s),Object.keys(a).some(n=>!["operation","values"].includes(n)))throw new t("Unexpected Spark management argument.");let e=N.find(n=>n.abi.name===a.operation);if(!e||!Array.isArray(a.values)||a.values.length!==e.abi.inputs.length)throw new t("Provide a supported Spark operation and its exact ordered values.");let u=e.abi.inputs.map((n,y)=>{let m=a.values[y];if(n.type==="bytes32"){if(typeof m!="string"||!Object.values(g).includes(m))throw new t("Provide a documented Spark role identifier.");return m}return R(n.type,m)});if(e.abi.name==="renounceRole"&&!S(String(u[1]),s))throw new t("Role renunciation must name this wallet.");let c=r.clientFor(o);if(await c.getChainId()!==o)throw new t("Spark requires chain 4663.");let f=await c.readContract({address:i,abi:p,functionName:"asset"});if(h(f)!==h(v))throw new t("Spark does not use canonical USDG.");if(e.authority!=="any"&&await c.readContract({address:i,abi:p,functionName:"hasRole",args:[g[e.authority],s]})!==!0)throw new t("This wallet does not hold the required Spark role. No transaction was built.");let d=`${e.abi.name} on Spark ${i}; ordered values ${JSON.stringify(a.values)}. ${e.abi.name==="upgradeToAndCall"?"Replaces vault implementation; Oak must review and re-pin upgraded code before subsequent use.":e.abi.name==="take"?"Pulls vault liquidity to this role-authorized wallet; it mints no savings shares.":""}`,l=[r.unsignedTx({to:i,data:x({abi:[e.abi],functionName:e.abi.name,args:u}),value:"0",chainId:o,description:d})],b=await r.preview(l,s);return{txs:l,preview:b,summary:`${d} ${b.summary} Role and rate bounds are enforced again by the contract at execution.`}}catch(e){throw new t(r.plainError(e))}}}]}export{N as a,_ as b};
@@ -1 +0,0 @@
1
- import{b as q,o as U}from"./BOVMED7R.js";import{a as ce}from"./RUX3RY7Y.js";import{a as fe,b as pe}from"./XBE3B6Y2.js";import{a as ye}from"./RVDUSNWW.js";import{a as le,b as ue,c as me}from"./ZV5HIQXC.js";import{e as F,h as O,m as de}from"./PV5FDT6O.js";import{b as se}from"./SPJCSEKP.js";import{a as B}from"./IOYRL6AY.js";import{c as ae}from"./VEQBHI6O.js";import{c as D,e as x,g as k,k as te,l as oe,m as re,n as ie}from"./NWNYJ26T.js";import{a as h,i as ne}from"./FWD4L3CJ.js";import{a as i}from"./XSD5NL7J.js";import{a as N}from"./JXOEJPJ4.js";import{decodeFunctionResult as Ie,encodeAbiParameters as j,encodeFunctionData as M,erc20Abi as J,isAddress as Pe,parseAbi as Ae,parseAbiParameters as V,toHex as W,zeroAddress as z}from"viem";var A=ne[h].clanker,he=Ae(["function deployToken(((address tokenAdmin,string name,string symbol,bytes32 salt,string image,string metadata,string context,uint256 originatingChainId) tokenConfig,(address hook,address pairedToken,int24 tickIfToken0IsClanker,int24 tickSpacing,bytes poolData) poolConfig,(address locker,address[] rewardAdmins,address[] rewardRecipients,uint16[] rewardBps,int24[] tickLower,int24[] tickUpper,uint16[] positionBps,bytes lockerData) lockerConfig,(address mevModule,bytes mevModuleData) mevModuleConfig,(address extension,uint256 msgValue,uint16 extensionBps,bytes extensionData)[] extensionConfigs) config) payable returns (address)","function tokenDeploymentInfo(address) view returns ((address,address,address,address[]))"]),T=Ae(["function availableFees(address,address) view returns (uint256)","function claim(address,address)","function collectRewards(address)","function mevModuleEnabled(bytes32) view returns (bool)","function mevModuleOperational(bytes32) returns (bool)"]),C={address:A.paired_weth.address,symbol:"WETH",decimals:18,chainId:h},Se="https://www.clanker.world/api/tokens",ge={type:"string",pattern:"^\\d+$"},be={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"};function I(e){return oe(te(e,F),F)}function we(e,t){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new i(`Provide an explicit bytes32 ${t}.`);return e}function P(e,t,s=!1){if(e===void 0&&!s)return"";if(typeof e!="string"||s&&!e.trim())throw new i(`Provide ${t} as text.`);return e}function Z(e,t=256){return ie(e,`Amount exceeds the uint${t} range.`,{bits:t})}function G(e){return re(e,"The contract returned an invalid amount.").toString()}function L(e,t){let s=Object.keys(e).find(u=>!t.includes(u));if(s)throw new i(`Unsupported Clanker input: ${s}.`)}function ke(e,t){return t.changes.map(({token:s,amount:u})=>{let b=u.startsWith("-");return`${b?"-":"+"}${e.formatAmount(b?u.slice(1):u,s.decimals)} ${s.symbol} (${s.address}, chain ${s.chainId})`}).join("; ")}function ve(e){return x(e)&&Array.isArray(e.data)&&Number.isSafeInteger(e.total)&&Number(e.total)>=0&&Number.isSafeInteger(e.tokensDeployed)&&Number(e.tokensDeployed)>=0&&(e.cursor===null||e.cursor===void 0||typeof e.cursor=="string")&&e.data.every(t=>x(t)&&typeof t.name=="string"&&typeof t.symbol=="string"&&Number.isSafeInteger(t.chain_id)&&["contract_address","admin","msg_sender","factory_address"].every(s=>typeof t[s]=="string"&&Pe(t[s],{strict:!1})))}function K(e,t=0){return typeof e=="string"?N(e):e===null||typeof e=="boolean"?e:typeof e=="number"?Number.isFinite(e)?e:null:t>=4?null:Array.isArray(e)?e.slice(0,20).map(s=>K(s,t+1)):x(e)?Object.fromEntries(Object.entries(e).filter(([s])=>/^[A-Za-z0-9_]{1,40}$/.test(s)).slice(0,40).map(([s,u])=>[s,K(u,t+1)])):null}function _e(e){return{...K(e),contract_address:e.contract_address,admin:e.admin,msg_sender:e.msg_sender,chain_id:e.chain_id,factory_address:e.factory_address,name:N(e.name),symbol:N(e.symbol)}}function $e(e){try{if(typeof e!="string"||!/^[A-Za-z0-9_-]{1,256}={0,2}$/.test(e))throw new Error;let t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(!x(t)||typeof t.id!="string"||!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z?$/.test(t.id)||!Number.isFinite(Date.parse(t.id)))throw new Error;return e}catch{throw new i("Use the cursor returned by the previous clanker_browse page.")}}async function Ne(e,t={}){L(t,["q","limit","cursor","deployer"]);let s=t.limit??10;if(typeof s!="number"||!Number.isInteger(s)||s<1||s>20)throw new i("Choose an indexer limit from 1 to 20.");let u=new URL(Se);u.searchParams.set("chainId",String(h)),u.searchParams.set("limit",String(s)),t.q!==void 0&&u.searchParams.set("q",P(t.q,"search")),t.cursor!==void 0&&u.searchParams.set("cursor",P(t.cursor,"cursor",!0)),t.deployer!==void 0&&u.searchParams.set("msgSender",I(t.deployer));let b=await ae(e.http,u.toString(),{headers:{"User-Agent":"Oak-Clanker/1.0"}},ve);return{tokens:b.data.filter(S=>S.chain_id===h&&k(S.factory_address,A.factory.address)),total:b.total,cursor:b.cursor||null,tokensDeployed:b.tokensDeployed}}var De=e=>{let t=()=>e.clientFor(h),s=async n=>{try{return await n()}catch(o){throw new i(e.plainError(o))}},u=(n,o,a,c="0")=>e.unsignedTx({to:n,data:o,value:c,chainId:h,description:a}),b=async(n,o)=>G(await t().readContract({address:A.fee_locker.address,abi:T,functionName:"availableFees",args:[n,o]})),S=async n=>{if(k(n,C.address))return C;let[o,a]=await Promise.all([t().readContract({address:n,abi:J,functionName:"symbol"}),t().readContract({address:n,abi:J,functionName:"decimals"})]);if(typeof o!="string"||!o.trim()||!Number.isInteger(a)||a<0||a>255)throw new i("The contract returned invalid token metadata.");return{address:n,chainId:h,symbol:o,decimals:a}},Q=async n=>{n.cursor!==void 0&&$e(n.cursor);let o=await Ne(e,n);return{...o,tokens:o.tokens.map(_e)}},xe=async(n,o)=>{if(L(n,["name","symbol","salt","image","metadata","context","vanity","initialBuy","minAmountOut","slippageBps","rewards","vault","airdrop","feeBps","pool"]),n.vanity!==void 0&&n.vanity!==!1)throw new i("Clanker launches use vanity false and an explicit salt.");let a=P(n.name,"token name",!0),c=P(n.symbol,"token symbol",!0),g=we(n.salt,"salt"),y=Z(n.initialBuy??"0"),l=n.slippageBps??q;if(typeof l!="number")throw new i("Slippage must be an integer from 0 to 9999 bps.");U("0",l);let r=n.minAmountOut===void 0?void 0:Z(n.minAmountOut,128);if(r!==void 0&&r<=1n)throw new i("Initial-buy minimum must exceed one base unit.");if(!y&&r!==void 0)throw new i("A minimum requires a positive initial buy.");let m=ue(n,o);O(n.feeBps??100,0,1e3);let f=pe(n);if(y&&!k(f.poolConfig.pairedToken,C.address))throw new i("An initial ETH buy currently requires a WETH-paired pool. Launch without an initial buy and obtain a protected swap quote separately.");let d=n.rewards??[{admin:o,recipient:o,bps:1e4,feePreference:0}];if(!Array.isArray(d)||!d.length||d.length>7)throw new i("Provide one to seven reward allocations.");let w=d.map(p=>{if(!x(p))throw new i("Provide reward allocations as objects.");return L(p,["admin","recipient","bps","feePreference"]),{admin:I(p.admin),recipient:I(p.recipient),bps:O(p.bps,1,1e4),feePreference:O(p.feePreference??0,0,2)}});if(w.reduce((p,v)=>p+v.bps,0)!==1e4)throw new i("Reward allocations must total 10000 bps.");let _={tokenConfig:{tokenAdmin:o,name:a,symbol:c,salt:g,image:P(n.image,"image"),metadata:P(n.metadata,"metadata"),context:n.context===void 0?JSON.stringify({interface:"Oak",platform:"robinhood"}):P(n.context,"context"),originatingChainId:BigInt(h)},poolConfig:f.poolConfig,lockerConfig:{locker:A.locker.address,rewardAdmins:w.map(p=>p.admin),rewardRecipients:w.map(p=>p.recipient),rewardBps:w.map(p=>p.bps),tickLower:f.tickLower,tickUpper:f.tickUpper,positionBps:f.positionBps,lockerData:j(V("(uint8[])"),[[w.map(p=>p.feePreference)]])},mevModuleConfig:{mevModule:A.mev_module.address,mevModuleData:j(V("(uint24,uint24,uint256)"),[[666777,41673,15n]])},extensionConfigs:m},Ce=await t().simulateContract({address:A.factory.address,abi:he,functionName:"deployToken",args:[_],account:o,value:0n,gas:B}),E=I(Ce.result),X=p=>{let v=[...m,...y?[{extension:A.devbuy.address,msgValue:y,extensionBps:0,extensionData:j(V("(address,address,uint24,int24,address),uint128,address"),[[z,z,0,0,z],p,o])}]:[]];return u(A.factory.address,M({abi:he,functionName:"deployToken",args:[{..._,extensionConfigs:v}]}),`Launch ${a} (${c}); initial buy ${y} native ETH base units.`,y.toString())};if(y&&r===void 0){let v=(await e.preview([X(0n)],o)).changes.filter($=>$.token.chainId===h&&k($.token.address,E)&&$.token.decimals===18).reduce(($,ee)=>$+(/^-?\d+$/.test(ee.amount)?BigInt(ee.amount):(()=>{throw new i("Invalid initial-buy simulation amount.")})()),0n);if(v<=0n)throw new i("Initial-buy simulation returned no token output.");if(r=Z(U(v.toString(),l),128),r<=1n)throw new i("Initial-buy output is too small for a protected minimum.")}let Y=[X(r??0n)],H=await e.preview(Y,o);return{txs:Y,preview:H,predictedToken:E,token:{address:E,chainId:h,symbol:c,decimals:18},...r!==void 0?{minAmountOut:r.toString()}:{},summary:`Launch ${c} at ${E} (CREATE2 address predicted from simulation); vanity false; salt ${g}. Supply 100000000000000000000000000000 base units (18 decimals). ${f.feeSummary}; protocol adds 20% of LP fees. Pool and LP allocations: ${JSON.stringify(f)}. Reward allocations: ${JSON.stringify(w)}. Extensions: ${JSON.stringify({vault:n.vault,airdrop:n.airdrop})}. Sniper fees 666777 to 41673 over 15 seconds. ${H.summary} ${ke(e,H)}`}},Te=async(n,o)=>{if(L(n,["token","poolId","collect"]),n.collect!==void 0&&typeof n.collect!="boolean")throw new i("collect must be boolean.");if(n.collect===!1&&n.poolId!==void 0)throw new i("poolId requires collection.");if(n.collect===!0&&n.token===void 0)throw new i("Collection requires a Clanker token.");if(n.poolId!==void 0&&n.token===void 0)throw new i("A pool ID requires its Clanker token.");let a=[C],c=[];if(n.token!==void 0){let r=I(n.token);if(k(r,C.address))throw new i("Provide the launched Clanker token, not WETH.");if(n.collect!==!1){let m=await de(e,r),{poolId:f,hook:d,locker:w}=m;if(n.poolId!==void 0&&!k(we(n.poolId,"pool ID for fee collection"),f))throw new i("The supplied pool ID does not match the onchain Clanker pool.");k(m.pairedToken,C.address)||a.splice(0,1,await S(m.pairedToken));let _=await t().readContract({address:d,abi:T,functionName:"mevModuleEnabled",args:[f]});if(typeof _!="boolean")throw new i("The hook returned an invalid MEV guard state.");_&&c.push(u(d,M({abi:T,functionName:"mevModuleOperational",args:[f]}),"Update the Clanker pool MEV guard before collection.")),c.push(u(w,M({abi:T,functionName:"collectRewards",args:[r]}),"Collect pending LP fees into the fee locker."))}a.push(await S(r))}let g;if(c.length){if(await t().getChainId()!==h)throw new i("Fee simulation endpoint is on the wrong chain.");let r=[...c.map(d=>({from:o,gas:W(B),to:d.to,data:d.data,value:W(BigInt(d.value))})),...a.map(d=>({from:o,gas:W(B),to:A.fee_locker.address,data:M({abi:T,functionName:"availableFees",args:[o,d.address]}),value:"0x0"}))],m=await t().request({method:"eth_simulateV1",params:[{blockStateCalls:[{calls:r}],validation:!1,traceTransfers:!1},"latest"]},{retryCount:0});if(!Array.isArray(m)||m.length!==1||!x(m[0])||!Array.isArray(m[0].calls)||m[0].calls.length!==r.length)throw new i("The endpoint returned an unexpected fee simulation response.");let f=m[0].calls;if(!f.every(d=>x(d)&&d.status==="0x1"&&!d.error))throw new i("Clanker fee collection simulation failed.");g=f.slice(c.length).map(d=>{if(!x(d)||typeof d.returnData!="string"||!/^0x[0-9a-fA-F]{64}$/.test(d.returnData))throw new i("The endpoint returned an invalid fee balance.");return G(Ie({abi:T,functionName:"availableFees",data:d.returnData}))})}else g=await Promise.all(a.map(r=>b(o,r.address)));let y=a.flatMap((r,m)=>BigInt(g[m])>0n?[{token:r,amount:g[m]}]:[]);if(!y.length)throw new i("No claimable fees for this wallet; pending LP fees may require the MEV window to end.");for(let{token:r}of y)c.push(u(A.fee_locker.address,M({abi:T,functionName:"claim",args:[o,r.address]}),`Claim ${r.symbol} fees to ${o}.`));let l=await e.preview(c,o);return{txs:c,preview:l,fees:y,summary:`Claim fees to ${o}. WETH fees aggregate across all Clanker launches for this recipient. ${l.summary} ${ke(e,l)}`}},R=(n,o,a,c)=>({name:`clanker_${n}`,inputSchema:{type:"object",properties:o,required:a,additionalProperties:!1},execute:(g,y)=>s(async()=>c(g,I(y)))});return{tools:[R("launch",{name:{type:"string"},symbol:{type:"string"},salt:be,image:{type:"string"},metadata:{type:"string"},context:{type:"string"},vanity:{const:!1},initialBuy:{...ge,description:"Native ETH base units, 18 decimals."},minAmountOut:{...ge,description:"Minimum new token base units, 18 decimals; derived from simulation when omitted."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:q},feeBps:{type:"integer",minimum:0,maximum:1e3,default:100},pool:fe,rewards:{type:"array",minItems:1,maxItems:7,items:{type:"object",properties:{admin:D,recipient:D,bps:{type:"integer",minimum:1,maximum:1e4},feePreference:{type:"integer",minimum:0,maximum:2}},required:["admin","recipient","bps"],additionalProperties:!1}},...le},["name","symbol","salt"],async(n,o)=>{let a=await xe(n,o);return{...a,summary:`${a.summary} After the launch is mined, use clanker_status to inspect ${a.predictedToken} and clanker_claim to collect creator fees.`}}),R("claim",{token:{...D,description:"Launched token; derives its onchain pool and collects pending LP fees before claiming."},poolId:{...be,description:"Optional assertion against the derived pool ID."},collect:{type:"boolean",default:!0,description:"Set false to claim only already-collected fees."}},[],Te),R("browse",{q:{type:"string"},limit:{type:"integer",minimum:1,maximum:20},cursor:{type:"string"},deployer:D},[],Q)],positions:n=>s(async()=>{I(n);let o=new Map,a=new Set,c;do{let l=await Q({deployer:n,limit:20,...c?{cursor:c}:{}});for(let r of l.tokens)k(r.msg_sender,n)&&o.set(r.contract_address.toLowerCase(),r);if(l.cursor&&a.has(l.cursor))throw new i("The Clanker indexer repeated a pagination cursor.");l.cursor&&a.add(l.cursor),c=l.cursor??void 0}while(c);let g=[],y=[C];for(let[l,r]of o){let m=await S(r.contract_address),f={...m,symbol:N(m.symbol)},d=G(await t().readContract({address:f.address,abi:J,functionName:"balanceOf",args:[n]}));g.push({module:"clanker",id:`launch:${l}`,chainId:h,assets:[{token:f,amount:d}],description:`Indexed launch ${r.name}; wallet token balance, not locked LP principal.`}),y.some(w=>k(w.address,f.address))||y.push(f)}for(let l of y){let r=await b(n,l.address);BigInt(r)>0n&&g.push({module:"clanker",id:`fees:${l.address.toLowerCase()}`,chainId:h,assets:[{token:l,amount:r}],description:"Collected fees across launches for this recipient. Pending LP fees excluded; token-side discovery covers indexed launches by this wallet."})}return g})}},ze=e=>se("clanker",[De(e),ce(e),me(e),ye(e)]);export{Ne as a,De as b,ze as c};
@@ -1 +0,0 @@
1
- import{a as H}from"./CDPSMI3Z.js";import{b as Z,c as z,d as J,e as K}from"./QBIY6FQN.js";import{a as W}from"./C7AXJHBT.js";import{a as j}from"./K3RDPI5J.js";import{a as L}from"./A3PN3PK3.js";import{c as V}from"./7WSHW7KW.js";import{b as $,o as q}from"./BOVMED7R.js";import{b as _}from"./SPJCSEKP.js";import{a as x,d as I,e as B}from"./43LI5NKJ.js";import{a as P}from"./66F5ZH34.js";import{g as A,m as R,n as E}from"./NWNYJ26T.js";import{a as h,d as F,i as N,j as S}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{getAddress as O,parseAbi as te}from"viem";var n=O(N[4663].vaults.groveAlm.address),ne="0x29626c2d8ca49a51e4deceec5499e52983c42bd5",m=te(["function asset() view returns (address)","function decimals() view returns (uint8)","function totalAssets() view returns (uint256)","function totalSupply() view returns (uint256)","function balanceOf(address) view returns (uint256)","function maxDeposit(address) view returns (uint256)","function maxWithdraw(address) view returns (uint256)","function previewDeposit(uint256) view returns (uint256)","function previewRedeem(uint256) view returns (uint256)","function performanceFee() view returns (uint256)","function managementFee() view returns (uint256)"]),T=P("Positive integer in token base units."),U={type:"string",description:`Public Grove vault only: ${n}. Defaults to this vault.`},Q={type:"integer",minimum:0,maximum:9999,default:$};function C(t){return E(t,"Amount must be positive and within the uint256 range.",{notString:"Amount must be a positive integer string in base units.",positive:!0})}function v(t){return R(t,"Grove returned an invalid integer read.")}function M(t,d,l){if(x(d),Object.keys(t).some(u=>!["vault",...l].includes(u)))throw new o("Unsupported Grove argument.");if(t.vault!==void 0){if(typeof t.vault!="string")throw new o("Provide the public Grove vault address.");if(t.vault.toLowerCase()===ne)throw new o("The Grove ALM proxy is allocator infrastructure, not the public ERC-4626 vault.");if(x(t.vault),!A(t.vault,n))throw new o("Only the public Grove ERC-4626 vault is supported.")}}function X(t,d,l){let u=l===void 0?$:l;if(typeof u!="number")throw new o("Slippage must be an integer from 0 to 9999 bps.");let e=BigInt(q(t.toString(),u)),a=d===void 0?e:C(d);if(a<=0n||a>t)throw new o("The minimum output must be positive and no greater than the quoted output.");return a}function Y(t,d){let l=0n;for(let u of t.changes)if(!(u.token.chainId!==d.chainId||!A(u.token.address,d.address))){if(u.token.decimals!==d.decimals||typeof u.amount!="string"||!/^-?\d+$/.test(u.amount))throw new o("Grove preview returned invalid token metadata or amounts.");l+=BigInt(u.amount)}return l}var ae=t=>{async function d(e){try{return await e()}catch(a){throw new o(t.plainError(a))}}async function l(){let e=t.clientFor(h);if(await e.getChainId()!==h)throw new o("Grove requires an RPC endpoint on chain 4663.");let a=await e.readContract({address:n,abi:m,functionName:"asset"});if(typeof a!="string"||!A(a,S))throw new o("The public Grove vault must use canonical USDG on chain 4663.");let[i,s,r]=await Promise.all([e.readContract({address:O(S),abi:m,functionName:"decimals"}),e.readContract({address:n,abi:m,functionName:"decimals"}),L(e,n)]);if(i!==F||s!==18)throw new o("Grove token decimals differ from the evidenced USDG/share interface.");let p={address:O(S),chainId:h,decimals:i,symbol:"USDG"};return{client:e,asset:p,shareToken:{address:n,chainId:h,decimals:s,symbol:r}}}async function u(e,a,i,s,r,p){let f=await t.preview(e,a);if(Y(f,i)!==-s)throw new o("Grove simulation did not show the exact requested token outflow.");if(Y(f,r)<p)throw new o("Grove simulated output is below the minimum.");let g=f.changes.map(({token:w,amount:b})=>{let y=b.startsWith("-");return`${y?"-":"+"}${t.formatAmount(y?b.slice(1):b,w.decimals)} ${w.symbol} (${w.address}, chain ${w.chainId})`}).join("; ");return{txs:e,summary:`${f.summary} ${g}. Minimum ${p} base units of ${r.address} is a preview check, not enforced on-chain by standard ERC-4626. Re-preview before signing; execution output can change.`}}return{tools:[z(t,"grove_details",n),j(t,"grove_analytics",n),H(t,"grove_manage",n),...W(t,"grove",n),{name:"grove_list",inputSchema:{type:"object",properties:{vault:U},additionalProperties:!1},execute:(e,a)=>d(async()=>{M(e,a,[]);let{client:i,asset:s,shareToken:r}=await l(),[p,f,c,g,w,b]=await Promise.all([i.readContract({address:n,abi:m,functionName:"totalAssets"}),i.readContract({address:n,abi:m,functionName:"totalSupply"}),i.readContract({address:n,abi:m,functionName:"maxDeposit",args:[a]}),i.readContract({address:n,abi:m,functionName:"maxWithdraw",args:[a]}),i.readContract({address:n,abi:m,functionName:"performanceFee"}),i.readContract({address:n,abi:m,functionName:"managementFee"})]);return[{vault:n,chainId:h,name:"Grove x Steakhouse USDG",asset:s,shareToken:r,totalAssets:{token:s,amount:v(p).toString()},totalSupply:{token:r,amount:v(f).toString()},maxDeposit:v(c)===0n?null:c.toString(),maxWithdraw:v(g)===0n?null:g.toString(),maxViewCaveat:"Zero Morpho V2 maximum views mean unknown capacity. Simulate the requested action; full exits use the fresh share balance.",fees:{performanceFeeRaw:v(w).toString(),managementFeeRaw:v(b).toString(),scale:"1000000000000000000",managementFeeTimeUnit:"second",performanceFeeBasis:"accrued interest"}}]})},{name:"grove_deposit",inputSchema:{type:"object",description:"Deposit USDG in base units (1 USDG = 1000000) for 18-decimal vault shares. Exit with grove_withdraw; check positions after confirmation.",properties:{vault:U,amount:T,minSharesOut:T,slippageBps:Q},required:["amount"],additionalProperties:!1},execute:(e,a)=>d(async()=>{M(e,a,["amount","minSharesOut","slippageBps"]);let i=C(e.amount),{client:s,asset:r,shareToken:p}=await l(),f=v(await s.readContract({address:n,abi:m,functionName:"previewDeposit",args:[i]})),c=X(f,e.minSharesOut,e.slippageBps),g=I(n,r.address,i.toString(),a,h),w=[t.approval(r.address,n,i.toString(),h),t.unsignedTx(g.txs[1])];return u(w,a,r,i,p,c)})},{name:"grove_withdraw",inputSchema:{type:"object",description:"Redeem shares in 18-decimal base units, or shares all for a full exit to USDG. Check positions after confirmation.",properties:{vault:U,shares:{oneOf:[T,{const:"all",description:"Redeem the fresh full share balance."}]},minAmountOut:T,slippageBps:Q,force:{type:"boolean"},maxPenaltyAssets:P()},required:["shares"],additionalProperties:!1},execute:(e,a)=>d(async()=>{M(e,a,["shares","minAmountOut","slippageBps","force","maxPenaltyAssets"]);let i=e.shares==="all"?void 0:C(e.shares),{client:s,asset:r,shareToken:p}=await l(),f=v(await s.readContract({address:n,abi:m,functionName:"balanceOf",args:[a]})),c=i??f;if(c===0n||c>f)throw new o("The Grove share balance is insufficient for this withdrawal.");if(e.force!==void 0&&typeof e.force!="boolean")throw new o("force must be a boolean.");if(e.force===!0){if(e.shares!=="all"||e.slippageBps!==void 0)throw new o("Force exit requires shares all and an explicit minAmountOut; omit slippageBps.");let k=V(e.maxPenaltyAssets),ee=C(e.minAmountOut),G=await Z(t,s,n,a,c,k),D=await t.preview([G.tx],a);return K(D.changes,n,c,ee),{txs:[G.tx],preview:D,summary:`${J(G.plan)} ${D.summary}`}}if(e.maxPenaltyAssets!==void 0)throw new o("maxPenaltyAssets requires force true.");let g=v(await s.readContract({address:n,abi:m,functionName:"previewRedeem",args:[c]})),w=X(g,e.minAmountOut,e.slippageBps),y=B(n,c.toString(),a,h).txs.map(k=>t.unsignedTx({...k,description:`Redeem ${c} Grove share base units to the wallet.`}));return u(y,a,p,c,r,w)})}],positions:e=>d(async()=>{x(e);let{client:a,asset:i,shareToken:s}=await l(),r=v(await a.readContract({address:n,abi:m,functionName:"balanceOf",args:[e]}));if(r===0n)return[];let p=v(await a.readContract({address:n,abi:m,functionName:"previewRedeem",args:[r]}));return[{module:"grove",id:`${h}:${n.toLowerCase()}`,chainId:h,assets:[{token:i,amount:p.toString()}],description:`${t.formatAmount(r.toString(),s.decimals)} Grove shares (${r} base units, ${s.decimals} decimals, ${n}); estimated USDG redemption, subject to simulation.`}]})}},we=t=>_("grove",[ae(t)]);export{ae as a,we as b};
@@ -1 +0,0 @@
1
- import{f as p,g as l}from"./V5JWGWXC.js";import{a as r,g as d}from"./YWSX6IE6.js";import{a}from"./XSD5NL7J.js";async function P(i,t,c={},u){r(t);let o=()=>{if(c.signal?.aborted)throw new a("Chop read was cancelled.")};o();try{let m=await p(i,u);o();let s=i.clientFor(4663),g=await d(s);return[...(await Promise.all(m.logs.map(async n=>{o();let e=await l(s,n,t,g);return o(),BigInt(e.logTokens.amount)===0n&&BigInt(e.stakedLp.amount)===0n&&BigInt(e.pendingChop.amount)===0n?[]:[{module:"chop",id:`4663:${n.log.address}`,chainId:4663,assets:[e.logTokens,e.stakedLp,e.pendingChop],description:`Chop log held: ${e.logTokens.amount} base units; redeemable net underlying ${e.net.amount} base units (${n.underlying.address}, decimals ${n.underlying.decimals}); staked LP ${e.stakedLp.amount} base units; unpaid CHOP ${e.pendingChop.amount} base units.`,oakNotice:e.warnings}]}))).flat(),{module:"chop",id:"4663:coverage",chainId:4663,assets:[],incomplete:!0,description:"Chop positions cover currently verified registry logs only. Delisted or unverified log holdings are not included."}]}catch{return o(),[{module:"chop",id:"4663:coverage",chainId:4663,assets:[],incomplete:!0,description:"Chop positions are incomplete because a chain read is unavailable. Please try again."}]}}export{P as a};
@@ -1,3 +0,0 @@
1
- import{a as ke,b as Te}from"./DL6AEWEM.js";import{b as be,o as we}from"./BOVMED7R.js";import{a as ye}from"./QHBS3PVU.js";import{c as ie}from"./VEQBHI6O.js";import{a as U}from"./66F5ZH34.js";import{b as re,c as N,d as fe,g as p,i as he,n as ge}from"./NWNYJ26T.js";import{a as l,i as oe,l as d}from"./FWD4L3CJ.js";import{a as i}from"./XSD5NL7J.js";import{a as I}from"./JXOEJPJ4.js";import{decodeEventLog as qe,encodeAbiParameters as Oe,encodeFunctionData as M,erc20Abi as j,getAddress as Se,keccak256 as Ue,parseAbi as D,parseAbiItem as Me,toHex as He,zeroAddress as F}from"viem";var ce=oe[l].pons.launchAndBuyRouter.address,ve=oe[l].ponsTrade.state_view.address,J={address:F,chainId:l,symbol:"ETH",decimals:18},f=D(["function getLaunchedToken(address) view returns ((address token,address curve,address deployer,address creatorFeeRecipient,address pairToken,uint256 graduationThreshold,uint24 poolFee,int24 tickSpacing,uint16 creatorTaxBps,bool buybackEnabled,uint8 phase,uint256 sweptQuote,uint256 sweptTokens,uint256 sweptAt,bool exists))","function previewLaunchEconomics(uint256,address) view returns (bytes32)","function launchFee() view returns (uint256)","function canLaunch(address) view returns (bool)","function launchConfigCount() view returns (uint256)","function approvedPairTokens(address) view returns (bool)","function pairTokenEconomics(address) view returns (uint256 phantomQuote,uint256 graduationThreshold,uint8 decimals)","function transferCreatorFeeRecipient(address token,address newRecipient)","function setBuybackEnabled(address token,bool enabled)","function getLaunchConfig(uint256) view returns ((uint256 supply,uint256 curveFeeBps,uint256 phantomQuote,uint256 graduationThreshold,uint24 poolFee,int24 tickSpacing,bool enabled))","function maxCreatorTaxBps() view returns (uint256)","function getLaunchFeePolicy(address) view returns ((address,uint16,uint16,uint16,uint16))","function memeHook() view returns (address)","function createGraduatedPool(address)"]),Q=D(["function factory() view returns (address)","function feeEscrow() view returns (address)","function getReserves() view returns (uint256,uint256)","function realQuoteReserve() view returns (uint256)","function feeBps() view returns (uint256)"]),je=D(["function launchFactory() view returns (address)"]),De=D(["function currentFeePolicy() view returns ((address,uint16,uint16,uint16,uint16))"]),Pe=D(["function getSlot0(bytes32) view returns (uint160,int24,uint24,uint24)","function getLiquidity(bytes32) view returns (uint128)"]),ae=D(["function launchToken((string,string,string,string,(string,string,string,string,string),address,uint16,bool,bytes32,bytes32),uint256,address) payable","function launchToken((string,string,string,string,(string,string,string,string,string),address,uint16,bool,bytes32,bytes32),uint256,address,address[]) payable","function launchAndBuy((string,string,string,string,(string,string,string,string,string),address,uint16,bool,bytes32,bytes32),uint256,address,uint256,uint256,address,address[]) payable"]),Ie=Me("event TokenLaunched(address indexed token,address indexed curve,address indexed deployer,address pairToken,uint256 launchConfigId,uint256 graduationThreshold)"),We=["curve","pending pool creation","graduated","rescued"],Ge=10000n,Ce=2000n;function A(t){return he(t,"Provide a token or wallet address.",fe)}function H(t){return ge(t,"Amount exceeds the uint256 range.",{notString:"Amounts must be integer strings in base units."})}function Ae(t,e){if(typeof t!="string"||!t.trim())throw new i(`Provide ${e}.`);return t}function R(t,e){return{token:t,amount:e.toString()}}function Ne(t,e,n,r,o){let a=t*BigInt(n)/10000n,s=r?(t-a)*BigInt(o)/10000n:0n;return{baseBps:t.toString(),creatorTaxBps:e.toString(),totalBps:(t+BigInt(e)).toString(),protocolBps:a.toString(),creatorBps:(t-a-s+BigInt(e)).toString(),buybackBps:s.toString(),buybackEnabled:r}}async function V(t,e,n){if(p(e,F))return J;let r=t.clientFor(l),[o,a]=await Promise.all([r.readContract({address:e,abi:j,functionName:"symbol",blockNumber:n}),r.readContract({address:e,abi:j,functionName:"decimals",blockNumber:n})]);return{address:Se(e),chainId:l,symbol:I(o),decimals:a}}async function X(t,e,n){let r=t.clientFor(l),[o,a]=await Promise.all([r.readContract({address:e,abi:je,functionName:"launchFactory",blockNumber:n}),r.readContract({address:d,abi:f,functionName:"getLaunchedToken",args:[e],blockNumber:n})]);if(!p(o,d)||!a.exists||!p(a.token,e))throw new i("This token is not a launch from the supported Pons factory.");if(a.phase>3)throw new i("Pons returned an unknown launch phase.");return a}async function ue(t,e,n){let r=t.clientFor(l),o=await X(t,e,n),[a,s,u,c,h,g,y]=await Promise.all([V(t,e,n),V(t,o.pairToken,n),r.readContract({address:e,abi:j,functionName:"totalSupply",blockNumber:n}),r.readContract({address:o.curve,abi:Q,functionName:"factory",blockNumber:n}),r.readContract({address:o.curve,abi:Q,functionName:"feeEscrow",blockNumber:n}),r.readContract({address:d,abi:f,functionName:"memeHook",blockNumber:n}),r.readContract({address:d,abi:f,functionName:"getLaunchFeePolicy",args:[e],blockNumber:n})]);if(!p(c,d))throw new i("The Pons curve does not belong to the supported factory.");let m=BigInt(y[3]),x=o.sweptQuote,b=null,T=null,_=null;if(o.phase===0){let[v,S,w]=await Promise.all([r.readContract({address:o.curve,abi:Q,functionName:"getReserves",blockNumber:n}),r.readContract({address:o.curve,abi:Q,functionName:"realQuoteReserve",blockNumber:n}),r.readContract({address:o.curve,abi:Q,functionName:"feeBps",blockNumber:n})]);if(x=S,m=w,o.graduationThreshold<=0n||v[1]<=0n)throw new i("Pons returned unavailable curve reserves or threshold.");b=S*1000000n/o.graduationThreshold,b>1000000n&&(b=1000000n),T=R(s,v[0]*10n**BigInt(a.decimals)/v[1])}else if(o.phase===2){let v=[e,o.pairToken].sort(($,C)=>BigInt($)<BigInt(C)?-1:1),S=Ue(Oe([{type:"address"},{type:"address"},{type:"uint24"},{type:"int24"},{type:"address"}],[v[0],v[1],o.poolFee,o.tickSpacing,g])),[w,q]=await Promise.all([r.readContract({address:ve,abi:Pe,functionName:"getSlot0",args:[S],blockNumber:n}),r.readContract({address:ve,abi:Pe,functionName:"getLiquidity",args:[S],blockNumber:n})]);if(w[0]===0n)throw new i("The graduated Pons pool price is unavailable.");let E=w[0]**2n,O=10n**BigInt(a.decimals);T=R(s,p(v[0],e)?E*O/(1n<<192n):(1n<<192n)*O/E),_={id:S,sqrtPriceX96:w[0].toString(),tick:w[1],protocolFee:w[2],lpFee:w[3],liquidity:q.toString()},b=1000000n}else o.phase===1&&(b=1000000n);return{token:a,pairToken:s,blockNumber:n.toString(),factory:d,curve:o.curve,hook:g,escrow:h,creator:o.deployer,creatorFeeRecipient:o.creatorFeeRecipient,phase:o.phase,phaseName:We[o.phase],tradable:o.phase===0||o.phase===2,graduationThreshold:R(s,o.graduationThreshold),raised:R(s,x),sweptTokens:R(a,o.sweptTokens),sweptAt:o.sweptAt.toString(),progressPpm:b?.toString()??null,totalSupply:R(a,u),fees:Ne(m,o.creatorTaxBps,y[1],o.buybackEnabled,y[2]),pool:_,spot:T,priceKind:"Marginal spot per whole token; not an execution quote or time average."}}async function Qe(t,e,n,r){let o=t.clientFor(l),[a,s]=await Promise.all([o.readContract({address:e.token.address,abi:j,functionName:"balanceOf",args:[n],blockNumber:r}),p(e.pairToken.address,F)?o.getBalance({address:n,blockNumber:r}):o.readContract({address:e.pairToken.address,abi:j,functionName:"balanceOf",args:[n],blockNumber:r})]),u;try{let c=await ke(t,e.token.address,n,!1,r),h=c.credited.some(g=>BigInt(g.amount)>0n)||BigInt(c.buybackVest.releasable.amount)>0n;u={isRecipient:c.isRecipient,recipient:c.recipient,escrow:c.escrow,credited:c.credited,pendingBeforeSweep:c.pendingBeforeSweep,operatorWait:c.operatorWait??null,buybackVest:c.buybackVest,nextStep:[c.isRecipient&&(h||c.txs.length||c.pendingBeforeSweep.length&&!c.operatorWait)?"pons_claim builds the sweep, vest release and escrow claims for this wallet.":"",!c.isRecipient&&h?"Escrow credits belong to this holder; only the current creator fee recipient can sweep or release this coin.":"",c.operatorWait?`${Te(c.operatorWait)} Oak cannot run it; credited amounts stay claimable.`:""].filter(Boolean).join(" ")||"Nothing to sweep or claim for this holder."}}catch(c){u={unavailable:t.plainError(c)}}return{holder:n,holding:R(e.token,a),pairBalance:R(e.pairToken,s),creatorFees:u,note:"Sell the actual holding shown here, not a quoted output. Balances are read at the status block."}}async function Ve(t,e,n){try{let r=await t.clientFor(l).getBlockNumber({cacheTime:0}),o=await ue(t,A(e),r);return n===void 0?o:{...o,account:await Qe(t,o,A(n),r)}}catch(r){throw new i(t.plainError(r))}}var xe="https://ponsfamily.com/api/launches",ze=t=>{let e=t;return!!e&&Array.isArray(e.items)&&e.items.length<=100&&(e.nextCursor===null||e.nextCursor===void 0||typeof e.nextCursor=="string")&&e.items.every(n=>!!n&&typeof n.address=="string"&&re.test(n.address)&&typeof n.factory=="string"&&re.test(n.factory))};async function Je(t,e){let n=e.limit??20;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>40)throw new i("Choose a search or listing limit from 1 to 40.");let r=new URL(xe);if(e.query!==void 0){if(typeof e.query!="string"||!e.query.trim()||e.query.length>100)throw new i("Provide a name, symbol or address query of 1 to 100 characters.");r.searchParams.set("q",e.query.trim())}else r.searchParams.set("sort","newest");if(e.cursor!==void 0){if(e.query!==void 0)throw new i("Search returns one page; use cursor only for the newest-first listing.");if(typeof e.cursor!="string"||!/^[0-9]{1,20}(\.0x[0-9a-fA-F]{40})?$/.test(e.cursor))throw new i("Use the nextCursor returned by the previous pons_browse page.");r.searchParams.set("cursor",e.cursor)}r.searchParams.set("limit",String(n));let o=await ie(t.http,r,{method:"GET",redirect:"error"},ze);if(o.nextCursor&&!/^[0-9]{1,20}(\.0x[0-9a-fA-F]{40})?$/.test(o.nextCursor))throw new i("Pons returned a malformed listing cursor.");let a=o.items.filter(h=>p(h.factory,d)),s=[...new Map(a.map(h=>[h.address.toLowerCase(),Se(h.address)])).values()].slice(0,n),u=await t.clientFor(l).getBlockNumber({cacheTime:0});return{items:await Promise.all(s.map(h=>ue(t,h,u))),statusBlock:u.toString(),source:xe,nextCursor:e.query===void 0?o.nextCursor??null:null,excludedOtherFactories:o.items.length-a.length,coverage:e.query!==void 0?"Pons index search over every launch (one page, at most 40). Results are discovery only; each one was re-read on chain from the pinned factory.":"Newest-first page of Pons's complete launch index; pass nextCursor to continue until it is null. Each item was re-read on chain; launches from other Pons factories are dropped."}}async function Ke(t,e={}){if(e.query!==void 0||e.cursor!==void 0||e.complete===!0)try{if(e.fromBlock!==void 0||e.toBlock!==void 0)throw new i("Use block bounds for an on-chain window, or query/cursor for the Pons index, not both.");return await Je(t,e)}catch(n){throw new i(t.plainError(n))}return Re(t,e)}async function Re(t,e={}){try{let n=t.clientFor(l),r=await n.getBlockNumber({cacheTime:0}),o=e.toBlock===void 0?r:H(e.toBlock),a=e.fromBlock===void 0?o>=Ce?o-Ce+1n:0n:H(e.fromBlock),s=e.limit??20;if(typeof s!="number"||!Number.isInteger(s)||s<1||s>100)throw new i("Choose a launch limit from 1 to 100.");if(a>o||o>r||o-a+1n>Ge)throw new i("Choose an ordered range of at most 10000 mined blocks.");let u=await n.getLogs({address:d,event:Ie,fromBlock:a,toBlock:o,strict:!0}),c=new Map;for(let y of u.filter(m=>p(m.address,d)&&!m.removed&&m.blockNumber!==null&&m.blockNumber>=a&&m.blockNumber<=o).sort((m,x)=>m.blockNumber===x.blockNumber?(x.logIndex??0)-(m.logIndex??0):m.blockNumber>x.blockNumber?-1:1)){let m=A(y.args.token);c.set(m.toLowerCase(),m)}let h=[...c.values()];return{items:await Promise.all(h.slice(0,s).map(y=>ue(t,y,r))),fromBlock:a.toString(),toBlock:o.toString(),statusBlock:r.toString(),truncated:h.length>s,coverage:"Only launches in the requested block range; this is not a complete launch history."}}catch(n){throw new i(t.plainError(n))}}async function K(t,e,n,r){let o=(Array.isArray(e)?e:[e]).map(t.unsignedTx),a=await t.preview(o,n),s=a.changes.map(u=>{let c=u.amount.startsWith("-");return`${c?"-":""}${t.formatAmount(c?u.amount.slice(1):u.amount,u.token.decimals)} ${u.token.symbol} (${u.token.chainId}:${u.token.address})`});return{txs:o,preview:a,summary:`${r} ${a.summary}${s.length?` Changes: ${s.join(", ")}.`:""}`}}var z=["twitter","telegram","discord","website","farcaster"],Be=5242880,$e="https://ponsfamily.com/api/ipfs/image";function se(t,e){if(t==="")return"";if(typeof t!="string"||t.length>2048)throw new i(`Provide a public HTTPS or IPFS ${e}.`);try{let n=new URL(t);if(!["https:","ipfs:"].includes(n.protocol)||!n.hostname||n.username||n.password)throw new Error}catch{throw new i(`Provide a public HTTPS or IPFS ${e}.`)}return t}function Xe(t){if(t===void 0)return;if(!t||typeof t!="object"||Array.isArray(t))throw new i("Provide image mimeType and base64.");let e=t,n={"image/png":"png","image/jpeg":"jpg","image/webp":"webp"};if(Object.keys(e).some(s=>!["mimeType","base64"].includes(s))||typeof e.mimeType!="string"||!n[e.mimeType])throw new i("Use a PNG, JPEG, or WebP image.");if(typeof e.base64!="string"||!e.base64.length||e.base64.length>4*Math.ceil(Be/3)||e.base64.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(e.base64))throw new i("Provide a base64 image of 1 to 5242880 bytes.");let r=atob(e.base64);if(!r.length||r.length>Be||btoa(r)!==e.base64)throw new i("Provide a base64 image of 1 to 5242880 bytes.");let o=Uint8Array.from(r,s=>s.charCodeAt(0));if(!(e.mimeType==="image/png"?r.startsWith(`\x89PNG\r
2
- 
3
- `):e.mimeType==="image/jpeg"?o[0]===255&&o[1]===216&&o[2]===255:r.startsWith("RIFF")&&r.slice(8,12)==="WEBP"))throw new i("Image bytes do not match the declared PNG, JPEG, or WebP type.");return{bytes:o,mimeType:e.mimeType,extension:n[e.mimeType]}}async function Ye(t,e,n){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new i("Provide a mined Pons launch transaction hash.");let o=await t.clientFor(l).getTransactionReceipt({hash:e});if(o.status!=="success"||!p(o.from,n))throw new i("The Pons launch must be a successful transaction from this wallet.");let a=o.logs.flatMap(c=>{if(!p(c.address,d))return[];try{return[qe({abi:[Ie],data:c.data,topics:c.topics,strict:!0}).args]}catch{return[]}}).filter(c=>p(c.deployer,n));if(a.length!==1)throw new i("The receipt does not contain exactly one Pons launch for this wallet.");let s=a[0].token,u=await X(t,s,o.blockNumber);return{transactionHash:e,token:await V(t,s,o.blockNumber),curve:u.curve,creator:u.deployer,creatorFeeRecipient:u.creatorFeeRecipient,chainId:l,summary:`Pons launch mined: ${s}. Creator fee recipient ${u.creatorFeeRecipient}. Use pons_status to inspect the launch and pons_claim to collect creator fees.`}}async function Ze(t,e,n){let r=Ae(e.name,"a coin name"),o=Ae(e.symbol,"a coin symbol");if(e.creatorFeeRecipient===void 0)throw new i("Provide an explicit nonzero creatorFeeRecipient; it is never defaulted to the agent wallet.");let a=A(e.creatorFeeRecipient);if(p(a,F))throw new i("Provide a nonzero creator fee recipient.");if(!p(a,n))throw new i("Pons creator fee recipient must be the signing wallet.");let s=A(e.pairToken??F),u=H(e.launchConfigId??"0"),c=H(e.initialBuy??"0"),h=A(e.buyRecipient??n);if(p(h,F))throw new i("Provide a nonzero initial buy recipient.");if(c===0n&&e.buyRecipient!==void 0)throw new i("A buy recipient requires an initial buy.");let g=H(e.minTokensOut??"0");if(c>0n&&e.minTokensOut!==void 0&&g<=1n)throw new i("Initial buy minimum must exceed one token base unit.");if(c>0n&&!p(h,n)&&e.minTokensOut===void 0)throw new i("Provide minTokensOut for an initial buy sent to another wallet.");if(c===0n&&g!==0n)throw new i("A launch without an initial buy must have a zero token minimum.");let y=e.creatorTaxBps??100;if(typeof y!="number"||!Number.isInteger(y)||y<0||y>65535)throw new i("Creator tax must be an integer number of basis points.");let m=e.buybackEnabled??!1;if(typeof m!="boolean")throw new i("Buyback enabled must be true or false.");let x=e.metadata??["",""],b=e.links??["","","","",""];if(!Array.isArray(x)||x.length!==2||!x.every(k=>typeof k=="string")||!Array.isArray(b)||b.length!==5||!b.every(k=>typeof k=="string"))throw new i("Provide two metadata strings and five link strings in ABI order.");if(e.metadata!==void 0&&(e.logo!==void 0||e.description!==void 0||e.image!==void 0))throw new i("Use named logo, description and image inputs or legacy metadata, not both.");if(e.links!==void 0&&e.socials!==void 0)throw new i("Use named socials or legacy links, not both.");let T=se(e.logo??x[0],"coin image URI"),_=e.description??x[1];if(typeof _!="string")throw new i("Provide a coin description string.");let v=e.socials;if(v!==void 0&&(!v||typeof v!="object"||Array.isArray(v)||Object.keys(v).some(k=>!z.includes(k))))throw new i("Provide twitter, telegram, discord, website and farcaster social links.");let S=z.map((k,P)=>se(v===void 0?b[P]:v[k]??"",`${k} link`)),w=Xe(e.image);if(w&&T)throw new i("Provide an image upload or an existing logo URI, not both.");let q=e.snipeTaxExemptions??[];if(!Array.isArray(q)||q.length>31)throw new i("Provide at most 31 snipe tax exemption addresses.");let E=q.map(A),O=e.salt??He(crypto.getRandomValues(new Uint8Array(32)));if(typeof O!="string"||!/^0x[0-9a-fA-F]{64}$/.test(O))throw new i("Salt must be 32 hex-encoded bytes.");let $=t.clientFor(l),C=await $.getBlockNumber({cacheTime:0}),[de,Ee]=await Promise.all([$.readContract({address:d,abi:f,functionName:"canLaunch",args:[n],blockNumber:C}),$.readContract({address:d,abi:f,functionName:"launchConfigCount",blockNumber:C})]);if(!de)throw new i("This wallet cannot launch on Pons. Ask Pons for launch access and retry when canLaunch is true.");if(u>=Ee)throw new i("Choose an existing Pons launchConfigId using pons_launch_options.");let[Y,W,Le,_e]=await Promise.all([$.readContract({address:d,abi:f,functionName:"launchFee",blockNumber:C}),$.readContract({address:d,abi:f,functionName:"getLaunchConfig",args:[u],blockNumber:C}),$.readContract({address:d,abi:f,functionName:"maxCreatorTaxBps",blockNumber:C}),$.readContract({address:d,abi:f,functionName:"memeHook",blockNumber:C})]);if(!W.enabled)throw new i("This Pons launch configuration is disabled. Choose an enabled launchConfigId.");let L=J,le=W.phantomQuote,pe=W.graduationThreshold;if(!p(s,F)){let[k,P]=await Promise.all([$.readContract({address:d,abi:f,functionName:"approvedPairTokens",args:[s],blockNumber:C}),$.readContract({address:d,abi:f,functionName:"pairTokenEconomics",args:[s],blockNumber:C})]);if(!k||P[0]<=0n||P[1]<=0n)throw new i("This pair token is not approved with usable Pons economics. Choose a supported pair.");if(L=await V(t,s,C),P[2]!==L.decimals)throw new i("Pair token decimals disagree with Pons. Ask Pons to refresh pair economics.");[le,pe]=P}if(BigInt(y)>Le)throw new i("Creator tax exceeds the current Pons maximum.");let[Z,ee]=await Promise.all([$.readContract({address:d,abi:f,functionName:"previewLaunchEconomics",args:[u,s],blockNumber:C}),$.readContract({address:_e,abi:De,functionName:"currentFeePolicy",blockNumber:C})]);if(e.expectedEconomics!==void 0&&e.expectedEconomics!==Z)throw new i("Pons launch economics changed. Refresh the launch preview.");let G=Ne(W.curveFeeBps,y,ee[1],m,ee[2]),ne="";if(w){let k=new FormData;k.append("image",new Blob([w.bytes],{type:w.mimeType}),`coin.${w.extension}`);let P=await ie(t.http,$e,{method:"POST",body:k,redirect:"error"},B=>!!B&&typeof B=="object"&&typeof B.uri=="string");if(T=se(P.uri,"uploaded coin image URI"),!T)throw new i("Pons returned an empty image URI. Retry with a public image URI.");ne=`Image (${w.bytes.length} bytes, ${w.mimeType}) uploaded via multipart POST to ${$e}; URI ${I(T)}. This off-chain upload persists even if launch is cancelled or fails; Pons retention/deletion is unknown.`}let te=k=>{let P=[r,o,T,_,S,a,y,m,Z,O],B={to:c===0n?d:ce,chainId:l,value:(Y+(p(s,F)?c:0n)).toString(),data:c===0n?E.length?M({abi:ae,functionName:"launchToken",args:[P,u,s,E]}):M({abi:ae,functionName:"launchToken",args:[P,u,s]}):M({abi:ae,functionName:"launchAndBuy",args:[P,u,s,c,k,h,E]}),description:`Launch ${I(r)} through the Pons ${c===0n?"factory":"router"} from ${n}; creator fees to ${a}. ${ne}`.trim()};return c>0n&&!p(s,F)?[t.approval(s,ce,c.toString(),l),B]:[B]};if(c>0n&&e.minTokensOut===void 0){let P=(await t.preview(te(0n).map(t.unsignedTx),n)).changes.filter(B=>B.token.chainId===l&&!p(B.token.address,F)&&!p(B.token.address,ye)&&!p(B.token.address,s)&&B.token.decimals===18&&/^\d+$/.test(B.amount)&&BigInt(B.amount)>0n);if(P.length!==1)throw new i("Pons launch preview did not identify a unique initial buy token output.");if(g=BigInt(we(P[0].amount,be)),g<=1n)throw new i("Initial buy minimum must exceed one token base unit.")}let me=await K(t,te(g),n,`Unsigned Pons launch from ${n}: ${I(r)} (${I(o)}), image ${T?I(T):"none"}, description ${I(_)}, links ${JSON.stringify(Object.fromEntries(z.map((k,P)=>[k,I(S[P])])))}. canLaunch=true at block ${C}; config ${u}, supply ${W.supply}, phantom quote ${le}, graduation threshold ${pe} pair base units. Pair ${L.symbol} (${l}:${L.address}, ${L.decimals} decimals). Initial buy ${t.formatAmount(c.toString(),L.decimals)} ${L.symbol} to ${h}; minimum ${g} token base units (18 decimals). Launch fee ${t.formatAmount(Y.toString(),18)} ETH plus gas; exact transaction value ${te(g).at(-1).value} wei. Curve fees ${G.totalBps} bps total, ${G.protocolBps} bps protocol, ${G.creatorBps} bps creator, ${G.buybackBps} bps buyback; creator tax ${y} bps, buybacks ${m?"on":"off"}, graduated hook fee ${ee[3]} bps plus creator tax. Creator fee recipient ${a}. Extra opening-tax exemptions ${JSON.stringify(E)}. Name, metadata, pair, tax and launch economics are fixed after launch. ${ne}`);return{...me,creatorFeeWarning:void 0,preview:{...me.preview,warnings:[]},canLaunch:de,blockNumber:C.toString(),launchConfigId:u.toString(),pairToken:L,salt:O,logo:T&&I(T),economics:Z,launchFee:R(J,Y),initialBuy:R(L,c),minimum:{amount:g.toString(),decimals:18,token:{chainId:l,address:null,name:I(r),symbol:I(o)},addressStatus:"Read the mined token address with pons_launch transactionHash; the local bridge does this automatically."},fees:G}}async function en(t,e,n){let r=t.clientFor(l),o=await r.getBlockNumber({cacheTime:0}),a=A(e.pairToken??F),[s,u,c,h]=await Promise.all([r.readContract({address:d,abi:f,functionName:"canLaunch",args:[n],blockNumber:o}),r.readContract({address:d,abi:f,functionName:"launchConfigCount",blockNumber:o}),r.readContract({address:d,abi:f,functionName:"launchFee",blockNumber:o}),r.readContract({address:d,abi:f,functionName:"maxCreatorTaxBps",blockNumber:o})]),g=H(e.offset??"0"),y=await Promise.all(Array.from({length:Number(u>g?u-g>100n?100n:u-g:0n)},async(_,v)=>{let S=g+BigInt(v),w=await r.readContract({address:d,abi:f,functionName:"getLaunchConfig",args:[S],blockNumber:o});return{id:S.toString(),...Object.fromEntries(Object.entries(w).map(([q,E])=>[q,typeof E=="bigint"?E.toString():E]))}})),m=p(a,F),[x,b,T]=await Promise.all([m?!0:r.readContract({address:d,abi:f,functionName:"approvedPairTokens",args:[a],blockNumber:o}),m?void 0:r.readContract({address:d,abi:f,functionName:"pairTokenEconomics",args:[a],blockNumber:o}),V(t,a,o)]);return{chainId:l,factory:d,router:ce,blockNumber:o.toString(),canLaunch:s,launchFee:R(J,c),maxCreatorTaxBps:h.toString(),configs:y,configCount:u.toString(),nextOffset:g+BigInt(y.length)<u?(g+BigInt(y.length)).toString():null,pairToken:T,pairApproved:x&&(!b||b[0]>0n&&b[1]>0n&&b[2]===T.decimals),pairEconomics:b?{phantomQuote:b[0].toString(),graduationThreshold:b[1].toString(),decimals:b[2]}:null,pairDiscovery:"Native ETH or any approved ERC-20 address with usable pairTokenEconomics; query each candidate address. The factory has no pair enumeration read."}}async function Fe(t,e,n,r){let o=A(e.token),a=await X(t,o,await t.clientFor(l).getBlockNumber({cacheTime:0}));if(!p(a.creatorFeeRecipient,n))throw new i(`Only the current creator fee recipient ${a.creatorFeeRecipient} can change this setting. Use that wallet.`);if(r){let s=A(e.creatorFeeRecipient);if(p(s,F))throw new i("Provide a nonzero creator fee recipient.");return K(t,{to:d,chainId:l,value:"0",data:M({abi:f,functionName:"transferCreatorFeeRecipient",args:[o,s]}),description:`Transfer future creator fees and the buyback vest beneficiary for ${o} to ${s}.`},n,`Unsigned Pons fee recipient transfer to ${s}; previously credited fees stay with ${n}. This wallet loses future fee controls. Cost: gas only.`)}if(typeof e.enabled!="boolean")throw new i("Buyback enabled must be true or false.");return K(t,{to:d,chainId:l,value:"0",data:M({abi:f,functionName:"setBuybackEnabled",args:[o,e.enabled]}),description:`Turn Pons buybacks ${e.enabled?"on":"off"} for ${o}.`},n,`Unsigned Pons buyback change: ${e.enabled?"on; funded from the creator fee share, tokens vest over five years":"off; existing vest stays locked on its schedule"}. Cost: gas only.`)}var nn=t=>{function e(n,r,o,a){return{name:n,inputSchema:{type:"object",properties:r,required:o,additionalProperties:!1,...n==="pons_launch"?{anyOf:[{required:["transactionHash"]},{required:["name","symbol","creatorFeeRecipient"]}]}:{},...n==="pons_browse"?{allOf:[{if:{anyOf:[{required:["query"]},{required:["cursor"]},{properties:{complete:{const:!0}},required:["complete"]}]},then:{properties:{limit:{maximum:40}}}}]}:{}},execute:async(s,u)=>{try{A(u);for(let c of Object.keys(s))if(!(c in r))throw new i(`Unknown ${n} input: ${c}.`);return await a(s,u)}catch(c){throw new i(t.plainError(c))}}}}return{tools:[e("pons_browse",{fromBlock:U(),toBlock:U(),limit:{type:"integer",minimum:1,maximum:100,description:"At most 40 for query, cursor or complete listings; at most 100 for an on-chain block window."},query:{type:"string",minLength:1,maxLength:100,description:"Name, symbol or address search over every Pons launch (Pons index; results re-read on chain)."},cursor:{type:"string",maxLength:64,description:"nextCursor from a previous newest-first page."},complete:{type:"boolean",description:"List every launch newest first through the Pons index, paginated with cursor."}},[],n=>Ke(t,n)),e("pons_status",{token:N,holder:N},["token"],(n,r)=>Ve(t,A(n.token),A(n.holder??r))),e("pons_launch_options",{pairToken:N,offset:U()},[],(n,r)=>en(t,n,r)),e("pons_transfer_creator_fee_recipient",{token:N,creatorFeeRecipient:N},["token","creatorFeeRecipient"],(n,r)=>Fe(t,n,r,!0)),e("pons_set_buyback",{token:N,enabled:{type:"boolean"}},["token","enabled"],(n,r)=>Fe(t,n,r,!1)),e("pons_launch",{name:{type:"string",minLength:1},symbol:{type:"string",minLength:1},creatorFeeRecipient:N,pairToken:N,launchConfigId:U(),buyRecipient:N,logo:{type:"string"},description:{type:"string"},socials:{type:"object",properties:Object.fromEntries(z.map(n=>[n,{type:"string"}])),additionalProperties:!1},image:{type:"object",properties:{mimeType:{type:"string",enum:["image/png","image/jpeg","image/webp"]},base64:{type:"string",minLength:1,maxLength:6990508}},required:["mimeType","base64"],additionalProperties:!1},snipeTaxExemptions:{type:"array",items:N,maxItems:31},transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},initialBuy:U(),minTokensOut:U(),creatorTaxBps:{type:"integer",minimum:0,maximum:65535},buybackEnabled:{type:"boolean"},expectedEconomics:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},salt:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},metadata:{type:"array",items:{type:"string"},minItems:2,maxItems:2},links:{type:"array",items:{type:"string"},minItems:5,maxItems:5}},[],(n,r)=>n.transactionHash===void 0?Ze(t,n,r):Ye(t,n.transactionHash,r)),e("pons_graduate",{token:N},["token"],async(n,r)=>{let o=A(n.token);if((await X(t,o,await t.clientFor(l).getBlockNumber({cacheTime:0}))).phase!==1)throw new i("Graduation requires a launch pending pool creation (phase 1).");return K(t,{to:d,chainId:l,value:"0",data:M({abi:f,functionName:"createGraduatedPool",args:[o]}),description:`Create the graduated Pons pool for ${o}.`},r,"Unsigned permissionless graduation retry; recheck status after the transaction is mined.")})],positions:async n=>{try{A(n);let r=await Re(t,{limit:100}),o=r.items.filter(a=>p(a.creator,n)||p(a.creatorFeeRecipient,n));return await Promise.all(o.map(async a=>{let s=await t.clientFor(l).readContract({address:a.token.address,abi:j,functionName:"balanceOf",args:[n],blockNumber:BigInt(a.blockNumber)});return{module:"pons",id:`${l}:${a.token.address}`,chainId:l,assets:[R(a.token,s)],description:`Pons ${a.phaseName}; creator fee recipient ${a.creatorFeeRecipient}. Discovery covers recent launches only (${r.fromBlock}-${r.toBlock}${r.truncated?", truncated":""}).`}}))}catch(r){throw new i(t.plainError(r))}}}},mn=nn;export{X as a,ue as b,Ve as c,Ke as d,nn as e,mn as f};
@@ -1 +0,0 @@
1
- import{c as xe}from"./AW7AXQCZ.js";import{a as Ee}from"./NAZPDRIF.js";import{a as $e,b as pe,c as Te}from"./QA3UHEO3.js";import{c as Re,d as t,e as R,f as d,g as Ae,h as W,i as v,j as ue,k as L,m as O,n as c,o as ce,p as le,q as me,r as Ce,s as qe}from"./64GOINYS.js";import{a as ke,o as de}from"./BOVMED7R.js";import{a as ve}from"./66F5ZH34.js";import{c as re,e as Q,g as M}from"./NWNYJ26T.js";import{a as l,i as be}from"./FWD4L3CJ.js";import{a as h}from"./XSD5NL7J.js";import{decodeFunctionData as Fe,erc20Abi as Me}from"viem";var z="0x0000000000000000000000000000000000000000",N=be[l].relay.depository.address.toLowerCase(),Se=30,ze=w=>{let U=qe(w);async function he(n){let e;try{e=await U(`/intents/status/v3?requestId=${encodeURIComponent(n)}`)}catch(C){if(w.plainError(C)!=="The request timed out. Please try again.")throw C;return{requestId:n,status:"unknown",timedOut:!0,fulfilled:!1,settled:!1,pollAgain:!0,needsAttention:!1,inTxHashes:[],txHashes:[],originChainId:void 0,destinationChainId:void 0,summary:"The status request timed out. Bridge settlement is unknown; poll again."}}if(typeof e.status!="string")throw new h("Relay returned an invalid bridge status.");let i=ce(e.inTxHashes),p=ce(e.txHashes),u=e.originChainId===void 0?void 0:W(e.originChainId),a=e.destinationChainId===void 0?void 0:W(e.destinationChainId),s=le(e.failReason),m=le(e.refundFailReason),r=e.status==="success"&&p.length>0&&a!==void 0,q=e.status==="refund"&&p.length>0&&u!==void 0,g=e.status==="failure"&&m!==void 0,A=["waiting","depositing","pending","submitted","failure","refund","success"].includes(e.status)?e.status==="failure"&&/TIMEOUT|EXPIRED/.test(typeof e.failReason=="string"?e.failReason:"")?"timeout":e.status:"unknown",k=r?"Relay reports destination fulfillment.":q?"Relay reports a refund on the origin chain; the destination was not fulfilled.":g?"The bridge failed and automatic refund is unavailable. Review the request with Relay.":"Bridge settlement is not confirmed. Poll Relay again; an origin receipt alone does not prove destination fulfillment.";return{requestId:n,status:A,relayStatus:e.status,fulfilled:r,settled:r||q,pollAgain:!r&&!q&&!g,needsAttention:g,timedOut:!1,inTxHashes:i,txHashes:p,originChainId:u,destinationChainId:a,failReason:s,refundFailReason:m,...e.updatedAt===void 0?{}:{updatedAt:v(String(e.updatedAt))},summary:k}}async function De(n,e){let i=s=>({destinationVerified:!1,destinationCheck:s}),p;try{if(p=w.clientFor(n),await p.getChainId()!==n)return i(`The configured RPC does not serve chain ${n}; destination receipts were not checked.`)}catch{return i(`No RPC is available for chain ${n}; destination receipts were not checked.`)}let u=[];for(let s of e)try{let m=await p.getTransactionReceipt({hash:s});u.push({hash:s,status:m.status,blockNumber:m.blockNumber.toString()})}catch{return{...i(`Receipt ${s} is not available on chain ${n} yet; poll again.`),destinationReceipts:u}}let a=u.length>0&&u.every(s=>s.status==="success");return{destinationVerified:a,destinationReceipts:u,destinationCheck:a?`Every Relay destination transaction has a successful receipt on chain ${n}. Amounts are not decoded here; compare the recipient balance for the exact delivered amount.`:`A Relay destination transaction did not succeed on chain ${n}; do not treat this bridge as delivered.`}}async function Pe(n){let e=await w.clientFor(l).readContract({address:n,abi:Me,functionName:"decimals"}),i=typeof e=="bigint"?Number(e):e;if(typeof i!="number"||!Number.isInteger(i)||i<0||i>255)throw new h("Could not read valid ERC-20 decimals() on-chain.");return i}async function _e(n,e){let i=d(e),p=d(n.recipient??i),u=W(n.destinationChainId);if(u===l)throw new h("Choose a destination chain other than 4663.");let a=Ae(n.originCurrency??z),s=a!==z,m=d(n.destinationCurrency??z),r=v(n.amount);if(r==="0")throw new h("Provide a positive bridge amount.");let q=n.minAmountOut===void 0?void 0:v(n.minAmountOut),g=n.slippageBps??pe;if(typeof g!="number")throw new h("Slippage must be an integer from 0 to 9999 bps.");de("0",g);let I=R((await U("/chains")).chains).map(t),A=I.find(o=>o.id===l),k=I.find(o=>o.id===u);if(!A||!k||A.disabled!==!1||k.disabled!==!1||A.depositEnabled!==!0||A.vmType!=="evm"||k.vmType!=="evm")throw new h("Relay does not currently support this outbound chain route.");if(!xe(u))throw new h(`Relay has no supported Oak return path from chain ${u}. Choose a destination supported by relay_bridge_in before bridge-out.`);let C=await $e(w.clientFor,u,i,"server"),b=s?await Pe(a):18,P=Math.floor(Date.now()/1e3)+ke,$=await U("/quote/v2",{user:i,recipient:p,originChainId:l,destinationChainId:u,originCurrency:a,destinationCurrency:m,amount:r,tradeType:"EXACT_INPUT",...s?{explicitDeposit:!0}:{}}),E=L($.requestId),S=t($.details),B=O(S.currencyIn),f=O(S.currencyOut),T={token:f.token,amount:v(t(S.currencyOut).minimumAmount)};if(c(d(S.sender)===i&&d(S.recipient)===p&&B.token.chainId===l&&B.token.address===a&&B.token.decimals===b&&B.amount===r&&f.token.chainId===u&&f.token.address===m&&BigInt(T.amount)>0n&&BigInt(T.amount)<=BigInt(f.amount)),m===z&&c(f.token.decimals===t(k.currency).decimals),q!==void 0){if(T.amount!==q)throw new h("Relay order minimum must exactly match minAmountOut. Request a new quote.")}else if(BigInt(T.amount)<BigInt(de(f.amount,g)))throw Te(f.amount,T.amount);let J=t(t($.protocol).v2),j=L(J.orderId),Z=t(J.orderData),Y=t(Z.output),ee=ue(Y.deadline),K=R(Z.inputs).map(t);c(K.length>0);let te=K.flatMap(o=>{let y=R(o.refunds).map(t);return c(y.length>0),y.map(we=>{if(d(we.recipient)!==i)throw new h("Relay refund recipient does not match the agent wallet. Request a new quote.");return ue(we.deadline)})}),Oe=te.reduce((o,y)=>Math.min(o,y),ee),ne=Math.min(P,Oe-Se),fe=()=>{if(Date.now()/1e3>=ne)throw new h("The Relay quote expired or its order/refund deadline leaves too little time to sign and send. Request a fresh bridge quote.")};fe();let H=R(Y.payments).map(t),ie=t(t(A.protocol).v2),Ne=t(t(k.protocol).v2),V=t(J.paymentDetails);c(Y.chainId===Ne.chainId&&H.length===1&&R(Y.calls).length===0&&d(H[0].recipient)===p&&d(H[0].currency)===m&&v(H[0].minimumAmount)===T.amount&&v(H[0].expectedAmount)===f.amount&&V.chainId===ie.chainId&&d(V.currency)===a&&v(V.amount)===r),c(d(V.depository)===N&&d(ie.depository)===N);let oe=t(K[0].payment);c(K.length===1&&oe.chainId===ie.chainId&&d(oe.currency)===a&&v(oe.amount)===r);let F=R($.steps).map(t),_=s&&F.length===2?F[0]:void 0;c(F.length===(_?2:1));let G=F[F.length-1];c(G.kind==="transaction"&&G.id==="deposit"&&G.requestId===E);let X=R(G.items).map(t);c(X.length===1&&X[0].status==="incomplete");let x=t(X[0].data),ye=t(X[0].check);if(c(ye.method==="GET"&&ye.endpoint===`/intents/status/v3?requestId=${E}`&&x.chainId===l&&d(x.from)===i&&d(x.to)===N&&v(x.value)===(s?"0":r)),typeof x.data!="string"||!(s?/^0x[0-9a-fA-F]{264}$/:/^0x[0-9a-fA-F]{136}$/).test(x.data))throw new h(`Relay returned unexpected ${s?"ERC-20":"native"} deposit calldata.`);let D=Fe({abi:Re,data:x.data});D.functionName==="depositErc20"?c(s&&d(D.args[0])===i&&d(D.args[1])===a&&D.args[2]===BigInt(r)&&M(D.args[3],j)):c(!s&&d(D.args[0])===i&&M(D.args[1],j));let Be=I.filter(o=>o.vmType==="evm"&&Q(o.protocol)&&Q(o.protocol.v2)).map(o=>t(t(o.protocol).v2).chainId).filter(o=>typeof o=="string");if(!M(Ee(Z,Be),j))throw new h("Relay order ID does not match the checked quote terms. Request a new quote.");let ae=s?w.approval(a,N,r,l):void 0;if(_&&ae){c(_.kind==="transaction"&&_.id==="approve"&&_.requestId===E);let o=R(_.items).map(t);c(o.length===1&&o[0].status==="incomplete");let y=t(o[0].data);c(y.chainId===l&&d(y.from)===i&&d(y.to)===a&&v(y.value)==="0"&&typeof y.data=="string"&&M(y.data,ae.data))}let ge=[...ae?await Ce(w,a,N,r,l,i):[],w.unsignedTx({to:N,data:x.data,value:s?"0":r,chainId:l,description:s?`Deposit ${r} base units of ${a} for Relay request ${E}.`:`Deposit native ETH for Relay request ${E}.`})],Ie=t($.fees);for(let o of Object.values(Ie))O(o);let se=await w.preview(ge,i);fe();let He=se.changes.map(o=>{let y=o.amount.startsWith("-");return`${y?"-":""}${w.formatAmount(y?o.amount.slice(1):o.amount,o.token.decimals)} ${o.token.symbol}`}).join(", ");return{txs:ge,requestId:E,orderId:j,recipient:p,originChainId:l,destinationChainId:u,expiresAt:String(ne),orderDeadline:String(ee),refundDeadlines:te.map(String),returnPath:C,amountIn:B,amountOut:f,minAmountOut:T,fees:Ie,expandedPriceImpact:S.expandedPriceImpact,timeEstimate:S.timeEstimate,preview:se,summary:`${C} Bridge to ${p} on chain ${u}; asset ${f.token.address} on chain ${f.token.chainId} (${me(f.token.symbol)}); expected ${f.amount}, minimum ${T.amount} base units (${f.token.decimals} decimals). Order deadline ${ee} Unix seconds; refund deadlines ${te.join(", ")} Unix seconds; accept before ${ne} Unix seconds to reserve ${Se}s to sign and send. Origin preview: ${He||se.summary}. Relay route fees are included in the quote; origin gas is separate. Poll relay_status with requestId ${E} after local submission; destination fulfillment is not yet confirmed.`}}return{tools:[{name:"relay_bridge_out",inputSchema:{type:"object",required:["destinationChainId","amount"],additionalProperties:!1,properties:{destinationChainId:{type:"integer",minimum:1},amount:{type:"string",pattern:"^[1-9][0-9]*$"},recipient:re,originCurrency:re,slippageBps:{type:"integer",minimum:0,maximum:9999,default:pe},destinationCurrency:{type:"string"},minAmountOut:ve()}},execute:async(n,e)=>{try{return await _e(n,e)}catch(i){throw new h(w.plainError(i))}}},{name:"relay_status",inputSchema:{type:"object",required:["requestId"],additionalProperties:!1,properties:{requestId:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},verifyDestination:{type:"boolean"}}},execute:async n=>{let e=await he(L(n.requestId));return n.verifyDestination!==!0||!e.fulfilled||e.destinationChainId===void 0?e:{...e,...await De(e.destinationChainId,e.txHashes)}}}],positions:async n=>{let e=d(n);if(!process.env.OAK_RELAY_API_KEY?.trim())return[{module:"relay",id:"relay-discovery-unavailable",chainId:l,assets:[],incomplete:!0,description:'Relay pending bridge discovery requires OAK_RELAY_API_KEY on the server. The request-history API requires this key; no pending bridges were checked. Ask the operator to configure it, or check a known request with relay_status {"requestId":"<id>"}. Legacy vault shares on other chains can be checked with relay_vault_status {"chainId":1} or {"chainId":42161}.'}];let i=new Map;for(let p of["outbound","inbound"]){let u=new Set,a;do{let s=new URLSearchParams({user:e,[p==="outbound"?"originChainId":"destinationChainId"]:String(l),limit:"100",includePendingRequests:"true"});a&&s.set("continuation",a);let m=await U(`/requests/v3?${s}`);for(let r of R(m.requests).map(t)){let q=Q(r.depositAddress)?r.depositAddress.depositor:void 0;if(![r.user,r.sender,q].some($=>typeof $=="string"&&$.toLowerCase()===e))throw new h("Relay returned a request for another wallet.");let g=L(r.id);if(i.has(g))continue;let I=await he(g);if(I.settled)continue;let A=t(r.data),k=t(t(A.route).quoted),C=O(t(k.origin).inputCurrency),b={...C,token:{...C.token,symbol:me(C.token.symbol)??"unknown"}},P=O(t(k.destination).outputCurrency);c(p==="outbound"?b.token.chainId===l&&P.token.chainId!==l:b.token.chainId!==l&&P.token.chainId===l),I.originChainId!==void 0&&c(I.originChainId===b.token.chainId),I.destinationChainId!==void 0&&c(I.destinationChainId===P.token.chainId),i.set(g,{module:"relay",id:g,chainId:b.token.chainId,assets:[b],description:`Relay ${p} ${I.status}: ${b.amount} ${b.token.symbol} base units (${b.token.decimals} decimals) from chain ${b.token.chainId} toward ${d(r.recipient)} on chain ${P.token.chainId}. ${I.summary} Track with relay_status requestId ${g}.`})}if(m.continuation!==void 0&&m.continuation!==null&&typeof m.continuation!="string")throw new h("Relay returned invalid pagination.");if(a=typeof m.continuation=="string"&&m.continuation?m.continuation:void 0,a){if(u.has(a))throw new h("Relay repeated its pagination cursor. Pending positions are incomplete.");u.add(a)}}while(a)}return[...i.values()]}}};export{ze as a};
@@ -1 +0,0 @@
1
- import{c as $}from"./AW7AXQCZ.js";import{b as S,d as A,e as j,f as T,g as O,h as I,i as P,m as k,n as M,q as f,s as B}from"./64GOINYS.js";import{a as w,e as _}from"./NWNYJ26T.js";import{a as p}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";function U(u){return{...u,token:{...u.token,symbol:f(u.token.symbol)??"unknown"}}}var J=u=>{let R=B(u);async function z(n,i){let g=T(i),r=I(n.originChainId),e=I(n.destinationChainId);if(r!==p&&e!==p)throw new d(`A Relay quote must start or end on chain ${p}.`);let h=O(n.originCurrency??S),b=O(n.destinationCurrency??S),c=T(n.recipient??g),a=P(n.amount);if(a==="0")throw new d("Provide a positive bridge amount.");let t=n.tradeType??"EXACT_INPUT";if(!["EXACT_INPUT","EXACT_OUTPUT","EXPECTED_OUTPUT"].includes(String(t)))throw new d("Choose EXACT_INPUT, EXACT_OUTPUT or EXPECTED_OUTPUT.");let m={};for(let E of["includedSwapSources","excludedSwapSources","includedOriginSwapSources","includedDestinationSwapSources"]){let y=n[E];if(y!==void 0){if(!Array.isArray(y)||y.length>100||y.some(x=>typeof x!="string"||!/^[A-Za-z0-9._ -]{1,128}$/.test(x)))throw new d("Provide valid Relay swap source names.");m[E]=y}}let N=await R("/quote/v2",{user:g,recipient:c,originChainId:r,destinationChainId:e,originCurrency:h,destinationCurrency:b,amount:a,tradeType:t,...m}),o=A(N.details),l=U(k(o.currencyIn)),s=U(k(o.currencyOut)),C=P(A(o.currencyOut).minimumAmount);M(T(o.sender)===g&&T(o.recipient)===c&&l.token.chainId===r&&l.token.address===h&&(t==="EXACT_INPUT"?l.amount===a:s.amount===a)&&s.token.chainId===e&&s.token.address===b&&BigInt(C)<=BigInt(s.amount));let F=Object.fromEntries(Object.entries(A(N.fees)).map(([E,y])=>[E,U(k(y))])),v=typeof o.timeEstimate=="number"&&Number.isFinite(o.timeEstimate)&&o.timeEstimate>=0?o.timeEstimate:void 0,X=e===p,q=X?"relay_bridge_in":"relay_bridge_out",D=t==="EXACT_INPUT"&&Object.keys(m).length===0&&r!==e&&(!X||$(r)!==void 0);return{executable:!1,nextAction:D?q:void 0,originChainId:r,destinationChainId:e,recipient:c,tradeType:t,amountIn:l,amountOut:s,minAmountOut:{token:s.token,amount:C},fees:F,slippage:{source:"provider",minimumAmount:C},...v===void 0?{}:{timeEstimateSeconds:v},summary:`Read-only Relay estimate: ${l.amount} base units of ${l.token.symbol} (${l.token.decimals} decimals) on chain ${r} for about ${s.amount}, minimum ${C}, base units of ${s.token.symbol} (${s.token.decimals} decimals) on chain ${e} for ${c}. Slippage: selected by Relay; Oak sent no slippage setting. The returned minimum above is the quote floor. Relay fees are already deducted from the output; origin gas is separate. Nothing was built or signed, and this estimate cannot be executed. ${D?`To bridge, call ${q}; it fetches a fresh quote and shows its own preview for human confirmation.`:"This estimate shape has no matching Oak execution path. No action will preserve these trade type or routing options."}`}}async function Z(n){let i=n.chainId===void 0?void 0:I(n.chainId),r=j((await R("/chains")).chains).map(A).flatMap(e=>{if(typeof e.id!="number"||!Number.isSafeInteger(e.id)||e.id<=0)return[];if(i!==void 0&&e.id!==i)return[];let h=e.disabled===!1,b=_(e.currency)?e.currency:{},c={chainId:e.id,name:f(e.displayName,"name")??f(e.name,"name")??String(e.id),vmType:f(e.vmType),nativeCurrency:{symbol:f(b.symbol),decimals:typeof b.decimals=="number"?b.decimals:void 0},bridgeIn:e.id!==p&&h&&$(e.id)!==void 0,bridgeOut:e.id!==p&&h&&e.vmType==="evm"};if(i===void 0)return[c];let a=new Map;for(let t of[...Array.isArray(e.featuredTokens)?e.featuredTokens:[],...Array.isArray(e.erc20Currencies)?e.erc20Currencies:[]]){if(!_(t)||typeof t.address!="string"||!new RegExp(w).test(t.address)||typeof t.decimals!="number"||!Number.isInteger(t.decimals)||t.decimals<0||t.decimals>255)continue;let m=T(t.address);a.has(m)||a.set(m,{address:m,symbol:f(t.symbol)??"unknown",decimals:t.decimals,bridgeable:t.supportsBridging===!0})}return[{...c,currencies:[...a.values()]}]});if(i!==void 0&&!r.length)throw new d(`Relay does not list chain ${i}.`);return{chains:r,summary:`${r.length} Relay chain${r.length===1?"":"s"}. bridgeIn marks origins relay_bridge_in can build from; bridgeOut marks destinations relay_bridge_out can reach. Currency lists are Relay-reported display data; bridgeable false means Relay does not bridge that token. Confirm token addresses before bridging.`}}return{tools:[{name:"relay_quote",inputSchema:{type:"object",additionalProperties:!1,required:["originChainId","destinationChainId","amount"],properties:{originChainId:{type:"integer",minimum:1},destinationChainId:{type:"integer",minimum:1},originCurrency:{type:"string",pattern:w},destinationCurrency:{type:"string",pattern:w},amount:{type:"string",pattern:"^[1-9][0-9]*$"},recipient:{type:"string",pattern:w},tradeType:{type:"string",enum:["EXACT_INPUT","EXACT_OUTPUT","EXPECTED_OUTPUT"]},...Object.fromEntries(["includedSwapSources","excludedSwapSources","includedOriginSwapSources","includedDestinationSwapSources"].map(n=>[n,{type:"array",maxItems:100,items:{type:"string",pattern:"^[A-Za-z0-9._ -]{1,128}$"}}]))}},execute:async(n,i)=>{try{return await z(n,i)}catch(g){throw new d(u.plainError(g))}}},{name:"relay_chains",inputSchema:{type:"object",additionalProperties:!1,properties:{chainId:{type:"integer",minimum:1}}},execute:async n=>{try{return await Z(n)}catch(i){throw new d(u.plainError(i))}}}]}};export{J as a};
@@ -1 +0,0 @@
1
- import{a as s,d as h,e as u}from"./DJN3JAWB.js";import{a as l}from"./66F5ZH34.js";import{a as c}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{concatHex as P,encodeAbiParameters as x,encodeFunctionData as w,getAddress as m,keccak256 as f,parseAbi as k,stringToHex as v}from"viem";var g=k(["function ownerOf(uint256) view returns (address)","function tokenURI(uint256) view returns (string)","function setMetadata(uint256,string,bytes)","function approve(address,uint256)"]),I=k(["function listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))","function recordHash(uint256) view returns (bytes32)"]),_=(t,r)=>f(P(BigInt(t)<BigInt(r)?[t,r]:[r,t]));function C(t){if(!Array.isArray(t)||t.length<1||t.length>1e4)throw new d("Provide 1 to 10000 identity IDs.");let r=[...new Set(t.map(e=>u(e,"agentIds").toString()))].sort((e,a)=>BigInt(e)<BigInt(a)?-1:1),n=[r.map(e=>f(f(x([{type:"uint256"}],[BigInt(e)]))))];for(;n.at(-1).length>1;){let e=n.at(-1),a=[];for(let o=0;o<e.length;o+=2)a.push(e[o+1]?_(e[o],e[o+1]):e[o]);n.push(a)}return{root:n.at(-1)[0],ids:r,proofs:r.map((e,a)=>{let o=[],p=a;for(let b of n.slice(0,-1)){let y=b[p^1];y&&o.push(y),p=Math.floor(p/2)}return{agentId:e,proof:o}})}}function A(t){return{tools:[{name:"priors_market_origin",inputSchema:{type:"object",properties:{agentIds:{type:"array",minItems:1,maxItems:1e4,items:l()}},required:["agentIds"],additionalProperties:!1},async execute(r){return{chainId:c,...C(r.agentIds),caveat:"Locally commits exactly these IDs. This does not verify third-party origin, quality, current owner or a seller claim."}}},{name:"priors_market_pins",inputSchema:{type:"object",properties:{agentId:l()},required:["agentId"],additionalProperties:!1},async execute(r){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let i=u(r.agentId,"agentId"),n=t.clientFor(c),e=await n.getBlockNumber({cacheTime:0}),[a,o,p]=await Promise.all([n.readContract({address:s.market,abi:I,functionName:"listingOf",args:[i],blockNumber:e}),n.readContract({address:s.market,abi:I,functionName:"recordHash",args:[i],blockNumber:e}),n.readContract({address:s.registry,abi:g,functionName:"tokenURI",args:[i],blockNumber:e})]);return{chainId:c,blockNumber:e.toString(),listing:h(a),recordHash:o,currentUriHash:f(v(p)),caveat:"Pins bind identity file and credit state, not included code, servers or keys. Listing and current URI hashes may differ; preview refuses an altered listing."}}},{name:"priors_market_clear_bid_budget",inputSchema:{type:"object",properties:{},additionalProperties:!1},async execute(r,i){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let n=[t.approval(s.usdg,s.bidSpender,"0",c)],e=await t.preview(n,m(i));return{txs:n,summary:`Clear all this wallet future bid spending allowance to ${s.bidSpender}. Existing bids cannot fill from it until approved again. ${e.summary}`}}},{name:"priors_market_revoke_nft",inputSchema:{type:"object",properties:{agentId:l()},required:["agentId"],additionalProperties:!1},async execute(r,i){let n=u(r.agentId,"agentId");if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");if(m(await t.clientFor(c).readContract({address:s.registry,abi:g,functionName:"ownerOf",args:[n]}))!==m(i))throw new d("Only current NFT owner may revoke this per-token approval.");let e=[t.unsignedTx({to:s.registry,data:w({abi:g,functionName:"approve",args:["0x0000000000000000000000000000000000000000",n]}),value:"0",chainId:c,description:`Revoke exact ERC-8004 NFT ${n} market approval.`})],a=await t.preview(e,i);return{txs:e,summary:`Clear this identity per-token transfer approval. Also cancel its listing before granting any new market approval. ${a.summary}`}}},{name:"priors_x_link",inputSchema:{type:"object",properties:{agentId:l(),postUrl:{type:"string",maxLength:160,description:"Canonical https://x.com/<handle>/status/<id> owner proof post URL, or empty to unlink. Owner creates the public post themselves."}},required:["agentId","postUrl"],additionalProperties:!1},async execute(r,i){if(t.network==="testnet")throw new d("Priors X metadata is mainnet only.");let n=u(r.agentId,"agentId");if(m(await t.clientFor(c).readContract({address:s.registry,abi:g,functionName:"ownerOf",args:[n]}))!==m(i))throw new d("Only the identity owner can link or clear X metadata.");if(typeof r.postUrl!="string"||r.postUrl!==""&&!/^https:\/\/x\.com\/[A-Za-z0-9_]{1,15}\/status\/[0-9]{1,30}$/.test(r.postUrl))throw new d("Provide a canonical X status URL or empty string to unlink.");let e=[t.unsignedTx({to:s.registry,data:w({abi:g,functionName:"setMetadata",args:[n,"x",v(r.postUrl)]}),value:"0",chainId:c,description:"Set/clear the owner identity X proof-post metadata."})],a=await t.preview(e,i);return{txs:e,summary:`Publish ${r.postUrl?"the specified X post URL":"empty X metadata"} on public ERC-8004 identity ${n}. Priors independently verifies the post; metadata alone does not prove the X account or affect credit terms. ${a.summary}`}}}]}}export{C as a,A as b};
@@ -1 +0,0 @@
1
- import{c as g,d as v}from"./VCOTCVKN.js";import{a as b,c as y,d}from"./QFNT73OF.js";import{ba as m}from"./ACW63WIL.js";import{h as f}from"./NWNYJ26T.js";import{a as c}from"./XSD5NL7J.js";import{erc20Abi as O}from"viem";async function C(r,n,s,l){if(!s.length)return[];let t=await r.multicall({allowFailure:!1,contracts:s.map(u=>({address:u,abi:O,functionName:"balanceOf",args:[n]})),blockNumber:l});if(!Array.isArray(t)||t.length!==s.length)throw new c("Borro share balances could not be read completely. Please try again.");return t.map(d)}async function V(r,n,s={}){y(n);let l=()=>{if(s.signal?.aborted)throw new c("Borro read was cancelled.")};l();let t=r.clientFor(4663),o=await(s.discoverVaults??g(r,s).discoverVaults)(t,{wallet:n,heldOnly:!0,...s.signal?{signal:s.signal}:{}});if(o.incomplete)throw new c("Borro discovery is incomplete, so these positions cannot be shown as complete. Please try again.");let h=o.shareBalances?.map(e=>e.vault)??[...new Set([...o.vaults.map(e=>e.vault),...o.refused.flatMap(e=>e.vault?[e.vault]:[])])],p=o.shareBalances?.map(e=>d(BigInt(e.amount)))??await C(t,n,h,BigInt(o.measuredAtBlock));l();let w=h.flatMap((e,i)=>p[i]>0n?[{vault:e,balance:p[i]}]:[]);return Promise.all(w.map(async({vault:e,balance:i})=>{let a=o.vaults.find(k=>f(k.vault,e));if(!a)throw new c("This wallet holds Borro shares whose vault could not be verified. Check the vault address before withdrawing.");let A=d(await t.readContract({address:e,abi:b,functionName:"convertToAssets",args:[i],blockNumber:BigInt(o.measuredAtBlock)}));l();let P={address:e,symbol:a.vaultSymbol,decimals:18,chainId:4663},B={address:a.asset,symbol:a.symbol,decimals:a.assetDecimals,chainId:4663};return{module:"borro",id:`4663:${e}`,chainId:4663,assets:[v(P,i)],oakNotice:m(),description:`${r.formatAmount(i.toString(),18)} ${a.vaultSymbol} = about ${r.formatAmount(A.toString(),a.assetDecimals)} ${B.symbol} lent through Borro. ${m()}`}}))}export{C as a,V as b};
@@ -1 +0,0 @@
1
- import{f as s,g as u,k as v}from"./46KWRAYK.js";import{a as y}from"./XSD5NL7J.js";var k=["L2Book","Ticker","TradeFill","SubaccountLiquidation","PositionUpdate","OrderUpdate","OrderFill","TokenTransfer"],A=p=>({tools:[{name:"meridian_perps_stream",inputSchema:{type:"object",additionalProperties:!1,required:["stream"],description:"Read a bounded sample of an official perps WebSocket stream, then close. Empty timed-out samples do not prove no activity. L2Book starts with up to 100 levels per side, followed by deltas.",properties:{stream:{type:"string",enum:k},symbol:{type:"string",pattern:"^[A-Za-z0-9]{1,32}$"},subaccountId:{type:"string",format:"uuid"},maxEvents:{type:"integer",minimum:1,maximum:20,default:1},timeoutSeconds:{type:"integer",minimum:1,maximum:30,default:10}}},execute:async e=>{try{p.network==="testnet"&&s("Meridian perps streams require mainnet."),(Object.keys(e).some(c=>!["stream","symbol","subaccountId","maxEvents","timeoutSeconds"].includes(c))||!k.includes(e.stream))&&s("Choose a Meridian perps stream from the schema.");let i=["L2Book","Ticker","TradeFill"].includes(String(e.stream)),M=i?{type:e.stream,symbol:e.symbol}:{type:e.stream,subaccountId:v(e.subaccountId)};(i?e.subaccountId!==void 0||typeof e.symbol!="string"||!/^[A-Za-z0-9]{1,32}$/.test(e.symbol):e.symbol!==void 0)&&s("Market streams need symbol only; account streams need subaccountId only.");let o=e.maxEvents??1,d=e.timeoutSeconds??10;return(typeof o!="number"||!Number.isInteger(o)||o<1||o>20||typeof d!="number"||!Number.isInteger(d)||d<1||d>30)&&s("Choose 1\u201320 events and a timeout of 1\u201330 seconds."),await new Promise((c,S)=>{let n=new globalThis.WebSocket("wss://ws.meridian.xyz/v1/stream"),l=[],h=!1,f=!1,b,m=(a,r=!1)=>{if(!f){f=!0,clearTimeout(I);try{n.readyState<2&&n.close()}catch{}a?S(new y(a)):c({chainId:4663,stream:e.stream,events:l,timedOut:r,scope:"Bounded event sample; no durable subscription or complete history. L2Book events after the first are absolute-quantity deltas; zero removes a level."})}},I=setTimeout(()=>m(h?void 0:"Meridian perps stream did not connect.",!0),d*1e3);n.addEventListener("open",()=>{h=!0,n.send(JSON.stringify({event:"subscribe",data:M}))}),n.addEventListener("error",()=>m("Meridian perps stream is unavailable; retry or inspect the HTTP history.")),n.addEventListener("close",()=>m("Meridian perps stream closed before the requested sample completed.")),n.addEventListener("message",a=>{if(!f)try{(typeof a.data!="string"||a.data.length>262144)&&s("Meridian perps stream returned an oversized or invalid message.");let r=u(JSON.parse(a.data));if(r.ok===!1&&s("Meridian perps stream rejected the subscription. Verify the symbol, subaccount and subscription limits."),r.e==="pong"||r.ok===!0&&r.e===void 0)return;(r.e!==e.stream||typeof r.t!="number"||!Number.isSafeInteger(r.t))&&s("Meridian perps stream returned a different or invalid event.");let t=u(r.data);if(i&&t.s!==e.symbol&&s("Meridian perps stream returned a different product."),!i){let w=Array.isArray(t.d)?t.d.map(u):[t];(!(e.stream==="SubaccountLiquidation"?t.sid===e.subaccountId:w.every(E=>E.sid===e.subaccountId))||t.sid!==void 0&&t.sid!==e.subaccountId)&&s("Meridian perps stream returned a different subaccount.")}e.stream==="L2Book"&&((typeof t.t!="number"||!Number.isSafeInteger(t.t)||t.t<0||!Array.isArray(t.a)||!Array.isArray(t.b))&&s("Meridian perps book snapshot is malformed."),b!==void 0&&t.pt!==void 0&&t.pt!==b&&s("Meridian perps book updates have a gap. Request a fresh snapshot."),b=t.t),l.push(r),l.length>=o&&m()}catch(r){m(p.plainError(r))}})})}catch(i){throw new y(p.plainError(i))}}}]});export{k as a,A as b};
@@ -1 +0,0 @@
1
- import{a as h}from"./ZQWZGH7V.js";import{c as p}from"./NWNYJ26T.js";import{a as l}from"./FWD4L3CJ.js";import{a}from"./XSD5NL7J.js";import{getAddress as v}from"viem";var f={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},w=[["hookr_release",{},[],"Read verified release contracts, block and recapture lane."],["hookr_blocks",{},[],"Read all Hook Blocks and their current availability."],["hookr_kings",{poolId:f},[],"Read King of the Pool rounds, leaders, pots and endings."],["hookr_claims",{poolId:f},[],"Read the signing wallet's prizes, royalties, recapture and PoolManager claims."],["hookr_revenue_tokens",{limit:{type:"integer",minimum:1,maximum:50},cursor:{type:"string",pattern:"^(v1|v1:[1-9][0-9]{0,19}|v2:[1-9][0-9]{0,19})$"}},[],"Read revenue tokens, tokenizer provenance, streams and income, page by page."],["hookr_revenue_token",{token:p},["token"],"Read a revenue token, stream endings, income, drops and the signing wallet's claims."],["hookr_hook",{address:p},["address"],"Read shared or owned hook provenance, ownership, allowed blocks, opening and pools."]],H=[...w.map(d=>d[0]),"hookr_contracts","hookr_read","hookr_revenue_read","hookr_addon_read","hookr_api_read"];function j(d){return[...w.map(([t,c,s,o])=>({name:t,inputSchema:{type:"object",description:o,properties:c,required:s,additionalProperties:!1},execute:async(r,g)=>{if(Object.keys(r).some(n=>!Object.hasOwn(c,n))||s.some(n=>r[n]===void 0))throw new a(`Provide the documented arguments for ${t}.`);let k={};for(let[n,i]of Object.entries(r)){let u=c[n];if(u.type==="integer"){if(typeof i!="number"||!Number.isInteger(i)||i<Number(u.minimum)||i>Number(u.maximum))throw new a("Hookr revenue page limit must be an integer from 1 to 50.")}else if(typeof i!="string"||!new RegExp(String(u.pattern)).test(i))throw new a(`Provide a valid Hookr ${n}.`);k[n]=n==="token"||n==="address"?v(String(i)):i}return(t==="hookr_claims"||t==="hookr_revenue_token")&&(k.account=g),{...await h(d,t,k),chainId:l,source:"https://hookr.fun/api/mcp"}}})),y(d)]}var m={catalog:"/api/hooks/catalog",stats:"/api/protocol-stats",poolApr:"/api/pool-apr",revenueTokens:"/api/revenue-tokens",revenueIncome:"/api/revenue-tokens/income"};function y(d){return{name:"hookr_api_read",inputSchema:{type:"object",description:"Read Hookr public catalog, protocol stats, pool APR, revenue directory/income, or one token's doors/mark. Marks are project metadata, not investment or security endorsements.",properties:{resource:{type:"string",enum:[...Object.keys(m),"revenueDoors","revenueMark"]},token:p},required:["resource"],additionalProperties:!1},execute:async e=>{if(Object.keys(e).some(o=>!["resource","token"].includes(o))||typeof e.resource!="string")throw new a("Choose a documented Hookr public resource.");let t=["revenueDoors","revenueMark"].includes(e.resource);if(!t&&e.token!==void 0||t&&typeof e.token!="string")throw new a("Only the revenueDoors and revenueMark resources take a token address.");let c;if(t){let o;try{o=v(String(e.token))}catch{throw new a("Provide a valid revenue token address.")}c=`/api/revenue-tokens/${o}/${e.resource==="revenueDoors"?"doors":"mark"}`}else{if(!Object.hasOwn(m,e.resource))throw new a("Choose a documented Hookr public resource.");c=m[e.resource]}let s=`https://hookr.fun${c}`;try{let o=await d.http(s,{method:"GET",redirect:"error",signal:AbortSignal.timeout(15e3)});if(!o.ok)throw new Error("Unavailable");if(e.resource==="revenueMark"){if(!o.headers.get("content-type")?.includes("image/svg+xml"))throw new Error("Invalid mark");return{chainId:l,source:s,imageUrl:s,pngUrl:`${s}.png`,note:"Official SVG mark URL; SVG code is not executed or returned. The PNG URL has not been fetched."}}let r=await o.json();if(!r||typeof r!="object"||"error"in r||"status"in r&&r.status==="unavailable")throw new Error("Unavailable");return{chainId:l,source:s,data:r}}catch{throw new a("Hookr public resource is unavailable. Retry later; no empty or zero result is implied.")}}}}export{H as a,j as b,y as c};
@@ -1 +0,0 @@
1
- import{c as v,d as N,e as h}from"./5AXWBSPG.js";import{a as m}from"./66F5ZH34.js";import{c as d,f as B,g as p,i as E}from"./NWNYJ26T.js";import{a as H}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{decodeEventLog as W,encodeFunctionData as G,getAddress as V,hashStruct as Y,isHex as J,parseAbi as Q,zeroAddress as k}from"viem";var Z="struct HookrSwapIntent { PoolKey key; bool zeroForOne; int128 amountSpecified; uint128 amountBound; uint160 sqrtPriceLimitX96; address recipient; address relayer; uint256 relayerFee; address engagement; uint256[] campaigns; uint256 nonce; uint256 deadline; }",I=Q(["struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }",Z,"function execute(HookrSwapIntent intent, address owner, bytes signature) returns (uint256 amountIn, uint256 amountOut)","function hashIntent(HookrSwapIntent intent) pure returns (bytes32)","function pullOf(HookrSwapIntent intent) view returns (address token, uint256 amount, bool feeFromInput)","function isNonceUsed(address owner, uint256 intentNonce) view returns (bool)","function router() view returns (address)","function registry() view returns (address)","function permit2() view returns (address)","event IntentExecuted(bytes32 indexed intentHash,address indexed owner,address indexed relayer,bytes32 poolId,uint256 amountIn,uint256 amountOut,uint256 relayerFee,bool feeFromInput)"]),ee={PoolKey:[{name:"currency0",type:"address"},{name:"currency1",type:"address"},{name:"fee",type:"uint24"},{name:"tickSpacing",type:"int24"},{name:"hooks",type:"address"}],HookrSwapIntent:[{name:"key",type:"PoolKey"},{name:"zeroForOne",type:"bool"},{name:"amountSpecified",type:"int128"},{name:"amountBound",type:"uint128"},{name:"sqrtPriceLimitX96",type:"uint160"},{name:"recipient",type:"address"},{name:"relayer",type:"address"},{name:"relayerFee",type:"uint256"},{name:"engagement",type:"address"},{name:"campaigns",type:"uint256[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},ne=V("0x000000000022D473030F116dDEE9F6B43aC78BA3"),F={key:{type:"object",properties:{currency0:d,currency1:d,fee:{type:"integer"},tickSpacing:{type:"integer"},hooks:d},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},zeroForOne:{type:"boolean"},amountSpecified:{type:"string",pattern:"^-?[0-9]+$"},amountBound:m(),sqrtPriceLimitX96:m(),recipient:d,relayer:d,relayerFee:m(),engagement:d,campaigns:{type:"array",items:m(),maxItems:8},nonce:m(),deadline:m()},x={owner:d,signature:{type:"string",pattern:"^0x[0-9a-fA-F]+$"},intent:{type:"object",properties:F,required:Object.keys(F),additionalProperties:!1}};function D(t){return B(t,"Provide a complete trader-signed Hookr intent.")}function y(t,i=256,e=!1){if(typeof t!="string"||!/^-?\d+$/.test(t)||t.length>79)throw new o("Hookr intent amounts, nonce and deadline must be decimal base-unit strings.");let n=BigInt(t);if(e?n<=-(1n<<BigInt(i-1))||n>=1n<<BigInt(i-1):n<0n||n>=1n<<BigInt(i))throw new o("Hookr intent integer is outside its ABI range.");return n}function l(t){return E(t,"Provide valid Hookr intent addresses.")}function j(t,i){if(Object.keys(t).some(s=>!Object.hasOwn(x,s)))throw new o("Provide only owner, intent and the trader signature for Hookr relay.");let e=D(t.intent);if(Object.keys(e).some(s=>!Object.hasOwn(F,s)))throw new o("Hookr intent contains an undocumented field.");let n=D(e.key);if(Object.keys(n).some(s=>!["currency0","currency1","fee","tickSpacing","hooks"].includes(s))||typeof n.fee!="number"||!Number.isInteger(n.fee)||n.fee<0||n.fee>16777215||typeof n.tickSpacing!="number"||!Number.isInteger(n.tickSpacing)||n.tickSpacing<=0||n.tickSpacing>8388607||typeof e.zeroForOne!="boolean")throw new o("Provide a valid canonical v4 pool key and direction.");let a={currency0:l(n.currency0),currency1:l(n.currency1),fee:n.fee,tickSpacing:n.tickSpacing,hooks:l(n.hooks)};if(BigInt(a.currency0)>=BigInt(a.currency1))throw new o("Hookr pool currencies must sort strictly by address.");let r=l(t.owner);if(r===k||p(r,i))throw new o("Hookr relay requires another trader as owner; the relayer funds gas only.");if(!Array.isArray(e.campaigns)||e.campaigns.length>8)throw new o("Provide at most eight Hookr campaign IDs.");let c={key:a,zeroForOne:e.zeroForOne,amountSpecified:y(e.amountSpecified,128,!0),amountBound:y(e.amountBound,128),sqrtPriceLimitX96:y(e.sqrtPriceLimitX96,160),recipient:l(e.recipient),relayer:l(e.relayer),relayerFee:y(e.relayerFee),engagement:l(e.engagement),campaigns:e.campaigns.map(s=>y(s)),nonce:y(e.nonce),deadline:y(e.deadline)};if(c.amountSpecified===0n||c.amountBound===0n)throw new o("Hookr intent input/output amounts and bound must be nonzero.");if([k,h,v].some(s=>p(s,c.recipient)))throw new o("Hookr intent recipient is reserved.");if(c.relayer!==k&&!p(c.relayer,i)||c.relayer===k&&c.relayerFee!==0n)throw new o("Hookr intent names a different relayer or an open relay with a fee.");if(c.engagement===k!=(c.campaigns.length===0))throw new o("Hookr engagement and campaigns must be supplied together.");let f=c.zeroForOne?a.currency0:a.currency1;if(f===k)throw new o("Hookr Permit2 relay cannot pull native ETH input.");if(typeof t.signature!="string"||!J(t.signature,{strict:!0})||t.signature.length<4||t.signature.length%2!==0||t.signature.length>16386)throw new o("Provide the trader-signed Permit2 witness signature, never a private key.");let S=t.signature,w=Y({data:c,primaryType:"HookrSwapIntent",types:ee});return{owner:r,intent:c,signature:S,input:f,intentHash:w}}function q(t,i){let{owner:e,intent:n,signature:a}=j(t,i);return{chainId:H,to:h,value:"0",data:G({abi:I,functionName:"execute",args:[n,e,a]}),description:`Relay Hookr trader ${e} to recipient ${n.recipient}; relayer fee ${n.relayerFee} in pool quote currency. Relayer pays gas; owner supplies Permit2 funds.`}}function ce(t,i,e){let n=q(i,e);if(t.length!==1||t[0].chainId!==n.chainId||!p(t[0].to,n.to)||t[0].value!=="0"||!p(t[0].data,n.data))throw new o("Hookr relay calldata differs from the locally requested signed intent.")}function ue(t){return[{name:"hookr_relay",inputSchema:{type:"object",description:"Preview a trader-signed Permit2 swap for local human-confirmed submission. Relayer pays gas; the trader supplies input. No signature is created by this tool.",properties:x,required:Object.keys(x),additionalProperties:!1},execute:async(i,e)=>{let n=j(i,e),{owner:a,intent:r,signature:c,input:f,intentHash:S}=n,w=t.clientFor(H),s=await w.getBlock();if(typeof s.number!="bigint"||typeof s.timestamp!="bigint"||s.timestamp<=0n||s.timestamp>r.deadline)throw new o("Hookr signed intent expired or the chain timestamp is unavailable.");let g=(X,M=[])=>w.readContract({address:h,abi:I,functionName:X,args:M,blockNumber:s.number}),[_,u,z,K,$,U]=await Promise.all([g("hashIntent",[r]),g("pullOf",[r]),g("isNonceUsed",[a,r.nonce]),g("router"),g("registry"),g("permit2")]);if(_!==S||z!==!1||K!==v||$!==N||U!==ne)throw new o("Hookr intent hash, nonce or forwarder deployment is invalid. Ask the trader for a fresh signed intent.");if(!Array.isArray(u)||u.length!==3||typeof u[0]!="string"||!p(u[0],f)||typeof u[1]!="bigint"||typeof u[2]!="boolean")throw new o("Hookr Permit2 pull could not be verified.");let b=u[2],P=r.amountSpecified<0n?-r.amountSpecified:r.amountBound;if(u[1]!==P+(b?r.relayerFee:0n)||r.amountSpecified>0n&&!b&&r.relayerFee>r.amountSpecified)throw new o("Hookr Permit2 pull or output-side fee differs from the signed terms.");let C=await w.simulateContract({address:h,abi:I,functionName:"execute",args:[r,a,c],account:e,blockNumber:s.number}),[A,R]=C.result,T=r.amountSpecified<0n?r.amountBound:r.amountSpecified-(b?0n:r.relayerFee);if(A>P||R<T)throw new o("Hookr relay simulation did not satisfy the signed input/output bounds.");let O=[t.unsignedTx(q(i,e))],L=await t.preview(O,e);return{txs:O,preview:L,summary:O[0].description,intentHash:S,owner:a,recipient:r.recipient,relayer:e,inputToken:f,maximumPull:u[1].toString(),feeToken:b?f:r.zeroForOne?r.key.currency1:r.key.currency0,relayerFee:r.relayerFee.toString(),feeFromInput:b,minimumOutput:T.toString(),simulatedAmountIn:A.toString(),simulatedAmountOut:R.toString(),note:"Verify IntentExecuted in the receipt and your fee balance after submission."}}},{name:"hookr_relay_receipt",inputSchema:{type:"object",description:"Read the executed intent and fee from a mined Hookr relay receipt.",properties:{transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}},required:["transactionHash"],additionalProperties:!1},execute:async i=>{if(Object.keys(i).some(a=>a!=="transactionHash")||typeof i.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(i.transactionHash))throw new o("Provide a Hookr relay transactionHash.");let e=await t.clientFor(H).getTransactionReceipt({hash:i.transactionHash});if(e.status!=="success")throw new o("Hookr relay reverted. No fee is proven paid.");let n=e.logs.filter(a=>p(a.address,h)).flatMap(a=>{try{let r=W({abi:I,eventName:"IntentExecuted",topics:a.topics,data:a.data});return[{...r.args,amountIn:r.args.amountIn.toString(),amountOut:r.args.amountOut.toString(),relayerFee:r.args.relayerFee.toString()}]}catch{return[]}});if(!n.length)throw new o("Receipt contains no verified Hookr IntentExecuted event.");return{chainId:H,transactionHash:e.transactionHash,blockNumber:e.blockNumber.toString(),intents:n,note:"Event evidence at this mined block; check balances and finality."}}}]}export{I as a,j as b,q as c,ce as d,ue as e};
@@ -1,3 +0,0 @@
1
- import{a as v}from"./VHV6WQ5F.js";import{$ as M,_ as R,ca as x}from"./ACW63WIL.js";import{g as A,i as k,m as _,n as P}from"./NWNYJ26T.js";import{a as p}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{encodeFunctionData as D}from"viem";var F={asset:{type:"string",pattern:"^[A-Za-z0-9.$_-]{1,32}$",description:"Official asset symbol; use vault if discovery is unavailable or ambiguous."},vault:{type:"string",pattern:"^0x[0-9a-fA-F]{40}$",description:"Vault address verified on chain on every call; required for a rebuild without HTTP."}};function O(c){return{type:"object",additionalProperties:!1,properties:{...F,amount:{type:"string",pattern:c==="withdraw"?"^(?:[0-9]+|max)$":"^[0-9]+$"}},required:["amount"],anyOf:[{required:["asset"]},{required:["vault"]}]}}function U(c){return P(c,"Borro amount must be positive and fit uint256.",{positive:!0,notString:"Borro amount must be an integer string in asset base units."})}function g(c){return _(c,"Borro returned an invalid uint256 read.")}var W=c=>c*9950n/10000n;function z(c,l,h,d,N){let S=0n,m=0n;for(let y of c.changes){let b=y.token;if(typeof y.amount!="string"||!/^-?\d+$/.test(y.amount))throw new n("Borro preview returned invalid token changes. Nothing was signed.");let e=BigInt(y.amount);g(e<0n?-e:e);let o=A(b.address,l.address)?l:A(b.address,d.address)?d:void 0;if(!o||b.chainId!==p||b.decimals!==o.decimals)throw new n("Borro preview showed an unexpected token movement. Nothing was signed.");if(o===l){if(e>0n)throw new n("Borro preview showed a reversed input movement. Nothing was signed.");S-=e}else{if(e<0n)throw new n("Borro preview showed a reversed output movement. Nothing was signed.");m+=e}}if(g(S),g(m),S!==h||m<N||m===0n)throw new n("Borro preview did not match the requested receipt. Nothing was signed.")}var K=c=>{let{client:l,context:h,wallet:d}=c;async function N(e,o,a){if(k(a,"Provide a valid wallet address."),!A(a,d))throw new n("Borro action wallet differs from the signing wallet. Nothing was signed.");if(h.network==="testnet"||await l.getChainId()!==p)throw new n("Borro requires chain 4663. Nothing was signed.");if(Object.keys(e).some(i=>!["asset","vault","amount"].includes(i)))throw new n("Unsupported Borro argument.");if(e.asset!==void 0&&(typeof e.asset!="string"||!/^[A-Za-z0-9.$_-]{1,32}$/.test(e.asset)||/^0x/i.test(e.asset)))throw new n("Provide an asset symbol, or put the vault address in vault.");let w=e.vault===void 0?void 0:k(e.vault,"Provide a valid Borro vault address.");if(!w&&e.asset===void 0)throw new n("Provide an asset symbol or a vault address.");let t=w?await c.verifyVault(l,w,o,{wallet:d}):await c.resolveVault(l,{asset:e.asset},o,d);if(w&&!A(w,t.vault)||e.asset!==void 0&&e.asset.toUpperCase()!==t.symbol.toUpperCase())throw new n("Borro vault and asset selectors do not match. Nothing was signed.");if(k(t.vault,"Borro returned an invalid vault address."),k(t.asset,"Borro returned an invalid asset address."),t.chainId!==p||t.shareDecimals!==18||A(t.asset,t.vault)||!Number.isInteger(t.assetDecimals)||t.assetDecimals<0||t.assetDecimals>255||t.mode!==o)throw new n(x("setup-mismatch",{}));let s=await c.verifySetup(l,t,o);if(!s.ok||o==="deposit"&&(!t.assetAllowed||s.drift.length>0))throw new n(x("setup-mismatch",{}));return{...t,setup:s}}function S(e){let o=e.mode==="withdraw"&&!/^[A-Za-z0-9.$_-]{1,16}$/.test(e.symbol)?"token":e.symbol;return{asset:{address:k(e.asset,"Borro returned an invalid asset."),symbol:o,decimals:e.assetDecimals,chainId:p},share:{address:k(e.vault,"Borro returned an invalid vault."),symbol:e.vaultSymbol,decimals:18,chainId:p}}}let m=(e,o)=>h.formatAmount(e.toString(),o),y="The minimum is checked in the preview; standard ERC-4626 calldata does not enforce it on chain. Re-preview before signing; execution output can change.",b=[{name:"borro_deposit",inputSchema:O("deposit"),execute:async(e,o)=>{let a=U(e.amount),w=await N(e,"deposit",o),{asset:t,share:s}=S(w),i=g(await l.readContract({address:t.address,abi:v,functionName:"balanceOf",args:[d]}));if(a>i)throw new n("This wallet does not hold enough of that asset for the Borro deposit.");let f=g(await l.readContract({address:s.address,abi:v,functionName:"previewDeposit",args:[a]}));if(f===0n)throw new n(x("deposit-would-revert",{}));let r=W(f),u=[h.approval(t.address,s.address,a.toString(),p),h.unsignedTx({to:s.address,data:D({abi:v,functionName:"deposit",args:[a,d]}),value:"0",chainId:p,description:`Deposit ${a} asset base units into Borro vault ${s.address}.`})],$;try{$=await h.preview(u,d),z($,t,a,s,r)}catch{throw new n(x("deposit-would-revert",{}))}let T=w.deployedAt===void 0?void 0:Date.parse(w.deployedAt)/1e3,B=R({amount:m(a,t.decimals),symbol:t.symbol,kind:t.symbol==="USDG"?"usdg":"stock",shares:m(f,18),sharesMin:m(r,18),vaultSymbol:s.symbol,deployedAtSeconds:T,nowSeconds:Math.floor(Date.now()/1e3)});return{txs:u,preview:$,vault:s.address,asset:t,shareToken:s,amount:a.toString(),shares:f.toString(),shares_min:r.toString(),summary:`${B}
2
- Base units: amount ${a} (${t.address}, decimals ${t.decimals}); shares ${f} (${s.address}, decimals 18); shares_min ${r}. ${y}`}}},{name:"borro_withdraw",inputSchema:O("withdraw"),execute:async(e,o)=>{let a=e.amount==="max",w=a?void 0:U(e.amount),t=await N(e,"withdraw",o),{asset:s,share:i}=S(t),f=g(await l.readContract({address:i.address,abi:v,functionName:"balanceOf",args:[d]}));if(f===0n)throw new n(x("no-shares",{symbol:s.symbol}));let r=a?f:g(await l.readContract({address:i.address,abi:v,functionName:"previewWithdraw",args:[w]}));if(r===0n||r>f)throw new n("This wallet does not hold enough Borro shares for that withdrawal.");let u=w??g(await l.readContract({address:i.address,abi:v,functionName:"previewRedeem",args:[r]}));if(u===0n)throw new n("Borro preview returned no assets for these shares. Nothing was signed.");let $=await c.readLiquidity(l,t).catch(()=>({kind:"unknown"})),T=$.kind!=="unknown"&&"readyBase"in $?$.readyBase:void 0,B=typeof T=="bigint"&&T>=0n&&T<1n<<256n?T:void 0;if(B!==void 0&&B<u)return{txs:[],vault:i.address,asset:s,shareToken:i,amount:u.toString(),shares:r.toString(),max_now:B.toString(),summary:x("too-little-ready",{ready:m(B,s.decimals),requested:m(u,s.decimals),maxNow:m(B,s.decimals),symbol:s.symbol})};let I=a?W(u):u,V=[h.unsignedTx({to:i.address,data:a?D({abi:v,functionName:"redeem",args:[r,d,d]}):D({abi:v,functionName:"withdraw",args:[u,d,d]}),value:"0",chainId:p,description:`Withdraw ${u} asset base units from Borro vault ${i.address}${a?` for ${r} share base units`:""}.`})],C=a?await h.preview(V,d):await h.preview(V,d,{reads:[{to:i.address,data:D({abi:v,functionName:"previewWithdraw",args:[u]}),chainId:p}]});if(!a){let q=C.readResults?.[0];if(C.readResults?.length!==1||typeof q!="string"||!/^0x[0-9a-fA-F]{64}$/.test(q))throw new n("Borro preview returned an invalid share quote. Nothing was signed.");if(r=g(BigInt(q)),r===0n||r>f)throw new n("This wallet does not hold enough Borro shares for that withdrawal.")}z(C,i,r,s,I);let E=M({amount:m(u,s.decimals),isAll:a,symbol:s.symbol,out:m(u,s.decimals),shares:m(r,18),vaultSymbol:i.symbol,drift:t.setup.drift.length>0});return{txs:V,preview:C,vault:i.address,asset:s,shareToken:i,amount:u.toString(),shares:r.toString(),assets_min:I.toString(),isMax:a,setup:t.setup,summary:`${E}
3
- Base units: amount ${u} (${s.address}, decimals ${s.decimals}); shares ${r} (${i.address}, decimals 18); assets_min ${I}. ${y}`}}}];for(let e of b){let o=e.execute;e.execute=async(a,w)=>{try{return await o(a,w)}catch(t){throw new n(h.plainError(t))}}}return b};export{K as a};
@@ -1,70 +0,0 @@
1
- import{a as ot}from"./63YRSLDK.js";var yt={};ot(yt,{ACCESS_FEE_LINE:()=>M,ACCESS_NO_PLAN:()=>T,BANNED_COPY:()=>pt,BONUS_CLAUSE:()=>l,CARD_FOOTER_ASK:()=>E,CARD_FOOTER_NO_ASK:()=>k,CARD_HEADER:()=>s,CARD_HEADER_AMOUNT:()=>r,CARD_HEADER_AMOUNT_NOT_HELD:()=>i,ETH_HINT:()=>f,FEES_ESTIMATED_HIGH:()=>K,LAYERBANK_RISK_SUMMARY:()=>u,LAYERBANK_SETUP_MISMATCH:()=>Q,LAYERBANK_SITE:()=>st,LB_BONUS_NOTE:()=>N,LB_CASH_NOTE:()=>O,LB_DEPOSIT_SCREEN:()=>x,LB_WITHDRAW_SCREEN:()=>S,LP_ADD_BUTTON:()=>ht,LP_BLOCK:()=>$,LP_BLOCK_UNREADABLE:()=>j,LP_DECLINE_BUTTON:()=>lt,LP_NOT_WORTH_CLAUSE:()=>X,MATURED_NOTICE:()=>W,MATURED_STOCK_NOTICE:()=>F,MATURED_STOCK_NOTICE_NO_AMOUNT:()=>z,NOTHING_TO_EARN:()=>b,NO_NEW_TERM:()=>q,OPTION_A:()=>h,OPTION_A_CANT_CHECK:()=>y,OPTION_A_CLOSED:()=>g,OPTION_A_NO_ROOM:()=>m,OPTION_B:()=>c,OPTION_B_CANT_CHECK:()=>w,OPTION_B_NONE:()=>p,PAYOUT_APPROX:()=>U,PAYOUT_EXACT:()=>v,PENDLE_BUY_STABLE_SCREEN:()=>A,PENDLE_BUY_STOCK_SCREEN:()=>L,PENDLE_CONTRACT_CHANGE:()=>ut,PENDLE_EARLY_EXIT:()=>_,PENDLE_FIXED_RATE:()=>it,PENDLE_REDEEM_SCREEN:()=>I,PENDLE_REDEEM_STOCK_SCREEN:()=>R,PENDLE_RISK_SUMMARY:()=>d,PENDLE_SELL_DEFAULT_BUTTON:()=>dt,PENDLE_SELL_GAP_LINE:()=>D,PENDLE_SELL_NO_GAP_LINE:()=>C,PENDLE_SELL_SCREEN:()=>P,PENDLE_SERVICE_DOWN:()=>tt,PENDLE_SITE:()=>rt,PRICE_MISMATCH_REFUSAL:()=>J,SLIPPAGE_CAP_REFUSAL:()=>V,STOCK_PAID_IN:()=>B,STOCK_SHORT_TERM:()=>Y,STOCK_SHORT_TERM_DAYS:()=>_t,TEMPLATES:()=>ct,THIN_MARKET_REFUSAL:()=>Z,TOO_SMALL:()=>G,TOO_SMALL_NO_SIZE:()=>H,fill:()=>nt,placeholdersOf:()=>at});function t(e){return{text:e}}function at(e){return[...new Set([...e.text.matchAll(/\{([a-z][a-z0-9_]*)\}/g)].map(o=>o[1]))]}function nt(e,o){let et=o;return e.text.replace(/\{([a-z][a-z0-9_]*)\}/g,(wt,a)=>{let n=et[a];if(typeof n!="string")throw new Error(`Missing value for {${a}}`);return n})}var st="layerbank.finance",rt="app.pendle.finance",s=t("You have {amount_usd} in USDG that isn't earning anything. Here are two ways to make it earn. Pick one, or neither."),r=t("Looking at {amount_usd} of your USDG. Here are two ways to make it earn. Pick one, or neither."),i=t("Looking at {amount_usd} of USDG. Here are two ways to make it earn. Pick one, or neither."),u="LayerBank is a lending app; if its code fails or almost everything is lent out, you could lose money or have to wait.",d="Pendle is a trading app; thin trading can make leaving early cost you, and its code can fail or be changed by its team.",_="If you leave early you sell at the market price that day, and that can be less than you put in.",it="The rate is fixed only if you hold until the end date.",ut="Pendle's router can be upgraded by Pendle's team, so its code can change.",h=t(`A. LayerBank: lending, take it out any time
2
- Pays about {lb_total_rate}% a year today ({lb_base_rate}% from borrowers{bonus_clause}). The rate changes, up or down.
3
- You can take your money out any time while LayerBank has cash on hand (right now {lb_cash_usd}).
4
- Risk: ${u}
5
- Cost: network fees of about {lb_gas_in_usd} to put it in and {lb_gas_out_usd} to take it out.`),l=t(", plus a bonus of {lb_bonus_rate}% that ends {bonus_end}"),c=t(`B. Pendle: a fixed rate until {pendle_end_date}
6
- Pays a fixed {pendle_rate}% a year if you keep it until {pendle_end_date}. You get {pendle_payout_usd} back for every {pendle_unit_usd} you put in.
7
- ${_}
8
- Risk: ${d}
9
- Cost: about {pendle_cost_in_usd} in fees to start and about {pendle_gas_out_usd} to cash out.`),p=t("B. Pendle has no fixed-rate USDG term open right now."),y=t("A. LayerBank can't be checked right now, so I won't offer it."),w=t("B. Pendle can't be checked right now, so I won't offer it."),g=t("A. LayerBank isn't taking new deposits right now, so I won't offer it."),m=t("A. LayerBank can only take {cap_room_usd} more right now, which is less than {amount_usd}, so I won't offer it."),E=t("Nobody guarantees either one. Which do you want: {choices}?"),k=t("Nobody guarantees either one."),f=t("You hold ETH but no USDG. I can swap some ETH to USDG first with Oak's swap tool and show you the price before anything happens."),b=t("This wallet holds no USDG and no ETH to put to work, so there is nothing to compare yet."),T=t("Putting money in or taking it out through Oak needs an active Oak plan ({plan_price}). Taking it out on {project_site} always works too, with this same wallet."),x=t(`Put {amount_usd} into LayerBank?
10
-
11
- What you get: about {lb_total_rate}% a year at today's rate. The rate changes.
12
- What happens: {amount_usd} of USDG leaves your wallet and becomes {amount_usd} of "lRobUSDG", your receipt for money lent through LayerBank. Your receipt grows as interest arrives.
13
- The risk: LayerBank is a lending app. If its code fails, or almost everything is lent out, you could lose money or have to wait to get it back.
14
- Taking it out: any time LayerBank has cash on hand. Right now that is {lb_cash_usd}. You can also take it out on layerbank.finance with this wallet.
15
- Cost: about {gas_usd} in network fees now and about {gas_out_usd} to take it out.
16
-
17
- Put in {amount_usd}? [Yes] [No]`),S=t(`Take {amount_or_all} out of LayerBank?
18
-
19
- You get back {usdg_out} USDG (your {amount_deposited_clause} plus interest so far{bonus_note}).
20
- {cash_note}
21
- Cost: about {gas_usd} in network fees.
22
-
23
- Take it out? [Yes] [No]`),N=t(". Your bonus is paid separately; ask me to claim it"),O=t("LayerBank only has {lb_cash_usd} on hand right now, so I can take out {max_now} today."),A=t(`Lock {amount_usd} in a fixed rate until {pendle_end_date}?
24
-
25
- What you get: a fixed {pendle_rate}% a year, if you keep it until {pendle_end_date}. You put in {amount_usd} and get {pt_out} tokens. Each token pays out {payout_per_pt_phrase} on {pendle_end_date}. That is about {gain_usd} more than you put in.
26
- What happens now: {amount_usd} of USDG leaves your wallet and you receive at least {pt_min} "PT-USDG" tokens (the price can move a little before this goes through; Oak refuses anything worse than {slippage_pct}%).
27
- The risk: if you leave before {pendle_end_date}, you sell at the market price that day, and that can be less than you put in. Pendle is a trading app; its code can fail, and its team can change it.
28
- Cost: about {fees_usd} in trading and network fees now, and about {gas_out_usd} to cash out at the end.
29
-
30
- Lock {amount_usd} until {pendle_end_date}? [Yes] [No]`),L=t(`Lock {amount_units} {stock_symbol} in a fixed rate until {pendle_end_date}?
31
-
32
- What you get: you put in {amount_units} {stock_symbol} and receive at least {pt_min} tokens. On {pendle_end_date} each token pays out {payout_per_pt_phrase}. That is {gain_units} {stock_symbol} more than you put in, a fixed {pendle_rate}% a year in {stock_symbol}, not in dollars.
33
- The catch: the payout is in {stock_symbol}, not dollars. If the stock token is worth less on {pendle_end_date}, you get less in dollars, even though the {stock_symbol} count is fixed.
34
- The risk: leaving early sells at the market price that day, which can be less than you put in. This term is short ({days_left} days), so the extra {stock_symbol} is small. Pendle is a trading app; its code can fail, and its team can change it.
35
- Cost: about {fees_usd} in trading and network fees now and about {gas_out_usd} to cash out.
36
-
37
- Lock it until {pendle_end_date}? [Yes] [No]`),P=t(`Leave early and sell {pt_amount} tokens now?
38
-
39
- If you wait until {pendle_end_date}, these tokens pay {payout_at_end} {unit}.
40
- If you sell now, the market pays about {sell_now} {unit}, and Oak accepts no less than {sell_min}. {gap_line}
41
- Selling early can lose money. The price today may be lower than what you paid.
42
- Cost: about {fees_usd} in trading and network fees.
43
-
44
- Sell now? [Yes, sell now] [No, keep waiting]`),D=t("That is {gap} less than waiting."),C=t("The quoted output before fees is at least the payout at the end of the term. Fees, the minimum output and what you paid still affect whether you lose money."),dt="No, keep waiting",I=t(`Cash out {pt_amount} tokens for {usdg_out} USDG?
45
-
46
- The term ended on {pendle_end_date}. Each token pays out {payout_per_pt_phrase} now, with no market price involved.
47
- Cost: about {gas_usd} in network fees.
48
-
49
- Cash out? [Yes] [No]`),R=t(`Cash out {pt_amount} tokens for about {unit_out} {stock_symbol}?
50
-
51
- The term ended on {pendle_end_date}. You receive {stock_symbol}, not USDG: about {unit_out} {stock_symbol}, worth about {value_usd} at today's price, which can move. No market price is involved in the payout itself.
52
- To end up in USDG, I can swap the {stock_symbol} afterwards with Oak's swap tool and show you that price first.
53
- Cost: about {gas_usd} in network fees.
54
-
55
- Cash out? [Yes] [No]`),v=t("exactly 1 {unit}"),U=t("about {x} {unit} at today's exchange rate"),B=t("Paid in {stock_symbol}, not dollars."),Y=t("ends in {days_left} days, usually too short to be worth the fees"),_t=7,G=t("At {amount_usd}, this is too small to be worth it. You would earn about {gross_usd} over {horizon}, and fees would take about {costs_usd}, leaving about {net_usd}. Putting in {suggest_usd} or more would be worth it, and I can still do it if you want."),H=t("At {amount_usd}, this is too small to be worth it. You would earn about {gross_usd} over {horizon}, and fees would take about {costs_usd}, leaving about {net_usd}. At today's rate no amount would make up for the fees, and I can still do it if you want."),M=t("Also: Oak access costs {plan_price} per 30 days, which you pay whether or not you earn. At this size that is more than you would earn in a month."),K=t("Fees estimated high because the live price was unavailable."),W=t(`Your fixed term on Pendle ended on {pendle_end_date}. Your {pt_amount} tokens are worth {usdg_out} USDG now.
56
- Want me to cash out to USDG, or start a new term? One "yes" is enough; say "cash out" or "new term".`),F=t('Your fixed term on Pendle ended on {pendle_end_date}. Your {pt_amount} tokens pay out about {unit_out} {stock_symbol} now, worth about {value_usd}. Want me to cash out and swap that to USDG, or start a new term? One "yes" is enough.'),z=t('Your fixed term on Pendle in {stock_symbol} ended on {pendle_end_date}. Your tokens pay out in {stock_symbol}, not USDG; I will show the exact amount before anything is sent. Want me to cash out and swap that to USDG, or start a new term? One "yes" is enough.'),q=t("There is no new fixed-rate USDG term open right now. I cashed out to USDG; want me to show LayerBank instead?"),$=t(`Before you add liquidity: what it is worth, and what can go wrong
57
-
58
- Worth: at today's reward rate of about {apr}% a year, {amount_usd} would earn about {gross_usd} until the campaign ends on {end_date}, and about {gas_usd} of that goes to network fees, leaving about {net_usd}. {worth_clause}
59
- What can go wrong:
60
- - Price exposure: you put in two coins. If one moves a lot against the other, you can end up with less than you started with, even if you earn rewards.
61
- - Going out of range: if the price leaves the range you chose, you stop earning until it comes back, and you hold mostly the weaker coin.
62
- - The rewards can end: the campaign ends on {end_date}, or sooner, and the rate shown is today's rate, which changes.
63
- Your call. [Add liquidity] [Don't]`),X=t("That is not worth it at this size."),j=t(`Before you add liquidity: what it is worth, and what can go wrong
64
-
65
- Worth: the reward rate or end date couldn't be read, so I can't tell you what this is worth.
66
- What can go wrong:
67
- - Price exposure: you put in two coins. If one moves a lot against the other, you can end up with less than you started with, even if you earn rewards.
68
- - Going out of range: if the price leaves the range you chose, you stop earning until it comes back, and you hold mostly the weaker coin.
69
- - The rewards can end: a campaign can end at any time, and any rate shown is the rate of that day, which changes.
70
- Your call. If you say nothing, the answer is Don't. [Don't] [Add liquidity]`),ht="Add liquidity",lt="Don't",V=t("Oak won't accept a price move that big. The most it allows is {cap_pct}%."),Z=t("This is a thin market and your size moves the price too much. Try a smaller amount."),J=t("Pendle's price doesn't match what Oak checked on the chain. Nothing was signed."),Q=t("LayerBank's setup no longer matches what Oak checked. Nothing was signed."),tt=t("Pendle's price service isn't answering, so I can't quote or start a new term; I can still cash out ended terms."),ct={CARD_HEADER:s,CARD_HEADER_AMOUNT:r,CARD_HEADER_AMOUNT_NOT_HELD:i,OPTION_A:h,BONUS_CLAUSE:l,OPTION_B:c,OPTION_B_NONE:p,OPTION_A_CANT_CHECK:y,OPTION_B_CANT_CHECK:w,OPTION_A_CLOSED:g,OPTION_A_NO_ROOM:m,CARD_FOOTER_ASK:E,CARD_FOOTER_NO_ASK:k,ETH_HINT:f,NOTHING_TO_EARN:b,ACCESS_NO_PLAN:T,LB_DEPOSIT_SCREEN:x,LB_WITHDRAW_SCREEN:S,LB_BONUS_NOTE:N,LB_CASH_NOTE:O,PENDLE_BUY_STABLE_SCREEN:A,PENDLE_BUY_STOCK_SCREEN:L,PENDLE_SELL_SCREEN:P,PENDLE_SELL_GAP_LINE:D,PENDLE_SELL_NO_GAP_LINE:C,PENDLE_REDEEM_SCREEN:I,PENDLE_REDEEM_STOCK_SCREEN:R,PAYOUT_EXACT:v,PAYOUT_APPROX:U,STOCK_PAID_IN:B,STOCK_SHORT_TERM:Y,TOO_SMALL:G,TOO_SMALL_NO_SIZE:H,ACCESS_FEE_LINE:M,FEES_ESTIMATED_HIGH:K,MATURED_NOTICE:W,MATURED_STOCK_NOTICE:F,MATURED_STOCK_NOTICE_NO_AMOUNT:z,NO_NEW_TERM:q,LP_BLOCK:$,LP_NOT_WORTH_CLAUSE:X,LP_BLOCK_UNREADABLE:j,SLIPPAGE_CAP_REFUSAL:V,THIN_MARKET_REFUSAL:Z,PRICE_MISMATCH_REFUSAL:J,LAYERBANK_SETUP_MISMATCH:Q,PENDLE_SERVICE_DOWN:tt},pt=[/\bsafe(ly|ty)?\b/i,/\bguaranteed\b/i,/\brisk-free\b/i,/\bpassive\b/i,/\binvest/i,/\bAPY\b(?! a year)/];export{at as a,nt as b,st as c,rt as d,s as e,r as f,i as g,u as h,d as i,_ as j,it as k,ut as l,h as m,l as n,c as o,p,y as q,w as r,g as s,m as t,E as u,k as v,f as w,b as x,T as y,x as z,S as A,N as B,O as C,A as D,L as E,P as F,D as G,C as H,dt as I,I as J,R as K,v as L,U as M,B as N,Y as O,_t as P,G as Q,H as R,M as S,K as T,W as U,F as V,z as W,q as X,$ as Y,X as Z,j as _,ht as $,lt as aa,V as ba,Z as ca,J as da,Q as ea,tt as fa,ct as ga,pt as ha,yt as ia};
@@ -1 +0,0 @@
1
- import{a as X}from"./CEQNXF6A.js";import{b as Q}from"./AXRL3REN.js";import{a as O,b as J,d as V}from"./6OGDTEGH.js";import{a as E}from"./QYKXWBZC.js";import{K as y}from"./DHUDSOGR.js";import{c as S}from"./AEL62KCG.js";import{a as H}from"./43LI5NKJ.js";import{a as N}from"./66F5ZH34.js";import{d as G,g as U,i as K}from"./NWNYJ26T.js";import{a as b}from"./FWD4L3CJ.js";import{a as e}from"./XSD5NL7J.js";import{encodeFunctionData as Z,erc20Abi as Y,getAddress as W,parseAbi as ee,zeroAddress as te}from"viem";var v={address:W("0xCeF73866b088766DeD46Ba71d9Bd7591B5e931d2"),symbol:"tNET",decimals:9,chainId:b},_={pair_oracle:["checkpoint"],futures:["open","close","marginCall","accrueCarry","sweepCarrySkim"],underwriting:["subscribe","redeem"],prize:["enter","enterWithNet","exit","exitToUsdg","lockTranche","earlyUnlock","pokeRebase"]},fe=x=>({tools:[{name:"netnet_desk_action",inputSchema:{type:"object",additionalProperties:!1,required:["program","operation"],properties:{program:{type:"string",enum:Object.keys(_)},operation:{type:"string",enum:[...new Set(Object.values(_).flat())]},amount:N(),minAmountOut:N(),maxPayment:N(),sizeUsdWad:N(),isLong:{type:"boolean"},account:{type:"string"},referrer:{type:"string"},trancheIndex:N(),lockDraws:{enum:["7","30"]},maxPenaltyAssets:N()}},execute:async(t,l)=>{try{if(H(l),typeof t.program!="string"||!Object.hasOwn(_,t.program)||typeof t.operation!="string"||!_[t.program].includes(t.operation))throw new e("Choose a supported finite NetNet desk operation.");let p=t.program,r=t.operation,P=E[p],q=X[p],T=x.clientFor(b);if(await T.getChainId()!==b)throw new e("NetNet desk actions require chain 4663.");let C=await T.getBlock(),z=new Set(["program","operation"]),m=(n,s=[])=>T.readContract({address:P.address,abi:q,functionName:n,args:s,blockNumber:C.number}),h=(...n)=>n.forEach(s=>z.add(s)),A=()=>(h("amount"),y(t.amount)),D=()=>(h("minAmountOut"),y(t.minAmountOut)),c=n=>K(n,"Provide an explicit checksummed account.",G),u=[],o,d=0n,w="",g;if(p==="pair_oracle"){if(c(await m("pairContract"))!==Q)throw new e("The oracle does not use the pinned canonical pair.");w="Permissionless oracle checkpoint; it sends no reward to this wallet and may not yet produce a valid TWAP."}else if(p==="futures"||p==="underwriting"){if(c(await m("token"))!==v.address||await T.readContract({address:v.address,abi:Y,functionName:"decimals",blockNumber:C.number})!==9)throw new e("This desk does not use the pinned valueless 9-decimal tNET test collateral.");let n=E.futures.address,s=E.underwriting.address;if(p==="futures"?c(await m("vault"))!==s:c(await m("clearinghouse"))!==n)throw new e("Futures and underwriting counterparties do not match the published pins.");if(w="Experimental tNET test program; tNET has no monetary value. Futures margin and underwriting capital can be lost. Utilization/ADL can prevent redemption. Prices and fees are read from the contract oracle; these calls encode no price floor.",r==="open"){if(h("isLong","sizeUsdWad","maxPayment"),typeof t.isLong!="boolean")throw new e("Provide isLong as a boolean.");let a=A(),f=y(t.sizeUsdWad);if(a>=1n<<128n||f>=1n<<128n)throw new e("Position margin and notional must fit uint128.");let k=c(await m("oracle"));if(k!==W("0xc8a11E8793F8714a159061369173dc86A0A5E23F"))throw new e("The futures oracle is not the published deployment.");let $=await T.readContract({address:k,abi:ee(["function marginPriceWad() view returns (uint256)"]),functionName:"marginPriceWad",blockNumber:C.number});if($<=0n)throw new e("Futures margin price is unavailable.");let i=f*5n/10000n*1000000000n/$;if(d=a+i,o=v,d>y(t.maxPayment))throw new e("Margin plus taker fee exceeds maxPayment.");u=[t.isLong,f,a],w+=` Entry fee ${i} tNET base units; exact approval caps price drift and may require a fresh preview.`}else if(r==="marginCall"){h("account");let a=c(t.account);if(await m("liquidatable",[a])!==!0)throw new e("The selected futures trader is not liquidatable.");u=[a]}else if(r==="subscribe"){d=A(),o=v,u=[d];let[a,f]=await Promise.all([m("totalShares"),m("equityTokens")]);if(typeof a!="bigint"||typeof f!="bigint"||a>0n&&f===0n)throw new e("Underwriting share price is invalid.");let k=a===0n?d:d*a/f;if(k===0n||k<D())throw new e("Underwriting subscription rounds to zero or misses the local share minimum.");w+=` Current quote ${k} underwriting share units; the share minimum is a local check, not encoded calldata.`}else if(r==="redeem"){let a=A();if(a>await m("sharesOf",[l]))throw new e("The wallet has insufficient underwriting shares.");u=[a],g={token:v,amount:D()}}}else{let[n,s,a,f,k,$]=await Promise.all(["net","usdg","staking","sNet","controller","book"].map(i=>m(i)));if(c(n)!==O.address||c(s)!==S.address||c(a)!==V||c(f)!==J.address||c(k)!==E.draw.address||c($)!==E.bonus.address)throw new e("WinNET token, staking, book or controller does not match its published pins.");if(w="WinNET principal is a fixed NET claim, exposed to NET price changes. Entry commits through three staking epochs; locks commit for 7 or 30 draws. Early unlock forfeits 1% of principal and cancels streak credits. Pair buys and sells each incur the NET trading tax; no prize or return is guaranteed.",r==="enter"||r==="enterWithNet"){h("referrer");let i=t.referrer===void 0?te:c(t.referrer);if(i===W(l))throw new e("WinNET does not permit self-referral.");d=A(),o=r==="enter"?S:O,u=r==="enter"?[d,D(),i]:[d,i],w+=` Referrer ${i} is recorded at the first deposit and cannot later be changed.`}else if(r==="exit"||r==="exitToUsdg"){let i=A();if(i>await m("principalOf",[l]))throw new e("WinNET exit exceeds this wallet\u2019s fixed principal.");u=r==="exit"?[i,l]:[i,D(),l],g={token:r==="exit"?O:S,amount:r==="exit"?i:y(t.minAmountOut)}}else if(r==="lockTranche"||r==="earlyUnlock"){h("trancheIndex");let i=y(t.trancheIndex,!0),I=await m("trancheAt",[l,i]);if(!Array.isArray(I)||typeof I[0]!="bigint"||I[0]===0n)throw new e("Choose a nonempty WinNET tranche.");if(r==="lockTranche"){if(h("lockDraws"),t.lockDraws!=="7"&&t.lockDraws!=="30")throw new e("Choose a 7- or 30-draw lock.");u=[i,BigInt(t.lockDraws)]}else{h("maxPenaltyAssets");let M=(I[0]+99n)/100n;if(M>y(t.maxPenaltyAssets,!0))throw new e("Early unlock exceeds maxPenaltyAssets in NET base units.");u=[i],w+=` Current irreversible forfeiture ${M} NET base units.`}}}if(Object.keys(t).some(n=>!z.has(n)))throw new e("Unexpected fields for this desk operation.");if(o&&await T.readContract({address:o.address,abi:Y,functionName:"balanceOf",args:[l],blockNumber:C.number})<d)throw new e(`Top up ${o.symbol}; this action needs ${d} base units.`);let F=`NetNet ${p}.${r}, contract ${P.address}, chain ${b}, ordered values ${JSON.stringify(u,(n,s)=>typeof s=="bigint"?String(s):s)}. ${o?`Approve exactly ${d} ${o.symbol} base units (token ${o.address}, decimals ${o.decimals}). `:""}${w}`,L=[...o?[x.approval(o.address,P.address,d.toString(),b)]:[],x.unsignedTx({to:P.address,data:Z({abi:q,functionName:r,args:u}),value:"0",chainId:b,description:F})],R=await x.preview(L,l),B=0n,j=0n;for(let n of R.changes){if(n.token.chainId!==b||!/^-?\d+$/.test(n.amount))throw new e("Invalid desk preview metadata.");let s=BigInt(n.amount);if(s<0n){if(!o||!U(n.token.address,o.address)||n.token.decimals!==o.decimals)throw new e("Desk preview spends an unexpected wallet asset.");B-=s}if(g&&U(n.token.address,g.token.address)){if(n.token.decimals!==g.token.decimals)throw new e("Desk receipt decimals mismatch.");j+=s}}if(B>d||g&&j<g.amount)throw new e("Desk preview exceeds its input budget or misses the requested receipt minimum.");return{txs:L,preview:R,summary:F}}catch(p){throw new e(x.plainError(p))}}}]});export{v as a,fe as b};
@@ -1 +0,0 @@
1
- import{a as S}from"./A3PN3PK3.js";import{a as M}from"./43LI5NKJ.js";import{a as s,j as I}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{getAddress as c}from"viem";var j=["one_hour","six_hours","one_day","seven_days","thirty_days","ninety_days","one_year","inception"],v=["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],A={apy:["v1","apy-averages"],allocations:["v0","allocations"],history:["v0","state/history"],pending_governance:["v0","pending-governance-actions"]};function f(o){if(!o||typeof o!="object"||Array.isArray(o))throw new n("Morpho analytics returned an invalid object.");return o}function b(o){if(typeof o!="string"||!/^\d+$/.test(o)||BigInt(o)>=1n<<256n)throw new n("Morpho analytics returned an invalid decimal base-unit amount.");return o}function N(o,d){let r=f(o);if(![s,String(s)].includes(r.chain_id)||typeof r.vault_address!="string"||c(r.vault_address)!==c(d))throw new n("Morpho analytics returned another chain or vault.")}function k(o,d=0){if(d>12)throw new n("Morpho analytics response is too deeply nested.");if(Array.isArray(o))return o.map(r=>k(r,d+1));if(o&&typeof o=="object")return Object.fromEntries(Object.entries(o).map(([r,e])=>{if(e!==null&&/(?:_assets|_shares|_supply|_cap|_wad|_ray)$/.test(r)&&typeof e!="object")return[r,b(e)];if(e!==null&&/_address$/.test(r)){if(typeof e!="string")throw new n("Morpho analytics returned an invalid address.");return[r,c(e)]}return[r,k(e,d+1)]}));if(typeof o=="number"&&!Number.isFinite(o))throw new n("Morpho analytics returned a non-finite value.");return o}function U(o,d,r){return{name:d,inputSchema:{type:"object",additionalProperties:!1,required:["view"],properties:{view:{type:"string",enum:Object.keys(A)},lookback:{type:"string",enum:j,description:"APY window: one_hour through inception. History: one_day, seven_days, thirty_days, ninety_days, one_year or inception. Defaults to six_hours for APY or seven_days for history."},cursor:{type:"string",maxLength:4096,description:"Opaque cursor from pending_governance only."},limit:{type:"integer",minimum:1,maximum:100}},allOf:[{if:{properties:{view:{const:"history"}},required:["view"]},then:{properties:{lookback:{enum:v}}}}]},execute:async(e,O)=>{try{if(M(O),Object.keys(e).some(t=>!["view","lookback","cursor","limit"].includes(t))||typeof e.view!="string"||!Object.hasOwn(A,e.view))throw new n("Choose a documented Morpho analytics view.");let a=e.view,u=a==="history",w=a==="apy",_=a==="pending_governance";if(e.lookback!==void 0&&(!u&&!w||typeof e.lookback!="string"||!j.includes(e.lookback)))throw new n("lookback is available only for APY/history with a documented window.");if(u&&e.lookback!==void 0&&!v.includes(e.lookback))throw new n(`Choose a history lookback from ${v.join(", ")}; sub-day history is unavailable.`);if(!_&&(e.cursor!==void 0||e.limit!==void 0))throw new n("Pagination applies only to pending_governance.");if(e.cursor!==void 0&&(typeof e.cursor!="string"||e.cursor.length>4096))throw new n("Provide the opaque pending-governance cursor string.");let y=e.limit??100;if(typeof y!="number"||!Number.isInteger(y)||y<1||y>100)throw new n("Pagination limit must be an integer from 1 to 100.");let[Y,$]=A[a],p=new URL(`https://api.morpho.org/${Y}/vaults-v2/${s}:${c(r)}/${$}`);(u||w)&&p.searchParams.set("lookback",String(e.lookback??(u?"seven_days":"six_hours"))),_&&(p.searchParams.set("limit",String(y)),e.cursor!==void 0&&p.searchParams.set("cursor",e.cursor));let g=await o.http(p.toString(),{headers:{accept:"application/json"},signal:AbortSignal.timeout(15e3)});if(!g.ok)throw new n(`Morpho analytics HTTP ${g.status}. Retry when the service is reachable; no zero APY or empty book was inferred.`);let i=f(await g.json());N(w||a==="allocations"?i.data:i.params,r);let m,h=i.last_indexed_block,P=null;if(w){let t=f(i.data);if(t.lookback!==(e.lookback??"six_hours")||t.apy!==null&&(typeof t.apy!="number"||!Number.isFinite(t.apy)||t.apy<-1))throw new n("Morpho analytics returned an invalid APY or lookback.");m={annualYieldFraction:t.apy===null?null:String(t.apy),...t.apy===null?{status:"unavailable",reason:"Not enough history for the requested APY window."}:{},lookback:t.lookback,basis:"Realized post-fee share-price APY, excluding rewards; historical observation, not a promised return."},h=t.last_indexed_block}else if(a==="allocations"){let t=f(i.data);if(!Array.isArray(t.allocations))throw new n("Morpho analytics omitted adapter allocations.");m=k(t.allocations),h=t.last_indexed_block}else{if(!Array.isArray(i.data))throw new n("Morpho analytics omitted its record array.");if(u)for(let t of i.data){let l=f(t);if(typeof l.timestamp!="number"||!Number.isSafeInteger(l.timestamp)||l.timestamp<0)throw new n("Morpho history returned an invalid timestamp.");for(let C of["total_assets","total_supply","withdrawable_assets","allocated_assets","idle_assets"])b(l[C]);l.share_price_ray!==null&&b(l.share_price_ray)}if(_){if(i.cursor!==null&&typeof i.cursor!="string")throw new n("Morpho analytics returned an invalid pagination cursor.");P=i.cursor}m=k(i.data)}h!==void 0&&b(h);let x=o.clientFor(s);if(await x.getChainId()!==s)throw new n("Vault share metadata requires chain 4663.");let D=await S(x,c(r));return{vault:c(r),chainId:s,sourceUrl:p.toString(),view:a,lastIndexedBlock:h??null,cursor:P,data:m,asset:{address:c(I),symbol:"USDG",decimals:6,chainId:s},shareToken:{address:c(r),symbol:D,decimals:18,chainId:s},scales:{sharePriceRay:"1000000000000000000000000000",capWad:"1000000000000000000"},caveat:"Indexer data may lag the chain. APY excludes rewards; empty records describe only this API window/page. Re-read onchain state and preview before any action. API book data is never executed as calldata automatically."}}catch(a){throw new n(o.plainError(a))}}}}export{U as a};
@@ -1 +0,0 @@
1
- var b=.25,l=30,g=30,f=.5,S=1e9;function p(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?{usd:e,estimatedHigh:!1}:{usd:.5,estimatedHigh:!0}}function x(e){let{gross:t,costs:n}=e,r=t-n,s=t<=n||n*4>t,o=s?m(e):void 0;return{tooSmall:s,grossUsd:t,costsUsd:n,netUsd:r,...o===void 0?{}:{suggestUsd:o}}}function m(e){let{gross:t,costs:n,amount:r}=e;if(![t,n,r].every(Number.isFinite)||!(t>0)||!(r>0)||!(n>=0))return;let s=t/r,o=i=>{let c=s*i;return n<=c*(1+1e-9)&&n*4<=c*(1+1e-9)},a=Math.ceil(n*4/s-1e-9);if(!Number.isFinite(a)||a>1e9)return;let u=Math.max(1,a);for(let i=0;i<4&&!o(u);i+=1)u+=1;if(o(u)){for(let i=0;i<4&&u>1&&o(u-1);i+=1)u-=1;return u}}function U(e){return e.amountUsd*e.ratePct/100*(e.days/365)}function A(e){let t=e.redeemOutBase-e.amountBase,n=t<0n,r=n?-t:t,s=10n**BigInt(e.decimals),o=Number(r/s)+Number(r%s)/Number(s);return n?-o:o}function _(e){let{planPriceUsd:t}=e;return typeof t!="number"||!Number.isFinite(t)||t<=0||!(e.gross30d<t)?!1:!(e.paidUntil>e.nowSec)||e.paidUntil<e.horizonEndsAt}function h(e,t){return Math.max(0,(t-e)/86400)}function D(e){let t=e<0?"-":"",n=Math.abs(e);if(n===0)return"$0.00";if(n<.001&&(n=.001),n>=.9995)return`${t}$${n.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`;let r=n.toFixed(3);return`${t}$${r.endsWith("0")?n.toFixed(2):r}`}function N(e){return e.toFixed(2)}var d=["January","February","March","April","May","June","July","August","September","October","November","December"];function $(e){let t=new Date(e*1e3);return`${d[t.getUTCMonth()]} ${t.getUTCDate()}, ${t.getUTCFullYear()}`}function E(e){let t=Math.max(1,Math.round(e));return t===1?"1 day":`${t} days`}function y(e,t,n=4){let r=e<0n,s=r?-e:e,o=10n**BigInt(t),a=s/o,u=(s%o).toString().padStart(t,"0").slice(0,n).replace(/0+$/,"");return`${r?"-":""}${a.toString()}${u?`.${u}`:""}`}export{b as a,l as b,g as c,f as d,S as e,p as f,x as g,m as h,U as i,A as j,_ as k,h as l,D as m,N as n,$ as o,E as p,y as q};