@oakagentkit/core 0.3.4 → 0.3.6
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 +14 -0
- package/build/dist/api/addresses.js +1 -1
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/history.d.ts +2 -0
- 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.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/actions.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/positions.js +1 -1
- package/build/dist/api/modules/borro/reader.js +1 -1
- package/build/dist/api/modules/chop/actions.d.ts +13 -1
- 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.d.ts +1 -0
- package/build/dist/api/modules/chop/copy.js +1 -1
- package/build/dist/api/modules/chop/display.d.ts +36 -0
- package/build/dist/api/modules/chop/display.js +1 -0
- 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 +1 -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.d.ts +6 -1
- package/build/dist/api/modules/chop/reader.js +1 -1
- package/build/dist/api/modules/chop/types.d.ts +7 -0
- package/build/dist/api/modules/chop/unfarm.d.ts +16 -0
- package/build/dist/api/modules/chop/unfarm.js +1 -0
- 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/index.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.js +1 -1
- package/build/dist/api/modules/erc8004/validation.js +1 -1
- package/build/dist/api/modules/factor/actions.js +1 -1
- package/build/dist/api/modules/factor/api.js +1 -1
- package/build/dist/api/modules/factor/checks.js +1 -1
- package/build/dist/api/modules/factor/copy.d.ts +11 -11
- package/build/dist/api/modules/factor/copy.js +1 -1
- package/build/dist/api/modules/factor/guard.js +1 -1
- package/build/dist/api/modules/factor/index.js +1 -1
- package/build/dist/api/modules/factor/reader.js +1 -1
- package/build/dist/api/modules/fobo/client.js +1 -1
- package/build/dist/api/modules/fobo/index.js +1 -1
- package/build/dist/api/modules/fobo/intent.js +1 -1
- package/build/dist/api/modules/fobo/steps.js +1 -1
- package/build/dist/api/modules/fobo/verify.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/scan.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.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.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.d.ts +39 -2
- 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.d.ts +14 -2
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/agent-link.d.ts +17 -0
- package/build/dist/api/modules/hookr/agent-link.js +1 -0
- package/build/dist/api/modules/hookr/api-client.d.ts +9 -0
- package/build/dist/api/modules/hookr/api-client.js +1 -0
- package/build/dist/api/modules/hookr/blocks/advisory.d.ts +41 -0
- package/build/dist/api/modules/hookr/blocks/advisory.js +1 -0
- package/build/dist/api/modules/hookr/blocks/buy-sell-block.d.ts +7 -0
- package/build/dist/api/modules/hookr/blocks/buy-sell-block.js +1 -0
- package/build/dist/api/modules/hookr/blocks/core-settings.d.ts +6 -0
- package/build/dist/api/modules/hookr/blocks/core-settings.js +1 -0
- package/build/dist/api/modules/hookr/blocks/exit-clock.d.ts +14 -0
- package/build/dist/api/modules/hookr/blocks/exit-clock.js +1 -0
- package/build/dist/api/modules/hookr/blocks/holder-pot.d.ts +30 -0
- package/build/dist/api/modules/hookr/blocks/holder-pot.js +1 -0
- package/build/dist/api/modules/hookr/blocks/managed-fee.d.ts +96 -0
- package/build/dist/api/modules/hookr/blocks/managed-fee.js +1 -0
- package/build/dist/api/modules/hookr/blocks/market-guard.d.ts +116 -0
- package/build/dist/api/modules/hookr/blocks/market-guard.js +1 -0
- package/build/dist/api/modules/hookr/blocks/market-hours-fee.d.ts +87 -0
- package/build/dist/api/modules/hookr/blocks/market-hours-fee.js +1 -0
- package/build/dist/api/modules/hookr/blocks/pay-later.d.ts +199 -0
- package/build/dist/api/modules/hookr/blocks/pay-later.js +1 -0
- package/build/dist/api/modules/hookr/blocks/sandwich-guard.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/sandwich-guard.js +1 -0
- package/build/dist/api/modules/hookr/blocks/storm-fee.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/storm-fee.js +1 -0
- package/build/dist/api/modules/hookr/blocks/swap-cut.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/swap-cut.js +1 -0
- package/build/dist/api/modules/hookr/blocks/swap-reward-mint.d.ts +125 -0
- package/build/dist/api/modules/hookr/blocks/swap-reward-mint.js +1 -0
- package/build/dist/api/modules/hookr/blocks/wallet-cap.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/wallet-cap.js +1 -0
- package/build/dist/api/modules/hookr/blocks/zap-source.d.ts +161 -0
- package/build/dist/api/modules/hookr/blocks/zap-source.js +1 -0
- package/build/dist/api/modules/hookr/blocks/zap-target.d.ts +51 -0
- package/build/dist/api/modules/hookr/blocks/zap-target.js +1 -0
- package/build/dist/api/modules/hookr/claims.d.ts +53 -0
- package/build/dist/api/modules/hookr/claims.js +1 -0
- package/build/dist/api/modules/hookr/contracts.d.ts +3 -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.d.ts +2 -2
- package/build/dist/api/modules/hookr/discovery.js +1 -1
- package/build/dist/api/modules/hookr/fill-bounty.d.ts +2 -0
- package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
- package/build/dist/api/modules/hookr/gas.d.ts +48 -0
- package/build/dist/api/modules/hookr/gas.js +1 -0
- package/build/dist/api/modules/hookr/gates.d.ts +51 -0
- package/build/dist/api/modules/hookr/gates.js +1 -0
- package/build/dist/api/modules/hookr/hook-blocks.d.ts +304 -0
- package/build/dist/api/modules/hookr/hook-blocks.js +1 -0
- package/build/dist/api/modules/hookr/index.d.ts +4 -2
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/jobs.d.ts +7 -0
- package/build/dist/api/modules/hookr/jobs.js +1 -0
- package/build/dist/api/modules/hookr/launch-options.d.ts +52 -3
- package/build/dist/api/modules/hookr/launch-options.js +1 -1
- package/build/dist/api/modules/hookr/launch-profile.d.ts +8 -0
- package/build/dist/api/modules/hookr/launch-profile.js +1 -1
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.d.ts +24 -0
- 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.d.ts +90 -2
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/pay-later-actions.d.ts +52 -0
- package/build/dist/api/modules/hookr/pay-later-actions.js +1 -0
- package/build/dist/api/modules/hookr/pins.d.ts +5 -0
- package/build/dist/api/modules/hookr/pins.js +1 -1
- package/build/dist/api/modules/hookr/pm-liquidity.d.ts +215 -0
- package/build/dist/api/modules/hookr/pm-liquidity.js +1 -0
- package/build/dist/api/modules/hookr/public-reads.d.ts +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.d.ts +4 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/hookr/scan.d.ts +25 -0
- package/build/dist/api/modules/hookr/scan.js +1 -0
- package/build/dist/api/modules/hookr/swap.d.ts +161 -0
- package/build/dist/api/modules/hookr/swap.js +1 -0
- 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/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.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/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-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.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.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/raeto/index.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/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/reads.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/stock-prices.d.ts +25 -0
- package/build/dist/api/modules/uniswap/stock-prices.js +1 -1
- package/build/dist/api/modules/uniswap/stocks.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/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/scan-text.d.ts +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/rpc.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 +2 -0
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.d.ts +10 -1
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/universal-router.js +1 -1
- package/build/dist/api/usd-estimate.d.ts +2 -0
- package/build/dist/api/usd-estimate.js +1 -1
- package/build/dist/chunks/{DMDOSHV7.js → 266VIESP.js} +1 -1
- package/build/dist/chunks/{KNBNKG7P.js → 2BKZLF5A.js} +1 -1
- package/build/dist/chunks/{HFVXNKA5.js → 2BM2WX2G.js} +1 -1
- package/build/dist/chunks/{OY5W7ZSL.js → 2H2OZE6X.js} +1 -1
- package/build/dist/chunks/{E76Z2TT4.js → 2QQ5CGQI.js} +1 -1
- package/build/dist/chunks/{4PLLS6CT.js → 2VYA6WIN.js} +1 -1
- package/build/dist/chunks/{LCH6F5HT.js → 342OZP53.js} +1 -1
- package/build/dist/chunks/{FQTO7VJG.js → 3HF6WE4L.js} +1 -1
- package/build/dist/chunks/3M7RMROZ.js +1 -0
- package/build/dist/chunks/3RGED2KO.js +1 -0
- package/build/dist/chunks/{RUSXMQSJ.js → 3XIJCHT7.js} +1 -1
- package/build/dist/chunks/3XY44BP5.js +1 -0
- package/build/dist/chunks/3YNXQ3EZ.js +1 -0
- package/build/dist/chunks/45QP74CE.js +1 -0
- package/build/dist/chunks/{NYHKIXJR.js → 4GAU3JLN.js} +1 -1
- package/build/dist/chunks/{Y2QADJOB.js → 4P6DRKY3.js} +1 -1
- package/build/dist/chunks/{W3DGFMQE.js → 4RTXP2YP.js} +1 -1
- package/build/dist/chunks/{7FYM7FJA.js → 4SXRXNHG.js} +1 -1
- package/build/dist/chunks/{ZTKT3ZQK.js → 53VBLEYS.js} +1 -1
- package/build/dist/chunks/5677LZOV.js +1 -0
- package/build/dist/chunks/{ADIPEGNN.js → 5AO2QPWE.js} +1 -1
- package/build/dist/chunks/{GQITAJVF.js → 5BPFF7NX.js} +1 -1
- package/build/dist/chunks/{PXUML7HJ.js → 5DWQUEBA.js} +1 -1
- package/build/dist/chunks/{WAKZWSHB.js → 5KKAN7XQ.js} +1 -1
- package/build/dist/chunks/{VVAM3EAK.js → 5N6YJFFA.js} +1 -1
- package/build/dist/chunks/{QIB6OMQV.js → 5O67QQIY.js} +1 -1
- package/build/dist/chunks/5PNFV7HH.js +1 -0
- package/build/dist/chunks/5RAZFRO4.js +1 -0
- package/build/dist/chunks/{FAH7FKUT.js → 5UWVXEPD.js} +1 -1
- package/build/dist/chunks/5VKVAUFQ.js +1 -0
- package/build/dist/chunks/5Y457HYC.js +1 -0
- package/build/dist/chunks/64LAWFBE.js +1 -0
- package/build/dist/chunks/{JJGZ7W3V.js → 6AS3TGOX.js} +1 -1
- package/build/dist/chunks/6EWSLHXL.js +1 -0
- package/build/dist/chunks/{6F527FLN.js → 6HNQAYBM.js} +1 -1
- package/build/dist/chunks/{FUP53K6G.js → 6LDC5D2S.js} +1 -1
- package/build/dist/chunks/{YR44GQG4.js → 6QXTL65K.js} +1 -1
- package/build/dist/chunks/6RVAV6BB.js +1 -0
- package/build/dist/chunks/{WSILNJS2.js → 6STUQOFL.js} +1 -1
- package/build/dist/chunks/{OKXKDDBX.js → 6Y2546JA.js} +1 -1
- package/build/dist/chunks/{4Z3IGMU6.js → 7AYP4ATZ.js} +1 -1
- package/build/dist/chunks/{YGW4ODAP.js → 7EPU3XGY.js} +1 -1
- package/build/dist/chunks/7GL547YZ.js +1 -0
- package/build/dist/chunks/7JTXYMNP.js +1 -0
- package/build/dist/chunks/{A3BJSQ23.js → 7VU5VCTL.js} +1 -1
- package/build/dist/chunks/{Z7FGEWO2.js → 7WXAS54T.js} +1 -1
- package/build/dist/chunks/{3D7FXI6G.js → 7X5JVF3F.js} +1 -1
- package/build/dist/chunks/{DRLBTB4E.js → A72ADVYF.js} +1 -1
- package/build/dist/chunks/{ANIF3JMV.js → AG66NM3J.js} +1 -1
- package/build/dist/chunks/{AOX6DKYU.js → AL6UXNGH.js} +1 -1
- package/build/dist/chunks/AODUTN65.js +1 -0
- package/build/dist/chunks/{PQG3ULRT.js → AONO47JX.js} +1 -1
- package/build/dist/chunks/{JTPHZCO3.js → AQJLEG6B.js} +1 -1
- package/build/dist/chunks/AZBTNUXF.js +1 -0
- package/build/dist/chunks/{O56EZB5Y.js → B5BU645H.js} +1 -1
- package/build/dist/chunks/{LQSPWRHN.js → B75SS7H6.js} +1 -1
- package/build/dist/chunks/{GBIBRYOV.js → B7HVPHSS.js} +1 -1
- package/build/dist/chunks/{LT5P6PZW.js → B7WZJHIJ.js} +1 -1
- package/build/dist/chunks/{3A2IKFTV.js → BIFANUTV.js} +1 -1
- package/build/dist/chunks/BM4KHOFB.js +1 -0
- package/build/dist/chunks/{X3YEDVRN.js → BSV65PCA.js} +1 -1
- package/build/dist/chunks/{HDBDBKEA.js → BW755PNH.js} +1 -1
- package/build/dist/chunks/{VXCGMALF.js → BWE5PXRE.js} +1 -1
- package/build/dist/chunks/{7U62MMUQ.js → BY2OWKZB.js} +1 -1
- package/build/dist/chunks/{SRHVSNPX.js → C2H3BWN5.js} +1 -1
- package/build/dist/chunks/{F7MGYRPU.js → CCPG6PRL.js} +1 -1
- package/build/dist/chunks/{ZTX4WT62.js → CFPJDLTZ.js} +1 -1
- package/build/dist/chunks/{OI3N4EW4.js → CG7ABZXH.js} +1 -1
- package/build/dist/chunks/CJMVRV34.js +1 -0
- package/build/dist/chunks/CQPIR6ER.js +1 -0
- package/build/dist/chunks/{FP7DHVK2.js → CR7DPGI6.js} +1 -1
- package/build/dist/chunks/{W5FM2OVB.js → CVVNAFUE.js} +1 -1
- package/build/dist/chunks/{LEHBRAZX.js → CW37EGPL.js} +1 -1
- package/build/dist/chunks/{MI5HZDMH.js → D6JOXK7Q.js} +1 -1
- package/build/dist/chunks/{SGHSCK22.js → DJRS3TR5.js} +1 -1
- package/build/dist/chunks/{IZFED3R2.js → DLNDJZR4.js} +1 -1
- package/build/dist/chunks/{SYERFEJ4.js → DPSFR3ZS.js} +1 -1
- package/build/dist/chunks/{2T6O77QZ.js → DV2HVFTM.js} +1 -1
- package/build/dist/chunks/{NMJVQX5M.js → DWRRIFXS.js} +1 -1
- package/build/dist/chunks/{3ZH5SOC2.js → EFOC337C.js} +1 -1
- package/build/dist/chunks/EHQRAA3R.js +1 -0
- package/build/dist/chunks/{WX7OYCNS.js → EJIP7RBG.js} +1 -1
- package/build/dist/chunks/EPOIAXCV.js +3 -0
- package/build/dist/chunks/EWZFZUVF.js +1 -0
- package/build/dist/chunks/{OB7BFDOV.js → EYE3ZAJB.js} +1 -1
- package/build/dist/chunks/{MQ5F2VOK.js → EZUQMTLE.js} +1 -1
- package/build/dist/chunks/F36IA5RI.js +1 -0
- package/build/dist/chunks/{DD47RZFU.js → F74ARK4H.js} +1 -1
- package/build/dist/chunks/{Q4HSQL65.js → FGGDAAHW.js} +1 -1
- package/build/dist/chunks/FMEO7RX7.js +1 -0
- package/build/dist/chunks/{V6EVQWAL.js → FN6XY6ET.js} +1 -1
- package/build/dist/chunks/G4IX4CYN.js +1 -0
- package/build/dist/chunks/G53U6Y4L.js +1 -0
- package/build/dist/chunks/{XHFAF5PZ.js → GBIL2I2K.js} +1 -1
- package/build/dist/chunks/{RKM62HC5.js → GCFHKJIO.js} +1 -1
- package/build/dist/chunks/{K7HTDKAT.js → GMMTHTCP.js} +1 -1
- package/build/dist/chunks/{O5QTITN6.js → GRHBE4MQ.js} +1 -1
- package/build/dist/chunks/GTJ6LBGB.js +1 -0
- package/build/dist/chunks/GV6Z3MET.js +1 -0
- package/build/dist/chunks/{GK3D7OKG.js → GVCNTGLC.js} +1 -1
- package/build/dist/chunks/GX2RCAHG.js +1 -0
- package/build/dist/chunks/{O3XWE4FO.js → H5KU4DUU.js} +1 -1
- package/build/dist/chunks/H7ZJ7LAB.js +1 -0
- package/build/dist/chunks/{DCGNVMKG.js → HC3QFA5I.js} +1 -1
- package/build/dist/chunks/{RK3PPFRX.js → HEQBTHFS.js} +1 -1
- package/build/dist/chunks/{C76D54YG.js → HGSFRN57.js} +1 -1
- package/build/dist/chunks/HJI7KO6F.js +1 -0
- package/build/dist/chunks/{L6CVMDWQ.js → HNBYPHTA.js} +1 -1
- package/build/dist/chunks/{MSRCJ2BS.js → HPBTSJW7.js} +1 -1
- package/build/dist/chunks/HPO673QQ.js +1 -0
- package/build/dist/chunks/{ZFRTBBIW.js → HRGLFGFL.js} +1 -1
- package/build/dist/chunks/{DGDMRATN.js → ICHT3H3W.js} +1 -1
- package/build/dist/chunks/IJVBCEA2.js +1 -0
- package/build/dist/chunks/{2TX7HP6M.js → IKVRFAUP.js} +1 -1
- package/build/dist/chunks/IM7ZF7XZ.js +1 -0
- package/build/dist/chunks/{I4473OC6.js → IMD33NQS.js} +1 -1
- package/build/dist/chunks/IR7KDBFU.js +1 -0
- package/build/dist/chunks/{X24YTJST.js → IY7FWTAL.js} +1 -1
- package/build/dist/chunks/IYOWMW5B.js +1 -0
- package/build/dist/chunks/J2J73XYU.js +1 -0
- package/build/dist/chunks/JCS24YBB.js +1 -0
- package/build/dist/chunks/JQVTHPUO.js +1 -0
- package/build/dist/chunks/{USZCTSPI.js → JTWJT2O3.js} +1 -1
- package/build/dist/chunks/{2YYKQGJZ.js → K4CYAWNL.js} +1 -1
- package/build/dist/chunks/{7VH6JQ2H.js → K5C6QBOO.js} +1 -1
- package/build/dist/chunks/K5OXLIPK.js +1 -0
- package/build/dist/chunks/{4PB6MSGZ.js → K6GECT3F.js} +1 -1
- package/build/dist/chunks/{HU2JXDLH.js → KB2JWQZ4.js} +1 -1
- package/build/dist/chunks/{EFESPGA2.js → KCZUJ57H.js} +1 -1
- package/build/dist/chunks/{YW4W3LPQ.js → KHLM6NIZ.js} +1 -1
- package/build/dist/chunks/{OIQTZOBN.js → KKGHXNM4.js} +1 -1
- package/build/dist/chunks/{SUNTJ6IU.js → KYANIEPX.js} +1 -1
- package/build/dist/chunks/{MOZBDCVV.js → L3IAEXQR.js} +1 -1
- package/build/dist/chunks/{ZZ6FZGHF.js → L4UFGM7M.js} +1 -1
- package/build/dist/chunks/{DMB64UIN.js → L76P6WIH.js} +1 -1
- package/build/dist/chunks/{QMNUB2GM.js → LBT6WR4U.js} +1 -1
- package/build/dist/chunks/LD3A2KLN.js +1 -0
- package/build/dist/chunks/{WRUTW6CG.js → LFSNAQ7V.js} +1 -1
- package/build/dist/chunks/{5ZVIAGLX.js → LKRAUTYI.js} +1 -1
- package/build/dist/chunks/{23HNDJ76.js → M2SWILNG.js} +1 -1
- package/build/dist/chunks/{IT2JLILU.js → MFKDNAHB.js} +1 -1
- package/build/dist/chunks/MFQTBUSD.js +1 -0
- package/build/dist/chunks/{V4UJMUIB.js → MLN5KTG7.js} +1 -1
- package/build/dist/chunks/{S4JUFCT4.js → MSQNOK3I.js} +1 -1
- package/build/dist/chunks/{FA3GBXQP.js → MXI7LX2F.js} +1 -1
- package/build/dist/chunks/N6YNJGEF.js +1 -0
- package/build/dist/chunks/{DXAPKN7H.js → NLC36QHL.js} +1 -1
- package/build/dist/chunks/NUTTPUYJ.js +1 -0
- package/build/dist/chunks/{O4S6XAYV.js → O7L55XM3.js} +1 -1
- package/build/dist/chunks/{NAO7VWZF.js → OCIEVYPR.js} +1 -1
- package/build/dist/chunks/{4NBXBKOX.js → OD7CY6BY.js} +1 -1
- package/build/dist/chunks/{RUTSEGGD.js → OHZHQSCA.js} +1 -1
- package/build/dist/chunks/{T3QEN3S6.js → OIGTTRN5.js} +1 -1
- package/build/dist/chunks/{5OTQCE2E.js → P6JE2NRA.js} +1 -1
- package/build/dist/chunks/PD5NXIRT.js +1 -0
- package/build/dist/chunks/{TXGZ6NWN.js → PG7HZIZL.js} +1 -1
- package/build/dist/chunks/{WXZ4LAKO.js → PXVF2SHU.js} +1 -1
- package/build/dist/chunks/{UBVE2U6X.js → Q43WPRYU.js} +1 -1
- package/build/dist/chunks/QA6Z2CYP.js +2 -0
- package/build/dist/chunks/QAAKUIWE.js +1 -0
- package/build/dist/chunks/{PQOWIRKQ.js → QAVP3CWL.js} +1 -1
- package/build/dist/chunks/{YXXK6EPI.js → QBHY2QRC.js} +1 -1
- package/build/dist/chunks/{ELHRXA5U.js → QFK335LC.js} +1 -1
- package/build/dist/chunks/{3PHJUFU2.js → QFUSCK5C.js} +1 -1
- package/build/dist/chunks/{IPU656WB.js → QKH7ED6B.js} +1 -1
- package/build/dist/chunks/{AHUCYDBC.js → QKIQ7ZKD.js} +1 -1
- package/build/dist/chunks/{XW3VGWXK.js → QMWHQRYC.js} +1 -1
- package/build/dist/chunks/{N6PHSHBE.js → QP2B7AYX.js} +1 -1
- package/build/dist/chunks/{VHK5AYC2.js → QZ6V6J6W.js} +1 -1
- package/build/dist/chunks/{MDLJFCT4.js → R5Z4HPCA.js} +1 -1
- package/build/dist/chunks/RKJFSDGV.js +1 -0
- package/build/dist/chunks/RKS3M7L5.js +1 -0
- package/build/dist/chunks/{GDOHHXNH.js → RLX6YTNT.js} +1 -1
- package/build/dist/chunks/RYEQIZ2H.js +1 -0
- package/build/dist/chunks/{USEF3QKG.js → S432S6NA.js} +1 -1
- package/build/dist/chunks/S47M3IPR.js +1 -0
- package/build/dist/chunks/S65KXMZ7.js +3 -0
- package/build/dist/chunks/{2OVJ2BTJ.js → SEXKWYUM.js} +1 -1
- package/build/dist/chunks/{2ILYVUFA.js → SRYX65GZ.js} +1 -1
- package/build/dist/chunks/{GNOHIL4Q.js → TMENUIBC.js} +1 -1
- package/build/dist/chunks/{BSX4LFYI.js → TNHU5UBQ.js} +1 -1
- package/build/dist/chunks/{PDPTJMTJ.js → TT2ST3Q3.js} +1 -1
- package/build/dist/chunks/TTBB6EFN.js +1 -0
- package/build/dist/chunks/{Z5YI6KLN.js → TWVDWNTG.js} +1 -1
- package/build/dist/chunks/TZG7HTVM.js +1 -0
- package/build/dist/chunks/{OVM4QIET.js → U4MSIH4G.js} +1 -1
- package/build/dist/chunks/UEOS6SHR.js +1 -0
- package/build/dist/chunks/{EIE2U4OX.js → UGFRBJDQ.js} +1 -1
- package/build/dist/chunks/{HUKDISRE.js → UIVOYAO2.js} +1 -1
- package/build/dist/chunks/{XRDLMTBJ.js → UMY6SP7C.js} +1 -1
- package/build/dist/chunks/UNBRUWSV.js +1 -0
- package/build/dist/chunks/{LGLWEGPY.js → UPX3OWKA.js} +1 -1
- package/build/dist/chunks/{MHONMLF6.js → URTQNYWU.js} +1 -1
- package/build/dist/chunks/{4RCYYN6O.js → V7HTGO23.js} +1 -1
- package/build/dist/chunks/{HZSYMGJ2.js → VS7ZA4OF.js} +1 -1
- package/build/dist/chunks/{BJ2U2VXJ.js → VTWAVH74.js} +1 -1
- package/build/dist/chunks/{5GQJVKVY.js → W5GWK72I.js} +1 -1
- package/build/dist/chunks/{65OITTDL.js → W73SLWBT.js} +1 -1
- package/build/dist/chunks/WRA3ZC6W.js +1 -0
- package/build/dist/chunks/{PRBIC3UK.js → WUONMIA2.js} +1 -1
- package/build/dist/chunks/{XL3W7DAQ.js → X3BB6WME.js} +1 -1
- package/build/dist/chunks/{K3TZYPSV.js → X53QVHBC.js} +1 -1
- package/build/dist/chunks/{LVFI74ST.js → XNJ6NDQQ.js} +1 -1
- package/build/dist/chunks/{GBPB7JIB.js → XSQJOOEY.js} +1 -1
- package/build/dist/chunks/XUDQYSPU.js +1 -0
- package/build/dist/chunks/{VKNKVUAA.js → XWZ5SL5Q.js} +1 -1
- package/build/dist/chunks/{365B4YEV.js → XXLQDQEX.js} +1 -1
- package/build/dist/chunks/{BDLV42SD.js → Y5T36EEU.js} +1 -1
- package/build/dist/chunks/{R73R4KN3.js → YBLJ2MCR.js} +1 -1
- package/build/dist/chunks/{WNWRF4HE.js → YZHJ4BAP.js} +1 -1
- package/build/dist/chunks/ZSGW2ZSO.js +1 -0
- package/build/dist/chunks/{HRAHGYNK.js → ZTNBX4VH.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/2QP6WGKZ.js +0 -1
- package/build/dist/chunks/3AOTYJPX.js +0 -1
- package/build/dist/chunks/4E7FJQLL.js +0 -1
- package/build/dist/chunks/4J245N3F.js +0 -1
- package/build/dist/chunks/4M6XBG6X.js +0 -1
- package/build/dist/chunks/BA66J5YQ.js +0 -1
- package/build/dist/chunks/BIY2F6MO.js +0 -1
- package/build/dist/chunks/CZ66MYKR.js +0 -1
- package/build/dist/chunks/DFM4T6ZE.js +0 -1
- package/build/dist/chunks/DGCJZ3HO.js +0 -1
- package/build/dist/chunks/DHX3Q5RV.js +0 -2
- package/build/dist/chunks/DWQJ7NSX.js +0 -1
- package/build/dist/chunks/EFUACKDK.js +0 -1
- package/build/dist/chunks/EQEMI54U.js +0 -1
- package/build/dist/chunks/GYPMUYB5.js +0 -1
- package/build/dist/chunks/JFC2QCMW.js +0 -1
- package/build/dist/chunks/JW7GLNLB.js +0 -3
- package/build/dist/chunks/MEB727X5.js +0 -1
- package/build/dist/chunks/MIKQWF6Q.js +0 -3
- package/build/dist/chunks/MQK6OP7S.js +0 -1
- package/build/dist/chunks/OSMOBKRQ.js +0 -1
- package/build/dist/chunks/P6MPKIU2.js +0 -1
- package/build/dist/chunks/P7C3TYI4.js +0 -1
- package/build/dist/chunks/RN3WUJIO.js +0 -1
- package/build/dist/chunks/TI727O2H.js +0 -1
- package/build/dist/chunks/UHIJMDD2.js +0 -1
- package/build/dist/chunks/VQJXQLFW.js +0 -1
- package/build/dist/chunks/W32UECOL.js +0 -1
- package/build/dist/chunks/WWNAGOCD.js +0 -1
- package/build/dist/chunks/ZNX3YVF2.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
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
|
|
1
|
+
import{a as ke,b as Te}from"./VS7ZA4OF.js";import{b as be,o as we}from"./TTBB6EFN.js";import{a as ye}from"./7WXAS54T.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"./EWZFZUVF.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 +1 @@
|
|
|
1
|
-
import{a as N}from"./A3PN3PK3.js";import{g as O,h as Y}from"./
|
|
1
|
+
import{a as N}from"./A3PN3PK3.js";import{g as O,h as Y}from"./IY7FWTAL.js";import{a as j}from"./43LI5NKJ.js";import{b as s,k as S}from"./EWZFZUVF.js";import{a as n}from"./XSD5NL7J.js";import{getAddress as c}from"viem";var R=["one_hour","six_hours","one_day","seven_days","thirty_days","ninety_days","one_year","inception"],A=["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],P={apy:["v1","apy-averages"],allocations:["v0","allocations"],history:["v0","state/history"],pending_governance:["v0","pending-governance-actions"]};function f(o){if(!o||typeof o!="object"||Array.isArray(o))throw new n("Morpho analytics returned an invalid object.");return o}function _(o){if(typeof o!="string"||!/^\d+$/.test(o)||BigInt(o)>=1n<<256n)throw new n("Morpho analytics returned an invalid decimal base-unit amount.");return o}function H(o,d){let r=f(o);if(![s,String(s)].includes(r.chain_id)||typeof r.vault_address!="string"||c(r.vault_address)!==c(d))throw new n("Morpho analytics returned another chain or vault.")}function b(o,d=0){if(d>12)throw new n("Morpho analytics response is too deeply nested.");if(Array.isArray(o))return o.map(r=>b(r,d+1));if(o&&typeof o=="object")return Object.fromEntries(Object.entries(o).map(([r,e])=>{if(e!==null&&/(?:_assets|_shares|_supply|_cap|_wad|_ray)$/.test(r)&&typeof e!="object")return[r,_(e)];if(e!==null&&/_address$/.test(r)){if(typeof e!="string")throw new n("Morpho analytics returned an invalid address.");return[r,c(e)]}return[r,b(e,d+1)]}));if(typeof o=="number"&&!Number.isFinite(o))throw new n("Morpho analytics returned a non-finite value.");return o}function G(o,d,r){return{name:d,inputSchema:{type:"object",additionalProperties:!1,required:["view"],properties:{view:{type:"string",enum:Object.keys(P),description:'Which analytics to read (required): "apy" realized yield over a lookback; "allocations" where the vault funds sit; "history" past totals and share price; "pending_governance" queued curator changes.'},lookback:{type:"string",enum:R,description:"APY window: one_hour through inception. History: one_day, seven_days, thirty_days, ninety_days, one_year or inception. Defaults to six_hours for APY or seven_days for history."},cursor:{type:"string",maxLength:4096,description:"Opaque cursor from pending_governance only."},limit:{type:"integer",minimum:1,maximum:100,description:"Rows per page, 1 to 100 (defaults to 100). Only for view pending_governance; use cursor for the next page."}},allOf:[{if:{properties:{view:{const:"history",description:'When view is "history".'}},required:["view"]},then:{properties:{lookback:{enum:A,description:"History window: one_day, seven_days, thirty_days, ninety_days, one_year or inception (no sub-day history)."}}}}]},execute:async(e,$)=>{try{if(j($),Object.keys(e).some(t=>!["view","lookback","cursor","limit"].includes(t))||typeof e.view!="string"||!Object.hasOwn(P,e.view))throw new n("Choose a documented Morpho analytics view.");let a=e.view,y=a==="history",w=a==="apy",k=a==="pending_governance";if(e.lookback!==void 0&&(!y&&!w||typeof e.lookback!="string"||!R.includes(e.lookback)))throw new n("lookback is available only for APY/history with a documented window.");if(y&&e.lookback!==void 0&&!A.includes(e.lookback))throw new n(`Choose a history lookback from ${A.join(", ")}; sub-day history is unavailable.`);if(!k&&(e.cursor!==void 0||e.limit!==void 0))throw new n("Pagination applies only to pending_governance.");if(e.cursor!==void 0&&(typeof e.cursor!="string"||e.cursor.length>4096))throw new n("Provide the opaque pending-governance cursor string.");let p=e.limit??100;if(typeof p!="number"||!Number.isInteger(p)||p<1||p>100)throw new n("Pagination limit must be an integer from 1 to 100.");let[q,D]=P[a],u=new URL(`https://api.morpho.org/${q}/vaults-v2/${s}:${c(r)}/${D}`);(y||w)&&u.searchParams.set("lookback",String(e.lookback??(y?"seven_days":"six_hours"))),k&&(u.searchParams.set("limit",String(p)),e.cursor!==void 0&&u.searchParams.set("cursor",e.cursor));let g=await o.http(u.toString(),{headers:{accept:"application/json"},signal:AbortSignal.timeout(15e3)});if(!g.ok)throw new n(`Morpho analytics HTTP ${g.status}. Retry when the service is reachable; no zero APY or empty book was inferred.`);let i=f(await g.json());H(w||a==="allocations"?i.data:i.params,r);let m,h=i.last_indexed_block,x=null,I=!1;if(w){let t=f(i.data);if(t.lookback!==(e.lookback??"six_hours")||t.apy!==null&&(typeof t.apy!="number"||!Number.isFinite(t.apy)||t.apy<-1))throw new n("Morpho analytics returned an invalid APY or lookback.");m={annualYieldFraction:t.apy===null?null:String(t.apy),...t.apy===null?{status:"unavailable",reason:"Not enough history for the requested APY window."}:{},lookback:t.lookback,basis:"Realized post-fee share-price APY, excluding rewards; historical observation, not a promised return."},h=t.last_indexed_block,I=t.apy===0}else if(a==="allocations"){let t=f(i.data);if(!Array.isArray(t.allocations))throw new n("Morpho analytics omitted adapter allocations.");m=b(t.allocations),h=t.last_indexed_block}else{if(!Array.isArray(i.data))throw new n("Morpho analytics omitted its record array.");if(y)for(let t of i.data){let l=f(t);if(typeof l.timestamp!="number"||!Number.isSafeInteger(l.timestamp)||l.timestamp<0)throw new n("Morpho history returned an invalid timestamp.");for(let C of["total_assets","total_supply","withdrawable_assets","allocated_assets","idle_assets"])_(l[C]);l.share_price_ray!==null&&_(l.share_price_ray)}if(k){if(i.cursor!==null&&typeof i.cursor!="string")throw new n("Morpho analytics returned an invalid pagination cursor.");x=i.cursor}m=b(i.data)}h!==void 0&&_(h);let v=o.clientFor(s);if(await v.getChainId()!==s)throw new n("Vault share metadata requires chain 4663.");let T=await N(v,c(r)),M=I&&await Y(v,c(r))===!0?O:void 0;return{vault:c(r),chainId:s,sourceUrl:u.toString(),view:a,lastIndexedBlock:h??null,cursor:x,data:m,...M?{note:M}:{},asset:{address:c(S),symbol:"USDG",decimals:6,chainId:s},shareToken:{address:c(r),symbol:T,decimals:18,chainId:s},scales:{sharePriceRay:"1000000000000000000000000000",capWad:"1000000000000000000"},caveat:"Indexer data may lag the chain. APY excludes rewards; empty records describe only this API window/page. Re-read onchain state and preview before any action. API book data is never executed as calldata automatically."}}catch(a){throw new n(o.plainError(a))}}}}export{G as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,b as p,c as b,e as y,f as F}from"./
|
|
1
|
+
import{a as f,b as p,c as b,e as y,f as F}from"./6AS3TGOX.js";import{a as l,b as h}from"./CZL6T2ZQ.js";import{a as d}from"./ZQ6AF3VX.js";import{a as m}from"./GMMTHTCP.js";import{a as u}from"./UEOS6SHR.js";import{a as o,e as g}from"./XSD5NL7J.js";import{decodeErrorResult as A,getAddress as i,isAddressEqual as w}from"viem";function $(e,r,a=[]){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(t=>!r.includes(t)))throw new o("Unexpected Factor argument.");if(a.some(t=>e[t]===void 0))throw new o("Provide every required Factor input.")}function S(e,r,a=!0){if(typeof e!="string"&&typeof e!="bigint"||!/^[0-9]+$/.test(String(e)))throw new o(`Provide ${r} as a decimal integer string.`);let t=BigInt(e);if(a&&t===0n||t>=2n**256n)throw new o(`${r} must fit a positive uint256.`);return t}function C(e){if(e.chainId!==l.chainId)throw new o("Factor requires Robinhood Chain 4663.");if(!w(i(e.to),h.desk.address))throw new o("Factor calls must target the pinned desk. Nothing was sent.");if(e.value!=="0")throw new o('Factor calls must attach value "0". Nothing was sent.');if(e.gasLimit!==void 0)throw new o("Factor calls use the sender\u2019s gas estimate; omit a fixed gas limit.")}async function x(e,r,a){if(e.network==="testnet")throw new o("Factor requires Robinhood Chain 4663.");let t=i(r),s=e.clientFor(l.chainId),[n,c,T]=await Promise.all([p(s),m(e.http),F(s,t)]);if(f({...n,stateDesk:c==="unreachable"?c:c.desk},a),T)throw new o(u.walletCode);return c}async function E(e,r){return e.readContract({address:h.desk.address,abi:d,functionName:"agent",args:[i(r)]})}async function I(e,r,a){let t=await b(e,S(r,"job"));if(!w(t.agent,i(a)))throw w(await y(e,t.agent),a)?new o(u.lineAccount):new o("Only the job's agent can do this.");return t}function k(e){let r=e;for(let a=0;a<12&&r&&typeof r=="object";a++){let t=r;if(typeof t.data=="string"&&/^0x[0-9a-f]+$/i.test(t.data))try{let s=A({abi:d,data:t.data}),n=s.args?.[0];switch(s.errorName){case"NotAgent":return"Only the job's agent can do this.";case"NotCustomer":return"Only this job\u2019s customer can do this.";case"NotRegistered":return"This wallet has not registered as a Factor agent.";case"AlreadyRegistered":return"This wallet is already registered as a Factor agent.";case"EarlyNotAllowed":return"The customer did not allow an early advance on this job.";case"TooLate":return"It is too late for that on this job.";case"WrongState":return"The job is not in a state that permits this action. Read the job again.";case"OverHalf":return`Advances stop at half the job price; ${String(n)} wei remains drawable.`;case"OverLimit":return`This agent\u2019s pool limit permits ${String(n)} wei now.`;case"PoolShort":return`Factor\u2019s pool has room to advance ${String(n)} wei now.`;case"Barred":return"Factor\u2019s pool no longer advances this agent.";case"ZeroAmount":return"The draw amount must be greater than zero.";case"TooSmall":return`Factor requires at least ${String(n)} wei for a job.`;case"TooSoon":return`Factor permits this action from Unix second ${String(n)}.`;case"BadDueTime":return"The due time must be from 1 hour to 30 days away.";case"GasShort":return"The simulation supplied too little gas for the desk payout. Re-estimate gas.";case"ReentrancyGuardReentrantCall":return"Factor\u2019s desk refused a reentrant call.";case"NothingOwed":return"No Factor payout is waiting for this wallet.";case"OwesThePool":return`The bond cannot leave while ${String(n)} wei is owed to the pool.`;case"OverBond":return`The bond holds only ${String(n)} wei.`;case"PushFailed":return"The recipient refused the Factor payout.";case"ZeroAddress":return"Factor requires a nonzero address."}}catch{}r=typeof t.data=="object"&&t.data!==null?t.data:t.cause??t.error}return g(e)}async function q(e,r,a){C(r);try{await e.call({account:i(a),to:r.to,data:r.data,value:0n})}catch(t){throw new o(`${k(t)} Nothing was sent.`)}}export{$ as a,S as b,C as c,x as d,E as e,I as f,k as g,q as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,b as p}from"./
|
|
1
|
+
import{a as g,b as p}from"./SEXKWYUM.js";import{a as y,b as D,c as m,d as T,e as I}from"./5BPFF7NX.js";import{c as O,d as A,f as P,g as R}from"./OUROA7XR.js";import{b as k,c as x}from"./43LI5NKJ.js";import{b}from"./EWZFZUVF.js";import{a as f}from"./XSD5NL7J.js";import{encodeFunctionData as C,zeroAddress as N}from"viem";function v(t=10){if(!Number.isInteger(t)||t<0||t>50)throw new f("Oak won't accept a cash-out reduction that big. Use a whole number from 0 to 50 bps (0.5%).");return t}async function z(t,e,a,u=10,r){let l=v(u);p(a,!0),m(e.tokensOut.some(n=>T(n,e.inputToken)),"the market input token cannot be redeemed from SY");try{let n=await t.client.getBlock();m(e.expired&&n.timestamp>=BigInt(e.expiry),"this term has not ended; wait for its end date");let h=p((await t.client.simulateContract({address:e.yt,abi:g,functionName:"pyIndexCurrent",blockNumber:n.number})).result,!0);for(let o of[e.syDecimals,e.ptDecimals])m(Number.isInteger(o)&&o>=0&&o<=77,"unreadable token decimals");let d=a*10n**18n*10n**BigInt(e.syDecimals)/(h*10n**BigInt(e.ptDecimals));p(d,!0);let i=p(await t.client.readContract({address:e.sy,abi:g,functionName:"previewRedeem",args:[e.inputToken,d],blockNumber:n.number}),!0),s=I(i,l);if(m(s>0n,"this cash-out amount is too small"),r&&(r.apiAmountOut>i?r.apiAmountOut-i:i-r.apiAmountOut)*10000n>i*50n)try{r.note("Pendle\u2019s API cash-out estimate differs from the chain by over 0.5%. Oak kept the chain estimate.")}catch{}let c={tokenOut:e.inputToken,minTokenOut:s,tokenRedeemSy:e.inputToken,pendleSwap:N,swapData:{swapType:0,extRouter:N,extCalldata:"0x",needScale:!1}},w=k({to:y,data:C({abi:D,functionName:"redeemPyToToken",args:[t.wallet,e.yt,a,c]}),value:"0",chainId:b,description:"Cash out ended Pendle PT to its input token."});return{txs:[x(e.pt,y,a.toString(),b),w],expected:i,minOut:s,summary:"Approve the exact PT amount, then cash out the ended term to its input token."}}catch(n){throw n instanceof f?n:new f("Oak could not read the Pendle cash-out amount from the chain. Try again.")}}async function F(t,e,a,u,r){let l=new AbortController,n;try{let h=new Promise(o=>{n=setTimeout(()=>{l.abort(),o(void 0)},1500)}),d=await Promise.race([R((o,B)=>t.http(o,{...B,signal:l.signal}),{inputToken:e.pt,outputToken:e.inputToken,amount:a,wallet:t.wallet,slippageBps:r}),h]);if(!d)return;let i=P(d.body).outputs;if(i.length!==1)return;let s=O(i[0]);if(!T(s.token,e.inputToken))return;let c=A(s.amount);return(c>u?c-u:u-c)*10000n>u*50n?"Pendle\u2019s API cash-out estimate differs from the chain by over 0.5%. Oak kept the chain estimate.":void 0}catch{return}finally{n!==void 0&&clearTimeout(n)}}export{v as a,z as b,F as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./
|
|
1
|
+
import{j as p}from"./6EWSLHXL.js";import{a as d}from"./7WXAS54T.js";import{a as f}from"./43LI5NKJ.js";import{d as a,i as c}from"./NWNYJ26T.js";import{b as m}from"./IX3GZMTM.js";import{b as i}from"./EWZFZUVF.js";import{a as s}from"./XSD5NL7J.js";import{erc20Abi as u,zeroAddress as b}from"viem";function T(r,n,e=256,t=!1){if(typeof r!="string"||!/^[0-9]+$/.test(r))throw new s(`${n} must be a decimal base-unit string.`);let o=m(r);if(!t&&o===0n||o>=1n<<BigInt(e))throw new s(`${n} must be ${t?"a":"a positive"} uint${e}.`);return o}function g(r){return c(r,"Provide a token or contract address.",a)}function E(r){return typeof r=="string"&&["eth",d.toLowerCase()].includes(r.toLowerCase())?b:g(r)}function D(r){let n=r??50;if(typeof n!="number"||!Number.isInteger(n)||n<0||n>=1e4)throw new s("Slippage must be an integer from 0 to 9999 bps.");return n}async function N(r,n,e){if(n===b)return{address:d,symbol:"ETH",decimals:18,chainId:i};let t=r.clientFor(i),[o,w]=await Promise.all([t.readContract({address:n,abi:u,functionName:"symbol",blockNumber:e}),t.readContract({address:n,abi:u,functionName:"decimals",blockNumber:e})]);return{address:n,symbol:p(o,n),decimals:w,chainId:i}}async function S(r,n,e,t){return f(e),{txs:n,preview:await r.preview(n,e),summary:t}}function $(r,n){if(Object.keys(r).some(e=>!n.includes(e)))throw new s(`Provide only ${n.join(", ")}.`)}export{T as a,g as b,E as c,D as d,N as e,S as f,$ as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./
|
|
1
|
+
import{a as A}from"./Q43WPRYU.js";import{a as i,b as w,c as b,e as C,f as x,g as h}from"./QP2B7AYX.js";import{a as o}from"./66F5ZH34.js";import{c as y}from"./NWNYJ26T.js";import{b as f}from"./EWZFZUVF.js";import{a as s}from"./XSD5NL7J.js";import{encodeAbiParameters as S,encodeFunctionData as g,encodePacked as T,erc20Abi as I,getAddress as q,parseAbi as B,parseAbiParameters as D,zeroAddress as R}from"viem";var L=q("0x0000ffffbe8efe702c8703ae3477ff5de3d319c0"),N=D("(address currency,address tokensRecipient,address fundsRecipient,uint64 startBlock,uint64 endBlock,uint64 claimBlock,uint256 tickSpacing,address validationHook,uint256 floorPrice,uint128 requiredCurrencyRaised,bytes auctionStepsData)"),P=B(["function create(address token,uint256 amount,bytes configData,bytes32 salt) returns (address)","function getAddress(address token,uint256 amount,bytes configData,bytes32 salt,address sender) view returns (address)"]),O=B(["function distributeToken(address token,(address strategy,uint128 amount,bytes configData) distribution,bytes32 salt) payable"]),v={token:{...y,description:"Address of the ERC-20 sale token to distribute in this auction."},amount:o('Amount of sale token in base units; use sale token decimals. Example: "1000000" = 1 sale token at 6 decimals.'),currency:{...y,description:"Payment currency address; the zero address means native ETH."},startBlock:o("Future block number at which auction bidding starts, as a decimal string."),endBlock:o("Block number at which auction bidding ends, as a decimal string."),claimBlock:o("First block number at which auction tokens can be claimed, as a decimal string."),tickSpacing:o("Auction price tick spacing in Q96 payment-currency base units per sale-token base unit."),floorPrice:o("Auction floor price in Q96 payment-currency base units per sale-token base unit."),requiredCurrencyRaised:o('Minimum amount of payment currency in base units; use payment currency decimals. Example: "1000000" = 1 payment currency at 6 decimals.'),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}$"},steps:{description:"Auction issuance steps; durations must cover endBlock minus startBlock and mps times duration must total 10000000.",type:"array",minItems:1,maxItems:100,items:{type:"object",additionalProperties:!1,required:["mps","duration"],properties:{mps:o("Issuance rate per block in MPS units; sum of mps times duration across steps must equal 10000000."),duration:o("Duration of this issuance step in blocks, as a decimal string.")}}}};function $(e,t){let r=i(e.startBlock,"startBlock",64),n=i(e.endBlock,"endBlock",64),c=i(e.claimBlock,"claimBlock",64);if(n<=r||c<n)throw new s("Auction needs startBlock < endBlock <= claimBlock.");if(!Array.isArray(e.steps)||e.steps.length<1||e.steps.length>100)throw new s("Provide 1 to 100 issuance steps.");let u="0x",p=0n,l=0n;for(let d of e.steps){if(!d||typeof d!="object"||Array.isArray(d))throw new s("Each step requires mps and duration decimal strings.");h(d,["mps","duration"]);let a=d,k=i(a.mps,"mps",24,!0),m=i(a.duration,"duration",40);u=`${u}${T(["uint24","uint40"],[Number(k),Number(m)]).slice(2)}`,l+=k*m,p+=m}if(l!==10000000n||p!==n-r)throw new s("Issuance must total exactly 10000000 MPS and its durations must equal endBlock - startBlock.");return S(N,[{currency:b(e.currency),tokensRecipient:t,fundsRecipient:t,startBlock:r,endBlock:n,claimBlock:c,tickSpacing:i(e.tickSpacing,"tickSpacing"),validationHook:R,floorPrice:i(e.floorPrice,"floorPrice"),requiredCurrencyRaised:i(e.requiredCurrencyRaised??"0","requiredCurrencyRaised",128,!0),auctionStepsData:u}])}function z(e){return{tools:[{name:"uniswap_create_auction",inputSchema:{type:"object",additionalProperties:!1,required:["token","amount","currency","startBlock","endBlock","claimBlock","tickSpacing","floorPrice","steps","salt"],properties:v},async execute(t,r){h(t,Object.keys(v));let n=w(t.token),c=i(t.amount,"amount",128);if(n===R||n===b(t.currency))throw new s("Auction sale token must be an ERC-20 distinct from its payment currency.");let u=$(t,r);if(typeof t.salt!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t.salt))throw new s("Provide a 32-byte deployment salt.");let p=t.salt,l=e.clientFor(f),d=await l.getBlockNumber();if(BigInt(String(t.startBlock))<=d)throw new s("Choose a future auction startBlock with time for confirmation and approvals.");let a=await l.readContract({address:A,abi:P,functionName:"getAddress",args:[n,c,u,p,r]});if((await l.getCode({address:a})??"0x")!=="0x")throw new s("This auction already exists; choose a fresh salt or configuration.");let k=await C(e,n),m=[e.unsignedTx({to:A,data:g({abi:P,functionName:"create",args:[n,c,u,p]}),value:"0",chainId:f,description:`Create CCA ${a}; proceeds and unsold tokens go to ${r}.`}),e.unsignedTx({to:n,data:g({abi:I,functionName:"transfer",args:[a,c]}),value:"0",chainId:f,description:`Fund the factory-predicted auction ${a} with exactly ${c} base units of ${n}.`}),e.unsignedTx({to:a,data:g({abi:B(["function onTokensReceived()"]),functionName:"onTokensReceived"}),value:"0",chainId:f,description:`Activate CCA ${a} after its sale tokens arrive.`})];return{...await x(e,m,r,"Create/fund/activate a standalone CCA in three separately confirmed transactions, not an LBP-managed liquidity launch. If interrupted, inspect the predicted address and journal before recovery; do not transfer tokens twice. Raw prices are payment-base-units per sale-token-base-unit in Q96. No validation hook or off-chain signature; all proceeds and unsold tokens go to the signing wallet."),auction:a,sale:{token:k,amount:c.toString()}}}}]}}export{L as a,N as b,P as c,O as d,$ as e,z as f};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as o,b as C,c as K,d as F,e as E,f as D}from"./4ZD5D2UP.js";import{h as H}from"./
|
|
1
|
+
import{a as o,b as C,c as K,d as F,e as E,f as D}from"./4ZD5D2UP.js";import{h as H}from"./TNHU5UBQ.js";import{c as U}from"./43LI5NKJ.js";import{e as N,g as R,h as l}from"./NWNYJ26T.js";import{a as P}from"./XSD5NL7J.js";import{decodeFunctionData as y,encodeFunctionData as k,erc20Abi as _,getAddress as q,isAddress as G,zeroAddress as h}from"viem";var X=15000000n,j=1200,L="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",w=n=>(1n<<BigInt(n))-1n;function S(n){throw new P(`FOBO ${n}. Nothing was signed. Ask for a fresh summary.`)}function i(n,e){n||S(e)}function I(n,e){return i(typeof n=="string"&&G(n,{strict:!1}),e),q(n)}function m(n,e,s){i(l(I(n,s),I(e,s)),s)}function T(n,e,s=256){i(typeof n=="string"&&n.length<=80&&/^(?:[0-9]+|0x[0-9a-fA-F]+)$/.test(n),`${e} must be an unsigned integer`);let r=BigInt(n);return i(r<=w(s),`${e} is too large`),r}function p(n,e,s=256){return i(typeof n=="bigint"&&n>=0n&&n<=w(s),`${e} is invalid`),n}function B(n){i(Number.isSafeInteger(n)&&n>=0&&n<=Number(w(48))-1800,"clock is invalid")}var $=120;function v(n,e){i(R(n,e),"calldata must be canonical")}function M(n,e){return l(n.currency0,e.currency0)&&l(n.currency1,e.currency1)&&l(n.hooks,e.hooks)&&n.fee===e.fee&&n.tickSpacing===e.tickSpacing}function W(n){i([o.permit2,o.factory,o.limitOrders].some(e=>l(n,e)),"approval spender is not pinned")}function J(n,e,s){let r=I(n,"approval token is invalid");return i(r!==h&&!l(r,L),"approval token cannot be native ETH"),W(I(e,"approval spender is invalid")),i(p(s,"approval amount")<w(256),"approval amount cannot be unlimited"),U(r,q(e),s.toString(),o.chainId)}function oe(n){let e=I(n.token,"permit token is invalid");i(e!==h&&!l(e,L),"permit token cannot be native ETH"),i(p(n.amount,"permit amount",160)>0n&&n.amount<w(160),"permit amount must be exact and positive"),i(Number.isSafeInteger(n.nonce)&&n.nonce>=0&&n.nonce<=Number(w(48)),"permit nonce is invalid"),B(n.now);let s=n.now+j;return{domain:{name:"Permit2",chainId:o.chainId,verifyingContract:o.permit2},types:{PermitDetails:[{name:"token",type:"address"},{name:"amount",type:"uint160"},{name:"expiration",type:"uint48"},{name:"nonce",type:"uint48"}],PermitSingle:[{name:"details",type:"PermitDetails"},{name:"spender",type:"address"},{name:"sigDeadline",type:"uint256"}]},primaryType:"PermitSingle",message:{details:{token:e,amount:n.amount.toString(),expiration:s,nonce:n.nonce},spender:o.router,sigDeadline:s.toString()}}}function re(n,e,s){try{return Q(n,e,s)}catch(r){if(r instanceof P&&r.message.startsWith("FOBO ")&&r.message.includes("Nothing was signed."))throw r;S("transaction could not be decoded and verified")}}function Q(n,e,s){i(N(n),"transaction is invalid"),i(n.chainId===o.chainId||n.chainId==="0x1237","chain must be 4663"),m(n.from,s,"wallet does not match the transaction sender");let r=I(n.to,"contract address is invalid");i(typeof n.data=="string"&&/^0x(?:[0-9a-fA-F]{2}){4,}$/.test(n.data),"selector or calldata is invalid");let d=T(n.value,"value"),c=T(n.gas,"gas");i(c>=21000n&&c<=X,"gas is outside the signing ceiling");let O=n.data.slice(0,10).toLowerCase(),f=(t,a)=>{m(r,t,"contract does not match the approved action"),i(O===a,"selector is not pinned for this contract")},A;switch(e.kind){case"approval":{i(l(r,e.token),"approval token differs from the approved input"),i(O===o.selectors.approve,"selector is not an ERC-20 approval"),i(d===0n,"approval value must be zero");let t=y({abi:_,data:n.data});i(t.functionName==="approve","selector is not an ERC-20 approval"),v(n.data,k({abi:_,functionName:"approve",args:t.args}));let[a]=t.args;return W(a),m(a,e.spender,"approval spender differs from the approved action"),{...J(r,a,e.amount),gasLimit:c.toString()}}case"trade":{f(o.router,o.selectors.execute),B(e.now);let t=H(n.data,[o.hook,h]);i(e.pools.length>0&&t.legs.length===e.pools.length&&t.legs.some(u=>l(u.poolKey.hooks,o.hook))&&t.legs.every((u,b)=>M(u.poolKey,e.pools[b])),"swap pools differ from the approved route");let a={currency0:h,currency1:o.usdg,fee:500,tickSpacing:10,hooks:h};if(i(t.legs.every(u=>l(u.poolKey.hooks,o.hook)||M(u.poolKey,a)),"swap contains an unsupported hookless pool"),m(t.currencyIn,e.currencyIn,"swap input currency differs"),m(t.currencyOut,e.currencyOut,"swap output currency differs"),i(t.amountIn===p(e.amountIn,"swap amount")&&t.amountIn>0n,"swap input amount differs"),i(t.amountOutMinimum>=p(e.minOut,"minimum output")&&e.minOut>0n,"swap minimum output is below the approved minimum"),i(t.deadline>BigInt(e.now)&&t.deadline<=BigInt(e.now+1200+$),"swap deadline must be within 20 minutes"),i(d===(l(e.currencyIn,h)?e.amountIn:0n),"swap ETH value differs from the approved input"),t.permit){let u=e.permit;i(u,"swap encodes an unexpected permit"),m(u.details.token,e.currencyIn,"permit token differs from the trade input"),i(T(u.details.amount,"permit amount",160)===e.amountIn&&e.amountIn<w(160),"permit amount differs from the exact trade input"),m(u.spender,o.router,"permit spender must be the Universal Router");let b=T(u.sigDeadline,"permit deadline");i(Number.isSafeInteger(u.details.expiration)&&u.details.expiration>e.now&&BigInt(u.details.expiration)<=b&&b>=BigInt(e.now+300)&&b<=BigInt(e.now+1800),"permit expiration or signature deadline is outside the signing window");let g=t.permit;i(l(g.token,u.details.token)&&g.amount===e.amountIn&&g.expiration===u.details.expiration&&g.nonce===u.details.nonce&&l(g.spender,u.spender)&&g.sigDeadline===b,"swap permit differs from the locally signed exact permit")}else i(!e.permit,"swap omitted the locally signed permit");A=`FOBO swap: exact input ${t.amountIn}; minimum output ${t.amountOutMinimum}.`;break}case"launch":{f(o.factory,o.selectors.launch),B(e.now);let t=y({abi:C,data:n.data});v(n.data,k({abi:C,...t}));let[a]=t.args;i(a.name===e.name&&a.ticker===e.ticker,"launch name or ticker differs from the approved launch"),m(a.quote,e.pair,"launch pair differs from the approved launch"),i(a.devBuyTokens===p(e.devBuyTokens,"initial buy")&&a.devBuyTokens<=50000000n*10n**18n&&a.devBuyMaxCost===p(e.devBuyMaxCost,"initial buy cost"),"launch initial buy or cost differs"),i(a.vestMonths===e.vestMonths&&[0,1,3,6,12].includes(a.vestMonths)&&(a.vestMonths===0||a.devBuyTokens>0n),"launch lock months differ"),i(a.deadline>BigInt(e.now)&&a.deadline<=BigInt(e.now+900+$),"launch deadline must be within 15 minutes"),i(d===p(e.launchFeeWei,"launch fee")+(l(a.quote,h)?a.devBuyMaxCost:0n),"launch ETH value differs from its fee plus initial buy"),A="Launch the approved FOBO token with its approved initial buy and lock.";break}case"limitOrder":{f(o.limitOrders,o.selectors.place);let t=y({abi:F,data:n.data});i(t.functionName==="place","selector is not place"),v(n.data,k({abi:F,...t}));let[a,u,b,g,z,V,Z]=t.args;i((a===0||a===1)&&a===e.side,"limit order side differs"),m(u,e.token,"limit order token differs"),m(b,e.payToken,"limit order pay token differs"),i(g===p(e.amount,"order amount")&&g>0n&&z===p(e.limitPriceUsdE18,"limit price")&&V===p(e.expiry,"order expiry")&&Z===p(e.maxFeePerFill,"keeper fee"),"limit order amount, price, expiry or keeper fee differs"),i(d===(a===0&&l(b,h)?g:0n),"limit order ETH value differs from its native escrow"),A="Place the approved FOBO limit order; escrow refunds and fills belong to this wallet.";break}case"cancel":{f(o.limitOrders,o.selectors.cancel),i(d===0n,"cancel value must be zero");let t=y({abi:F,data:n.data});i(t.functionName==="cancel","selector is not cancel"),v(n.data,k({abi:F,...t})),i(t.args[0]===p(e.orderId,"order id"),"cancel order differs"),m(t.args[1],s,"cancel recipient must be this wallet"),A="Cancel the approved FOBO order and refund this wallet.";break}case"claim":{if(i(d===0n,"claim value must be zero"),e.claimKind==="creator"){f(o.hook,o.selectors.claimCreator);let t=y({abi:K,data:n.data});v(n.data,k({abi:K,...t})),i(M(t.args[0],e.poolKey)&&l(t.args[0].hooks,o.hook),"creator claim pool differs"),m(t.args[1],s,"creator claim recipient must be this wallet")}else if(e.claimKind==="referral"){f(o.revenue,o.selectors.claimReferral);let t=y({abi:E,data:n.data});v(n.data,k({abi:E,...t})),m(t.args[0],s,"referral claim account must be this wallet"),m(t.args[1],e.currency,"referral claim currency differs"),m(t.args[2],e.recipient??s,"referral claim recipient differs from the approved recipient")}else{i(e.claimKind==="vesting","claim kind is unsupported"),f(o.vesting,o.selectors.claimVesting);let t=y({abi:D,data:n.data});v(n.data,k({abi:D,...t})),i(t.args[0]===p(e.lockId,"vesting lock"),"vesting lock differs"),m(e.beneficiary,s,"vesting beneficiary must be this wallet")}A="Claim the approved FOBO earnings to their approved recipient.";break}default:S("transaction expectation is unsupported")}return{to:r,data:n.data,value:d.toString(),chainId:o.chainId,gasLimit:c.toString(),description:A}}function ae(n,e,s){let r="sign-in message is not a fresh fobo.fun sign-in for this wallet";try{B(s),i(typeof n=="string"&&n.length<=2048&&!/[\r\p{Cc}\p{Cf}]/u.test(n.replaceAll(`
|
|
2
2
|
`,"")),r);let d=n.split(`
|
|
3
3
|
`);i(["fobo.fun wants you to sign in with your Ethereum account:","fobo.fun wants you to sign in with your wallet:"].includes(d[0]??"")&&d[2]==="",r),m(d[1],e,r);let c=3;d[c]!=="URI: https://fobo.fun"&&d[c]!=="URI: https://fobo.fun/"&&(i(["Sign in to fobo.fun","Sign in to fobo.fun.","Sign in to FOBO.","Sign in to fobo.","Sign in to FOBO. This is free: no transaction, no gas."].includes(d[c]??"")&&d[c+1]==="",r),c+=2),i(["URI: https://fobo.fun","URI: https://fobo.fun/"].includes(d[c]??""),r),c+=1,d[c]?.startsWith("Version:")&&(i(d[c]==="Version: 1",r),c++),d[c]?.startsWith("Chain ID:")&&(i(d[c]==="Chain ID: 4663",r),c++),i(/^Nonce: [a-zA-Z0-9]{8,128}$/.test(d[c]??""),r);let O=d[c+1]?.match(/^Issued At: (\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z)$/)?.[1];i(O&&d.length===c+2,r);let f=Math.floor(Date.parse(O)/1e3);i(Number.isFinite(f)&&f<=s+2&&f>=s-300,r)}catch{S(r)}}export{X as a,J as b,oe as c,re as d,ae as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as p,f as s,i as d,j as u,p as P}from"./UMY6SP7C.js";import{a as o}from"./XSD5NL7J.js";import{decodeAbiParameters as R,encodeAbiParameters as x,keccak256 as M,parseAbi as C,stringToHex as $,zeroAddress as f}from"viem";var l={id:"market-hours-fee",supported:!0,contract:"HookrSessionAdvisory",address:"0x78Bc6b7302Dda8632e661c8d74966bdBea1c66b1",source:"src/extensions/HookrSessionAdvisory.sol",advisoryTerms:"regularPips:uint24, preMarketPips:uint24, afterHoursPips:uint24, overnightPips:uint24, closedPips:uint24, openRampSeconds:uint16, closeRampSeconds:uint16, flags:uint8",payment:"Returns an LP fee surcharge.",wiring:"Requires a separate session advisory binding and verified calendar, phase, gas and fee-cap handling."},h=[{type:"tuple",components:[{name:"regularPips",type:"uint24"},{name:"preMarketPips",type:"uint24"},{name:"afterHoursPips",type:"uint24"},{name:"overnightPips",type:"uint24"},{name:"closedPips",type:"uint24"},{name:"openRampSeconds",type:"uint16"},{name:"closeRampSeconds",type:"uint16"},{name:"flags",type:"uint8"}]}];function k(r){p(r,["regularPips","preMarketPips","afterHoursPips","overnightPips","closedPips","openRampSeconds","closeRampSeconds","flags"],["regularPips","preMarketPips","afterHoursPips","overnightPips","closedPips","openRampSeconds","closeRampSeconds","flags"]);let e={regularPips:Number(s(r.regularPips,24)),preMarketPips:Number(s(r.preMarketPips,24)),afterHoursPips:Number(s(r.afterHoursPips,24)),overnightPips:Number(s(r.overnightPips,24)),closedPips:Number(s(r.closedPips,24)),openRampSeconds:Number(s(r.openRampSeconds,16)),closeRampSeconds:Number(s(r.closeRampSeconds,16)),flags:Number(s(r.flags,8))};if(e.flags>1||e.openRampSeconds+e.closeRampSeconds>12600||Math.max(e.regularPips,e.preMarketPips,e.afterHoursPips,e.overnightPips,e.closedPips)>6e5)throw new o("Invalid market-hours-fee advisory terms.");return x(h,[e])}function w(r){let[e]=R(h,r),n=Object.fromEntries(Object.entries(e).map(([a,t])=>[a,String(t)]));if(k(n).toLowerCase()!==r.toLowerCase())throw new o("Non-canonical market-hours-fee advisory terms.");return e}function O(r){let e=w(r);return`Market hours LP surcharge: regular ${e.regularPips}, pre-market ${e.preMarketPips}, after-hours ${e.afterHoursPips}, overnight ${e.overnightPips}, closed ${e.closedPips} pips; open and close ramps ${e.openRampSeconds}/${e.closeRampSeconds} seconds, flags ${e.flags}. Surcharge is an LP fee for in-range LPs, clipped to available pool fee room, including during the launch guard.`}var A={address:l.address,codeHash:"0x0e33fd89175de3909a2a51a4d93c0bd359b17dd9396dd49faeea0d49370d6e18",schemaHash:M($("SessionSchedule(uint24 regularPips,uint24 preMarketPips,uint24 afterHoursPips,uint24 overnightPips,uint24 closedPips,uint16 openRampSeconds,uint16 closeRampSeconds,uint8 flags)")),phaseMask:1,feeOnly:!0,failOpen:!1,gasMin:15e4},N=C(["function owner() view returns (address)","function lastCoveredYear() view returns (uint256)","function pendingOwner() view returns (address)","function delay() view returns (uint48)"]);async function T(r,e,n){p(n,["terms","owner","lastCoveredYear"],["terms","owner","lastCoveredYear"]);let a=d(n.owner);if(a===f)throw new o("Calendar governance owner must be nonzero.");let t=s(n.lastCoveredYear,256),c=k(p(n.terms,["regularPips","preMarketPips","afterHoursPips","overnightPips","closedPips","openRampSeconds","closeRampSeconds","flags"],["regularPips","preMarketPips","afterHoursPips","overnightPips","closedPips","openRampSeconds","closeRampSeconds","flags"])),[v,y,b,S]=await Promise.all(["owner","lastCoveredYear","pendingOwner","delay"].map(H=>P(r,l.address,N,H,[],e)));if(v!==a||u(y)!==t)throw new o("Calendar owner or coverage differs at the named block.");let m=d(b),g=u(S,48);if(m!==f)throw new o(`Market hours fee refused: an ownership transfer to ${m} is pending on advisory ${l.address}. Whoever accepts it controls the calendar that sets this pool's surcharge. Retry after the transfer is accepted or cancelled, naming the owner you then see.`);let i=w(c);return{data:c,summary:`${O(c)} Calendar covers through ${t}; owner ${a} may append years and mark weekdays closed or early-close after a timelock of ${g} seconds. No ownership transfer is pending at the checked block. The owner is not fixed by this launch and can change later; an ownership transfer waits the same timelock and must then be accepted. Outside calendar coverage, the flag controls whether weekdays use the closed surcharge.`,delaySeconds:g,descriptor:A,phases:1,requiredCaps:{maxLpFeePips:BigInt(Math.max(i.regularPips,i.preMarketPips,i.afterHoursPips,i.overnightPips,i.closedPips)),maxQuoteTakePips:0n,maxSubjectTakeBps:0n},owner:a,lastCoveredYear:t}}export{l as a,k as b,w as c,O as d,A as e,N as f,T as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./XSD5NL7J.js";var c={tickSpacing:200,baseLpFeePips:3e3,deadlineSeconds:300n};function d(o){return o?"Arb recapture: ON, 25% to a closed source executor, 15% Hookr, 60% LPs; swaps need a high gas limit; cannot be changed. Oak read the executor share (25%) on chain; the 15% Hookr and 60% LP shares are Hookr's published split, not read by Oak":"Arb recapture: OFF, cannot be added later"}var h=1<<18,i=["market-guard","market-hours-fee","managed-fee","zap-source","zap-target","swap-reward-mint"];function u(o,r,a){let n=o===void 0?"agents-only":o;if(n!=="agents-only"&&n!=="open")throw new e("Choose launchProfile agents-only or open.");let t=a.filter(s=>i.includes(s.id));if(t.length>1)throw new e("A Hookr pool has one advisory slot. Choose exactly one advisory Hook Block.");if(n==="agents-only"){if(t.length)throw new e("The agent gate and an advisory Hook Block both need the one advisory slot. Choose launchProfile open and omit agentGate to use this block.");if(r==null)throw new e("An agents-only launch requires explicit agentGate terms.")}else{if(r!==void 0)throw new e("An open launch uses its advisory Hook Block instead of the agent gate. Omit agentGate.");if(t.length!==1)throw new e("Choose exactly one advisory Hook Block for an open launch.")}return{kind:n,advisory:t[0]??null}}export{c as a,d as b,h as c,i as d,u as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,d as y,e as m}from"./
|
|
1
|
+
import{a as o,d as y,e as m}from"./BWE5PXRE.js";import{a as l}from"./66F5ZH34.js";import{b as c}from"./EWZFZUVF.js";import{a as d}from"./XSD5NL7J.js";import{concatHex as x,encodeAbiParameters as P,encodeFunctionData as w,getAddress as u,keccak256 as f,parseAbi as k,stringToHex as I}from"viem";var g=k(["function ownerOf(uint256) view returns (address)","function tokenURI(uint256) view returns (string)","function setMetadata(uint256,string,bytes)","function approve(address,uint256)"]),v=k(["function listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))","function recordHash(uint256) view returns (bytes32)"]),C=(t,r)=>f(x(BigInt(t)<BigInt(r)?[t,r]:[r,t]));function _(t){if(!Array.isArray(t)||t.length<1||t.length>1e4)throw new d("Provide 1 to 10000 identity IDs.");let r=[...new Set(t.map(e=>m(e,"agentIds").toString()))].sort((e,a)=>BigInt(e)<BigInt(a)?-1:1),i=[r.map(e=>f(f(P([{type:"uint256"}],[BigInt(e)]))))];for(;i.at(-1).length>1;){let e=i.at(-1),a=[];for(let s=0;s<e.length;s+=2)a.push(e[s+1]?C(e[s],e[s+1]):e[s]);i.push(a)}return{root:i.at(-1)[0],ids:r,proofs:r.map((e,a)=>{let s=[],p=a;for(let b of i.slice(0,-1)){let h=b[p^1];h&&s.push(h),p=Math.floor(p/2)}return{agentId:e,proof:s}})}}function S(t){return{tools:[{name:"priors_market_origin",inputSchema:{type:"object",properties:{agentIds:{type:"array",minItems:1,maxItems:1e4,items:l(),description:"Exact ERC-8004 agent ID list (decimal strings, 1 to 10000) to commit in a bid_any Merkle root."}},required:["agentIds"],additionalProperties:!1},async execute(r){return{chainId:c,..._(r.agentIds),caveat:"Locally commits exactly these IDs. This does not verify third-party origin, quality, current owner or a seller claim."}}},{name:"priors_market_pins",inputSchema:{type:"object",properties:{agentId:l('ERC-8004 agent ID whose listing pins to read, as a decimal string. Example: "437".')},required:["agentId"],additionalProperties:!1},async execute(r){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let n=m(r.agentId,"agentId"),i=t.clientFor(c),e=await i.getBlockNumber({cacheTime:0}),[a,s,p]=await Promise.all([i.readContract({address:o.market,abi:v,functionName:"listingOf",args:[n],blockNumber:e}),i.readContract({address:o.market,abi:v,functionName:"recordHash",args:[n],blockNumber:e}),i.readContract({address:o.registry,abi:g,functionName:"tokenURI",args:[n],blockNumber:e})]);return{chainId:c,blockNumber:e.toString(),listing:y(a),recordHash:s,currentUriHash:f(I(p)),caveat:"Pins bind identity file and credit state, not included code, servers or keys. Listing and current URI hashes may differ; preview refuses an altered listing."}}},{name:"priors_market_clear_bid_budget",inputSchema:{type:"object",properties:{},additionalProperties:!1},async execute(r,n){if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");let i=[t.approval(o.usdg,o.bidSpender,"0",c)],e=await t.preview(i,u(n));return{txs:i,summary:`Clear all this wallet future bid spending allowance to ${o.bidSpender}. Existing bids cannot fill from it until approved again. ${e.summary}`}}},{name:"priors_market_revoke_nft",inputSchema:{type:"object",properties:{agentId:l('ERC-8004 agent ID whose single-NFT market approval to clear, as a decimal string. Example: "437".')},required:["agentId"],additionalProperties:!1},async execute(r,n){let i=m(r.agentId,"agentId");if(t.network==="testnet")throw new d("Priors market requires mainnet chain 4663.");if(u(await t.clientFor(c).readContract({address:o.registry,abi:g,functionName:"ownerOf",args:[i]}))!==u(n))throw new d("Only current NFT owner may revoke this per-token approval.");let e=[t.unsignedTx({to:o.registry,data:w({abi:g,functionName:"approve",args:["0x0000000000000000000000000000000000000000",i]}),value:"0",chainId:c,description:`Revoke exact ERC-8004 NFT ${i} market approval.`})],a=await t.preview(e,n);return{txs:e,summary:`Clear this identity per-token transfer approval. Also cancel its listing before granting any new market approval. ${a.summary}`}}},{name:"priors_x_link",inputSchema:{type:"object",properties:{agentId:l('ERC-8004 agent ID this wallet owns, as a decimal string. Example: "437".'),postUrl:{type:"string",maxLength:160,description:"Canonical https://x.com/<handle>/status/<id> owner proof post URL, or empty to unlink. Owner creates the public post themselves."}},required:["agentId","postUrl"],additionalProperties:!1},async execute(r,n){if(t.network==="testnet")throw new d("Priors X metadata is mainnet only.");let i=m(r.agentId,"agentId");if(u(await t.clientFor(c).readContract({address:o.registry,abi:g,functionName:"ownerOf",args:[i]}))!==u(n))throw new d("Only the identity owner can link or clear X metadata.");if(typeof r.postUrl!="string"||r.postUrl!==""&&!/^https:\/\/x\.com\/[A-Za-z0-9_]{1,15}\/status\/[0-9]{1,30}$/.test(r.postUrl))throw new d("Provide a canonical X status URL or empty string to unlink.");let e=[t.unsignedTx({to:o.registry,data:w({abi:g,functionName:"setMetadata",args:[i,"x",I(r.postUrl)]}),value:"0",chainId:c,description:"Set/clear the owner identity X proof-post metadata."})],a=await t.preview(e,n);return{txs:e,summary:`Publish ${r.postUrl?"the specified X post URL":"empty X metadata"} on public ERC-8004 identity ${i}. Priors independently verifies the post; metadata alone does not prove the X account or affect credit terms. ${a.summary}`}}}]}}export{_ as a,S as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./K5OXLIPK.js";import{o as d}from"./S65KXMZ7.js";import{h as r}from"./QA6Z2CYP.js";import{a as i}from"./CFPJDLTZ.js";import{getAddress as h}from"viem";var u=t=>BigInt(t.replace(".","")),C=t=>`${t/100n}.${(t%100n).toString().padStart(2,"0")}`;async function B(t,p,l,m){let e=await d(t,p,l,m),s=await c({clientFor:t.clientFor,oakTokenAddress:h(i.oak)},[e.net,...e.stakedBacking.assets,e.pendingChop,e.claimableChop]),a=s.slice(1,1+e.stakedBacking.assets.length),o=a.length>0&&a.every(n=>n.usdEstimate!==null),g=o?C(a.reduce((n,k)=>n+u(k.usdEstimate),0n)):null;return{...e,net:s[0],chopSwapNotice:r,stakedBacking:{...e.stakedBacking,assets:a},stakedLp:{...e.stakedLp,usdEstimate:g,estimateLabel:o?"estimate, not a quote":"price unavailable",...o?{estimateSource:"Chop LP reserves and caller-bound net log backing; locks and gas excluded"}:{estimateReason:e.stakedBacking.estimateReason??"A Chop LP reserve has no USD estimate."}},pendingChop:s.at(-2),claimableChop:s.at(-1)}}export{B as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,i as T,l as O,m as x,n as R}from"./NWNYJ26T.js";import{b as f,j as S}from"./
|
|
1
|
+
import{c as w,i as T,l as O,m as x,n as R}from"./NWNYJ26T.js";import{b as f,j as S}from"./EWZFZUVF.js";import{a as c}from"./XSD5NL7J.js";import{a as P}from"./JXOEJPJ4.js";import{encodeFunctionData as $,erc20Abi as E,parseAbi as z,zeroAddress as j}from"viem";var g=S[f].merkl.distributor.address,H=["function accessControlManager() view returns (address)","function isGovernor(address) view returns (bool)","function isGovernorOrGuardian(address) view returns (bool)","function canUpdateMerkleRoot(address) view returns (uint256)","function mainOperators(address,address) view returns (uint256)","function disputeToken() view returns (address)","function disputeAmount() view returns (uint256)","function disputer() view returns (address)","function endOfDisputePeriod() view returns (uint48)","function getMerkleRoot() view returns (bytes32)","function getEpochDuration() view returns (uint32)","function disputePeriod() view returns (uint48)","function upgradeabilityDeactivated() view returns (uint256)","function disputeTree(string)","function updateTree((bytes32 merkleRoot,bytes32 ipfsHash))","function toggleTrusted(address)","function toggleMainOperatorStatus(address,address)","function revokeUpgradeability()","function setEpochDuration(uint32)","function resolveDispute(bool)","function revokeTree()","function recoverERC20(address,address,uint256)","function setDisputePeriod(uint48)","function setDisputeToken(address)","function setDisputeAmount(uint256)"],y=z(H),F={type:"string",pattern:"^\\d+$"},C={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},G="Provide a valid address.";function m(o,l=!1){let n=T(o,G);return l?n:O(n,G)}function _(o,l=256){return R(o,`Value exceeds uint${l}.`,{bits:l})}function k(o){return x(o,"Merkl returned invalid protocol state.")}function I(o){return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?String(o):k(o).toString()}var D={updateTree:["merkleRoot","ipfsHash"],toggleTrusted:["target","enabled"],toggleMainOperatorStatus:["target","token","enabled"],revokeUpgradeability:[],setEpochDuration:["amount"],resolveDispute:["valid"],revokeTree:[],recoverERC20:["token","recipient","amount"],setDisputePeriod:["amount"],setDisputeToken:["token"],setDisputeAmount:["amount"]},W=o=>{let l=()=>o.clientFor(f),n=(r,i=[],e=g)=>l().readContract({address:e,abi:y,functionName:r,args:i}),b=(r,i,e,p)=>({name:`merkl_${r}`,inputSchema:{type:"object",properties:i,required:e,additionalProperties:!1},execute:async(u,s)=>{try{let a=Object.keys(u).find(d=>!Object.hasOwn(i,d));if(a)throw new c(`Unsupported Merkl input: ${a}.`);return await p(u,m(s))}catch(a){throw new c(o.plainError(a))}}}),U=async(r,i,e,p)=>{let u=[o.unsignedTx({to:g,data:$({abi:y,functionName:r,args:i}),value:"0",chainId:f,description:e})],s=await o.preview(u,p);return{txs:u,preview:s,summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${e} ${s.summary}`}};return{tools:[b("distributor_status",{},[],async(r,i)=>{let[e,p,u,s,a,d,t,h,N]=await Promise.all([n("getMerkleRoot"),n("disputeToken"),n("disputeAmount"),n("disputer"),n("endOfDisputePeriod"),n("getEpochDuration"),n("disputePeriod"),n("upgradeabilityDeactivated"),n("accessControlManager")]);if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e)||typeof d!="number"||!Number.isInteger(d)||d<0||d>4294967295)throw new c("Merkl returned invalid Distributor state.");let v=m(N),[M,A]=await Promise.all([n("isGovernor",[i],v),n("isGovernorOrGuardian",[i],v)]);if(typeof M!="boolean"||typeof A!="boolean")throw new c("Merkl returned invalid governance roles.");return{chainId:f,distributor:g,root:e,disputeToken:m(p,!0),disputeAmount:k(u).toString(),disputer:m(s,!0),endOfDisputePeriod:I(a),epochDuration:String(d),disputePeriod:I(t),upgradeabilityDeactivated:k(h).toString(),accessControlManager:v,governor:M,governorOrGuardian:A,summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Dispute amounts are token base units. Opening a dispute locks collateral until governor resolution; a rejected dispute forfeits it."}}),b("dispute",{reason:{type:"string",minLength:1,maxLength:2e3,description:"Public reason for disputing the Merkl tree, from 1 to 2000 characters."}},["reason"],async(r,i)=>{if(typeof r.reason!="string"||!r.reason.trim()||r.reason.length>2e3)throw new c("Provide a public dispute reason of 1 to 2000 characters.");let e=m(await n("disputeToken")),p=k(await n("disputeAmount")),[u,s]=await Promise.all([l().readContract({address:e,abi:E,functionName:"symbol"}),l().readContract({address:e,abi:E,functionName:"decimals"})]);if(typeof u!="string"||!u.trim()||typeof s!="number"||!Number.isInteger(s)||s<0||s>255)throw new c("Merkl dispute token metadata is invalid.");let a=`Dispute Merkl's tree: ${r.reason}. Lock ${p} ${P(u)} base units (token ${e}, decimals ${s}) until governor resolution; rejection forfeits the deposit. There is no unilateral withdrawal.`,d=[...p?[o.approval(e,g,p.toString(),f)]:[],o.unsignedTx({to:g,data:$({abi:y,functionName:"disputeTree",args:[r.reason]}),value:"0",chainId:f,description:a})],t=await o.preview(d,i);return{txs:d,preview:t,deposit:{token:{address:e,symbol:u,decimals:s,chainId:f},amount:p.toString()},summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${a} ${t.summary}`}}),b("distributor_admin",{operation:{enum:Object.keys(D),description:"Distributor admin operation: tree updates/revocation, trust/operator changes, epoch/dispute settings, resolution, token recovery or upgradeability revocation."},target:{...w,description:"Address whose trusted or operator status is changed."},token:{...w,description:"Reward or recovery token contract address."},recipient:{...w,description:"Address to receive recovered tokens."},amount:{...F,description:'Admin amount: Unix seconds for durations, otherwise token base units using recovery/dispute token decimals (USDG has 6: "1000000" = 1 USDG).'},enabled:{type:"boolean",description:"true enables the selected role; false disables it."},valid:{type:"boolean",description:"Whether the disputed tree is valid."},merkleRoot:{...C,description:"New reward tree root as a 0x-prefixed 32-byte hex string."},ipfsHash:{...C,description:"New tree IPFS content hash as a 0x-prefixed 32-byte hex string."}},["operation"],async(r,i)=>{let e=String(r.operation);if(!Object.hasOwn(D,e))throw new c("Choose a supported Distributor operation.");let p=D[e];for(let t of Object.keys(r))if(t!=="operation"&&!p.includes(t))throw new c(`Input ${t} does not match this Distributor operation.`);let u=m(await n("accessControlManager")),s=await n("isGovernor",[i],u);if(typeof s!="boolean")throw new c("Merkl returned invalid governor status.");if(!s&&!(e==="updateTree"?await n("canUpdateMerkleRoot",[i])===1n:e==="toggleMainOperatorStatus"&&r.token!==j?await n("isGovernorOrGuardian",[i],u)===!0:!1))throw new c("The connected wallet lacks the required Merkl governance role.");let a=p.map(t=>{if(t==="enabled"||t==="valid"){if(typeof r[t]!="boolean")throw new c(`Provide ${t} as boolean.`);return r[t]}if(t==="amount"){let h=_(r[t],e==="setEpochDuration"?32:e==="setDisputePeriod"?48:256);return e==="setEpochDuration"?Number(h):h}if(t==="merkleRoot"||t==="ipfsHash"){if(typeof r[t]!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r[t]))throw new c("Provide a bytes32 root and IPFS hash.");return r[t]}return m(r[t],t==="token"&&e==="toggleMainOperatorStatus")}),d=a;if(e==="updateTree"&&(d=[{merkleRoot:a[0],ipfsHash:a[1]}]),e==="toggleTrusted"||e==="toggleMainOperatorStatus"){let t=await n(e==="toggleTrusted"?"canUpdateMerkleRoot":"mainOperators",e==="toggleTrusted"?[a[0]]:a.slice(0,2));if(t!==0n&&t!==1n)throw new c("Merkl returned invalid authorization state.");if(t===1n===r.enabled)return{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Authorization already has the requested state."};d=a.slice(0,-1)}return U(e,d,`Merkl Distributor ${e} ${JSON.stringify(r)}. Governance affects every claimant. Upgradeability revocation is permanent; dispute resolution returns or forfeits collateral. Authorization operations toggle the observed state; re-preview if state changes.`,i)})]}};export{W as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as l}from"./CW37EGPL.js";import{a as L}from"./K6D6SDIG.js";import{a as $}from"./CFPJDLTZ.js";import{g as k}from"./NWNYJ26T.js";import{a as d}from"./XSD5NL7J.js";import{encodeFunctionData as P,erc20Abi as A,formatUnits as w,toEventSelector as C}from"viem";var x=C("Transfer(address,address,uint256)");async function I(o,e,r,s){let u=BigInt(e.measuredAtBlock),p=l(s.amount),y=l(s.deadline),g=$.helper.address,m=await o.simulateBlocks({blockNumber:u,validation:!1,traceTransfers:!0,blocks:[{blockOverrides:{baseFeePerGas:0n},calls:[{account:r,to:e.staking.address,data:P({abi:A,functionName:"approve",args:[g,p]}),gas:10000000n,gasPrice:0n},{account:r,to:g,data:P({abi:L,functionName:"unstakeAndRemoveLP",args:[e.log.address,p,1n,1n,y]}),gas:10000000n,gasPrice:0n}]}]});if(m[0]?.calls.some(i=>i.status!=="success"&&i.gasUsed>=10000000n))throw new d("Chop unfarm quote still fails at the saved gas limit; the simulation ceiling cannot cover this exit.");if(m.length!==1||m[0].calls.length!==2||m[0].calls.some(i=>i.status!=="success"))throw new d("Chop unfarm quote could not simulate the exit. Check the unlocked stake, liquidity and deadline.");let f=i=>m[0].calls.flatMap(t=>t.logs??[]).filter(t=>k(t.address,i.address)).reduce((t,n)=>{if(n.topics[0]?.toLowerCase()!==x)return t;if(n.topics.length!==3||!/^0x[0-9a-fA-F]{64}$/.test(n.data)||!n.topics.slice(1).every(a=>/^0x0{24}[0-9a-fA-F]{40}$/.test(a)))throw new d("Chop unfarm quote returned an invalid token transfer.");let c=a=>a.slice(-40).toLowerCase()===r.slice(2).toLowerCase();return t+BigInt(n.data)*((c(n.topics[2])?1n:0n)-(c(n.topics[1])?1n:0n))},0n),h=f(e.log),O=f(e.paired),b=(i,t,n)=>{if(t<=0n)throw new d("Chop unfarm simulated receipt is too small; choose a larger amount or wait for liquidity.");let c=t*99n/100n||1n,a=s[i]===void 0?c:l(s[i]);if(a>t)throw new d(`Chop unfarm ${i} (${a} base units) is too high: current output is ${w(t,n.decimals)} ${n.symbol} (${t} base units) at block ${u}. Lower ${i} or omit it for the suggested 1% slippage minimum.`);return a.toString()};return{measuredAtBlock:u.toString(),slippageBps:100,expectedLogOut:h.toString(),expectedPairedOut:O.toString(),minLogOut:b("minLogOut",h,e.log),minPairedOut:b("minPairedOut",O,e.paired),suggested:{minLogOut:s.minLogOut===void 0,minPairedOut:s.minPairedOut===void 0}}}function N(o,e){let r=(s,u)=>`${w(BigInt(s),u.decimals)} ${u.symbol} (${s} base units)`;return`Expected outputs at block ${o.measuredAtBlock}: ${r(o.expectedLogOut,e.log)} and ${r(o.expectedPairedOut,e.paired)}. On-chain minimums: ${r(o.minLogOut,e.log)} and ${r(o.minPairedOut,e.paired)}. ${o.suggested.minLogOut||o.suggested.minPairedOut?"Omitted minimums use 1% slippage (100 bps).":"Caller minimums retained."} Simulated quote; outputs may change before execution.`}export{I as a,N as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as f,b as m,c as V,e as y,f as S,g as A,h as I,i as B,j as T,l as x,m as M,n as D}from"./CW37EGPL.js";import{a as $}from"./K6D6SDIG.js";import{c as N,e as R,j as U,k as P,l as F,n as q,o as _}from"./QA6Z2CYP.js";import{a as b}from"./CFPJDLTZ.js";import{a as c}from"./XSD5NL7J.js";import{encodeFunctionData as Y,formatUnits as Z}from"viem";var h=(o,e)=>({token:o,amount:e.toString()}),G=6e4;function pe(){let o=new WeakMap;return{entry(e){let s=o.get(e);return(!s||Date.now()>=s.expiresAt)&&(s={logs:new Map,expiresAt:Date.now()+G},o.set(e,s)),s}}}function Q(o,e){return{to:o.log.address,data:Y({abi:$,functionName:"debond",args:[e,[],[]]}),value:"0",chainId:4663,description:`Unwrap ${e} log base units from ${o.log.address}.`}}async function O(o,e,s,a,t=BigInt(e.measuredAtBlock),r){if(a>BigInt(e.totalSupply))throw new c("Unwrap amount exceeds the issued Chop log supply.");let i=m(await S(o,e.log.address,"convertToAssets",[a],t,s,r)),g=1n<<96n,d=BigInt(e.managedUnderlying)*(a*g/BigInt(e.totalSupply))/g;if(i>d)throw new c("Chop redemption exceeds the measured backing.");return{gross:h(e.underlying,d),fee:h(e.underlying,d-i),net:h(e.underlying,i)}}async function X(o,e,s,a,t,r){let i=t.toString();if(a===0n)return{assets:[],estimateLabel:"estimate, not a quote",measuredAtBlock:i};try{if(e.drift.length)throw new c("Chop code changed; LP backing conversion is unavailable.");let[g,d,u,n,l,p]=await A(o,[{target:e.pool,fn:"token0"},{target:e.pool,fn:"token1"},{target:e.pool,fn:"getReserves"},{target:e.pool,fn:"totalSupply"},{target:e.pool,fn:"balanceOf",args:[e.staking.address]},{target:e.staking.address,fn:"totalSupply"}],t,r),w=[f(g),f(d)],k=w.findIndex(K=>K.toLowerCase()===e.log.address.toLowerCase());if(k<0||w[1-k].toLowerCase()!==e.paired.address.toLowerCase())throw new c("Chop LP reserve tokens disagree with the verified log.");if(!Array.isArray(u)||u.length!==3)throw new c("Chop LP reserves are unavailable.");let C=m(n);if(C===0n||a>C)throw new c("Chop LP supply cannot cover these shares.");let L=m(p);if(a>L||m(l)<L)throw new c("Chop staking receipts exceed their LP custody.");let v=m(u[k])*a/C,z=m(u[1-k])*a/C,J=v===0n?h(e.underlying,0n):(await O(o,e,s,v,t,r)).net;return y(r),{assets:[J,h(e.paired,z)],logTokens:h(e.log,v),estimateLabel:"estimate, not a quote",measuredAtBlock:i}}catch{return y(r),{assets:[],estimateLabel:"price unavailable",measuredAtBlock:i,estimateReason:"Chop LP reserves or net log backing could not be verified. The stake is retained; its value is unknown."}}}async function H(o,e){if(y(e),o.network==="testnet")throw new c("Chop requires chain 4663.");let s=o.clientFor(4663),a=await I(s,e),t=B();await T(s,b.registry,a,e,t);let r=await S(s,b.registry.address,"allIndexes",[],a,void 0,e);if(!Array.isArray(r)||r.length>1e3)throw new c("Chop registry inventory is unreadable or too large.");let i=r.filter(n=>n&&n.verified===!0).map(n=>f(n.index));if(new Set(i).size!==i.length)throw new c("Chop registry returned duplicate logs.");let g=[];for(let n=0;n<i.length;n+=4)y(e),g.push(...await Promise.all(i.slice(n,n+4).map(l=>x(s,l,"read",a,e,t))));y(e);let d=g.map(n=>`${n.log.symbol} (${n.log.address}): ${U(n)}`),u=g.flatMap(n=>n.drift.length?[`Code changed for ${n.log.address}: ${n.drift.join(", ")}.`]:[]);return{logs:g.map(n=>({...n,plainSummary:F(n)})),measuredAtBlock:a.toString(),warnings:[...R,...d,...u]}}async function ge(o,e,s){if(y(s),!e)return H(o,s);let a=o.clientFor(4663),t=e.entry(a);if(t.inventory)return structuredClone(t.inventory);let r=t.pending;if(!r){let n=new AbortController,l={controller:n,waiters:0,promise:H(o,n.signal)};l.promise=l.promise.then(p=>{y(n.signal),t.inventory=structuredClone(p);for(let w of p.logs)t.logs.set(w.log.address.toLowerCase(),structuredClone(w));return p}).finally(()=>{n.abort(),t.pending===l&&(t.pending=void 0)}),t.pending=r=l}let i=r;i.waiters++;let g,d=!1,u=()=>{d||(d=!0,--i.waiters===0&&t.pending===i&&(i.controller.abort(),t.pending=void 0))};try{let n=await new Promise((l,p)=>{g=()=>{u(),p(new c("Chop read was cancelled."))},s?.addEventListener("abort",g,{once:!0}),i.promise.then(l,p)});return y(s),structuredClone(n)}finally{g&&s?.removeEventListener("abort",g),u()}}async function ue(o,e,s){let{limit:a,offset:t}=s,r=new Set(e.logs.map(l=>`${l.log.symbol} (${l.log.address}): ${U(l)}`)),i=e.warnings.filter(l=>!r.has(l)),g=Object.entries(e).map(([l,p])=>({name:l,chars:JSON.stringify(p).length,...Array.isArray(p)?{items:p.length}:{}})),d=o.clientFor(4663),u=e.logs.slice(t,t+a),n=[];for(let l=0;l<u.length;l+=4)n.push(...await Promise.all(u.slice(l,l+4).map(async p=>{let w=await A(d,[{target:p.pool,fn:"balanceOf",args:[p.staking.address]},{target:p.pool,fn:"totalSupply"}],BigInt(p.measuredAtBlock)),k=m(w[0]),C=m(w[1]);if(k>C)throw new c("Chop staked LP balance exceeds the pool supply.");return{log:p.log.address,symbol:p.log.symbol,backingPerLog:p.backingPerLog,fees:p.fees,pool:p.pool,stakedShare:{stakedLp:k.toString(),totalLp:C.toString(),bps:C===0n?null:Number(k*10000n/C)},riskLines:P(p).split(`
|
|
2
|
+
`).filter(L=>!R.includes(L)).join(`
|
|
3
|
+
`)}})));for(;;){let l=t+n.length,p=`Use detail: "full" for every complete row, or fields: ["logs"] or ["warnings"] for whole sections. ${l<e.logs.length?`Continue with offset: ${l}, limit: ${a}.`:"End of this list; use offset: 0 to start again."} Summary rows omit financial measurements and full contract metadata.`,w={warnings:i,summary:{logs:n,offset:t,total:e.logs.length,omitted:e.logs.length-n.length,measuredAtBlock:e.measuredAtBlock},sections:g,more:p};if(JSON.stringify(w).length<=8e3)return w;if(n.length<=1)throw new c('Chop risk lines exceed the summary budget. Request fields or detail: "full" to read them whole.');n.pop()}}async function ce(o,e){let s=o.clientFor(4663),a=[];for(let t=0;t<e.length;t+=4)a.push(...await Promise.all(e.slice(t,t+4).map(async r=>{let[i,g,d,u]=await A(s,[{target:f(b.chop),fn:"balanceOf",args:[r.rewards]},{target:r.pool,fn:"token0"},{target:r.pool,fn:"token1"},{target:r.pool,fn:"getReserves"}],BigInt(r.measuredAtBlock)),n=[f(g),f(d)].map(p=>[r.log,r.paired].find(w=>w.address.toLowerCase()===p.toLowerCase()));if(!n[0]||!n[1]||n[0]===n[1])throw new c("Chop pool tokens disagree with the verified log.");if(!Array.isArray(u)||u.length!==3)throw new c("Chop pool reserves are unavailable.");let l=h(r.underlying,BigInt(r.managedUnderlying));return{...r,backingNow:{...l,humanAmount:Z(BigInt(l.amount),r.underlying.decimals)},rewardPot:h({address:f(b.chop),symbol:"CHOP",decimals:18,chainId:4663},m(i)),reserves:[h(n[0],m(u[0])),h(n[1],m(u[1]))]}})));return a}var E=o=>BigInt(o.replace(".","")),j=o=>`${o/100n}.${(o%100n).toString().padStart(2,"0")}`;function me(o){return o.some(e=>e.usdEstimate===null)?{reserves:o,usdEstimate:null,estimateLabel:"price unavailable",estimateReason:"A pool reserve has no USD estimate"}:{reserves:o,usdEstimate:j(o.reduce((e,s)=>e+E(s.usdEstimate),0n)),estimateLabel:"estimate, not a quote",estimateSource:"sum of the two reserve estimates"}}function he(o,e){let s={label:"rough",pct:null,inputToken:e,assumptions:"Constant-product marginal price move for buying the log with $100 of the paired token; excludes pool and token fees, gas and other trades."};if(o.some(d=>BigInt(d.amount)===0n))return{...s,reason:"The pool is empty on at least one side"};let a=o.find(d=>d.token.address.toLowerCase()===e.address.toLowerCase());if(!a?.usdEstimate||E(a.usdEstimate)===0n)return{...s,reason:"Paired reserve price unavailable or below one cent"};let t=E(a.usdEstimate),i=((t+10000n)**2n-t**2n)*10000n,g=t**2n;return{...s,pct:j((2n*i+g)/(2n*g))}}var W=new WeakMap,ee=10;async function te(o,e,s,a,t,r){if(y(t),e.length>ee)throw new c("Chop holdings probes support at most ten logs per call.");if(e.length===0)return[];let i=t?W.get(t):void 0;t&&!i&&(i=B(),W.set(t,i)),await T(o,b.whitelist,a,t,i);let g=await A(o,e.flatMap(d=>[{target:d.log.address,fn:"balanceOf",args:[s]},{target:d.staking.address,fn:"balanceOf",args:[s]},{target:d.staking.address,fn:"withdrawableStake",args:[s]},{target:d.rewards,fn:"getUnpaid",args:[b.chop,s]},{target:d.rewards,fn:"getClaimable",args:[b.chop,s]},{target:b.whitelist.address,fn:"paused",args:[b.chop]},{target:d.log.address,fn:"totalSupply"},{target:d.log.address,fn:"totalAssets",args:[d.underlying.address]}]),a,t);return y(t),Promise.all(e.map(async(d,u)=>{let n=await oe(o,d,s,a,t,g.slice(u*8,(u+1)*8));return y(t),r?.(n,u),n}))}async function ne(o,e,s,a=BigInt(e.measuredAtBlock),t){return(await te(o,[e],s,a,t))[0]}async function oe(o,e,s,a,t,r){if(y(t),typeof r[5]!="boolean")throw new c("Chop reward pause state is unavailable.");let i=m(r[0]),g=m(r[6]),d=m(r[7]);if(g===0n)throw new c("This Chop log has no issued supply.");let u={...e,totalSupply:g.toString(),managedUnderlying:d.toString()},n=i===0n?{gross:h(e.underlying,0n),fee:h(e.underlying,0n),net:h(e.underlying,0n)}:await O(o,u,s,i,a,t),l=await X(o,u,s,m(r[1]),a,t),p={address:f(b.chop),symbol:"CHOP",decimals:18,chainId:4663};return{log:e.log.address,logTokens:h(e.log,i),...n,stakedBacking:l,stakedLp:h(e.staking,m(r[1])),withdrawableLp:h(e.staking,m(r[2])),pendingChop:h(p,m(r[3])),claimableChop:h(p,m(r[4])),rewardsPaused:r[5],measuredAtBlock:a.toString(),warnings:P(e)}}async function we(o,e,s,a){let t=o.clientFor(4663);f(s);let r=a?.entry(t),i=f(e).toLowerCase(),g=r?.logs.get(i)??await x(t,e,"read");return r&&!r.logs.has(i)&&r.logs.set(i,structuredClone(g)),ne(t,g,s,await I(t))}async function ye(o,e,s,a){let t=V(a),r=o.clientFor(4663);f(s);let i=await x(r,e,"exit"),g=m(await S(r,i.log.address,"balanceOf",[s],BigInt(i.measuredAtBlock)));if(g===0n)throw new c(q(i.log.symbol));if(t>g)throw new c(_(i.log,t,g));let d=await O(r,i,s,t),u=BigInt(d.net.amount);if(u===0n)throw new c("This Chop unwrap would return no underlying.");let n=Q(i,t),l=o.unsignedTx(n);M([l],[n]);let p=await o.preview([l],s);M(p.txs,[n]);let w=D(p,[{token:i.log,min:-t,max:-t},{token:i.underlying,min:u}]);return{log:i.log.address,amount:t.toString(),...d,simulatedNet:h(i.underlying,w.get(i.underlying.address.toLowerCase())),quotedNet:d.net.amount,preview:p,measuredAtBlock:i.measuredAtBlock,warning:N,summary:P(i)}}export{h as a,G as b,pe as c,Q as d,O as e,X as f,ge as g,ue as h,ce as i,me as j,he as k,ee as l,te as m,ne as n,we as o,ye as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,c}from"./
|
|
1
|
+
import{a as x,c}from"./5BPFF7NX.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 T}from"./
|
|
1
|
+
import{b as T}from"./LBT6WR4U.js";import{c as A}from"./5UWVXEPD.js";import{i as b}from"./DWRRIFXS.js";import{o as P}from"./IR7KDBFU.js";import{b as f,j as g}from"./EWZFZUVF.js";var U=.5,E=394930n,C=315200n,R=1000000000n,x=10000n*10n**18n,M="fees estimated high because the live price was unavailable";function I(s,r){if(s.impliedApy===void 0)return{reason:"Pendle's service gave no rate, so Oak won't show one."};let t=Math.expm1(Number(r)/1e18)*100,n=s.impliedApy*100;return!Number.isFinite(t)||!Number.isFinite(n)?{reason:"the rate could not be checked against the chain, so Oak won't show one."}:Math.abs(n-t)>U?{reason:`The rate Pendle's service lists (${n.toFixed(2)}% a year) differs from the chain's (${t.toFixed(2)}% a year) by more than ${U} points, so Oak won't show one.`}:{ratePct:n}}async function S(s,r){let t=s.clientFor(f),n=await t.getGasPrice().catch(()=>{}),i=r;i===void 0&&(i=await P(g[f].tokens.WETH.address,{client:t}).then(a=>BigInt(a.usdE18),()=>{}));let o=n!==void 0&&n>0n&&i!==void 0&&i>0n?{gasPrice:n,ethUsd:i}:void 0,{gasPrice:u,ethUsd:h}=o??{gasPrice:R,ethUsd:x},m=a=>Number(a*u*h)/1e36;return{inUsd:m(E),outUsd:m(C),checks:o?[]:[M]}}async function v(s,r,t={}){let n=s.clientFor(f),i=t.now??Math.floor(Date.now()/1e3),o=await b(s,{allowChain:!1}),u=await T(n,r,o.rows),h=e=>(u.get(e.pt.toLowerCase())??0n)>0n,m=o.rows.filter(e=>e.active&&e.expiry>i||h(e)),[{ok:a,dropped:_},p]=await Promise.all([A(n,m,{now:i}),S(s,t.ethUsdE18)]),y=[...o.dropped,..._],l=[];for(let{row:e,facts:d}of a){let c=d.verified,k={market:e.market,kind:c.kind,unitSymbol:c.inputSymbol,unitDecimals:c.inputDecimals,endsAt:c.expiry,liquidityUsd:e.liquidityUsd??0,ptBalanceBase:u.get(e.pt.toLowerCase())??0n,gasInUsd:p.inUsd,gasOutUsd:p.outUsd};if(c.expired){k.ptBalanceBase>0n&&l.push({...k,ratePct:0,matured:!0,checks:["this term has ended",...p.checks]});continue}if(!e.active)continue;let w=I(e,d.lnImpliedRate);if("reason"in w){y.push(`${e.market}: ${w.reason}`);continue}l.push({...k,ratePct:w.ratePct,matured:!1,checks:[...e.liquidityUsd===void 0?["liquidity was not reported"]:[],...p.checks]})}return l.sort((e,d)=>e.kind===d.kind?e.endsAt-d.endsAt:e.kind==="stable"?-1:1),{terms:l,dropped:y}}async function L(s,r,t={}){return(await v(s,r,t)).terms}export{I as a,v as b,L as c};
|
|
@@ -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"./5DWQUEBA.js";import{a as h,b as k,f as y,g as m}from"./QP2B7AYX.js";import{O as b,b as I}from"./5677LZOV.js";import{a as N}from"./66F5ZH34.js";import{c as w,g}from"./NWNYJ26T.js";import{b as v}from"./EWZFZUVF.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as t}from"./NWNYJ26T.js";import{b as x,j as b,n as C}from"./
|
|
1
|
+
import{g as t}from"./NWNYJ26T.js";import{b as x,j as b,n as C}from"./EWZFZUVF.js";import{a as s}from"./XSD5NL7J.js";import{decodeAbiParameters as y,decodeFunctionData as q,encodeAbiParameters as f,encodeFunctionData as J,getAddress as U,parseAbi as Q,parseAbiParameters as A,zeroAddress as g}from"viem";var Y=U(b[x].ponsTrade.universal_router.address),ie=U(b[x].ponsTrade.permit2.address),H="0x0Af57F62982D03066ef917AcAd87F771c06528Ec",ae=Object.freeze({pons:U(C),fobo:H}),Z=Object.freeze({currency0:g,currency1:U(b[x].tokens.USDG.address),fee:500,tickSpacing:10,hooks:g}),ce=Object.freeze([H,g]),M=Q(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),L=A("bytes,bytes[]"),X=A("((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 amountIn,uint128 amountOutMinimum,uint256 minHopPriceX36,bytes hookData)"),j=A("(address currencyIn,(address intermediateCurrency,uint24 fee,int24 tickSpacing,address hooks,bytes hookData)[] path,uint256[] minHopPriceX36,uint128 amountIn,uint128 amountOutMinimum)"),R=A("address,uint256"),G=A("((address token,uint160 amount,uint48 expiration,uint48 nonce) details,address spender,uint256 sigDeadline),bytes"),ee="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",I="Universal Router calldata must be one canonical v4 swap command, optionally after one Permit2 permit.",h="Universal Router actions must swap an exact input, settle it and take all output to the sender.",E="Universal Router settlement and receipt must match the swap.",W="Universal Router swap must carry no hook data or per-hop price limit.",te="Universal Router permit must cover the swap input token and name the Universal Router as spender.";function ue(o){return t(o,ee)?g:o}function m(o,n,a,l){let u;try{if(u=o(),t(n(u),a))return u}catch{}throw new s(l)}function le(o,n){let a=m(()=>q({abi:M,data:o}),e=>J({abi:M,...e}),o,I),[l,u,$]=a.args,P=t(l,"0x0a10");if(!P&&!t(l,"0x10")||u.length!==(P?2:1))throw new s(I);let K=u.at(-1),[T,c]=m(()=>y(L,K),e=>f(L,e),K,h),_=t(T,"0x060c0f");if(!_&&!t(T,"0x070c0f")||c.length!==3)throw new s(h);let S,d,O,w,k;if(_){let[e]=m(()=>y(X,c[0]),F=>f(X,F),c[0],h);if(e.hookData!=="0x"||e.minHopPriceX36!==0n)throw new s(W);let{currency0:r,currency1:i,fee:p,tickSpacing:v,hooks:D}=e.poolKey;S=[{poolKey:{currency0:r,currency1:i,fee:p,tickSpacing:v,hooks:D},zeroForOne:e.zeroForOne}],[d,O]=e.zeroForOne?[r,i]:[i,r],{amountIn:w,amountOutMinimum:k}=e}else{let[e]=m(()=>y(j,c[0]),i=>f(j,i),c[0],h);if(e.path.length<2)throw new s(h);if(e.minHopPriceX36.length!==0||e.path.some(i=>i.hookData!=="0x"))throw new s(W);let r=e.currencyIn;S=e.path.map(i=>{let p=i.intermediateCurrency;if(t(r,p))throw new s(h);let[v,D]=BigInt(r)<BigInt(p)?[r,p]:[p,r],F={poolKey:{currency0:v,currency1:D,fee:i.fee,tickSpacing:i.tickSpacing,hooks:i.hooks},zeroForOne:t(r,v)};return r=p,F}),d=e.currencyIn,O=r,{amountIn:w,amountOutMinimum:k}=e}if(w<=0n)throw new s("Universal Router swap input must be a positive exact amount.");if(t(d,O))throw new s("Universal Router swap must end in a different currency than it starts.");for(let{poolKey:e}of S)if(!n.some(r=>t(r,e.hooks)))throw new s(`Universal Router swap uses pool hook ${e.hooks}, which this route does not allow.`);let N=m(()=>y(R,c[1]),e=>f(R,e),c[1],E),z=m(()=>y(R,c[2]),e=>f(R,e),c[2],E);if(!t(N[0],d)||N[1]!==w||!t(z[0],O)||z[1]!==k)throw new s(E);let B={legs:S,currencyIn:d,currencyOut:O,amountIn:w,amountOutMinimum:k,deadline:$};if(P){let[e,r]=m(()=>y(G,u[0]),i=>f(G,i),u[0],I);if(t(d,g)||!t(e.details.token,d)||!t(e.spender,Y))throw new s(te);B.permit={...e.details,spender:e.spender,sigDeadline:e.sigDeadline,signature:r}}return B}function V(o,n){return t(o.currency0,n.currency0)&&t(o.currency1,n.currency1)&&o.fee===n.fee&&o.tickSpacing===n.tickSpacing&&t(o.hooks,n.hooks)}function de(o,n){return o.length===n.length&&o.every((a,l)=>V(a.poolKey,n[l].poolKey)&&a.zeroForOne===n[l].zeroForOne)}var pe=1200,me=1800;function ye(o){let n=0;for(let{poolKey:a}of o.legs)if(t(a.hooks,H))n++;else if(!V(a,Z))throw new s("Swap leaves the FOBO route: every pool must be a FoboHook pool or FOBO's ETH/USDG pool.");if(n===0)throw new s("Swap is not a FOBO route: it uses no FoboHook pool.")}export{Y as a,ie as b,H as c,ae as d,Z as e,ce as f,ue as g,le as h,V as i,de as j,pe as k,me as l,ye as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,d as A,i as T,m as C}from"./NWNYJ26T.js";import{b as c,j as _}from"./
|
|
1
|
+
import{c as w,d as A,i as T,m as C}from"./NWNYJ26T.js";import{b as c,j as _}from"./EWZFZUVF.js";import{a as r}from"./XSD5NL7J.js";import{encodeFunctionData as O,getAddress as x,keccak256 as D,parseAbi as P}from"viem";var g=x("0x03695edcfcf2c62a4dc36b032eb2513cd1d928a2"),S="0x0b3d9287f6788f70f8f32597eb50d8aaf791742819ecf58053f3e22fd96cb76b",$=["beefy_vault_manage"],I=P(["function owner() view returns(address)","function want() view returns(address)","function vault() view returns(address)","function strategy() view returns(address)","function approvalDelay() view returns(uint256)","function stratCandidate() view returns(address implementation,uint256 proposedTime)","function earn()","function proposeStrat(address)","function upgradeStrat()","function inCaseTokensGetStuck(address)","function transferOwnership(address)","function renounceOwnership()"]),i=x(_[c].vaults.beefyTestedLpVault.address);function d(p){return T(p,"Provide a contract or wallet address.",A)}function m(p){return C(p,"Invalid Beefy administration integer.")}var F=p=>{async function v(e){try{return await e()}catch(t){throw new r(p.plainError(t))}}function b(e,t){if(e.chainId!==void 0&&e.chainId!==c)throw new r("Beefy requires chain 4663.");for(let u of Object.keys(e))if(!["chainId","vault",...t].includes(u))throw new r(`Unsupported Beefy input: ${u}.`);if(d(e.vault)!==i)throw new r("Administration is qualified only for the measured up33-weth-up vault.")}async function k(){let e=p.clientFor(c);if(await e.getChainId()!==c)throw new r("The Beefy endpoint must report chain 4663.");let t=m(await e.getBlockNumber()),[u,n]=await Promise.all([e.getCode({address:i,blockNumber:t}),e.getCode({address:g,blockNumber:t})]),o=`0x363d3d373d3d3d363d73${g.slice(2).toLowerCase()}5af43d82803e903d91602b57fd5bf3`;if(u?.toLowerCase()!==o||!n||D(n)!==S)throw new r("The Beefy vault implementation no longer matches its qualified code hash.");let a=(E,N)=>e.readContract({address:E,abi:I,functionName:N,blockNumber:t}),[f,h,y,s,l,B]=await Promise.all([a(i,"owner"),a(i,"want"),a(i,"strategy"),a(i,"approvalDelay"),a(i,"stratCandidate"),e.getBlock({blockNumber:t})]);if(!Array.isArray(l)||l.length!==2)throw new r("Invalid Beefy strategy candidate.");return{client:e,blockNumber:t,owner:d(f),want:d(h),strategy:d(y),approvalDelay:m(s),candidate:{implementation:d(l[0]),proposedTime:m(l[1])},timestamp:m(B.timestamp),read:a}}return{tools:[{name:"beefy_vault_admin",inputSchema:{type:"object",properties:{vault:{...w,description:"Address of the Beefy vault contract; only the qualified up33-weth-up vault is supported."},chainId:{const:c,description:"Chain id; only 4663 (Robinhood Chain mainnet) is supported. Optional."}},required:["vault"],additionalProperties:!1},execute:e=>v(async()=>{b(e,[]);let t=await k();return{vault:i,chainId:c,owner:t.owner,want:t.want,strategy:t.strategy,candidate:{implementation:t.candidate.implementation,proposedTime:t.candidate.proposedTime.toString()},approvalDelay:t.approvalDelay.toString(),block:t.blockNumber.toString(),implementation:g,codeHash:S}})},{name:"beefy_vault_manage",inputSchema:{type:"object",properties:{vault:{...w,description:"Address of the Beefy vault contract; only the qualified up33-weth-up vault is supported."},action:{enum:["earn","propose_strategy","upgrade_strategy","rescue_tokens","transfer_ownership","renounce_ownership"],description:"earn: put idle want to work; propose_strategy then upgrade_strategy after the approval delay; rescue stuck tokens; transfer or permanently renounce ownership. Owner only except earn."},strategy:{...w,description:"Address of the new strategy contract to propose, deployed for this vault and its want token."},token:{...w,description:"Address of the stuck token to rescue to the owner wallet; the want token cannot be rescued."},recipient:{...w,description:"Address of the new owner for transfer_ownership; must not be the zero address."},chainId:{const:c,description:"Chain id; only 4663 (Robinhood Chain mainnet) is supported. Optional."}},required:["vault","action"],additionalProperties:!1},execute:(e,t)=>v(async()=>{let u={earn:[],propose_strategy:["strategy"],upgrade_strategy:[],rescue_tokens:["token"],transfer_ownership:["recipient"],renounce_ownership:[]},n=String(e.action);if(!Object.hasOwn(u,n))throw new r("Choose a documented Beefy vault management action.");b(e,["action",...u[n]]),t=d(t);let o=await k();if(n!=="earn"&&o.owner!==t)throw new r("This wallet is not the Beefy vault owner.");let a,f=[];if(n==="earn")a="earn";else if(n==="propose_strategy"){let s=d(e.strategy),l=await o.client.getCode({address:s,blockNumber:o.blockNumber});if(!l||l==="0x"||d(await o.read(s,"vault"))!==i||d(await o.read(s,"want"))!==o.want)throw new r("The proposed strategy must be deployed for this exact vault and want token.");a="proposeStrat",f=[s]}else if(n==="upgrade_strategy"){if(o.candidate.implementation==="0x0000000000000000000000000000000000000000"||o.candidate.proposedTime+o.approvalDelay>=o.timestamp)throw new r("Propose a strategy first and wait until the on-chain approval delay has fully passed.");a="upgradeStrat"}else if(n==="rescue_tokens"){let s=d(e.token);if(s===o.want)throw new r("The vault owner cannot rescue the want token.");a="inCaseTokensGetStuck",f=[s]}else if(n==="transfer_ownership"){let s=d(e.recipient);if(s==="0x0000000000000000000000000000000000000000")throw new r("Ownership transfer needs a nonzero recipient.");a="transferOwnership",f=[s]}else a="renounceOwnership";let h=[p.unsignedTx({to:i,data:O({abi:I,functionName:a,args:f}),value:"0",chainId:c,description:`Beefy vault ${n}.`})],y=n==="renounce_ownership"?" This permanently gives up owner administration.":n==="rescue_tokens"?" Rescued tokens go to the calling owner wallet; want is excluded.":n==="propose_strategy"||n==="upgrade_strategy"?" Strategy changes affect all vault depositors.":"";return{txs:h,inputs:[],preview:await p.preview(h,t),summary:`Beefy vault action ${n} on ${i}.${y} Inspect the preview before local human confirmation.`}})}]}};export{g as a,S as b,$ as c,I as d,F as e};
|