@oakagentkit/core 0.2.7 → 0.3.1
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.
- package/build/dist/api/addresses.d.ts +9 -0
- package/build/dist/api/addresses.js +1 -1
- package/build/dist/api/chain.d.ts +4 -0
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/identity-link.js +1 -1
- package/build/dist/api/metadata.js +1 -1
- package/build/dist/api/modules/beefy/boosts.js +1 -1
- package/build/dist/api/modules/beefy/clm.d.ts +9 -0
- package/build/dist/api/modules/beefy/clm.js +1 -1
- package/build/dist/api/modules/beefy/guard.js +1 -1
- package/build/dist/api/modules/beefy/index.js +1 -1
- package/build/dist/api/modules/beefy/liquidity.js +1 -1
- package/build/dist/api/modules/beefy/management.js +1 -1
- package/build/dist/api/modules/beefy/vaults.js +1 -1
- package/build/dist/api/modules/borro/abi.d.ts +54 -0
- package/build/dist/api/modules/borro/abi.js +1 -1
- package/build/dist/api/modules/borro/actions.d.ts +14 -1
- package/build/dist/api/modules/borro/actions.js +1 -1
- package/build/dist/api/modules/borro/checks.js +1 -1
- package/build/dist/api/modules/borro/copy.d.ts +10 -2
- package/build/dist/api/modules/borro/copy.js +1 -1
- package/build/dist/api/modules/borro/index.js +1 -1
- package/build/dist/api/modules/borro/liquidity.js +1 -1
- package/build/dist/api/modules/borro/pins.d.ts +30 -14
- package/build/dist/api/modules/borro/pins.js +1 -1
- package/build/dist/api/modules/borro/positions.js +1 -1
- package/build/dist/api/modules/borro/reader.js +1 -1
- package/build/dist/api/modules/borro/types.d.ts +1 -0
- package/build/dist/api/modules/chop/actions.js +1 -1
- package/build/dist/api/modules/chop/checks.js +1 -1
- package/build/dist/api/modules/chop/copy.js +1 -1
- package/build/dist/api/modules/chop/guard.js +1 -1
- package/build/dist/api/modules/chop/index.js +1 -1
- package/build/dist/api/modules/chop/pins.d.ts +13 -0
- package/build/dist/api/modules/chop/pins.js +1 -1
- package/build/dist/api/modules/chop/positions.js +1 -1
- package/build/dist/api/modules/chop/reader.js +1 -1
- package/build/dist/api/modules/clanker/extensions.js +1 -1
- package/build/dist/api/modules/clanker/index.js +1 -1
- package/build/dist/api/modules/clanker/manage.js +1 -1
- package/build/dist/api/modules/clanker/pool-config.js +1 -1
- package/build/dist/api/modules/clanker/protocol.js +1 -1
- package/build/dist/api/modules/clanker/state.js +1 -1
- package/build/dist/api/modules/earn/copy.d.ts +6 -6
- package/build/dist/api/modules/earn/copy.js +1 -1
- package/build/dist/api/modules/earn/cost.d.ts +1 -1
- package/build/dist/api/modules/earn/cost.js +1 -1
- package/build/dist/api/modules/earn/index.js +1 -1
- package/build/dist/api/modules/earn/lp.js +1 -1
- package/build/dist/api/modules/earn/options.js +1 -1
- package/build/dist/api/modules/erc8004/common.js +1 -1
- package/build/dist/api/modules/erc8004/domain.js +1 -1
- package/build/dist/api/modules/erc8004/index.js +1 -1
- package/build/dist/api/modules/erc8004/management.js +1 -1
- package/build/dist/api/modules/erc8004/reputation.js +1 -1
- package/build/dist/api/modules/erc8004/services.js +1 -1
- package/build/dist/api/modules/erc8004/thesis.d.ts +61 -0
- package/build/dist/api/modules/erc8004/thesis.js +1 -0
- package/build/dist/api/modules/erc8004/validation.js +1 -1
- package/build/dist/api/modules/fobo/client.d.ts +9 -0
- package/build/dist/api/modules/fobo/client.js +1 -0
- package/build/dist/api/modules/fobo/index.d.ts +16 -0
- package/build/dist/api/modules/fobo/index.js +1 -0
- package/build/dist/api/modules/fobo/intent.d.ts +243 -0
- package/build/dist/api/modules/fobo/intent.js +1 -0
- package/build/dist/api/modules/fobo/pins.d.ts +178 -0
- package/build/dist/api/modules/fobo/pins.js +1 -0
- package/build/dist/api/modules/fobo/steps.d.ts +25 -0
- package/build/dist/api/modules/fobo/steps.js +1 -0
- package/build/dist/api/modules/fobo/verify.d.ts +89 -0
- package/build/dist/api/modules/fobo/verify.js +1 -0
- package/build/dist/api/modules/gloam/copy.d.ts +1 -1
- package/build/dist/api/modules/gloam/copy.js +1 -1
- package/build/dist/api/modules/gloam/index.js +1 -1
- package/build/dist/api/modules/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
- package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
- package/build/dist/api/modules/hoodag/index.d.ts +12 -1
- package/build/dist/api/modules/hoodag/index.js +1 -1
- package/build/dist/api/modules/hoodag/management.js +1 -1
- package/build/dist/api/modules/hoodag/public-reads.js +1 -1
- package/build/dist/api/modules/hoodag/reconstruct.d.ts +14 -0
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/buyback.js +1 -1
- package/build/dist/api/modules/hoodlock/commerce.js +1 -1
- package/build/dist/api/modules/hoodlock/fee.js +1 -1
- package/build/dist/api/modules/hoodlock/guard.js +1 -1
- package/build/dist/api/modules/hoodlock/index.js +1 -1
- package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
- package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
- package/build/dist/api/modules/hoodlock/public.js +1 -1
- package/build/dist/api/modules/hookr/actions.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/contracts.js +1 -1
- package/build/dist/api/modules/hookr/create-cancel.js +1 -1
- package/build/dist/api/modules/hookr/discovery.js +1 -1
- package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/launch-options.js +1 -1
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.js +1 -1
- package/build/dist/api/modules/hookr/liquidity.js +1 -1
- package/build/dist/api/modules/hookr/lp-positions.js +1 -1
- package/build/dist/api/modules/hookr/lp-reads.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/kyberswap/index.d.ts +2 -1
- package/build/dist/api/modules/kyberswap/index.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/abi.js +1 -1
- package/build/dist/api/modules/layerbank/actions.js +1 -1
- package/build/dist/api/modules/layerbank/checks.js +1 -1
- package/build/dist/api/modules/layerbank/index.js +1 -1
- package/build/dist/api/modules/layerbank/merkl.js +1 -1
- package/build/dist/api/modules/layerbank/reader.js +1 -1
- package/build/dist/api/modules/layerbank/reserve.js +1 -1
- package/build/dist/api/modules/lighter/index.js +1 -1
- package/build/dist/api/modules/longbow/administration.js +1 -1
- package/build/dist/api/modules/longbow/analytics.js +1 -1
- package/build/dist/api/modules/longbow/fixed.js +1 -1
- package/build/dist/api/modules/longbow/index.js +1 -1
- package/build/dist/api/modules/longbow/nft.js +1 -1
- package/build/dist/api/modules/longbow/rebates.js +1 -1
- package/build/dist/api/modules/longbow/staking.js +1 -1
- package/build/dist/api/modules/meridian/index.js +1 -1
- package/build/dist/api/modules/meridian/markets.js +1 -1
- package/build/dist/api/modules/meridian/predict-read.js +1 -1
- package/build/dist/api/modules/meridian/rfq.js +1 -1
- package/build/dist/api/modules/merkl/discovery.js +1 -1
- package/build/dist/api/modules/merkl/index.js +1 -1
- package/build/dist/api/modules/merkl/manage.js +1 -1
- package/build/dist/api/modules/merkl/protocol.js +1 -1
- package/build/dist/api/modules/morpho/allocator.js +1 -1
- package/build/dist/api/modules/morpho/bundles.js +1 -1
- package/build/dist/api/modules/morpho/in-kind.js +1 -1
- package/build/dist/api/modules/morpho/index.js +1 -1
- package/build/dist/api/modules/morpho/local-guard.d.ts +2 -1
- package/build/dist/api/modules/morpho/local-guard.js +1 -1
- package/build/dist/api/modules/morpho/midnight.js +1 -1
- package/build/dist/api/modules/morpho/protocol.js +1 -1
- package/build/dist/api/modules/morpho/surface.js +1 -1
- package/build/dist/api/modules/morpho/vault-management.js +1 -1
- package/build/dist/api/modules/morpho/vault-tools.js +1 -1
- package/build/dist/api/modules/morpho/vault-v2.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-policy.d.ts +1 -0
- package/build/dist/api/modules/netnet/card-policy.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.js +1 -1
- package/build/dist/api/modules/netnet/desk-read.js +1 -1
- package/build/dist/api/modules/netnet/financial.js +1 -1
- package/build/dist/api/modules/netnet/index.js +1 -1
- package/build/dist/api/modules/netnet/staking.js +1 -1
- package/build/dist/api/modules/orbio/index.d.ts +6 -0
- package/build/dist/api/modules/orbio/index.js +1 -1
- package/build/dist/api/modules/orbio/positions.js +1 -1
- package/build/dist/api/modules/pendle/costs.js +1 -1
- package/build/dist/api/modules/pendle/index.js +1 -1
- package/build/dist/api/modules/pendle/markets.js +1 -1
- package/build/dist/api/modules/pendle/positions.js +1 -1
- package/build/dist/api/modules/pendle/pricecheck.js +1 -1
- package/build/dist/api/modules/pendle/reader.js +1 -1
- package/build/dist/api/modules/pendle/redeem.js +1 -1
- package/build/dist/api/modules/pendle/trade.js +1 -1
- package/build/dist/api/modules/pendle/validate.js +1 -1
- package/build/dist/api/modules/pendle/verify.js +1 -1
- package/build/dist/api/modules/pons/claim.js +1 -1
- package/build/dist/api/modules/pons/index.js +1 -1
- package/build/dist/api/modules/pons/launch-status.js +1 -1
- package/build/dist/api/modules/pons/prices.js +1 -1
- package/build/dist/api/modules/pons/reads.js +1 -1
- package/build/dist/api/modules/pons/swap-terms.d.ts +2 -8
- package/build/dist/api/modules/pons/swap-terms.js +1 -1
- package/build/dist/api/modules/pons/trade.js +1 -1
- package/build/dist/api/modules/poolstrade/index.js +1 -1
- package/build/dist/api/modules/priors/coverage.js +1 -1
- package/build/dist/api/modules/priors/discovery.js +1 -1
- package/build/dist/api/modules/priors/features.js +1 -1
- package/build/dist/api/modules/priors/holdings.js +1 -1
- package/build/dist/api/modules/priors/index.js +1 -1
- package/build/dist/api/modules/priors/integration.js +1 -1
- package/build/dist/api/modules/priors/market.js +1 -1
- package/build/dist/api/modules/priors/pt.js +1 -1
- package/build/dist/api/modules/priors/savings-exit.js +1 -1
- package/build/dist/api/modules/priors/starter-line.js +1 -1
- package/build/dist/api/modules/priors/stock-swap.js +1 -1
- package/build/dist/api/modules/relay/api.js +1 -1
- package/build/dist/api/modules/relay/bootstrap.js +1 -1
- package/build/dist/api/modules/relay/discovery.js +1 -1
- package/build/dist/api/modules/relay/inbound.js +1 -1
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/order.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/readiness.js +1 -1
- package/build/dist/api/modules/relay/reads.js +1 -1
- package/build/dist/api/modules/relay/vaults.js +1 -1
- package/build/dist/api/modules/spark/actions.js +1 -1
- package/build/dist/api/modules/spark/details.js +1 -1
- package/build/dist/api/modules/spark/index.js +1 -1
- package/build/dist/api/modules/spark/management.js +1 -1
- package/build/dist/api/modules/steakhouse/analytics.js +1 -1
- package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
- package/build/dist/api/modules/steakhouse/index.js +1 -1
- package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
- package/build/dist/api/modules/steakhouse/management.js +1 -1
- package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
- package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
- package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
- package/build/dist/api/modules/tickerspring/discovery.js +1 -1
- package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
- package/build/dist/api/modules/tickerspring/guards.js +1 -1
- package/build/dist/api/modules/tickerspring/index.js +1 -1
- package/build/dist/api/modules/tickerspring/journeys.js +1 -1
- package/build/dist/api/modules/tickerspring/ladder.js +1 -1
- package/build/dist/api/modules/tickerspring/maker.js +1 -1
- package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
- package/build/dist/api/modules/tickerspring/research.js +1 -1
- package/build/dist/api/modules/tickerspring/strategies.js +1 -1
- package/build/dist/api/modules/uniswap/auction-create.js +1 -1
- package/build/dist/api/modules/uniswap/auction.js +1 -1
- package/build/dist/api/modules/uniswap/batch.js +1 -1
- package/build/dist/api/modules/uniswap/common.js +1 -1
- package/build/dist/api/modules/uniswap/fees.js +1 -1
- package/build/dist/api/modules/uniswap/index.js +1 -1
- package/build/dist/api/modules/uniswap/local-guard.js +1 -1
- package/build/dist/api/modules/uniswap/oracle.js +1 -1
- package/build/dist/api/modules/uniswap/pool-math.js +1 -1
- package/build/dist/api/modules/uniswap/pools.js +1 -1
- package/build/dist/api/modules/uniswap/position.js +1 -1
- package/build/dist/api/modules/uniswap/protocol.js +1 -1
- package/build/dist/api/modules/uniswap/quote-guard.js +1 -1
- package/build/dist/api/modules/uniswap/token-jar.js +1 -1
- package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
- package/build/dist/api/modules/uniswap/trade.js +1 -1
- package/build/dist/api/modules/uniswap/v2.js +1 -1
- package/build/dist/api/modules/uniswap/v3.js +1 -1
- package/build/dist/api/modules/uniswap/v4.js +1 -1
- package/build/dist/api/modules/uniswap/wrap.js +1 -1
- package/build/dist/api/modules/upoch/copy.d.ts +5 -0
- package/build/dist/api/modules/upoch/copy.js +1 -0
- package/build/dist/api/modules/upoch/index.d.ts +8 -0
- package/build/dist/api/modules/upoch/index.js +1 -0
- package/build/dist/api/modules/upoch/pins.d.ts +8 -0
- package/build/dist/api/modules/upoch/pins.js +1 -0
- package/build/dist/api/modules/upoch/reads.d.ts +509 -0
- package/build/dist/api/modules/upoch/reads.js +1 -0
- package/build/dist/api/modules/velora/claims.js +1 -1
- package/build/dist/api/modules/velora/delta-reads.js +1 -1
- package/build/dist/api/modules/velora/index.js +1 -1
- package/build/dist/api/modules/wormhole/index.js +1 -1
- package/build/dist/api/modules/wormhole/x402-client.d.ts +17 -1
- package/build/dist/api/modules/wormhole/x402-client.js +1 -1
- package/build/dist/api/positions.js +1 -1
- package/build/dist/api/pricenote.js +1 -1
- package/build/dist/api/prices.d.ts +5 -0
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/pricing.js +1 -1
- package/build/dist/api/rpc.js +1 -1
- package/build/dist/api/secret-fields.d.ts +2 -0
- package/build/dist/api/secret-fields.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/signing.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.d.ts +1 -0
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.d.ts +1 -0
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/universal-router.d.ts +45 -0
- package/build/dist/api/universal-router.js +1 -0
- package/build/dist/api/usd-estimate.js +1 -1
- package/build/dist/chunks/{ZOMFHTB2.js → 22TU5PFT.js} +1 -1
- package/build/dist/chunks/23HNDJ76.js +2 -0
- package/build/dist/chunks/{ZFU65MB4.js → 257N7343.js} +1 -1
- package/build/dist/chunks/{F3VDVTMS.js → 27PVS6BU.js} +1 -1
- package/build/dist/chunks/{N245WC5R.js → 2JWAFLJU.js} +1 -1
- package/build/dist/chunks/{GQYV4TFO.js → 2OVJ2BTJ.js} +1 -1
- package/build/dist/chunks/{JS53DQVT.js → 35LXCSHY.js} +1 -1
- package/build/dist/chunks/{V37L4DU4.js → 3A2IKFTV.js} +1 -1
- package/build/dist/chunks/{OYPAVXGQ.js → 3BMM3V4P.js} +1 -1
- package/build/dist/chunks/{ZKZUS3QU.js → 3FU6XP6S.js} +1 -1
- package/build/dist/chunks/{BB765L75.js → 3PHJUFU2.js} +1 -1
- package/build/dist/chunks/{FWIFTPSE.js → 3PU2SD3U.js} +1 -1
- package/build/dist/chunks/{SBY4RJ7I.js → 3ZH5SOC2.js} +1 -1
- package/build/dist/chunks/43BG2JRB.js +1 -0
- package/build/dist/chunks/{YTLH4M4Y.js → 47HSRR7G.js} +1 -1
- package/build/dist/chunks/4NBXBKOX.js +2 -0
- package/build/dist/chunks/{EZZM2GQT.js → 4NDIYRH5.js} +1 -1
- package/build/dist/chunks/{FOKEFXGP.js → 4PLLS6CT.js} +1 -1
- package/build/dist/chunks/4RCYYN6O.js +1 -0
- package/build/dist/chunks/{XHYFISVV.js → 4Z3IGMU6.js} +1 -1
- package/build/dist/chunks/4ZD5D2UP.js +1 -0
- package/build/dist/chunks/{CSDN4MYP.js → 5GQJVKVY.js} +1 -1
- package/build/dist/chunks/{QFSBDPLN.js → 65OITTDL.js} +1 -1
- package/build/dist/chunks/{4FPV4CRC.js → 6D3XNCOX.js} +1 -1
- package/build/dist/chunks/{DSTMEY5F.js → 6F527FLN.js} +1 -1
- package/build/dist/chunks/{O3JWCJIF.js → 6GWXPQZ6.js} +1 -1
- package/build/dist/chunks/{32RXFUOH.js → 73BZPPRS.js} +1 -1
- package/build/dist/chunks/75SULXNT.js +1 -0
- package/build/dist/chunks/{WU7XIAXB.js → 7EACRKFV.js} +1 -1
- package/build/dist/chunks/{SKEKXEUU.js → 7FIEBJOZ.js} +1 -1
- package/build/dist/chunks/{4GNUXN4K.js → 7FZXSYFD.js} +1 -1
- package/build/dist/chunks/{ZP36DSOD.js → 7TSIF3F4.js} +1 -1
- package/build/dist/chunks/{AMTRDPVO.js → 7U62MMUQ.js} +1 -1
- package/build/dist/chunks/{DW4V5PUY.js → 7VH6JQ2H.js} +1 -1
- package/build/dist/chunks/A3BJSQ23.js +1 -0
- package/build/dist/chunks/{YSMWCKIX.js → ADIPEGNN.js} +1 -1
- package/build/dist/chunks/AG2G7BHH.js +6 -0
- package/build/dist/chunks/AIYNFIG6.js +1 -0
- package/build/dist/chunks/ANIF3JMV.js +4 -0
- package/build/dist/chunks/{4JTTA3BX.js → AWV24X7F.js} +1 -1
- package/build/dist/chunks/{7QKYDNF6.js → AXHFNE6L.js} +1 -1
- package/build/dist/chunks/{WOGWLFAL.js → BGVC5NI6.js} +1 -1
- package/build/dist/chunks/BJK75C7G.js +1 -0
- package/build/dist/chunks/BSX4LFYI.js +1 -0
- package/build/dist/chunks/{OYJFXEDU.js → BZPFPQ2I.js} +1 -1
- package/build/dist/chunks/{5PI57UC2.js → C76D54YG.js} +1 -1
- package/build/dist/chunks/{TDZTC5WR.js → DBOGRUPS.js} +1 -1
- package/build/dist/chunks/{HHO5ISMM.js → DCGNVMKG.js} +1 -1
- package/build/dist/chunks/{Y77EVVT4.js → DGDMRATN.js} +1 -1
- package/build/dist/chunks/{EGZREEG2.js → DLNA5272.js} +1 -1
- package/build/dist/chunks/{TM7Z5SA4.js → DMDOSHV7.js} +1 -1
- package/build/dist/chunks/{WHVZ372B.js → DRLBTB4E.js} +1 -1
- package/build/dist/chunks/DXAPKN7H.js +1 -0
- package/build/dist/chunks/{FZ6IJZZM.js → E76Z2TT4.js} +1 -1
- package/build/dist/chunks/{67BWOVET.js → EHGH646D.js} +1 -1
- package/build/dist/chunks/{KKPMOAVI.js → ELHRXA5U.js} +1 -1
- package/build/dist/chunks/{PZEF5LBL.js → ETMD747Y.js} +1 -1
- package/build/dist/chunks/{XCKTE4ON.js → F7MGYRPU.js} +1 -1
- package/build/dist/chunks/{MRMR4QHA.js → FAH7FKUT.js} +1 -1
- package/build/dist/chunks/FXOFR432.js +1 -0
- package/build/dist/chunks/{VHV6WQ5F.js → G2AA73ZE.js} +1 -1
- package/build/dist/chunks/{JWR5XVP2.js → GBIBRYOV.js} +1 -1
- package/build/dist/chunks/{FNGIJKMZ.js → GDOHHXNH.js} +1 -1
- package/build/dist/chunks/{BZ34ZR65.js → GGMVT5A6.js} +1 -1
- package/build/dist/chunks/GK3D7OKG.js +1 -0
- package/build/dist/chunks/{2OKYXT25.js → GQITAJVF.js} +1 -1
- package/build/dist/chunks/GYPMUYB5.js +1 -0
- package/build/dist/chunks/H3E7UD2X.js +1 -0
- package/build/dist/chunks/{GDRQ2ANN.js → H64QC4QR.js} +1 -1
- package/build/dist/chunks/HFVXNKA5.js +1 -0
- package/build/dist/chunks/HHYE42JG.js +21 -0
- package/build/dist/chunks/{U363GQTF.js → HIG7JY3J.js} +1 -1
- package/build/dist/chunks/{XWKK75TO.js → HOBIXKGO.js} +1 -1
- package/build/dist/chunks/HQIS3QI7.js +3 -0
- package/build/dist/chunks/{UOCRYXAB.js → HRAHGYNK.js} +1 -1
- package/build/dist/chunks/{GLF7WEY2.js → HUKDISRE.js} +1 -1
- package/build/dist/chunks/{GSFHM5L3.js → HZSYMGJ2.js} +1 -1
- package/build/dist/chunks/{FJLJ7ZQ5.js → I4473OC6.js} +1 -1
- package/build/dist/chunks/IBL6TL2Q.js +1 -0
- package/build/dist/chunks/{3DNJTJ2X.js → IJ4HZIDG.js} +1 -1
- package/build/dist/chunks/{OARVU3RC.js → IPU656WB.js} +1 -1
- package/build/dist/chunks/{HCBX4NFM.js → IT2JLILU.js} +1 -1
- package/build/dist/chunks/{REWXG6X6.js → JDSSYT6R.js} +1 -1
- package/build/dist/chunks/{XRDXFHIK.js → JFWJBZ7M.js} +1 -1
- package/build/dist/chunks/{TPEKCXVE.js → JTPHZCO3.js} +1 -1
- package/build/dist/chunks/{CSOO4SW7.js → K4GUZ5QS.js} +1 -1
- package/build/dist/chunks/{BAIY32AV.js → KLEJ3W4T.js} +1 -1
- package/build/dist/chunks/{ACH4BSME.js → KOKLM63Q.js} +1 -1
- package/build/dist/chunks/{7D73A6KS.js → KVVBT43U.js} +1 -1
- package/build/dist/chunks/{CO4GCF4L.js → KXX7ZBFY.js} +1 -1
- package/build/dist/chunks/{I6PQW2JI.js → L2AE32SL.js} +1 -1
- package/build/dist/chunks/{WUT7TZYM.js → LCH6F5HT.js} +1 -1
- package/build/dist/chunks/LEV5SNNC.js +3 -0
- package/build/dist/chunks/{SPRVVJXI.js → LFSJDFMY.js} +1 -1
- package/build/dist/chunks/{6UVGQYZ3.js → LGLWEGPY.js} +1 -1
- package/build/dist/chunks/{PV4AK32X.js → LQSPWRHN.js} +1 -1
- package/build/dist/chunks/{C3WBHFLX.js → LTDF2LNP.js} +1 -1
- package/build/dist/chunks/{5HIHUYA4.js → M4AGEGWW.js} +1 -1
- package/build/dist/chunks/{ARI72OYT.js → M6SQPOOL.js} +1 -1
- package/build/dist/chunks/{SOTYQGPT.js → M7CQPTRK.js} +1 -1
- package/build/dist/chunks/{XPEDQBLI.js → MGVX5EUH.js} +1 -1
- package/build/dist/chunks/{C5ZZAYXD.js → MI5HZDMH.js} +1 -1
- package/build/dist/chunks/{APHNOGNS.js → MQ37QX6U.js} +1 -1
- package/build/dist/chunks/MQ5F2VOK.js +1 -0
- package/build/dist/chunks/{JKD2B6OX.js → MSRCJ2BS.js} +1 -1
- package/build/dist/chunks/{JKRBGAX2.js → NAO7VWZF.js} +1 -1
- package/build/dist/chunks/{RLMVA575.js → NDSNE6PS.js} +1 -1
- package/build/dist/chunks/{RT7IU6TI.js → NMJVQX5M.js} +1 -1
- package/build/dist/chunks/NQ4MTIU3.js +1 -0
- package/build/dist/chunks/{IEG6GLFR.js → NTUXDIY6.js} +1 -1
- package/build/dist/chunks/{F4UQEPJT.js → NUERUFH7.js} +1 -1
- package/build/dist/chunks/NV6FDIYT.js +1 -0
- package/build/dist/chunks/O2J5I4VA.js +1 -0
- package/build/dist/chunks/{XVJ7ILKK.js → O3CC5SRM.js} +1 -1
- package/build/dist/chunks/{2SUHQWND.js → O4S6XAYV.js} +1 -1
- package/build/dist/chunks/{TAEZTP4L.js → O5QTITN6.js} +1 -1
- package/build/dist/chunks/{NA424YAL.js → OB7BFDOV.js} +1 -1
- package/build/dist/chunks/{523ZIR3J.js → ODV3XT5U.js} +1 -1
- package/build/dist/chunks/{GW5IXLKU.js → OI3N4EW4.js} +1 -1
- package/build/dist/chunks/{FL5SSHUL.js → OIQTZOBN.js} +1 -1
- package/build/dist/chunks/OLDQV43V.js +1 -0
- package/build/dist/chunks/OOPMZIG7.js +1 -0
- package/build/dist/chunks/{XYPGLG6A.js → OSMOBKRQ.js} +1 -1
- package/build/dist/chunks/{OZ5MDUD2.js → OVM4QIET.js} +1 -1
- package/build/dist/chunks/{N4XNNXOJ.js → OY5W7ZSL.js} +1 -1
- package/build/dist/chunks/{GRSXWQWD.js → PDGYM2WG.js} +1 -1
- package/build/dist/chunks/{UQEEF5W5.js → PDPTJMTJ.js} +1 -1
- package/build/dist/chunks/PEHXHQVA.js +1 -0
- package/build/dist/chunks/{JOKL5L6X.js → PKYQ3XVA.js} +1 -1
- package/build/dist/chunks/PMFR47H3.js +1 -0
- package/build/dist/chunks/{N6GIC7HJ.js → PWJVC2FV.js} +1 -1
- package/build/dist/chunks/{753HZZTY.js → QBYV7NXH.js} +1 -1
- package/build/dist/chunks/QHV5GORV.js +1 -0
- package/build/dist/chunks/{2LWBN35N.js → QIB6OMQV.js} +1 -1
- package/build/dist/chunks/{TK55VASJ.js → QMNUB2GM.js} +1 -1
- package/build/dist/chunks/{HKVQ646Q.js → QN45T4N3.js} +1 -1
- package/build/dist/chunks/{J73ATSEQ.js → QPY6UTLU.js} +1 -1
- package/build/dist/chunks/{YUHNPUNK.js → R73R4KN3.js} +1 -1
- package/build/dist/chunks/{RLI4JDOL.js → RA7DOR7F.js} +1 -1
- package/build/dist/chunks/{VR344DAZ.js → RN3WUJIO.js} +1 -1
- package/build/dist/chunks/RUSXMQSJ.js +1 -0
- package/build/dist/chunks/{D742AYEV.js → RUTSEGGD.js} +1 -1
- package/build/dist/chunks/{4Q2ZBZXM.js → RXP7ZUPY.js} +1 -1
- package/build/dist/chunks/{TFDPEAVZ.js → S4JUFCT4.js} +1 -1
- package/build/dist/chunks/{DYYEA5HB.js → SMKO7GKX.js} +1 -1
- package/build/dist/chunks/{C75MT5SD.js → SNCV6HV7.js} +1 -1
- package/build/dist/chunks/{HIX5N25Z.js → SOJHYMD7.js} +1 -1
- package/build/dist/chunks/{JLRHM2DQ.js → SUNTJ6IU.js} +1 -1
- package/build/dist/chunks/{4JRXEN7C.js → THL4TMQW.js} +2 -2
- package/build/dist/chunks/TI727O2H.js +1 -0
- package/build/dist/chunks/{PV5FDT6O.js → TXGZ6NWN.js} +1 -1
- package/build/dist/chunks/{Q2ACLVWR.js → UBI3HBXD.js} +1 -1
- package/build/dist/chunks/{YMV5TL5C.js → UEHN2IDF.js} +1 -1
- package/build/dist/chunks/{ZF2VPDRQ.js → UHIJMDD2.js} +1 -1
- package/build/dist/chunks/UJQYOTO5.js +1 -0
- package/build/dist/chunks/{VTPT5544.js → USEF3QKG.js} +1 -1
- package/build/dist/chunks/{LR4XTZ37.js → UYULQHZJ.js} +1 -1
- package/build/dist/chunks/{YWZQJJYY.js → V4UJMUIB.js} +1 -1
- package/build/dist/chunks/{7VC53B5X.js → V5YSJKRH.js} +13 -13
- package/build/dist/chunks/{INOYMBWE.js → VC5ZCQYZ.js} +1 -1
- package/build/dist/chunks/{M7ZXDLKM.js → VDJPDIBV.js} +1 -1
- package/build/dist/chunks/{2FHELZ7Y.js → VFM2BICB.js} +1 -1
- package/build/dist/chunks/{TE6D3OIX.js → VOJULRNU.js} +1 -1
- package/build/dist/chunks/{UEDGYZOC.js → VVAM3EAK.js} +1 -1
- package/build/dist/chunks/VVJO6OYK.js +1 -0
- package/build/dist/chunks/{JESMX2UC.js → VXCGMALF.js} +1 -1
- package/build/dist/chunks/{NUFZUKYS.js → W32UECOL.js} +1 -1
- package/build/dist/chunks/{UUID2E22.js → W3DGFMQE.js} +1 -1
- package/build/dist/chunks/W7OCS4AM.js +6 -0
- package/build/dist/chunks/{DNNFKDZR.js → W7QNSNOH.js} +1 -1
- package/build/dist/chunks/{2MZXTOZU.js → WAKZWSHB.js} +1 -1
- package/build/dist/chunks/{HM72DH4V.js → WRUTW6CG.js} +1 -1
- package/build/dist/chunks/{VYYSL557.js → WSILNJS2.js} +1 -1
- package/build/dist/chunks/{L646YWDP.js → X24YTJST.js} +1 -1
- package/build/dist/chunks/{FOD34G2H.js → XL3W7DAQ.js} +1 -1
- package/build/dist/chunks/{2E4I7CJ7.js → XRDLMTBJ.js} +1 -1
- package/build/dist/chunks/{GG24LO2R.js → XVOW6UCI.js} +1 -1
- package/build/dist/chunks/XW3VGWXK.js +1 -0
- package/build/dist/chunks/{6WD4HHID.js → Y2QADJOB.js} +1 -1
- package/build/dist/chunks/Y64GFBTA.js +1 -0
- package/build/dist/chunks/Y7HBFQYG.js +1 -0
- package/build/dist/chunks/{ARLGF5MU.js → YGW4ODAP.js} +1 -1
- package/build/dist/chunks/YRSAZTTC.js +7 -0
- package/build/dist/chunks/YW4W3LPQ.js +1 -0
- package/build/dist/chunks/{3VBIRLU3.js → YXXK6EPI.js} +1 -1
- package/build/dist/chunks/{EH5G4O3U.js → Z2QV6EZY.js} +1 -1
- package/build/dist/chunks/Z3IBPCY4.js +2 -0
- package/build/dist/chunks/{H5DY7CNB.js → Z7FGEWO2.js} +1 -1
- package/build/dist/chunks/{KDGSYNOP.js → ZDCCFEVL.js} +1 -1
- package/build/dist/chunks/{4RQAOOO2.js → ZOLHVZDK.js} +1 -1
- package/build/dist/chunks/{AI3VAPA3.js → ZSVAGOF2.js} +1 -1
- package/build/dist/chunks/{EVBHQQQG.js → ZTKT3ZQK.js} +1 -1
- package/build/dist/chunks/{4BVP652W.js → ZZ6FZGHF.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/3K2N5VFH.js +0 -1
- package/build/dist/chunks/3ZABD6ZF.js +0 -2
- package/build/dist/chunks/44MB6SA6.js +0 -1
- package/build/dist/chunks/4D4ZRZUW.js +0 -1
- package/build/dist/chunks/4OVIMYNH.js +0 -2
- package/build/dist/chunks/6NUNCD5J.js +0 -1
- package/build/dist/chunks/6PZGDVHV.js +0 -1
- package/build/dist/chunks/7MBVTNLU.js +0 -1
- package/build/dist/chunks/7VNO46LV.js +0 -1
- package/build/dist/chunks/CAWTAR5V.js +0 -1
- package/build/dist/chunks/DPE7SPW7.js +0 -1
- package/build/dist/chunks/E3RACZUY.js +0 -1
- package/build/dist/chunks/EI6GGPDS.js +0 -20
- package/build/dist/chunks/FV4WZOTD.js +0 -1
- package/build/dist/chunks/FWD4L3CJ.js +0 -1
- package/build/dist/chunks/JBTOZ6IH.js +0 -1
- package/build/dist/chunks/KREBNL2D.js +0 -1
- package/build/dist/chunks/MVD3KWPP.js +0 -1
- package/build/dist/chunks/P6OMKZMR.js +0 -3
- package/build/dist/chunks/PXVREXCS.js +0 -1
- package/build/dist/chunks/QJNLLI6N.js +0 -1
- package/build/dist/chunks/RPB46QAC.js +0 -1
- package/build/dist/chunks/TID4C2KC.js +0 -1
- package/build/dist/chunks/U2YCQWZK.js +0 -1
- package/build/dist/chunks/UWBKAWX3.js +0 -7
- package/build/dist/chunks/V6SDKPZS.js +0 -1
- package/build/dist/chunks/WHTRPRRD.js +0 -1
- package/build/dist/chunks/WLMWWEP7.js +0 -2
- package/build/dist/chunks/XQ24RSEI.js +0 -1
- package/build/dist/chunks/YDNTY67T.js +0 -1
- package/build/dist/chunks/ZQAFFWDK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as j}from"./OYJFXEDU.js";import{h as me,k as ke}from"./2GXHYI23.js";import{b as S}from"./DNNFKDZR.js";import{b as le}from"./SPJCSEKP.js";import{a as _}from"./43LI5NKJ.js";import{g as B,i as ue}from"./NWNYJ26T.js";import{b as H}from"./IX3GZMTM.js";import{a as d,i as N}from"./FWD4L3CJ.js";import{a as u}from"./XSD5NL7J.js";import{a as de}from"./JXOEJPJ4.js";import{encodeFunctionData as K,erc20Abi as pe,getAddress as m,isAddress as ye,parseAbi as U,zeroAddress as fe}from"viem";var T=m(N[d].hoodlock.locker.address),F=m(N[d].hoodlock.burner.address),v=m(N[d].hoodlock.liquidityLocker.address),O=m(N[d].uniswap.v3_position_manager.address),V=m(N[d].uniswap.v4_position_manager.address),We="0x000000000000000000000000000000000000dEaD",$e=3153600000n,Le=1000000000000n,we=65535,D=U(["function fee() view returns (uint256)","function lock(address token, uint256 amount, uint256 unlockTime) payable returns (uint256 lockId)","function getLock(uint256 lockId) view returns (address owner, address token, uint256 amount, uint256 unlockTime, bool withdrawn)","function locksByOwner(address owner) view returns (uint256[])","function locksByToken(address token) view returns (uint256[])"]),te=U(["function fee() view returns (uint256)","function burn(address token, uint256 amount) payable returns (uint256 burnId)","function DEAD() view returns (address)","function getBurn(uint256 burnId) view returns (address burner, address token, uint256 amount, uint256 timestamp)","function totalBurnedOf(address token) view returns (uint256)"]),q=U(["function fixedFee() view returns (uint256)","function collectFeeBps() view returns (uint16)","function paused() view returns (bool)","function lock(address manager, uint256 tokenId, uint256 unlockTime, address feeRecipient, bool acceptUnverifiedHook, uint16 maxCollectFeeBps) payable returns (uint256 lockId)","function lockIdOf(address manager, uint256 tokenId) view returns (uint256)","function getLock(uint256 lockId) view returns (address owner, uint40 unlockTime, uint16 collectFeeBps, bool isV4, bool hookVerified, bool withdrawn, address feeRecipient, address token0, address token1, uint256 tokenId)","function locksOf(address owner) view returns (uint256[])"]),Se=U(["function approve(address to, uint256 tokenId)"]);function xe(e,o,t){let a=o.trim();if(a.startsWith("-")){let k=a.slice(1),i=e(k,t);return i==="0"?"0":`-${i}`}return e(a,t)}function ge(e,o){return o.length===0?"no ERC-20 transfer deltas":o.map(t=>`${xe(e.formatAmount,t.amount,t.token.decimals)} ${t.token.symbol}`).join(", ")}function E(e,o="token"){if(typeof e!="string"||!e.trim())throw new u(`Provide a valid ${o} contract address.`);if(!ye(e,{strict:!1}))throw new u(`Identify ${o} by chain and contract address, not by symbol.`);return m(e)}async function W(e,o){try{return await o()}catch(t){throw new u(e.plainError(t))}}function ve(e){let o=H(e);if(o<=0n)throw new u("Amount must be greater than zero.");return o}async function be(e){let o=await e.getBlock();if(!o||typeof o.timestamp!="bigint")throw new u("Could not read the current chain timestamp. Please try again.");return o.timestamp}function he(e,o){if(typeof e!="string"||!/^\d+$/.test(e.trim()))throw new u("unlockTime must be a non-negative integer string in Unix seconds.");let t=BigInt(e.trim());if(t>=Le)throw new u("unlockTime appears to be in milliseconds; provide Unix seconds at most 100 years (3153600000 seconds) in the future.");if(t<=o)throw new u(`unlockTime (${t}) must be in the future (greater than current timestamp ${o}).`);let a=o+$e;if(t>a)throw new u(`unlockTime (${t}) exceeds the 100-year maximum lock duration (3153600000 seconds; max ${a}).`);return t}async function ie(e,o,t=d){let a=m(o),[k,i]=await Promise.all([e.readContract({address:a,abi:pe,functionName:"symbol"}),e.readContract({address:a,abi:pe,functionName:"decimals"})]);return{address:a,symbol:de(String(k)),decimals:Number(i),chainId:t}}function Ie(e,o){if(e==null)return o;let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number(e.trim()):NaN;if(!Number.isInteger(t)||t<0||t>we)throw new u("maxCollectFeeBps must be an integer between 0 and 65535.");if(t<o)throw new u(`Live collectFeeBps (${o}) exceeds maxCollectFeeBps (${t}): collect fee changed.`);return Math.min(t,o)}function Pe(e){return e.tokenId!==void 0||e.manager!==void 0||e.feeRecipient!==void 0||e.maxCollectFeeBps!==void 0||e.acceptUnverifiedHook!==void 0||e.kind==="v3"||e.kind==="lp"||e.kind==="v4"||e.version==="v3"||e.version==="v4"}async function Ce(e,o,t){_(t);let a=m(t),k=o.kind==="v4"||o.version==="v4",i=o.manager!==void 0?E(o.manager,"manager"):k?V:O,g=i===V;if(i!==O&&!g)throw new u(`Unsupported position manager ${i}; use the configured Uniswap v3 or v4 manager.`);if(k&&!g||g&&(o.kind==="v3"||o.version==="v3"))throw new u("The requested version disagrees with the position manager.");if(o.acceptUnverifiedHook!==void 0&&typeof o.acceptUnverifiedHook!="boolean")throw new u("acceptUnverifiedHook must be a boolean.");let b=o.acceptUnverifiedHook===!0;if(!g&&b)throw new u("Uniswap v3 has no hooks; omit acceptUnverifiedHook.");let s=g?"v4":"v3";if(typeof o.tokenId!="string")throw new u("Provide an NFT tokenId as a decimal string.");let p=String(o.tokenId).trim(),c=H(p),l=ue(o.feeRecipient,"Provide an explicit feeRecipient address for LP position locks."),w=e.clientFor(d),[x,I,h]=await Promise.all([be(w),w.readContract({address:v,abi:q,functionName:"fixedFee"}),w.readContract({address:v,abi:q,functionName:"collectFeeBps"})]),y,$=!0;if(g){let C=U(["function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey, uint256 info)","function getPositionLiquidity(uint256 tokenId) view returns (uint128)","function ownerOf(uint256 tokenId) view returns (address)"]),[Y,J,M]=await Promise.all([w.readContract({address:i,abi:C,functionName:"getPoolAndPositionInfo",args:[c]}),w.readContract({address:i,abi:C,functionName:"getPositionLiquidity",args:[c]}),w.readContract({address:i,abi:C,functionName:"ownerOf",args:[c]})]);if(m(M)!==a)throw new u("This wallet does not own that v4 position NFT.");if(J<=0n)throw new u("The v4 position has no liquidity to lock.");if(y=m(Y[0].hooks),$=y===fe||await w.readContract({address:v,abi:U(["function hookAllowed(address) view returns (bool)"]),functionName:"hookAllowed",args:[y]}),!$&&!b)throw new u(`Unverified v4 hook ${y}; review its risks and explicitly set acceptUnverifiedHook: true to proceed.`)}let A=he(o.unlockTime,x),n=BigInt(I),r=Number(h);if(!Number.isInteger(r)||r<0||r>we)throw new u(`Invalid on-chain collectFeeBps (${String(h)}).`);if(o.maxFee!==void 0){let C=H(String(o.maxFee));if(n>C)throw new u(`Live fixedFee (${n}) exceeds maxFee (${C}).`)}let f=Ie(o.maxCollectFeeBps,r),L=(r/100).toString(),R=e.unsignedTx({to:i,data:K({abi:Se,functionName:"approve",args:[v,c]}),value:"0",chainId:d,description:`Approve Uniswap ${s} position NFT #${c} on ${i} for HoodLock LiquidityLocker ${v}.`}),P=e.unsignedTx({to:v,data:K({abi:q,functionName:"lock",args:[i,c,A,l,b,f]}),value:n.toString(),chainId:d,description:`Lock Uniswap ${s} NFT #${c} in HoodLock LiquidityLocker (${v}) until ${A} with feeRecipient ${l}, upfront fixedFee ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei), and ongoing collect fee ${r} bps (${L}% of collected LP fees, frozen per lock).`}),X=[R,P],z=await e.preview(X,a),Q=`Approve and lock Uniswap ${s} NFT #${c} (manager ${i}) in HoodLock LiquidityLocker ${v} until Unix ${A}. Upfront fixedFee: ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei). Ongoing LP fee share: ${r} bps (${L}% of collected LP fees, frozen per lock; maxCollectFeeBps=${f}) with feeRecipient ${l}. V4 hook: ${y??"none"}, reviewed: ${$}; acceptUnverifiedHook=${b}.`;return j(e,{txs:z.txs,summary:Q,preview:z,kind:s,contract:v,manager:i,tokenId:c.toString(),unlockTime:A.toString(),feeRecipient:l,acceptUnverifiedHook:b,collectFeeBps:r,maxCollectFeeBps:f,fixedFee:{token:S,amount:n.toString()}},v,n)}async function Fe(e,o,t){_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([be(i),i.readContract({address:T,abi:D,functionName:"fee"}),ie(i,k,d)]),p=ve(o.amount),c=he(o.unlockTime,g),l=BigInt(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(l>A)throw new u(`Live lock fee (${l}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,T,p.toString(),d),x=e.unsignedTx({to:T,data:K({abi:D,functionName:"lock",args:[s.address,p,c]}),value:l.toString(),chainId:d,description:`Lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until ${c} with exact fee ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until Unix ${c}. Exact fee: ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,kind:"token",contract:T,token:s,amount:p.toString(),unlockTime:c.toString(),fee:{token:S,amount:l.toString()}},T,l)}function Re(e){return{name:"hoodlock_lock",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["token","v2","v3","v4"],description:"Lock mode: token/v2 LP via Locker, or Uniswap v3/v4 NFT via LiquidityLocker."},token:{type:"string",description:"ERC-20 token or v2 LP token contract address on chain 4663 (for token/v2 locks)."},amount:{type:"string",description:"Token amount as an integer string in base units (for token/v2 locks)."},manager:{type:"string",description:"Configured Uniswap v3 or v4 position manager; inferred from kind when omitted."},tokenId:{type:"string",description:"Uniswap NFT position tokenId as a decimal string."},feeRecipient:{type:"string",description:"Explicit recipient address for collected LP fees during a position lock."},acceptUnverifiedHook:{type:"boolean",description:"Explicit v4 unreviewed-hook consent; default false. A reviewed hook is not a safety guarantee."},maxFee:{type:"string",description:"Maximum upfront ETH fee in wei; the exact live fee is sent."},maxCollectFeeBps:{type:"number",description:"Maximum acceptable ongoing LP collect fee in bps (uint16, must be >= live collectFeeBps)."},unlockTime:{type:"string",description:"Unlock timestamp in Unix seconds (must be > now and <= now + 100 years)."}},required:["unlockTime"],additionalProperties:!1},async execute(o,t){return W(e,async()=>Pe(o)?Ce(e,o,t):Fe(e,o,t))}}}function Ne(e){return{name:"hoodlock_burn",inputSchema:{type:"object",properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663 to send to the dead address via HoodLock Burner."},amount:{type:"string",description:"Amount to burn as an integer string in base units."}},required:["token","amount"],additionalProperties:!1},async execute(o,t){return W(e,async()=>{_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([i.readContract({address:F,abi:te,functionName:"fee"}),i.readContract({address:F,abi:te,functionName:"DEAD"}),ie(i,k,d)]),p=ve(o.amount),c=BigInt(g),l=m(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(c>A)throw new u(`Live burn fee (${c}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,F,p.toString(),d),x=e.unsignedTx({to:F,data:K({abi:te,functionName:"burn",args:[s.address,p]}),value:c.toString(),chainId:d,description:`Send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F} (totalSupply is unchanged) with exact fee ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F}. Note: tokens are transferred to ${l} and totalSupply is unchanged. Exact fee: ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,contract:F,deadAddress:l,token:s,amount:p.toString(),fee:{token:S,amount:c.toString()},totalSupplyReduced:!1},F,c)})}}}async function Ae(e,o,t){_(o);let a=m(o),k=t?E(t,"token"):void 0,i=e.clientFor(d),g=[],b=new Set,s=n=>{for(let r of n){let f=r.toString();b.has(f)||(b.add(f),g.push(r))}};if(k){let[n,r]=await Promise.all([i.readContract({address:T,abi:D,functionName:"locksByToken",args:[k]}),i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]})]);s(n),s(r)}else{let n=await i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]});s(n)}let c=(await Promise.all(g.map(async n=>{let r=await i.readContract({address:T,abi:D,functionName:"getLock",args:[n]});return{id:n,owner:m(r[0]),token:m(r[1]),amount:BigInt(r[2]),unlockTime:BigInt(r[3]),withdrawn:!!r[4]}}))).filter(n=>!n.withdrawn&&n.amount>0n&&B(n.owner,a)&&(!k||B(n.token,k))),l=new Map,w=async n=>{let r=n.toLowerCase(),f=l.get(r);if(f)return f;let L=n===fe?S:await ie(i,n,d);return l.set(r,L),L},x=[],I=[];for(let n of c){let r=await w(n.token),f=n.amount.toString(),L=n.unlockTime.toString(),R={token:r,amount:f};x.push({lockId:n.id.toString(),kind:"token",contract:T,chainId:d,owner:n.owner,token:r,amount:f,asset:R,unlockTime:L,withdrawn:!1}),I.push({module:"hoodlock",id:`lock:${n.id.toString()}`,chainId:d,assets:[R],economics:{principal:[me("locked",{token:r,amount:f,source:"hoodlock.lock.amount",dueAt:L})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`HoodLock token lock #${n.id} of ${e.formatAmount(f,r.decimals)} ${r.symbol} (${r.address}) until Unix ${L}.`})}let h=await i.readContract({address:v,abi:q,functionName:"locksOf",args:[a]}),y=[...new Set(h.map(n=>n.toString()))].map(n=>BigInt(n)),$=[];for(let n of y){let r=await i.readContract({address:v,abi:q,functionName:"getLock",args:[n]}),[f,L,R,P,X,z,Q,C,Y,J]=r,M=m(f);if(z||!B(M,a))continue;let re=m(C),se=m(Y);if(k&&!B(re,k)&&!B(se,k))continue;let[Z,ee]=await Promise.all([w(re),w(se)]),ae=m(Q),ce=Number(R),oe=BigInt(L).toString(),ne=BigInt(J).toString();$.push({lockId:n.toString(),kind:P?"v4":"v3",contract:v,manager:P?V:O,chainId:d,owner:M,tokenId:ne,unlockTime:oe,collectFeeBps:ce,feeRecipient:ae,hookVerified:!!X,token0:Z,token1:ee,withdrawn:!1}),I.push({module:"hoodlock",id:`lp-lock:${n.toString()}`,chainId:d,assets:[{token:{address:P?V:O,symbol:`UNI-${P?"V4":"V3"} #${ne}`,decimals:0,chainId:d},amount:"1"}],economics:{principal:[],debt:[],rewards:[],backing:[Z,ee].map(Te=>ke({token:Te,amount:null,source:"hoodlock.lpLock.underlying",unknownReason:"HoodLock does not read the locked LP's underlying amounts.",heldAs:P?V:O,dueAt:oe})),coverage:{complete:!0}},description:`HoodLock Uniswap ${P?"v4":"v3"} LP lock #${n} (NFT #${ne}, ${Z.symbol}/${ee.symbol}, feeRecipient ${ae}, collectFeeBps ${ce}) until Unix ${oe}. One NFT held in LiquidityLocker custody for ${M}. Underlying token amounts are not valued.`})}let A=`Found ${x.length} active token lock(s) and ${$.length} active Uniswap v3/v4 LP lock(s) for ${a}.`;return{locks:x,lpLocks:$,positions:I,summary:A}}function He(e){return{name:"hoodlock_list_locks",inputSchema:{type:"object",properties:{owner:{type:"string",description:"Optional owner wallet address to query (defaults to the authenticated wallet)."},token:{type:"string",description:"Optional ERC-20 or LP token address to filter active locks owned by the wallet."}},additionalProperties:!1},async execute(o,t){let a=o.owner!==void 0?E(o.owner,"owner"):m(t),k=o.token!==void 0?E(o.token,"token"):void 0;return W(e,()=>Ae(e,a,k))}}}function Be(e){return async o=>(await W(e,()=>Ae(e,o))).positions}var G=e=>({tools:[Re(e),Ne(e),He(e)],positions:Be(e)}),Ge=G,Xe=G,Qe=e=>le("hoodlock",[G(e)]),Ye=G;export{T as a,F as b,v as c,O as d,V as e,We as f,$e as g,xe as h,Re as i,Ne as j,He as k,Be as l,G as m,Ge as n,Xe as o,Qe as p,Ye as q};
|
|
1
|
+
import{b as j}from"./BZPFPQ2I.js";import{h as me,k as ke}from"./2GXHYI23.js";import{b as S}from"./W7QNSNOH.js";import{b as le}from"./SPJCSEKP.js";import{a as _}from"./43LI5NKJ.js";import{g as B,i as ue}from"./NWNYJ26T.js";import{b as H}from"./IX3GZMTM.js";import{b as d,j as N}from"./TI727O2H.js";import{a as u}from"./XSD5NL7J.js";import{a as de}from"./JXOEJPJ4.js";import{encodeFunctionData as K,erc20Abi as pe,getAddress as m,isAddress as ye,parseAbi as U,zeroAddress as fe}from"viem";var T=m(N[d].hoodlock.locker.address),F=m(N[d].hoodlock.burner.address),v=m(N[d].hoodlock.liquidityLocker.address),O=m(N[d].uniswap.v3_position_manager.address),V=m(N[d].uniswap.v4_position_manager.address),We="0x000000000000000000000000000000000000dEaD",$e=3153600000n,Le=1000000000000n,we=65535,D=U(["function fee() view returns (uint256)","function lock(address token, uint256 amount, uint256 unlockTime) payable returns (uint256 lockId)","function getLock(uint256 lockId) view returns (address owner, address token, uint256 amount, uint256 unlockTime, bool withdrawn)","function locksByOwner(address owner) view returns (uint256[])","function locksByToken(address token) view returns (uint256[])"]),te=U(["function fee() view returns (uint256)","function burn(address token, uint256 amount) payable returns (uint256 burnId)","function DEAD() view returns (address)","function getBurn(uint256 burnId) view returns (address burner, address token, uint256 amount, uint256 timestamp)","function totalBurnedOf(address token) view returns (uint256)"]),q=U(["function fixedFee() view returns (uint256)","function collectFeeBps() view returns (uint16)","function paused() view returns (bool)","function lock(address manager, uint256 tokenId, uint256 unlockTime, address feeRecipient, bool acceptUnverifiedHook, uint16 maxCollectFeeBps) payable returns (uint256 lockId)","function lockIdOf(address manager, uint256 tokenId) view returns (uint256)","function getLock(uint256 lockId) view returns (address owner, uint40 unlockTime, uint16 collectFeeBps, bool isV4, bool hookVerified, bool withdrawn, address feeRecipient, address token0, address token1, uint256 tokenId)","function locksOf(address owner) view returns (uint256[])"]),Se=U(["function approve(address to, uint256 tokenId)"]);function xe(e,o,t){let a=o.trim();if(a.startsWith("-")){let k=a.slice(1),i=e(k,t);return i==="0"?"0":`-${i}`}return e(a,t)}function ge(e,o){return o.length===0?"no ERC-20 transfer deltas":o.map(t=>`${xe(e.formatAmount,t.amount,t.token.decimals)} ${t.token.symbol}`).join(", ")}function E(e,o="token"){if(typeof e!="string"||!e.trim())throw new u(`Provide a valid ${o} contract address.`);if(!ye(e,{strict:!1}))throw new u(`Identify ${o} by chain and contract address, not by symbol.`);return m(e)}async function W(e,o){try{return await o()}catch(t){throw new u(e.plainError(t))}}function ve(e){let o=H(e);if(o<=0n)throw new u("Amount must be greater than zero.");return o}async function be(e){let o=await e.getBlock();if(!o||typeof o.timestamp!="bigint")throw new u("Could not read the current chain timestamp. Please try again.");return o.timestamp}function he(e,o){if(typeof e!="string"||!/^\d+$/.test(e.trim()))throw new u("unlockTime must be a non-negative integer string in Unix seconds.");let t=BigInt(e.trim());if(t>=Le)throw new u("unlockTime appears to be in milliseconds; provide Unix seconds at most 100 years (3153600000 seconds) in the future.");if(t<=o)throw new u(`unlockTime (${t}) must be in the future (greater than current timestamp ${o}).`);let a=o+$e;if(t>a)throw new u(`unlockTime (${t}) exceeds the 100-year maximum lock duration (3153600000 seconds; max ${a}).`);return t}async function ie(e,o,t=d){let a=m(o),[k,i]=await Promise.all([e.readContract({address:a,abi:pe,functionName:"symbol"}),e.readContract({address:a,abi:pe,functionName:"decimals"})]);return{address:a,symbol:de(String(k)),decimals:Number(i),chainId:t}}function Ie(e,o){if(e==null)return o;let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number(e.trim()):NaN;if(!Number.isInteger(t)||t<0||t>we)throw new u("maxCollectFeeBps must be an integer between 0 and 65535.");if(t<o)throw new u(`Live collectFeeBps (${o}) exceeds maxCollectFeeBps (${t}): collect fee changed.`);return Math.min(t,o)}function Pe(e){return e.tokenId!==void 0||e.manager!==void 0||e.feeRecipient!==void 0||e.maxCollectFeeBps!==void 0||e.acceptUnverifiedHook!==void 0||e.kind==="v3"||e.kind==="lp"||e.kind==="v4"||e.version==="v3"||e.version==="v4"}async function Ce(e,o,t){_(t);let a=m(t),k=o.kind==="v4"||o.version==="v4",i=o.manager!==void 0?E(o.manager,"manager"):k?V:O,g=i===V;if(i!==O&&!g)throw new u(`Unsupported position manager ${i}; use the configured Uniswap v3 or v4 manager.`);if(k&&!g||g&&(o.kind==="v3"||o.version==="v3"))throw new u("The requested version disagrees with the position manager.");if(o.acceptUnverifiedHook!==void 0&&typeof o.acceptUnverifiedHook!="boolean")throw new u("acceptUnverifiedHook must be a boolean.");let b=o.acceptUnverifiedHook===!0;if(!g&&b)throw new u("Uniswap v3 has no hooks; omit acceptUnverifiedHook.");let s=g?"v4":"v3";if(typeof o.tokenId!="string")throw new u("Provide an NFT tokenId as a decimal string.");let p=String(o.tokenId).trim(),c=H(p),l=ue(o.feeRecipient,"Provide an explicit feeRecipient address for LP position locks."),w=e.clientFor(d),[x,I,h]=await Promise.all([be(w),w.readContract({address:v,abi:q,functionName:"fixedFee"}),w.readContract({address:v,abi:q,functionName:"collectFeeBps"})]),y,$=!0;if(g){let C=U(["function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey, uint256 info)","function getPositionLiquidity(uint256 tokenId) view returns (uint128)","function ownerOf(uint256 tokenId) view returns (address)"]),[Y,J,M]=await Promise.all([w.readContract({address:i,abi:C,functionName:"getPoolAndPositionInfo",args:[c]}),w.readContract({address:i,abi:C,functionName:"getPositionLiquidity",args:[c]}),w.readContract({address:i,abi:C,functionName:"ownerOf",args:[c]})]);if(m(M)!==a)throw new u("This wallet does not own that v4 position NFT.");if(J<=0n)throw new u("The v4 position has no liquidity to lock.");if(y=m(Y[0].hooks),$=y===fe||await w.readContract({address:v,abi:U(["function hookAllowed(address) view returns (bool)"]),functionName:"hookAllowed",args:[y]}),!$&&!b)throw new u(`Unverified v4 hook ${y}; review its risks and explicitly set acceptUnverifiedHook: true to proceed.`)}let A=he(o.unlockTime,x),n=BigInt(I),r=Number(h);if(!Number.isInteger(r)||r<0||r>we)throw new u(`Invalid on-chain collectFeeBps (${String(h)}).`);if(o.maxFee!==void 0){let C=H(String(o.maxFee));if(n>C)throw new u(`Live fixedFee (${n}) exceeds maxFee (${C}).`)}let f=Ie(o.maxCollectFeeBps,r),L=(r/100).toString(),R=e.unsignedTx({to:i,data:K({abi:Se,functionName:"approve",args:[v,c]}),value:"0",chainId:d,description:`Approve Uniswap ${s} position NFT #${c} on ${i} for HoodLock LiquidityLocker ${v}.`}),P=e.unsignedTx({to:v,data:K({abi:q,functionName:"lock",args:[i,c,A,l,b,f]}),value:n.toString(),chainId:d,description:`Lock Uniswap ${s} NFT #${c} in HoodLock LiquidityLocker (${v}) until ${A} with feeRecipient ${l}, upfront fixedFee ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei), and ongoing collect fee ${r} bps (${L}% of collected LP fees, frozen per lock).`}),X=[R,P],z=await e.preview(X,a),Q=`Approve and lock Uniswap ${s} NFT #${c} (manager ${i}) in HoodLock LiquidityLocker ${v} until Unix ${A}. Upfront fixedFee: ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei). Ongoing LP fee share: ${r} bps (${L}% of collected LP fees, frozen per lock; maxCollectFeeBps=${f}) with feeRecipient ${l}. V4 hook: ${y??"none"}, reviewed: ${$}; acceptUnverifiedHook=${b}.`;return j(e,{txs:z.txs,summary:Q,preview:z,kind:s,contract:v,manager:i,tokenId:c.toString(),unlockTime:A.toString(),feeRecipient:l,acceptUnverifiedHook:b,collectFeeBps:r,maxCollectFeeBps:f,fixedFee:{token:S,amount:n.toString()}},v,n)}async function Fe(e,o,t){_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([be(i),i.readContract({address:T,abi:D,functionName:"fee"}),ie(i,k,d)]),p=ve(o.amount),c=he(o.unlockTime,g),l=BigInt(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(l>A)throw new u(`Live lock fee (${l}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,T,p.toString(),d),x=e.unsignedTx({to:T,data:K({abi:D,functionName:"lock",args:[s.address,p,c]}),value:l.toString(),chainId:d,description:`Lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until ${c} with exact fee ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until Unix ${c}. Exact fee: ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,kind:"token",contract:T,token:s,amount:p.toString(),unlockTime:c.toString(),fee:{token:S,amount:l.toString()}},T,l)}function Re(e){return{name:"hoodlock_lock",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["token","v2","v3","v4"],description:"Lock mode: token/v2 LP via Locker, or Uniswap v3/v4 NFT via LiquidityLocker."},token:{type:"string",description:"ERC-20 token or v2 LP token contract address on chain 4663 (for token/v2 locks)."},amount:{type:"string",description:"Token amount as an integer string in base units (for token/v2 locks)."},manager:{type:"string",description:"Configured Uniswap v3 or v4 position manager; inferred from kind when omitted."},tokenId:{type:"string",description:"Uniswap NFT position tokenId as a decimal string."},feeRecipient:{type:"string",description:"Explicit recipient address for collected LP fees during a position lock."},acceptUnverifiedHook:{type:"boolean",description:"Explicit v4 unreviewed-hook consent; default false. A reviewed hook is not a safety guarantee."},maxFee:{type:"string",description:"Maximum upfront ETH fee in wei; the exact live fee is sent."},maxCollectFeeBps:{type:"number",description:"Maximum acceptable ongoing LP collect fee in bps (uint16, must be >= live collectFeeBps)."},unlockTime:{type:"string",description:"Unlock timestamp in Unix seconds (must be > now and <= now + 100 years)."}},required:["unlockTime"],additionalProperties:!1},async execute(o,t){return W(e,async()=>Pe(o)?Ce(e,o,t):Fe(e,o,t))}}}function Ne(e){return{name:"hoodlock_burn",inputSchema:{type:"object",properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663 to send to the dead address via HoodLock Burner."},amount:{type:"string",description:"Amount to burn as an integer string in base units."}},required:["token","amount"],additionalProperties:!1},async execute(o,t){return W(e,async()=>{_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([i.readContract({address:F,abi:te,functionName:"fee"}),i.readContract({address:F,abi:te,functionName:"DEAD"}),ie(i,k,d)]),p=ve(o.amount),c=BigInt(g),l=m(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(c>A)throw new u(`Live burn fee (${c}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,F,p.toString(),d),x=e.unsignedTx({to:F,data:K({abi:te,functionName:"burn",args:[s.address,p]}),value:c.toString(),chainId:d,description:`Send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F} (totalSupply is unchanged) with exact fee ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F}. Note: tokens are transferred to ${l} and totalSupply is unchanged. Exact fee: ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,contract:F,deadAddress:l,token:s,amount:p.toString(),fee:{token:S,amount:c.toString()},totalSupplyReduced:!1},F,c)})}}}async function Ae(e,o,t){_(o);let a=m(o),k=t?E(t,"token"):void 0,i=e.clientFor(d),g=[],b=new Set,s=n=>{for(let r of n){let f=r.toString();b.has(f)||(b.add(f),g.push(r))}};if(k){let[n,r]=await Promise.all([i.readContract({address:T,abi:D,functionName:"locksByToken",args:[k]}),i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]})]);s(n),s(r)}else{let n=await i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]});s(n)}let c=(await Promise.all(g.map(async n=>{let r=await i.readContract({address:T,abi:D,functionName:"getLock",args:[n]});return{id:n,owner:m(r[0]),token:m(r[1]),amount:BigInt(r[2]),unlockTime:BigInt(r[3]),withdrawn:!!r[4]}}))).filter(n=>!n.withdrawn&&n.amount>0n&&B(n.owner,a)&&(!k||B(n.token,k))),l=new Map,w=async n=>{let r=n.toLowerCase(),f=l.get(r);if(f)return f;let L=n===fe?S:await ie(i,n,d);return l.set(r,L),L},x=[],I=[];for(let n of c){let r=await w(n.token),f=n.amount.toString(),L=n.unlockTime.toString(),R={token:r,amount:f};x.push({lockId:n.id.toString(),kind:"token",contract:T,chainId:d,owner:n.owner,token:r,amount:f,asset:R,unlockTime:L,withdrawn:!1}),I.push({module:"hoodlock",id:`lock:${n.id.toString()}`,chainId:d,assets:[R],economics:{principal:[me("locked",{token:r,amount:f,source:"hoodlock.lock.amount",dueAt:L})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`HoodLock token lock #${n.id} of ${e.formatAmount(f,r.decimals)} ${r.symbol} (${r.address}) until Unix ${L}.`})}let h=await i.readContract({address:v,abi:q,functionName:"locksOf",args:[a]}),y=[...new Set(h.map(n=>n.toString()))].map(n=>BigInt(n)),$=[];for(let n of y){let r=await i.readContract({address:v,abi:q,functionName:"getLock",args:[n]}),[f,L,R,P,X,z,Q,C,Y,J]=r,M=m(f);if(z||!B(M,a))continue;let re=m(C),se=m(Y);if(k&&!B(re,k)&&!B(se,k))continue;let[Z,ee]=await Promise.all([w(re),w(se)]),ae=m(Q),ce=Number(R),oe=BigInt(L).toString(),ne=BigInt(J).toString();$.push({lockId:n.toString(),kind:P?"v4":"v3",contract:v,manager:P?V:O,chainId:d,owner:M,tokenId:ne,unlockTime:oe,collectFeeBps:ce,feeRecipient:ae,hookVerified:!!X,token0:Z,token1:ee,withdrawn:!1}),I.push({module:"hoodlock",id:`lp-lock:${n.toString()}`,chainId:d,assets:[{token:{address:P?V:O,symbol:`UNI-${P?"V4":"V3"} #${ne}`,decimals:0,chainId:d},amount:"1"}],economics:{principal:[],debt:[],rewards:[],backing:[Z,ee].map(Te=>ke({token:Te,amount:null,source:"hoodlock.lpLock.underlying",unknownReason:"HoodLock does not read the locked LP's underlying amounts.",heldAs:P?V:O,dueAt:oe})),coverage:{complete:!0}},description:`HoodLock Uniswap ${P?"v4":"v3"} LP lock #${n} (NFT #${ne}, ${Z.symbol}/${ee.symbol}, feeRecipient ${ae}, collectFeeBps ${ce}) until Unix ${oe}. One NFT held in LiquidityLocker custody for ${M}. Underlying token amounts are not valued.`})}let A=`Found ${x.length} active token lock(s) and ${$.length} active Uniswap v3/v4 LP lock(s) for ${a}.`;return{locks:x,lpLocks:$,positions:I,summary:A}}function He(e){return{name:"hoodlock_list_locks",inputSchema:{type:"object",properties:{owner:{type:"string",description:"Optional owner wallet address to query (defaults to the authenticated wallet)."},token:{type:"string",description:"Optional ERC-20 or LP token address to filter active locks owned by the wallet."}},additionalProperties:!1},async execute(o,t){let a=o.owner!==void 0?E(o.owner,"owner"):m(t),k=o.token!==void 0?E(o.token,"token"):void 0;return W(e,()=>Ae(e,a,k))}}}function Be(e){return async o=>(await W(e,()=>Ae(e,o))).positions}var G=e=>({tools:[Re(e),Ne(e),He(e)],positions:Be(e)}),Ge=G,Xe=G,Qe=e=>le("hoodlock",[G(e)]),Ye=G;export{T as a,F as b,v as c,O as d,V as e,We as f,$e as g,xe as h,Re as i,Ne as j,He as k,Be as l,G as m,Ge as n,Xe as o,Qe as p,Ye as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as W,c as K}from"./
|
|
1
|
+
import{b as W,c as K}from"./A3BJSQ23.js";import{L as z}from"./AXHFNE6L.js";import{a as D}from"./IPU656WB.js";import{c as C}from"./LCH6F5HT.js";import{c as B,f as R,i as F,j as L,k as H}from"./X24YTJST.js";import{a as V}from"./43LI5NKJ.js";import{a as u}from"./66F5ZH34.js";import{g as O}from"./NWNYJ26T.js";import{b as A}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{encodeFunctionData as I,erc20Abi as j,getAddress as P,parseAbi as k}from"viem";var f=k(["function asset() view returns (address)","function decimals() view returns (uint8)","function balanceOf(address) view returns (uint256)","function previewMint(uint256) view returns (uint256)","function previewRedeem(uint256) view returns (uint256)","function previewWithdraw(uint256) view returns (uint256)","function mint(uint256 shares,address receiver) returns (uint256)","function redeem(uint256 shares,address receiver,address owner) returns (uint256)","function withdraw(uint256 assets,address receiver,address owner) returns (uint256)"]);function U(t,n=!1){if(typeof t!="string"||!/^\d+$/.test(t)||t.length>78||BigInt(t)>=1n<<256n||!n&&BigInt(t)===0n)throw new o("Provide a positive uint256 decimal base-unit string.");return BigInt(t)}function ce(t,n,y){return["details","analytics","manage","mint",n==="netnet"?"redeem":"withdraw_assets","force_exit","in_kind_exit"].map(e=>{let $=[...n==="longbow"?["vault"]:[],...e==="mint"?["shares","maxAssets"]:e==="redeem"?["shares"]:e==="withdraw_assets"?["amount"]:e==="force_exit"?["maxPenaltyAssets","minAmountOut"]:[]],m={...n==="longbow"?{vault:{type:"string",enum:y.map(i=>i.vault),description:"Pinned vault address on chain 4663; use longbow_list to compare vault names."}}:{}};e==="in_kind_exit"&&(Object.assign(m,{amount:u(`Assets to receive, in base units of the vault's asset (read its decimals; USDG has 6). Example: "1000000" = 1 USDG.`),maxShares:u('Most vault shares you will burn, in share base units (shares have 18 decimals). Example: "1000000000000000000" = 1 share.'),maxPenaltyAssets:u(`Highest exit penalty you accept, in base units of the vault's asset (read its decimals). Example: "10000" = 0.01 USDG for a 6-decimal asset.`),deadline:u("Absolute Unix seconds deadline, no more than five minutes ahead. Example: 1800000000.")}),$.push("amount","maxShares","maxPenaltyAssets","deadline")),e==="mint"&&Object.assign(m,{shares:u('Vault shares to mint, in base units (shares have 18 decimals). Example: "1000000000000000000" = 1 share.'),maxAssets:u(`Most of the vault's asset you will pay, in base units (read its decimals; USDG has 6). Example: "1000000" = 1 USDG.`)}),e==="redeem"&&(m.shares=u('Vault shares to redeem, in base units (shares have 18 decimals). Example: "1000000000000000000" = 1 share.')),e==="withdraw_assets"&&(m.amount=u(`Assets to withdraw, in base units of the vault's asset (read its decimals; USDG has 6). Example: "1000000" = 1 USDG.`)),e==="force_exit"&&Object.assign(m,{maxPenaltyAssets:u(`Highest exit penalty you accept, in base units of the vault's asset (read its decimals). Example: "10000" = 0.01 USDG for a 6-decimal asset.`),minAmountOut:u(`Least of the vault's asset you must receive, in base units (read its decimals). Example: "1000000" = 1 USDG.`)});let J=C(t,`${n}_manage`,y[0].vault,y[0].asset),N=D(t,`${n}_analytics`,y[0].vault);if(e==="manage"||e==="analytics"){let i=e==="manage"?J.inputSchema:N.inputSchema;Object.assign(m,i.properties),e==="analytics"&&n==="longbow"&&(m.view={type:"string",enum:["apy","published_apy"],description:"Report: apy (realized yield from share price) or published_apy (yield published by the project)."}),$.push(...i.required)}return{name:`${n}_${e}`,inputSchema:{type:"object",properties:m,required:$,additionalProperties:!1,...e==="analytics"&&n==="netnet"?{allOf:N.inputSchema.allOf}:{}},execute:async(i,r)=>{try{if(V(r),Object.keys(i).some(c=>!Object.hasOwn(m,c)))throw new o("Unsupported vault feature argument.");let _=n==="netnet"?y[0]:y.find(c=>typeof i.vault=="string"&&O(c.vault,i.vault));if(!_)throw new o("Choose a current vault returned by the project list tool.");let{vault:s,asset:a}=_,b={...i};if(delete b.vault,e==="details")return F(t,`${n}_details`,s,a).execute(b,r);if(e==="manage")return C(t,`${n}_manage`,s,a).execute(b,r);if(e==="analytics"){if(n==="longbow"&&i.view==="published_apy")return K(t,s,a,b);if(n==="longbow"&&i.view==="apy")return W(t,s,a,b);if(n==="longbow")throw new o("Choose apy or published_apy; the Longbow vault is not indexed by Morpho for other analytics views.");return{...await D(t,`${n}_analytics`,s).execute(b,r),asset:{...a,address:P(a.address)}}}if(e==="in_kind_exit")return z(t,s,a,i,r);let h=t.clientFor(A);if(await h.getChainId()!==A)throw new o("Vault actions require chain 4663.");let[Q,X,Y]=await Promise.all([h.readContract({address:s,abi:f,functionName:"asset"}),h.readContract({address:s,abi:f,functionName:"decimals"}),h.readContract({address:a.address,abi:j,functionName:"decimals"})]);if(P(Q)!==P(a.address)||X!==18||Y!==a.decimals)throw new o("Vault metadata does not match the pinned asset and shares.");let T=e==="force_exit"?await h.readContract({address:s,abi:f,functionName:"balanceOf",args:[r]}):void 0;if(e==="force_exit"){let c=await R(t,h,s,r,T,B(i.maxPenaltyAssets),a),E=U(i.minAmountOut),w=[c.tx],v=await t.preview(w,r);return H(v.changes,s,T,E,a),{txs:w,preview:v,summary:`${L(c.plan,a.symbol)} ${v.summary}`}}let d=e==="mint",g=e==="redeem",l=U(d||g?i.shares:i.amount),x=await h.readContract({address:s,abi:f,functionName:d?"previewMint":g?"previewRedeem":"previewWithdraw",args:[l]});if(x<=0n||d&&x>U(i.maxAssets))throw new o("Vault quote is zero or exceeds maxAssets.");let q=d?void 0:await h.readContract({address:s,abi:f,functionName:"balanceOf",args:[r]});if(!d&&(g?l:x)>q)throw new o("The wallet share balance cannot cover this exit.");let Z=d?I({abi:f,functionName:"mint",args:[l,r]}):g?I({abi:f,functionName:"redeem",args:[l,r,r]}):I({abi:f,functionName:"withdraw",args:[l,r,r]}),G=`${e} ${l} ${d||g?"18-decimal share":`${a.decimals}-decimal ${a.symbol}`} base units on ${s}; beneficiary ${r}.`,M=[...d?[t.approval(a.address,s,x.toString(),A)]:[],t.unsignedTx({to:s,data:Z,value:"0",chainId:A,description:G})],S=await t.preview(M,r),p=(c,E)=>S.changes.filter(w=>w.token.chainId===A&&O(w.token.address,c)).reduce((w,v)=>{if(v.token.decimals!==E||!/^-?\d+$/.test(v.amount))throw new o("Invalid vault preview metadata.");return w+BigInt(v.amount)},0n);if(d?p(a.address,a.decimals)!==-x||p(s,18)!==l:g?p(s,18)!==-l||p(a.address,a.decimals)<=0n:p(a.address,a.decimals)!==l||-p(s,18)<=0n||-p(s,18)>q)throw new o("Vault preview does not match the requested amount and beneficiary.");return{txs:M,preview:S,summary:`${G} Counterpart quote ${x} base units. Mint approval is exact; accrual may require a fresh quote. Standard ERC-4626 calls encode no minimum receipt. ${S.summary}`}}catch(_){throw new o(t.plainError(_))}}}})}export{ce as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,c}from"./
|
|
1
|
+
import{a as x,c}from"./GQITAJVF.js";import{a}from"./XSD5NL7J.js";import{parseAbi as M}from"viem";var b=M(["function readState(address router) view returns ((int256 totalPt,int256 totalSy,int256 totalLp,address treasury,int256 scalarRoot,uint256 expiry,uint256 lnFeeRateRoot,uint256 reserveFeePercent,uint256 lastLnImpliedRate) market)","function pyIndexCurrent() returns(uint256)","function exchangeRate() view returns(uint256)","function previewDeposit(address tokenIn,uint256 amount) view returns(uint256)","function previewRedeem(address tokenOut,uint256 amount) view returns(uint256)"]),R=10n**18n,E=31536e3,P="Pendle's price doesn't match what Oak checked on the chain. Try a smaller amount. Nothing was signed.";function n(e,t=!1){if(typeof e!="bigint"||e<(t?1n:0n)||e>=1n<<256n)throw new a("Oak could not read the Pendle price check from the chain. Nothing was signed.");return e}function d(e){return c(Number.isInteger(e)&&e>=0&&e<=77,"unreadable token decimals"),10n**BigInt(e)}function k(e){if(!Number.isFinite(e)||Math.abs(e)>40)throw new a(P);return BigInt(Math.floor(Math.exp(e)*1e18))}async function A(e,t,v,p,u,f){try{c(Number.isFinite(f)&&Math.abs(f)<=.03,"unreadable or excessive price impact"),n(p,!0),n(u,!0);let i=await e.getBlock(),s=i.number,[h,C]=await Promise.all([e.readContract({address:t.market,abi:b,functionName:"readState",args:[x],blockNumber:s}),e.simulateContract({address:t.yt,abi:b,functionName:"pyIndexCurrent",blockNumber:s}).then(o=>o.result)]),I=n(h.lastLnImpliedRate),D=n(h.lnFeeRateRoot),w=n(C,!0);c(Number.isSafeInteger(t.expiry)&&t.expiry>Number(i.timestamp),"this term has ended; use pendle_redeem");let y=(t.expiry-Number(i.timestamp))/E,g=Number(I)/1e18*y,r;if(v==="buy")r=n(await e.readContract({address:t.sy,abi:b,functionName:"previewDeposit",args:[t.inputToken,p],blockNumber:s}),!0)*w*k(g)*d(t.ptDecimals)/(R*R*d(t.syDecimals));else{let o=p*k(-g)*d(t.syDecimals)/(w*d(t.ptDecimals));n(o,!0),r=n(await e.readContract({address:t.sy,abi:b,functionName:"previewRedeem",args:[t.inputToken,o],blockNumber:s}),!0)}n(r,!0);let m=1-Math.exp(-Number(D)/1e18*y);c(Number.isFinite(m)&&m>=0&&m<=1,"unreadable market fee");let N=.01+m,F=u>r?u-r:r-u,l=Number(F)/Number(r);if(!Number.isFinite(l)||l>N)throw new a(P);return{estimateBase:r,relativeDifference:l,tolerance:N,blockNumber:s}}catch(i){throw i instanceof a?i:new a("Oak could not read the Pendle price check from the chain. Nothing was signed.")}}export{b as a,n as b,A as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ne}from"./F4UQEPJT.js";import{b as ee,e as te}from"./ZOMFHTB2.js";import{a as D,b as W,c as _,d as J,e as z,f as Y,g as Z}from"./J73ATSEQ.js";import{d as V,e as $,w as U}from"./BAIY32AV.js";import{a as H}from"./IOYRL6AY.js";import{a as E}from"./66F5ZH34.js";import{c as b,g as G}from"./NWNYJ26T.js";import{a as S,i as N}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as w,encodeFunctionData as oe,encodePacked as he,erc20Abi as be,getAddress as ce,parseAbi as T,parseAbiParameters as g,zeroAddress as v}from"viem";var ie=ce("0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7"),re=ce(N[4663].ponsTrade.quoter.address),xe=T(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),we=T(["function approve(address token,address spender,uint160 amount,uint48 expiration)"]),se=T(["function factory() view returns (address)","function quoteExactInput(bytes path,uint256 amountIn) returns (uint256,uint160[],uint32[],uint256)","function quoteExactOutput(bytes path,uint256 amountOut) returns (uint256,uint160[],uint32[],uint256)"]),F="(address intermediateCurrency,uint24 fee,int24 tickSpacing,address hooks,bytes hookData)",M="(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks)",ae=T([`function quoteExactInput((address exactCurrency,${F}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactOutput((address exactCurrency,${F}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactInputSingle((${M} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`,`function quoteExactOutputSingle((${M} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`]),ke=g(`(address exactCurrency,${F}[] path,uint256[] minHopPriceX36,uint128 amount,uint128 limit)`);function ve(u,t,r,l){let s=[],e=l?r:t,i=new Set([e]);for(let n of l?[...u].reverse():u){let c=n.currency0===e?n.currency1:n.currency1===e?n.currency0:void 0;if(!c||i.has(c))throw new o("V4 poolKeys must form a continuous route without repeated currencies.");s.push({intermediateCurrency:c,fee:n.fee,tickSpacing:n.tickSpacing,hooks:n.hooks,hookData:"0x"}),e=c,i.add(e)}if(e!==(l?t:r))throw new o("V4 route does not end at the requested currency.");return s}var ge=g(`(${M} poolKey,bool zeroForOne,uint128 amount,uint128 limit,uint256 minHopPriceX36,bytes hookData)`),Ae=g("address recipient,uint256 amount,uint256 limit,bytes path,bool payerIsUser,uint256[] minHopPriceX36"),Pe=g("address recipient,uint256 amount,uint256 limit,address[] path,bool payerIsUser,uint256[] minHopPriceX36"),ue=g("address,uint256"),Ie=g("bytes,bytes[]");function Se(u,t,r){let l=r?[...u].reverse():u,s=r?[...t].reverse():t,e=l[0];return s.forEach((i,n)=>{e=`${e}${he(["uint24","address"],[i,l[n+1]]).slice(2)}`}),e}var de={version:{description:'Uniswap version: "v2" for pairs, "v3" for concentrated liquidity or "v4" for PoolManager.',type:"string",enum:["v2","v3","v4"]},tokenIn:{...b,description:"Input token address; the zero address means native ETH for v4."},tokenOut:{...b,description:"Output token address; the zero address means native ETH for v4."},path:{description:"Two to six distinct ERC-20 token addresses in input-to-output order for v2 or v3.",type:"array",minItems:2,maxItems:6,items:b},fees:{type:"array",description:"One v3 pool fee per path hop, in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%).",items:{type:"integer",minimum:0,maximum:1e6}},poolKeys:{description:"One to five v4 pool keys in input-to-output route order, without repeated currencies.",type:"array",minItems:1,maxItems:5,items:{type:"object",required:["currency0","currency1","fee","tickSpacing","hooks"],properties:{currency0:{...b,description:"Lower sorted currency address; the zero address means native ETH."},currency1:{...b,description:"Higher sorted currency address."},fee:{type:"integer",description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%)."},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"integer"},hooks:{...b,description:"Hook contract address; the zero address means no hook."}},additionalProperties:!1}},poolKey:{description:"V4 pool key: sorted currencies, fee in pips, tick spacing and hook address.",type:"object",properties:{currency0:{...b,description:"Lower sorted currency address; the zero address means native ETH."},currency1:{...b,description:"Higher sorted currency address."},fee:{type:"integer",description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%)."},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"integer"},hooks:{...b,description:"Hook contract address; the zero address means no hook."}},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},allowHighFeePools:{description:"Allow pools above Oak's usual fee threshold; review the fee warning before confirming.",type:"boolean"},acceptValueLoss:{description:"Acknowledge the quoted value-loss warning; review the measured loss before confirming.",type:"boolean"},amountIn:E('Amount of input token in base units; use input token decimals. Example: "1000000" = 1 input token at 6 decimals.'),amountOut:E('Amount of output token in base units; use output token decimals. Example: "1000000" = 1 output token at 6 decimals.'),minAmountOut:E('Minimum amount of output token in base units; use output token decimals. Example: "1000000" = 1 output token at 6 decimals.'),maxAmountIn:E('Maximum amount of input token in base units; use input token decimals. Example: "1000000" = 1 input token at 6 decimals.'),slippageBps:{description:"Slippage tolerance in basis points (50 = 0.5%).",type:"integer",minimum:0,maximum:9999}};async function Ee(u,t,r,l=!1){Z(t,Object.keys(de));let s=t.version;if(!["v2","v3","v4"].includes(String(s)))throw new o("Provide version v2, v3 or v4.");let e=t.amountOut!==void 0;if(t.amountIn!==void 0===e)throw new o("Provide exactly one of amountIn or amountOut.");if(e&&t.minAmountOut!==void 0||!e&&t.maxAmountIn!==void 0)throw new o("Use maxAmountIn for exact output, minAmountOut for exact input.");let i=D(e?t.amountOut:t.amountIn,e?"amountOut":"amountIn",s==="v4"?128:160),n=_(t.tokenIn),c=_(t.tokenOut);if(n===c)throw new o("Swap requires different input and output currencies.");let x=u.clientFor(S),p=await x.getBlock(),L=J(t.slippageBps),j,I,m,O,A,f,d,C;if(s==="v4"){if(t.path!==void 0||t.fees!==void 0)throw new o("V4 uses poolKey or poolKeys; omit path and fees.");if(t.poolKey===void 0==(t.poolKeys===void 0))throw new o("Provide poolKey or poolKeys, not both.");if(t.poolKeys!==void 0){if(!Array.isArray(t.poolKeys)||t.poolKeys.length<1||t.poolKeys.length>5)throw new o("Provide 1 to 5 v4 poolKeys.");let a=t.poolKeys.map(P=>U(P));j=a,I=ve(a,n,c,e),m=(await x.simulateContract({address:re,abi:ae,functionName:e?"quoteExactOutput":"quoteExactInput",args:[{exactCurrency:e?c:n,path:I,exactAmount:i}],account:r,gas:H,blockNumber:p.number})).result[0]}else{if(f=U(t.poolKey),![f.currency0,f.currency1].includes(n)||![f.currency0,f.currency1].includes(c))throw new o("PoolKey currencies differ from the requested swap.");m=(await x.simulateContract({address:re,abi:ae,functionName:e?"quoteExactOutputSingle":"quoteExactInputSingle",args:[{poolKey:f,zeroForOne:n===f.currency0,exactAmount:i,hookData:"0x"}],account:r,gas:H,blockNumber:p.number})).result[0]}A="0x10"}else{if(t.poolKey!==void 0||t.poolKeys!==void 0||n===v||c===v)throw new o("V2/v3 routes use ERC-20 tokens; wrap ETH to WETH first.");if(d=Array.isArray(t.path)?t.path.map(W):[n,c],d.length<2||d.length>6||d[0]!==n||d.at(-1)!==c||new Set(d).size!==d.length||d.includes(v))throw new o("Path must contain 2 to 6 distinct ERC-20 tokens in input-to-output order.");if(s==="v2"){if(t.fees!==void 0)throw new o("V2 fees are fixed by the pair; omit fees.");let a=await x.readContract({address:ee,abi:te,functionName:e?"getAmountsIn":"getAmountsOut",args:[i,d],blockNumber:p.number});m=e?a[0]:a.at(-1),A=e?"0x09":"0x08"}else{let a=t.fees;if(!Array.isArray(a)||a.length!==d.length-1||a.some(P=>typeof P!="number"||!Number.isInteger(P)||P<0||P>1e6))throw new o("Provide one integer pool fee in hundredths of a basis point (3000 = 0.3%) per v3 path hop.");if(!G(await x.readContract({address:ie,abi:se,functionName:"factory",blockNumber:p.number}),N[4663].uniswap.v3_factory.address))throw new o("V3 quoter is not configured for the pinned factory.");C=Se(d,a,e),m=(await x.simulateContract({address:ie,abi:se,functionName:e?"quoteExactOutput":"quoteExactInput",args:[C,i],account:r,gas:H,blockNumber:p.number})).result[0],A=e?"0x01":"0x00"}}if(m<=0n)throw new o("No positive Uniswap quote is available.");let k=await ne(x,{version:s,input:n,path:d,fees:t.fees,poolKeys:f?[f]:j,exactOutput:e,amount:i,quoted:m,blockNumber:p.number,allowHighFeePools:t.allowHighFeePools===!0,acceptValueLoss:t.acceptValueLoss===!0}),{confirmationWarnings:pe,...me}=k,R=e?t.maxAmountIn:t.minAmountOut;if(!l&&R===void 0)throw new o(`Provide ${e?"maxAmountIn":"minAmountOut"} from uniswap_quote to confirm the trade bound.`);let y=R===void 0?e?(m*BigInt(1e4+L)+9999n)/10000n:m*BigInt(1e4-L)/10000n:D(R,e?"maxAmountIn":"minAmountOut",s==="v4"?128:160);if(y<=0n||(e?y<m:y>m))throw new o("The fresh quote does not satisfy the confirmed swap bound.");let h=e?y:i;if(h>=1n<<160n||s==="v4"&&(h>=1n<<128n||y>=1n<<128n))throw new o("Swap bounds exceed the router amount range.");let[le,fe]=await Promise.all([z(u,n,p.number),z(u,c,p.number)]),X={...me,version:s,input:{token:le,amount:(e?m:i).toString()},output:{token:fe,amount:(e?i:m).toString()},[e?"maxAmountIn":"minAmountOut"]:y.toString(),blockNumber:p.number.toString(),expiresAt:(p.timestamp+60n).toString()};if(l)return{quote:X,...k.warnings?{warnings:k.warnings}:{},summary:"Read-only on-chain quote. Repeat the same route with the returned bound in uniswap_swap; execution gets a fresh quote and preview."};let q=p.timestamp+300n,K=[],B="Native ETH input; no token approvals.";if(n!==v){let a=await x.readContract({address:n,abi:be,functionName:"allowance",args:[r,V],blockNumber:p.number});a!==h&&K.push(u.approval(n,V,h.toString(),S)),B=`${a===h?"Reuse existing exact ERC-20 allowance of":"Set ERC-20 allowance to exactly"} ${h} input base units to Permit2; exact router permit.`,K.push(u.unsignedTx({to:V,data:oe({abi:we,functionName:"approve",args:[n,$,h,Number(q)]}),value:"0",chainId:S,description:`Permit exactly ${h} input base units to Universal Router until ${q}.`}))}if(s==="v4"){let a=I?w(ke,[{exactCurrency:e?c:n,path:I,minHopPriceX36:[],amount:i,limit:y}]):w(ge,[{poolKey:f,zeroForOne:n===f.currency0,amount:i,limit:y,minHopPriceX36:0n,hookData:"0x"}]);O=w(Ie,[I?e?"0x090c0f":"0x070c0f":e?"0x080c0f":"0x060c0f",[a,w(ue,[n,h]),w(ue,[c,e?i:y])]])}else s==="v2"?O=w(Pe,[r,i,y,d,!0,[]]):O=w(Ae,[r,i,y,C,!0,[]]);let Q=[O];return n===v&&e&&(A=`${A}04`,Q.push(w(g("address,address,uint256"),[v,r,0n]))),K.push(u.unsignedTx({to:$,data:oe({abi:xe,functionName:"execute",args:[A,Q,q]}),value:n===v?h.toString():"0",chainId:S,description:`Uniswap ${s} ${e?"exact output":"exact input"} swap; recipient ${r}; deadline ${q}.`})),{...k.warnings?{warnings:k.warnings}:{},confirmationWarnings:pe,...await Y(u,K,r,`${(k.warnings??[]).join(" ")}${k.warnings?.length?" ":""}Swap through Universal Router 2.1.2. ${B} Fixed output/input bound and five-minute on-chain deadline. Venue fees included; gas excluded.`),quote:X}}function Ue(u){return{tools:[!0,!1].map(t=>({name:t?"uniswap_quote":"uniswap_swap",inputSchema:{type:"object",additionalProperties:!1,required:["version","tokenIn","tokenOut"],properties:de},execute:(r,l)=>Ee(u,r,l,t)}))}}export{ie as a,re as b,xe as c,we as d,se as e,ae as f,ke as g,ve as h,ge as i,Ae as j,Pe as k,Se as l,Ee as m,Ue as n};
|
|
1
|
+
import{b as ne}from"./NUERUFH7.js";import{b as ee,e as te}from"./22TU5PFT.js";import{a as D,b as W,c as _,d as J,e as z,f as Y,g as Z}from"./QPY6UTLU.js";import{d as V,e as $,w as U}from"./KLEJ3W4T.js";import{a as H}from"./IOYRL6AY.js";import{a as E}from"./66F5ZH34.js";import{c as b,g as G}from"./NWNYJ26T.js";import{b as S,j as N}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as w,encodeFunctionData as oe,encodePacked as he,erc20Abi as be,getAddress as ce,parseAbi as T,parseAbiParameters as g,zeroAddress as v}from"viem";var ie=ce("0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7"),re=ce(N[4663].ponsTrade.quoter.address),xe=T(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),we=T(["function approve(address token,address spender,uint160 amount,uint48 expiration)"]),se=T(["function factory() view returns (address)","function quoteExactInput(bytes path,uint256 amountIn) returns (uint256,uint160[],uint32[],uint256)","function quoteExactOutput(bytes path,uint256 amountOut) returns (uint256,uint160[],uint32[],uint256)"]),F="(address intermediateCurrency,uint24 fee,int24 tickSpacing,address hooks,bytes hookData)",M="(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks)",ae=T([`function quoteExactInput((address exactCurrency,${F}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactOutput((address exactCurrency,${F}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactInputSingle((${M} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`,`function quoteExactOutputSingle((${M} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`]),ke=g(`(address exactCurrency,${F}[] path,uint256[] minHopPriceX36,uint128 amount,uint128 limit)`);function ve(u,t,r,l){let s=[],e=l?r:t,i=new Set([e]);for(let n of l?[...u].reverse():u){let c=n.currency0===e?n.currency1:n.currency1===e?n.currency0:void 0;if(!c||i.has(c))throw new o("V4 poolKeys must form a continuous route without repeated currencies.");s.push({intermediateCurrency:c,fee:n.fee,tickSpacing:n.tickSpacing,hooks:n.hooks,hookData:"0x"}),e=c,i.add(e)}if(e!==(l?t:r))throw new o("V4 route does not end at the requested currency.");return s}var ge=g(`(${M} poolKey,bool zeroForOne,uint128 amount,uint128 limit,uint256 minHopPriceX36,bytes hookData)`),Ae=g("address recipient,uint256 amount,uint256 limit,bytes path,bool payerIsUser,uint256[] minHopPriceX36"),Pe=g("address recipient,uint256 amount,uint256 limit,address[] path,bool payerIsUser,uint256[] minHopPriceX36"),ue=g("address,uint256"),Ie=g("bytes,bytes[]");function Se(u,t,r){let l=r?[...u].reverse():u,s=r?[...t].reverse():t,e=l[0];return s.forEach((i,n)=>{e=`${e}${he(["uint24","address"],[i,l[n+1]]).slice(2)}`}),e}var de={version:{description:'Uniswap version: "v2" for pairs, "v3" for concentrated liquidity or "v4" for PoolManager.',type:"string",enum:["v2","v3","v4"]},tokenIn:{...b,description:"Input token address; the zero address means native ETH for v4."},tokenOut:{...b,description:"Output token address; the zero address means native ETH for v4."},path:{description:"Two to six distinct ERC-20 token addresses in input-to-output order for v2 or v3.",type:"array",minItems:2,maxItems:6,items:b},fees:{type:"array",description:"One v3 pool fee per path hop, in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%).",items:{type:"integer",minimum:0,maximum:1e6}},poolKeys:{description:"One to five v4 pool keys in input-to-output route order, without repeated currencies.",type:"array",minItems:1,maxItems:5,items:{type:"object",required:["currency0","currency1","fee","tickSpacing","hooks"],properties:{currency0:{...b,description:"Lower sorted currency address; the zero address means native ETH."},currency1:{...b,description:"Higher sorted currency address."},fee:{type:"integer",description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%)."},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"integer"},hooks:{...b,description:"Hook contract address; the zero address means no hook."}},additionalProperties:!1}},poolKey:{description:"V4 pool key: sorted currencies, fee in pips, tick spacing and hook address.",type:"object",properties:{currency0:{...b,description:"Lower sorted currency address; the zero address means native ETH."},currency1:{...b,description:"Higher sorted currency address."},fee:{type:"integer",description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%)."},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"integer"},hooks:{...b,description:"Hook contract address; the zero address means no hook."}},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},allowHighFeePools:{description:"Allow pools above Oak's usual fee threshold; review the fee warning before confirming.",type:"boolean"},acceptValueLoss:{description:"Acknowledge the quoted value-loss warning; review the measured loss before confirming.",type:"boolean"},amountIn:E('Amount of input token in base units; use input token decimals. Example: "1000000" = 1 input token at 6 decimals.'),amountOut:E('Amount of output token in base units; use output token decimals. Example: "1000000" = 1 output token at 6 decimals.'),minAmountOut:E('Minimum amount of output token in base units; use output token decimals. Example: "1000000" = 1 output token at 6 decimals.'),maxAmountIn:E('Maximum amount of input token in base units; use input token decimals. Example: "1000000" = 1 input token at 6 decimals.'),slippageBps:{description:"Slippage tolerance in basis points (50 = 0.5%).",type:"integer",minimum:0,maximum:9999}};async function Ee(u,t,r,l=!1){Z(t,Object.keys(de));let s=t.version;if(!["v2","v3","v4"].includes(String(s)))throw new o("Provide version v2, v3 or v4.");let e=t.amountOut!==void 0;if(t.amountIn!==void 0===e)throw new o("Provide exactly one of amountIn or amountOut.");if(e&&t.minAmountOut!==void 0||!e&&t.maxAmountIn!==void 0)throw new o("Use maxAmountIn for exact output, minAmountOut for exact input.");let i=D(e?t.amountOut:t.amountIn,e?"amountOut":"amountIn",s==="v4"?128:160),n=_(t.tokenIn),c=_(t.tokenOut);if(n===c)throw new o("Swap requires different input and output currencies.");let x=u.clientFor(S),p=await x.getBlock(),L=J(t.slippageBps),j,I,m,O,A,f,d,C;if(s==="v4"){if(t.path!==void 0||t.fees!==void 0)throw new o("V4 uses poolKey or poolKeys; omit path and fees.");if(t.poolKey===void 0==(t.poolKeys===void 0))throw new o("Provide poolKey or poolKeys, not both.");if(t.poolKeys!==void 0){if(!Array.isArray(t.poolKeys)||t.poolKeys.length<1||t.poolKeys.length>5)throw new o("Provide 1 to 5 v4 poolKeys.");let a=t.poolKeys.map(P=>U(P));j=a,I=ve(a,n,c,e),m=(await x.simulateContract({address:re,abi:ae,functionName:e?"quoteExactOutput":"quoteExactInput",args:[{exactCurrency:e?c:n,path:I,exactAmount:i}],account:r,gas:H,blockNumber:p.number})).result[0]}else{if(f=U(t.poolKey),![f.currency0,f.currency1].includes(n)||![f.currency0,f.currency1].includes(c))throw new o("PoolKey currencies differ from the requested swap.");m=(await x.simulateContract({address:re,abi:ae,functionName:e?"quoteExactOutputSingle":"quoteExactInputSingle",args:[{poolKey:f,zeroForOne:n===f.currency0,exactAmount:i,hookData:"0x"}],account:r,gas:H,blockNumber:p.number})).result[0]}A="0x10"}else{if(t.poolKey!==void 0||t.poolKeys!==void 0||n===v||c===v)throw new o("V2/v3 routes use ERC-20 tokens; wrap ETH to WETH first.");if(d=Array.isArray(t.path)?t.path.map(W):[n,c],d.length<2||d.length>6||d[0]!==n||d.at(-1)!==c||new Set(d).size!==d.length||d.includes(v))throw new o("Path must contain 2 to 6 distinct ERC-20 tokens in input-to-output order.");if(s==="v2"){if(t.fees!==void 0)throw new o("V2 fees are fixed by the pair; omit fees.");let a=await x.readContract({address:ee,abi:te,functionName:e?"getAmountsIn":"getAmountsOut",args:[i,d],blockNumber:p.number});m=e?a[0]:a.at(-1),A=e?"0x09":"0x08"}else{let a=t.fees;if(!Array.isArray(a)||a.length!==d.length-1||a.some(P=>typeof P!="number"||!Number.isInteger(P)||P<0||P>1e6))throw new o("Provide one integer pool fee in hundredths of a basis point (3000 = 0.3%) per v3 path hop.");if(!G(await x.readContract({address:ie,abi:se,functionName:"factory",blockNumber:p.number}),N[4663].uniswap.v3_factory.address))throw new o("V3 quoter is not configured for the pinned factory.");C=Se(d,a,e),m=(await x.simulateContract({address:ie,abi:se,functionName:e?"quoteExactOutput":"quoteExactInput",args:[C,i],account:r,gas:H,blockNumber:p.number})).result[0],A=e?"0x01":"0x00"}}if(m<=0n)throw new o("No positive Uniswap quote is available.");let k=await ne(x,{version:s,input:n,path:d,fees:t.fees,poolKeys:f?[f]:j,exactOutput:e,amount:i,quoted:m,blockNumber:p.number,allowHighFeePools:t.allowHighFeePools===!0,acceptValueLoss:t.acceptValueLoss===!0}),{confirmationWarnings:pe,...me}=k,R=e?t.maxAmountIn:t.minAmountOut;if(!l&&R===void 0)throw new o(`Provide ${e?"maxAmountIn":"minAmountOut"} from uniswap_quote to confirm the trade bound.`);let y=R===void 0?e?(m*BigInt(1e4+L)+9999n)/10000n:m*BigInt(1e4-L)/10000n:D(R,e?"maxAmountIn":"minAmountOut",s==="v4"?128:160);if(y<=0n||(e?y<m:y>m))throw new o("The fresh quote does not satisfy the confirmed swap bound.");let h=e?y:i;if(h>=1n<<160n||s==="v4"&&(h>=1n<<128n||y>=1n<<128n))throw new o("Swap bounds exceed the router amount range.");let[le,fe]=await Promise.all([z(u,n,p.number),z(u,c,p.number)]),X={...me,version:s,input:{token:le,amount:(e?m:i).toString()},output:{token:fe,amount:(e?i:m).toString()},[e?"maxAmountIn":"minAmountOut"]:y.toString(),blockNumber:p.number.toString(),expiresAt:(p.timestamp+60n).toString()};if(l)return{quote:X,...k.warnings?{warnings:k.warnings}:{},summary:"Read-only on-chain quote. Repeat the same route with the returned bound in uniswap_swap; execution gets a fresh quote and preview."};let q=p.timestamp+300n,K=[],B="Native ETH input; no token approvals.";if(n!==v){let a=await x.readContract({address:n,abi:be,functionName:"allowance",args:[r,V],blockNumber:p.number});a!==h&&K.push(u.approval(n,V,h.toString(),S)),B=`${a===h?"Reuse existing exact ERC-20 allowance of":"Set ERC-20 allowance to exactly"} ${h} input base units to Permit2; exact router permit.`,K.push(u.unsignedTx({to:V,data:oe({abi:we,functionName:"approve",args:[n,$,h,Number(q)]}),value:"0",chainId:S,description:`Permit exactly ${h} input base units to Universal Router until ${q}.`}))}if(s==="v4"){let a=I?w(ke,[{exactCurrency:e?c:n,path:I,minHopPriceX36:[],amount:i,limit:y}]):w(ge,[{poolKey:f,zeroForOne:n===f.currency0,amount:i,limit:y,minHopPriceX36:0n,hookData:"0x"}]);O=w(Ie,[I?e?"0x090c0f":"0x070c0f":e?"0x080c0f":"0x060c0f",[a,w(ue,[n,h]),w(ue,[c,e?i:y])]])}else s==="v2"?O=w(Pe,[r,i,y,d,!0,[]]):O=w(Ae,[r,i,y,C,!0,[]]);let Q=[O];return n===v&&e&&(A=`${A}04`,Q.push(w(g("address,address,uint256"),[v,r,0n]))),K.push(u.unsignedTx({to:$,data:oe({abi:xe,functionName:"execute",args:[A,Q,q]}),value:n===v?h.toString():"0",chainId:S,description:`Uniswap ${s} ${e?"exact output":"exact input"} swap; recipient ${r}; deadline ${q}.`})),{...k.warnings?{warnings:k.warnings}:{},confirmationWarnings:pe,...await Y(u,K,r,`${(k.warnings??[]).join(" ")}${k.warnings?.length?" ":""}Swap through Universal Router 2.1.2. ${B} Fixed output/input bound and five-minute on-chain deadline. Venue fees included; gas excluded.`),quote:X}}function Ue(u){return{tools:[!0,!1].map(t=>({name:t?"uniswap_quote":"uniswap_swap",inputSchema:{type:"object",additionalProperties:!1,required:["version","tokenIn","tokenOut"],properties:de},execute:(r,l)=>Ee(u,r,l,t)}))}}export{ie as a,re as b,xe as c,we as d,se as e,ae as f,ke as g,ve as h,ge as i,Ae as j,Pe as k,Se as l,Ee as m,Ue as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./X5V2Z2NM.js";import{a as m}from"./43LI5NKJ.js";import{a as k}from"./66F5ZH34.js";import{e as A,g as u,i as b}from"./NWNYJ26T.js";import{
|
|
1
|
+
import{a as g}from"./X5V2Z2NM.js";import{a as m}from"./43LI5NKJ.js";import{a as k}from"./66F5ZH34.js";import{e as A,g as u,i as b}from"./NWNYJ26T.js";import{b as l,j as x,t as y}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{b as w}from"./JXOEJPJ4.js";import{Buffer as v}from"node:buffer";import{decodeEventLog as $}from"viem";var R="Profile contents and oak.registrar are mutable, self-asserted metadata, not registry-validated claims or proof of provenance. Oak registration always writes the public oak.registrar = oak marker on Robinhood Chain. Anyone can see it, and the transaction stays in the public history even if the marker is changed later.",B="oak.registrar",D="0x6f616b",L=k("Agent ID as a decimal uint256 integer string."),j={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},q={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"32-byte hex value."},z={type:"string",pattern:"^0x([0-9a-fA-F]{2})*$"},T="0x0000000000000000000000000000000000000000";function h(t){let e=t.network??"mainnet",{chainId:n,identityRegistry:r}=y[e],s=e==="mainnet"?x[l].identity:void 0;return{network:e,chainId:n,registry:r,registryId:`eip155:${n}:${r}`,reputation:s?.reputationRegistry.address,validation:s?.validationRegistry.address}}function K(t){let{chainId:e,reputation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 reputation registry for this network.");return{chainId:e,address:n}}function V(t){let{chainId:e,validation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 validation registry for this network.");return{chainId:e,address:n}}function Z(t){return u(t,T)}function G(t){if(typeof t!="string"||!/^[0-9]+$/.test(t)||t.length>78||BigInt(t)>=2n**256n)throw new o("Provide an agent ID as a decimal uint256 integer string.");return BigInt(t)}function J(t,e){return b(t,`Provide a valid ${e} address.`)}function Q(t,e){let n=h(t).chainId;if(e!==void 0&&e!==n)throw new o(`ERC-8004 actions are supported only on chain ${n}.`)}function X(t,e){if(typeof t!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t))throw new o(`Provide ${e} as 32-byte hex.`);return t.toLowerCase()}function I(t,e,n,r=!0){if(t===void 0){if(r)return"";throw new o(`Provide ${e}.`)}if(typeof t!="string"||!r&&!t.trim()||t.length>n||w(t))throw new o(`${e} must be plain text of at most ${n} characters.`);return t}function Y(t,e){if(typeof t!="string"||!t.trim()||t.length>2048)throw new o(`Provide a valid ${e}.`);try{let n=new URL(t);if(!["https:","ipfs:"].includes(n.protocol)||!n.hostname||n.username||n.password||w(t))throw new Error}catch{throw new o(`${e} must be an HTTPS or IPFS URI without credentials.`)}return t}function tt(t){let e=/^data:application\/json;base64,([A-Za-z0-9+/=]+)$/.exec(t);if(e)try{let n=JSON.parse(v.from(e[1],"base64").toString("utf8"));return A(n)?n:void 0}catch{return}}async function C(t,e,n,r,s=!0){let i=await t.preview(e,n),a=i.changes.map(({amount:d,token:f})=>{let c=d.startsWith("-");return`${c?"-":""}${t.formatAmount(c?d.slice(1):d,f.decimals)} ${f.symbol} (${f.address}, chain ${f.chainId})`});return{txs:e,summary:`${i.summary} ${a.join("; ")} ${s?`${R} `:""}${r}`}}async function et(t,e,n,r="update this profile"){let{chainId:s,registry:i}=h(t),a=t.clientFor(s),d=await a.readContract({address:i,abi:g,functionName:"ownerOf",args:[e]});if(m(d),u(d,n))return d;let[f,c]=await Promise.all([a.readContract({address:i,abi:g,functionName:"getApproved",args:[e]}),a.readContract({address:i,abi:g,functionName:"isApprovedForAll",args:[d,n]})]);if(m(f),typeof c!="boolean")throw new o("The registry returned invalid operator approval data.");if(!u(f,n)&&!c)throw new o(`Only the agent owner or an approved operator can ${r}.`);return d}async function nt(t,e,n){let{chainId:r,registry:s}=h(t),i=t.clientFor(r),a=await i.readContract({address:s,abi:g,functionName:"ownerOf",args:[e]});if(m(a),u(a,n))return a;if(await i.readContract({address:s,abi:g,functionName:"isApprovedForAll",args:[a,n]})!==!0)throw new o("Only the agent owner or an operator approved for all of its agents can change the token approval.");return a}async function H(t,e,n,r,s){let{chainId:i,registry:a}=h(t),d=s??a;if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new o("Provide the mined transaction hash.");let f=t.clientFor(i),c=await f.getTransactionReceipt({hash:e});if(!c)throw new o("The transaction is not mined yet. Try again after confirmation.");if(c.status!=="success"||!c.to||!u(c.to,d)||!u(c.from,n)||!u(c.transactionHash,e))throw new o("The receipt is not a successful matching registry transaction.");let p=await f.getTransaction({hash:e});if(p.chainId!==i||p.value!==0n||!p.to||!u(p.to,d)||!u(p.from,n))throw new o("The transaction does not match this chain, registry and wallet.");if(!(typeof r=="function"?typeof p.input=="string"&&r(p.input):typeof p.input=="string"&&u(p.input,r)))throw new o("The mined transaction calldata does not match the exact operation Oak built.");return c}function rt(t,e,n,r){let s=t.logs.filter(i=>u(i.address,e)&&!i.removed).flatMap(i=>{try{let a=$({abi:n,topics:i.topics,data:i.data,strict:!0});return a.eventName===r?[a.args]:[]}catch{return[]}});if(s.length!==1)throw new o(`The receipt must contain one matching ${r} event.`);return s[0]}function ot(t){let e=I(t,"metadata key",128,!1);if(e==="agentWallet")throw new o("The key agentWallet is reserved: use erc8004_set_wallet / erc8004_unset_wallet, which prove control of the wallet.");return e}function it(t){if(t.value===void 0==(t.text===void 0))throw new o("Provide exactly one of value (0x hex bytes) or text (UTF-8).");let e;if(t.value!==void 0){if(typeof t.value!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(t.value))throw new o("Metadata value must be 0x-prefixed hex bytes.");e=t.value}else{if(typeof t.text!="string")throw new o("Metadata text must be a string.");e=`0x${v.from(t.text,"utf8").toString("hex")}`}if((e.length-2)/2>4096)throw new o("Metadata values are limited to 4096 bytes.");return e}async function at(t,e,n,r){let{chainId:s}=h(t);if(n.transactionHash!==void 0){let a=await H(t,n.transactionHash,e,r.matcher??r.data,r.to);return r.verify(a)}await r.authority();let i=t.unsignedTx({to:r.to,data:r.data,value:"0",chainId:s,description:r.description});return C(t,[i],e,r.summary,!1)}export{R as a,B as b,D as c,L as d,j as e,q as f,z as g,h,K as i,V as j,Z as k,G as l,J as m,Q as n,X as o,I as p,Y as q,tt as r,C as s,et as t,nt as u,H as v,rt as w,ot as x,it as y,at as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as w}from"./2GXHYI23.js";import{c as A,d as B}from"./
|
|
1
|
+
import{h as w}from"./2GXHYI23.js";import{c as A,d as B}from"./ZSVAGOF2.js";import{a as g,c as v,d}from"./VVJO6OYK.js";import{ia as u}from"./HHYE42JG.js";import{h as y}from"./NWNYJ26T.js";import{a as c}from"./XSD5NL7J.js";import{erc20Abi as C}from"viem";async function I(a,n,o,l){if(!o.length)return[];let t=await a.multicall({allowFailure:!1,contracts:o.map(p=>({address:p,abi:C,functionName:"balanceOf",args:[n]})),blockNumber:l});if(!Array.isArray(t)||t.length!==o.length)throw new c("Borro share balances could not be read completely. Please try again.");return t.map(d)}async function T(a,n,o={}){v(n);let l=()=>{if(o.signal?.aborted)throw new c("Borro read was cancelled.")};l();let t=a.clientFor(4663),s=await(o.discoverVaults??A(a,o).discoverVaults)(t,{wallet:n,heldOnly:!0,...o.signal?{signal:o.signal}:{}});if(s.incomplete)throw new c("Borro discovery is incomplete, so these positions cannot be shown as complete. Please try again.");let h=s.shareBalances?.map(e=>e.vault)??[...new Set([...s.vaults.map(e=>e.vault),...s.refused.flatMap(e=>e.vault?[e.vault]:[])])],b=s.shareBalances?.map(e=>d(BigInt(e.amount)))??await I(t,n,h,BigInt(s.measuredAtBlock));l();let P=h.flatMap((e,i)=>b[i]>0n?[{vault:e,balance:b[i]}]:[]);return Promise.all(P.map(async({vault:e,balance:i})=>{let r=s.vaults.find(O=>y(O.vault,e));if(!r)throw new c("This wallet holds Borro shares whose vault could not be verified. Check the vault address before withdrawing.");let m=d(await t.readContract({address:e,abi:g,functionName:"convertToAssets",args:[i],blockNumber:BigInt(s.measuredAtBlock)}));l();let k={address:e,symbol:r.vaultSymbol,decimals:18,chainId:4663},f={address:r.asset,symbol:r.symbol,decimals:r.assetDecimals,chainId:4663};return{module:"borro",id:`4663:${e}`,chainId:4663,assets:[B(k,i)],oakNotice:u(),economics:{principal:m===0n?[]:[w("redeemable",{token:f,amount:m.toString(),source:"borro.convertToAssets",heldAs:e,measuredAtBlock:s.measuredAtBlock})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`${a.formatAmount(i.toString(),18)} ${r.vaultSymbol} = about ${a.formatAmount(m.toString(),r.assetDecimals)} ${f.symbol} lent through Borro. ${u()}`}}))}export{I as a,T as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./
|
|
1
|
+
import{a as f}from"./PDGYM2WG.js";import{a as k}from"./G2LAO23N.js";import{c as l}from"./NWNYJ26T.js";import{b as p}from"./TI727O2H.js";import{a as s}from"./XSD5NL7J.js";import{getAddress as g}from"viem";var v={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Hookr v4 pool ID: 32 bytes, 0x followed by 64 hex digits."},b=[["hookr_release",{},[],"Read verified release contracts, block and recapture lane."],["hookr_blocks",{},[],"Read all Hook Blocks and their current availability."],["hookr_kings",{poolId:v},[],"Read King of the Pool rounds, leaders, pots and endings."],["hookr_claims",{poolId:v},[],"Read the signing wallet's prizes, royalties, recapture and PoolManager claims."],["hookr_revenue_tokens",{limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of revenue tokens to return, 1 to 50."},cursor:{type:"string",pattern:"^(v1|v1:[1-9][0-9]{0,19}|v2:[1-9][0-9]{0,19})$",description:"Paging cursor: the nextCursor string from the previous page (v1, v1:N or v2:N); omit for the first page."}},[],"Read revenue tokens, tokenizer provenance, streams and income, page by page."],["hookr_revenue_token",{token:{...l,description:k.address("revenue token")}},["token"],"Read a revenue token, stream endings, income, drops and the signing wallet's claims."],["hookr_hook",{address:{...l,description:k.address("Hookr hook contract")}},["address"],"Read shared or owned hook provenance, ownership, allowed blocks, opening and pools."]],M=[...b.map(d=>d[0]),"hookr_contracts","hookr_read","hookr_revenue_read","hookr_addon_read","hookr_api_read"];function P(d){return[...b.map(([t,c,a,o])=>({name:t,inputSchema:{type:"object",description:o,properties:c,required:a,additionalProperties:!1},execute:async(r,w)=>{if(Object.keys(r).some(n=>!Object.hasOwn(c,n))||a.some(n=>r[n]===void 0))throw new s(`Provide the documented arguments for ${t}.`);let m={};for(let[n,i]of Object.entries(r)){let u=c[n];if(u.type==="integer"){if(typeof i!="number"||!Number.isInteger(i)||i<Number(u.minimum)||i>Number(u.maximum))throw new s("Hookr revenue page limit must be an integer from 1 to 50.")}else if(typeof i!="string"||!new RegExp(String(u.pattern)).test(i))throw new s(`Provide a valid Hookr ${n}.`);m[n]=n==="token"||n==="address"?g(String(i)):i}return(t==="hookr_claims"||t==="hookr_revenue_token")&&(m.account=w),{...await f(d,t,m),chainId:p,source:"https://hookr.fun/api/mcp"}}})),y(d)]}var h={catalog:"/api/hooks/catalog",stats:"/api/protocol-stats",poolApr:"/api/pool-apr",revenueTokens:"/api/revenue-tokens",revenueIncome:"/api/revenue-tokens/income"};function y(d){return{name:"hookr_api_read",inputSchema:{type:"object",description:"Read Hookr public catalog, protocol stats, pool APR, revenue directory/income, or one token's doors/mark. Marks are project metadata, not investment or security endorsements.",properties:{resource:{type:"string",enum:[...Object.keys(h),"revenueDoors","revenueMark"],description:"Public feed to read: catalog, stats, poolApr, revenueTokens, revenueIncome; revenueDoors and revenueMark also need token (that token's doors, or its mark image URL)."},token:{...l,description:k.address("revenue token, only for revenueDoors and revenueMark")}},required:["resource"],additionalProperties:!1},execute:async e=>{if(Object.keys(e).some(o=>!["resource","token"].includes(o))||typeof e.resource!="string")throw new s("Choose a documented Hookr public resource.");let t=["revenueDoors","revenueMark"].includes(e.resource);if(!t&&e.token!==void 0||t&&typeof e.token!="string")throw new s("Only the revenueDoors and revenueMark resources take a token address.");let c;if(t){let o;try{o=g(String(e.token))}catch{throw new s("Provide a valid revenue token address.")}c=`/api/revenue-tokens/${o}/${e.resource==="revenueDoors"?"doors":"mark"}`}else{if(!Object.hasOwn(h,e.resource))throw new s("Choose a documented Hookr public resource.");c=h[e.resource]}let a=`https://hookr.fun${c}`;try{let o=await d.http(a,{method:"GET",redirect:"error",signal:AbortSignal.timeout(15e3)});if(!o.ok)throw new Error("Unavailable");if(e.resource==="revenueMark"){if(!o.headers.get("content-type")?.includes("image/svg+xml"))throw new Error("Invalid mark");return{chainId:p,source:a,imageUrl:a,pngUrl:`${a}.png`,note:"Official SVG mark URL; SVG code is not executed or returned. The PNG URL has not been fetched."}}let r=await o.json();if(!r||typeof r!="object"||"error"in r||"status"in r&&r.status==="unavailable")throw new Error("Unavailable");return{chainId:p,source:a,data:r}}catch{throw new s("Hookr public resource is unavailable. Retry later; no empty or zero result is implied.")}}}}export{M as a,P as b,y as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as ke,b as Te}from"./GSFHM5L3.js";import{b as be,o as we}from"./CAWTAR5V.js";import{a as ye}from"./H5DY7CNB.js";import{c as ie}from"./SCG5HWMN.js";import{a as O}from"./66F5ZH34.js";import{b as re,c as R,d as fe,g as p,i as he,n as ge}from"./NWNYJ26T.js";import{a as l,i as oe,l as u}from"./FWD4L3CJ.js";import{a as i}from"./XSD5NL7J.js";import{a as F}from"./JXOEJPJ4.js";import{decodeEventLog as qe,encodeAbiParameters as Ue,encodeFunctionData as M,erc20Abi as j,getAddress as Ie,keccak256 as Oe,parseAbi as D,parseAbiItem as Me,toHex as He,zeroAddress as S}from"viem";var ce=oe[l].pons.launchAndBuyRouter.address,Pe=oe[l].ponsTrade.state_view.address,J={address:S,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)"]),z=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))"]),ve=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"]),Fe=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,xe=2000n;function C(n){return he(n,"Provide a token or wallet address.",fe)}function H(n){return ge(n,"Amount exceeds the uint256 range.",{notString:"Amounts must be integer strings in base units."})}function Ce(n,e){if(typeof n!="string"||!n.trim())throw new i(`Provide ${e}.`);return n}function N(n,e){return{token:n,amount:e.toString()}}function Re(n,e,t,r,o){let a=n*BigInt(t)/10000n,s=r?(n-a)*BigInt(o)/10000n:0n;return{baseBps:n.toString(),creatorTaxBps:e.toString(),totalBps:(n+BigInt(e)).toString(),protocolBps:a.toString(),creatorBps:(n-a-s+BigInt(e)).toString(),buybackBps:s.toString(),buybackEnabled:r}}async function Q(n,e,t){if(p(e,S))return J;let r=n.clientFor(l),[o,a]=await Promise.all([r.readContract({address:e,abi:j,functionName:"symbol",blockNumber:t}),r.readContract({address:e,abi:j,functionName:"decimals",blockNumber:t})]);return{address:Ie(e),chainId:l,symbol:F(o),decimals:a}}async function X(n,e,t){let r=n.clientFor(l),[o,a]=await Promise.all([r.readContract({address:e,abi:je,functionName:"launchFactory",blockNumber:t}),r.readContract({address:u,abi:f,functionName:"getLaunchedToken",args:[e],blockNumber:t})]);if(!p(o,u)||!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 de(n,e,t){let r=n.clientFor(l),o=await X(n,e,t),[a,s,d,c,h,g,y]=await Promise.all([Q(n,e,t),Q(n,o.pairToken,t),r.readContract({address:e,abi:j,functionName:"totalSupply",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"factory",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"feeEscrow",blockNumber:t}),r.readContract({address:u,abi:f,functionName:"memeHook",blockNumber:t}),r.readContract({address:u,abi:f,functionName:"getLaunchFeePolicy",args:[e],blockNumber:t})]);if(!p(c,u))throw new i("The Pons curve does not belong to the supported factory.");let m=BigInt(y[3]),A=o.sweptQuote,b=null,T=null,_=null;if(o.phase===0){let[P,I,w]=await Promise.all([r.readContract({address:o.curve,abi:z,functionName:"getReserves",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"realQuoteReserve",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"feeBps",blockNumber:t})]);if(A=I,m=w,o.graduationThreshold<=0n||P[1]<=0n)throw new i("Pons returned unavailable curve reserves or threshold.");b=I*1000000n/o.graduationThreshold,b>1000000n&&(b=1000000n),T=N(s,P[0]*10n**BigInt(a.decimals)/P[1])}else if(o.phase===2){let P=[e,o.pairToken].sort(($,x)=>BigInt($)<BigInt(x)?-1:1),I=Oe(Ue([{type:"address"},{type:"address"},{type:"uint24"},{type:"int24"},{type:"address"}],[P[0],P[1],o.poolFee,o.tickSpacing,g])),[w,q]=await Promise.all([r.readContract({address:Pe,abi:ve,functionName:"getSlot0",args:[I],blockNumber:t}),r.readContract({address:Pe,abi:ve,functionName:"getLiquidity",args:[I],blockNumber:t})]);if(w[0]===0n)throw new i("The graduated Pons pool price is unavailable.");let E=w[0]**2n,U=10n**BigInt(a.decimals);T=N(s,p(P[0],e)?E*U/(1n<<192n):(1n<<192n)*U/E),_={id:I,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:t.toString(),factory:u,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:N(s,o.graduationThreshold),raised:N(s,A),sweptTokens:N(a,o.sweptTokens),sweptAt:o.sweptAt.toString(),progressPpm:b?.toString()??null,totalSupply:N(a,d),fees:Re(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 ze(n,e,t,r){let o=n.clientFor(l),[a,s]=await Promise.all([o.readContract({address:e.token.address,abi:j,functionName:"balanceOf",args:[t],blockNumber:r}),p(e.pairToken.address,S)?o.getBalance({address:t,blockNumber:r}):o.readContract({address:e.pairToken.address,abi:j,functionName:"balanceOf",args:[t],blockNumber:r})]),d;try{let c=await ke(n,e.token.address,t,!1,r),h=c.credited.some(g=>BigInt(g.amount)>0n)||BigInt(c.buybackVest.releasable.amount)>0n;d={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){d={unavailable:n.plainError(c)}}return{holder:t,holding:N(e.token,a),pairBalance:N(e.pairToken,s),creatorFees:d,note:"Sell the actual holding shown here, not a quoted output. Balances are read at the status block."}}async function Qe(n,e,t){try{let r=await n.clientFor(l).getBlockNumber({cacheTime:0}),o=await de(n,C(e),r);return t===void 0?o:{...o,account:await ze(n,o,C(t),r)}}catch(r){throw new i(n.plainError(r))}}var Ae="https://ponsfamily.com/api/launches",Ve=n=>{let e=n;return!!e&&Array.isArray(e.items)&&e.items.length<=100&&(e.nextCursor===null||e.nextCursor===void 0||typeof e.nextCursor=="string")&&e.items.every(t=>!!t&&typeof t.address=="string"&&re.test(t.address)&&typeof t.factory=="string"&&re.test(t.factory))};async function Je(n,e){let t=e.limit??20;if(typeof t!="number"||!Number.isInteger(t)||t<1||t>40)throw new i("Choose a search or listing limit from 1 to 40.");let r=new URL(Ae);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(t));let o=await ie(n.http,r,{method:"GET",redirect:"error"},Ve);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,u)),s=[...new Map(a.map(h=>[h.address.toLowerCase(),Ie(h.address)])).values()].slice(0,t),d=await n.clientFor(l).getBlockNumber({cacheTime:0});return{items:await Promise.all(s.map(h=>de(n,h,d))),statusBlock:d.toString(),source:Ae,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(n,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(n,e)}catch(t){throw new i(n.plainError(t))}return Ne(n,e)}async function Ne(n,e={}){try{let t=n.clientFor(l),r=await t.getBlockNumber({cacheTime:0}),o=e.toBlock===void 0?r:H(e.toBlock),a=e.fromBlock===void 0?o>=xe?o-xe+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 d=await t.getLogs({address:u,event:Fe,fromBlock:a,toBlock:o,strict:!0}),c=new Map;for(let y of d.filter(m=>p(m.address,u)&&!m.removed&&m.blockNumber!==null&&m.blockNumber>=a&&m.blockNumber<=o).sort((m,A)=>m.blockNumber===A.blockNumber?(A.logIndex??0)-(m.logIndex??0):m.blockNumber>A.blockNumber?-1:1)){let m=C(y.args.token);c.set(m.toLowerCase(),m)}let h=[...c.values()];return{items:await Promise.all(h.slice(0,s).map(y=>de(n,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(t){throw new i(n.plainError(t))}}async function K(n,e,t,r){let o=(Array.isArray(e)?e:[e]).map(n.unsignedTx),a=await n.preview(o,t),s=a.changes.map(d=>{let c=d.amount.startsWith("-");return`${c?"-":""}${n.formatAmount(c?d.amount.slice(1):d.amount,d.token.decimals)} ${d.token.symbol} (${d.token.chainId}:${d.token.address})`});return{txs:o,preview:a,summary:`${r} ${a.summary}${s.length?` Changes: ${s.join(", ")}.`:""}`}}var V=["twitter","telegram","discord","website","farcaster"],Be=5242880,$e="https://ponsfamily.com/api/ipfs/image";function se(n,e){if(n==="")return"";if(typeof n!="string"||n.length>2048)throw new i(`Provide a public HTTPS or IPFS ${e}.`);try{let t=new URL(n);if(!["https:","ipfs:"].includes(t.protocol)||!t.hostname||t.username||t.password)throw new Error}catch{throw new i(`Provide a public HTTPS or IPFS ${e}.`)}return n}function Xe(n){if(n===void 0)return;if(!n||typeof n!="object"||Array.isArray(n))throw new i("Provide image mimeType and base64.");let e=n,t={"image/png":"png","image/jpeg":"jpg","image/webp":"webp"};if(Object.keys(e).some(s=>!["mimeType","base64"].includes(s))||typeof e.mimeType!="string"||!t[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
|
|
1
|
+
import{a as ke,b as Te}from"./HZSYMGJ2.js";import{b as be,o as we}from"./GYPMUYB5.js";import{a as ye}from"./Z7FGEWO2.js";import{c as ie}from"./SCG5HWMN.js";import{a as O}from"./66F5ZH34.js";import{b as re,c as R,d as fe,g as p,i as he,n as ge}from"./NWNYJ26T.js";import{b as l,j as oe,m as u}from"./TI727O2H.js";import{a as i}from"./XSD5NL7J.js";import{a as F}from"./JXOEJPJ4.js";import{decodeEventLog as qe,encodeAbiParameters as Ue,encodeFunctionData as M,erc20Abi as j,getAddress as Ie,keccak256 as Oe,parseAbi as D,parseAbiItem as Me,toHex as He,zeroAddress as S}from"viem";var ce=oe[l].pons.launchAndBuyRouter.address,Pe=oe[l].ponsTrade.state_view.address,J={address:S,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)"]),z=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))"]),ve=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"]),Fe=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,xe=2000n;function C(n){return he(n,"Provide a token or wallet address.",fe)}function H(n){return ge(n,"Amount exceeds the uint256 range.",{notString:"Amounts must be integer strings in base units."})}function Ce(n,e){if(typeof n!="string"||!n.trim())throw new i(`Provide ${e}.`);return n}function N(n,e){return{token:n,amount:e.toString()}}function Re(n,e,t,r,o){let a=n*BigInt(t)/10000n,s=r?(n-a)*BigInt(o)/10000n:0n;return{baseBps:n.toString(),creatorTaxBps:e.toString(),totalBps:(n+BigInt(e)).toString(),protocolBps:a.toString(),creatorBps:(n-a-s+BigInt(e)).toString(),buybackBps:s.toString(),buybackEnabled:r}}async function Q(n,e,t){if(p(e,S))return J;let r=n.clientFor(l),[o,a]=await Promise.all([r.readContract({address:e,abi:j,functionName:"symbol",blockNumber:t}),r.readContract({address:e,abi:j,functionName:"decimals",blockNumber:t})]);return{address:Ie(e),chainId:l,symbol:F(o),decimals:a}}async function X(n,e,t){let r=n.clientFor(l),[o,a]=await Promise.all([r.readContract({address:e,abi:je,functionName:"launchFactory",blockNumber:t}),r.readContract({address:u,abi:f,functionName:"getLaunchedToken",args:[e],blockNumber:t})]);if(!p(o,u)||!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 de(n,e,t){let r=n.clientFor(l),o=await X(n,e,t),[a,s,d,c,h,g,y]=await Promise.all([Q(n,e,t),Q(n,o.pairToken,t),r.readContract({address:e,abi:j,functionName:"totalSupply",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"factory",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"feeEscrow",blockNumber:t}),r.readContract({address:u,abi:f,functionName:"memeHook",blockNumber:t}),r.readContract({address:u,abi:f,functionName:"getLaunchFeePolicy",args:[e],blockNumber:t})]);if(!p(c,u))throw new i("The Pons curve does not belong to the supported factory.");let m=BigInt(y[3]),A=o.sweptQuote,b=null,T=null,_=null;if(o.phase===0){let[P,I,w]=await Promise.all([r.readContract({address:o.curve,abi:z,functionName:"getReserves",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"realQuoteReserve",blockNumber:t}),r.readContract({address:o.curve,abi:z,functionName:"feeBps",blockNumber:t})]);if(A=I,m=w,o.graduationThreshold<=0n||P[1]<=0n)throw new i("Pons returned unavailable curve reserves or threshold.");b=I*1000000n/o.graduationThreshold,b>1000000n&&(b=1000000n),T=N(s,P[0]*10n**BigInt(a.decimals)/P[1])}else if(o.phase===2){let P=[e,o.pairToken].sort(($,x)=>BigInt($)<BigInt(x)?-1:1),I=Oe(Ue([{type:"address"},{type:"address"},{type:"uint24"},{type:"int24"},{type:"address"}],[P[0],P[1],o.poolFee,o.tickSpacing,g])),[w,q]=await Promise.all([r.readContract({address:Pe,abi:ve,functionName:"getSlot0",args:[I],blockNumber:t}),r.readContract({address:Pe,abi:ve,functionName:"getLiquidity",args:[I],blockNumber:t})]);if(w[0]===0n)throw new i("The graduated Pons pool price is unavailable.");let E=w[0]**2n,U=10n**BigInt(a.decimals);T=N(s,p(P[0],e)?E*U/(1n<<192n):(1n<<192n)*U/E),_={id:I,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:t.toString(),factory:u,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:N(s,o.graduationThreshold),raised:N(s,A),sweptTokens:N(a,o.sweptTokens),sweptAt:o.sweptAt.toString(),progressPpm:b?.toString()??null,totalSupply:N(a,d),fees:Re(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 ze(n,e,t,r){let o=n.clientFor(l),[a,s]=await Promise.all([o.readContract({address:e.token.address,abi:j,functionName:"balanceOf",args:[t],blockNumber:r}),p(e.pairToken.address,S)?o.getBalance({address:t,blockNumber:r}):o.readContract({address:e.pairToken.address,abi:j,functionName:"balanceOf",args:[t],blockNumber:r})]),d;try{let c=await ke(n,e.token.address,t,!1,r),h=c.credited.some(g=>BigInt(g.amount)>0n)||BigInt(c.buybackVest.releasable.amount)>0n;d={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){d={unavailable:n.plainError(c)}}return{holder:t,holding:N(e.token,a),pairBalance:N(e.pairToken,s),creatorFees:d,note:"Sell the actual holding shown here, not a quoted output. Balances are read at the status block."}}async function Qe(n,e,t){try{let r=await n.clientFor(l).getBlockNumber({cacheTime:0}),o=await de(n,C(e),r);return t===void 0?o:{...o,account:await ze(n,o,C(t),r)}}catch(r){throw new i(n.plainError(r))}}var Ae="https://ponsfamily.com/api/launches",Ve=n=>{let e=n;return!!e&&Array.isArray(e.items)&&e.items.length<=100&&(e.nextCursor===null||e.nextCursor===void 0||typeof e.nextCursor=="string")&&e.items.every(t=>!!t&&typeof t.address=="string"&&re.test(t.address)&&typeof t.factory=="string"&&re.test(t.factory))};async function Je(n,e){let t=e.limit??20;if(typeof t!="number"||!Number.isInteger(t)||t<1||t>40)throw new i("Choose a search or listing limit from 1 to 40.");let r=new URL(Ae);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(t));let o=await ie(n.http,r,{method:"GET",redirect:"error"},Ve);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,u)),s=[...new Map(a.map(h=>[h.address.toLowerCase(),Ie(h.address)])).values()].slice(0,t),d=await n.clientFor(l).getBlockNumber({cacheTime:0});return{items:await Promise.all(s.map(h=>de(n,h,d))),statusBlock:d.toString(),source:Ae,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(n,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(n,e)}catch(t){throw new i(n.plainError(t))}return Ne(n,e)}async function Ne(n,e={}){try{let t=n.clientFor(l),r=await t.getBlockNumber({cacheTime:0}),o=e.toBlock===void 0?r:H(e.toBlock),a=e.fromBlock===void 0?o>=xe?o-xe+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 d=await t.getLogs({address:u,event:Fe,fromBlock:a,toBlock:o,strict:!0}),c=new Map;for(let y of d.filter(m=>p(m.address,u)&&!m.removed&&m.blockNumber!==null&&m.blockNumber>=a&&m.blockNumber<=o).sort((m,A)=>m.blockNumber===A.blockNumber?(A.logIndex??0)-(m.logIndex??0):m.blockNumber>A.blockNumber?-1:1)){let m=C(y.args.token);c.set(m.toLowerCase(),m)}let h=[...c.values()];return{items:await Promise.all(h.slice(0,s).map(y=>de(n,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(t){throw new i(n.plainError(t))}}async function K(n,e,t,r){let o=(Array.isArray(e)?e:[e]).map(n.unsignedTx),a=await n.preview(o,t),s=a.changes.map(d=>{let c=d.amount.startsWith("-");return`${c?"-":""}${n.formatAmount(c?d.amount.slice(1):d.amount,d.token.decimals)} ${d.token.symbol} (${d.token.chainId}:${d.token.address})`});return{txs:o,preview:a,summary:`${r} ${a.summary}${s.length?` Changes: ${s.join(", ")}.`:""}`}}var V=["twitter","telegram","discord","website","farcaster"],Be=5242880,$e="https://ponsfamily.com/api/ipfs/image";function se(n,e){if(n==="")return"";if(typeof n!="string"||n.length>2048)throw new i(`Provide a public HTTPS or IPFS ${e}.`);try{let t=new URL(n);if(!["https:","ipfs:"].includes(t.protocol)||!t.hostname||t.username||t.password)throw new Error}catch{throw new i(`Provide a public HTTPS or IPFS ${e}.`)}return n}function Xe(n){if(n===void 0)return;if(!n||typeof n!="object"||Array.isArray(n))throw new i("Provide image mimeType and base64.");let e=n,t={"image/png":"png","image/jpeg":"jpg","image/webp":"webp"};if(Object.keys(e).some(s=>!["mimeType","base64"].includes(s))||typeof e.mimeType!="string"||!t[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
2
|
|
|
3
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:t[e.mimeType]}}async function Ye(n,e,t){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 n.clientFor(l).getTransactionReceipt({hash:e});if(o.status!=="success"||!p(o.from,t))throw new i("The Pons launch must be a successful transaction from this wallet.");let a=o.logs.flatMap(c=>{if(!p(c.address,u))return[];try{return[qe({abi:[Fe],data:c.data,topics:c.topics,strict:!0}).args]}catch{return[]}}).filter(c=>p(c.deployer,t));if(a.length!==1)throw new i("The receipt does not contain exactly one Pons launch for this wallet.");let s=a[0].token,d=await X(n,s,o.blockNumber);return{transactionHash:e,token:await Q(n,s,o.blockNumber),curve:d.curve,creator:d.deployer,creatorFeeRecipient:d.creatorFeeRecipient,chainId:l,summary:`Pons launch mined: ${s}. Creator fee recipient ${d.creatorFeeRecipient}. Use pons_status to inspect the launch and pons_claim to collect creator fees.`}}async function Ze(n,e,t){let r=Ce(e.name,"a coin name"),o=Ce(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=C(e.creatorFeeRecipient);if(p(a,S))throw new i("Provide a nonzero creator fee recipient.");if(!p(a,t))throw new i("Pons creator fee recipient must be the signing wallet.");let s=C(e.pairToken??S),d=H(e.launchConfigId??"0"),c=H(e.initialBuy??"0"),h=C(e.buyRecipient??t);if(p(h,S))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,t)&&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 A=e.metadata??["",""],b=e.links??["","","","",""];if(!Array.isArray(A)||A.length!==2||!A.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??A[0],"coin image URI"),_=e.description??A[1];if(typeof _!="string")throw new i("Provide a coin description string.");let P=e.socials;if(P!==void 0&&(!P||typeof P!="object"||Array.isArray(P)||Object.keys(P).some(k=>!V.includes(k))))throw new i("Provide twitter, telegram, discord, website and farcaster social links.");let I=V.map((k,v)=>se(P===void 0?b[v]:P[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(C),U=e.salt??He(crypto.getRandomValues(new Uint8Array(32)));if(typeof U!="string"||!/^0x[0-9a-fA-F]{64}$/.test(U))throw new i("Salt must be 32 hex-encoded bytes.");let $=n.clientFor(l),x=await $.getBlockNumber({cacheTime:0}),[ue,Ee]=await Promise.all([$.readContract({address:u,abi:f,functionName:"canLaunch",args:[t],blockNumber:x}),$.readContract({address:u,abi:f,functionName:"launchConfigCount",blockNumber:x})]);if(!ue)throw new i("This wallet cannot launch on Pons. Ask Pons for launch access and retry when canLaunch is true.");if(d>=Ee)throw new i("Choose an existing Pons launchConfigId using pons_launch_options.");let[Y,W,Le,_e]=await Promise.all([$.readContract({address:u,abi:f,functionName:"launchFee",blockNumber:x}),$.readContract({address:u,abi:f,functionName:"getLaunchConfig",args:[d],blockNumber:x}),$.readContract({address:u,abi:f,functionName:"maxCreatorTaxBps",blockNumber:x}),$.readContract({address:u,abi:f,functionName:"memeHook",blockNumber:x})]);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,S)){let[k,v]=await Promise.all([$.readContract({address:u,abi:f,functionName:"approvedPairTokens",args:[s],blockNumber:x}),$.readContract({address:u,abi:f,functionName:"pairTokenEconomics",args:[s],blockNumber:x})]);if(!k||v[0]<=0n||v[1]<=0n)throw new i("This pair token is not approved with usable Pons economics. Choose a supported pair.");if(L=await Q(n,s,x),v[2]!==L.decimals)throw new i("Pair token decimals disagree with Pons. Ask Pons to refresh pair economics.");[le,pe]=v}if(BigInt(y)>Le)throw new i("Creator tax exceeds the current Pons maximum.");let[Z,ee]=await Promise.all([$.readContract({address:u,abi:f,functionName:"previewLaunchEconomics",args:[d,s],blockNumber:x}),$.readContract({address:_e,abi:De,functionName:"currentFeePolicy",blockNumber:x})]);if(e.expectedEconomics!==void 0&&e.expectedEconomics!==Z)throw new i("Pons launch economics changed. Refresh the launch preview.");let G=Re(W.curveFeeBps,y,ee[1],m,ee[2]),te="";if(w){let k=new FormData;k.append("image",new Blob([w.bytes],{type:w.mimeType}),`coin.${w.extension}`);let v=await ie(n.http,$e,{method:"POST",body:k,redirect:"error"},B=>!!B&&typeof B=="object"&&typeof B.uri=="string");if(T=se(v.uri,"uploaded coin image URI"),!T)throw new i("Pons returned an empty image URI. Retry with a public image URI.");te=`Image (${w.bytes.length} bytes, ${w.mimeType}) uploaded via multipart POST to ${$e}; URI ${F(T)}. This off-chain upload persists even if launch is cancelled or fails; Pons retention/deletion is unknown.`}let ne=k=>{let v=[r,o,T,_,I,a,y,m,Z,U],B={to:c===0n?u:ce,chainId:l,value:(Y+(p(s,S)?c:0n)).toString(),data:c===0n?E.length?M({abi:ae,functionName:"launchToken",args:[v,d,s,E]}):M({abi:ae,functionName:"launchToken",args:[v,d,s]}):M({abi:ae,functionName:"launchAndBuy",args:[v,d,s,c,k,h,E]}),description:`Launch ${F(r)} through the Pons ${c===0n?"factory":"router"} from ${t}; creator fees to ${a}. ${te}`.trim()};return c>0n&&!p(s,S)?[n.approval(s,ce,c.toString(),l),B]:[B]};if(c>0n&&e.minTokensOut===void 0){let v=(await n.preview(ne(0n).map(n.unsignedTx),t)).changes.filter(B=>B.token.chainId===l&&!p(B.token.address,S)&&!p(B.token.address,ye)&&!p(B.token.address,s)&&B.token.decimals===18&&/^\d+$/.test(B.amount)&&BigInt(B.amount)>0n);if(v.length!==1)throw new i("Pons launch preview did not identify a unique initial buy token output.");if(g=BigInt(we(v[0].amount,be)),g<=1n)throw new i("Initial buy minimum must exceed one token base unit.")}let me=await K(n,ne(g),t,`Unsigned Pons launch from ${t}: ${F(r)} (${F(o)}), image ${T?F(T):"none"}, description ${F(_)}, links ${JSON.stringify(Object.fromEntries(V.map((k,v)=>[k,F(I[v])])))}. canLaunch=true at block ${x}; config ${d}, supply ${W.supply}, phantom quote ${le}, graduation threshold ${pe} pair base units. Pair ${L.symbol} (${l}:${L.address}, ${L.decimals} decimals). Initial buy ${n.formatAmount(c.toString(),L.decimals)} ${L.symbol} to ${h}; minimum ${g} token base units (18 decimals). Launch fee ${n.formatAmount(Y.toString(),18)} ETH plus gas; exact transaction value ${ne(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. ${te}`);return{...me,creatorFeeWarning:void 0,preview:{...me.preview,warnings:[]},canLaunch:ue,blockNumber:x.toString(),launchConfigId:d.toString(),pairToken:L,salt:U,logo:T&&F(T),economics:Z,launchFee:N(J,Y),initialBuy:N(L,c),minimum:{amount:g.toString(),decimals:18,token:{chainId:l,address:null,name:F(r),symbol:F(o)},addressStatus:"Read the mined token address with pons_launch transactionHash; the local bridge does this automatically."},fees:G}}async function et(n,e,t){let r=n.clientFor(l),o=await r.getBlockNumber({cacheTime:0}),a=C(e.pairToken??S),[s,d,c,h]=await Promise.all([r.readContract({address:u,abi:f,functionName:"canLaunch",args:[t],blockNumber:o}),r.readContract({address:u,abi:f,functionName:"launchConfigCount",blockNumber:o}),r.readContract({address:u,abi:f,functionName:"launchFee",blockNumber:o}),r.readContract({address:u,abi:f,functionName:"maxCreatorTaxBps",blockNumber:o})]),g=H(e.offset??"0"),y=await Promise.all(Array.from({length:Number(d>g?d-g>100n?100n:d-g:0n)},async(_,P)=>{let I=g+BigInt(P),w=await r.readContract({address:u,abi:f,functionName:"getLaunchConfig",args:[I],blockNumber:o});return{id:I.toString(),...Object.fromEntries(Object.entries(w).map(([q,E])=>[q,typeof E=="bigint"?E.toString():E]))}})),m=p(a,S),[A,b,T]=await Promise.all([m?!0:r.readContract({address:u,abi:f,functionName:"approvedPairTokens",args:[a],blockNumber:o}),m?void 0:r.readContract({address:u,abi:f,functionName:"pairTokenEconomics",args:[a],blockNumber:o}),Q(n,a,o)]);return{chainId:l,factory:u,router:ce,blockNumber:o.toString(),canLaunch:s,launchFee:N(J,c),maxCreatorTaxBps:h.toString(),configs:y,configCount:d.toString(),nextOffset:g+BigInt(y.length)<d?(g+BigInt(y.length)).toString():null,pairToken:T,pairApproved:A&&(!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 Se(n,e,t,r){let o=C(e.token),a=await X(n,o,await n.clientFor(l).getBlockNumber({cacheTime:0}));if(!p(a.creatorFeeRecipient,t))throw new i(`Only the current creator fee recipient ${a.creatorFeeRecipient} can change this setting. Use that wallet.`);if(r){let s=C(e.creatorFeeRecipient);if(p(s,S))throw new i("Provide a nonzero creator fee recipient.");return K(n,{to:u,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}.`},t,`Unsigned Pons fee recipient transfer to ${s}; previously credited fees stay with ${t}. 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(n,{to:u,chainId:l,value:"0",data:M({abi:f,functionName:"setBuybackEnabled",args:[o,e.enabled]}),description:`Turn Pons buybacks ${e.enabled?"on":"off"} for ${o}.`},t,`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 tt=n=>{function e(t,r,o,a){return{name:t,inputSchema:{type:"object",properties:r,required:o,additionalProperties:!1,...t==="pons_launch"?{anyOf:[{required:["transactionHash"]},{required:["name","symbol","creatorFeeRecipient"]}]}:{},...t==="pons_browse"?{allOf:[{if:{anyOf:[{required:["query"]},{required:["cursor"]},{properties:{complete:{description:"Request a complete paginated listing through the Pons index.",const:!0}},required:["complete"]}]},then:{properties:{limit:{description:"Maximum number of results to return, within the stated bounds.",maximum:40}}}}]}:{}},execute:async(s,d)=>{try{C(d);for(let c of Object.keys(s))if(!(c in r))throw new i(`Unknown ${t} input: ${c}.`);return await a(s,d)}catch(c){throw new i(n.plainError(c))}}}}return{tools:[e("pons_browse",{fromBlock:O("First block number of the scan, as a decimal string; inclusive."),toBlock:O("Last block number of the scan, as a decimal string; inclusive."),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."}},[],t=>Ke(n,t)),e("pons_status",{token:{...R,description:"Address of the token to inspect or use."},holder:{...R,description:"Holder address to inspect; defaults to the signing wallet."}},["token"],(t,r)=>Qe(n,C(t.token),C(t.holder??r))),e("pons_launch_options",{pairToken:{...R,description:"Launch pair token address; the zero address means native ETH."},offset:O("Launch configuration list offset, as a decimal string; defaults to zero.")},[],(t,r)=>et(n,t,r)),e("pons_transfer_creator_fee_recipient",{token:{...R,description:"Address of the token to inspect or use."},creatorFeeRecipient:{...R,description:"New nonzero recipient address for future creator fees; use the intended recipient."}},["token","creatorFeeRecipient"],(t,r)=>Se(n,t,r,!0)),e("pons_set_buyback",{token:{...R,description:"Address of the token to inspect or use."},enabled:{description:"Whether to enable creator buybacks.",type:"boolean"}},["token","enabled"],(t,r)=>Se(n,t,r,!1)),e("pons_launch",{name:{description:"Name for the new launch token.",type:"string",minLength:1},symbol:{description:"Symbol for the new launch token.",type:"string",minLength:1},creatorFeeRecipient:{...R,description:"Creator-fee recipient address; must be the nonzero signing wallet."},pairToken:{...R,description:"Launch pair token address; the zero address means native ETH."},launchConfigId:O('Identifier of the Pons launch configuration, as a decimal string, from pons_launch_options. Example: "1".'),buyRecipient:{...R,description:"Recipient address for the initial buy; defaults to the signing wallet and requires initialBuy."},logo:{description:"Public HTTPS or IPFS logo URI, or empty; cannot combine a nonempty logo with image upload.",type:"string"},description:{description:"Plain-text description of the launch token.",type:"string"},socials:{description:"Social links keyed by twitter, telegram, discord, website or farcaster.",type:"object",properties:Object.fromEntries(V.map(t=>[t,{type:"string",description:`Public HTTPS or IPFS URI for the token's ${t} page, or empty.`}])),additionalProperties:!1},image:{description:"Launch image upload with its MIME type and base64-encoded content.",type:"object",properties:{mimeType:{description:"Image content type: PNG, JPEG or WebP.",type:"string",enum:["image/png","image/jpeg","image/webp"]},base64:{description:"Base64-encoded image bytes without a data URL prefix.",type:"string",minLength:1,maxLength:6990508}},required:["mimeType","base64"],additionalProperties:!1},snipeTaxExemptions:{description:"Up to 31 wallet addresses exempt from the launch snipe tax; use intended addresses.",type:"array",items:R,maxItems:31},transactionHash:{description:"Confirmed launch transaction hash as a 32-byte hex string; use to recover a submitted launch.",type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},initialBuy:O('Initial buy amount of pair token in base units; use pair token decimals. Example: "1000000" = 1 pair token at 6 decimals.'),minTokensOut:O('Minimum launch-token output in base units (18 decimals). Example: "1000000000000000000" = 1 launch token.'),creatorTaxBps:{description:"Creator tax in basis points (50 = 0.5%); cannot exceed the current maximum from pons_launch_options.",type:"integer",minimum:0,maximum:65535},buybackEnabled:{description:"Whether creator buybacks are enabled for this launch.",type:"boolean"},expectedEconomics:{description:"Economics hash from the prior pons_launch result, as a 32-byte hex string; confirms changed terms on retry.",type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},salt:{description:"Deployment salt as a 32-byte hex string; choose a fresh value for a new deployment.",type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},metadata:{description:"Legacy metadata tuple: [logo URL, token description].",type:"array",items:{type:"string"},minItems:2,maxItems:2},links:{description:"Legacy social URL tuple: [twitter, telegram, discord, website, farcaster].",type:"array",items:{type:"string"},minItems:5,maxItems:5}},[],(t,r)=>t.transactionHash===void 0?Ze(n,t,r):Ye(n,t.transactionHash,r)),e("pons_graduate",{token:{...R,description:"Address of the token to inspect or use."}},["token"],async(t,r)=>{let o=C(t.token);if((await X(n,o,await n.clientFor(l).getBlockNumber({cacheTime:0}))).phase!==1)throw new i("Graduation requires a launch pending pool creation (phase 1).");return K(n,{to:u,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 t=>{try{C(t);let r=await Ne(n,{limit:100}),o=r.items.filter(a=>p(a.creator,t)||p(a.creatorFeeRecipient,t));return await Promise.all(o.map(async a=>{let s=await n.clientFor(l).readContract({address:a.token.address,abi:j,functionName:"balanceOf",args:[t],blockNumber:BigInt(a.blockNumber)});return{module:"pons",id:`${l}:${a.token.address}`,chainId:l,assets:[N(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(n.plainError(r))}}}},pt=tt;export{X as a,de as b,Qe as c,Ke as d,tt as e,pt as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as k,g as F,i as M,n as _,o as w,p as z}from"./
|
|
1
|
+
import{f as k,g as F,i as M,n as _,o as w,p as z}from"./H3E7UD2X.js";import{$ as N,U as A,Z as T,_ as I,aa as O,b as s,ba as W,ca as y,da as D,ea as R,fa as S,ga as x,ha as U,ia as b,ja as B,ka as C}from"./V5YSJKRH.js";import{getAddress as H,isAddress as G}from"viem";function K(e){if(e==null)return;let r=e instanceof Date?e.getTime()/1e3:typeof e=="string"?/^\d{1,12}$/.test(e)?Number(e):Date.parse(e)/1e3:e;return typeof r=="number"&&Number.isFinite(r)?Math.floor(r):void 0}var a=e=>typeof e=="number"&&Number.isFinite(e),$=e=>w(e).replace(/\.?0+$/,"");function j(e){let r=e.nowSec??Math.floor(Date.now()/1e3),f=K(e.endDate),i=a(e.apr)&&e.apr>=0?e.apr:void 0,o=a(e.amountUsd)&&e.amountUsd>0?e.amountUsd:void 0,g={addButton:U,declineButton:b};if(i===void 0||f===void 0||f<=r)return{text:s(x,{}),readable:!1,notWorth:!0,defaultButton:b,...g};let l=z(f),u=[s(I,{apr:$(i),end_date:l})];e.outOfRangeIncentivized===!1&&u.push(s(N,{})),a(e.feeWeightPct)&&e.feeWeightPct>0&&e.feeWeightPct<=100&&u.push(s(O,{w:$(e.feeWeightPct)}));let d=!1,c=[];if(o!==void 0){let n=(f-r)/86400,t=M({amountUsd:o,ratePct:i,days:n}),m=k(e.gasUsd);d=F({gross:t,costs:m.usd,amount:o}).tooSmall,u.push(s(W,{amount_usd:_(o),per_day_usd:_(o*i/100/365),gross_usd:_(t),end_date:l}),s(y,{gas_usd:_(m.usd)})),d&&c.push(s(S,{})),m.estimatedHigh&&c.push(s(A,{}))}u.push(s(D,{}),...c);let p=typeof e.creator=="string"&&G(e.creator,{strict:!1})?H(e.creator):void 0;return{text:s(T,{worth_line:u.join(" "),funder_line:p?`${s(R,{creator:p})}
|
|
2
2
|
`:"",end_date:l}),readable:!0,notWorth:d,...d?{defaultButton:b}:{},...g}}function X(e){return j(e).text}function Y(e){let r=a(e)&&e>0?s(C,{time:new Date(e*1e3).toISOString().slice(0,16).replace("T"," ")}):"";return s(B,{last_update_clause:r})}var h=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),E=e=>{if(a(e)&&Number.isSafeInteger(e)&&e>0)return e;if(typeof e=="string"&&/^\d{1,12}$/.test(e))return Number(e)};function P(e){if(!(e.length===0||e.some(r=>r===void 0)))return e.every(r=>r===e[0])?e[0]:void 0}function Z(e,r,f=4663){if(!Array.isArray(e))return{live:0};let i=e.filter(h).filter(n=>{if(n.distributionChainId!==void 0&&Number(n.distributionChainId)!==f)return!1;let t=E(n.startTimestamp),m=E(n.endTimestamp);return m!==void 0&&m>r&&(t===void 0||t<=r)});if(i.length===0)return{live:0};let o=i.map(n=>a(n.apr)&&n.apr>=0?n.apr:void 0),g=i.map(n=>h(n.params)?n.params:{}),l=g.map(n=>{let t=typeof n.weightFees=="string"&&/^\d{1,5}$/.test(n.weightFees)?Number(n.weightFees):n.weightFees;return a(t)&&Number.isInteger(t)&&t>=0&&t<=1e4?t/100:void 0}),u=i.map(n=>{let t=typeof n.creatorAddress=="string"?n.creatorAddress:h(n.creator)&&typeof n.creator.address=="string"?n.creator.address:void 0;return t!==void 0&&G(t,{strict:!1})?H(t):void 0}),d={live:i.length,endsAt:Math.min(...i.map(n=>E(n.endTimestamp)))};o.every(a)&&(d.aprPct=o.reduce((n,t)=>n+t,0));let c=P(g.map(n=>typeof n.isOutOfRangeIncentivized=="boolean"?n.isOutOfRangeIncentivized:void 0));c!==void 0&&(d.outOfRangeIncentivized=c);let p=P(l);p!==void 0&&(d.feeWeightPct=p);let L=P(u);return L!==void 0&&(d.creator=L),d}export{j as a,X as b,Y as c,Z as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H}from"./66F5ZH34.js";import{c as B,f as j,g as b,k as F,n as G}from"./NWNYJ26T.js";import{a as k,i as z}from"./FWD4L3CJ.js";import{a}from"./XSD5NL7J.js";import{encodeFunctionData as Q,erc20Abi as O,parseAbi as oe,zeroHash as J}from"viem";var ne=z[k].meridian,S=ne.PredictionMarketEscrow.address,T={address:ne.CollateralToken_USDe.address,chainId:k,symbol:"USDe",decimals:18},se="https://api.predict.meridian.xyz/graphql",ae="query GetOpenConditions($now: Int!, $first: Int!, $after: String, $search: String, $conditionIds: [Bytes!], $resolvers: [Address!]) { conditions(first: $first, after: $after, filter: { chainId: 4663, settled: false, public: true, endTime: { gte: $now }, search: $search, conditionIds: $conditionIds, resolvers: $resolvers }) { totalCount pageInfo { hasNextPage endCursor } nodes { conditionId resolver question shortName optionName endTime estimatedPrice openInterest similarMarketVolume24h marketType } } }",de="query GetHolderPositions($holder: Address!, $first: Int!, $after: String) { positions(first: $first, after: $after, filter: { holder: $holder, chainId: 4663 }, orderBy: { field: CREATED_AT, direction: DESC }) { totalCount pageInfo { hasNextPage endCursor } nodes { id chainId holder side balance tokenAddress: token pickConfigId userCollateral totalPayout prediction { predictionId } pickConfig { pickConfigId marketAddress: escrow resolved result } } } }",U=oe(["function getClaimableAmount(bytes32 pickConfigId, address positionToken, uint256 tokenAmount) view returns (uint256)","function settle(bytes32 predictionId, bytes32 refCode)","function redeem(address positionToken, uint256 amount, bytes32 refCode) returns (uint256)"]),K={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},V={type:"string",minLength:1,maxLength:4096,description:"Opaque nextCursor returned by the previous page."},E=25,W={type:"integer",minimum:1,maximum:E},ce=1e3;function Y(e,p){if(e===void 0)return p;if(!Number.isSafeInteger(e)||e<1||e>E)throw new a("Provide a Meridian page limit from 1 to 25.");return e}function Z(e){if(e===void 0)return;let p=()=>new a("Provide the opaque Meridian nextCursor returned by the previous page.");if(typeof e!="string"||e.length>4096||!/^[A-Za-z0-9+/_-]+={0,2}$/.test(e))throw p();try{let c=Buffer.from(e,"base64url");if(c.toString("base64url")!==e.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_"))throw p();let m=C(JSON.parse(c.toString("utf8")));if(typeof m.k!="string"||!m.k||typeof m.id!="string"||!m.id)throw p()}catch{throw p()}return e}function X(e,p,c,m=!1){let l=C(e),f=C(l.pageInfo),P=Array.isArray(l.nodes)?l.nodes.filter(q=>!m||N(C(q).balance)!=="0").length:0;if(!Array.isArray(l.nodes)||l.nodes.length>p||!Number.isSafeInteger(l.totalCount)||l.totalCount<P||typeof f.hasNextPage!="boolean"||c===void 0&&!f.hasNextPage&&l.totalCount>l.nodes.length||f.endCursor!==null&&(typeof f.endCursor!="string"||!f.endCursor.trim()||f.endCursor.length>4096)||f.hasNextPage&&(l.nodes.length===0||f.endCursor===null||f.endCursor===c))throw new a("Meridian returned invalid pagination; retry the scan from the first page.");return{nodes:l.nodes,totalCount:l.totalCount,nextCursor:f.hasNextPage?f.endCursor:null,complete:!f.hasNextPage&&c===void 0}}function C(e){return j(e,"Meridian returned an unexpected response.")}function A(e){if(typeof e!="string"||!e.trim())throw new a("Meridian returned an invalid text field.");return e}function I(e){return F(e,"Provide a valid Meridian contract or wallet address.")}function v(e){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new a("Provide a valid Meridian prediction or pick configuration ID.");return e}function R(e){return G(e,"Meridian amount exceeds the uint256 range.",{notString:"Meridian amounts must be integer strings in base units."}).toString()}function N(e){return e===0?"0":R(e)}function D(e){if(typeof e!="bigint"||e<0n)throw new a("Meridian returned an invalid on-chain amount.");return R(e.toString())}function ue(e,p){return e.chainId===p.chainId&&b(e.address,p.address)}function ee(e,p){let c=C(e),m=C(c.pickConfig),l=I(c.holder),f=I(m.marketAddress);if(c.chainId!==k||!b(l,p))throw new a("Meridian returned a position for a different wallet or chain.");if(!b(f,S))throw new a("This Meridian position uses an unsupported escrow contract.");if(typeof m.resolved!="boolean"||m.result!==null&&typeof m.result!="string")throw new a("Meridian returned an invalid resolution.");let P=v(c.pickConfigId);if(!b(v(m.pickConfigId),P))throw new a("Meridian returned mismatched pick configuration IDs.");if(c.side!=="PREDICTOR"&&c.side!=="COUNTERPARTY")throw new a("Meridian returned an invalid position side.");return{id:A(c.id),chainId:k,holder:l,side:c.side,balance:N(c.balance),tokenAddress:I(c.tokenAddress),pickConfigId:P,userCollateral:N(c.userCollateral),totalPayout:N(c.totalPayout),prediction:{predictionId:v(C(c.prediction).predictionId)},pickConfig:{pickConfigId:P,marketAddress:f,resolved:m.resolved,result:m.result}}}var le=e=>{async function p(t){try{return await t()}catch(o){throw new a(e.plainError(o))}}async function c(){let t=e.clientFor(k);if(await t.getChainId()!==k)throw new a("Meridian requires an RPC on chain 4663.");return t}async function m(t,o,r){let s=new URL(se);s.searchParams.set("op",t),s.searchParams.set("query",o),s.searchParams.set("variables",JSON.stringify(r));let n=await e.http(s.toString(),{method:"GET",headers:{Accept:"application/json"}});if(!n.ok)throw new a(`Meridian returned HTTP ${n.status}. Please try again.`);let u;try{u=await n.json()}catch{throw new a("Meridian returned malformed JSON.")}let d=C(u);if(d.errors!==void 0&&(!Array.isArray(d.errors)||d.errors.length>0))throw new a("Meridian could not complete the GraphQL query. Please try again.");return C(d.data)}async function l(t,o=10,r){I(t);let s=await m("GetHolderPositions",de,{holder:t,first:o,...r===void 0?{}:{after:r}});return X(s.positions,o,r,!0)}async function f(t,o){let r=[],s=new Set,n=new Set,u,d,h=0;for(let g=0;g<ce;g++){let w=await l(t,E,u);if(d!==void 0&&d!==w.totalCount)throw new a("Meridian positions changed during pagination; retry from the first page.");d=w.totalCount;for(let x of w.nodes){let i=C(x),y=A(i.id);if(n.has(y))throw new a("Meridian repeated a position during pagination; retry from the first page.");n.add(y),N(i.balance)!=="0"&&h++,(o===void 0||b(I(i.tokenAddress),o))&&r.push(ee(x,t))}if(w.nextCursor===null){if(h>d||n.size<d)throw new a("Meridian returned an incomplete positions scan; retry from the first page.");return r}if(s.has(w.nextCursor))throw new a("Meridian repeated a cursor; retry from the first page.");s.add(w.nextCursor),u=w.nextCursor}throw new a("Meridian positions scan exceeded 1000 pages. Use meridian_positions with limit and cursor to inspect pages; redeem a known settled positionToken directly.")}async function P(t,o){if(t.length===0)return[];let r=await c();return(await Promise.all(t.map(async n=>{let[u,d,h]=await Promise.all([r.readContract({address:n.tokenAddress,abi:O,functionName:"balanceOf",args:[o]}),r.readContract({address:n.tokenAddress,abi:O,functionName:"decimals"}),r.readContract({address:n.tokenAddress,abi:O,functionName:"symbol"})]);if(!Number.isInteger(d)||d<0||d>255)throw new a("Meridian returned invalid position token decimals.");let g={address:n.tokenAddress,chainId:k,decimals:d,symbol:A(h)},w=D(u),x=n.pickConfig.resolved?{token:{...T},amount:D(await r.readContract({address:S,abi:U,functionName:"getClaimableAmount",args:[n.pickConfigId,n.tokenAddress,BigInt(w)]}))}:null;return{module:"meridian",id:n.id,chainId:k,assets:[{token:g,amount:w}],description:`Meridian ${n.side.toLowerCase()} position; ${n.pickConfig.resolved?n.pickConfig.result??"resolved":"unresolved"}.`,holder:n.holder,side:n.side,pickConfigId:n.pickConfigId,prediction:n.prediction,pickConfig:n.pickConfig,userCollateral:{token:{...T},amount:n.userCollateral},totalPayout:{token:{...T},amount:n.totalPayout},claimable:x}}))).filter(n=>BigInt(n.assets[0].amount)>0n)}async function q(t){return P(await f(t),t)}function _(t){return e.unsignedTx({to:S,chainId:k,value:"0",data:Q({abi:U,functionName:"settle",args:[t,J]}),description:`Settle Meridian prediction ${t}.`})}function L(t,o,r){let s=o.changes.map(n=>{let u=n.amount.startsWith("-"),d=e.formatAmount(u?n.amount.slice(1):n.amount,n.token.decimals);return`${u?"-":"+"}${d} ${n.token.symbol} (${n.token.address}, chain ${n.token.chainId})`});return{txs:t,preview:o,summary:`${r} ${o.summary}${s.length?` Changes: ${s.join("; ")}.`:""}`}}async function te(t){let o=Y(t.limit,20),r=Z(t.cursor);if(r!==void 0&&t.asOf===void 0)throw new a("Pass the previous Meridian browse asOf with cursor to keep the same time filter.");let s=t.asOf===void 0?Math.floor(Date.now()/1e3):Number(R(t.asOf));if(!Number.isSafeInteger(s)||s<0||s>2147483647)throw new a("Provide Meridian asOf as Unix seconds within the GraphQL Int range.");let n;if(t.search!==void 0&&(n=A(t.search).trim(),n.length>500))throw new a("Keep the Meridian market search to 500 characters.");let u=t.conditionId===void 0?void 0:v(t.conditionId),d=t.resolver===void 0?void 0:I(t.resolver),h=await m("GetOpenConditions",ae,{now:s,first:o,...r===void 0?{}:{after:r},...n===void 0?{}:{search:n},...u===void 0?{}:{conditionIds:[u]},...d===void 0?{}:{resolvers:[d]}}),g=X(h.conditions,o,r),w=g.nodes.map(x=>{let i=C(x);if(!Number.isSafeInteger(i.endTime)||i.endTime<0||i.estimatedPrice!==null&&(typeof i.estimatedPrice!="number"||!Number.isFinite(i.estimatedPrice)||i.estimatedPrice<0||i.estimatedPrice>1))throw new a("Meridian returned invalid market pricing or time.");let y=v(i.conditionId),M=I(i.resolver);if(u!==void 0&&!b(y,u)||d!==void 0&&!b(M,d))throw new a("Meridian returned a different condition or resolver than requested.");return{conditionId:y,resolver:M,question:A(i.question),shortName:i.shortName===null?null:A(i.shortName),optionName:i.optionName===null?null:A(i.optionName),endTime:String(i.endTime),estimatedPrice:i.estimatedPrice===null?null:String(i.estimatedPrice),marketType:i.marketType===null?null:A(i.marketType)}});return{chainId:k,collateral:{...T},totalCount:g.totalCount,markets:w,limit:o,nextCursor:g.nextCursor,complete:g.complete,asOf:String(s)}}async function ie(t,o){let r=I(t.positionToken),s=R(t.amount);if(BigInt(s)===0n)throw new a("Provide a positive Meridian redemption amount.");let n=await c(),u=D(await n.readContract({address:r,abi:O,functionName:"balanceOf",args:[o]}));if(BigInt(s)>BigInt(u))throw new a("The redemption amount exceeds the wallet position balance.");let d=e.unsignedTx({to:S,chainId:k,value:"0",data:Q({abi:U,functionName:"redeem",args:[r,BigInt(s),J]}),description:`Redeem ${s} Meridian position base units for USDe.`}),h=[d],g;try{g=await e.preview(h,o)}catch(i){if(!/\breverted\b/i.test(e.plainError(i)))throw i;let y=await f(o,r);if(y.length!==1)throw new a("Direct Meridian redemption reverted and no unique indexed prediction was found for this token. Retry indexing or use meridian_settle with the known predictionId first.");let M=y[0];if(M.pickConfig.resolved){let re=D(await n.readContract({address:S,abi:U,functionName:"getClaimableAmount",args:[M.pickConfigId,r,BigInt(s)]}));if(BigInt(re)===0n)throw i}h=[_(M.prediction.predictionId),d],g=await e.preview(h,o)}let w=g.changes.filter(i=>ue(i.token,T)&&i.token.decimals===T.decimals).reduce((i,y)=>i+BigInt(y.amount),0n),x=g.changes.filter(i=>i.token.chainId===k&&b(i.token.address,r)).reduce((i,y)=>i+BigInt(y.amount),0n);if(w<=0n||x!==-BigInt(s))throw new a("Meridian preview did not show the requested position burn and a positive USDe payout.");return L(h,g,h.length===2?"Settle the prediction, then redeem for USDe. Unsigned transactions only.":"Redeem the position for USDe. Unsigned transaction only.")}function $(t,o,r,s,n){return{name:t,inputSchema:{type:"object",properties:o,required:r,additionalProperties:!1,description:s},execute:(u,d)=>p(async()=>{if(C(u),I(d),Object.keys(u).some(h=>!Object.hasOwn(o,h))||r.some(h=>u[h]===void 0))throw new a("Provide only the required Meridian tool inputs.");return n(u,d)})}}return{tools:[$("meridian_browse",{search:{type:"string",minLength:1,maxLength:500,description:"Search text for open conditions."},cursor:V,limit:{...W,description:"Maximum results per page, from 1 to 25."},conditionId:{...K,description:"Condition identifier as a 0x-prefixed 32-byte hex string."},resolver:{...B,description:"Condition resolver contract address on chain 4663."},asOf:H("Reuse the returned Unix seconds with cursor.")},[],"Search open Meridian conditions or look up a conditionId/resolver. Follow nextCursor with the same filters and asOf.",te),$("meridian_positions",{cursor:V,limit:{...W,description:"Maximum results per page, from 1 to 25."}},[],"Page through indexed Meridian positions with on-chain balances and claimability. Follow nextCursor until null; indexing can lag transfers.",async(t,o)=>{let r=Y(t.limit,10),s=Z(t.cursor),n=await l(o,r,s);return{positions:await P(n.nodes.map(u=>ee(u,o)),o),totalCount:n.totalCount,limit:r,nextCursor:n.nextCursor,complete:n.complete,scope:"Indexed positions with current on-chain balances. Index totalCount may exclude zero-balance rows. Indexing can lag transfers; redeem known settled tokens directly."}}),$("meridian_settle",{predictionId:{...K,description:"Prediction identifier as a 0x-prefixed 32-byte hex string."}},["predictionId"],"Preview an unsigned unilateral settlement; unresolved or already settled predictions may revert.",async(t,o)=>{let r=_(v(t.predictionId));await c();let s=[r];return L(s,await e.preview(s,o),"Settle the Meridian prediction. Unsigned transaction only.")}),$("meridian_redeem",{positionToken:{...B,description:"Meridian position token contract address on chain 4663."},amount:H('Position token amount in base units using its decimals; for an 18-decimal position token, "1000000000000000000" = 1 position token.')},["positionToken","amount"],"Preview redemption of a known position token directly; scan all indexed pages for settlement first if required. No approval or typed signature.",ie)],positions:t=>p(()=>q(t))}},we=le;export{le as a,we as b};
|
|
1
|
+
import{a as H}from"./66F5ZH34.js";import{c as B,f as j,g as b,k as F,n as G}from"./NWNYJ26T.js";import{b as k,j as z}from"./TI727O2H.js";import{a}from"./XSD5NL7J.js";import{encodeFunctionData as Q,erc20Abi as O,parseAbi as oe,zeroHash as J}from"viem";var ne=z[k].meridian,S=ne.PredictionMarketEscrow.address,T={address:ne.CollateralToken_USDe.address,chainId:k,symbol:"USDe",decimals:18},se="https://api.predict.meridian.xyz/graphql",ae="query GetOpenConditions($now: Int!, $first: Int!, $after: String, $search: String, $conditionIds: [Bytes!], $resolvers: [Address!]) { conditions(first: $first, after: $after, filter: { chainId: 4663, settled: false, public: true, endTime: { gte: $now }, search: $search, conditionIds: $conditionIds, resolvers: $resolvers }) { totalCount pageInfo { hasNextPage endCursor } nodes { conditionId resolver question shortName optionName endTime estimatedPrice openInterest similarMarketVolume24h marketType } } }",de="query GetHolderPositions($holder: Address!, $first: Int!, $after: String) { positions(first: $first, after: $after, filter: { holder: $holder, chainId: 4663 }, orderBy: { field: CREATED_AT, direction: DESC }) { totalCount pageInfo { hasNextPage endCursor } nodes { id chainId holder side balance tokenAddress: token pickConfigId userCollateral totalPayout prediction { predictionId } pickConfig { pickConfigId marketAddress: escrow resolved result } } } }",U=oe(["function getClaimableAmount(bytes32 pickConfigId, address positionToken, uint256 tokenAmount) view returns (uint256)","function settle(bytes32 predictionId, bytes32 refCode)","function redeem(address positionToken, uint256 amount, bytes32 refCode) returns (uint256)"]),K={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},V={type:"string",minLength:1,maxLength:4096,description:"Opaque nextCursor returned by the previous page."},E=25,W={type:"integer",minimum:1,maximum:E},ce=1e3;function Y(e,p){if(e===void 0)return p;if(!Number.isSafeInteger(e)||e<1||e>E)throw new a("Provide a Meridian page limit from 1 to 25.");return e}function Z(e){if(e===void 0)return;let p=()=>new a("Provide the opaque Meridian nextCursor returned by the previous page.");if(typeof e!="string"||e.length>4096||!/^[A-Za-z0-9+/_-]+={0,2}$/.test(e))throw p();try{let c=Buffer.from(e,"base64url");if(c.toString("base64url")!==e.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_"))throw p();let m=C(JSON.parse(c.toString("utf8")));if(typeof m.k!="string"||!m.k||typeof m.id!="string"||!m.id)throw p()}catch{throw p()}return e}function X(e,p,c,m=!1){let l=C(e),f=C(l.pageInfo),P=Array.isArray(l.nodes)?l.nodes.filter(q=>!m||N(C(q).balance)!=="0").length:0;if(!Array.isArray(l.nodes)||l.nodes.length>p||!Number.isSafeInteger(l.totalCount)||l.totalCount<P||typeof f.hasNextPage!="boolean"||c===void 0&&!f.hasNextPage&&l.totalCount>l.nodes.length||f.endCursor!==null&&(typeof f.endCursor!="string"||!f.endCursor.trim()||f.endCursor.length>4096)||f.hasNextPage&&(l.nodes.length===0||f.endCursor===null||f.endCursor===c))throw new a("Meridian returned invalid pagination; retry the scan from the first page.");return{nodes:l.nodes,totalCount:l.totalCount,nextCursor:f.hasNextPage?f.endCursor:null,complete:!f.hasNextPage&&c===void 0}}function C(e){return j(e,"Meridian returned an unexpected response.")}function A(e){if(typeof e!="string"||!e.trim())throw new a("Meridian returned an invalid text field.");return e}function I(e){return F(e,"Provide a valid Meridian contract or wallet address.")}function v(e){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new a("Provide a valid Meridian prediction or pick configuration ID.");return e}function R(e){return G(e,"Meridian amount exceeds the uint256 range.",{notString:"Meridian amounts must be integer strings in base units."}).toString()}function N(e){return e===0?"0":R(e)}function D(e){if(typeof e!="bigint"||e<0n)throw new a("Meridian returned an invalid on-chain amount.");return R(e.toString())}function ue(e,p){return e.chainId===p.chainId&&b(e.address,p.address)}function ee(e,p){let c=C(e),m=C(c.pickConfig),l=I(c.holder),f=I(m.marketAddress);if(c.chainId!==k||!b(l,p))throw new a("Meridian returned a position for a different wallet or chain.");if(!b(f,S))throw new a("This Meridian position uses an unsupported escrow contract.");if(typeof m.resolved!="boolean"||m.result!==null&&typeof m.result!="string")throw new a("Meridian returned an invalid resolution.");let P=v(c.pickConfigId);if(!b(v(m.pickConfigId),P))throw new a("Meridian returned mismatched pick configuration IDs.");if(c.side!=="PREDICTOR"&&c.side!=="COUNTERPARTY")throw new a("Meridian returned an invalid position side.");return{id:A(c.id),chainId:k,holder:l,side:c.side,balance:N(c.balance),tokenAddress:I(c.tokenAddress),pickConfigId:P,userCollateral:N(c.userCollateral),totalPayout:N(c.totalPayout),prediction:{predictionId:v(C(c.prediction).predictionId)},pickConfig:{pickConfigId:P,marketAddress:f,resolved:m.resolved,result:m.result}}}var le=e=>{async function p(t){try{return await t()}catch(o){throw new a(e.plainError(o))}}async function c(){let t=e.clientFor(k);if(await t.getChainId()!==k)throw new a("Meridian requires an RPC on chain 4663.");return t}async function m(t,o,r){let s=new URL(se);s.searchParams.set("op",t),s.searchParams.set("query",o),s.searchParams.set("variables",JSON.stringify(r));let n=await e.http(s.toString(),{method:"GET",headers:{Accept:"application/json"}});if(!n.ok)throw new a(`Meridian returned HTTP ${n.status}. Please try again.`);let u;try{u=await n.json()}catch{throw new a("Meridian returned malformed JSON.")}let d=C(u);if(d.errors!==void 0&&(!Array.isArray(d.errors)||d.errors.length>0))throw new a("Meridian could not complete the GraphQL query. Please try again.");return C(d.data)}async function l(t,o=10,r){I(t);let s=await m("GetHolderPositions",de,{holder:t,first:o,...r===void 0?{}:{after:r}});return X(s.positions,o,r,!0)}async function f(t,o){let r=[],s=new Set,n=new Set,u,d,h=0;for(let g=0;g<ce;g++){let w=await l(t,E,u);if(d!==void 0&&d!==w.totalCount)throw new a("Meridian positions changed during pagination; retry from the first page.");d=w.totalCount;for(let x of w.nodes){let i=C(x),y=A(i.id);if(n.has(y))throw new a("Meridian repeated a position during pagination; retry from the first page.");n.add(y),N(i.balance)!=="0"&&h++,(o===void 0||b(I(i.tokenAddress),o))&&r.push(ee(x,t))}if(w.nextCursor===null){if(h>d||n.size<d)throw new a("Meridian returned an incomplete positions scan; retry from the first page.");return r}if(s.has(w.nextCursor))throw new a("Meridian repeated a cursor; retry from the first page.");s.add(w.nextCursor),u=w.nextCursor}throw new a("Meridian positions scan exceeded 1000 pages. Use meridian_positions with limit and cursor to inspect pages; redeem a known settled positionToken directly.")}async function P(t,o){if(t.length===0)return[];let r=await c();return(await Promise.all(t.map(async n=>{let[u,d,h]=await Promise.all([r.readContract({address:n.tokenAddress,abi:O,functionName:"balanceOf",args:[o]}),r.readContract({address:n.tokenAddress,abi:O,functionName:"decimals"}),r.readContract({address:n.tokenAddress,abi:O,functionName:"symbol"})]);if(!Number.isInteger(d)||d<0||d>255)throw new a("Meridian returned invalid position token decimals.");let g={address:n.tokenAddress,chainId:k,decimals:d,symbol:A(h)},w=D(u),x=n.pickConfig.resolved?{token:{...T},amount:D(await r.readContract({address:S,abi:U,functionName:"getClaimableAmount",args:[n.pickConfigId,n.tokenAddress,BigInt(w)]}))}:null;return{module:"meridian",id:n.id,chainId:k,assets:[{token:g,amount:w}],description:`Meridian ${n.side.toLowerCase()} position; ${n.pickConfig.resolved?n.pickConfig.result??"resolved":"unresolved"}.`,holder:n.holder,side:n.side,pickConfigId:n.pickConfigId,prediction:n.prediction,pickConfig:n.pickConfig,userCollateral:{token:{...T},amount:n.userCollateral},totalPayout:{token:{...T},amount:n.totalPayout},claimable:x}}))).filter(n=>BigInt(n.assets[0].amount)>0n)}async function q(t){return P(await f(t),t)}function _(t){return e.unsignedTx({to:S,chainId:k,value:"0",data:Q({abi:U,functionName:"settle",args:[t,J]}),description:`Settle Meridian prediction ${t}.`})}function L(t,o,r){let s=o.changes.map(n=>{let u=n.amount.startsWith("-"),d=e.formatAmount(u?n.amount.slice(1):n.amount,n.token.decimals);return`${u?"-":"+"}${d} ${n.token.symbol} (${n.token.address}, chain ${n.token.chainId})`});return{txs:t,preview:o,summary:`${r} ${o.summary}${s.length?` Changes: ${s.join("; ")}.`:""}`}}async function te(t){let o=Y(t.limit,20),r=Z(t.cursor);if(r!==void 0&&t.asOf===void 0)throw new a("Pass the previous Meridian browse asOf with cursor to keep the same time filter.");let s=t.asOf===void 0?Math.floor(Date.now()/1e3):Number(R(t.asOf));if(!Number.isSafeInteger(s)||s<0||s>2147483647)throw new a("Provide Meridian asOf as Unix seconds within the GraphQL Int range.");let n;if(t.search!==void 0&&(n=A(t.search).trim(),n.length>500))throw new a("Keep the Meridian market search to 500 characters.");let u=t.conditionId===void 0?void 0:v(t.conditionId),d=t.resolver===void 0?void 0:I(t.resolver),h=await m("GetOpenConditions",ae,{now:s,first:o,...r===void 0?{}:{after:r},...n===void 0?{}:{search:n},...u===void 0?{}:{conditionIds:[u]},...d===void 0?{}:{resolvers:[d]}}),g=X(h.conditions,o,r),w=g.nodes.map(x=>{let i=C(x);if(!Number.isSafeInteger(i.endTime)||i.endTime<0||i.estimatedPrice!==null&&(typeof i.estimatedPrice!="number"||!Number.isFinite(i.estimatedPrice)||i.estimatedPrice<0||i.estimatedPrice>1))throw new a("Meridian returned invalid market pricing or time.");let y=v(i.conditionId),M=I(i.resolver);if(u!==void 0&&!b(y,u)||d!==void 0&&!b(M,d))throw new a("Meridian returned a different condition or resolver than requested.");return{conditionId:y,resolver:M,question:A(i.question),shortName:i.shortName===null?null:A(i.shortName),optionName:i.optionName===null?null:A(i.optionName),endTime:String(i.endTime),estimatedPrice:i.estimatedPrice===null?null:String(i.estimatedPrice),marketType:i.marketType===null?null:A(i.marketType)}});return{chainId:k,collateral:{...T},totalCount:g.totalCount,markets:w,limit:o,nextCursor:g.nextCursor,complete:g.complete,asOf:String(s)}}async function ie(t,o){let r=I(t.positionToken),s=R(t.amount);if(BigInt(s)===0n)throw new a("Provide a positive Meridian redemption amount.");let n=await c(),u=D(await n.readContract({address:r,abi:O,functionName:"balanceOf",args:[o]}));if(BigInt(s)>BigInt(u))throw new a("The redemption amount exceeds the wallet position balance.");let d=e.unsignedTx({to:S,chainId:k,value:"0",data:Q({abi:U,functionName:"redeem",args:[r,BigInt(s),J]}),description:`Redeem ${s} Meridian position base units for USDe.`}),h=[d],g;try{g=await e.preview(h,o)}catch(i){if(!/\breverted\b/i.test(e.plainError(i)))throw i;let y=await f(o,r);if(y.length!==1)throw new a("Direct Meridian redemption reverted and no unique indexed prediction was found for this token. Retry indexing or use meridian_settle with the known predictionId first.");let M=y[0];if(M.pickConfig.resolved){let re=D(await n.readContract({address:S,abi:U,functionName:"getClaimableAmount",args:[M.pickConfigId,r,BigInt(s)]}));if(BigInt(re)===0n)throw i}h=[_(M.prediction.predictionId),d],g=await e.preview(h,o)}let w=g.changes.filter(i=>ue(i.token,T)&&i.token.decimals===T.decimals).reduce((i,y)=>i+BigInt(y.amount),0n),x=g.changes.filter(i=>i.token.chainId===k&&b(i.token.address,r)).reduce((i,y)=>i+BigInt(y.amount),0n);if(w<=0n||x!==-BigInt(s))throw new a("Meridian preview did not show the requested position burn and a positive USDe payout.");return L(h,g,h.length===2?"Settle the prediction, then redeem for USDe. Unsigned transactions only.":"Redeem the position for USDe. Unsigned transaction only.")}function $(t,o,r,s,n){return{name:t,inputSchema:{type:"object",properties:o,required:r,additionalProperties:!1,description:s},execute:(u,d)=>p(async()=>{if(C(u),I(d),Object.keys(u).some(h=>!Object.hasOwn(o,h))||r.some(h=>u[h]===void 0))throw new a("Provide only the required Meridian tool inputs.");return n(u,d)})}}return{tools:[$("meridian_browse",{search:{type:"string",minLength:1,maxLength:500,description:"Search text for open conditions."},cursor:V,limit:{...W,description:"Maximum results per page, from 1 to 25."},conditionId:{...K,description:"Condition identifier as a 0x-prefixed 32-byte hex string."},resolver:{...B,description:"Condition resolver contract address on chain 4663."},asOf:H("Reuse the returned Unix seconds with cursor.")},[],"Search open Meridian conditions or look up a conditionId/resolver. Follow nextCursor with the same filters and asOf.",te),$("meridian_positions",{cursor:V,limit:{...W,description:"Maximum results per page, from 1 to 25."}},[],"Page through indexed Meridian positions with on-chain balances and claimability. Follow nextCursor until null; indexing can lag transfers.",async(t,o)=>{let r=Y(t.limit,10),s=Z(t.cursor),n=await l(o,r,s);return{positions:await P(n.nodes.map(u=>ee(u,o)),o),totalCount:n.totalCount,limit:r,nextCursor:n.nextCursor,complete:n.complete,scope:"Indexed positions with current on-chain balances. Index totalCount may exclude zero-balance rows. Indexing can lag transfers; redeem known settled tokens directly."}}),$("meridian_settle",{predictionId:{...K,description:"Prediction identifier as a 0x-prefixed 32-byte hex string."}},["predictionId"],"Preview an unsigned unilateral settlement; unresolved or already settled predictions may revert.",async(t,o)=>{let r=_(v(t.predictionId));await c();let s=[r];return L(s,await e.preview(s,o),"Settle the Meridian prediction. Unsigned transaction only.")}),$("meridian_redeem",{positionToken:{...B,description:"Meridian position token contract address on chain 4663."},amount:H('Position token amount in base units using its decimals; for an 18-decimal position token, "1000000000000000000" = 1 position token.')},["positionToken","amount"],"Preview redemption of a known position token directly; scan all indexed pages for settlement first if required. No approval or typed signature.",ie)],positions:t=>p(()=>q(t))}},we=le;export{le as a,we as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as G,d as V,g as W,l as _,m as Q}from"./NV6FDIYT.js";import{a as K}from"./Y2QADJOB.js";import{b as P}from"./L2AE32SL.js";import{b as O,j as $}from"./TI727O2H.js";import{formatUnits as oe,getAddress as j,parseAbi as Y}from"viem";var p={chainId:4663,usdg:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",v4:{poolManager:"0x8366a39CC670B4001A1121B8F6A443A643e40951",swapper:"0x7Cd4E04E433E69e588728c86A3832753B5F846d4",quoter:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b"},v3:{router:"0xCaf681a66D020601342297493863E78C959E5cb2",quoter:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA"},tokens:[{symbol:"AAPL",token:"0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",pools:[{v:3,fee:500,pool:"0xAae0d815EE56e4092a5E5C2911E676Fea50B2d6D"},{v:4,fee:3e3,tickSpacing:60,id:"0xc748f4671a867db48b552f6b7650bf3255e05f80f00e3f7aad1b17ccb7898fdb"},{v:3,fee:3e3,pool:"0x783C9bbB765047CFdD2b84b92b2Ca9F11D34b7Ed"}]},{symbol:"AMD",token:"0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",pools:[{v:3,fee:3e3,pool:"0x48D284A2A4d3DC1b3Da08231Fe44317e7e7Aa51f"}]},{symbol:"AMZN",token:"0x12f190a9F9d7D37a250758b26824B97CE941bF54",pools:[{v:3,fee:3e3,pool:"0x8AC92DA74AB5F3b1d024Dc1943Ad7e15Dc4179Ef"},{v:4,fee:2400,tickSpacing:24,id:"0xefc94885c96b02696b9b45de43eeeb8ac53c0199cab42b4daae4911b96fb8825"}]},{symbol:"ASML",token:"0x47F93d52cBeC7C6D2CfC080e154002370a60dAEA",pools:[{v:3,fee:1e4,pool:"0xedb22516B14Eb2d1C86927Db373B0E8bF70F5cD1"}]},{symbol:"BABA",token:"0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x1791fc651cc794a282e5dbcb56d0b2b38eff8754b677c8876e86901521ecc439"},{v:3,fee:3e3,pool:"0xa57ab582b310dd6f9e934EA1EEEa152741545E6A"}]},{symbol:"COIN",token:"0x6330D8C3178a418788dF01a47479c0ce7CCF450b",pools:[{v:4,fee:2500,tickSpacing:25,id:"0xe2e1a0e32205e854525e0fb1d3667a53bd3b4919f032b9bcd2a038b6b6dac314"},{v:4,fee:1e4,tickSpacing:200,id:"0x007a13fa152f6dc383cad20a8eaab4e1e2538b606936eae2a424f8aa47d6db31"}]},{symbol:"CRCL",token:"0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",pools:[{v:3,fee:3e3,pool:"0x654E4143e82a5824445Ade0824351C2A9ACD95a8"},{v:4,fee:3e3,tickSpacing:30,id:"0x628c98ab436ee34a6a7decd606242890582591bdf7c9a35d90e0d08021c31ea0"},{v:4,fee:1500,tickSpacing:15,id:"0x5177eac8c2176468bbf15e44081e151d35c2e7d068e96d3db94f496a4dc944b2"}]},{symbol:"CRWV",token:"0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x237014478f7ef98afbe7412ac35b6a3f96b8fb111de48b7c4dbf49dba4bd9c4b"}]},{symbol:"DELL",token:"0x941AE714EC6D8130c7B75d67160Ca08f1e7d11Dd",pools:[{v:3,fee:1e4,pool:"0xc30c89cB7815A1488b7998D15eEC73961707Fc5a"}]},{symbol:"GME",token:"0x1b0E319c6A659F002271B69dB8A7df2F911c153E",pools:[{v:3,fee:500,pool:"0xE2b46c905E12Ab8E2f864e4821a4325884C1B126"}]},{symbol:"GOOGL",token:"0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",pools:[{v:3,fee:500,pool:"0x34D0dC122CF9A8Eb296fC5e0D3A233625D7d19b7"},{v:4,fee:300,tickSpacing:3,id:"0x43fe16b75cabbf38f5b185d16142b02d1d9200d8f1ba17cb6cf899f562c6197f"},{v:4,fee:3e3,tickSpacing:60,id:"0xd4ecb79fdc521d7725d22b33ed43cb4e47aa96bfad76aa29577e3151f723ac5e"}]},{symbol:"INTC",token:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",pools:[{v:3,fee:3e3,pool:"0x2e5a92f5013a64661A49312111be2e8aBd33F56a"}]},{symbol:"META",token:"0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",pools:[{v:4,fee:310,tickSpacing:3,id:"0xc58bb68060bcb7b3ea0f6d4a4afef1e57f628722e808db12afb6d1733552872f"},{v:3,fee:3e3,pool:"0x107a7Cb40d8665360ba10E59471Af06150A50922"},{v:4,fee:3e3,tickSpacing:60,id:"0x5875d407a42965b0e768c8925cea290e06fa50603ef34fc99eb92a1050e6ae36"}]},{symbol:"MSFT",token:"0xe93237C50D904957Cf27E7B1133b510C669c2e74",pools:[{v:3,fee:3e3,pool:"0xeb60bCD1D920ad6E102690CCFC6fB488899E1510"},{v:4,fee:3e3,tickSpacing:60,id:"0x9194a557b6a6bb2236b49ea7e2bbccec5d3eeb705aef00903be4b3de1d949579"}]},{symbol:"MSTR",token:"0xec262a75e413fAfD0dF80480274532C79D42da09",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x319bac87e616a89e241c10aeb8afd4892a852cdd8b373cd9765ecddc40b87cfe"},{v:4,fee:2400,tickSpacing:24,id:"0xc105b8300ff65d750a0e4e63c7a879e20504069b770713464a5315e797735326"}]},{symbol:"MU",token:"0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD",pools:[{v:3,fee:3e3,pool:"0xd057B1Bc54917855BBee58eAd58647f47caB35E5"}]},{symbol:"NBIS",token:"0x9D9c6684F596F66a64C030B93A886D51Fd4D7931",pools:[{v:4,fee:9900,tickSpacing:99,id:"0x7c2f9ce1214ba9baf56d1b6a1fc640c1b63e9a711172c0c7d10e5a9c4a3d4f0c"}]},{symbol:"NVDA",token:"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",pools:[{v:3,fee:500,pool:"0xd4EB21209C4D6093f80B5b84f5C45cc093EA14a3"},{v:4,fee:100,tickSpacing:1,id:"0x6444a8e0b267406a15db74ca00c4a24bdfa81ed3180f5b6d0851f8ed6f4f29c5"},{v:4,fee:3e3,tickSpacing:60,id:"0x3bb34a44f1b2b5f32c034c38a53065a521a47b199700fa9bd19d60985ff24bf1"}]},{symbol:"ORCL",token:"0xb0992820E760d836549ba69BC7598b4af75dEE03",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0xc2ce4784e1e72cf0221b51b30c8aaadf6c0b12863cf03ab3687854fb7b1d850a"}]},{symbol:"PLTR",token:"0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",pools:[{v:4,fee:1500,tickSpacing:15,id:"0xc59eaeda6d1a6f031bc7e1d039772f2d675e7b4de2c8668610f4471bd60b3802"},{v:3,fee:3e3,pool:"0x851680416A4f4E1c463d45171d61ACDdBc8554c0"}]},{symbol:"QQQ",token:"0xD5f3879160bc7c32ebb4dC785F8a4F505888de68",pools:[{v:3,fee:500,pool:"0xD60A5d14dB690B7Afad71F76B108071D7175597d"}]},{symbol:"SGOV",token:"0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5",pools:[{v:3,fee:500,pool:"0x6Ba50150B17Ffd0972915Aaf04fFd5E8f4Fa49b4"},{v:3,fee:3e3,pool:"0xfAb520051f96F4D2a32c22B6a3dD7fFfdf231bFe"}]},{symbol:"SLV",token:"0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f",pools:[{v:3,fee:3e3,pool:"0x8cB787e6c315D464775289BaD00FDD67d53Ecb3D"},{v:3,fee:1e4,pool:"0x0Fa7BC480885DCf58Ad2ef63eC7289cF2481D51c"}]},{symbol:"SNDK",token:"0xB90A19fF0Af67f7779afF50A882A9CfF42446400",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0x2707cb88a6a40fa0f948f58958051ba097d6f6a3cf7f87929bd68ccc5becea24"}]},{symbol:"SPCX",token:"0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",pools:[{v:3,fee:500,pool:"0xc61284332117c3FB23A2A56cceFFD07F7aF60029"},{v:3,fee:3e3,pool:"0xEb07d9587eFD1778dFb9c385Ec43EF6d5F9fE401"}]},{symbol:"SPY",token:"0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",pools:[{v:4,fee:100,tickSpacing:1,id:"0xe1ae6a4c6ccc9f037389a8d50a4f577bde1a9fe01d85d88ecbbd39955ce53288"},{v:3,fee:500,pool:"0xa7Bb1AC63BBaB0C44316E6c8C455213441689167"},{v:4,fee:500,tickSpacing:5,id:"0xe5923c8a8be481ec89a2ca784a2bbfa4235de6d88f92260fd66b660c4babf907"}]},{symbol:"TSLA",token:"0x322F0929c4625eD5bAd873c95208D54E1c003b2d",pools:[{v:3,fee:3e3,pool:"0xf4ACdAEEB7022862A763C9B1B885e11191c889E3"},{v:4,fee:3e3,tickSpacing:60,id:"0x8517f8071ae5b831b738052f12125e8e3d6c158b78728aa44ce3b25e5104d32e"}]},{symbol:"TSM",token:"0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",pools:[{v:4,fee:7500,tickSpacing:75,id:"0x0ba5d53d2f6255f334b7c8ead4f56b6aef5af3402c5e4d11180afd38c6b85fb1"},{v:3,fee:1e4,pool:"0x07e8Ea83D4C1340774c8965125e26e12bf943bf1"}]},{symbol:"USAR",token:"0xd917B029C761D264c6A312BBbcDA868658eF86a6",pools:[{v:3,fee:3e3,pool:"0x04391780F519B7d3ba59c9590459D76e23d225C4"}]},{symbol:"USO",token:"0xa30FA36Db767ad9eD3f7a60fC79526fB4d56D344",pools:[{v:4,fee:1200,tickSpacing:15,id:"0x1f2ad5a274a776d8e1408292bde1d92d8fa7b6444acf14ad60b9c3e4e5b66420"},{v:3,fee:3e3,pool:"0x02175608F1b5E6b5ed221cCFdC7Be197D111D915"}]}],notOffered:{CLSK:"thin",EWY:"thin",IONQ:"thin",RGTI:"thin",RKLB:"thin"},sourceCommit:"02230282d8888e00794207ed271ee01b4ce30309"};var u=10n**18n,T=1n<<192n,C=Y(["function slot0() view returns (uint160,int24,uint16,uint16,uint16,uint8,bool)","function liquidity() view returns (uint128)","function getSlot0(bytes32) view returns (uint160,int24,uint24,uint24)","function getLiquidity(bytes32) view returns (uint128)"]),ne=Y(["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))"]),c=r=>({usdEstimate:null,estimateLabel:"price unavailable",estimateReason:r}),g=r=>`${r.chainId}:${r.address.toLowerCase()}`;async function be(r,I,k={}){let v=Number.isFinite(k.budgetMs)?Math.min(3e3,Math.max(0,k.budgetMs)):3e3,x=`Oak stopped pricing after ${v===3e3?"3 seconds":`${v} milliseconds`}`,D=new Map,h=[...new Map(I.map(e=>[g(e.token),e.token])).values()],f=!1,F=0,y=[];async function B(e){if(f)throw new Error(x);if(F>=6?await new Promise(t=>y.push(t)):F++,f)throw new Error(x);try{return await e()}finally{let t=y.shift();t?t():F--}}let U=new Map,L=new Map,R=new Map,q;function m(e){let t=U.get(e);if(!t){let a=r.clientFor(e);t=new Proxy(a,{get(n,o,b){let s=Reflect.get(n,o,b);return o==="readContract"?(...i)=>B(async()=>Reflect.apply(s,n,i)):s}}),U.set(e,t)}return t}function S(e){let t=L.get(e);return t||(t=B(()=>m(e).getBlockNumber({cacheTime:0})),L.set(e,t)),t}function w(e,t){return q??=_(e,void 0,t).then(a=>{let n=BigInt(a);if(n<=0n)throw new Error("ETH average unavailable");return n}),q}function J(e,t){let a=`${e}:${t}`,n=R.get(a);return n||(n=B(()=>m(e).getBlock({blockNumber:t})).then(o=>{if(!(o.number!==t||typeof o.timestamp!="bigint"||o.timestamp<=0n))return o.timestamp.toString()}).catch(()=>{}),R.set(a,n)),n}async function X(e,t){let a=m(e.chainId),n=await S(e.chainId),o;for(let s of t.pools)try{let i=s.v===3,d=j(i?s.pool:p.v4.stateView),E=await a.readContract({address:d,abi:C,functionName:i?"slot0":"getSlot0",args:i?[]:[s.id],blockNumber:n}),l=await a.readContract({address:d,abi:C,functionName:i?"liquidity":"getLiquidity",args:i?[]:[s.id],blockNumber:n}),A=E[0];A>0n&&l>0n&&(!o||l>o.liquidity)&&(o={liquidity:l,sqrt:A})}catch{}if(!o)return c("Oak has no pinned pool with in-range liquidity for this token");let b=BigInt(e.address)<BigInt(p.usdg);return{numerator:b?o.sqrt**2n:T,denominator:(b?T:o.sqrt**2n)*10n**6n,source:`current price in the Uniswap USDG/${t.symbol} pool; on-chain trading can differ from the stock market`,block:n}}async function Z(e){if(V(e))return{numerator:1n,denominator:10n**6n,source:"USDG counted at $1.00"};if(e.chainId!==O)return c("Oak has no source for this token");if(k.chopShareTokens?.some(i=>i.toLowerCase()===e.address.toLowerCase()))return c("chop_logs shows this log's backing");let t=e.symbol;if(t.startsWith("untrusted "))try{let i=JSON.parse(t.slice(10));typeof i=="string"&&(t=i)}catch{}if(G(e))try{let i=m(e.chainId),d=await S(e.chainId),E=j(P.stateView),l=P.poolId,[A,te]=await Promise.all([i.readContract({address:E,abi:C,functionName:"getSlot0",args:[l],blockNumber:d}),i.readContract({address:E,abi:C,functionName:"getLiquidity",args:[l],blockNumber:d})]),H=A[0];return H<=0n||te<=0n?c("The pinned Uniswap v4 WETH/CHOP pool has no active liquidity, and the only other route is a near-empty pool. A quote is a sale for this amount only; Oak never uses it to value a balance."):{numerator:await w(i,d)*T,denominator:u*H**2n*10n**BigInt(e.decimals),source:"current price in the Uniswap v4 WETH/CHOP pool",block:d}}catch{return c("Oak could not verify the pinned Uniswap v4 WETH/CHOP pool for CHOP. A quote is a sale for this amount only; Oak never uses it to value a balance.")}if(t==="CHOP")return c("Oak has no pinned market for CHOP. A quote is a sale for this amount only; Oak never uses it to value a balance.");let a=p.tokens.find(i=>i.token.toLowerCase()===e.address.toLowerCase());if(a)return X(e,a);if(Object.hasOwn(p.notOffered,t))return c("Oak has no pinned market for this token");let n=m(e.chainId),o=await S(e.chainId);if(W(e))return{numerator:await w(n,o),denominator:u*u,source:"30-minute average of the Uniswap ETH/USDG pool",block:o};let b=(r.oakTokenAddress??process.env.OAK_TOKEN_ADDRESS)?.toLowerCase()===e.address.toLowerCase();if(b)try{let i=r.resolvePrice?await r.resolvePrice(e,o):await Q(e,{client:n,blockNumber:o,oakTokenAddress:e.address,officialStockTokens:[]}),d=BigInt(i.usdE18);if(d<=0n)throw new Error("OAK price unavailable");return{numerator:d,denominator:u*10n**BigInt(e.decimals),source:"OAK price",block:o}}catch{}if(b&&(await n.readContract({address:$[O].pons.factory.address,abi:ne,functionName:"getLaunchedToken",args:[e.address],blockNumber:o})).phase!==2)return c("Oak has no graduated Pons pool price for OAK");let s=await K(e,n,o);return s.numerator<=0n||s.denominator<=0n?c("Oak has no source for this token"):{numerator:await w(n,o)*s.numerator,denominator:u*s.denominator*10n**BigInt(e.decimals),source:b?"OAK's current Pons pool price; fewer than enough trades in 30 minutes for a price":"current Pons pool price",block:o}}let N=0;async function z(){for(;!f&&N<h.length;){let e=h[N++],t;try{if(!Number.isInteger(e.decimals)||e.decimals<0||e.decimals>255)throw new Error("Invalid decimals");if(t=await Z(e),f||D.set(g(e),t),"numerator"in t&&t.block!==void 0){let a=await J(e.chainId,t.block);f||(t.observedAt=a)}}catch{t=c("Oak has no source for this token")}f||D.set(g(e),t)}}let M,ee=new Promise(e=>{M=setTimeout(()=>{f=!0;for(let t of y.splice(0))t();e()},v)});try{await Promise.race([Promise.all(Array.from({length:Math.min(6,h.length)},z)),ee])}finally{clearTimeout(M),f=!0}return I.map(e=>{let t;try{if(!/^\d+$/.test(e.amount)||!Number.isInteger(e.token.decimals)||e.token.decimals<0||e.token.decimals>255)throw new Error("Invalid amount");t="humanAmount"in e&&typeof e.humanAmount=="string"?e.humanAmount:oe(BigInt(e.amount),e.token.decimals);let a=D.get(g(e.token));if(a&&"numerator"in a){let o=(BigInt(e.amount)*a.numerator*100n*2n+a.denominator)/(a.denominator*2n);return{...e,humanAmount:t,usdEstimate:`${o/100n}.${(o%100n).toString().padStart(2,"0")}`,estimateLabel:"estimate, not a quote",estimateSource:a.source,unitUsdE18:(a.numerator*10n**BigInt(e.token.decimals)*u/a.denominator).toString(),...a.observedAt===void 0?{}:{observedAt:a.observedAt},...a.block===void 0?{}:{estimateAsOf:a.block.toString()}}}return{...e,humanAmount:t,...a??c(x)}}catch{return{...e,...t===void 0?{}:{humanAmount:t},...c("Oak cannot format this token amount")}}})}export{be as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as P,h as T,n as A}from"./
|
|
1
|
+
import{e as P,h as T,n as A}from"./6D3XNCOX.js";import{a as h,b as k,f as y,g as m}from"./QPY6UTLU.js";import{O as b,b as I}from"./KLEJ3W4T.js";import{a as N}from"./66F5ZH34.js";import{c as w,g}from"./NWNYJ26T.js";import{b as v}from"./TI727O2H.js";import{a as n}from"./XSD5NL7J.js";import{encodeFunctionData as c,parseAbi as _,zeroAddress as F}from"viem";var i=_(["function ownerOf(uint256) view returns (address)","function getApproved(uint256) view returns (address)","function getPositionLiquidity(uint256) view returns (uint128)","function safeTransferFrom(address from,address to,uint256 tokenId)","function approve(address spender,uint256 tokenId)","function burn(uint256 tokenId)"]),q={version:{description:'Uniswap version: "v3" for concentrated liquidity or "v4" for PoolManager.',type:"string",enum:["v3","v4"]},tokenId:N('Identifier of the position NFT, as a decimal string. Example: "1".'),operation:{description:'Choose "transfer" to move the NFT, "approve" to grant an NFT approval, "revoke" to clear it or "burn" to destroy an empty NFT.',type:"string",enum:["transfer","approve","revoke","burn"]},target:{...w,description:"Intended NFT recipient or per-NFT approved operator address; required for transfer or approve."}};function $(s){return{tools:[!1,!0].map(f=>({name:f?"uniswap_position_manage":"uniswap_position_status",inputSchema:{type:"object",additionalProperties:!1,required:f?["version","tokenId","operation"]:["version","tokenId"],properties:q},async execute(e,p){if(e.version!=="v3"&&e.version!=="v4")throw new n("Specify position version v3 or v4.");let o=h(e.tokenId,"tokenId"),a=e.version==="v3"?P.positionManager:I,d=s.clientFor(v),l=await d.readContract({address:a,abi:i,functionName:"ownerOf",args:[o]});if(!f){m(e,["version","tokenId"]);let r=await d.readContract({address:a,abi:i,functionName:"getApproved",args:[o]});return{version:e.version,tokenId:o.toString(),manager:a,owner:l,approved:r}}if(!g(l,p))throw new n("Only manage a Uniswap NFT owned by the signing wallet.");let t=e.operation;m(e,["version","tokenId","operation",...["transfer","approve"].includes(String(t))?["target"]:[]]);let u;if(t==="transfer"||t==="approve"){let r=k(e.target);if(r===F)throw new n("Choose a nonzero target, or operation revoke to clear approval.");u=t==="transfer"?c({abi:i,functionName:"safeTransferFrom",args:[p,r,o]}):c({abi:i,functionName:"approve",args:[r,o]})}else if(t==="revoke")u=c({abi:i,functionName:"approve",args:[F,o]});else if(t==="burn"){if(e.version==="v4"){if(await d.readContract({address:a,abi:i,functionName:"getPositionLiquidity",args:[o]})!==0n)throw new n("Remove all liquidity before burning an empty position.");return b(s).tools.find(S=>S.name==="uniswap_remove").execute({version:"v4",tokenId:o.toString(),liquidity:"all",amount0Min:"0",amount1Min:"0"},p)}let r=A(await d.readContract({address:a,abi:T,functionName:"positions",args:[o]}));if(r.liquidity!==0n||r.tokensOwed0!==0n||r.tokensOwed1!==0n)throw new n("Remove liquidity and collect all owed tokens before burning a v3 NFT.");u=c({abi:i,functionName:"burn",args:[o]})}else throw new n("Choose transfer, approve, revoke or burn. Operator-wide approvals are not exact approvals.");return y(s,[s.unsignedTx({to:a,data:u,value:"0",chainId:v,description:`${t} Uniswap ${e.version} NFT #${o}${e.target?` with target ${e.target}`:""}.`})],p,"Position ownership or exact per-NFT approval changes. A transferred position includes its liquidity and accrued rights; burn requires an empty NFT.")}}))}}export{i as a,$ as b};
|