@oakagentkit/core 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/api/addresses.d.ts +112 -0
- package/build/dist/api/addresses.js +1 -1
- package/build/dist/api/amounts.d.ts +2 -0
- package/build/dist/api/amounts.js +1 -1
- package/build/dist/api/args.js +1 -1
- package/build/dist/api/cache.js +1 -1
- package/build/dist/api/canonical.js +1 -1
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/deployments.js +1 -1
- package/build/dist/api/errors.d.ts +1 -0
- package/build/dist/api/errors.js +1 -1
- package/build/dist/api/gas.js +1 -1
- package/build/dist/api/grandfather.js +1 -1
- package/build/dist/api/guards.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/http.js +1 -1
- package/build/dist/api/identity-link.d.ts +1 -0
- package/build/dist/api/identity-link.js +1 -1
- package/build/dist/api/launch.js +1 -1
- package/build/dist/api/merkle.js +1 -1
- package/build/dist/api/metadata.js +1 -1
- package/build/dist/api/module.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/abi.d.ts +149 -0
- package/build/dist/api/modules/borro/abi.js +1 -0
- package/build/dist/api/modules/borro/actions.d.ts +2 -0
- package/build/dist/api/modules/borro/actions.js +1 -0
- package/build/dist/api/modules/borro/checks.d.ts +151 -0
- package/build/dist/api/modules/borro/checks.js +1 -0
- package/build/dist/api/modules/borro/copy.d.ts +174 -0
- package/build/dist/api/modules/borro/copy.js +1 -0
- package/build/dist/api/modules/borro/index.d.ts +13 -0
- package/build/dist/api/modules/borro/index.js +1 -0
- package/build/dist/api/modules/borro/liquidity.d.ts +4 -0
- package/build/dist/api/modules/borro/liquidity.js +1 -0
- package/build/dist/api/modules/borro/pins.d.ts +264 -0
- package/build/dist/api/modules/borro/pins.js +1 -0
- package/build/dist/api/modules/borro/positions.d.ts +8 -0
- package/build/dist/api/modules/borro/positions.js +1 -0
- package/build/dist/api/modules/borro/rates.d.ts +20 -0
- package/build/dist/api/modules/borro/rates.js +1 -0
- package/build/dist/api/modules/borro/reader.d.ts +32 -0
- package/build/dist/api/modules/borro/reader.js +1 -0
- package/build/dist/api/modules/borro/types.d.ts +120 -0
- package/build/dist/api/modules/borro/types.js +0 -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/copy.d.ts +114 -0
- package/build/dist/api/modules/earn/copy.js +1 -0
- package/build/dist/api/modules/earn/cost.d.ts +47 -0
- package/build/dist/api/modules/earn/cost.js +1 -0
- package/build/dist/api/modules/earn/index.d.ts +8 -0
- package/build/dist/api/modules/earn/index.js +1 -0
- package/build/dist/api/modules/earn/lp.d.ts +17 -0
- package/build/dist/api/modules/earn/lp.js +1 -0
- package/build/dist/api/modules/earn/options.d.ts +36 -0
- package/build/dist/api/modules/earn/options.js +1 -0
- package/build/dist/api/modules/earn/types.d.ts +39 -0
- package/build/dist/api/modules/earn/types.js +0 -0
- package/build/dist/api/modules/erc8004/abi.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/validation.js +1 -1
- package/build/dist/api/modules/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/backoff.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/freshness.js +1 -1
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/proof-reads.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/status-labels.d.ts +1 -1
- package/build/dist/api/modules/heyresearch/status-labels.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.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/contracts.js +1 -1
- package/build/dist/api/modules/hookr/create-cancel.js +1 -1
- package/build/dist/api/modules/hookr/discovery.js +1 -1
- package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/launch-options.js +1 -1
- package/build/dist/api/modules/hookr/launch-profile.js +1 -1
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.js +1 -1
- package/build/dist/api/modules/hookr/liquidity.js +1 -1
- package/build/dist/api/modules/hookr/lp-positions.js +1 -1
- package/build/dist/api/modules/hookr/lp-reads.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/pins.js +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/kyberswap/index.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/abi.d.ts +165 -0
- package/build/dist/api/modules/layerbank/abi.js +1 -0
- package/build/dist/api/modules/layerbank/actions.d.ts +2 -0
- package/build/dist/api/modules/layerbank/actions.js +1 -0
- package/build/dist/api/modules/layerbank/checks.d.ts +21 -0
- package/build/dist/api/modules/layerbank/checks.js +1 -0
- package/build/dist/api/modules/layerbank/index.d.ts +2 -0
- package/build/dist/api/modules/layerbank/index.js +1 -0
- package/build/dist/api/modules/layerbank/merkl.d.ts +6 -0
- package/build/dist/api/modules/layerbank/merkl.js +1 -0
- package/build/dist/api/modules/layerbank/reader.d.ts +15 -0
- package/build/dist/api/modules/layerbank/reader.js +1 -0
- package/build/dist/api/modules/layerbank/reserve.d.ts +13 -0
- package/build/dist/api/modules/layerbank/reserve.js +1 -0
- 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/perps-batch.js +1 -1
- package/build/dist/api/modules/meridian/perps-common.js +1 -1
- package/build/dist/api/modules/meridian/perps-guards.js +1 -1
- package/build/dist/api/modules/meridian/perps-intents.js +1 -1
- package/build/dist/api/modules/meridian/perps-stream.js +1 -1
- package/build/dist/api/modules/meridian/perps.d.ts +1 -0
- package/build/dist/api/modules/meridian/perps.js +1 -1
- package/build/dist/api/modules/meridian/predict-read.js +1 -1
- package/build/dist/api/modules/meridian/rfq.js +1 -1
- package/build/dist/api/modules/merkl/discovery.js +1 -1
- package/build/dist/api/modules/merkl/index.js +1 -1
- package/build/dist/api/modules/merkl/manage.js +1 -1
- package/build/dist/api/modules/merkl/protocol.js +1 -1
- package/build/dist/api/modules/morpho/allocator.js +1 -1
- package/build/dist/api/modules/morpho/bundles-abi.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-abi.js +1 -1
- package/build/dist/api/modules/morpho/midnight.js +1 -1
- package/build/dist/api/modules/morpho/protocol.js +1 -1
- package/build/dist/api/modules/morpho/surface.js +1 -1
- package/build/dist/api/modules/morpho/vault-management.js +1 -1
- package/build/dist/api/modules/morpho/vault-tools.js +1 -1
- package/build/dist/api/modules/morpho/vault-v2.js +1 -1
- package/build/dist/api/modules/netnet/blackjack-hashes.js +1 -1
- package/build/dist/api/modules/netnet/card-abi.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-policy.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action-abi.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/desk-registry.js +1 -1
- package/build/dist/api/modules/netnet/financial-abi.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/gateway.js +1 -1
- package/build/dist/api/modules/orbio/index.js +1 -1
- package/build/dist/api/modules/orbio/pins.js +1 -1
- package/build/dist/api/modules/orbio/positions.d.ts +2 -0
- package/build/dist/api/modules/orbio/positions.js +1 -0
- package/build/dist/api/modules/pendle/abi.d.ts +205 -0
- package/build/dist/api/modules/pendle/abi.js +1 -0
- package/build/dist/api/modules/pendle/convert.d.ts +24 -0
- package/build/dist/api/modules/pendle/convert.js +1 -0
- package/build/dist/api/modules/pendle/costs.d.ts +3 -0
- package/build/dist/api/modules/pendle/costs.js +1 -0
- package/build/dist/api/modules/pendle/index.d.ts +11 -0
- package/build/dist/api/modules/pendle/index.js +1 -0
- package/build/dist/api/modules/pendle/markets.d.ts +37 -0
- package/build/dist/api/modules/pendle/markets.js +1 -0
- package/build/dist/api/modules/pendle/positions.d.ts +18 -0
- package/build/dist/api/modules/pendle/positions.js +1 -0
- package/build/dist/api/modules/pendle/pricecheck.d.ts +95 -0
- package/build/dist/api/modules/pendle/pricecheck.js +1 -0
- package/build/dist/api/modules/pendle/reader.d.ts +17 -0
- package/build/dist/api/modules/pendle/reader.js +1 -0
- package/build/dist/api/modules/pendle/redeem.d.ts +15 -0
- package/build/dist/api/modules/pendle/redeem.js +1 -0
- package/build/dist/api/modules/pendle/trade.d.ts +2 -0
- package/build/dist/api/modules/pendle/trade.js +1 -0
- package/build/dist/api/modules/pendle/types.d.ts +41 -0
- package/build/dist/api/modules/pendle/types.js +0 -0
- package/build/dist/api/modules/pendle/validate.d.ts +424 -0
- package/build/dist/api/modules/pendle/validate.js +1 -0
- package/build/dist/api/modules/pendle/verify.d.ts +22 -0
- package/build/dist/api/modules/pendle/verify.js +1 -0
- package/build/dist/api/modules/pons/claim.js +1 -1
- package/build/dist/api/modules/pons/holder-directory.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.d.ts +38 -2
- 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.d.ts +4 -0
- package/build/dist/api/modules/priors/holdings.js +1 -0
- package/build/dist/api/modules/priors/index.js +1 -1
- package/build/dist/api/modules/priors/integration.js +1 -1
- package/build/dist/api/modules/priors/market.js +1 -1
- package/build/dist/api/modules/priors/pt.js +1 -1
- package/build/dist/api/modules/priors/savings-exit.js +1 -1
- package/build/dist/api/modules/priors/starter-line.js +1 -1
- package/build/dist/api/modules/priors/stock-swap.js +1 -1
- package/build/dist/api/modules/relay/api.js +1 -1
- package/build/dist/api/modules/relay/bootstrap.js +1 -1
- package/build/dist/api/modules/relay/discovery.js +1 -1
- package/build/dist/api/modules/relay/inbound.d.ts +2 -0
- package/build/dist/api/modules/relay/inbound.js +1 -1
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/order.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/readiness.js +1 -1
- package/build/dist/api/modules/relay/reads.js +1 -1
- package/build/dist/api/modules/relay/vaults.js +1 -1
- package/build/dist/api/modules/spark/actions.js +1 -1
- package/build/dist/api/modules/spark/details.js +1 -1
- package/build/dist/api/modules/spark/index.js +1 -1
- package/build/dist/api/modules/spark/management.js +1 -1
- package/build/dist/api/modules/steakhouse/analytics.js +1 -1
- package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
- package/build/dist/api/modules/steakhouse/index.js +1 -1
- package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
- package/build/dist/api/modules/steakhouse/management.js +1 -1
- package/build/dist/api/modules/steakhouse/share-symbol.d.ts +3 -0
- package/build/dist/api/modules/steakhouse/share-symbol.js +1 -0
- 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/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.d.ts +11 -0
- 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/license.js +1 -1
- package/build/dist/api/modules/wormhole/quotetext.js +1 -1
- package/build/dist/api/modules/wormhole/scan-text.js +1 -1
- package/build/dist/api/modules/wormhole/token-check.js +1 -1
- package/build/dist/api/owner-signature.js +1 -1
- package/build/dist/api/positions.d.ts +5 -5
- package/build/dist/api/positions.js +1 -1
- package/build/dist/api/pricenote.js +1 -1
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/pricing.js +1 -1
- package/build/dist/api/reads.js +1 -1
- package/build/dist/api/routes.js +1 -1
- package/build/dist/api/rpc.js +1 -1
- package/build/dist/api/secret-fields.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/signing.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/token-output.js +1 -1
- package/build/dist/api/tokens.d.ts +1 -0
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/tx.js +1 -1
- package/build/dist/api/types.d.ts +7 -2
- package/build/dist/api/untrusted.js +1 -1
- package/build/dist/api/vendor-limits.js +1 -1
- package/build/dist/chunks/{PEA32CWB.js → 2KYAMXTS.js} +1 -1
- package/build/dist/chunks/2MAMJJJC.js +1 -0
- package/build/dist/chunks/2MZXTOZU.js +1 -0
- package/build/dist/chunks/{VC2RCYQE.js → 2TK3ETUO.js} +1 -1
- package/build/dist/chunks/{LKJBMHCE.js → 326QMOTR.js} +1 -1
- package/build/dist/chunks/{OE3CLZHR.js → 3FUVMSCF.js} +1 -1
- package/build/dist/chunks/{3EFV4FQF.js → 3GOHSYHW.js} +1 -1
- package/build/dist/chunks/{CY75R4FK.js → 3MLUCYCB.js} +1 -1
- package/build/dist/chunks/{5O5ZE3ZV.js → 3NJ5KQ3Q.js} +1 -1
- package/build/dist/chunks/{EVANKNJV.js → 3XNZUIRU.js} +1 -1
- package/build/dist/chunks/3XXBLNEX.js +1 -0
- package/build/dist/chunks/{6IM6A5VA.js → 43LI5NKJ.js} +1 -1
- package/build/dist/chunks/{YZSTP2E6.js → 45BRW2ZF.js} +1 -1
- package/build/dist/chunks/46547QT3.js +1 -0
- package/build/dist/chunks/{C3TJLARP.js → 46KWRAYK.js} +1 -1
- package/build/dist/chunks/{SOYQOE5P.js → 4BVP652W.js} +1 -1
- package/build/dist/chunks/4HG6FRVH.js +1 -0
- package/build/dist/chunks/4MXM6Q4W.js +1 -0
- package/build/dist/chunks/{NWSPC3NH.js → 4PY3UFNR.js} +1 -1
- package/build/dist/chunks/52ELWNXJ.js +2 -0
- package/build/dist/chunks/{O5IVZHHP.js → 553UE2ZQ.js} +1 -1
- package/build/dist/chunks/{FUXT7GRK.js → 57MEFFCU.js} +1 -1
- package/build/dist/chunks/{XWEFKXKA.js → 5APS4T2D.js} +1 -1
- package/build/dist/chunks/{3RFSGU2Y.js → 5CAAFU7R.js} +1 -1
- package/build/dist/chunks/{6AWTAE4Q.js → 5SMVQCAP.js} +1 -1
- package/build/dist/chunks/63YRSLDK.js +1 -0
- package/build/dist/chunks/{53N7PNJH.js → 64GOINYS.js} +1 -1
- package/build/dist/chunks/66F5ZH34.js +1 -0
- package/build/dist/chunks/{6ZYLNB2B.js → 6B3VVISQ.js} +1 -1
- package/build/dist/chunks/6D5DJA5B.js +1 -0
- package/build/dist/chunks/{DZGEQBO7.js → 6I4NTKB2.js} +1 -1
- package/build/dist/chunks/{DCTUYDWF.js → 6OGDTEGH.js} +1 -1
- package/build/dist/chunks/6PBGEPUK.js +20 -0
- package/build/dist/chunks/{E7R3J4H7.js → 6WD4HHID.js} +1 -1
- package/build/dist/chunks/{RAKUK5VR.js → 6WZX7C4T.js} +1 -1
- package/build/dist/chunks/{MKQVS3IO.js → 74Y2KDNR.js} +1 -1
- package/build/dist/chunks/{AMICUXS6.js → 7WSHW7KW.js} +1 -1
- package/build/dist/chunks/A3PN3PK3.js +1 -0
- package/build/dist/chunks/{CXLEQCP3.js → ABPL3ZZI.js} +1 -1
- package/build/dist/chunks/{YQUKU2LS.js → AFBEZXNV.js} +1 -1
- package/build/dist/chunks/AKYF5264.js +7 -0
- package/build/dist/chunks/{ASDKY5NX.js → APGLZXIW.js} +1 -1
- package/build/dist/chunks/{UNZRE3YU.js → AVG4W3Y7.js} +1 -1
- package/build/dist/chunks/{VFKNXQXI.js → B3RXD5ET.js} +1 -1
- package/build/dist/chunks/{V5LTA42G.js → BBS3ODWZ.js} +1 -1
- package/build/dist/chunks/{U3F6DDML.js → BJ2VGRF4.js} +1 -1
- package/build/dist/chunks/{VFSRRDLY.js → BTD5SMOW.js} +1 -1
- package/build/dist/chunks/{PTAWEHKB.js → BTPXJAUX.js} +1 -1
- package/build/dist/chunks/{R53P2K3C.js → C36BFZH6.js} +1 -1
- package/build/dist/chunks/{L62M7LOB.js → C5ZZAYXD.js} +1 -1
- package/build/dist/chunks/{VVEUJ36E.js → C7AXJHBT.js} +1 -1
- package/build/dist/chunks/CBG5HARQ.js +2 -0
- package/build/dist/chunks/{ELZNT5Q3.js → CCTXCMH4.js} +1 -1
- package/build/dist/chunks/{AJP5LDM2.js → CHXBOXOD.js} +1 -1
- package/build/dist/chunks/D3YLXQPW.js +1 -0
- package/build/dist/chunks/DFM4T6ZE.js +1 -0
- package/build/dist/chunks/{GGUEKSR4.js → DJN3JAWB.js} +1 -1
- package/build/dist/chunks/{52DHGSG4.js → DW4V5PUY.js} +1 -1
- package/build/dist/chunks/E3RACZUY.js +1 -0
- package/build/dist/chunks/{VCLPOU7T.js → E674J2MD.js} +1 -1
- package/build/dist/chunks/EE64JSLY.js +1 -0
- package/build/dist/chunks/EJ7O75A7.js +1 -0
- package/build/dist/chunks/{ZXQMF56D.js → ELSXLZN5.js} +1 -1
- package/build/dist/chunks/ER47KGRM.js +1 -0
- package/build/dist/chunks/FQ6UZCM6.js +1 -0
- package/build/dist/chunks/FWD4L3CJ.js +1 -0
- package/build/dist/chunks/GEIFITAQ.js +1 -0
- package/build/dist/chunks/{S3HNPTXA.js → GGSAKCND.js} +1 -1
- package/build/dist/chunks/GL4NCUMH.js +1 -0
- package/build/dist/chunks/GNC6RXLT.js +1 -0
- package/build/dist/chunks/{YA5WWDEW.js → GQ5GYUEH.js} +1 -1
- package/build/dist/chunks/{TLJPVYRJ.js → GW5IXLKU.js} +1 -1
- package/build/dist/chunks/{57HAXNQV.js → GW626GG2.js} +1 -1
- package/build/dist/chunks/{CE7D6MUS.js → H2XDMFQQ.js} +1 -1
- package/build/dist/chunks/H43RNCX2.js +1 -0
- package/build/dist/chunks/HAQPIBYR.js +1 -0
- package/build/dist/chunks/HCUHMCBW.js +1 -0
- package/build/dist/chunks/HKEMQBFA.js +1 -0
- package/build/dist/chunks/{WTSMPDT5.js → HM72DH4V.js} +1 -1
- package/build/dist/chunks/HSCQZ66A.js +1 -0
- package/build/dist/chunks/{4KQZTPMS.js → I26DMNJG.js} +1 -1
- package/build/dist/chunks/{YHPOXAKA.js → IMO3GDA5.js} +1 -1
- package/build/dist/chunks/INOZIE55.js +1 -0
- package/build/dist/chunks/IOYRL6AY.js +1 -0
- package/build/dist/chunks/IX3GZMTM.js +1 -0
- package/build/dist/chunks/IY7BXLT4.js +1 -0
- package/build/dist/chunks/J2OT4KAH.js +1 -0
- package/build/dist/chunks/JKD2B6OX.js +1 -0
- package/build/dist/chunks/JUZ5JU6D.js +70 -0
- package/build/dist/chunks/{5OEHZJ6X.js → JVLLVNF2.js} +1 -1
- package/build/dist/chunks/K3RDPI5J.js +1 -0
- package/build/dist/chunks/{WCKMQFGS.js → K4DHHQBI.js} +1 -1
- package/build/dist/chunks/KBKK7UNY.js +1 -0
- package/build/dist/chunks/KIFSRO5K.js +1 -0
- package/build/dist/chunks/KIFZ5ZSK.js +1 -0
- package/build/dist/chunks/{4AKIXLXH.js → KPCY5V35.js} +1 -1
- package/build/dist/chunks/L4N2RSK2.js +1 -0
- package/build/dist/chunks/{2W46IRX6.js → L5BLHY34.js} +1 -1
- package/build/dist/chunks/{ZT47KN7A.js → LSXUAHOE.js} +1 -1
- package/build/dist/chunks/{NATG6YA6.js → M37654RL.js} +1 -1
- package/build/dist/chunks/MJ6WEWMI.js +3 -0
- package/build/dist/chunks/{ACN2BFMA.js → MQK6OP7S.js} +1 -1
- package/build/dist/chunks/{XV2HQKND.js → MR5L7V6Z.js} +1 -1
- package/build/dist/chunks/MRMR4QHA.js +1 -0
- package/build/dist/chunks/{TWSTOFN3.js → N4Q6GN65.js} +1 -1
- package/build/dist/chunks/{H4S2ZCWK.js → NAZPDRIF.js} +1 -1
- package/build/dist/chunks/{FBSUTF3B.js → NDCLTVIU.js} +1 -1
- package/build/dist/chunks/NEEZBJBC.js +1 -0
- package/build/dist/chunks/{MRWCFTMS.js → NKX3FE34.js} +1 -1
- package/build/dist/chunks/{J3GFCBZZ.js → NKZKKCK2.js} +1 -1
- package/build/dist/chunks/{73N3TOJL.js → NWNYJ26T.js} +1 -1
- package/build/dist/chunks/{LBEMCOND.js → O7HCEPQY.js} +1 -1
- package/build/dist/chunks/{F6WBPPBN.js → OJ4WJUPP.js} +1 -1
- package/build/dist/chunks/OJPG45AC.js +1 -0
- package/build/dist/chunks/{SKQGLGES.js → OKUO3BVM.js} +1 -1
- package/build/dist/chunks/OTXSKFUD.js +1 -0
- package/build/dist/chunks/{AAGDMH54.js → P3S4BR5G.js} +1 -1
- package/build/dist/chunks/P56RZC2M.js +1 -0
- package/build/dist/chunks/{EA6IYKIB.js → P5PYFK7L.js} +1 -1
- package/build/dist/chunks/{JST5JGAP.js → P7I62KFR.js} +1 -1
- package/build/dist/chunks/{5IIR3GIN.js → PK66GCDT.js} +1 -1
- package/build/dist/chunks/PSBQWDYI.js +1 -0
- package/build/dist/chunks/{WQ6H62DM.js → PV5FDT6O.js} +1 -1
- package/build/dist/chunks/{TQL7UDFL.js → PXT5YTWU.js} +1 -1
- package/build/dist/chunks/Q42YI3EP.js +1 -0
- package/build/dist/chunks/{SQ5BNSXR.js → QA3UHEO3.js} +1 -1
- package/build/dist/chunks/QC3HH5UD.js +3 -0
- package/build/dist/chunks/{TWCSCRFS.js → QF52OIBS.js} +1 -1
- package/build/dist/chunks/{LQUDJCAR.js → QO3KCJMP.js} +1 -1
- package/build/dist/chunks/QQECG3WP.js +1 -0
- package/build/dist/chunks/QSHCBASA.js +1 -0
- package/build/dist/chunks/QU5XKRGK.js +1 -0
- package/build/dist/chunks/{TPDOUL4N.js → QZZ4O34L.js} +1 -1
- package/build/dist/chunks/RQ4GHJXE.js +1 -0
- package/build/dist/chunks/{ALK6NKFP.js → RUC7KH7A.js} +1 -1
- package/build/dist/chunks/RUX3RY7Y.js +1 -0
- package/build/dist/chunks/{GIV5JMTE.js → RVDUSNWW.js} +1 -1
- package/build/dist/chunks/S47VUTHM.js +1 -0
- package/build/dist/chunks/{2LM7U4S7.js → S7IFAQPG.js} +1 -1
- package/build/dist/chunks/{XQUPZ3GU.js → SIYUNOLI.js} +1 -1
- package/build/dist/chunks/{7XLEYOZH.js → SJJR4ZBZ.js} +1 -1
- package/build/dist/chunks/SK2VBNAU.js +1 -0
- package/build/dist/chunks/SMYWWIE6.js +1 -0
- package/build/dist/chunks/SPJCSEKP.js +1 -0
- package/build/dist/chunks/{L3ZM77SJ.js → SSHCD6RZ.js} +1 -1
- package/build/dist/chunks/{3NDVXEBR.js → T2WHOZXM.js} +1 -1
- package/build/dist/chunks/T3AJSQYT.js +1 -0
- package/build/dist/chunks/TAEZTP4L.js +1 -0
- package/build/dist/chunks/TEJ7W534.js +1 -0
- package/build/dist/chunks/TFDPEAVZ.js +1 -0
- package/build/dist/chunks/TM2XCRU7.js +1 -0
- package/build/dist/chunks/{XQXLFF7Y.js → TMVO2DAK.js} +1 -1
- package/build/dist/chunks/{2UU5TBBB.js → TVWMTMEF.js} +1 -1
- package/build/dist/chunks/{AFHHRDPJ.js → TX2EOIRS.js} +1 -1
- package/build/dist/chunks/{QRDDKA4I.js → U4JGEMKT.js} +1 -1
- package/build/dist/chunks/{PARWLWXW.js → U5PMVP56.js} +1 -1
- package/build/dist/chunks/U67J4BCH.js +1 -0
- package/build/dist/chunks/{SSTROLQM.js → UHTRW2R6.js} +1 -1
- package/build/dist/chunks/{XUYHMOHS.js → UHVSINR5.js} +1 -1
- package/build/dist/chunks/{NRBIXV7V.js → UMIZMJWW.js} +1 -1
- package/build/dist/chunks/{VXLJRRKV.js → UNJJRQIU.js} +1 -1
- package/build/dist/chunks/V74F6IDY.js +1 -0
- package/build/dist/chunks/VEQBHI6O.js +1 -0
- package/build/dist/chunks/VHV6WQ5F.js +1 -0
- package/build/dist/chunks/{DRWWPBOQ.js → VJS4DHQQ.js} +1 -1
- package/build/dist/chunks/{R7FXNZRM.js → VOMGT5SG.js} +1 -1
- package/build/dist/chunks/{QXNPPCOU.js → VY7XRHZQ.js} +1 -1
- package/build/dist/chunks/{TCPPYBGQ.js → VYAJXLND.js} +1 -1
- package/build/dist/chunks/{WWFOYZT2.js → VYN2NRAP.js} +1 -1
- package/build/dist/chunks/{OVK4EEOD.js → VYYSL557.js} +1 -1
- package/build/dist/chunks/W2BYU5JQ.js +2 -0
- package/build/dist/chunks/W6BS3T7S.js +1 -0
- package/build/dist/chunks/WCNHZYQQ.js +1 -0
- package/build/dist/chunks/{BX7XQANB.js → WDK6VOG4.js} +1 -1
- package/build/dist/chunks/{QYYFRAWY.js → WIRBCS4W.js} +1 -1
- package/build/dist/chunks/{3WBDHUV2.js → WLMWWEP7.js} +1 -1
- package/build/dist/chunks/{TNSKEHPC.js → WP6RHXGN.js} +1 -1
- package/build/dist/chunks/WTXC3XKW.js +1 -0
- package/build/dist/chunks/{R7QPJQP6.js → WU7XIAXB.js} +1 -1
- package/build/dist/chunks/{OQVZVR2S.js → WV3A3OUU.js} +1 -1
- package/build/dist/chunks/{GCWA4Z3W.js → X2KFXCVD.js} +1 -1
- package/build/dist/chunks/X3BYCOWS.js +1 -0
- package/build/dist/chunks/{L7YBCMZU.js → X3PQMS4N.js} +1 -1
- package/build/dist/chunks/{WVXW6VL3.js → XBE3B6Y2.js} +1 -1
- package/build/dist/chunks/XLOYBLFI.js +1 -0
- package/build/dist/chunks/XR7VK24E.js +1 -0
- package/build/dist/chunks/XSD5NL7J.js +1 -0
- package/build/dist/chunks/{NU4K3TEZ.js → XSRIJUFU.js} +1 -1
- package/build/dist/chunks/{WQQJ7UPJ.js → Y25EXZCO.js} +1 -1
- package/build/dist/chunks/{2FSX7MMR.js → YCZPSMZ5.js} +1 -1
- package/build/dist/chunks/YDNTY67T.js +1 -0
- package/build/dist/chunks/YN56C7PN.js +1 -0
- package/build/dist/chunks/YWRDZQI6.js +1 -0
- package/build/dist/chunks/{SJPM5ST4.js → YXTSWRV5.js} +1 -1
- package/build/dist/chunks/Z43BTOTE.js +1 -0
- package/build/dist/chunks/{PWBL4WKB.js → Z4FZVJ5Z.js} +1 -1
- package/build/dist/chunks/ZMFRMWHR.js +1 -0
- package/build/dist/chunks/{KSZMMNXK.js → ZQAFFWDK.js} +1 -1
- package/build/dist/chunks/{LMVB3B6T.js → ZSN4IRI5.js} +1 -1
- package/build/dist/chunks/{CQCVFRQ5.js → ZV5HIQXC.js} +1 -1
- package/package.json +2 -2
- package/build/dist/chunks/2MSQ6JII.js +0 -1
- package/build/dist/chunks/3SC5UI35.js +0 -1
- package/build/dist/chunks/4GHVIBL5.js +0 -1
- package/build/dist/chunks/4X2JOQ2L.js +0 -1
- package/build/dist/chunks/5VHH5PW3.js +0 -1
- package/build/dist/chunks/5YS5V2LK.js +0 -1
- package/build/dist/chunks/6UPPUHCL.js +0 -1
- package/build/dist/chunks/7YU6DELJ.js +0 -1
- package/build/dist/chunks/AXYOJBX6.js +0 -1
- package/build/dist/chunks/CEIPDEXZ.js +0 -1
- package/build/dist/chunks/CUNQ5RG5.js +0 -1
- package/build/dist/chunks/EG6M6SSO.js +0 -1
- package/build/dist/chunks/EGUMOD3A.js +0 -1
- package/build/dist/chunks/EXRKBBX2.js +0 -1
- package/build/dist/chunks/G3MHDTGT.js +0 -1
- package/build/dist/chunks/G6HCV67X.js +0 -1
- package/build/dist/chunks/GJY3P6OG.js +0 -1
- package/build/dist/chunks/HIMVOTIU.js +0 -1
- package/build/dist/chunks/IBXYIN7Q.js +0 -1
- package/build/dist/chunks/IUE6RASI.js +0 -1
- package/build/dist/chunks/JPOYTTTW.js +0 -1
- package/build/dist/chunks/JWCOXLYA.js +0 -1
- package/build/dist/chunks/KHJFXJBU.js +0 -1
- package/build/dist/chunks/LLM5WDM3.js +0 -1
- package/build/dist/chunks/LQGPMOD2.js +0 -1
- package/build/dist/chunks/MYBDO5SA.js +0 -1
- package/build/dist/chunks/NAYRD43N.js +0 -1
- package/build/dist/chunks/NMYGNJIJ.js +0 -1
- package/build/dist/chunks/NSOEDRBU.js +0 -3
- package/build/dist/chunks/PZHR4ITH.js +0 -1
- package/build/dist/chunks/R7SXC74O.js +0 -1
- package/build/dist/chunks/RETS2ZEK.js +0 -1
- package/build/dist/chunks/SJPYXNOK.js +0 -1
- package/build/dist/chunks/SQZRVIVF.js +0 -1
- package/build/dist/chunks/SXAIXD56.js +0 -1
- package/build/dist/chunks/SXX3VTBP.js +0 -1
- package/build/dist/chunks/TMGWXDCZ.js +0 -1
- package/build/dist/chunks/TNLHMDWL.js +0 -1
- package/build/dist/chunks/UFS2RVEZ.js +0 -1
- package/build/dist/chunks/USSOVTD5.js +0 -1
- package/build/dist/chunks/UWOFA6GV.js +0 -1
- package/build/dist/chunks/V2OOOV6B.js +0 -1
- package/build/dist/chunks/XVFLT275.js +0 -1
- package/build/dist/chunks/YHB55C5T.js +0 -1
- package/build/dist/chunks/YOENHHKI.js +0 -1
- package/build/dist/chunks/Z7RL4NGX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A}from"./5HCXZWUH.js";import{n as y}from"./
|
|
1
|
+
import{c as A}from"./5HCXZWUH.js";import{n as y}from"./ABPL3ZZI.js";import{a as b}from"./XSD5NL7J.js";import{erc20Abi as F,getAddress as $}from"viem";var P=new WeakMap,E=3e3,k=new WeakMap;async function q(C,h,u,m,c){u=$(u);let n=A(C),e=P.get(n);e||(e=new Map,P.set(n,e));let i=`${h}:${u.toLowerCase()}:${m}:${c??"latest"}`,t=e.get(i);if(t&&(e.delete(i),e.set(i,t)),!t){for(t=new Promise((s,T)=>{let a=k.get(n);a||(a=new Map,k.set(n,a));let f=`${h}:${c??"latest"}`,l=a.get(f);if(!l){l=[],a.set(f,l);let d=l;queueMicrotask(async()=>{a.delete(f);let w=d.map(r=>({address:r.address,abi:F,functionName:r.field}));try{if(d.length>1&&n.chain?.contracts?.multicall3&&typeof n.multicall=="function"){let r=await y(()=>n.multicall({contracts:w,blockNumber:c,allowFailure:!0}));d.forEach((o,p)=>{let g=r[p];g?.status==="success"?o.resolve(g.result):o.reject(g?.error??new b("Token metadata could not be read."))})}else await Promise.all(d.map(async(r,o)=>{try{r.resolve(await y(()=>n.readContract({...w[o],blockNumber:c})))}catch(p){r.reject(p)}}))}catch(r){d.forEach(o=>o.reject(r))}})}l.push({address:u,field:m,resolve:s,reject:T})}).then(s=>{if(m==="decimals"?!Number.isInteger(s)||Number(s)<0||Number(s)>255:typeof s!="string"||!s.trim())throw new b("The contract returned invalid token metadata.");return s});e.size>=E;)e.delete(e.keys().next().value);e.set(i,t);let M=t;t.catch(()=>{e.get(i)===M&&e.delete(i)})}try{return await t}finally{c!==void 0&&e.get(i)===t&&e.delete(i)}}export{q as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as P,e as E,f,h as M,j as b,k as V,l as T,m as q,n as j,o as g,p as S,q as x,t as F,w as U,z as $}from"./
|
|
1
|
+
import{d as P,e as E,f,h as M,j as b,k as V,l as T,m as q,n as j,o as g,p as S,q as x,t as F,w as U,z as $}from"./N4Q6GN65.js";import{c as m}from"./X5V2Z2NM.js";import{a as _}from"./43LI5NKJ.js";import{c as R,g as v}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";import{a as I}from"./JXOEJPJ4.js";import{encodeFunctionData as N,keccak256 as G,toBytes as L}from"viem";var D=`0x${"00".repeat(32)}`,ae=d=>{let A=(e,t,s)=>({name:e,inputSchema:t,execute:async(r,a)=>{try{return _(a),j(d,r.chainId),await s(r,a)}catch(u){throw new i(d.plainError(u))}}}),C={transactionHash:{...E,description:"After local submission, repeat the same arguments with the mined hash to verify calldata, event and registry state."}},w=(e,t,s)=>d.clientFor(M(d).chainId).readContract({address:e,abi:m,functionName:t,args:s}),p=async(e,t)=>{try{return await w(e,"getValidationStatus",[t])}catch{return}},H=(e,t)=>({requestHash:e,validator:t[0],agentId:t[1].toString(),response:t[2],responseHash:t[3],tag:I(t[4]),lastUpdate:t[5].toString(),possiblyUnanswered:t[2]===0&&t[3]===D&&t[4]===""}),W=A("erc8004_validation_request",{type:"object",additionalProperties:!1,required:["agentId","validator","requestURI"],description:"Ask a validator (re-execution staker, zkML verifier, TEE oracle, judge) to check an agent's work (Validation Registry validationRequest). Owner or approved operator only.",properties:{agentId:P,validator:{...R,description:"The validator contract or wallet that will respond."},requestURI:{type:"string",description:"HTTPS/IPFS URI of the data the validator needs (inputs and outputs)."},requestHash:{...f,description:"keccak256 commitment to the request payload; provide this or requestContent."},requestContent:{type:"string",description:"The exact request payload text; Oak commits its keccak256 as requestHash."},...C}},async(e,t)=>{let{address:s}=b(d),r=T(e.agentId),a=q(e.validator,"validator");if(V(a))throw new i("Provide a real validator address.");let u=x(e.requestURI,"requestURI");if(e.requestHash===void 0==(e.requestContent===void 0))throw new i("Provide exactly one of requestHash or requestContent.");let l=e.requestHash!==void 0?g(e.requestHash,"requestHash"):G(L(S(e.requestContent,"requestContent",1e6,!1)));return $(d,t,e,{to:s,data:N({abi:m,functionName:"validationRequest",args:[a,r,u,l]}),description:`Request validation of ERC-8004 agent ${r} by ${a}.`,summary:`Asks ${a} to validate agent ${r}'s work: request ${l}, data at ${I(u)}. The request is public and permanent. Only the named validator can respond. Repeat with transactionHash to verify.`,authority:async()=>{if(await F(d,r,t,"request validation"),await p(s,l))throw new i("A validation request with that requestHash already exists; use a different payload commitment.")},verify:async h=>{let c=U(h,s,m,"ValidationRequest"),o=await p(s,l);if(!o||!v(String(c.validatorAddress),a)||c.agentId!==r||c.requestHash!==l||o[1]!==r||!v(o[0],a))throw new i("The registry event or stored request does not match.");return{...H(l,o),confirmed:!0}}})}),Z=A("erc8004_validation_response",{type:"object",additionalProperties:!1,required:["requestHash","response"],description:"As the named validator, record a validation result from 0 (failed) to 100 (passed) for a request. May be called again to update.",properties:{requestHash:f,response:{type:"integer",minimum:0,maximum:100},responseURI:{type:"string",description:"Optional HTTPS/IPFS evidence or audit URI."},responseHash:{...f,description:"Optional commitment to the evidence content."},tag:{type:"string",description:"Optional category, e.g. soft-finality / hard-finality."},...C}},async(e,t)=>{let{address:s}=b(d),r=g(e.requestHash,"requestHash"),a=e.response;if(typeof a!="number"||!Number.isInteger(a)||a<0||a>100)throw new i("response must be an integer from 0 to 100.");let u=e.responseURI===void 0?"":x(e.responseURI,"responseURI"),l=e.responseHash===void 0?D:g(e.responseHash,"responseHash"),h=S(e.tag,"tag",128);return $(d,t,e,{to:s,data:N({abi:m,functionName:"validationResponse",args:[r,a,u,l,h]}),description:`Respond ${a}/100 to validation request ${r}.`,summary:`Records validation result ${a}/100${h?` (tag ${I(h)})`:""} for request ${r} as this wallet. It is public; a later response replaces the stored result but the event history stays. Repeat with transactionHash to verify.`,authority:async()=>{let c=await p(s,r);if(!c)throw new i("No validation request has that requestHash.");if(!v(c[0],t))throw new i("Only the validator named in the request can respond to it.")},verify:async c=>{let o=U(c,s,m,"ValidationResponse"),n=await p(s,r);if(!n||o.requestHash!==r||o.response!==a||!v(String(o.validatorAddress),t)||n[2]!==a)throw new i("The registry event or stored result does not match.");return{...H(r,n),confirmed:!0}}})}),z=A("erc8004_validation",{type:"object",additionalProperties:!1,description:"Read-only validation lookups. Provide exactly one of requestHash (one request), agentId (its requests and average) or validator (requests addressed to it).",properties:{requestHash:f,agentId:P,validator:R,validators:{type:"array",maxItems:50,items:R,description:"With agentId: average only these validators."},tag:{type:"string",description:"With agentId: average only this tag."},limit:{type:"integer",minimum:1,maximum:100,default:25}}},async e=>{let{address:t}=b(d),s=["requestHash","agentId","validator"].filter(n=>e[n]!==void 0);if(s.length!==1)throw new i("Provide exactly one of requestHash, agentId or validator.");let r=typeof e.limit=="number"?Math.min(Math.max(1,Math.trunc(e.limit)),100):25,a=async n=>{let y=n.slice(-r).reverse(),B=await Promise.all(y.map(async k=>{let O=await p(t,k);return O?H(k,O):{requestHash:k,unavailable:!0}}));return{requestsTotal:n.length,requests:B,truncated:n.length>y.length,newestFirst:!0}};if(s[0]==="requestHash"){let n=g(e.requestHash,"requestHash"),y=await p(t,n);if(!y)throw new i("No validation request has that requestHash.");return{registry:t,...H(n,y)}}if(s[0]==="validator")return{registry:t,validator:q(e.validator,"validator"),...await a(await w(t,"getValidatorRequests",[q(e.validator,"validator")]))};let u=T(e.agentId),l=Array.isArray(e.validators)?e.validators.map(n=>q(n,"validator")):[],h=S(e.tag,"tag",128),[c,o]=await Promise.all([w(t,"getAgentValidations",[u]),w(t,"getSummary",[u,l,h])]);return{registry:t,agentId:u.toString(),answeredCount:o[0].toString(),averageResponse:o[0]===0n?null:o[1],...await a(c),note:"The average counts only answered requests and includes whatever validators were asked; judge a result by who the validator is."}});return{tools:[W,Z,z]}};export{ae as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as qe,b as fe,g as Z,h as he,i as Be,m as ee,n as D,y as be,z as Oe}from"./3NJ5KQ3Q.js";import{b as y,c as Ie}from"./ZQAFFWDK.js";import{a as le,b as z}from"./3MLUCYCB.js";import{a as Q}from"./43LI5NKJ.js";import{a as $e}from"./IOYRL6AY.js";import{a as Se}from"./66F5ZH34.js";import{c as me,g as P}from"./NWNYJ26T.js";import{b as Pe}from"./IX3GZMTM.js";import{a as b,i as pe}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{a as ce}from"./JXOEJPJ4.js";import{randomUUID as He}from"node:crypto";import{encodeAbiParameters as ne,encodeFunctionData as ke,erc20Abi as Te,getAddress as F,parseAbi as X,parseAbiParameters as oe,zeroAddress as K}from"viem";var Me=pe[b].pons,N=pe[b].ponsTrade,Re=X(["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))"]),te=X(["function getReserves() view returns (uint256 quoteReserve,uint256 tokenReserve)","function feeBps() view returns (uint256)","function creatorTaxBps() view returns (uint256)","function currentSnipeTaxBps(address) view returns (uint256)","function sellableTokens() view returns (uint256)","function buy(uint256 quoteIn,uint256 minTokensOut,address recipient) payable returns (uint256)","function sell(uint256 tokensIn,uint256 minQuoteOut,address recipient) returns (uint256)"]),Le=X(["function quoteExactInputSingle(((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountOut,uint256 gasEstimate)"]),ze=X(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),Ke=X(["function approve(address token,address spender,uint160 amount,uint48 expiration)"]),Xe=oe("((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 amountIn,uint128 amountOutMinimum,uint256 minHopPriceX36,bytes hookData)"),je={address:le,chainId:b,decimals:18,symbol:"ETH"},_e="There is no on-chain expiry. The signed transaction is protected by its minimum output.",Ge=`Quote expiry is enforced by Oak before signing only. ${_e}`,$=10000n,we=(1n<<256n)-1n,Ee=(1n<<128n)-1n,I=(n,t)=>({token:n,amount:t.toString()}),Ne=(n,t)=>(n+t-1n)/t,Ce="Reuse existing exact allowance";async function Ve(n,t,i,o,c){try{let e=await n.readContract({address:t,abi:Te,functionName:"allowance",args:[i,o],blockNumber:c});return typeof e=="bigint"?e:void 0}catch{return}}var We={type:"object",additionalProperties:!1,required:["token","amountIn"],properties:{token:{...me,description:"Pons launch token address on chain 4663."},amountIn:Se("Positive base units: the launch pair token for buy (native ETH wei for ETH pairs; pons_status shows pairToken), the launch token for sell."),pairToken:{...me,description:"The launch pair from pons_status. Required to buy a custom-pair launch, so amountIn is never read in the wrong units; omit or use the zero address for native ETH."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:fe}}};function Qe(n,t,i,o){if(n===void 0){if(i&&y(t)!==K)throw new d(`This Pons launch is paired with ${o}; amountIn is in that token's base units. Repeat with pairToken "${t}" to confirm the input asset.`);return}if(typeof n!="string")throw new d("pairToken must be a token address.");if(Q(n),!P(y(n),y(t)))throw new Z(`This Pons launch trades only against ${o}.`)}async function De(n,t,i,o,{quoteOnly:c=!1,curveOnly:e=!1,blockNumber:p}={}){if(Q(i),Object.keys(t).some(f=>!["token","amountIn","slippageBps","pairToken"].includes(f)))throw new d("Provide only token, amountIn, optional pairToken and optional slippageBps.");if(typeof t.token!="string")throw new d("Provide a launch token address.");Q(t.token);let s=F(t.token),r=Pe(t.amountIn);if(r===0n||r>we)throw new d("Trade amount must be positive and within the uint256 range.");let m=t.slippageBps??fe;if(typeof m!="number"||!Number.isInteger(m)||m<0||m>=1e4)throw new d("Slippage must be an integer from 0 to 9999 basis points.");let x=f=>f*($-BigInt(m))/$,a=n.clientFor(b),l=p===void 0?await a.getBlock():await a.getBlock({blockNumber:p});if(p!==void 0&&l.number!==p)throw new d("Pons quote snapshot is unavailable.");let u=await a.readContract({address:Me.factory.address,abi:Re,functionName:"getLaunchedToken",args:[s],blockNumber:l.number});if(!u.exists||!P(u.token,s))throw new d("This address is not a Pons launch token.");if(e&&u.phase!==0)throw new Z("Pons curve quotes are only available before graduation.");if(u.phase===1)throw new d("Pons graduation is pending; the curve is closed and the pool is not ready.");if(u.phase===3)throw new d("This Pons launch was rescued and has no active trade route.");if(u.phase!==0&&u.phase!==2)throw new d("This Pons launch has an unknown trade phase.");let g=y(u.pairToken)===K,C=F(u.pairToken);if(P(C,s))throw new d("This Pons launch has an invalid pair.");let j=f=>Promise.all([a.readContract({address:f,abi:Te,functionName:"symbol",blockNumber:l.number}),a.readContract({address:f,abi:Te,functionName:"decimals",blockNumber:l.number})]),[[B,U],H]=await Promise.all([j(s),g?void 0:j(C)]),w=H?{address:C,chainId:b,symbol:ce(H[0]),decimals:H[1]}:je,G=g?"native ETH":`${w.symbol} (${w.address})`;Qe(t.pairToken,C,o,`${G}, ${w.decimals} decimals`);let V={address:s,chainId:b,symbol:ce(B),decimals:U},se=o?w:V,re=o?V:w,q=[],ie=(f,h,S,A)=>n.unsignedTx({to:f,data:h,value:S.toString(),chainId:b,description:A}),T,k,W,O=r,ge=null,ae,ve="";if(u.phase===0){let f=v=>a.readContract({address:u.curve,abi:te,functionName:v,blockNumber:l.number}),[[h,S],A,M,R,_]=await Promise.all([a.readContract({address:u.curve,abi:te,functionName:"getReserves",blockNumber:l.number}),f("feeBps"),f("creatorTaxBps"),o?a.readContract({address:u.curve,abi:te,functionName:"currentSnipeTaxBps",args:[i],blockNumber:l.number}):Promise.resolve(0n),o?f("sellableTokens"):Promise.resolve(0n)]);if(h<=0n||S<=0n||A+M>$-100n)throw new d("Pons curve reserves or fee settings are unavailable.");let J=$-A-M-100n,E=R<J?R:J,xe=v=>({base:v*A/$,creator:v*M/$,snipe:v*E/$}),Ae=v=>{let L=xe(v);return v-L.base-L.creator-L.snipe},Y;if(o){if(_<=0n||_>=S)throw new d("The curve has no available sellable tokens.");let v=Ae(r);if(T=v*S/(h+v),T>=_){T=_;let L=T*h/(S-T)+1n;O=Ne(L*$,$-A-M-E),O>r&&(O=r)}Y=O,k=x(T),W=Ne(k*r,O),g||q.push(n.approval(w.address,u.curve,r.toString(),b))}else Y=r*h/(S+r),T=Ae(Y),k=x(T),q.push(n.approval(s,u.curve,r.toString(),b));let de=xe(Y);ge={base:I(w,de.base),creator:I(w,de.creator),snipe:I(w,de.snipe)},ae=`Curve fees included: ${A} base, ${M} creator and ${E} opening-tax basis points, each rounded separately.`,q.push(ie(u.curve,ke({abi:te,functionName:o?"buy":"sell",args:[r,W??k,i]}),o&&g?r:0n,o?`Buy Pons curve tokens with ${G}.`:`Sell Pons curve tokens for ${G}.`))}else{if(r>Ee)throw new d("Trade amount exceeds the router uint128 range.");let f=Ie(u.pairToken,s,u.poolFee,u.tickSpacing),h=o?y(u.pairToken):s,S=o?s:y(u.pairToken),A=P(h,f.currency0);if(T=(await a.simulateContract({address:N.quoter.address,abi:Le,functionName:"quoteExactInputSingle",args:[{poolKey:f,zeroForOne:A,exactAmount:r,hookData:"0x"}],account:i,gas:$e,blockNumber:l.number})).result[0],k=x(T),k>Ee)throw new d("Minimum output exceeds the router uint128 range.");let R=l.timestamp+300n;if(R>=1n<<48n)throw new d("Permit2 expiry exceeds its timestamp range.");if(h!==K){let E=!c&&await Ve(a,h,i,N.permit2.address,l.number)===r;E||q.push(n.approval(h,N.permit2.address,r.toString(),b)),ve=E?`${Ce}: ${r} input base units already approved to Permit2. `:"",q.push(ie(N.permit2.address,ke({abi:Ke,functionName:"approve",args:[h,N.universal_router.address,r,Number(R)]}),0n,`${E?`${Ce}. `:""}Approve the exact token amount to the Pons router through Permit2 for five minutes.`))}let _=[ne(Xe,[{poolKey:f,zeroForOne:A,amountIn:r,amountOutMinimum:k,minHopPriceX36:0n,hookData:"0x"}]),ne(oe("address,uint256"),[h,r]),ne(oe("address,uint256"),[S,k])],J=ne(oe("bytes,bytes[]"),["0x060c0f",_]);q.push(ie(N.universal_router.address,ke({abi:ze,functionName:"execute",args:["0x10",[J],R]}),h===K?r:0n,"Trade through Pons Universal Router v2.1.2.")),ae="Quoter output is net of Pons hook fees; no additional fee is subtracted."}if(T<=0n||k<=0n||k>we||(W??k)>we)throw new d("Trade output or minimum is outside the supported positive range.");let ye=c?{changes:[],summary:"Quote only; preview is required before sending."}:await n.preview(q,i),ue=r-O;return{txs:q,changes:ye.changes,summary:`${o?"Buy":"Sell"} ${V.symbol} (${V.address}) on chain ${b}${g?"":` ${o?"with":"for"} ${G}`}. ${ae} ${ve}${u.phase===0?`${_e} `:""}${ue>0n?`Expected ${g?"native refund":"refund"}: ${n.formatAmount(ue.toString(),w.decimals)} ${w.symbol}; minimum output uses the expected spend after refund. `:""}${ye.summary}`,pairToken:w,quote:{phase:u.phase,amountIn:I(se,r),amountOut:I(re,T),minAmountOut:I(re,k),minimumKind:"absolute",calldataMinAmountOut:I(re,W??k),expectedSpend:I(se,O),expectedRefund:I(se,ue),fees:ge,blockNumber:l.number.toString(),blockTimestamp:l.timestamp.toString()}}}function ln(n){return Fe(n,!0)}function Fe(n,t=!1,i){let o=new Map,c=e=>{if(BigInt(ee())>=BigInt(e.expiresAt))throw new he};return{name:"pons",async quote(e,p){if(e={...e,from:z(e.from),to:z(e.to)},D(e.from)&&D(e.to))throw new Z("Pons quotes require a launch token and its pair token.");let s=D(e.from)||!D(e.to)&&await Je(n,e.from,e.to,i),r=ee(),m=await De(n,{token:s?e.to:e.from,amountIn:e.amountIn,slippageBps:e.slippageBps,pairToken:y(s?e.from:e.to)},p,s,{quoteOnly:!0,curveOnly:t,blockNumber:i}),x=m.txs.at(-1),a=m.quote,l=String(BigInt(i===void 0?r:a.blockTimestamp)+BigInt(qe)),u=a.minAmountOut.amount,g=a.fees,C=D(m.pairToken.address)?"native ETH base units (18 decimals)":`${m.pairToken.symbol} (${m.pairToken.address}) base units (${m.pairToken.decimals} decimals)`,j=g?`Pons curve fees included in net output: ${g.base.amount} base, ${g.creator.amount} creator and ${g.snipe.amount} opening tax, in ${C}. Oak swap fee: 0 (venue fee is never Oak income). ${Ge}`:"Quoter output is net of Pons hook fees; no additional fee is subtracted. Oak swap fee: 0.",B=Oe({...e,quoteId:`pons:${He()}`,provider:"pons",wallet:p,chainId:b,router:x.to,spender:a.phase===0?x.to:N.permit2.address,expiresAt:l,data:x.data,value:x.value,amountOut:a.amountOut.amount,minAmountOut:u,blockNumber:a.blockNumber,...a.phase===0?{ponsCurveToken:s?e.to:e.from,calldataMinAmountOut:a.calldataMinAmountOut.amount}:{ponsPoolToken:s?e.to:e.from},expectedSpend:a.expectedSpend.amount,expectedRefund:a.expectedRefund.amount,feeDisclosure:j,oakFee:"0"});be(x,B),c(B);for(let[U,H]of o)BigInt(ee())>=BigInt(H.quote.expiresAt)&&o.delete(U);for(;o.size>=Be;)o.delete(o.keys().next().value);return o.set(B.quoteId,{quote:{...B},txs:m.txs.map(U=>({...U})),summary:m.summary}),B},async build(e,p){let s=o.get(e);if(!s)throw new he;if(c(s.quote),Q(p),!P(p,s.quote.wallet))throw new d("Quote was issued for a different wallet.");let r=s.txs.map(a=>({...a}));be(r.at(-1),s.quote);let m=await n.preview(r,p);if(c(s.quote),m.changes.filter(a=>P(z(a.token.address),z(s.quote.to))).reduce((a,l)=>a+BigInt(l.amount),0n)<BigInt(s.quote.minAmountOut))throw new d("Preview retained output is below the accepted minimum.");return{txs:r,summary:`${s.summary} ${m.summary} ${s.quote.feeDisclosure}`}}}}async function Ue(n,t,i){return n.clientFor(b).readContract({address:Me.factory.address,abi:Re,functionName:"getLaunchedToken",args:[F(t)],...i===void 0?{}:{blockNumber:i}})}async function Je(n,t,i,o){let c=await Ue(n,i,o);return c.exists&&P(c.token,i)&&P(y(c.pairToken),y(t))}async function fn(n,t,i,o,c){if(typeof i.token!="string")throw new d("Provide a launch token address.");Q(i.token);let e=F(i.token),p=await Ue(n,e,c);if(!p.exists||!P(p.token,e))throw new d("This address is not a Pons launch token.");let s=y(p.pairToken)===K?le:F(p.pairToken);return Qe(i.pairToken,F(p.pairToken),t,s),{quote:await Fe(n,!1,c).quote({from:t?s:e,to:t?e:s,amountIn:String(i.amountIn),...i.slippageBps===void 0?{}:{slippageBps:i.slippageBps}},o),input:t?s:e}}var Ye=n=>({tools:[!0,!1].map(t=>({name:t?"pons_buy":"pons_sell",inputSchema:We,async execute(i,o){try{return await De(n,i,o,t)}catch(c){throw new d(n.plainError(c))}}}))}),hn=Ye;export{ln as a,Fe as b,fn as c,Ye as d,hn as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as T,e as v,f as F,g as I}from"./
|
|
1
|
+
import{a as c,b as T,e as v,f as F,g as I}from"./T2WHOZXM.js";import{a as l}from"./66F5ZH34.js";import{c as A,g,h as S}from"./NWNYJ26T.js";import{a as h}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{encodeFunctionData as y,getAddress as M,parseAbi as j,parseAbiItem as D,zeroAddress as H}from"viem";var x=M("0x000000001f26a0044baa66024e7b6599c61963f8"),_=D("event AuctionCreated(address indexed auction,address indexed token,uint256 amount,bytes configData)"),n=j(["function currency() view returns (address)","function token() view returns (address)","function startBlock() view returns (uint64)","function endBlock() view returns (uint64)","function claimBlock() view returns (uint64)","function validationHook() view returns (address)","function clearingPrice() view returns (uint256)","function isGraduated() view returns (bool)","function bids(uint256) view returns ((uint64 startBlock,uint24 startCumulativeMps,uint64 exitedBlock,uint256 maxPrice,address owner,uint256 amountQ96,uint256 tokensFilled))","function submitBid(uint256 maxPrice,uint128 amount,address owner,uint256 prevTickPrice,bytes hookData) payable returns (uint256)","function exitBid(uint256)","function exitPartiallyFilledBid(uint256,uint64,uint64)","function claimTokens(uint256)","function claimTokensBatch(address,uint256[])","function checkpoint()","function sweepCurrency()","function sweepUnsoldTokens()"]);async function $(s,B){let o=T(B.auction),t=c(B.creationBlock,"creationBlock",64,!0),e=await s.getLogs({address:x,event:_,args:{auction:o},fromBlock:t,toBlock:t,strict:!0});if(e.length!==1||!g(e[0].address,x)||!S(e[0].args.auction,o))throw new d("Auction has no matching AuctionCreated event at the pinned CCA factory and creationBlock.");return o}async function Q(s,B){let o=s.clientFor(h),t=await $(o,B),e=await o.getBlockNumber(),[a,k,i,b,m,C,u,w]=await Promise.all([o.readContract({address:t,abi:n,functionName:"currency",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"token",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"startBlock",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"endBlock",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"claimBlock",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"validationHook",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"clearingPrice",blockNumber:e}),o.readContract({address:t,abi:n,functionName:"isGraduated",blockNumber:e})]);return{auction:t,currency:a,saleToken:k,startBlock:i,endBlock:b,claimBlock:m,validationHook:C,clearingPrice:u,graduated:w,blockNumber:e}}var U={auction:A,creationBlock:l(),bidId:l(),amount:l(),maxPrice:l(),prevTickPrice:l(),lastFullyFilledCheckpointBlock:l(),outbidBlock:l(),mode:{type:"string",enum:["full","partial"]},bidIds:{type:"array",minItems:1,maxItems:50,items:l()}};function R(s){let o=["status","bid","exit","claim","checkpoint","sweep_currency","sweep_tokens"].map(t=>({name:`uniswap_auction_${t}`,inputSchema:{type:"object",additionalProperties:!1,required:["auction","creationBlock",...t==="bid"?["amount","maxPrice","prevTickPrice"]:t==="exit"?["bidId","mode"]:[]],properties:U},async execute(e,a){I(e,["auction","creationBlock",...t==="bid"?["amount","maxPrice","prevTickPrice"]:t==="exit"?["bidId","mode","lastFullyFilledCheckpointBlock","outbidBlock"]:t==="claim"?["bidId","bidIds"]:t==="status"?["bidId"]:[]]);let i=await Q(s,e),b=s.clientFor(h),[m,C]=await Promise.all([v(s,i.currency,i.blockNumber),v(s,i.saleToken,i.blockNumber)]),u=e.bidId===void 0?void 0:await b.readContract({address:i.auction,abi:n,functionName:"bids",args:[c(e.bidId,"bidId",256,!0)],blockNumber:i.blockNumber});if(t==="status")return{auction:i.auction,paymentToken:m,saleToken:C,startBlock:i.startBlock.toString(),endBlock:i.endBlock.toString(),claimBlock:i.claimBlock.toString(),validationHook:i.validationHook,clearingPrice:i.clearingPrice.toString(),graduated:i.graduated,...u?{bid:{...u,startBlock:u.startBlock.toString(),exitedBlock:u.exitedBlock.toString(),maxPrice:u.maxPrice.toString(),amountQ96:u.amountQ96.toString(),tokensFilled:u.tokensFilled.toString()}}:{},summary:"CCA prices use currency-base-units per sale-token-base-unit in Q96. Clearing price/graduation reflect the latest checkpoint and may lag the head."};let w=[],f,N=0n;if(t==="bid"){if(i.validationHook!==H)throw new d("This auction has a validation hook. Its validation/signing contract is not configured; do not pass an off-chain signature manually.");if(i.blockNumber<i.startBlock||i.blockNumber>=i.endBlock)throw new d("Auction is not in its bidding window.");let r=c(e.amount,"amount",128),p=c(e.maxPrice,"maxPrice"),P=c(e.prevTickPrice,"prevTickPrice",256,!0);if(p<=i.clearingPrice)throw new d("Bid maxPrice must be above the checkpoint clearing price.");i.currency===H?N=r:w.push(s.approval(i.currency,i.auction,r.toString(),h)),f=y({abi:n,functionName:"submitBid",args:[p,r,a,P,"0x"]})}else if(t==="exit"){if(!u||!g(u.owner,a))throw new d("Only exit a bid owned by the signing wallet.");let r=c(e.bidId,"bidId",256,!0);if(e.mode==="full"){if(e.lastFullyFilledCheckpointBlock!==void 0||e.outbidBlock!==void 0)throw new d("Full exit takes no checkpoint hints.");f=y({abi:n,functionName:"exitBid",args:[r]})}else if(e.mode==="partial")f=y({abi:n,functionName:"exitPartiallyFilledBid",args:[r,c(e.lastFullyFilledCheckpointBlock,"lastFullyFilledCheckpointBlock",64,!0),c(e.outbidBlock,"outbidBlock",64,!0)]});else throw new d("Choose full or partial exit explicitly; partial exits require checkpoint hints.")}else if(t==="claim"){if(e.bidId===void 0==(e.bidIds===void 0))throw new d("Provide bidId or bidIds, not both.");let r=e.bidIds===void 0?[c(e.bidId,"bidId",256,!0)]:Array.isArray(e.bidIds)?e.bidIds.map(p=>c(p,"bidIds",256,!0)):[];if(r.length<1||r.length>50||new Set(r.map(String)).size!==r.length)throw new d("Provide 1 to 50 unique bid IDs.");for(let p of r){let P=await b.readContract({address:i.auction,abi:n,functionName:"bids",args:[p],blockNumber:i.blockNumber});if(!g(P.owner,a))throw new d("Claimed tokens must belong to the signing wallet.")}f=y({abi:n,functionName:"claimTokensBatch",args:[a,r]})}else f=y({abi:n,functionName:t==="checkpoint"?"checkpoint":t==="sweep_currency"?"sweepCurrency":"sweepUnsoldTokens"});return w.push(s.unsignedTx({to:i.auction,data:f,value:N.toString(),chainId:h,description:`CCA ${t} on factory-verified auction ${i.auction}. Bid owner ${a}.`})),F(s,w,a,`CCA ${t}; checkpoint/exit/claim eligibility and creator-only sweeps are checked by the contract in preview. Sweeps pay the auction's immutable funds/tokens recipient, not an arbitrary recipient.`)}}));return o.push({name:"uniswap_auctions",inputSchema:{type:"object",additionalProperties:!1,properties:{fromBlock:l(),toBlock:l()}},async execute(t){I(t,["fromBlock","toBlock"]);let e=s.clientFor(h),a=await e.getBlockNumber(),k=t.fromBlock===void 0?a>9999n?a-9999n:0n:c(t.fromBlock,"fromBlock",64,!0),i=t.toBlock===void 0?a:c(t.toBlock,"toBlock",64,!0);if(k>i||i>a||i-k>=10000n)throw new d("Scan an ordered range of at most 10000 blocks, ending at or before the head.");let b=await e.getLogs({address:x,event:_,fromBlock:k,toBlock:i,strict:!0});return{factory:x,fromBlock:k.toString(),toBlock:i.toString(),auctions:b.map(m=>({auction:m.args.auction,token:m.args.token,amount:m.args.amount.toString(),creationBlock:m.blockNumber.toString()})),summary:"Factory-verified auctions in this block window only. An empty result does not establish that no auctions exist outside it. Scan earlier windows for older launches."}}}),{tools:o}}export{x as a,_ as b,n as c,$ as d,Q as e,R as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as le,s as D,x as W}from"./YOENHHKI.js";import{d as fe}from"./MKQVS3IO.js";import{a as me,b as ee,c as de,e as oe,f as ye,g as pe,h as V,i as b,j as g,l as M,m as N,o as U,p as B,q as T,s as O,u as E,v as _}from"./5OEHZJ6X.js";import{b as G,g as K,h as X,i as se,j as ue}from"./ACN2BFMA.js";import{c as Z}from"./73N3TOJL.js";import{a as i}from"./5YS5V2LK.js";import{encodeAbiParameters as Oe,getAddress as we,keccak256 as Ke,parseAbi as Ve,toHex as ae,zeroAddress as je}from"viem";import{encodeAbiParameters as ge,encodePacked as Ce,getAddress as Ae,keccak256 as te,parseAbi as Fe,toHex as Le,zeroAddress as ke}from"viem";var Re=1n<<256n,ve=1n<<128n,Ue=Fe(["function extsload(bytes32[] slots) view returns (bytes32[])"]),$=(o,n)=>({type:"object",additionalProperties:!1,properties:o,required:n}),qe={oneOf:[$({kind:{const:"family"},launcher:Z,familyId:ee,member:{type:"string",enum:["0","1","2","3","4","5","6","7"]}},["kind","launcher","familyId","member"]),$({kind:{const:"nft"},tokenId:me},["kind","tokenId"]),$({kind:{const:"agent-account"},account:Z,positionId:ee},["kind","account","positionId"])]};function Ne(o){let n=N(o);if(n.kind!=="family")throw new i("This step supports Launcher family positions only. NFT and agent-account position reads are reserved for a later integration.");oe(n,["kind","launcher","familyId","member"],["kind","launcher","familyId","member"]);let e=ye(n.member,8);if(e>7n)throw new i("Hookr family member must be a decimal string from 0 to 7.");return{kind:"family",launcher:ue(n.launcher),familyId:V(n.familyId),member:e.toString()}}var C=o=>Le(BigInt.asUintN(256,o),{size:32}),ne=(o,n)=>te(ge([{type:"bytes32"},{type:"bytes32"}],[o,n]));function re(o,n,e,a,r,H){let w=ne(o,C(6n)),P=m=>ne(C(BigInt(m)),C(BigInt(w)+4n)),y=te(ge([{type:"bytes32"},{type:"uint8"}],[e,a])),c=te(Ce(["address","int24","int24","bytes32"],[n,r,H,y])),u=ne(c,C(BigInt(w)+6n));return[w,C(BigInt(w)+1n),C(BigInt(w)+2n),C(BigInt(P(r))+1n),C(BigInt(P(r))+2n),C(BigInt(P(H))+1n),C(BigInt(P(H))+2n),u,C(BigInt(u)+1n),C(BigInt(u)+2n)]}function Q(o,n,e,a,r,H){return BigInt.asUintN(256,a<r?n-e:a>=H?e-n:o-n-e)}function J(o,n,e){if(o<0n||o>=1n<<128n||[n,e].some(a=>a<0n||a>=Re))throw new i("Hookr fee inputs are outside the verified v4 layout.");return o*BigInt.asUintN(256,n-e)/ve}function ie(o){let n=N(o),e={currency0:b(n.currency0),currency1:b(n.currency1),fee:Number(g(n.fee,24)),tickSpacing:Number(g(n.tickSpacing,24)),hooks:b(n.hooks)};if(BigInt(e.currency0)>=BigInt(e.currency1)||e.fee!==8388608||e.hooks!==T||e.tickSpacing<1||e.tickSpacing>32767)throw new i("Hookr family PoolKey is not a supported Root dynamic-fee pool.");return e}async function Te(o,n,e,a){let r=await X(o,a),H={},w=new Set,P=(t,k=[])=>B(o,e.launcher,U(e.launcher===Ae(G.launcherV1)?"launcherV1":"launcher"),t,k,r.number),y=async(t,k)=>{try{return await k()}catch(S){return H[t]=S instanceof i?S.message:`Hookr ${t} read failed at block ${r.number}. Retry the named-block read; no zero or empty result is implied.`,null}},c={chainId:4663,blockNumber:r.number.toString(),blockHash:r.hash,position:e,owner:null,ownedByWallet:null,poolId:null,poolKey:null,range:null,liquidity:null,tokens:null,principal:null,uncollectedLpFees:null,collectedLpFees:null,claimableCoreCredits:null,poolPendingRecapture:null,inRange:null,gateStatus:null,locks:null},u=async()=>(await se(o,r),{...c,readStatus:{status:Object.keys(H).length?"partial":"complete",reasons:H},warnings:["collectedLpFees is null: no complete collection-history reconstruction is available in this step.","LP fees can include donations already released into v4 fee growth. Pending recapture is pool-level, unallocated and excluded from LP fees.","Principal is current withdrawable token inventory before fees, gas or price changes; it is not the original deposit value."]});if(await y("pins",async()=>(await K(o,r.number,[e.launcher,T,O],w),!0))===null)return u();let m=await y("owner",async()=>{let t=b(await P("familyOwner",[e.familyId]));if(t===ke)throw new i("Hookr family does not exist at this block. Check its Launcher and family ID.");return t});if(m===null)return u();c.owner=m,c.ownedByWallet=m===n;let R=await y("position",async()=>{let[t,k,S]=await Promise.all([P("memberCount",[e.familyId]),P("position",[e.familyId,Number(e.member)]),P("poolManager")]);if(S!==O||g(t,8)>8n||BigInt(e.member)>=g(t,8))throw new i("Hookr family member or PoolManager is invalid.");let h=N(k),d=ie(h.key);if(typeof h.tickLower!="number"||typeof h.tickUpper!="number")throw new i("Hookr position range is incomplete.");W(h.tickLower,h.tickUpper,d.tickSpacing);let s=g(h.liquidity,128),L=D(d);if(await P("poolFamily",[L])!==e.familyId)throw new i("Hookr pool does not belong to this family.");return{key:d,id:L,tickLower:h.tickLower,tickUpper:h.tickUpper,liquidity:s}});if(R===null)return u();let{key:l,id:p,tickLower:A,tickUpper:I,liquidity:v}=R;c.poolKey=l,c.poolId=p,c.range={tickLower:A,tickUpper:I},c.liquidity=v.toString();let[f,q,F]=await Promise.all([y("tokens",()=>Promise.all([_(o,l.currency0,r.number),_(o,l.currency1,r.number)])),y("feeGrowth",async()=>{let t=re(p,e.launcher,e.familyId,Number(e.member),A,I),k=await B(o,O,Ue,"extsload",[t],r.number),S=M(k,10).map(Be=>BigInt(V(Be))),[h,d,s,L,Y,x,j,Pe,Ie,Se]=S,ce=h&(1n<<160n)-1n,z=Number(BigInt.asIntN(24,h>>160n));if(ce===0n||z<-887272||z>887272||Pe!==v)throw new i("Hookr PoolManager position is uninitialized or differs from the Launcher liquidity. No principal or fee amount is inferred.");let He=Q(d,L,x,z,A,I),xe=Q(s,Y,j,z,A,I);return{sqrtPriceX96:ce,tick:z,fee0:J(v,He,Ie),fee1:J(v,xe,Se)}}),y("poolConfig",async()=>{let t=N(await B(o,T,U("rootV1"),"poolConfig",[p],r.number));if(b(t.liquidityOwner)!==e.launcher||![l.currency0,l.currency1].includes(b(t.subject))||![l.currency0,l.currency1].includes(b(t.quote))||t.subject===t.quote)throw new i("Hookr pool configuration differs from this family position.");let k=b(t.rules),S=E(k);return await K(o,r.number,[k],w),{pc:t,core:k,role:S}})]);if(c.tokens=f,q&&(c.inRange=q.tick>=A&&q.tick<I,f)){let t=le({liquidity:v,tickLower:A,tickUpper:I,sqrtPriceX96:q.sqrtPriceX96});c.principal=[{token:f[0],amount:t.amount0.toString()},{token:f[1],amount:t.amount1.toString()}],c.uncollectedLpFees=[{token:f[0],amount:q.fee0.toString()},{token:f[1],amount:q.fee1.toString()}]}if(F){let t=(s,L=[])=>B(o,F.core,U("rulesV1"),s,L,r.number),[k,S,h,d]=await Promise.all([y("gateStatus",async()=>{let s=b(F.pc.advisory);return s!==ke&&await K(o,r.number,[s],w),fe(o,r.number,p,e.launcher,s)}),y("locks",async()=>be(o,{position:e,block:r,poolId:p,core:F.core,role:F.role})),y("claimableCoreCredits",async()=>{if(!f)throw new i("Read token metadata before displaying core credits.");let s=await t("poolAccruedCurrencies",[p]);if(!Array.isArray(s)||s.length>32||s.some(x=>x!==l.currency0&&x!==l.currency1))throw new i("Core accrual includes unmeasured currencies; read the core directly before collecting.");let[L,Y]=await Promise.all([Promise.all([l.currency0,l.currency1].map(x=>t("poolAccrued",[p,x]))),Promise.all([l.currency0,l.currency1].map(x=>B(o,F.core,U(F.role),"claimable",[x,n],r.number)))]);return{core:F.core,familyOwnerAccrual:L.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCredits:Y.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCreditsScope:"Core-wide wallet credits, not attributed to this position. Do not add them to LP fees."}}),y("poolPendingRecapture",async()=>{if(!f)throw new i("Read token metadata before displaying pending recapture.");let s=M(await t("pendingDonation",[p]),5).map(L=>g(L));return{due:[{token:f[0],amount:s[0].toString()},{token:f[1],amount:s[1].toString()}],fresh:[{token:f[0],amount:s[2].toString()},{token:f[1],amount:s[3].toString()}],freshChildBlock:s[4].toString(),scope:"pool",allocatedToPosition:!1}})]);c.gateStatus=k,c.locks=S,c.claimableCoreCredits=h,c.poolPendingRecapture=d}return u()}function Je(o){return[{name:"hookr_lp_position",inputSchema:$({position:qe,...de},["position"]),execute:async(n,e)=>{oe(n,["position","blockNumber"],["position"]);let a=Ne(n.position);if(o.network==="testnet")throw new i("Hookr LP reads are configured only on mainnet, chain 4663.");try{return await Te(o.clientFor(4663),e,a,pe(n))}catch(r){throw r instanceof i?r:new i("Hookr position block is unavailable. Retry the complete named-block read; no zero position or fee is implied.")}}}]}var he=o=>U(o.launcher===we(G.launcherV1)?"launcherV1":"launcher");function ze(o){let n=Ke(Oe([{type:"bytes32"},{type:"bytes32"}],[o,"0x3c0d3d8cba92527b3a48aa783c8734a4e170057eb16401c9df8a7c8a6588b900"]));return ae(BigInt(n)+5n,{size:32})}async function Me(o,n){try{let e="0x0000000000000000000000000000000000000a11",a=await o.request({method:"eth_call",params:[{to:e,data:"0x"},ae(n.number),{[e]:{code:"0x4360005260206000f3"}}]});return BigInt(V(a))}catch{throw new i("Hookr parent-block clock is unavailable. Retry with an RPC supporting named-block eth_call state overrides; child-chain height cannot establish lock expiry.")}}async function io(o,n,e){let a=await X(o);await K(o,a.number,[e.launcher,T,O]);let r=(d,s=[])=>B(o,e.launcher,he(e),d,s,a.number),[H,w,P,y]=await Promise.all([r("familyOwner",[e.familyId]),r("memberCount",[e.familyId]),r("position",[e.familyId,Number(e.member)]),r("poolManager")]),c=b(H);if(c===je||c!==n)throw new i("Only the current Hookr family owner can add, collect or remove this position. Use its signing wallet.");if(y!==O||g(w,8)<1n||g(w,8)>8n||BigInt(e.member)>=g(w,8))throw new i("Hookr family member or PoolManager differs from the reviewed deployment.");let u=N(P),m=ie(u.key),R=g(u.liquidity,128);if(typeof u.tickLower!="number"||typeof u.tickUpper!="number")throw new i("Hookr family range is unavailable.");let l=u.tickLower,p=u.tickUpper;W(l,p,m.tickSpacing);let A=D(m);if(await r("poolFamily",[A])!==e.familyId)throw new i("Hookr pool does not belong to this Launcher family.");let I=N(await B(o,T,U("rootV1"),"poolConfig",[A],a.number)),v=b(I.rules),f=E(v);if(b(I.liquidityOwner)!==e.launcher||![m.currency0,m.currency1].includes(b(I.subject))||![m.currency0,m.currency1].includes(b(I.quote))||I.subject===I.quote)throw new i("Hookr pool configuration differs from this family key.");await K(o,a.number,[v]);let[q,F]=await Promise.all([Promise.all([m.currency0,m.currency1].map(d=>_(o,d,a.number))),B(o,O,Ve(["function extsload(bytes32[] slots) view returns (bytes32[])"]),"extsload",[re(A,e.launcher,e.familyId,Number(e.member),l,p)],a.number)]),t=M(F,10).map(d=>BigInt(V(d))),k=t[0]&(1n<<160n)-1n,S=Number(BigInt.asIntN(24,t[0]>>160n));if(!k||S<-887272||S>887272||t[7]!==R)throw new i("Hookr PoolManager state differs from the family position. Retry the full read.");let h=[0,1].map(d=>J(R,Q(t[1+d],t[3+d],t[5+d],S,l,p),t[8+d]));return{position:e,block:a,owner:c,key:m,poolId:A,liquidity:R,tickLower:l,tickUpper:p,sqrtPriceX96:k,fees:h,tokens:q,pc:I,core:v,role:f}}async function be(o,n){let{position:e,block:a,poolId:r,core:H,role:w}=n,[P,y,c,u]=await Promise.all([B(o,e.launcher,he(e),"principalLockedUntil",[e.familyId],a.number),B(o,H,U(w),"removalLockedUntil",[r],a.number),o.getStorageAt({address:T,slot:ze(r),blockNumber:a.number}),Me(o,a)]),m=BigInt(V(c));if(we(ae(m&(1n<<160n)-1n,{size:20}))!==e.launcher)throw new i("Hookr frozen Root lock storage does not match the family owner contract.");let R=m>>160n&(1n<<40n)-1n,l=g(P),p=g(y);return{clock:"parent-block",parentBlock:u.toString(),familyUntilParentBlock:l.toString(),poolRulesUntilParentBlock:p.toString(),rootUntilParentBlock:R.toString(),currentlyLocked:u<l||u<p||u<R,feesCollectableDuringPrincipalLocks:!0}}export{he as a,ze as b,Me as c,io as d,be as e,qe as f,Ne as g,re as h,Q as i,J as j,ie as k,Te as l,Je as m};
|
|
1
|
+
import{A as le,s as D,x as W}from"./GEIFITAQ.js";import{d as fe}from"./74Y2KDNR.js";import{a as me,b as ee,c as de,e as oe,f as ye,g as pe,h as V,i as b,j as g,l as M,m as N,o as U,p as B,q as T,s as O,u as E,v as _}from"./JVLLVNF2.js";import{b as G,g as K,h as X,i as se,j as ue}from"./MQK6OP7S.js";import{c as Z}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";import{encodeAbiParameters as Oe,getAddress as we,keccak256 as Ke,parseAbi as Ve,toHex as ae,zeroAddress as je}from"viem";import{encodeAbiParameters as ge,encodePacked as Ce,getAddress as Ae,keccak256 as te,parseAbi as Fe,toHex as Le,zeroAddress as ke}from"viem";var Re=1n<<256n,ve=1n<<128n,Ue=Fe(["function extsload(bytes32[] slots) view returns (bytes32[])"]),$=(o,n)=>({type:"object",additionalProperties:!1,properties:o,required:n}),qe={oneOf:[$({kind:{const:"family"},launcher:Z,familyId:ee,member:{type:"string",enum:["0","1","2","3","4","5","6","7"]}},["kind","launcher","familyId","member"]),$({kind:{const:"nft"},tokenId:me},["kind","tokenId"]),$({kind:{const:"agent-account"},account:Z,positionId:ee},["kind","account","positionId"])]};function Ne(o){let n=N(o);if(n.kind!=="family")throw new i("This step supports Launcher family positions only. NFT and agent-account position reads are reserved for a later integration.");oe(n,["kind","launcher","familyId","member"],["kind","launcher","familyId","member"]);let e=ye(n.member,8);if(e>7n)throw new i("Hookr family member must be a decimal string from 0 to 7.");return{kind:"family",launcher:ue(n.launcher),familyId:V(n.familyId),member:e.toString()}}var C=o=>Le(BigInt.asUintN(256,o),{size:32}),ne=(o,n)=>te(ge([{type:"bytes32"},{type:"bytes32"}],[o,n]));function re(o,n,e,a,r,H){let w=ne(o,C(6n)),P=m=>ne(C(BigInt(m)),C(BigInt(w)+4n)),y=te(ge([{type:"bytes32"},{type:"uint8"}],[e,a])),c=te(Ce(["address","int24","int24","bytes32"],[n,r,H,y])),u=ne(c,C(BigInt(w)+6n));return[w,C(BigInt(w)+1n),C(BigInt(w)+2n),C(BigInt(P(r))+1n),C(BigInt(P(r))+2n),C(BigInt(P(H))+1n),C(BigInt(P(H))+2n),u,C(BigInt(u)+1n),C(BigInt(u)+2n)]}function Q(o,n,e,a,r,H){return BigInt.asUintN(256,a<r?n-e:a>=H?e-n:o-n-e)}function J(o,n,e){if(o<0n||o>=1n<<128n||[n,e].some(a=>a<0n||a>=Re))throw new i("Hookr fee inputs are outside the verified v4 layout.");return o*BigInt.asUintN(256,n-e)/ve}function ie(o){let n=N(o),e={currency0:b(n.currency0),currency1:b(n.currency1),fee:Number(g(n.fee,24)),tickSpacing:Number(g(n.tickSpacing,24)),hooks:b(n.hooks)};if(BigInt(e.currency0)>=BigInt(e.currency1)||e.fee!==8388608||e.hooks!==T||e.tickSpacing<1||e.tickSpacing>32767)throw new i("Hookr family PoolKey is not a supported Root dynamic-fee pool.");return e}async function Te(o,n,e,a){let r=await X(o,a),H={},w=new Set,P=(t,k=[])=>B(o,e.launcher,U(e.launcher===Ae(G.launcherV1)?"launcherV1":"launcher"),t,k,r.number),y=async(t,k)=>{try{return await k()}catch(S){return H[t]=S instanceof i?S.message:`Hookr ${t} read failed at block ${r.number}. Retry the named-block read; no zero or empty result is implied.`,null}},c={chainId:4663,blockNumber:r.number.toString(),blockHash:r.hash,position:e,owner:null,ownedByWallet:null,poolId:null,poolKey:null,range:null,liquidity:null,tokens:null,principal:null,uncollectedLpFees:null,collectedLpFees:null,claimableCoreCredits:null,poolPendingRecapture:null,inRange:null,gateStatus:null,locks:null},u=async()=>(await se(o,r),{...c,readStatus:{status:Object.keys(H).length?"partial":"complete",reasons:H},warnings:["collectedLpFees is null: no complete collection-history reconstruction is available in this step.","LP fees can include donations already released into v4 fee growth. Pending recapture is pool-level, unallocated and excluded from LP fees.","Principal is current withdrawable token inventory before fees, gas or price changes; it is not the original deposit value."]});if(await y("pins",async()=>(await K(o,r.number,[e.launcher,T,O],w),!0))===null)return u();let m=await y("owner",async()=>{let t=b(await P("familyOwner",[e.familyId]));if(t===ke)throw new i("Hookr family does not exist at this block. Check its Launcher and family ID.");return t});if(m===null)return u();c.owner=m,c.ownedByWallet=m===n;let R=await y("position",async()=>{let[t,k,S]=await Promise.all([P("memberCount",[e.familyId]),P("position",[e.familyId,Number(e.member)]),P("poolManager")]);if(S!==O||g(t,8)>8n||BigInt(e.member)>=g(t,8))throw new i("Hookr family member or PoolManager is invalid.");let h=N(k),d=ie(h.key);if(typeof h.tickLower!="number"||typeof h.tickUpper!="number")throw new i("Hookr position range is incomplete.");W(h.tickLower,h.tickUpper,d.tickSpacing);let s=g(h.liquidity,128),L=D(d);if(await P("poolFamily",[L])!==e.familyId)throw new i("Hookr pool does not belong to this family.");return{key:d,id:L,tickLower:h.tickLower,tickUpper:h.tickUpper,liquidity:s}});if(R===null)return u();let{key:l,id:p,tickLower:A,tickUpper:I,liquidity:v}=R;c.poolKey=l,c.poolId=p,c.range={tickLower:A,tickUpper:I},c.liquidity=v.toString();let[f,q,F]=await Promise.all([y("tokens",()=>Promise.all([_(o,l.currency0,r.number),_(o,l.currency1,r.number)])),y("feeGrowth",async()=>{let t=re(p,e.launcher,e.familyId,Number(e.member),A,I),k=await B(o,O,Ue,"extsload",[t],r.number),S=M(k,10).map(Be=>BigInt(V(Be))),[h,d,s,L,Y,x,j,Pe,Ie,Se]=S,ce=h&(1n<<160n)-1n,z=Number(BigInt.asIntN(24,h>>160n));if(ce===0n||z<-887272||z>887272||Pe!==v)throw new i("Hookr PoolManager position is uninitialized or differs from the Launcher liquidity. No principal or fee amount is inferred.");let He=Q(d,L,x,z,A,I),xe=Q(s,Y,j,z,A,I);return{sqrtPriceX96:ce,tick:z,fee0:J(v,He,Ie),fee1:J(v,xe,Se)}}),y("poolConfig",async()=>{let t=N(await B(o,T,U("rootV1"),"poolConfig",[p],r.number));if(b(t.liquidityOwner)!==e.launcher||![l.currency0,l.currency1].includes(b(t.subject))||![l.currency0,l.currency1].includes(b(t.quote))||t.subject===t.quote)throw new i("Hookr pool configuration differs from this family position.");let k=b(t.rules),S=E(k);return await K(o,r.number,[k],w),{pc:t,core:k,role:S}})]);if(c.tokens=f,q&&(c.inRange=q.tick>=A&&q.tick<I,f)){let t=le({liquidity:v,tickLower:A,tickUpper:I,sqrtPriceX96:q.sqrtPriceX96});c.principal=[{token:f[0],amount:t.amount0.toString()},{token:f[1],amount:t.amount1.toString()}],c.uncollectedLpFees=[{token:f[0],amount:q.fee0.toString()},{token:f[1],amount:q.fee1.toString()}]}if(F){let t=(s,L=[])=>B(o,F.core,U("rulesV1"),s,L,r.number),[k,S,h,d]=await Promise.all([y("gateStatus",async()=>{let s=b(F.pc.advisory);return s!==ke&&await K(o,r.number,[s],w),fe(o,r.number,p,e.launcher,s)}),y("locks",async()=>be(o,{position:e,block:r,poolId:p,core:F.core,role:F.role})),y("claimableCoreCredits",async()=>{if(!f)throw new i("Read token metadata before displaying core credits.");let s=await t("poolAccruedCurrencies",[p]);if(!Array.isArray(s)||s.length>32||s.some(x=>x!==l.currency0&&x!==l.currency1))throw new i("Core accrual includes unmeasured currencies; read the core directly before collecting.");let[L,Y]=await Promise.all([Promise.all([l.currency0,l.currency1].map(x=>t("poolAccrued",[p,x]))),Promise.all([l.currency0,l.currency1].map(x=>B(o,F.core,U(F.role),"claimable",[x,n],r.number)))]);return{core:F.core,familyOwnerAccrual:L.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCredits:Y.map((x,j)=>({token:f[j],amount:g(x).toString()})),walletCreditsScope:"Core-wide wallet credits, not attributed to this position. Do not add them to LP fees."}}),y("poolPendingRecapture",async()=>{if(!f)throw new i("Read token metadata before displaying pending recapture.");let s=M(await t("pendingDonation",[p]),5).map(L=>g(L));return{due:[{token:f[0],amount:s[0].toString()},{token:f[1],amount:s[1].toString()}],fresh:[{token:f[0],amount:s[2].toString()},{token:f[1],amount:s[3].toString()}],freshChildBlock:s[4].toString(),scope:"pool",allocatedToPosition:!1}})]);c.gateStatus=k,c.locks=S,c.claimableCoreCredits=h,c.poolPendingRecapture=d}return u()}function Je(o){return[{name:"hookr_lp_position",inputSchema:$({position:qe,...de},["position"]),execute:async(n,e)=>{oe(n,["position","blockNumber"],["position"]);let a=Ne(n.position);if(o.network==="testnet")throw new i("Hookr LP reads are configured only on mainnet, chain 4663.");try{return await Te(o.clientFor(4663),e,a,pe(n))}catch(r){throw r instanceof i?r:new i("Hookr position block is unavailable. Retry the complete named-block read; no zero position or fee is implied.")}}}]}var he=o=>U(o.launcher===we(G.launcherV1)?"launcherV1":"launcher");function ze(o){let n=Ke(Oe([{type:"bytes32"},{type:"bytes32"}],[o,"0x3c0d3d8cba92527b3a48aa783c8734a4e170057eb16401c9df8a7c8a6588b900"]));return ae(BigInt(n)+5n,{size:32})}async function Me(o,n){try{let e="0x0000000000000000000000000000000000000a11",a=await o.request({method:"eth_call",params:[{to:e,data:"0x"},ae(n.number),{[e]:{code:"0x4360005260206000f3"}}]});return BigInt(V(a))}catch{throw new i("Hookr parent-block clock is unavailable. Retry with an RPC supporting named-block eth_call state overrides; child-chain height cannot establish lock expiry.")}}async function io(o,n,e){let a=await X(o);await K(o,a.number,[e.launcher,T,O]);let r=(d,s=[])=>B(o,e.launcher,he(e),d,s,a.number),[H,w,P,y]=await Promise.all([r("familyOwner",[e.familyId]),r("memberCount",[e.familyId]),r("position",[e.familyId,Number(e.member)]),r("poolManager")]),c=b(H);if(c===je||c!==n)throw new i("Only the current Hookr family owner can add, collect or remove this position. Use its signing wallet.");if(y!==O||g(w,8)<1n||g(w,8)>8n||BigInt(e.member)>=g(w,8))throw new i("Hookr family member or PoolManager differs from the reviewed deployment.");let u=N(P),m=ie(u.key),R=g(u.liquidity,128);if(typeof u.tickLower!="number"||typeof u.tickUpper!="number")throw new i("Hookr family range is unavailable.");let l=u.tickLower,p=u.tickUpper;W(l,p,m.tickSpacing);let A=D(m);if(await r("poolFamily",[A])!==e.familyId)throw new i("Hookr pool does not belong to this Launcher family.");let I=N(await B(o,T,U("rootV1"),"poolConfig",[A],a.number)),v=b(I.rules),f=E(v);if(b(I.liquidityOwner)!==e.launcher||![m.currency0,m.currency1].includes(b(I.subject))||![m.currency0,m.currency1].includes(b(I.quote))||I.subject===I.quote)throw new i("Hookr pool configuration differs from this family key.");await K(o,a.number,[v]);let[q,F]=await Promise.all([Promise.all([m.currency0,m.currency1].map(d=>_(o,d,a.number))),B(o,O,Ve(["function extsload(bytes32[] slots) view returns (bytes32[])"]),"extsload",[re(A,e.launcher,e.familyId,Number(e.member),l,p)],a.number)]),t=M(F,10).map(d=>BigInt(V(d))),k=t[0]&(1n<<160n)-1n,S=Number(BigInt.asIntN(24,t[0]>>160n));if(!k||S<-887272||S>887272||t[7]!==R)throw new i("Hookr PoolManager state differs from the family position. Retry the full read.");let h=[0,1].map(d=>J(R,Q(t[1+d],t[3+d],t[5+d],S,l,p),t[8+d]));return{position:e,block:a,owner:c,key:m,poolId:A,liquidity:R,tickLower:l,tickUpper:p,sqrtPriceX96:k,fees:h,tokens:q,pc:I,core:v,role:f}}async function be(o,n){let{position:e,block:a,poolId:r,core:H,role:w}=n,[P,y,c,u]=await Promise.all([B(o,e.launcher,he(e),"principalLockedUntil",[e.familyId],a.number),B(o,H,U(w),"removalLockedUntil",[r],a.number),o.getStorageAt({address:T,slot:ze(r),blockNumber:a.number}),Me(o,a)]),m=BigInt(V(c));if(we(ae(m&(1n<<160n)-1n,{size:20}))!==e.launcher)throw new i("Hookr frozen Root lock storage does not match the family owner contract.");let R=m>>160n&(1n<<40n)-1n,l=g(P),p=g(y);return{clock:"parent-block",parentBlock:u.toString(),familyUntilParentBlock:l.toString(),poolRulesUntilParentBlock:p.toString(),rootUntilParentBlock:R.toString(),currentlyLocked:u<l||u<p||u<R,feesCollectableDuringPrincipalLocks:!0}}export{he as a,ze as b,Me as c,io as d,be as e,qe as f,Ne as g,re as h,Q as i,J as j,ie as k,Te as l,Je as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./WWNAGOCD.js";import{c as U}from"./
|
|
1
|
+
import{a as S}from"./WWNAGOCD.js";import{c as U}from"./74Y2KDNR.js";import{b as R,c as I,d as j,e as C,g as D,h as V,j as t,k as w,l as E,m as B,o as n,p as o,q as d,r as p,s as y,v as H}from"./JVLLVNF2.js";import{b as a,f as F,g as L,h as O,i as q}from"./MQK6OP7S.js";import{a as s}from"./XSD5NL7J.js";import{getAddress as i}from"viem";async function re(r,m,x,u=[]){let e=await O(r,x);await L(r,e.number,[a.launcherV1,d,a.rulesV1,a.agentGateV1]);let l=i(a.launcherV1),[h,_,z,N,Q,K,G,W,$,J,X,A,b]=await Promise.all([U(r,e.number,m,u),o(r,l,j,"launchFee",[],e.number),o(r,p,n("registry"),"rootOpenFor",[d,m],e.number),o(r,p,n("registry"),"newMarketsPaused",[],e.number),o(r,p,n("registry"),"isLauncher",[l],e.number),o(r,d,n("rootV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"poolManager",[],e.number),o(r,l,n("launcherV1"),"registry",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"trustedRoot",[],e.number),o(r,i(a.rulesV1),n("rulesV1"),"poolManager",[],e.number),o(r,p,n("registry"),"admission",[d,i(a.rulesV1)],e.number),o(r,i(a.rulesV1),n("rulesV1"),"configSchemaHash",[],e.number),o(r,p,n("registry"),"quoteAssets",[],e.number)]);if(K!==y||G!==y||W!==p||$!==d||J!==y)throw new s("Hookr launch dependency wiring differs from the reviewed deployment.");V(A);let c=B(X),g=B(c.caps);if(c.implementation!==i(a.rulesV1)||t(c.kind,8)!==0n||c.codeHash!==F(a.rulesV1).codeHash||c.schemaHash!==A||t(c.gasLimit,32)===0n||t(g.maxLpFeePips,24)>600000n||t(g.maxQuoteTakePips,24)>=1000000n||t(g.maxSubjectTakeBps,16)>1000n)throw new s("Hookr core admission, schema or caps differ from the supported launch profile.");if(!Array.isArray(b)||b.length>32)throw new s("Hookr qualified quote list is incomplete or exceeds the bounded read.");let T=[];for(let f=0;f<b.length;f+=2)T.push(...await Promise.all(b.slice(f,f+2).map(ee=>H(r,i(String(ee)),e.number))));let Y=await H(r,i("0x0000000000000000000000000000000000000000"),e.number),k=E(_,5),Z={token:Y,amount:t(k[0]).toString(),currency:"ETH",decimals:18,treasury:i(String(k[1])),pendingAmount:t(k[2]).toString(),pendingTreasury:i(String(k[3])),readyAt:t(k[4]).toString()},M=w(z),P=w(N),v=w(Q);return await q(r,e),{chainId:4663,blockNumber:e.number.toString(),blockHash:e.hash,timestamp:e.timestamp.toString(),version:"hookr-launcher-v1",launcher:l,root:d,core:i(a.rulesV1),poolManager:y,permissionMask:"0x2acc",launchFee:Z,qualifiedQuotes:T,coreAdmission:{schemaHash:A,gasLimit:t(c.gasLimit,32).toString(),caps:{maxLpFeePips:t(g.maxLpFeePips,24).toString(),maxQuoteTakePips:t(g.maxQuoteTakePips,24).toString(),maxSubjectTakeBps:t(g.maxSubjectTakeBps,16).toString()}},gate:h,rootOpenForWallet:M,newMarketsPaused:P,launcherAdmitted:v,launchAvailable:M&&!P&&v&&h.healthyIdentityOnly&&h.walletAgent,scoreLaunchAvailable:M&&!P&&v&&h.healthyForScores&&h.walletAgent,supportedSettings:{route:"launchAdvised",members:"1",tokenKinds:["new"],reservedTokenKinds:["existing"],tickSpacing:String(S.tickSpacing),baseLpFeePips:String(S.baseLpFeePips),deadlineSecondsMax:S.deadlineSeconds.toString(),guardEndBlock:"0",burnBps:"0",royaltyBps:"0",integrator:null,nameMaxUtf8Bytes:"48",symbolMaxUtf8Bytes:"12",supplyMaxBaseUnits:((1n<<108n)-1n).toString(),liquidityMax:((1n<<127n)-1n).toString(),fee:"8388608",tickSpacingMin:"1",tickSpacingMax:"32767",tickMin:"-887272",tickMax:"887272",requiresTickAlignment:!0,gateRequired:!0,gatePhases:"1",gateFailOpen:!1,arbitraryAdvisories:!1,devBuy:!1,locks:!1,ownedRoot:!1,lpRewardsBpsMax:"1000",lpRewardsPlusBurnBpsMax:"1000",totalLpFeePipsMax:"600000",protocolShareBpsMin:"2000",protocolShareBpsMax:"5000",existingTokenFunding:"requires a separately qualified token route"},readStatus:"complete",warnings:["Read-only admission snapshot. hookr_launch supports one new-token agents-only pool with the fixed profile; add/collect/remove require separate tools.","Oak identity linking alone does not establish on-chain Hookr gate eligibility.",h.reviewerSetsNotice]}}function le(r){return[{name:"hookr_launch_options",inputSchema:{type:"object",additionalProperties:!1,properties:{...I,reviewerSetIds:{type:"array",maxItems:8,uniqueItems:!0,items:R,description:"Existing registered reviewer set IDs to inspect; no alias or arbitrary reviewer address."}}},execute:async(m,x)=>{if(C(m,["blockNumber","reviewerSetIds"]),r.network==="testnet")throw new s("Hookr launch reads are configured only on mainnet, chain 4663.");let u=m.reviewerSetIds??[];if(!Array.isArray(u)||u.length>8||new Set(u).size!==u.length)throw new s("Provide at most eight distinct reviewer set IDs.");let e=u.map(V);if(new Set(e).size!==e.length)throw new s("Provide distinct reviewer set IDs.");try{return await re(r.clientFor(4663),x,D(m),e)}catch(l){throw l instanceof s?l:new s("Hookr launch settings are unavailable at the named block. Retry the complete read; no zero fee or healthy gate is implied.")}}}]}export{re as a,le as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as A}from"./IX3GZMTM.js";import{a as g}from"./5CAAFU7R.js";import{a as d}from"./XSD5NL7J.js";import{concat as b,encodeAbiParameters as L,getAddress as G,isAddress as C,keccak256 as h,parseAbiParameters as I,toHex as v}from"viem";var B=h(v("OakGrandfather/v1")),w="oak-grandfather/v1",D=(1n<<256n)-1n,H="0x0000000000000000000000000000000000000000000000000000000000000000";function p(e,n){if(typeof e!="string"||!C(e,{strict:!1}))throw new d(`Invalid ${n} address.`);return G(e)}function x(e,n){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new d(`${n} must be a 32-byte hex string.`);return e.toLowerCase()}function E(e){let n=typeof e=="bigint"?e:A(e);if(n<0n||n>D)throw new d("Count exceeds uint256 bounds.");return n}function j(e,n,o){let i=typeof e=="object"?e.wallet:e,t=typeof e=="object"?e.count:n,c=typeof e=="object"?e.source:o;if(t===void 0||c===void 0)throw new d("Grandfather leaf requires wallet, count and source.");let u=h(L(I("bytes32, address, uint256, address"),[B,p(i,"wallet"),E(t),p(c,"source")]));return h(u)}function R(e,n){let o=x(e,"first node"),i=x(n,"second node");return BigInt(o)<=BigInt(i)?h(b([o,i])):h(b([i,o]))}function _(e,n,o){if(!Array.isArray(o))throw new d("Grandfather proof must be an array.");let i=x(e,"root"),t=x(n,"leaf");for(let c=0;c<o.length;c++){if(!Object.prototype.hasOwnProperty.call(o,c))throw new d("Grandfather proof must not be a sparse array.");t=R(t,o[c])}return t===i}function S(e){if(!Array.isArray(e))throw new d("Grandfather entries must be an array.");let n=new Set,o=[];for(let r=0;r<e.length;r++){if(!Object.prototype.hasOwnProperty.call(e,r)||!e[r])throw new d(`Grandfather entries must not be sparse (missing index ${r}).`);let s=e[r],a=p(s.wallet,"wallet").toLowerCase(),f=p(s.source,"source").toLowerCase(),l=E(s.count).toString();if(n.has(a))throw new d(`Duplicate wallet in grandfather entries: ${a}`);n.add(a),o.push({wallet:a,count:l,source:f})}if(o.sort((r,s)=>BigInt(r.wallet)<BigInt(s.wallet)?-1:BigInt(r.wallet)>BigInt(s.wallet)?1:0),o.length===0){let r=g({entries:[],root:H,schema:w});return{schema:w,root:H,entries:[],proofs:{},canonicalJson:r}}let i=o.map(r=>j(r)),t=[i];for(;t[t.length-1].length>1;){let r=t[t.length-1],s=[];for(let a=0;a<r.length;a+=2){let f=r[a],l=r[a+1];s.push(l!==void 0?R(f,l):f)}t.push(s)}let c=t[t.length-1][0],u={},P=o.map((r,s)=>{let a=[],f=s;for(let l=0;l<t.length-1;l++){let y=t[l],m=f^1;m<y.length&&a.push(y[m]),f=Math.floor(f/2)}return u[r.wallet]=a,u[G(r.wallet)]=a,{...r,leaf:i[s],proof:a}}),T=g({entries:o.map(({count:r,source:s,wallet:a})=>({count:r,source:s,wallet:a})),root:c,schema:w});return{schema:w,root:c,entries:P,proofs:u,canonicalJson:T}}var M=S;function N(e,n){let o=p(n,"wallet").toLowerCase(),i=Array.isArray(e)?S(e):e,t=i.entries.find(u=>u.wallet.toLowerCase()===o);if(!t)throw new d(`Wallet ${n} is not in the grandfather list.`);let c=[...t.proof];return Object.defineProperties(c,{proof:{value:[...t.proof],enumerable:!1},leaf:{value:t.leaf,enumerable:!1},root:{value:i.root,enumerable:!1},entry:{value:{wallet:t.wallet,count:t.count,source:t.source},enumerable:!1},count:{value:t.count,enumerable:!1},source:{value:t.source,enumerable:!1}}),c}export{B as a,w as b,j as c,R as d,_ as e,S as f,M as g,N as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as u,h as l,i as y}from"./NWNYJ26T.js";import{a as p}from"./XSD5NL7J.js";import{a as m}from"./JXOEJPJ4.js";import{parseUnits as b}from"viem";var h={"User-Agent":"oak-core/borro",Accept:"application/json"};async function g(e,o,a){let c=AbortSignal.timeout(1e4),n=await e(`https://borro.markets/${o}.json`,{method:"GET",headers:h,redirect:"error",signal:a?AbortSignal.any([a,c]):c});if(!n.ok||n.redirected||!n.body)throw new p("Borro's page could not be read right now.");let t=n.body.getReader(),r=new TextDecoder,s=0,d="";try{for(;;){let{done:i,value:f}=await t.read();if(i)break;if(s+=f.byteLength,s>2e6)throw new p("Borro's page exceeds the read limit.");d+=r.decode(f,{stream:!0})}return JSON.parse(d+r.decode())}finally{await t.cancel().catch(()=>{}),t.releaseLock()}}var A=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1?e:void 0;function k(e,o=Date.now()/1e3){let a=new Map;if(!u(e))return a;let c=typeof e.read_at=="string"?Date.parse(e.read_at)/1e3:NaN;if(!Number.isFinite(c)||c>o+30||o-c>300)return a;let n=(t,r)=>{if(!u(r)||!u(r.lend)||a.has(t))return;let s=A(r.lend.apr),d=r.lend.ready_to_withdraw,i;try{i=y(t==="USDG"?r.vault:u(r.contracts)?r.contracts.vault:void 0,"Unreadable rate vault.")}catch{}a.set(t,{...i?{vault:i}:{},...s===void 0?{}:{apr:s},...t==="USDG"&&typeof d=="number"&&Number.isFinite(d)&&d>=0&&d<=Number.MAX_SAFE_INTEGER?{ready:d}:{}})};if(n("USDG",e.usdg),Array.isArray(e.stocks)&&e.stocks.length<=1e3){let t=e.stocks.filter(u),r=t.map(s=>typeof s.symbol=="string"?s.symbol.toUpperCase():"");t.forEach((s,d)=>{let i=r[d];/^[A-Z0-9.$_-]{1,32}$/.test(i)&&r.indexOf(i)===r.lastIndexOf(i)&&n(i,s)})}return a}async function _(e,o,a=Date.now()/1e3){try{return k(await g(e,"markets",o),a)}catch{return new Map}}function S(e,o,a){let c=e.get(o.symbol.toUpperCase()),n=l(c?.vault,a)?c:void 0,t;if(n?.ready!==void 0)try{t={token:o,amount:b(n.ready.toFixed(o.decimals),o.decimals).toString()}}catch{}return{rate:n?.apr===void 0?"unavailable":"available",...n?.apr===void 0?{}:{apr:n.apr,source:m("Borro markets.json; display data only")},...t?{readyToWithdraw:t}:{}}}export{h as a,g as b,k as c,_ as d,S as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as w,b as R}from"./OTXSKFUD.js";import{a,e as P}from"./XSD5NL7J.js";function q(t){return t===404||t===410?`The service returned HTTP ${t}: it has no record of that request, so trying again will not help.`:`The service returned HTTP ${t}. Please try again.`}var y=class extends a{constructor(n){super(q(n.status));this.response=n}response};function h(){return new a("The request was cancelled.")}async function v(t,s){if(s.aborted)throw h();await new Promise((n,c)=>{let o=setTimeout(()=>{s.removeEventListener("abort",m),n()},t),m=()=>{clearTimeout(o),s.removeEventListener("abort",m),c(h())};s.addEventListener("abort",m,{once:!0})})}function _(t,s){if(t===null)return s;if(/^\d+(\.\d+)?$/.test(t))return Number(t)*1e3;let n=Date.parse(t);return Number.isFinite(n)?Math.max(0,n-Date.now()):s}function A(t={}){let s=t.fetch??globalThis.fetch,n=t.timeoutMs??1e4,c=t.retries??2,u=t.retryDelayMs??250,o=t.maxRetryDelayMs??3e4;if(!Number.isInteger(c)||c<0||c>10||!Number.isFinite(n)||n<=0||n>2147483647||!Number.isFinite(u)||u<0||!Number.isFinite(o)||o<0||o>2147483647)throw new a("Provide finite timeout and retry bounds, with 0 to 10 retries.");return async(m,k)=>{let r=new Request(m,{...k,redirect:"error"}),d=R(s,r.url),N=r.method==="GET"||r.method==="HEAD";for(let b=0;;b++){if(r.signal.aborted)throw h();if(d){let e=Date.now()+2e3,f=d.reserve();for(f>0&&await v(f,r.signal);;){if(r.signal.aborted)throw h();if(Date.now()>e)throw new w(d.label,1);let i=d.dispatchDelay();if(i===0)break;if(Date.now()+i>e)throw new w(d.label,i/1e3);await v(i,r.signal)}}if(r.signal.aborted)throw h();let p=new AbortController,x=()=>p.abort();r.signal.addEventListener("abort",x,{once:!0});let D=!1,O=setTimeout(()=>{D=!0,p.abort()},n),M;try{let e=await s(r.clone(),{signal:p.signal});if(e.redirected)throw await e.body?.cancel(),new a("The request failed. Please try again.");if(e.ok){let f=await e.text();if(r.method!=="HEAD"&&e.status!==204&&e.status!==205){let i=r.headers.get("accept")?.toLowerCase(),l=e.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase(),T=l?.startsWith("text/"),E=i?.split(",").some(g=>g.trim().startsWith("text/"));if(!E&&i?.split(",").some(g=>/(?:application\/json|\+json)(?:\s*;.*)?$/.test(g.trim()))||l==="application/json"||l?.endsWith("+json")||!T&&!E)try{JSON.parse(f)}catch{throw new a("The service returned malformed JSON.")}}return new Response(f||null,{status:e.status,statusText:e.statusText,headers:e.headers})}else{let f=e.status===429||e.status>=500,i=u*2**b*(.5+Math.random()),l=Math.max(i,_(e.headers.get("Retry-After"),i));if(e.status===429&&d?.backoff(l),!N||!f||b>=c||l>o){if(e.status===429)throw await e.body?.cancel(),new w(d?.label??"The service",Math.max(1,l/1e3));let T=await e.text();throw new y(new Response(T||null,{status:e.status,statusText:e.statusText,headers:e.headers}))}await e.body?.cancel(),M=l}}catch(e){throw r.signal.aborted?h():D?new a("The request timed out. Please try again."):e instanceof y?e:new a(P(e))}finally{clearTimeout(O),r.signal.removeEventListener("abort",x)}await v(M,r.signal)}}}async function S(t,s,n,c){let u=await t(s,n);if(!u.ok)throw new a(q(u.status));let o;try{o=await u.json()}catch{throw new a("The service returned malformed JSON.")}try{if(c(o))return o}catch{}throw new a("The service returned an unexpected response.")}export{y as a,A as b,S as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseAbi as e}from"viem";var t=e(["function asset() view returns (address)","function decimals() view returns (uint8)","function totalAssets() view returns (uint256)","function previewDeposit(uint256 assets) view returns (uint256 shares)","function previewWithdraw(uint256 assets) view returns (uint256 shares)","function previewRedeem(uint256 shares) view returns (uint256 assets)","function convertToAssets(uint256 shares) view returns (uint256 assets)","function balanceOf(address account) view returns (uint256)","function approve(address spender,uint256 amount) returns (bool)","function deposit(uint256 assets,address receiver) returns (uint256 shares)","function withdraw(uint256 assets,address receiver,address owner) returns (uint256 shares)","function redeem(uint256 shares,address receiver,address owner) returns (uint256 assets)"]);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,d as N,e as h}from"./
|
|
1
|
+
import{c as v,d as N,e as h}from"./NEEZBJBC.js";import{a as m}from"./66F5ZH34.js";import{c as d,f as B,g as p,i as E}from"./NWNYJ26T.js";import{a as H}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{decodeEventLog as W,encodeFunctionData as G,getAddress as V,hashStruct as Y,isHex as J,parseAbi as Q,zeroAddress as k}from"viem";var Z="struct HookrSwapIntent { PoolKey key; bool zeroForOne; int128 amountSpecified; uint128 amountBound; uint160 sqrtPriceLimitX96; address recipient; address relayer; uint256 relayerFee; address engagement; uint256[] campaigns; uint256 nonce; uint256 deadline; }",I=Q(["struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }",Z,"function execute(HookrSwapIntent intent, address owner, bytes signature) returns (uint256 amountIn, uint256 amountOut)","function hashIntent(HookrSwapIntent intent) pure returns (bytes32)","function pullOf(HookrSwapIntent intent) view returns (address token, uint256 amount, bool feeFromInput)","function isNonceUsed(address owner, uint256 intentNonce) view returns (bool)","function router() view returns (address)","function registry() view returns (address)","function permit2() view returns (address)","event IntentExecuted(bytes32 indexed intentHash,address indexed owner,address indexed relayer,bytes32 poolId,uint256 amountIn,uint256 amountOut,uint256 relayerFee,bool feeFromInput)"]),ee={PoolKey:[{name:"currency0",type:"address"},{name:"currency1",type:"address"},{name:"fee",type:"uint24"},{name:"tickSpacing",type:"int24"},{name:"hooks",type:"address"}],HookrSwapIntent:[{name:"key",type:"PoolKey"},{name:"zeroForOne",type:"bool"},{name:"amountSpecified",type:"int128"},{name:"amountBound",type:"uint128"},{name:"sqrtPriceLimitX96",type:"uint160"},{name:"recipient",type:"address"},{name:"relayer",type:"address"},{name:"relayerFee",type:"uint256"},{name:"engagement",type:"address"},{name:"campaigns",type:"uint256[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},ne=V("0x000000000022D473030F116dDEE9F6B43aC78BA3"),F={key:{type:"object",properties:{currency0:d,currency1:d,fee:{type:"integer"},tickSpacing:{type:"integer"},hooks:d},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},zeroForOne:{type:"boolean"},amountSpecified:{type:"string",pattern:"^-?[0-9]+$"},amountBound:m(),sqrtPriceLimitX96:m(),recipient:d,relayer:d,relayerFee:m(),engagement:d,campaigns:{type:"array",items:m(),maxItems:8},nonce:m(),deadline:m()},x={owner:d,signature:{type:"string",pattern:"^0x[0-9a-fA-F]+$"},intent:{type:"object",properties:F,required:Object.keys(F),additionalProperties:!1}};function D(t){return B(t,"Provide a complete trader-signed Hookr intent.")}function y(t,i=256,e=!1){if(typeof t!="string"||!/^-?\d+$/.test(t)||t.length>79)throw new o("Hookr intent amounts, nonce and deadline must be decimal base-unit strings.");let n=BigInt(t);if(e?n<=-(1n<<BigInt(i-1))||n>=1n<<BigInt(i-1):n<0n||n>=1n<<BigInt(i))throw new o("Hookr intent integer is outside its ABI range.");return n}function l(t){return E(t,"Provide valid Hookr intent addresses.")}function j(t,i){if(Object.keys(t).some(s=>!Object.hasOwn(x,s)))throw new o("Provide only owner, intent and the trader signature for Hookr relay.");let e=D(t.intent);if(Object.keys(e).some(s=>!Object.hasOwn(F,s)))throw new o("Hookr intent contains an undocumented field.");let n=D(e.key);if(Object.keys(n).some(s=>!["currency0","currency1","fee","tickSpacing","hooks"].includes(s))||typeof n.fee!="number"||!Number.isInteger(n.fee)||n.fee<0||n.fee>16777215||typeof n.tickSpacing!="number"||!Number.isInteger(n.tickSpacing)||n.tickSpacing<=0||n.tickSpacing>8388607||typeof e.zeroForOne!="boolean")throw new o("Provide a valid canonical v4 pool key and direction.");let a={currency0:l(n.currency0),currency1:l(n.currency1),fee:n.fee,tickSpacing:n.tickSpacing,hooks:l(n.hooks)};if(BigInt(a.currency0)>=BigInt(a.currency1))throw new o("Hookr pool currencies must sort strictly by address.");let r=l(t.owner);if(r===k||p(r,i))throw new o("Hookr relay requires another trader as owner; the relayer funds gas only.");if(!Array.isArray(e.campaigns)||e.campaigns.length>8)throw new o("Provide at most eight Hookr campaign IDs.");let c={key:a,zeroForOne:e.zeroForOne,amountSpecified:y(e.amountSpecified,128,!0),amountBound:y(e.amountBound,128),sqrtPriceLimitX96:y(e.sqrtPriceLimitX96,160),recipient:l(e.recipient),relayer:l(e.relayer),relayerFee:y(e.relayerFee),engagement:l(e.engagement),campaigns:e.campaigns.map(s=>y(s)),nonce:y(e.nonce),deadline:y(e.deadline)};if(c.amountSpecified===0n||c.amountBound===0n)throw new o("Hookr intent input/output amounts and bound must be nonzero.");if([k,h,v].some(s=>p(s,c.recipient)))throw new o("Hookr intent recipient is reserved.");if(c.relayer!==k&&!p(c.relayer,i)||c.relayer===k&&c.relayerFee!==0n)throw new o("Hookr intent names a different relayer or an open relay with a fee.");if(c.engagement===k!=(c.campaigns.length===0))throw new o("Hookr engagement and campaigns must be supplied together.");let f=c.zeroForOne?a.currency0:a.currency1;if(f===k)throw new o("Hookr Permit2 relay cannot pull native ETH input.");if(typeof t.signature!="string"||!J(t.signature,{strict:!0})||t.signature.length<4||t.signature.length%2!==0||t.signature.length>16386)throw new o("Provide the trader-signed Permit2 witness signature, never a private key.");let S=t.signature,w=Y({data:c,primaryType:"HookrSwapIntent",types:ee});return{owner:r,intent:c,signature:S,input:f,intentHash:w}}function q(t,i){let{owner:e,intent:n,signature:a}=j(t,i);return{chainId:H,to:h,value:"0",data:G({abi:I,functionName:"execute",args:[n,e,a]}),description:`Relay Hookr trader ${e} to recipient ${n.recipient}; relayer fee ${n.relayerFee} in pool quote currency. Relayer pays gas; owner supplies Permit2 funds.`}}function ce(t,i,e){let n=q(i,e);if(t.length!==1||t[0].chainId!==n.chainId||!p(t[0].to,n.to)||t[0].value!=="0"||!p(t[0].data,n.data))throw new o("Hookr relay calldata differs from the locally requested signed intent.")}function ue(t){return[{name:"hookr_relay",inputSchema:{type:"object",description:"Preview a trader-signed Permit2 swap for local human-confirmed submission. Relayer pays gas; the trader supplies input. No signature is created by this tool.",properties:x,required:Object.keys(x),additionalProperties:!1},execute:async(i,e)=>{let n=j(i,e),{owner:a,intent:r,signature:c,input:f,intentHash:S}=n,w=t.clientFor(H),s=await w.getBlock();if(typeof s.number!="bigint"||typeof s.timestamp!="bigint"||s.timestamp<=0n||s.timestamp>r.deadline)throw new o("Hookr signed intent expired or the chain timestamp is unavailable.");let g=(X,M=[])=>w.readContract({address:h,abi:I,functionName:X,args:M,blockNumber:s.number}),[_,u,z,K,$,U]=await Promise.all([g("hashIntent",[r]),g("pullOf",[r]),g("isNonceUsed",[a,r.nonce]),g("router"),g("registry"),g("permit2")]);if(_!==S||z!==!1||K!==v||$!==N||U!==ne)throw new o("Hookr intent hash, nonce or forwarder deployment is invalid. Ask the trader for a fresh signed intent.");if(!Array.isArray(u)||u.length!==3||typeof u[0]!="string"||!p(u[0],f)||typeof u[1]!="bigint"||typeof u[2]!="boolean")throw new o("Hookr Permit2 pull could not be verified.");let b=u[2],P=r.amountSpecified<0n?-r.amountSpecified:r.amountBound;if(u[1]!==P+(b?r.relayerFee:0n)||r.amountSpecified>0n&&!b&&r.relayerFee>r.amountSpecified)throw new o("Hookr Permit2 pull or output-side fee differs from the signed terms.");let C=await w.simulateContract({address:h,abi:I,functionName:"execute",args:[r,a,c],account:e,blockNumber:s.number}),[A,R]=C.result,T=r.amountSpecified<0n?r.amountBound:r.amountSpecified-(b?0n:r.relayerFee);if(A>P||R<T)throw new o("Hookr relay simulation did not satisfy the signed input/output bounds.");let O=[t.unsignedTx(q(i,e))],L=await t.preview(O,e);return{txs:O,preview:L,summary:O[0].description,intentHash:S,owner:a,recipient:r.recipient,relayer:e,inputToken:f,maximumPull:u[1].toString(),feeToken:b?f:r.zeroForOne?r.key.currency1:r.key.currency0,relayerFee:r.relayerFee.toString(),feeFromInput:b,minimumOutput:T.toString(),simulatedAmountIn:A.toString(),simulatedAmountOut:R.toString(),note:"Verify IntentExecuted in the receipt and your fee balance after submission."}}},{name:"hookr_relay_receipt",inputSchema:{type:"object",description:"Read the executed intent and fee from a mined Hookr relay receipt.",properties:{transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}},required:["transactionHash"],additionalProperties:!1},execute:async i=>{if(Object.keys(i).some(a=>a!=="transactionHash")||typeof i.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(i.transactionHash))throw new o("Provide a Hookr relay transactionHash.");let e=await t.clientFor(H).getTransactionReceipt({hash:i.transactionHash});if(e.status!=="success")throw new o("Hookr relay reverted. No fee is proven paid.");let n=e.logs.filter(a=>p(a.address,h)).flatMap(a=>{try{let r=W({abi:I,eventName:"IntentExecuted",topics:a.topics,data:a.data});return[{...r.args,amountIn:r.args.amountIn.toString(),amountOut:r.args.amountOut.toString(),relayerFee:r.args.relayerFee.toString()}]}catch{return[]}});if(!n.length)throw new o("Receipt contains no verified Hookr IntentExecuted event.");return{chainId:H,transactionHash:e.transactionHash,blockNumber:e.blockNumber.toString(),intents:n,note:"Event evidence at this mined block; check balances and finality."}}}]}export{I as a,j as b,q as c,ce as d,ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as g,f as T,g as k,i as E}from"./
|
|
1
|
+
import{e as g,f as T,g as k,i as E}from"./SSHCD6RZ.js";import{c as _,d as S}from"./P56RZC2M.js";import{g as h}from"./NWNYJ26T.js";import{a as l}from"./FWD4L3CJ.js";import{a as i}from"./XSD5NL7J.js";import{decodeAbiParameters as B,encodeAbiParameters as H,getAddress as d}from"viem";var D=d("0xcEF685D4796FA80F71a97e803D2c0b6719F1b4E2"),O=[{name:"items",type:"tuple[]",components:[{...k[0],name:"offer"},{name:"ratifierData",type:"bytes"}]}],G=p=>({tools:[{name:"longbow_fixed_offers",inputSchema:{type:"object",additionalProperties:!1,properties:{limit:{type:"integer",minimum:1,maximum:50},marketId:{type:"string"}}},execute:async o=>{try{let a=o.limit??20;if(Object.keys(o).some(s=>!["limit","marketId"].includes(s))||!Number.isInteger(a)||Number(a)<1||Number(a)>50||o.marketId!==void 0&&(typeof o.marketId!="string"||!/^0x[0-9a-f]{64}$/i.test(o.marketId)))throw new i("Use limit 1..50 and an optional exact bytes32 marketId.");let f=await p.http("https://longbow.credit/api/fixed/offers",{method:"GET",redirect:"error"});if(!f.ok)throw new i(`Longbow fixed order book returned HTTP ${f.status}; offers are unavailable.`);let x=await f.text();if(x.length>2e6)throw new i("Longbow fixed order book exceeds the supported response size.");let t=JSON.parse(x);if(!t||t.chainId!==l||typeof t.mempool!="string"||d(t.mempool)!==D||!Array.isArray(t.publications)||t.publications.length>1e3||!Number.isSafeInteger(t.head)||Number(t.head)<0)throw new i("Longbow fixed indexer does not match the pinned chain, mempool or publication schema.");let c=[],u=[],y=0;for(let[s,m]of t.publications.entries())try{if(!m||typeof m!="object")throw new i("Invalid publication.");let r=m,n=r.itemsAbi;if(!Number.isSafeInteger(r.blockNumber)||Number(r.blockNumber)<0||Number(r.blockNumber)>Number(t.head))throw new i("Invalid publication block.");if(typeof n!="string"||!/^0x[0-9a-f]+$/i.test(n)||n.length>1e6||n.length<130||BigInt(`0x${n.slice(2,66)}`)!==32n||BigInt(`0x${n.slice(66,130)}`)>512n)throw new i("Invalid or oversized publication encoding.");let[I]=B(O,n);if(I.length!==r.items)throw new i("Publication count mismatch.");for(let b of I){y++;let e=b.offer;if(e.market.chainId!==BigInt(l)||d(e.market.midnight)!==g||b.ratifierData.length>32770)throw new i("Publication market or proof is unqualified.");let w=E(e.market);if(o.marketId!==void 0&&!h(w,String(o.marketId)))continue;let N=[_,S].find(P=>h(P.address,e.market.loanToken));c.push({marketId:w,offer:H(k,[e]),ratifierData:b.ratifierData,maker:d(e.maker),buy:e.buy,maturity:e.market.maturity.toString(),start:e.start.toString(),expiry:e.expiry.toString(),tick:e.tick.toString(),loanToken:N??null,directBuilderSupported:!!N&&/^0x0{40}$/i.test(e.callback)&&e.callbackData==="0x"&&T.includes(d(e.ratifier)),sourceBlock:String(r.blockNumber)})}}catch(r){u.push({publication:s,reason:p.plainError(r)})}return c.sort((s,m)=>BigInt(s.expiry)>BigInt(m.expiry)?-1:BigInt(s.expiry)<BigInt(m.expiry)?1:0),{chainId:l,midnight:g,mempool:D,indexedHead:String(t.head),decodedCount:y,matchingCount:c.length,offers:c.slice(0,Number(a)),incomplete:u.length>0||t.skipped!==0,rejected:u,warning:"Historical off-chain publications, not executable quotes. Expiry, consumption, authorization, signatures and liquidity are not verified here. Use morpho_midnight_status and preview morpho_midnight_take with the returned exact offer/proof; callback offers need a separately qualified builder. This read publishes nothing and creates no signature."}}catch(a){throw new i(p.plainError(a))}}}]});export{D as a,O as b,G as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as I}from"./DW4V5PUY.js";import{b as M}from"./GGSAKCND.js";import{a as U}from"./5SMVQCAP.js";import{b as C}from"./SPJCSEKP.js";import{a as W}from"./43LI5NKJ.js";import{a as P}from"./66F5ZH34.js";import{g as $}from"./NWNYJ26T.js";import{b as R}from"./IX3GZMTM.js";import{a as h,d as D,i as T,j as b}from"./FWD4L3CJ.js";import{a as p}from"./XSD5NL7J.js";import{encodeFunctionData as A,erc20Abi as O,parseAbi as E}from"viem";var f=T[h].vaults.spark.address,i={address:b,chainId:h,symbol:"USDG",decimals:D},u={address:f,chainId:h,symbol:"spUSDG",decimals:6},G=(1n<<256n)-1n,k=E(["function asset() view returns (address)","function decimals() view returns (uint8)","function totalAssets() view returns (uint256)","function balanceOf(address owner) view returns (uint256)","function maxDeposit(address receiver) view returns (uint256)","function maxWithdraw(address owner) view returns (uint256)","function maxRedeem(address owner) view returns (uint256)","function previewDeposit(uint256 assets) view returns (uint256)","function previewWithdraw(uint256 assets) view returns (uint256)","function previewRedeem(uint256 shares) view returns (uint256)","function deposit(uint256 assets,address receiver) returns (uint256 shares)","function withdraw(uint256 assets,address receiver,address owner) returns (uint256 shares)","function redeem(uint256 shares,address receiver,address owner) returns (uint256 assets)"]),t=(s,l)=>({token:{...s},amount:l.toString()});function y(s,l,v=!1){if(!s||typeof s!="object"||Array.isArray(s)||Object.keys(s).some(S=>!l||S!=="amount"))throw new p(l?"Provide only the amount for this Spark action.":"Spark listing takes no arguments.");if(!l)return 0n;if(v&&s.amount==="max")return"max";if(typeof s.amount!="string")throw new p("Amount must be a positive integer string in base units.");let n=R(s.amount);if(n===0n||n>G)throw new p("Amount must be positive and within the uint256 range.");return n}var N=s=>{async function l(a){try{return await a()}catch(e){throw new p(s.plainError(e))}}async function v(a){W(a);let e=s.clientFor(h);if(await e.getChainId()!==h)throw new p("Spark requires an endpoint on chain 4663.");let[r,c,o]=await Promise.all([e.readContract({address:f,abi:k,functionName:"asset"}),e.readContract({address:f,abi:k,functionName:"decimals"}),e.readContract({address:b,abi:O,functionName:"decimals"})]);if(typeof r!="string"||!$(r,b))throw new p("Spark does not report the expected USDG asset on chain 4663.");if(c!==u.decimals||o!==i.decimals)throw new p("Spark shares and USDG must both have 6 decimals.");return async(d,x=[])=>{let m=await e.readContract({address:f,abi:k,functionName:d,args:x});if(typeof m!="bigint"||m<0n||m>G)throw new p(`Spark returned an invalid ${d} value.`);return m}}function n(a){let e=a.amount.startsWith("-"),r=e?a.amount.slice(1):a.amount;return`${e?"-":""}${s.formatAmount(r,a.token.decimals)} ${a.token.symbol}`}async function S(a,e,r,c){let o=await s.preview(a,e),d=o.changes.map(n).join(", ");return{txs:a,amounts:r,preview:o,summary:`${c} Preview values can change before execution. ${o.summary}${d?` Changes: ${d}.`:""}`}}return{positions:a=>l(async()=>{let e=await v(a),r=await e("balanceOf",[a]);if(r===0n)return[];let[c,o,d]=await Promise.all([e("previewRedeem",[r]),e("maxRedeem",[a]),e("maxWithdraw",[a])]);return[{module:"spark",id:`${h}:${f}`,chainId:h,assets:[t(u,r)],description:`${n(t(u,r))}; redeem preview ${n(t(i,c))} (rounded down). Current maximum redeem ${n(t(u,o))}; maximum withdrawal ${n(t(i,d))}.`}]}),tools:[I(s),...M(s),...U(s),{name:"spark_list",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:(a,e)=>l(async()=>{y(a,!1);let r=await v(e),c=await r("totalAssets"),[o,d,x,m,w]=await Promise.all([r("balanceOf",[e]),r("maxDeposit",[e]),r("maxWithdraw",[e]),r("maxRedeem",[e]),r("previewDeposit",[1000000n])]),g=await r("previewRedeem",[o]);return[{chainId:h,address:f,name:"Spark Savings USDG",asset:{...i},shareToken:{...u},totalAssets:t(i,c),balance:t(u,o),maxDeposit:t(i,d),maxWithdraw:t(i,x),maxRedeem:t(u,m),previewDepositAssets:t(i,1000000n),previewDeposit:t(u,w),previewRedeemShares:t(u,o),previewRedeem:t(i,g),rounding:"Deposit shares and redeemed assets round down; exact-asset withdrawals round shares up. Previews can change before execution."}]})},{name:"spark_deposit",inputSchema:{type:"object",properties:{amount:P("Positive USDG base-unit integer (6 decimals).")},required:["amount"],additionalProperties:!1},execute:(a,e)=>l(async()=>{let r=y(a,!0),c=await v(e),[o,d]=await Promise.all([c("maxDeposit",[e]),c("previewDeposit",[r])]);if(r>o)throw new p("The deposit exceeds Spark\u2019s current maximum deposit.");if(d===0n)throw new p("This deposit would return zero Spark shares.");let x=[s.approval(b,f,r.toString(),h),s.unsignedTx({to:f,data:A({abi:k,functionName:"deposit",args:[r,e]}),value:"0",chainId:h,description:`Deposit ${n(t(i,r))} into Spark for this wallet.`})];return S(x,e,{assets:t(i,r),shares:t(u,d),maxDeposit:t(i,o)},`Approve exactly ${n(t(i,r))} for Spark ${f}, then deposit. Expected ${n(t(u,d))}, rounded down; current maximum deposit ${n(t(i,o))}.`)})},{name:"spark_withdraw",inputSchema:{type:"object",properties:{amount:{type:"string",anyOf:[{pattern:"^[0-9]+$"},{const:"max"}],description:"Positive USDG base-unit integer (6 decimals), or max to redeem all held shares."}},required:["amount"],additionalProperties:!1},execute:(a,e)=>l(async()=>{let r=y(a,!0,!0),c=await v(e),[o,d,x]=await Promise.all([c("balanceOf",[e]),c("maxWithdraw",[e]),c("maxRedeem",[e])]);if(o===0n)throw new p("This wallet has no Spark shares to withdraw.");let m,w,g;if(r==="max"){if(w=o,w>x)throw new p("The full share balance exceeds Spark\u2019s current maximum redeem. Request an asset amount within the current maximum withdrawal.");m=await c("previewRedeem",[w]),g=A({abi:k,functionName:"redeem",args:[w,e,e]})}else{if(m=r,m>d)throw new p("The withdrawal exceeds Spark\u2019s current maximum withdrawal.");if(w=await c("previewWithdraw",[m]),w>o)throw new p("This wallet has insufficient Spark shares for the withdrawal.");g=A({abi:k,functionName:"withdraw",args:[m,e,e]})}if(m===0n||w===0n)throw new p("Spark returned a zero asset or share preview for this withdrawal.");let _=r==="max"?`Redeem all ${n(t(u,w))} from Spark to this wallet.`:`Withdraw ${n(t(i,m))} from Spark to this wallet.`,j=[s.unsignedTx({to:f,data:g,value:"0",chainId:h,description:_})];return S(j,e,{assets:t(i,m),shares:t(u,w),maxWithdraw:t(i,d),maxRedeem:t(u,x)},r==="max"?`Redeem all ${n(t(u,w))} for an expected ${n(t(i,m))}, rounded down. Current maximum redeem ${n(t(u,x))}.`:`Withdraw ${n(t(i,m))} using an expected ${n(t(u,w))}, rounded up. Current maximum withdrawal ${n(t(i,d))}.`)})}]}};function Z(s){return C("spark",[N(s)])}export{N as a,Z as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as f}from"./
|
|
1
|
+
import{b as f}from"./7WSHW7KW.js";import{a as p}from"./43LI5NKJ.js";import{a as u}from"./FWD4L3CJ.js";import{a as r}from"./XSD5NL7J.js";import{encodeFunctionData as A,getAddress as w,parseAbi as T,parseAbiItem as F}from"viem";var R=[["setOwner(address newOwner)","owner"],["setCurator(address newCurator)","owner"],["setIsSentinel(address account,bool enabled)","owner"],["setName(string name)","owner"],["setSymbol(string symbol)","owner"],["setIsAllocator(address account,bool enabled)","timelock"],["setReceiveSharesGate(address gate)","timelock"],["setSendSharesGate(address gate)","timelock"],["setReceiveAssetsGate(address gate)","timelock"],["setSendAssetsGate(address gate)","timelock"],["setAdapterRegistry(address registry)","timelock"],["addAdapter(address adapter)","timelock"],["removeAdapter(address adapter)","timelock"],["increaseTimelock(bytes4 selector,uint256 duration)","timelock"],["decreaseTimelock(bytes4 selector,uint256 duration)","timelock"],["abdicate(bytes4 selector)","timelock"],["setPerformanceFee(uint256 fee)","timelock"],["setManagementFee(uint256 fee)","timelock"],["setPerformanceFeeRecipient(address recipient)","timelock"],["setManagementFeeRecipient(address recipient)","timelock"],["increaseAbsoluteCap(bytes idData,uint256 cap)","timelock"],["increaseRelativeCap(bytes idData,uint256 cap)","timelock"],["decreaseAbsoluteCap(bytes idData,uint256 cap)","curatorOrSentinel"],["decreaseRelativeCap(bytes idData,uint256 cap)","curatorOrSentinel"],["setForceDeallocatePenalty(address adapter,uint256 penalty)","timelock"],["allocate(address adapter,bytes data,uint256 assets)","allocator"],["deallocate(address adapter,bytes data,uint256 assets)","allocatorOrSentinel"],["setLiquidityAdapterAndData(address adapter,bytes data)","allocator"],["setMaxRate(uint256 rate)","allocator"],["accrueInterest()","any"]],S=R.map(([a,t])=>({abi:F(`function ${a}`),authority:t})),x=T(["function asset() view returns (address)","function owner() view returns (address)","function curator() view returns (address)","function isSentinel(address) view returns (bool)","function isAllocator(address) view returns (bool)","function executableAt(bytes) view returns (uint256)","function abdicated(bytes4) view returns (bool)","function submit(bytes data)","function revoke(bytes data)"]);function M(a,t){if(a==="bool"){if(typeof t!="boolean")throw new r("Boolean operation values must be booleans.");return t}if(typeof t!="string")throw new r("All address, byte, text and integer operation values must be strings.");if(a==="address")return p(t),w(t);if(a==="uint256"){if(!/^\d+$/.test(t)||BigInt(t)>=1n<<256n)throw new r("Integer operation values must be uint256 decimal base-unit strings.");return BigInt(t)}if((a==="bytes"||a==="bytes4")&&!(a==="bytes4"?/^0x[0-9a-f]{8}$/i:/^0x(?:[0-9a-f]{2})*$/i).test(t))throw new r("Invalid hexadecimal operation bytes.");return t}function E(a,t,m,O){return{name:t,inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:S.map(i=>i.abi.name)},values:{type:"array",maxItems:3,items:{oneOf:[{type:"string"},{type:"boolean"}]},description:"Ordered ABI values. Integers are decimal base-unit strings; addresses and bytes are explicit strings."},mode:{enum:["call","submit","revoke"],default:"call",description:"Submit/revoke only for timelocked curator operations. Execution is a separate call after the delay."}}},execute:async(i,c)=>{try{if(p(c),Object.keys(i).some(e=>!["operation","values","mode"].includes(e)))throw new r("Unexpected vault management argument.");let n=S.find(e=>e.abi.name===i.operation);if(!n||!Array.isArray(i.values)||i.values.length!==n.abi.inputs.length)throw new r("Provide a supported operation and its exact ordered values.");let o=i.mode??"call";if(!["call","submit","revoke"].includes(String(o))||o!=="call"&&n.authority!=="timelock")throw new r("Submit/revoke is available only for timelocked curator operations.");let I=n.abi.inputs.map((e,d)=>M(e.type,i.values[d])),l=A({abi:[n.abi],functionName:n.abi.name,args:I}),b=a.clientFor(u);if(await b.getChainId()!==u)throw new r("Vault management requires chain 4663.");let s=(e,d=[])=>b.readContract({address:m,abi:x,functionName:e,args:d}),y=await s("asset");if(typeof y!="string"||w(y)!==w(O.address))throw new r("Vault management requires the pinned vault asset.");let g=e=>typeof e=="string"&&e.toLowerCase()===c.toLowerCase(),C=async e=>e==="any"?!0:e==="owner"?g(await s("owner")):e==="allocator"?await s("isAllocator",[c])===!0:e==="allocatorOrSentinel"?await s("isAllocator",[c])===!0||await s("isSentinel",[c])===!0:g(await s("curator"))||e==="curatorOrSentinel"&&await s("isSentinel",[c])===!0;if(n.authority==="timelock"&&o==="call"){let[e,d,D]=await Promise.all([s("executableAt",[l]),s("abdicated",[l.slice(0,10)]),b.getBlock()]);if(f(e)===0n||f(e)>D.timestamp||d!==!1)throw new r("This exact operation has not matured or its selector is abdicated. Submit it with the curator, then wait for its executable time.")}else if(!await C(o==="submit"?"timelock":o==="revoke"?"curatorOrSentinel":n.authority))throw new r("This wallet does not hold the required vault management role. No transaction was built.");let $=o==="call"?l:A({abi:x,functionName:o==="submit"?"submit":"revoke",args:[l]}),k=`${o} ${n.abi.name} on ${m}; ordered values ${JSON.stringify(i.values)}. ${n.abi.name==="abdicate"?"Abdication is irreversible.":""}`,h=[a.unsignedTx({to:m,data:$,value:"0",chainId:u,description:k})],v=await a.preview(h,c);return{txs:h,preview:v,summary:`${k} ${v.summary} ${o==="submit"?"Submission schedules this exact operation; it does not execute the configuration change.":"Role, cap and timing checks can change before execution."}`}}catch(n){throw new r(a.plainError(n))}}}}export{S as a,M as b,E as c};
|