@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{A as qe,s as oe,x as xe}from"./YOENHHKI.js";import{a as Be}from"./NRBIXV7V.js";import{a as y}from"./WWNAGOCD.js";import{a as w,b as re,d as ve,e as A,f as d,h as $,i as q,j as k,k as N,l as H,m as R,n as ie,o as f,p as c,q as I,r as j,s as He,t as Se}from"./5OEHZJ6X.js";import{b as K,f as Pe,g as V,h as Te,i as Le}from"./ACN2BFMA.js";import{i as ne}from"./FUXT7GRK.js";import{a as be}from"./CY75R4FK.js";import{s as ge}from"./G6HCV67X.js";import{a as o}from"./5YS5V2LK.js";import{encodeAbiParameters as _e,encodeFunctionData as Qe,erc20Abi as We,formatUnits as Ae,getAddress as ue,parseAbi as _,zeroAddress as b,zeroHash as se}from"viem";var Ge="hookr_launch",g=ue(K.launcherV1),z=ue(K.rulesV1),Je=[{type:"tuple",components:[{name:"flags",type:"uint16"},{name:"minScore",type:"uint32"},{name:"tierScore",type:"uint32"},{name:"tierPips",type:"uint24"},{name:"reviewers",type:"bytes32"}]}],X=(a,n=Object.keys(a))=>({type:"object",properties:a,required:n,additionalProperties:!1}),Re={type:"string",pattern:"^0x[0-9a-fA-F]{40}$"},ae=X({token:{oneOf:[X({kind:{const:"new",type:"string"},name:{type:"string",minLength:1,maxLength:48},symbol:{type:"string",minLength:1,maxLength:12},supply:w,salt:re}),X({kind:{const:"existing",type:"string"},address:Re})]},quote:{...Re,description:"Qualified ETH (zero address) or pinned USDG quote. Other quote funding routes await qualification."},sqrtPriceX96:{...w,description:"Integer sqrt(currency1/currency0) times 2^96 for the sorted PoolKey."},tickLower:{type:"integer",minimum:-887272,maximum:887272},tickUpper:{type:"integer",minimum:-887272,maximum:887272},liquidity:w,amount0Max:w,amount1Max:w,agentGate:X({minScore:w,tierScore:w,tierPips:w,reviewerSetId:re}),lpRewardsBps:w,arbRecapture:{type:"boolean"},deadline:w});function Ye(a){let n=A(a,Object.keys(ae.properties),ae.required),r=R(n.token);if(r.kind==="existing")throw A(r,["kind","address"],["kind","address"]),q(r.address),new o("Existing-token Hookr launches await a qualified funding route. Use token.kind new.");if(A(r,["kind","name","symbol","supply","salt"],["kind","name","symbol","supply","salt"]),r.kind!=="new")throw new o("Choose token.kind new; existing tokens are not supported yet.");let e=(P,M)=>{if(typeof P!="string"||!P.trim()||new TextEncoder().encode(P).length>M||[...P].some(Q=>Q.codePointAt(0)<32)||/[\u007f-\u009f\u2028-\u202e\u2066-\u2069\ud800-\udfff]/u.test(P))throw new o(`Use nonempty public token text within ${M} UTF-8 bytes without control characters.`);return P},i=d(r.supply,108);if(!i)throw new o("Hookr new-token supply must be positive and at most 2^108-1 base units.");let t=q(n.quote);if(![b,ue(ge.mainnet.usdg)].includes(t))throw new o("Use native ETH (zero address) or the pinned USDG quote; other quote funding routes await qualification.");let l=n.tickLower,u=n.tickUpper;if(typeof l!="number"||typeof u!="number")throw new o("Provide integer aligned Hookr ticks.");xe(l,u,y.tickSpacing);let s=d(n.sqrtPriceX96,160);if(s<=ne(l)||s>=ne(u))throw new o("Hookr opening price must be strictly inside the aligned tick range.");let p=d(n.liquidity,127);if(!p)throw new o("Hookr liquidity must be positive and at most int128 max.");let m=d(n.amount0Max,128),L=d(n.amount1Max,128),x=qe({liquidity:p,tickLower:l,tickUpper:u,sqrtPriceX96:s,roundUp:!0});if(x.amount0>=1n<<127n||x.amount1>=1n<<127n||!x.amount0||!x.amount1||x.amount0>m||x.amount1>L)throw new o("Hookr exact rounded-up debts must be positive and fit both approved funding caps. Reduce liquidity or increase the caps.");let h=A(n.agentGate,["minScore","tierScore","tierPips","reviewerSetId"],["minScore","tierScore","tierPips","reviewerSetId"]),F=Number(d(h.minScore,32)),S=Number(d(h.tierScore,32)),B=Number(d(h.tierPips,24)),O=$(h.reviewerSetId);if(B>5e4||S===0!=(B===0)||(F!==0||S!==0)!=(O!==se))throw new o("Use tierPips at most 50000, paired nonzero tier score/pips, and a registered reviewer set only for scored gates. Identity-only uses all zero values.");let U=Number(d(n.lpRewardsBps,16));if(U>1e3)throw new o("Hookr LP Rewards plus burn must not exceed 1000 bps; this profile has zero burn.");if(typeof n.arbRecapture!="boolean")throw new o("Choose arbRecapture true or false explicitly.");return{token:{existing:b,name:e(r.name,48),symbol:e(r.symbol,12),supply:i,salt:$(r.salt)},quote:t,sqrtPriceX96:s,tickLower:l,tickUpper:u,liquidity:p,amount0Max:m,amount1Max:L,debts:x,gateTerms:{flags:1,minScore:F,tierScore:S,tierPips:B,reviewers:O},lpRewardsBps:U,arbRecapture:n.arbRecapture,deadline:d(n.deadline,64)}}async function Ze(a,n,r,e){return q(await c(a,g,f("launcherV1"),"predictToken",[n,r],e))}async function et(a,n,r,e,i){let t=r.gate;if(!t.walletAgent||!(e?t.healthyForScores:t.healthyIdentityOnly))throw new o("Hookr needs a healthy on-chain agent identity. Own an ERC-8004 identity or link its current agent wallet on the Hookr gate; Oak setup linking alone is insufficient.");let l=(p,m)=>c(a,t.identity,_(["function balanceOf(address) view returns (uint256)","function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),p,m,i),u=k(await l("balanceOf",[n])),s=!1;if(t.link.linked){let p=BigInt(t.link.agentId);s=q(await l("getAgentWallet",[p]))===n,!s&&u>0n&&(s=q(await l("ownerOf",[p]))===n)}if(!u&&!s||e&&!s)throw new o("Hookr on-chain identity ownership or gate link is missing or stale. Link a current ERC-8004 agent ID on the Hookr gate before launching; scored gates require that link even for an NFT owner.")}async function tt(a,n,r){let e=Ye(n);if(a.network==="testnet")throw new o("Hookr launch requires Robinhood Chain 4663.");let i=a.clientFor(4663),t=await Te(i);if(e.deadline<=t.timestamp||e.deadline>t.timestamp+y.deadlineSeconds)throw new o("Set a fresh Hookr deadline within the next 300 seconds of chain time.");let l=e.gateTerms.reviewers!==se,u=await Be(i,r,t.number,l?[e.gateTerms.reviewers]:[]);if(!u.rootOpenForWallet||u.newMarketsPaused||!u.launcherAdmitted)throw new o("Hookr new markets or the reviewed Launcher are closed. Retry only after registry admission is restored.");await et(i,r,u,l,t.number);let s=await Ze(i,r,e.token,t.number);if(s===b||s===e.quote)throw new o("Hookr predicted token collides with its quote. Choose a fresh salt.");let p={currency0:BigInt(s)<BigInt(e.quote)?s:e.quote,currency1:BigInt(s)<BigInt(e.quote)?e.quote:s,fee:8388608,tickSpacing:y.tickSpacing,hooks:I},m=oe(p),L=p.currency0===s,x=L?e.amount0Max:e.amount1Max,h=L?e.amount1Max:e.amount0Max,F=L?e.debts.amount0:e.debts.amount1,S=L?e.debts.amount1:e.debts.amount0;if(x>e.token.supply)throw new o("Hookr new-token deposit cap exceeds its fixed supply.");let[B,O,U,P,M,Q,Ie,Fe]=await Promise.all([i.getCode({address:s,blockNumber:t.number}),i.getTransactionCount({address:s,blockNumber:t.number}),c(i,g,f("launcherV1"),"memberKey",[s,e.quote,y.tickSpacing,I],t.number),c(i,I,f("rootV1"),"knownPool",[m],t.number),c(i,g,f("launcherV1"),"SKIP_TAKEN",[],t.number),c(i,j,f("registry"),"isQuote",[e.quote],t.number),c(i,j,f("registry"),"quoteIsBraked",[e.quote],t.number),c(i,z,f("rulesV1"),"minProtocolShareBps",[],t.number)]),[Ce,$e]=H(U,2);if(e.token.salt===$(M))throw new o("SKIP_TAKEN is unsupported. Choose an ordinary new-token salt.");if(B&&B!=="0x"||O!==0||N(P)||!N($e)||oe(R(Ce))!==m)throw new o("Hookr token address or pool is already taken or its predicted key differs. Choose a fresh salt and rebuild.");if(!N(Q)||N(H(Ie,2)[0]))throw new o("The Hookr quote is not currently qualified or is braked. Choose an admitted quote.");let ce=R(u.gate.admission),Ne=R(ce.caps),pe=d(Ne.maxLpFeePips,24),Oe=BigInt(u.coreAdmission.caps.maxLpFeePips),W=BigInt(y.baseLpFeePips)+pe;if(BigInt(e.gateTerms.tierPips)>pe||W>Oe||W>600000n)throw new o("Hookr gate tier or total LP fee exceeds the live admission cap. Lower the tier or wait for compatible admission.");let de=q(await c(i,z,f("rulesV1"),"protocolRecipient",[],t.number));await V(i,t.number,[de]);let[Ue,Me,Ee]=H(await c(i,de,_(["function feeTerms(address,bool,bytes32) view returns (uint16,uint16,uint16)"]),"feeTerms",[b,e.arbRecapture,m],t.number),3),le=k(Ue,16),G=k(Ee,16);if(k(Me,16)!==0n||G>10000n)throw new o("Hookr treasury minimum or integrator terms exceed the reviewed profile.");let me=k(Fe,16),E=le>me?le:me;if(E<2000n||E>5000n)throw new o("Hookr protocol share is outside the reviewed 2000\u20135000 bps profile.");let J=BigInt(e.lpRewardsBps)*100n+(!e.arbRecapture&&e.lpRewardsBps===0?G:0n);if(J>BigInt(u.coreAdmission.caps.maxQuoteTakePips))throw new o("Hookr LP Rewards and minimum quote charge exceed the live quote-take cap. Lower LP Rewards.");let Y={on:e.arbRecapture,traderBps:0,lpBps:e.arbRecapture?1e4:0,period:0,maxPrizeBps:0,potReleaseBps:0,minBuyQuote:0n,releaseBlocks:0},he=null;if(e.arbRecapture){let[D,ye]=await Promise.all([c(i,z,_(["function recaptureDefaults() view returns ((bool on,uint16 traderBps,uint16 lpBps,uint32 period,uint16 maxPrizeBps,uint16 potReleaseBps,uint128 minBuyQuote,uint32 releaseBlocks) rc,uint16 potBps)"]),"recaptureDefaults",[],t.number),c(i,j,f("registry"),"activeLaneOf",[I],t.number)]);Y.releaseBlocks=Number(k(R(H(D,2)[0]).releaseBlocks,32));let[Ve,je,ze,Xe]=H(ye,4),te=q(Ve);if(await V(i,t.number,[te]),te===b||$(je)!==Pe(te).codeHash||k(ze,32)===0n||k(Xe,16)>10000n||!Y.releaseBlocks)throw new o("Hookr recapture lane is unavailable. Use arbRecapture false until its executor and gas floor are reviewed.");he=ie(ye)}let we={quote:e.quote,tickSpacing:y.tickSpacing,sqrtPriceX96:e.sqrtPriceX96,tickLower:e.tickLower,tickUpper:e.tickUpper,liquidity:e.liquidity,amount0Max:e.amount0Max,amount1Max:e.amount1Max,config:{subject:s,quote:e.quote,rules:z,advisory:Se,liquidityOwner:g,baseLpFeePips:y.baseLpFeePips,caps:{maxLpFeePips:Number(W),maxQuoteTakePips:Number(J),maxSubjectTakeBps:0},rulesGasLimit:Number(u.coreAdmission.gasLimit),advisoryGasLimit:Number(d(ce.gasLimit,32)),advisoryPhases:1,advisoryFailOpen:!1,policyId:se},rules:{guardEndBlock:0,maxFeePips:y.baseLpFeePips,snipeTaxPips:0,snipeFloorPips:0,snipeDecaySeconds:0,dynamicFeeSens:0,burnBps:0,lpBps:e.lpRewardsBps,potBps:0,royaltyBps:0,protocolShareBps:Number(E),potEveryNBuys:0,maxBuyQuoteAmount:0n,potMinBuyQuote:0n,royaltyTo:b,integrator:b},recapture:Y},v=BigInt(u.launchFee.amount);if(v>10000000000000000n)throw new o("Hookr launch fee exceeds the reviewed 0.01 ETH maximum.");let T=b;if(v&&(await V(i,t.number,[u.launchFee.treasury]),T=q(await c(i,u.launchFee.treasury,_(["function target() view returns (address)"]),"target",[],t.number)),T===b||T===g||T===r||T===He))throw new o("Hookr launch fee recipient is outside the reviewed payment profile.");let Z=v+(e.quote===b?h:0n),ee=[],C=[];if(e.quote!==b){let D=k(await c(i,e.quote,We,"allowance",[r,g],t.number));D!==0n&&D!==h&&C.push(a.approval(e.quote,g,"0",4663)),C.push(a.approval(e.quote,g,h.toString(),4663)),ee.push({token:e.quote,amount:h})}Z&&ee.push({token:be,amount:Z,to:g});let ke=`Launch public, permanent token ${JSON.stringify(e.token.name)} (${JSON.stringify(e.token.symbol)}), fixed supply ${Ae(e.token.supply,18)} (18 decimals). Create one agents-only pool (identity check on every buy). Price currency1/currency0 = ${e.sqrtPriceX96*e.sqrtPriceX96}/${1n<<192n}; sqrtPriceX96 ${e.sqrtPriceX96}, ticks ${e.tickLower} to ${e.tickUpper}, spacing ${y.tickSpacing}. Deposit at most ${e.amount0Max} currency0 and ${e.amount1Max} currency1 base units; exact launch debts ${e.debts.amount0} and ${e.debts.amount1}. Currency0 ${p.currency0}; currency1 ${p.currency1}. Launch fee ${v} wei to ${T} (${Ae(v,18)} ETH). Unused quote funding (${h-S} base units) and retained token supply (${e.token.supply-F} base units) return to ${r} in this transaction. Family owner ${r}; token ${s}; pool ${m}. LP base fee 3000 pips; gate flags 1, scores ${e.gateTerms.minScore}/${e.gateTerms.tierScore}, tier ${e.gateTerms.tierPips} pips; LP Rewards ${e.lpRewardsBps} bps; burn 0; quote-take cap ${J} pips (includes Hookr minimum); protocol share ${E} bps. Arb recapture ${e.arbRecapture}; deadline ${e.deadline}. No lock.`;C.push(a.unsignedTx({to:g,data:Qe({abi:f("launcherV1"),functionName:"launchAdvised",args:[e.token,I,[we],[_e(Je,[e.gateTerms])],e.deadline]}),value:Z.toString(),chainId:4663,description:ke}));let[fe,De,Ke]=await Promise.all([i.getCode({address:s}),i.getTransactionCount({address:s}),i.readContract({address:g,abi:ve,functionName:"launchFee"})]);if(fe&&fe!=="0x"||De!==0||k(H(Ke,5)[0])!==v)throw new o("Hookr collision state or launch fee changed. Request a fresh launch preview.");return await Le(i,t),{txs:C,inputs:ee,summary:ke,tokenAddress:s,poolId:m,feeTarget:T,feeTreasury:u.launchFee.treasury,terms:ie({request:n,blockNumber:t.number,blockHash:t.hash,owner:r,tokenAddress:s,poolId:m,poolKey:p,member:we,gateTerms:e.gateTerms,launchFee:v,feeTarget:T,feeTreasury:u.launchFee.treasury,hookrMinimumPips:G,exactApprovals:C.slice(0,-1),refunds:{quote:h-S,retainedSupply:e.token.supply-F},gasEstimate:null,gasEstimateReason:"The local sender estimates the ordered exact calls after funding approvals and confirms the gas limit and maximum fee.",lane:he,pins:K})}}function nt(a){if(!Array.isArray(a)||a.length<1||a.length>3)throw new o("Hookr launch requires only the locally reconstructed finite approvals and one launch transaction.");for(let n of a)A(n,["to","data","value","chainId","description"],["to","data","value","chainId","description"])}function mt(a,n){if(nt(a),a.length!==n.length||a.some((r,e)=>r.to.toLowerCase()!==n[e].to.toLowerCase()||r.data.toLowerCase()!==n[e].data.toLowerCase()||r.value!==n[e].value||r.chainId!==4663))throw new o("Hookr launch differs from the locally reconstructed exact parameters, approvals and funding.")}function ht(a){return[{name:Ge,inputSchema:ae,execute:async(n,r)=>{let e=await tt(a,n,r);return{txs:e.txs,preview:await a.preview(e.txs,r),terms:e.terms,summary:e.summary}}}]}export{Ge as a,g as b,z as c,ae as d,Ye as e,tt as f,nt as g,mt as h,ht as i};
|
|
1
|
+
import{a as Be}from"./UMIZMJWW.js";import{a as y}from"./WWNAGOCD.js";import{A as qe,s as oe,x as xe}from"./GEIFITAQ.js";import{a as w,b as re,d as ve,e as A,f as d,h as $,i as q,j as k,k as N,l as H,m as R,n as ie,o as f,p as c,q as I,r as j,s as He,t as Se}from"./JVLLVNF2.js";import{b as K,f as Pe,g as V,h as Te,i as Le}from"./MQK6OP7S.js";import{i as ne}from"./57MEFFCU.js";import{a as be}from"./3MLUCYCB.js";import{s as ge}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as _e,encodeFunctionData as Qe,erc20Abi as We,formatUnits as Ae,getAddress as ue,parseAbi as _,zeroAddress as b,zeroHash as se}from"viem";var Ge="hookr_launch",g=ue(K.launcherV1),z=ue(K.rulesV1),Je=[{type:"tuple",components:[{name:"flags",type:"uint16"},{name:"minScore",type:"uint32"},{name:"tierScore",type:"uint32"},{name:"tierPips",type:"uint24"},{name:"reviewers",type:"bytes32"}]}],X=(a,n=Object.keys(a))=>({type:"object",properties:a,required:n,additionalProperties:!1}),Re={type:"string",pattern:"^0x[0-9a-fA-F]{40}$"},ae=X({token:{oneOf:[X({kind:{const:"new",type:"string"},name:{type:"string",minLength:1,maxLength:48},symbol:{type:"string",minLength:1,maxLength:12},supply:w,salt:re}),X({kind:{const:"existing",type:"string"},address:Re})]},quote:{...Re,description:"Qualified ETH (zero address) or pinned USDG quote. Other quote funding routes await qualification."},sqrtPriceX96:{...w,description:"Integer sqrt(currency1/currency0) times 2^96 for the sorted PoolKey."},tickLower:{type:"integer",minimum:-887272,maximum:887272},tickUpper:{type:"integer",minimum:-887272,maximum:887272},liquidity:w,amount0Max:w,amount1Max:w,agentGate:X({minScore:w,tierScore:w,tierPips:w,reviewerSetId:re}),lpRewardsBps:w,arbRecapture:{type:"boolean"},deadline:w});function Ye(a){let n=A(a,Object.keys(ae.properties),ae.required),r=R(n.token);if(r.kind==="existing")throw A(r,["kind","address"],["kind","address"]),q(r.address),new o("Existing-token Hookr launches await a qualified funding route. Use token.kind new.");if(A(r,["kind","name","symbol","supply","salt"],["kind","name","symbol","supply","salt"]),r.kind!=="new")throw new o("Choose token.kind new; existing tokens are not supported yet.");let e=(P,M)=>{if(typeof P!="string"||!P.trim()||new TextEncoder().encode(P).length>M||[...P].some(Q=>Q.codePointAt(0)<32)||/[\u007f-\u009f\u2028-\u202e\u2066-\u2069\ud800-\udfff]/u.test(P))throw new o(`Use nonempty public token text within ${M} UTF-8 bytes without control characters.`);return P},i=d(r.supply,108);if(!i)throw new o("Hookr new-token supply must be positive and at most 2^108-1 base units.");let t=q(n.quote);if(![b,ue(ge.mainnet.usdg)].includes(t))throw new o("Use native ETH (zero address) or the pinned USDG quote; other quote funding routes await qualification.");let l=n.tickLower,u=n.tickUpper;if(typeof l!="number"||typeof u!="number")throw new o("Provide integer aligned Hookr ticks.");xe(l,u,y.tickSpacing);let s=d(n.sqrtPriceX96,160);if(s<=ne(l)||s>=ne(u))throw new o("Hookr opening price must be strictly inside the aligned tick range.");let p=d(n.liquidity,127);if(!p)throw new o("Hookr liquidity must be positive and at most int128 max.");let m=d(n.amount0Max,128),L=d(n.amount1Max,128),x=qe({liquidity:p,tickLower:l,tickUpper:u,sqrtPriceX96:s,roundUp:!0});if(x.amount0>=1n<<127n||x.amount1>=1n<<127n||!x.amount0||!x.amount1||x.amount0>m||x.amount1>L)throw new o("Hookr exact rounded-up debts must be positive and fit both approved funding caps. Reduce liquidity or increase the caps.");let h=A(n.agentGate,["minScore","tierScore","tierPips","reviewerSetId"],["minScore","tierScore","tierPips","reviewerSetId"]),F=Number(d(h.minScore,32)),S=Number(d(h.tierScore,32)),B=Number(d(h.tierPips,24)),O=$(h.reviewerSetId);if(B>5e4||S===0!=(B===0)||(F!==0||S!==0)!=(O!==se))throw new o("Use tierPips at most 50000, paired nonzero tier score/pips, and a registered reviewer set only for scored gates. Identity-only uses all zero values.");let U=Number(d(n.lpRewardsBps,16));if(U>1e3)throw new o("Hookr LP Rewards plus burn must not exceed 1000 bps; this profile has zero burn.");if(typeof n.arbRecapture!="boolean")throw new o("Choose arbRecapture true or false explicitly.");return{token:{existing:b,name:e(r.name,48),symbol:e(r.symbol,12),supply:i,salt:$(r.salt)},quote:t,sqrtPriceX96:s,tickLower:l,tickUpper:u,liquidity:p,amount0Max:m,amount1Max:L,debts:x,gateTerms:{flags:1,minScore:F,tierScore:S,tierPips:B,reviewers:O},lpRewardsBps:U,arbRecapture:n.arbRecapture,deadline:d(n.deadline,64)}}async function Ze(a,n,r,e){return q(await c(a,g,f("launcherV1"),"predictToken",[n,r],e))}async function et(a,n,r,e,i){let t=r.gate;if(!t.walletAgent||!(e?t.healthyForScores:t.healthyIdentityOnly))throw new o("Hookr needs a healthy on-chain agent identity. Own an ERC-8004 identity or link its current agent wallet on the Hookr gate; Oak setup linking alone is insufficient.");let l=(p,m)=>c(a,t.identity,_(["function balanceOf(address) view returns (uint256)","function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),p,m,i),u=k(await l("balanceOf",[n])),s=!1;if(t.link.linked){let p=BigInt(t.link.agentId);s=q(await l("getAgentWallet",[p]))===n,!s&&u>0n&&(s=q(await l("ownerOf",[p]))===n)}if(!u&&!s||e&&!s)throw new o("Hookr on-chain identity ownership or gate link is missing or stale. Link a current ERC-8004 agent ID on the Hookr gate before launching; scored gates require that link even for an NFT owner.")}async function tt(a,n,r){let e=Ye(n);if(a.network==="testnet")throw new o("Hookr launch requires Robinhood Chain 4663.");let i=a.clientFor(4663),t=await Te(i);if(e.deadline<=t.timestamp||e.deadline>t.timestamp+y.deadlineSeconds)throw new o("Set a fresh Hookr deadline within the next 300 seconds of chain time.");let l=e.gateTerms.reviewers!==se,u=await Be(i,r,t.number,l?[e.gateTerms.reviewers]:[]);if(!u.rootOpenForWallet||u.newMarketsPaused||!u.launcherAdmitted)throw new o("Hookr new markets or the reviewed Launcher are closed. Retry only after registry admission is restored.");await et(i,r,u,l,t.number);let s=await Ze(i,r,e.token,t.number);if(s===b||s===e.quote)throw new o("Hookr predicted token collides with its quote. Choose a fresh salt.");let p={currency0:BigInt(s)<BigInt(e.quote)?s:e.quote,currency1:BigInt(s)<BigInt(e.quote)?e.quote:s,fee:8388608,tickSpacing:y.tickSpacing,hooks:I},m=oe(p),L=p.currency0===s,x=L?e.amount0Max:e.amount1Max,h=L?e.amount1Max:e.amount0Max,F=L?e.debts.amount0:e.debts.amount1,S=L?e.debts.amount1:e.debts.amount0;if(x>e.token.supply)throw new o("Hookr new-token deposit cap exceeds its fixed supply.");let[B,O,U,P,M,Q,Ie,Fe]=await Promise.all([i.getCode({address:s,blockNumber:t.number}),i.getTransactionCount({address:s,blockNumber:t.number}),c(i,g,f("launcherV1"),"memberKey",[s,e.quote,y.tickSpacing,I],t.number),c(i,I,f("rootV1"),"knownPool",[m],t.number),c(i,g,f("launcherV1"),"SKIP_TAKEN",[],t.number),c(i,j,f("registry"),"isQuote",[e.quote],t.number),c(i,j,f("registry"),"quoteIsBraked",[e.quote],t.number),c(i,z,f("rulesV1"),"minProtocolShareBps",[],t.number)]),[Ce,$e]=H(U,2);if(e.token.salt===$(M))throw new o("SKIP_TAKEN is unsupported. Choose an ordinary new-token salt.");if(B&&B!=="0x"||O!==0||N(P)||!N($e)||oe(R(Ce))!==m)throw new o("Hookr token address or pool is already taken or its predicted key differs. Choose a fresh salt and rebuild.");if(!N(Q)||N(H(Ie,2)[0]))throw new o("The Hookr quote is not currently qualified or is braked. Choose an admitted quote.");let ce=R(u.gate.admission),Ne=R(ce.caps),pe=d(Ne.maxLpFeePips,24),Oe=BigInt(u.coreAdmission.caps.maxLpFeePips),W=BigInt(y.baseLpFeePips)+pe;if(BigInt(e.gateTerms.tierPips)>pe||W>Oe||W>600000n)throw new o("Hookr gate tier or total LP fee exceeds the live admission cap. Lower the tier or wait for compatible admission.");let de=q(await c(i,z,f("rulesV1"),"protocolRecipient",[],t.number));await V(i,t.number,[de]);let[Ue,Me,Ee]=H(await c(i,de,_(["function feeTerms(address,bool,bytes32) view returns (uint16,uint16,uint16)"]),"feeTerms",[b,e.arbRecapture,m],t.number),3),le=k(Ue,16),G=k(Ee,16);if(k(Me,16)!==0n||G>10000n)throw new o("Hookr treasury minimum or integrator terms exceed the reviewed profile.");let me=k(Fe,16),E=le>me?le:me;if(E<2000n||E>5000n)throw new o("Hookr protocol share is outside the reviewed 2000\u20135000 bps profile.");let J=BigInt(e.lpRewardsBps)*100n+(!e.arbRecapture&&e.lpRewardsBps===0?G:0n);if(J>BigInt(u.coreAdmission.caps.maxQuoteTakePips))throw new o("Hookr LP Rewards and minimum quote charge exceed the live quote-take cap. Lower LP Rewards.");let Y={on:e.arbRecapture,traderBps:0,lpBps:e.arbRecapture?1e4:0,period:0,maxPrizeBps:0,potReleaseBps:0,minBuyQuote:0n,releaseBlocks:0},he=null;if(e.arbRecapture){let[D,ye]=await Promise.all([c(i,z,_(["function recaptureDefaults() view returns ((bool on,uint16 traderBps,uint16 lpBps,uint32 period,uint16 maxPrizeBps,uint16 potReleaseBps,uint128 minBuyQuote,uint32 releaseBlocks) rc,uint16 potBps)"]),"recaptureDefaults",[],t.number),c(i,j,f("registry"),"activeLaneOf",[I],t.number)]);Y.releaseBlocks=Number(k(R(H(D,2)[0]).releaseBlocks,32));let[Ve,je,ze,Xe]=H(ye,4),te=q(Ve);if(await V(i,t.number,[te]),te===b||$(je)!==Pe(te).codeHash||k(ze,32)===0n||k(Xe,16)>10000n||!Y.releaseBlocks)throw new o("Hookr recapture lane is unavailable. Use arbRecapture false until its executor and gas floor are reviewed.");he=ie(ye)}let we={quote:e.quote,tickSpacing:y.tickSpacing,sqrtPriceX96:e.sqrtPriceX96,tickLower:e.tickLower,tickUpper:e.tickUpper,liquidity:e.liquidity,amount0Max:e.amount0Max,amount1Max:e.amount1Max,config:{subject:s,quote:e.quote,rules:z,advisory:Se,liquidityOwner:g,baseLpFeePips:y.baseLpFeePips,caps:{maxLpFeePips:Number(W),maxQuoteTakePips:Number(J),maxSubjectTakeBps:0},rulesGasLimit:Number(u.coreAdmission.gasLimit),advisoryGasLimit:Number(d(ce.gasLimit,32)),advisoryPhases:1,advisoryFailOpen:!1,policyId:se},rules:{guardEndBlock:0,maxFeePips:y.baseLpFeePips,snipeTaxPips:0,snipeFloorPips:0,snipeDecaySeconds:0,dynamicFeeSens:0,burnBps:0,lpBps:e.lpRewardsBps,potBps:0,royaltyBps:0,protocolShareBps:Number(E),potEveryNBuys:0,maxBuyQuoteAmount:0n,potMinBuyQuote:0n,royaltyTo:b,integrator:b},recapture:Y},v=BigInt(u.launchFee.amount);if(v>10000000000000000n)throw new o("Hookr launch fee exceeds the reviewed 0.01 ETH maximum.");let T=b;if(v&&(await V(i,t.number,[u.launchFee.treasury]),T=q(await c(i,u.launchFee.treasury,_(["function target() view returns (address)"]),"target",[],t.number)),T===b||T===g||T===r||T===He))throw new o("Hookr launch fee recipient is outside the reviewed payment profile.");let Z=v+(e.quote===b?h:0n),ee=[],C=[];if(e.quote!==b){let D=k(await c(i,e.quote,We,"allowance",[r,g],t.number));D!==0n&&D!==h&&C.push(a.approval(e.quote,g,"0",4663)),C.push(a.approval(e.quote,g,h.toString(),4663)),ee.push({token:e.quote,amount:h})}Z&&ee.push({token:be,amount:Z,to:g});let ke=`Launch public, permanent token ${JSON.stringify(e.token.name)} (${JSON.stringify(e.token.symbol)}), fixed supply ${Ae(e.token.supply,18)} (18 decimals). Create one agents-only pool (identity check on every buy). Price currency1/currency0 = ${e.sqrtPriceX96*e.sqrtPriceX96}/${1n<<192n}; sqrtPriceX96 ${e.sqrtPriceX96}, ticks ${e.tickLower} to ${e.tickUpper}, spacing ${y.tickSpacing}. Deposit at most ${e.amount0Max} currency0 and ${e.amount1Max} currency1 base units; exact launch debts ${e.debts.amount0} and ${e.debts.amount1}. Currency0 ${p.currency0}; currency1 ${p.currency1}. Launch fee ${v} wei to ${T} (${Ae(v,18)} ETH). Unused quote funding (${h-S} base units) and retained token supply (${e.token.supply-F} base units) return to ${r} in this transaction. Family owner ${r}; token ${s}; pool ${m}. LP base fee 3000 pips; gate flags 1, scores ${e.gateTerms.minScore}/${e.gateTerms.tierScore}, tier ${e.gateTerms.tierPips} pips; LP Rewards ${e.lpRewardsBps} bps; burn 0; quote-take cap ${J} pips (includes Hookr minimum); protocol share ${E} bps. Arb recapture ${e.arbRecapture}; deadline ${e.deadline}. No lock.`;C.push(a.unsignedTx({to:g,data:Qe({abi:f("launcherV1"),functionName:"launchAdvised",args:[e.token,I,[we],[_e(Je,[e.gateTerms])],e.deadline]}),value:Z.toString(),chainId:4663,description:ke}));let[fe,De,Ke]=await Promise.all([i.getCode({address:s}),i.getTransactionCount({address:s}),i.readContract({address:g,abi:ve,functionName:"launchFee"})]);if(fe&&fe!=="0x"||De!==0||k(H(Ke,5)[0])!==v)throw new o("Hookr collision state or launch fee changed. Request a fresh launch preview.");return await Le(i,t),{txs:C,inputs:ee,summary:ke,tokenAddress:s,poolId:m,feeTarget:T,feeTreasury:u.launchFee.treasury,terms:ie({request:n,blockNumber:t.number,blockHash:t.hash,owner:r,tokenAddress:s,poolId:m,poolKey:p,member:we,gateTerms:e.gateTerms,launchFee:v,feeTarget:T,feeTreasury:u.launchFee.treasury,hookrMinimumPips:G,exactApprovals:C.slice(0,-1),refunds:{quote:h-S,retainedSupply:e.token.supply-F},gasEstimate:null,gasEstimateReason:"The local sender estimates the ordered exact calls after funding approvals and confirms the gas limit and maximum fee.",lane:he,pins:K})}}function nt(a){if(!Array.isArray(a)||a.length<1||a.length>3)throw new o("Hookr launch requires only the locally reconstructed finite approvals and one launch transaction.");for(let n of a)A(n,["to","data","value","chainId","description"],["to","data","value","chainId","description"])}function mt(a,n){if(nt(a),a.length!==n.length||a.some((r,e)=>r.to.toLowerCase()!==n[e].to.toLowerCase()||r.data.toLowerCase()!==n[e].data.toLowerCase()||r.value!==n[e].value||r.chainId!==4663))throw new o("Hookr launch differs from the locally reconstructed exact parameters, approvals and funding.")}function ht(a){return[{name:Ge,inputSchema:ae,execute:async(n,r)=>{let e=await tt(a,n,r);return{txs:e.txs,preview:await a.preview(e.txs,r),terms:e.terms,summary:e.summary}}}]}export{Ge as a,g as b,z as c,ae as d,Ye as e,tt as f,nt as g,mt as h,ht as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as H}from"./66F5ZH34.js";import{c as B,f as j,g as I,k as F,n as G}from"./NWNYJ26T.js";import{a as k,i as z}from"./FWD4L3CJ.js";import{a}from"./XSD5NL7J.js";import{encodeFunctionData as Q,erc20Abi as O,parseAbi as oe,zeroHash as J}from"viem";var ne=z[k].meridian,S=ne.PredictionMarketEscrow.address,M={address:ne.CollateralToken_USDe.address,chainId:k,symbol:"USDe",decimals:18},se="https://api.predict.meridian.xyz/graphql",ae="query GetOpenConditions($now: Int!, $first: Int!, $after: String, $search: String, $conditionIds: [Bytes!], $resolvers: [Address!]) { conditions(first: $first, after: $after, filter: { chainId: 4663, settled: false, public: true, endTime: { gte: $now }, search: $search, conditionIds: $conditionIds, resolvers: $resolvers }) { totalCount pageInfo { hasNextPage endCursor } nodes { conditionId resolver question shortName optionName endTime estimatedPrice openInterest similarMarketVolume24h marketType } } }",de="query GetHolderPositions($holder: Address!, $first: Int!, $after: String) { positions(first: $first, after: $after, filter: { holder: $holder, chainId: 4663 }, orderBy: { field: CREATED_AT, direction: DESC }) { totalCount pageInfo { hasNextPage endCursor } nodes { id chainId holder side balance tokenAddress: token pickConfigId userCollateral totalPayout prediction { predictionId } pickConfig { pickConfigId marketAddress: escrow resolved result } } } }",U=oe(["function getClaimableAmount(bytes32 pickConfigId, address positionToken, uint256 tokenAmount) view returns (uint256)","function settle(bytes32 predictionId, bytes32 refCode)","function redeem(address positionToken, uint256 amount, bytes32 refCode) returns (uint256)"]),K={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},V={type:"string",minLength:1,maxLength:4096,description:"Opaque nextCursor returned by the previous page."},E=25,W={type:"integer",minimum:1,maximum:E},ce=1e3;function Y(e,p){if(e===void 0)return p;if(!Number.isSafeInteger(e)||e<1||e>E)throw new a("Provide a Meridian page limit from 1 to 25.");return e}function Z(e){if(e===void 0)return;let p=()=>new a("Provide the opaque Meridian nextCursor returned by the previous page.");if(typeof e!="string"||e.length>4096||!/^[A-Za-z0-9+/_-]+={0,2}$/.test(e))throw p();try{let c=Buffer.from(e,"base64url");if(c.toString("base64url")!==e.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_"))throw p();let m=C(JSON.parse(c.toString("utf8")));if(typeof m.k!="string"||!m.k||typeof m.id!="string"||!m.id)throw p()}catch{throw p()}return e}function X(e,p,c,m=!1){let l=C(e),f=C(l.pageInfo),P=Array.isArray(l.nodes)?l.nodes.filter(q=>!m||N(C(q).balance)!=="0").length:0;if(!Array.isArray(l.nodes)||l.nodes.length>p||!Number.isSafeInteger(l.totalCount)||l.totalCount<P||typeof f.hasNextPage!="boolean"||c===void 0&&!f.hasNextPage&&l.totalCount>l.nodes.length||f.endCursor!==null&&(typeof f.endCursor!="string"||!f.endCursor.trim()||f.endCursor.length>4096)||f.hasNextPage&&(l.nodes.length===0||f.endCursor===null||f.endCursor===c))throw new a("Meridian returned invalid pagination; retry the scan from the first page.");return{nodes:l.nodes,totalCount:l.totalCount,nextCursor:f.hasNextPage?f.endCursor:null,complete:!f.hasNextPage&&c===void 0}}function C(e){return j(e,"Meridian returned an unexpected response.")}function A(e){if(typeof e!="string"||!e.trim())throw new a("Meridian returned an invalid text field.");return e}function b(e){return F(e,"Provide a valid Meridian contract or wallet address.")}function v(e){if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new a("Provide a valid Meridian prediction or pick configuration ID.");return e}function R(e){return G(e,"Meridian amount exceeds the uint256 range.",{notString:"Meridian amounts must be integer strings in base units."}).toString()}function N(e){return e===0?"0":R(e)}function D(e){if(typeof e!="bigint"||e<0n)throw new a("Meridian returned an invalid on-chain amount.");return R(e.toString())}function ue(e,p){return e.chainId===p.chainId&&I(e.address,p.address)}function ee(e,p){let c=C(e),m=C(c.pickConfig),l=b(c.holder),f=b(m.marketAddress);if(c.chainId!==k||!I(l,p))throw new a("Meridian returned a position for a different wallet or chain.");if(!I(f,S))throw new a("This Meridian position uses an unsupported escrow contract.");if(typeof m.resolved!="boolean"||m.result!==null&&typeof m.result!="string")throw new a("Meridian returned an invalid resolution.");let P=v(c.pickConfigId);if(!I(v(m.pickConfigId),P))throw new a("Meridian returned mismatched pick configuration IDs.");if(c.side!=="PREDICTOR"&&c.side!=="COUNTERPARTY")throw new a("Meridian returned an invalid position side.");return{id:A(c.id),chainId:k,holder:l,side:c.side,balance:N(c.balance),tokenAddress:b(c.tokenAddress),pickConfigId:P,userCollateral:N(c.userCollateral),totalPayout:N(c.totalPayout),prediction:{predictionId:v(C(c.prediction).predictionId)},pickConfig:{pickConfigId:P,marketAddress:f,resolved:m.resolved,result:m.result}}}var le=e=>{async function p(t){try{return await t()}catch(o){throw new a(e.plainError(o))}}async function c(){let t=e.clientFor(k);if(await t.getChainId()!==k)throw new a("Meridian requires an RPC on chain 4663.");return t}async function m(t,o,r){let s=new URL(se);s.searchParams.set("op",t),s.searchParams.set("query",o),s.searchParams.set("variables",JSON.stringify(r));let n=await e.http(s.toString(),{method:"GET",headers:{Accept:"application/json"}});if(!n.ok)throw new a(`Meridian returned HTTP ${n.status}. Please try again.`);let u;try{u=await n.json()}catch{throw new a("Meridian returned malformed JSON.")}let d=C(u);if(d.errors!==void 0&&(!Array.isArray(d.errors)||d.errors.length>0))throw new a("Meridian could not complete the GraphQL query. Please try again.");return C(d.data)}async function l(t,o=10,r){b(t);let s=await m("GetHolderPositions",de,{holder:t,first:o,...r===void 0?{}:{after:r}});return X(s.positions,o,r,!0)}async function f(t,o){let r=[],s=new Set,n=new Set,u,d,h=0;for(let g=0;g<ce;g++){let w=await l(t,E,u);if(d!==void 0&&d!==w.totalCount)throw new a("Meridian positions changed during pagination; retry from the first page.");d=w.totalCount;for(let x of w.nodes){let i=C(x),y=A(i.id);if(n.has(y))throw new a("Meridian repeated a position during pagination; retry from the first page.");n.add(y),N(i.balance)!=="0"&&h++,(o===void 0||I(b(i.tokenAddress),o))&&r.push(ee(x,t))}if(w.nextCursor===null){if(h>d||n.size<d)throw new a("Meridian returned an incomplete positions scan; retry from the first page.");return r}if(s.has(w.nextCursor))throw new a("Meridian repeated a cursor; retry from the first page.");s.add(w.nextCursor),u=w.nextCursor}throw new a("Meridian positions scan exceeded 1000 pages. Use meridian_positions with limit and cursor to inspect pages; redeem a known settled positionToken directly.")}async function P(t,o){if(t.length===0)return[];let r=await c();return(await Promise.all(t.map(async n=>{let[u,d,h]=await Promise.all([r.readContract({address:n.tokenAddress,abi:O,functionName:"balanceOf",args:[o]}),r.readContract({address:n.tokenAddress,abi:O,functionName:"decimals"}),r.readContract({address:n.tokenAddress,abi:O,functionName:"symbol"})]);if(!Number.isInteger(d)||d<0||d>255)throw new a("Meridian returned invalid position token decimals.");let g={address:n.tokenAddress,chainId:k,decimals:d,symbol:A(h)},w=D(u),x=n.pickConfig.resolved?{token:{...M},amount:D(await r.readContract({address:S,abi:U,functionName:"getClaimableAmount",args:[n.pickConfigId,n.tokenAddress,BigInt(w)]}))}:null;return{module:"meridian",id:n.id,chainId:k,assets:[{token:g,amount:w}],description:`Meridian ${n.side.toLowerCase()} position; ${n.pickConfig.resolved?n.pickConfig.result??"resolved":"unresolved"}.`,holder:n.holder,side:n.side,pickConfigId:n.pickConfigId,prediction:n.prediction,pickConfig:n.pickConfig,userCollateral:{token:{...M},amount:n.userCollateral},totalPayout:{token:{...M},amount:n.totalPayout},claimable:x}}))).filter(n=>BigInt(n.assets[0].amount)>0n)}async function q(t){return P(await f(t),t)}function _(t){return e.unsignedTx({to:S,chainId:k,value:"0",data:Q({abi:U,functionName:"settle",args:[t,J]}),description:`Settle Meridian prediction ${t}.`})}function L(t,o,r){let s=o.changes.map(n=>{let u=n.amount.startsWith("-"),d=e.formatAmount(u?n.amount.slice(1):n.amount,n.token.decimals);return`${u?"-":"+"}${d} ${n.token.symbol} (${n.token.address}, chain ${n.token.chainId})`});return{txs:t,preview:o,summary:`${r} ${o.summary}${s.length?` Changes: ${s.join("; ")}.`:""}`}}async function te(t){let o=Y(t.limit,20),r=Z(t.cursor);if(r!==void 0&&t.asOf===void 0)throw new a("Pass the previous Meridian browse asOf with cursor to keep the same time filter.");let s=t.asOf===void 0?Math.floor(Date.now()/1e3):Number(R(t.asOf));if(!Number.isSafeInteger(s)||s<0||s>2147483647)throw new a("Provide Meridian asOf as Unix seconds within the GraphQL Int range.");let n;if(t.search!==void 0&&(n=A(t.search).trim(),n.length>500))throw new a("Keep the Meridian market search to 500 characters.");let u=t.conditionId===void 0?void 0:v(t.conditionId),d=t.resolver===void 0?void 0:b(t.resolver),h=await m("GetOpenConditions",ae,{now:s,first:o,...r===void 0?{}:{after:r},...n===void 0?{}:{search:n},...u===void 0?{}:{conditionIds:[u]},...d===void 0?{}:{resolvers:[d]}}),g=X(h.conditions,o,r),w=g.nodes.map(x=>{let i=C(x);if(!Number.isSafeInteger(i.endTime)||i.endTime<0||i.estimatedPrice!==null&&(typeof i.estimatedPrice!="number"||!Number.isFinite(i.estimatedPrice)||i.estimatedPrice<0||i.estimatedPrice>1))throw new a("Meridian returned invalid market pricing or time.");let y=v(i.conditionId),T=b(i.resolver);if(u!==void 0&&!I(y,u)||d!==void 0&&!I(T,d))throw new a("Meridian returned a different condition or resolver than requested.");return{conditionId:y,resolver:T,question:A(i.question),shortName:i.shortName===null?null:A(i.shortName),optionName:i.optionName===null?null:A(i.optionName),endTime:String(i.endTime),estimatedPrice:i.estimatedPrice===null?null:String(i.estimatedPrice),marketType:i.marketType===null?null:A(i.marketType)}});return{chainId:k,collateral:{...M},totalCount:g.totalCount,markets:w,limit:o,nextCursor:g.nextCursor,complete:g.complete,asOf:String(s)}}async function ie(t,o){let r=b(t.positionToken),s=R(t.amount);if(BigInt(s)===0n)throw new a("Provide a positive Meridian redemption amount.");let n=await c(),u=D(await n.readContract({address:r,abi:O,functionName:"balanceOf",args:[o]}));if(BigInt(s)>BigInt(u))throw new a("The redemption amount exceeds the wallet position balance.");let d=e.unsignedTx({to:S,chainId:k,value:"0",data:Q({abi:U,functionName:"redeem",args:[r,BigInt(s),J]}),description:`Redeem ${s} Meridian position base units for USDe.`}),h=[d],g;try{g=await e.preview(h,o)}catch(i){if(!/\breverted\b/i.test(e.plainError(i)))throw i;let y=await f(o,r);if(y.length!==1)throw new a("Direct Meridian redemption reverted and no unique indexed prediction was found for this token. Retry indexing or use meridian_settle with the known predictionId first.");let T=y[0];if(T.pickConfig.resolved){let re=D(await n.readContract({address:S,abi:U,functionName:"getClaimableAmount",args:[T.pickConfigId,r,BigInt(s)]}));if(BigInt(re)===0n)throw i}h=[_(T.prediction.predictionId),d],g=await e.preview(h,o)}let w=g.changes.filter(i=>ue(i.token,M)&&i.token.decimals===M.decimals).reduce((i,y)=>i+BigInt(y.amount),0n),x=g.changes.filter(i=>i.token.chainId===k&&I(i.token.address,r)).reduce((i,y)=>i+BigInt(y.amount),0n);if(w<=0n||x!==-BigInt(s))throw new a("Meridian preview did not show the requested position burn and a positive USDe payout.");return L(h,g,h.length===2?"Settle the prediction, then redeem for USDe. Unsigned transactions only.":"Redeem the position for USDe. Unsigned transaction only.")}function $(t,o,r,s,n){return{name:t,inputSchema:{type:"object",properties:o,required:r,additionalProperties:!1,description:s},execute:(u,d)=>p(async()=>{if(C(u),b(d),Object.keys(u).some(h=>!Object.hasOwn(o,h))||r.some(h=>u[h]===void 0))throw new a("Provide only the required Meridian tool inputs.");return n(u,d)})}}return{tools:[$("meridian_browse",{search:{type:"string",minLength:1,maxLength:500},cursor:V,limit:W,conditionId:K,resolver:B,asOf:H("Reuse the returned Unix seconds with cursor.")},[],"Search open Meridian conditions or look up a conditionId/resolver. Follow nextCursor with the same filters and asOf.",te),$("meridian_positions",{cursor:V,limit:W},[],"Page through indexed Meridian positions with on-chain balances and claimability. Follow nextCursor until null; indexing can lag transfers.",async(t,o)=>{let r=Y(t.limit,10),s=Z(t.cursor),n=await l(o,r,s);return{positions:await P(n.nodes.map(u=>ee(u,o)),o),totalCount:n.totalCount,limit:r,nextCursor:n.nextCursor,complete:n.complete,scope:"Indexed positions with current on-chain balances. Index totalCount may exclude zero-balance rows. Indexing can lag transfers; redeem known settled tokens directly."}}),$("meridian_settle",{predictionId:K},["predictionId"],"Preview an unsigned unilateral settlement; unresolved or already settled predictions may revert.",async(t,o)=>{let r=_(v(t.predictionId));await c();let s=[r];return L(s,await e.preview(s,o),"Settle the Meridian prediction. Unsigned transaction only.")}),$("meridian_redeem",{positionToken:B,amount:H("Position token amount in base units.")},["positionToken","amount"],"Preview redemption of a known position token directly; scan all indexed pages for settlement first if required. No approval or typed signature.",ie)],positions:t=>p(()=>q(t))}},we=le;export{le as a,we as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as me,c as De}from"./QA3UHEO3.js";import{c as Te,d as a,r as Ee}from"./64GOINYS.js";import{o as pe}from"./3NJ5KQ3Q.js";import{a as M}from"./3MLUCYCB.js";import{a as xe}from"./43LI5NKJ.js";import{a as te}from"./66F5ZH34.js";import{c as G,j as ve}from"./NWNYJ26T.js";import{b as ke}from"./IX3GZMTM.js";import{a as R,i as Ce}from"./FWD4L3CJ.js";import{a as t}from"./XSD5NL7J.js";import{decodeFunctionData as Se,erc20Abi as Oe}from"viem";var Fe="https://api.relay.link",q="0x0000000000000000000000000000000000000000",Le=60,Pe=30,n=Ce[R].relay.depository.address.toLowerCase(),ne="0x59916da825d2d2ec1bf878d71c88826f6633ecca",ie=new Map([[1,{chainId:"ethereum",depository:n}],[10,{chainId:"optimism",depository:n}],[25,{chainId:"cronos",depository:ne}],[56,{chainId:"bnb",depository:n}],[100,{chainId:"gnosis",depository:n}],[130,{chainId:"unichain",depository:n}],[137,{chainId:"polygon",depository:n}],[143,{chainId:"monad",depository:n}],[146,{chainId:"sonic",depository:n}],[169,{chainId:"manta",depository:n}],[196,{chainId:"xlayer",depository:n}],[288,{chainId:"boba",depository:n}],[324,{chainId:"zksync",depository:n}],[360,{chainId:"shape",depository:n}],[480,{chainId:"worldchain",depository:n}],[747,{chainId:"flow",depository:n}],[988,{chainId:"stable",depository:n}],[999,{chainId:"hyperevm",depository:n}],[1088,{chainId:"metis",depository:ne}],[1135,{chainId:"lisk",depository:n}],[1868,{chainId:"soneium",depository:n}],[2020,{chainId:"ronin",depository:n}],[2741,{chainId:"abstract",depository:n}],[2818,{chainId:"morph",depository:n}],[4217,{chainId:"tempo",depository:n}],[4326,{chainId:"megaeth",depository:n}],[5e3,{chainId:"mantle",depository:ne}],[5031,{chainId:"somnia",depository:n}],[5042,{chainId:"arc",depository:n}],[8453,{chainId:"base",depository:n}],[9745,{chainId:"plasma",depository:n}],[33139,{chainId:"apechain",depository:n}],[34443,{chainId:"mode",depository:n}],[42018,{chainId:"mythos",depository:n}],[42161,{chainId:"arbitrum",depository:n}],[42220,{chainId:"celo",depository:n}],[43114,{chainId:"avalanche",depository:n}],[48900,{chainId:"zircuit",depository:n}],[57073,{chainId:"ink",depository:n}],[59144,{chainId:"linea",depository:ne}],[60808,{chainId:"bob",depository:n}],[80094,{chainId:"berachain",depository:n}],[97477,{chainId:"doma",depository:n}],[98866,{chainId:"plume",depository:n}],[534352,{chainId:"scroll",depository:n}],[685689,{chainId:"gensyn",depository:n}],[747474,{chainId:"katana",depository:n}],[5064014,{chainId:"ethereal",depository:n}],[7777777,{chainId:"zora",depository:n}]]),nt=Object.freeze(["robinhood",...Array.from(ie.values(),e=>e.chainId)]);function ot(e){return e===R?"robinhood":ie.get(e)?.chainId}function it(e){return ie.get(e)?.depository}function j(e){return ve(e,"Provide a token or wallet address.")}function I(e){let o=j(e);return o===M?q:o}function f(e,o){return j(e)===j(o)}function l(e){if(typeof e!="string")throw new t("Provide a decimal base-unit amount string.");return ke(e),e}function oe(e){let o=l(e);if(BigInt(o)<=0n)throw new t("Provide a positive base-unit amount.");return o}function ze(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new t("Provide a positive integer origin chain ID.");return e}function Ne(e,o){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new t(`${o} is missing or invalid.`);return e}async function V(e,o,c,i,p){let r=a(c);if(r.chainId!==i||I(r.address)!==p||typeof r.symbol!="string"||!/^[A-Za-z0-9._-]{1,32}$/.test(r.symbol))throw new t("Relay quote token metadata does not match the requested chain and address.");if(p===q){if(r.decimals!==18)throw new t("Native token decimals must be 18.");return{address:M,chainId:i,symbol:r.symbol,decimals:18}}let g=`${i}:${p}`,m=o.get(g);if(m===void 0){let d=await e.clientFor(i).readContract({address:p,abi:Oe,functionName:"decimals"}),w=typeof d=="bigint"?Number(d):d;if(typeof w!="number"||!Number.isInteger(w)||w<0||w>255)throw new t("Could not read valid ERC-20 decimals() on-chain.");m=w,o.set(g,m)}return{address:p,chainId:i,symbol:r.symbol,decimals:m}}async function Ke(e,o,c,i,p,r,g){if(c.swap===void 0)return[];let m=a(c.swap),d=a(m.from);if(d.chainId!==p)throw new t("The swap prerequisite token must be on the origin chain.");let w=await V(e,o,d,p,I(d.address)),F=r===q?M:r;if(f(w.address,F))throw new t("The swap prerequisite must use a different input token.");let he=oe(m.amountIn),y=m.slippageBps;if(y!==void 0&&(typeof y!="number"||!Number.isInteger(y)||y<0||y>1e4))throw new t("Provide swap slippage in basis points from 0 to 10000.");let D=await e.quoteSwap({from:w.address,to:F,amountIn:he,...y===void 0?{}:{slippageBps:y}},i);if(BigInt(l(D.expiresAt))<=BigInt(Math.floor(Date.now()/1e3)))throw new t("The swap prerequisite quote expired. Request a fresh quote.");if(BigInt(l(D.minAmountOut))<BigInt(g))throw new t("The swap prerequisite minimum cannot cover the bridge amount.");let C=await e.buildSwap(D.quoteId,i);if(!("txs"in C)||!C.txs.length)throw new t("The swap prerequisite must return unsigned transactions.");if(C.txs.some(S=>S.chainId!==p))throw new t("The injected swap coordinator does not support this origin chain.");return C.txs.map(S=>e.unsignedTx(S))}async function Ue(e,o,c){xe(c);let i=ze(o.originChainId);if(i===R)throw new t("Inbound bridging requires an origin chain other than 4663.");let p=ie.get(i);if(!p)throw new t("Relay inbound does not support this origin chain.");if(o.destinationChainId!==void 0&&o.destinationChainId!==R)throw new t("Inbound bridge destination must be chain 4663.");let r=I(o.originCurrency??M),g=I(o.destinationCurrency??M),m=j(o.recipient??c),d=oe(o.amount),w=o.minAmountOut===void 0?void 0:l(o.minAmountOut),F=o.slippageBps===void 0?me:o.slippageBps;if(pe("0",F),await e.clientFor(i).getChainId()!==i)throw new t("The RPC chain does not match the inbound origin chain.");let y=new Map,D=await Ke(e,y,o,c,i,r,d),C,S=process.env.OAK_RELAY_API_KEY?.trim();if(!S)throw new t("Configure OAK_RELAY_API_KEY on the server: Relay quote/v2 requires a valid API key since October 2, 2026. Status and chain reads remain available without it.");try{let s=await e.http(`${Fe}/quote/v2`,{method:"POST",headers:{"content-type":"application/json","user-agent":"oak-core/0.1.0","x-api-key":S},body:JSON.stringify({user:c,recipient:m,originChainId:i,destinationChainId:R,originCurrency:r,destinationCurrency:g,amount:d,tradeType:"EXACT_INPUT",includeProtocolData:!0,...r===q?{}:{explicitDeposit:!0}})});if(!s.ok)throw new Error("Relay HTTP failure.");C=await s.json()}catch{throw new t("Relay quote request failed. Please try again.")}let b=a(C);if(typeof b.requestId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(b.requestId))throw new t("Relay returned an invalid request ID.");let P=b.requestId,ye=`/intents/status/v3?requestId=${P}`,L=a(b.details);if(!f(L.sender,c)||!f(L.recipient,m))throw new t("Relay quote sender or recipient does not match the request.");let le=a(L.currencyIn),re=a(L.currencyOut),N=await V(e,y,le.currency,i,r),O=await V(e,y,re.currency,R,g);if(l(le.amount)!==d)throw new t("Relay quote input amount does not match the request.");let _=oe(re.amount),k=oe(re.minimumAmount);if(BigInt(k)>BigInt(_))throw new t("Relay quote minimum output exceeds the expected output.");if(w!==void 0){if(k!==w)throw new t("Relay order minimum must exactly match minAmountOut. Request a new quote.")}else{let s=pe(_,F);if(BigInt(k)<BigInt(s))throw De(_,k)}let fe=a(a(b.fees).relayer),we=a(fe.currency),Q=await V(e,y,we,i,I(we.address)),Ie={token:Q,amount:l(fe.amount)},ge=a(L.refundCurrency),_e=a(ge.currency),z=await V(e,y,_e,i,r),se=l(ge.amount),K=a(a(b.protocol).v2);if(typeof K.orderId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(K.orderId))throw new t("Relay returned an invalid order ID.");let W=K.orderId.toLowerCase(),J=a(K.paymentDetails),$=j(J.depository);if(J.chainId!==p.chainId||$!==p.depository||I(J.currency)!==r||l(J.amount)!==d)throw new t("Relay payment details do not match the origin chain depository and input.");let U=a(K.orderData),v=a(U.output);if(v.chainId!=="robinhood"||!Array.isArray(v.calls)||v.calls.length!==0||!Array.isArray(v.payments)||v.payments.length!==1)throw new t("Relay order output does not match destination chain 4663.");let X=a(v.payments[0]);if(!f(X.recipient,m)||I(X.currency)!==g||l(X.minimumAmount)!==k||l(X.expectedAmount)!==_)throw new t("Relay order output payment does not match the quoted recipient and amounts.");let ae=Ne(v.deadline,"Relay order output deadline");if(!Array.isArray(U.inputs)||!U.inputs.length)throw new t("Relay order has no inputs.");let Z=[],de=[];for(let s of U.inputs){let u=a(s),T=a(u.payment);if(T.chainId!==p.chainId||I(T.currency)!==r||l(T.amount)!==d||!Array.isArray(u.refunds)||!u.refunds.length)throw new t("Relay order input does not match the quoted input.");for(let E of u.refunds){let h=a(E);if(!f(h.recipient,c))throw new t("Relay refund recipient does not match the agent wallet. Request a new quote.");if(Z.push(Ne(h.deadline,"Relay order refund deadline")),de.push(l(h.minimumAmount)),!(h.chainId===p.chainId?f(h.recipient,c)&&I(h.currency)===r:h.chainId==="robinhood"&&I(h.currency)===g))throw new t("Relay order refund terms do not match the sender or recipient.")}}let be=Math.min(ae,...Z),Y=0,Ae=()=>{let s=Math.floor(Date.now()/1e3),u=Y||s+Le;if(be-s<=Pe)throw new t("Relay order deadline is expired or too soon to sign safely. Request a new quote.");if(Y=Math.min(u,be-Pe),Y<=s)throw new t("Relay quote expired before signing. Request a new quote.")};if(Ae(),!Array.isArray(b.steps)||!b.steps.length)throw new t("Relay returned no origin transactions.");let x=[];for(let s of b.steps){let u=a(s);if(u.kind!=="transaction"||u.requestId!==P||!Array.isArray(u.items)||!u.items.length)throw new t("Relay returned an unsupported origin step.");for(let T of u.items){let E=a(T),h=a(E.data),ce=a(E.check);if(E.status!=="incomplete"||h.chainId!==i||!f(h.from,c))throw new t("Relay transaction does not match the origin chain and sender.");if(ce.method!=="GET"||ce.endpoint!==ye)throw new t("Relay status endpoint does not match the request ID.");x.push(e.unsignedTx({to:j(h.to),data:h.data,value:l(h.value),chainId:i,description:`Relay inbound deposit for request ${P}; destination chain 4663.`}))}}if(!x.length)throw new t("Relay returned no origin transactions.");if(r===q&&x.length!==1)throw new t("Relay native deposit must be a single depositNative transaction.");if(r!==q&&x.length>2)throw new t("Relay ERC-20 deposit allows at most one exact-amount approval before depositErc20.");for(let s of x.slice(0,-1)){if(!s.data.toLowerCase().startsWith("0x095ea7b3"))throw new t("Relay returned an unsupported prerequisite transaction.");let u=Se({abi:Oe,data:s.data});if(u.functionName!=="approve")throw new t("Relay returned an invalid approval.");let[T,E]=u.args;if(r===q||!f(s.to,r)||!f(T,$)||E!==BigInt(d)||s.value!=="0")throw new t("Relay approval must authorize the exact input amount for the origin depository.");s.description=`Approve exactly ${e.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`}let B=x[x.length-1],H=r===q,ee=H?"depositNative":"depositErc20",Re=H?"depositNative(address,bytes32)":"depositErc20(address,address,uint256,bytes32)";if(!f(B.to,$)||B.value!==(H?d:"0")||!(H?/^0x[0-9a-fA-F]{136}$/:/^0x[0-9a-fA-F]{264}$/).test(B.data))throw new t(`Relay deposit transaction does not target the origin depository with ${ee} calldata.`);let A;try{A=Se({abi:Te,data:B.data})}catch{throw new t(`Relay deposit transaction must call ${Re}.`)}if(A.functionName!==ee)throw new t(`Relay deposit transaction must call ${Re}.`);let Be=A.args[0],Me=A.functionName==="depositErc20"?A.args[3]:A.args[1];if(A.functionName==="depositErc20"&&(!f(A.args[1],r)||A.args[2]!==BigInt(d)))throw new t("Relay depositErc20 token or amount does not match the quoted input.");if(!f(Be,c)||Me.toLowerCase()!==W)throw new t(`Relay ${ee} depositor or orderId does not match the wallet and quoted protocol.v2.orderId.`);B.description=`Relay inbound ${ee} for order ${W} (request ${P}); destination chain 4663.`;let ue=H?[]:await Ee(e,r,$,d,i,c);for(let[s,u]of ue.entries())u.description=ue.length===2&&s===0?`Reset the existing ${N.symbol} allowance for ${$} on chain ${i} to zero.`:`Approve exactly ${e.formatAmount(d,N.decimals)} ${N.symbol} (${d} base units of ${r}) for ${$} on chain ${i}.`;let $e=[...D,...ue,B],qe=await e.preview($e,c);Ae();let je=qe.changes.map(s=>{let u=s.amount.startsWith("-");return`${u?"-":""}${e.formatAmount(u?s.amount.slice(1):s.amount,s.token.decimals)} ${s.token.symbol} (${s.token.address}, chain ${s.token.chainId})`});return{txs:$e,preview:qe,requestId:P,orderId:W,orderData:U,depository:$,originChainId:i,destinationChainId:R,recipient:m,amountIn:{token:N,amount:d},amountOut:{token:O,amount:_},minAmountOut:k,relayerFee:Ie,refundCurrency:{token:z,amount:se,minimumAmounts:de},orderDeadline:String(ae),refundDeadlines:Z.map(String),expiresAt:String(Y),status:"pending",statusEndpoint:ye,summary:`${D.length?"Swap prerequisite first, then ":""}Relay inbound from chain ${i} to chain 4663 for ${m}; expected ${e.formatAmount(_,O.decimals)} ${O.symbol}, minimum ${e.formatAmount(k,O.decimals)} ${O.symbol} (${O.address}). Quoted relay fee ${e.formatAmount(Ie.amount,Q.decimals)} ${Q.symbol} (${Q.address}, chain ${i}); output is net of quoted fees. Order ${W} (request ${P}); output deadline ${ae}, refund deadlines ${Z.join(", ")}, quote expires ${Y}. Refund terms: details.refundCurrency quotes ${e.formatAmount(se,z.decimals)} ${z.symbol} (${se} base units) on chain ${z.chainId} (${z.address}), but protocol.v2 order refund floor is ${de.join(", ")} base units. ${je.join("; ")}. Unsigned origin transactions only; destination fulfillment remains pending. Track with relay_status; timeout or refund is not fulfillment.`}}var rt=e=>({tools:[{name:"relay_bridge_in",inputSchema:{type:"object",additionalProperties:!1,required:["originChainId","amount"],properties:{originChainId:{type:"integer",minimum:1},destinationChainId:{const:R},originCurrency:G,destinationCurrency:G,amount:te(),minAmountOut:te(),slippageBps:{type:"integer",minimum:0,maximum:9999,default:me},recipient:G,swap:{type:"object",additionalProperties:!1,required:["from","amountIn"],properties:{from:{type:"object",additionalProperties:!1,required:["address","chainId","symbol","decimals"],properties:{address:G,chainId:{type:"integer",minimum:1},symbol:{type:"string"},decimals:{type:"integer",minimum:0,maximum:255}}},amountIn:te(),slippageBps:{type:"integer",minimum:0,maximum:1e4}}}}},async execute(o,c){try{return await Ue(e,o,c)}catch(i){throw new t(e.plainError(i))}}}]});export{nt as a,ot as b,it as c,rt as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./XSD5NL7J.js";var d=4663,r=46630,p=18,u=6,h=30,A="recipient",v="direct",P="totalSupply",o={4663:{layerbank:{pool:{address:"0x433e21dC2BF027910B1635653c2Eb630bC7dAD43",source:"https://docs.layerbank.finance/",pointer:"/robinhood/pool",block:null,blockKind:"read"},aToken:{address:"0xAd9b5C0ea95Cf998C1A31Aaa8aC7a24de94BeE69",source:"https://docs.layerbank.finance/",pointer:"/robinhood/USDG/aToken",block:null,blockKind:"read"}},pendle:{router:{address:"0x888888888889758F76e7103c6CbF23ABbF58F946",source:"https://docs.pendle.finance/",pointer:"/4663/router",block:null,blockKind:"read"},marketFactory:{address:"0x544BF81c855AE84c1e8b65d5E38770898D01EeE2",source:"https://docs.pendle.finance/",pointer:"/4663/marketFactory",block:null,blockKind:"read"}},pons:{factory:{address:"0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e",source:"Recorded chain and API observations",pointer:"/pons/factory",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},launchAndBuyRouter:{address:"0xe33E9E479dF8802cb0866d5d05258bEc4cF62948",source:"Recorded chain and API observations",pointer:"/pons/launchAndBuyRouter",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},memeHook:{address:"0xE5e702641Ea86F4ae6cC3cDaeD2B886f976Be044",source:"Recorded chain and API observations",pointer:"/pons/memeHook",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},feeEscrow:{address:"0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9e",source:"Recorded chain and API observations",pointer:"/pons/feeEscrow",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},buybackVault:{address:"0x42df2a798f82289E177311362e8f5ccC45c1219c",source:"Recorded chain and API observations",pointer:"/pons/buybackVault",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},locker:{address:"0x267444D099b10fB5Ed7c3Cc7B7c767AdcA574952",source:"Recorded chain and API observations",pointer:"/pons/locker",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},launchDeployer:{address:"0x3711ceA4feaDE896C913C68F01Eda97Cb06D1A42",source:"Recorded chain and API observations",pointer:"/pons/launchDeployer",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},graduationExecutor:{address:"0xC7819B64A1dAECD7eC19856d026cb14EfBd89046",source:"Recorded chain and API observations",pointer:"/pons/graduationExecutor",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},graduationGuard:{address:"0xf5695117b99B6f6401e67d4195BD653628176C6C",source:"Recorded chain and API observations",pointer:"/pons/graduationGuard",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},poolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/pons/poolManager",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},positionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/pons/positionManager",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"}},oracle:{ethUsdgPool:{address:"0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca",source:"Recorded chain and API observations",pointer:"/ethUsdgPool/address",block:"100307735",blockKind:"read",blockPointer:"/ethUsdgPool/rawReading/block"}},tokens:{USDG:{address:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",source:"Recorded chain and API observations",pointer:"/usdg/address",block:null,blockKind:"latest",caveat:"Token reads around head 100305826; not individually pinned (Part B section 1.2)."},WETH:{address:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",source:"Recorded chain and API observations",pointer:"/routers/wrappedNative",block:null,blockKind:"latest"}},routes:{kyberswap:{address:"0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",source:"Recorded chain and API observations",pointer:"/routers/kyberswap/router",block:null,blockKind:"latest",caveat:"Historical API target; validate each fresh quote/build chain and target."},velora:{address:"0x6a000f20005980200259b80c5102003040001068",source:"Recorded chain and API observations",pointer:"/routers/velora/router",block:null,blockKind:"latest",caveat:"Historical API target; validate each fresh quote/build chain and target."}},ponsClaims:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",source:"Recorded chain and API observations",pointer:"/addresses/multicall3/address",block:null,blockKind:"unanchored",caveat:"Code present in the source snapshot; exact code-read block not recorded."}},ponsTrade:{universal_router:{address:"0x204faca1764b154221e35c0d20abb3c525710498",source:"Recorded chain and API observations",pointer:"/contracts/universal_router/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},pool_manager:{address:"0x8366a39cc670b4001a1121b8f6a443a643e40951",source:"Recorded chain and API observations",pointer:"/contracts/pool_manager/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},state_view:{address:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",source:"Recorded chain and API observations",pointer:"/contracts/state_view/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},quoter:{address:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",source:"Recorded chain and API observations",pointer:"/contracts/quoter/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},permit2:{address:"0x000000000022d473030f116ddee9f6b43ac78ba3",source:"Recorded chain and API observations",pointer:"/contracts/permit2/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"}},uniswap:{v3_factory:{address:"0x1f7d7550b1b028f7571e69a784071f0205fd2efa",source:"Recorded chain and API observations",pointer:"/addresses/v3_factory/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},v3_position_manager:{address:"0x73991a25c818bf1f1128deaab1492d45638de0d3",source:"Recorded chain and API observations",pointer:"/addresses/v3_position_manager/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},v4_pool_manager:{address:"0x8366a39cc670b4001a1121b8f6a443a643e40951",source:"Recorded chain and API observations",pointer:"/addresses/v4_pool_manager/address",block:"100363029",blockKind:"snapshot",blockPointer:"/snapshots/v4_block"},v4_position_manager:{address:"0x58daec3116aae6d93017baaea7749052e8a04fa7",source:"Recorded chain and API observations",pointer:"/addresses/v4_position_manager/address",block:"100363029",blockKind:"snapshot",blockPointer:"/snapshots/v4_block"},v4_state_view:{address:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",source:"Recorded chain and API observations",pointer:"/addresses/v4_state_view/address",block:"100363029",blockKind:"snapshot",blockPointer:"/snapshots/v4_block"},swap_router02:{address:"0xcaf681a66d020601342297493863e78c959e5cb2",source:"Recorded chain and API observations",pointer:"/addresses/swap_router02/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},permit2:{address:"0x000000000022d473030f116ddee9f6b43ac78ba3",source:"Recorded chain and API observations",pointer:"/addresses/permit2/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},WETH:{address:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",source:"Recorded chain and API observations",pointer:"/addresses/WETH/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},USDG:{address:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",source:"Recorded chain and API observations",pointer:"/addresses/USDG/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"}},clanker:{factory:{address:"0xD3f2cC1731b7Fd17f28798835C2E02f0a1839A94",source:"Recorded chain and API observations",pointer:"/contracts/factory/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},locker:{address:"0xE4910b09709423aFafD995dD76D8A81CF9134A09",source:"Recorded chain and API observations",pointer:"/contracts/locker/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},legacy_locker_v1:{address:"0x290f735f63824bb5836cde24a35f5103a5b5bc99",source:"Recorded chain and API observations",pointer:"/contracts/legacy_locker_v1/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},fee_locker:{address:"0x88db2340bE5991B2b5Fca2Baee39B5CE048Cd70c",source:"Recorded chain and API observations",pointer:"/contracts/fee_locker/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},fee_static_hook_v2:{address:"0x48B8F6AD3A1b4aA477314c9a23035b8F84dDe8cc",source:"Recorded chain and API observations",pointer:"/contracts/fee_static_hook_v2/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},fee_dynamic_hook_v2:{address:"0x65efDF8Cce99b53C925DF878Df275Df21cB6E8Cc",source:"Recorded chain and API observations",pointer:"/contracts/fee_dynamic_hook_v2/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},mev_module:{address:"0xEA1Fe197dF140e5d88fC6B49f2d21Ea05092299e",source:"Recorded chain and API observations",pointer:"/contracts/mev_module/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},devbuy:{address:"0xa27b1986e5c7e5371Cb6507f87918fBD0302fF5a",source:"Recorded chain and API observations",pointer:"/contracts/devbuy/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},vault:{address:"0x99B2a80ed21c7af1F5cc1A97383DADeEC7DD1427",source:"Recorded chain and API observations",pointer:"/contracts/vault/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},airdrop:{address:"0x6f27372FF493A3855E6746b9a4fe6Ed2Cc3034B5",source:"Recorded chain and API observations",pointer:"/contracts/airdrop/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},paired_weth:{address:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",source:"Recorded chain and API observations",pointer:"/contracts/paired_weth/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"}},clankerDependencies:{pool_manager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/pool_manager/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},position_manager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/position_manager/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},universal_router:{address:"0x53BF6B0684Ec7eF91e1387Da3D1a1769bC5A6F77",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/universal_router/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/permit2/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"}},hoodag:{registry:{address:"0x3E717dc89AAF4605b607324329EEeB0a8B3C8A1c",source:"Recorded chain and API observations",pointer:"/contracts/registry/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},universalResolver:{address:"0xa9ed3C73F522875F18DAa631429125da893D8E53",source:"Recorded chain and API observations",pointer:"/contracts/universalResolver/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},registrar:{address:"0x9a122C54e15B6287c164b90833bcDA6E16520D50",source:"Recorded chain and API observations",pointer:"/contracts/registrar/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},publicResolver:{address:"0x072C7a66a6D52B23274470b86096AFCBF816CA0B",source:"Recorded chain and API observations",pointer:"/contracts/publicResolver/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},registrarController:{address:"0x7900b2B8Cc3f0616B18C68AdA7E115A9022Ca04a",source:"Recorded chain and API observations",pointer:"/contracts/registrarController/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},reverseRegistrar:{address:"0x4be6D0379f56404B563afAe17c6b095b1dfcf479",source:"Recorded chain and API observations",pointer:"/contracts/reverseRegistrar/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"}},hoodlock:{locker:{address:"0xd0f7d8c6e9f6d80c297bebe4f7fd1b9c8125c32f",source:"Recorded chain and API observations",pointer:"/contracts/locker/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"},burner:{address:"0x6bf43ca706faa8ea46803299c191484e82280652",source:"Recorded chain and API observations",pointer:"/contracts/burner/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"},airdrop:{address:"0x6B1fE7b821001144Ee74EEA258b0AafdE20102E8",source:"Recorded chain and API observations",pointer:"/contracts/airdrop/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"},liquidityLocker:{address:"0x91Aa2dA1956C77F8448E18DCaf53383bCc658e67",source:"Recorded chain and API observations",pointer:"/contracts/liquidityLocker/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"}},hookrLauncherV1:{launcherV1:{address:"0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/launcherV1",block:"104346779",blockKind:"read"},rootV1:{address:"0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/rootV1",block:"104346779",blockKind:"read"},rulesV1:{address:"0x342bAA22e202954593b04B7eD1663621E0565d46",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/rulesV1",block:"104346779",blockKind:"read"},agentGateV1:{address:"0x3b1aC66a6Fd9e9d8F063d145003cf29eac4Fb0C9",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/agentGateV1",block:"104346779",blockKind:"read"},familyRouterV1:{address:"0xbc56F48f873841d26a5a02575263d82f68e12864",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/familyRouterV1",block:"104346779",blockKind:"read"},familyLockV1:{address:"0x5248AF9139DaDEf0C5296342b7BE441deDf0adC2",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/familyLockV1",block:"104346779",blockKind:"read"},poolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/poolManager",block:"104346779",blockKind:"read"},positionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/positionManager",block:"104346779",blockKind:"read"},permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/permit2",block:"104346779",blockKind:"read"},registry:{address:"0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/registry",block:"104346779",blockKind:"read"},router:{address:"0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/router",block:"104346779",blockKind:"read"},identity:{address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/identity",block:"104346779",blockKind:"read"},reputation:{address:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/reputation",block:"104346779",blockKind:"read"}},hookr:{HookrLimitOrders:{address:"0x0c376cc30b1AC98b8ef80a4F516212D3B99402fA",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrLimitOrders/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRoot:{address:"0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRoot/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRouter:{address:"0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRouter/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrQuoter:{address:"0x445D7891381Aa7F91F5048EdBC6a611ccBDe7865",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrQuoter/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrLauncher:{address:"0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrLauncher/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRules:{address:"0x4a71c270b1520F94064268102AebD744b0DE7942",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRules/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRegistry:{address:"0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRegistry/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrTreasury:{address:"0x2242F7FC75606500503075f29ea8cDA684EfB4a9",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrTreasury/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrForwarder:{address:"0xe7863CC0E2Fb783b44c279aB159bcD812c2ceA1c",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrForwarder/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrOwnedRootFactory:{address:"0xA6c2a401597301dFf57A59bC8F70a9622499f3ec",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrOwnedRootFactory/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRootFactory:{address:"0x21E438FaBE10770afb4407cF6b09d32369CBdCE4",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRootFactory/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrFamilyRouter:{address:"0x854f3Fa7AC342B244DF0d9A8c8F597b051aAE559",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrFamilyRouter/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrFamilyLock:{address:"0xfAFEcE64099C1E791C4B46189c277f00c0c7e00b",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrFamilyLock/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},PoolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/PoolManager/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HOOKR_Token:{address:"0x18E674231A58c239Dc7DaeDcffE15Ec3A24cff5c",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HOOKR_Token/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"}},merkl:{distributor:{address:"0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae",source:"Recorded chain and API observations",pointer:"/contracts/distributor/address",block:null,blockKind:"latest"},distributionCreator:{address:"0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd",source:"Recorded chain and API observations",pointer:"/contracts/distributionCreator/address",block:null,blockKind:"latest"},accessControlManager:{address:"0x5D36e13F076f34eE2Bf69fEAEa784887754465f8",source:"Recorded chain and API observations",pointer:"/contracts/accessControlManager/address",block:null,blockKind:"latest"}},poolsTrade:{liquidityLauncher:{address:"0x0000FffFBE8efE702c8703aE3477FF5dE3d319C0",source:"Recorded chain and API observations",pointer:"/contracts/liquidityLauncher/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},instantLaunchStrategyFeesOn:{address:"0x7c48DDe3B447381F4d986334679b3Afc7F2D35C2",source:"Recorded chain and API observations",pointer:"/contracts/instantLaunchStrategyFeesOn/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},instantLaunchStrategyFeesOff:{address:"0xC9566675b1Ea42861546f3c5B74Ace2c79c49572",source:"Recorded chain and API observations",pointer:"/contracts/instantLaunchStrategyFeesOff/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},feeSplitterFeesOn:{address:"0x9411fa7F956f64aa7981AA27cB3bC6eC0415449C",source:"Recorded chain and API observations",pointer:"/contracts/feeSplitterFeesOn/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},feeSplitterFeesOff:{address:"0x882Ae5e2095435A62Fd1BBDEfcb637f5CeAFc0ee",source:"Recorded chain and API observations",pointer:"/contracts/feeSplitterFeesOff/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},uerc20BeneficiaryVault:{address:"0x26d2F7AcB07707034406a0dC458351Bb63C02553",source:"Recorded chain and API observations",pointer:"/contracts/uerc20BeneficiaryVault/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},compoundingClaimRecipient:{address:"0xf585b5D728A8fdE743027307BF5F3556E3B9C58D",source:"Recorded chain and API observations",pointer:"/contracts/compoundingClaimRecipient/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},universalRouterStrategyApp:{address:"0x1242c9439d589cAE85E121B1f79f2aF51e91DCEE",source:"Recorded chain and API observations",pointer:"/contracts/universalRouterStrategyApp/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},uerc20Factory:{address:"0x000000e200088D55C39a11F609E5F667729ad49b",source:"Recorded chain and API observations",pointer:"/contracts/uerc20Factory/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},universalRouter:{address:"0x8876789976dEcBfCbBbe364623C63652db8C0904",source:"Recorded chain and API observations",pointer:"/contracts/universalRouter/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},v4PoolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/contracts/v4PoolManager/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},v4PositionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/contracts/v4PositionManager/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Recorded chain and API observations",pointer:"/contracts/permit2/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},v4Quoter:{address:"0x8Dc178eFB8111BB0973Dd9d722ebeFF267c98F94",source:"Recorded chain and API observations",pointer:"/contracts/v4Quoter/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},protocolFeeController:{address:"0x6d0009504D129CF5002Dba61D9Ae8575AA79314c",source:"Recorded chain and API observations",pointer:"/contracts/protocolFeeController/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"}},priors:{pool:{address:"0x281210097f0de7A8FB6F87310AF0f089c9C8DE21",source:"Recorded chain and API observations",pointer:"/contracts/pool/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},lens:{address:"0x9d7035722bd42C551f82FEB9FDDd17453AEF3D9B",source:"Recorded chain and API observations",pointer:"/contracts/lens/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},usdg:{address:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",source:"Recorded chain and API observations",pointer:"/contracts/usdg/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},registry:{address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",source:"Recorded chain and API observations",pointer:"/contracts/registry/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},stockVault:{address:"0xbEcd07EC689988e16b870C121756C4c2C8cb02B6",source:"Recorded chain and API observations",pointer:"/contracts/stockVault/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"}},morpho:{morpho_blue:{address:"0x9D53d5E3bd5E8d4Cbfa6DB1ca238AEA02E651010",source:"Recorded chain and API observations",pointer:"/addresses/morpho_blue/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"},adaptive_curve_irm:{address:"0x2BD3d5965B26B51814AC95127B2b80dD6CcC0fa1",source:"Recorded chain and API observations",pointer:"/addresses/adaptive_curve_irm/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"},USDG:{address:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",source:"Recorded chain and API observations",pointer:"/addresses/USDG/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"},WETH:{address:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",source:"Recorded chain and API observations",pointer:"/addresses/WETH/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"}},tickerSpring:{limitOrderHook:{address:"0xa31729621a2280C0Ff9Aaff5B3F357cFF1bEC040",source:"Recorded chain and API observations",pointer:"/liveness/contracts/limitOrderHook/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},gridStrategy:{address:"0xd597785134307B5324f469A9506066fAd4827730",source:"Recorded chain and API observations",pointer:"/liveness/contracts/gridStrategy/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},ladderStrategy:{address:"0x23c7906D8fa3ede698A00AbE66D28605A41b4177",source:"Recorded chain and API observations",pointer:"/liveness/contracts/ladderStrategy/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},basketZap:{address:"0xFca65c50325b83F8f1E07cD103c00De0cEa4Fb39",source:"Recorded chain and API observations",pointer:"/liveness/contracts/basketZap/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},usdg:{address:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",source:"Recorded chain and API observations",pointer:"/liveness/contracts/usdg/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"}},orbio:{credit:{address:"0xe33322da1380e61e5ae5dfb21e7f62924c73004c",source:"Recorded chain and API observations",pointer:"/orbio/credit/address",block:"100313751",blockKind:"fork",caveat:"Fork anchor block recorded from chain observations; individual code reads were latest."},exchange:{address:"0x6951ffd32630b05e06f50062aea801625a58ebc0",source:"Recorded chain and API observations",pointer:"/orbio/exchange/address",block:"100313751",blockKind:"fork",caveat:"Fork anchor block recorded from chain observations; individual code reads were latest."}},vaults:{steakhouse:{address:"0xBeEff033F34C046626B8D0A041844C5d1A5409dd",source:"Recorded chain and API observations",pointer:"/vaults/eligible/0/address",block:"100320900",blockKind:"read",blockPointer:"/vaults/verifiedAtBlock",caveat:"Historical eligibility only; recheck asset and >=1e12 USDG totalAssets on every listing."},spark:{address:"0xde770c84fe66e063336b31737cfe9790f18c4087",source:"Recorded chain and API observations",pointer:"/vaults/eligible/1/address",block:"100320900",blockKind:"read",blockPointer:"/vaults/verifiedAtBlock",caveat:"Historical eligibility only; recheck asset and >=1e12 USDG totalAssets on every listing."},netnet:{address:"0x99347d5F70D3838763f6Bddcf80304C8aa953B57",source:"Recorded chain and API observations",pointer:"/vaults/eligible/2/address",block:"100320900",blockKind:"read",blockPointer:"/vaults/verifiedAtBlock",caveat:"Historical eligibility only; recheck asset and >=1e12 USDG totalAssets on every listing."},morphoV2Factory:{address:"0x0fbad98595b0186da120e41f77c102beb49f803c",source:"Recorded chain and API observations",pointer:"/vaults/morphoVaultV2Factory",block:null,blockKind:"latest"},longbowCore:{address:"0x026df18fbd2A7639089D0a16293383ec687A5Ca1",source:"Recorded chain and API observations",pointer:"/projects/0/deployments/0/address",block:"100355967",blockKind:"read",blockPointer:"/projects/0/deployments/0/read_block",caveat:"Below USDG threshold or wrong asset at measurement; deployment context only."},longbowFrontier:{address:"0x65dC90cd3a0BCDE967c8AE6019d6790b616E78F7",source:"Recorded chain and API observations",pointer:"/projects/0/deployments/1/address",block:"100355967",blockKind:"read",blockPointer:"/projects/0/deployments/1/read_block",caveat:"Below USDG threshold or wrong asset at measurement; deployment context only."},longbowEth:{address:"0xe129D4Cb2d454C4ACFAc909d1576453A9b835f61",source:"Recorded chain and API observations",pointer:"/projects/0/deployments/2/address",block:"100355967",blockKind:"read",blockPointer:"/projects/0/deployments/2/read_block",caveat:"Below USDG threshold or wrong asset at measurement; deployment context only."},beefyTestedLpVault:{address:"0xC447184BF75a84Ace3087515CCFFb54937838FC8",source:"Recorded chain and API observations",pointer:"/projects/1/tested_lp_vault",block:"100357163",blockKind:"fork",blockPointer:"/fork_environment/fork_block",caveat:"LP adapter only; not an eligible USDG ERC-4626 vault. Other per-vault/strategy addresses remain dynamic."},groveAlm:{address:"0xBEEff039907422219Fb367e525954DDC092854d9",source:"Recorded chain and API observations",pointer:"/projects/2/address",block:"100355967",blockKind:"read",blockPointer:"/raw_reads/longbow_grove_control/4/block",caveat:"Public Grove x Steakhouse USDG ERC-4626 vault; below $1M USDG threshold at measurement."}},identity:{identityRegistry:{address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",source:"Recorded chain and API observations",pointer:"/erc8004/identityRegistry",block:null,blockKind:"latest"},reputationRegistry:{address:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",source:"Recorded chain and API observations",pointer:"/erc8004/reputationRegistry",block:null,blockKind:"latest"},validationRegistry:{address:"0x8004Cc8439f36fd5F9F049D9fF86523Df6dAAB58",source:"Recorded chain and API observations",pointer:"/erc8004/validationRegistry",block:null,blockKind:"latest"}},meridian:{PredictionMarketEscrow:{address:"0xE4cea507b19796362A5a28Fa7cb705A3F1866213",source:"Recorded chain and API observations",pointer:"/addresses/PredictionMarketEscrow/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."},SecondaryMarketEscrow:{address:"0x7E318ef37c3bC3d0cBA205Af2D1Fc9F9CeFEB5df",source:"Recorded chain and API observations",pointer:"/addresses/SecondaryMarketEscrow/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."},MeridianRobinhoodVault:{address:"0x79cB914f3F336426E89FaB55A9488AB25770552D",source:"Recorded chain and API observations",pointer:"/addresses/MeridianRobinhoodVault/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."},CollateralToken_USDe:{address:"0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34",source:"Recorded chain and API observations",pointer:"/addresses/CollateralToken_USDe/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."}},relay:{depository:{address:"0x4cd00e387622c35bddb9b4c962c136462338bc31",source:"Recorded chain and API observations",pointer:"/addresses/depository_4663",block:"100355691",blockKind:"fork",blockPointer:"/fork/fork_block",caveat:"Only quoted depositNative path fork-tested; bridge settlement is external and unmeasured."}},lighter:{settlement:{address:"0x94bAB9693Ba2f6358507eFfcbd372b0660AFfF9d",source:"Recorded chain and API observations",pointer:"/contracts_on_4663/lighter_rh_settlement_proxy/address",block:"100355574",blockKind:"read",blockPointer:"/block_number",caveat:"Settlement/custody metadata only; funding tool uses HTTP, not this contract."}},heyResearch:{heyToken:{address:"0xB33eb16782776b4D738c0Fd643577cb0284Db610",source:"Recorded chain and API observations",pointer:"/addresses/heyToken/address",block:null,blockKind:"unanchored",caveat:"API-only tools; source has time range but no block anchor."}}},46630:{deployments:{test_USDG:{address:"0x7E955252E15c84f5768B83c41a71F9eba181802F",source:"Recorded chain and API observations",pointer:"/code_probes/0/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/0/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_WETH:{address:"0x7943e237c7F95DA44E0301572D358911207852Fa",source:"Recorded chain and API observations",pointer:"/code_probes/1/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/1/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_gateway:{address:"0x77bF00A6A90c600f214b34BAFBB7918c0cF113A8",source:"Recorded chain and API observations",pointer:"/code_probes/2/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/2/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_identity:{address:"0x8004A818BFB912233c491871b3d84c89A494BD9e",source:"Recorded chain and API observations",pointer:"/code_probes/3/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/3/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_USDG_implementation:{address:"0xf0863d7a29a55d0c4263c11bfac754312ff078df",source:"Recorded chain and API observations",pointer:"/code_probes/15/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/15/block",caveat:"Code presence alone does not establish a complete testnet integration."},facet_0xef55bec6:{address:"0x08f560a85db40a7d4ac49b4F44f1D38e5B8aB811",source:"Recorded chain and API observations",pointer:"/code_probes/17/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/17/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v4_production_poolmanager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/code_probes/22/address",block:"144389821",blockKind:"read",blockPointer:"/code_probes/22/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v3_community_test_candidate:{address:"0xFECCB63CD759d768538458Ea56F47eA8004323c1",source:"Recorded chain and API observations",pointer:"/code_probes/50/address",block:"144389821",blockKind:"read",blockPointer:"/code_probes/50/block",caveat:"Community v3 is not canonically endorsed; v4 native stack is incomplete."},Uniswap_v4_PositionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/code_probes/52/address",block:"144390120",blockKind:"read",blockPointer:"/code_probes/52/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v4_Quoter:{address:"0x8Dc178eFB8111BB0973Dd9d722ebeFF267c98F94",source:"Recorded chain and API observations",pointer:"/code_probes/54/address",block:"144390120",blockKind:"read",blockPointer:"/code_probes/54/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v4_StateView:{address:"0xF3334192D15450CdD385c8B70e03f9A6bD9E673b",source:"Recorded chain and API observations",pointer:"/code_probes/56/address",block:"144390120",blockKind:"read",blockPointer:"/code_probes/56/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_Permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Recorded chain and API observations",pointer:"/code_probes/77/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/77/block",caveat:"Code presence alone does not establish a complete testnet integration."},v3_test_WETH9:{address:"0x37E402B8081eFcE1D82A09a066512278006e4691",source:"Recorded chain and API observations",pointer:"/code_probes/78/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/78/block",caveat:"Community v3 is not canonically endorsed; v4 native stack is incomplete."}}}},t=o[4663].tokens.USDG.address,i=o[46630].deployments.test_USDG.address,x=o[4663].pons.factory.address,m=o[4663].pons.memeHook.address,_=o[4663].pons.poolManager.address,R=o[4663].pons.feeEscrow.address,C=o[4663].oracle.ethUsdgPool.address,b={name:"Global Dollar",version:"1",chainId:d,verifyingContract:t},l={name:"Global Dollar",version:"1",chainId:r,verifyingContract:i},c={mainnet:{chainId:d,usdg:t,usdgDomain:b,weth:o[d].tokens.WETH.address,identityRegistry:o[d].identity.identityRegistry.address},testnet:{chainId:r,usdg:i,usdgDomain:l,weth:o[r].deployments.test_WETH.address,identityRegistry:o[r].deployments.test_identity.address}};function E(e="mainnet"){if(e!=="mainnet"&&e!=="testnet")throw new a("Set OAK_NETWORK to mainnet or testnet.");return e}function F(e,s){if(s.toLowerCase()!==c[e].usdg.toLowerCase())throw new a(`USDG does not match the pinned ${e} deployment on chain ${c[e].chainId}.`)}async function B(e,s){let n=await s.getChainId();if(n!==c[e].chainId)throw new a(`RPC chain ${n} does not match OAK_NETWORK ${e} (chain ${c[e].chainId}).`)}var y={4663:{kyberswap:"0xe21fd0e9",velora:"0xe3ead59e"}},k={4663:{kyberswap:{address:"0x8F10B468b06c6FD214B65F87778827F7D113f996",source:"https://raw.githubusercontent.com/KyberNetwork/kyberswap-documentation/main/developer-guide/aggregator-api/contracts.md",pointer:"Robinhood / AggregationExecutorProxy",block:"100861304",blockKind:"read",caveat:"Corroborated by successful transaction 0x4a2474960f846f412d4d1cbdebb86727c81f92a0859ad743425fdc544d8973e8; approveTarget is zero."},velora:{address:"0x006d0e0d006109f0020f3050000a713780b7b000",source:"https://rpc.mainnet.chain.robinhood.com",pointer:"eth_getTransactionByHash / 0x70bc411f8427d622798ff82e6088d6cf3c011ae04b063c731664215f982ecfba / input / executor",block:"100861280",blockKind:"read",caveat:"Observed v6.2 executor, corroborated by six fresh Velora builds on 2026-10-29; no vendor executor list for 4663. Inner route targets vary; this pin does not authenticate them."}}},D=BigInt("0x45a6e007c874ffc6321d6fb90eac272dd6864bfa")<<96n|1n<<92n|1n,g=[k[4663].velora.address,"0x082738d007001080a00099a000004f3006152085"],I=[{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x1266261289d815650a6bcdb308766be36efa8149",codeHash:"0xa38c335d383c1ac060df1f3f4687917a6da673bbf6e37a3b5241b49760194d6d"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x3e2db9ed1693964d599dfeba87181a36fffc8ed8",codeHash:"0xbc971642d398135438c4d2cf9f2229ffe5f8c321584673c4a2535b6df47c01ef"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x664aafe2bd40e581aa4f8c5a594c9ee168b92d4f",codeHash:"0xda9b31df9b098e520e7f6a5b94356920d32a66c736c8788cf2af3035781babc9"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x9d215290f43366bbceff40a79fbac9dd23325379",codeHash:"0x8d15c4f2b99c6b24daa0f2383c0cfd998879b89b36e9359b18345fc9e7686333"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0xa685fc7cef9eb4c1e8337f11019aeba111e48c31",codeHash:"0xd5cb6ac468476cda0e4069cb53097412c45dc4fcc23d61db05426e8047aa7a9b"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0xf475964cb5235641f23e99c8d7828996c4289ac4",codeHash:"0x399cd0fb5f0a36db2d3221fab8d04c78c88239a128c9463f6c27aa2120a1f6ff"}],K=[{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x0a48ea27489881d84288776d1e0588d633945ad6",proxyCodeHash:"0xd460046af3bffad2aa81503173711d1b70a88a56155b8d0cd0ca53a3fee23078",implementation:"0xcf319d0021dfde8c676a54f8a36ead8fd2e48984",codeHash:"0x503caa96fd60bb34d6c4e290019d4f931bc36340b8e07b669f0e99059055d092"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxyCodeHash:"0xd460046af3bffad2aa81503173711d1b70a88a56155b8d0cd0ca53a3fee23078",implementation:"0x50fa4b08d75586603d678fadbeabf1f4d8d2113b",codeHash:"0xa157bf9c94b218a72d8ebe2c4321817d5d53a58e81553928c2a8cbfaf9edb628"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxyCodeHash:"0xd460046af3bffad2aa81503173711d1b70a88a56155b8d0cd0ca53a3fee23078",implementation:"0xb8ea4704fe518c5ccbf429fc6db1b2c4c4ca7193",codeHash:"0x5577c0b6a060fce1ceffb8ef0c80305bf8391d7af789742c8d1f2d00457aa955"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x5685f0b21126d87f60810780ce23c43ea45cb61e",proxyCodeHash:"0xd8500e5bf9af5e118e73c61f9c78ad630740b50d86cf38aaa26543a239cb1db2",implementation:"0xb20e7d58987b2b606d242f220cdb8cd9c676b526",codeHash:"0xbccc9c0d786a46f9d9810fb887905cc89ba453c5d2a1d9846e2267f71bfa877d"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0xad9b5c0ea95cf998c1a31aaa8ac7a24de94bee69",proxyCodeHash:"0xd8500e5bf9af5e118e73c61f9c78ad630740b50d86cf38aaa26543a239cb1db2",implementation:"0x0a75d1a1800e98fb0df13cdb4ecee3e4ea1685ca",codeHash:"0xaac5c7ab1c270883872ca5817bc80aca7cdce1ad8500acbe02e2943465fe9d36"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",proxyCodeHash:"0x864cc9ad53b338b82da1f7cab85ab0b3d5c8861acb422b6fec63cf36234f36a6",implementation:"0x68184c449e1a8f34fa18d289737129fd27b66f8f",codeHash:"0x3a551ac5c744af57e68a1d1431ac403c0f516ffd7d224a75746aee11fc4f3baf"}];export{d as a,r as b,p as c,u as d,h as e,A as f,v as g,P as h,o as i,t as j,i as k,x as l,m,_ as n,R as o,C as p,b as q,l as r,c as s,E as t,F as u,B as v,y as w,k as x,D as y,g as z,I as A,K as B};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Re,d as je,e as qe,f as ye,i as Le,j as ze}from"./6B3VVISQ.js";import{i as ce}from"./57MEFFCU.js";import{b as Ie,o as Ce}from"./3NJ5KQ3Q.js";import{a as ae}from"./3MLUCYCB.js";import{a as T,b as Oe}from"./43LI5NKJ.js";import{a as L}from"./66F5ZH34.js";import{b as U}from"./IX3GZMTM.js";import{a as m,d as Xe,i as Q,j as Be}from"./FWD4L3CJ.js";import{a as o,b as He,e as ee}from"./XSD5NL7J.js";import{encodeAbiParameters as A,encodeFunctionData as ne,erc20Abi as We,getAddress as y,isAddress as In,keccak256 as Cn,pad as qn,parseAbi as Pe,parseAbiParameters as B,toEventSelector as Ln,toHex as Ge}from"viem";var Tn=y(Q[4663].uniswap.v4_pool_manager.address),$=y(Q[4663].uniswap.v4_position_manager.address),le=y(Q[4663].uniswap.v4_state_view.address),_e=y(Q[4663].uniswap.permit2.address),lt=y(Q[4663].ponsTrade.universal_router.address),te=y(Q[4663].uniswap.WETH.address),E=y(Be),k="0x0000000000000000000000000000000000000000",Ue=8388608,Ee=-887272,ke=887272,mn=(1n<<48n)-1n,J=(1n<<128n)-1n,$n=(1n<<160n)-1n,ue=1n<<96n,Ze=1800n,yn=50n,Ye=e=>e*(10000n-yn)/10000n,Qe=(e,n)=>{let i=(e*(10000n+yn)+9999n)/10000n;return i<n?i:n},Mn="0xbac3aa3b91584a53a579b3c999a56756e954e59247e497bad1d25a4334bde551",Ke=[{poolId:"0xbac3aa3b91584a53a579b3c999a56756e954e59247e497bad1d25a4334bde551",key:{currency0:k,currency1:E,fee:8388608,tickSpacing:10,hooks:y("0x06a889870c8f83640d6816319f72e2aa579b6080")},liquidity:"5532026605872066941",sqrtPriceX96:"3839897026469220985301794",tick:-198703,protocolFee:0,lpFee:0},{poolId:"0x387bf619da4d3fb62bb276482693dba1b9b3520f573cabdfe033384a24125982",key:{currency0:k,currency1:E,fee:500,tickSpacing:10,hooks:k},liquidity:"225820987949255613",sqrtPriceX96:"3840577772610961024680304",tick:-198700,protocolFee:512125,lpFee:500},{poolId:"0x54f7883914619af9105355bf83ed678bcf9f63560218ac61c9963b9503d0ba32",key:{currency0:k,currency1:E,fee:460,tickSpacing:9,hooks:k},liquidity:"85654324417347171",sqrtPriceX96:"3840419018843648722761192",tick:-198701,protocolFee:479349,lpFee:460},{poolId:"0xc7b615a3721594f73664eb3f62d8290d0fcc8d9d1156aed1ddecbd7f32efd9f5",key:{currency0:k,currency1:E,fee:8388608,tickSpacing:10,hooks:y("0xcb787a5cdea8b3715d984d82f1203fd7bfebe0c4")},liquidity:"50517446454827887",sqrtPriceX96:"3840495145865430860317598",tick:-198700,protocolFee:0,lpFee:0},{poolId:"0x24107d152f14a76d292123265ae3f3c71f863fc2f4ef7ba49d64e78d28ea379e",key:{currency0:k,currency1:E,fee:100,tickSpacing:1,hooks:k},liquidity:"36478878201789434",sqrtPriceX96:"3840363370720475418748563",tick:-198701,protocolFee:102425,lpFee:100},{poolId:"0x84bd4e2d8be11aeb0afc1195b38f587b61e90068548f1063fdbe448fb8cad0b6",key:{currency0:te,currency1:E,fee:200,tickSpacing:4,hooks:k},liquidity:"5980655057479791",sqrtPriceX96:"3839891926195366283625355",tick:-198703,protocolFee:213044,lpFee:200},{poolId:"0x3b0cbf0603ecc67b5fc9bb4fbb6ac9e08d3b2f406b63d1662a36063a7fe5e866",key:{currency0:k,currency1:E,fee:87,tickSpacing:1,hooks:k},liquidity:"5486760264498148",sqrtPriceX96:"3840563617639470134132117",tick:-198700,protocolFee:90134,lpFee:87}],Ne=y("0x987e330f00b79864a07fe81dfac344d0078abcc0"),wn="0xa791e5169faf703c0b63fd9552c33ec1128a773a00f5dc33a640da62a022cd35",_n={currency0:k,currency1:E,fee:Ue,tickSpacing:1,hooks:Ne},En=new Set([...Ke.map(e=>e.key.hooks.toLowerCase()),Ne.toLowerCase()]),Dn=B("address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks"),Un=B("(address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) poolKey, int24 tickLower, int24 tickUpper, uint256 liquidity, uint128 amount0Max, uint128 amount1Max, address owner, bytes hookData"),Kn=B("address currency0, address currency1"),Nn=B("address currency, address recipient"),we=B("uint256 tokenId, uint256 liquidity, uint128 amount0Min, uint128 amount1Min, bytes hookData"),Fn=B("uint256 tokenId, uint128 amount0Min, uint128 amount1Min, bytes hookData"),Te=B("address currency0, address currency1, address recipient"),de=B("bytes actions, bytes[] params"),F=Pe(["function modifyLiquidities(bytes unlockData, uint256 deadline) payable","function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)","function getPositionLiquidity(uint256 tokenId) view returns (uint128 liquidity)","function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) poolKey, uint256 info)","function positionInfo(uint256 tokenId) view returns (uint256 info)","function ownerOf(uint256 tokenId) view returns (address owner)","function nextTokenId() view returns (uint256 tokenId)"]),Vn=Pe(["function initialize((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, uint160 sqrtPriceX96) returns (int24 tick)"]),Je=B("address currency"),en=1e6,pe=Pe(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Hn=Pe(["function approve(address token, address spender, uint160 amount, uint48 expiration)"]),Xn=Ln("Transfer(address,address,uint256)");function he(e){if(typeof e!="string"||!In(e,{strict:!1}))throw new o("Provide a valid v4 currency address.");let n=e.toLowerCase();return n===k||n===ae.toLowerCase()?k:y(e)}function X(e){let n=e.toLowerCase();return n===k||n===ae.toLowerCase()}function fe(e){let n=he(e.currency0),i=he(e.currency1);T(e.hooks);let r=y(e.hooks);return Cn(A(Dn,[n,i,e.fee,e.tickSpacing,r]))}function bn(e){return((typeof e=="number"?e:e.fee)&Ue)!==0}function nn(e,n){return bn(e)?{dynamicFee:!0,storedLpFee:n,swapsAreFree:!1,feeNote:"Pool uses dynamic fee flag 0x800000; stored lpFee=0 does not mean swaps are free. The hook determines the swap fee; a past observation is not a current quote."}:{dynamicFee:!1,storedLpFee:n,swapsAreFree:n===0,feeNote:`Static LP fee ${n} pips.`}}function be(e,n){if(!e||typeof e!="object")throw new o("Provide a valid v4 PoolKey.");let i=he(e.currency0),r=he(e.currency1);if(BigInt(i)>=BigInt(r))throw new o("PoolKey currencies must be strictly sorted (currency0 < currency1).");if(!Number.isInteger(e.tickSpacing)||e.tickSpacing<=0||e.tickSpacing>32767)throw new o("PoolKey tickSpacing must be a positive integer.");if(!Number.isInteger(e.fee)||e.fee<0||e.fee>16777215)throw new o("PoolKey fee must be a valid uint24.");T(e.hooks);let c=y(e.hooks),s=bn(e.fee);if(!s&&e.fee>en)throw new o(`PoolKey static fee ${e.fee} exceeds the v4 maximum of ${en} pips (100%).`);if(s&&e.fee!==Ue)throw new o("Dynamic-fee PoolKey must use exact fee flag 0x800000 (8388608).");if(s&&c.toLowerCase()===k)throw new o("Dynamic-fee PoolKey requires a non-zero hook address.");if(!En.has(c.toLowerCase()))throw new o(`Unsupported v4 hook ${c}: Oak does not assure arbitrary v4 hooks outside measured PoolKeys.`);let t={currency0:i,currency1:r,fee:e.fee,tickSpacing:e.tickSpacing,hooks:c},d=fe(t);if(c===Ne&&d.toLowerCase()!==wn)throw new o("Only the documented VolatilePair ETH/USDG PoolKey is supported. Pool creation requires the Uniswap Labs role.");if(n!==void 0){if(typeof n!="string"||!/^0x[0-9a-fA-F]{64}$/.test(n))throw new o("Provide a 32-byte hex poolId.");if(d.toLowerCase()!==n.toLowerCase())throw new o(`PoolKey hash (${d}) does not match expected poolId (${n}).`)}return t}function Bn(e){if(!Number.isInteger(e)||e<=0||e>ke)throw new o("tickSpacing must be a positive integer.");let n=Math.trunc(Ee/e)*e,i=Math.trunc(ke/e)*e;return{tickLower:n===0?0:n,tickUpper:i===0?0:i}}function On(e,n,i){if(!Number.isInteger(i)||i<=0)throw new o("tickSpacing must be a positive integer.");if(!Number.isInteger(e)||!Number.isInteger(n))throw new o("tickLower and tickUpper must be integers.");if(e<Ee||n>ke)throw new o(`Ticks [${e}, ${n}] are outside Uniswap bounds [${Ee}, ${ke}].`);if(e>=n)throw new o("tickLower must be strictly less than tickUpper.");if(e%i!==0||n%i!==0)throw new o(`Ticks [${e}, ${n}] must be divisible by tickSpacing ${i}.`)}function tn(e,n,i,r,c=m){if(T(e),T(n),X(e))throw new o("Native ETH does not use Permit2 approval.");let s=U(i);if(s<=0n||s>$n)throw new o("Permit2 approval amount must be a positive integer within uint160.");let t=U(String(r));if(t<=0n||t>mn)throw new o("Permit2 expiration must be a positive timestamp within uint48.");let d=ne({abi:Hn,functionName:"approve",args:[e,n,s,Number(t)]});return Oe({to:_e,data:d,value:"0",chainId:c,description:`Approve Permit2 allowance of ${s} base units of ${e} for ${n} until ${t}.`})}function on(e){let n=Number(e&0xffffffn);return(n&8388608)!==0?n-16777216:n}function Rn(e){let n=(e&0xffn)!==0n,i=on(e>>8n&0xffffffn),r=on(e>>32n&0xffffffn);return{poolIdBytes25:`0x${(e>>56n&(1n<<200n)-1n).toString(16).padStart(50,"0")}`,tickLower:i,tickUpper:r,hasSubscriber:n}}function rn(e,n,i,r=!1){let[c,s]=e<=n?[e,n]:[n,e];if(c<=0n||s<=0n)return 0n;let t=(i<<96n)*(s-c),d=s*c;return r?(t+d-1n)/d:t/d}function sn(e,n,i,r=!1){let[c,s]=e<=n?[e,n]:[n,e],t=i*(s-c);return r?(t+ue-1n)/ue:t/ue}function gn(e){if(e.liquidity<=0n)return{amount0:0n,amount1:0n};let n=ce(e.tickLower),i=ce(e.tickUpper);return e.sqrtPriceX96<=n?{amount0:rn(n,i,e.liquidity,e.roundUp),amount1:0n}:e.sqrtPriceX96<i?{amount0:rn(e.sqrtPriceX96,i,e.liquidity,e.roundUp),amount1:sn(n,e.sqrtPriceX96,e.liquidity,e.roundUp)}:{amount0:0n,amount1:sn(n,i,e.liquidity,e.roundUp)}}function jn(e){let n=ce(e.tickLower),i=ce(e.tickUpper),r=(s,t,d)=>t<=s||d<=0n?0n:d*s*t/ue/(t-s),c=(s,t,d)=>t<=s||d<=0n?0n:d*ue/(t-s);if(e.sqrtPriceX96<=n)return r(n,i,e.amount0);if(e.sqrtPriceX96<i){let s=r(e.sqrtPriceX96,i,e.amount0),t=c(n,e.sqrtPriceX96,e.amount1);return s<t?s:t}return c(n,i,e.amount1)}function $e(e,n){return e.map(i=>{let r=i.amount.trim(),c=r.startsWith("-"),s=c||r.startsWith("+")?r.slice(1):r,t=n(s,i.token.decimals);return`${c?"-":""}${t} ${i.token.symbol}`})}function an(e,n=m){if(X(e))return{address:ae,symbol:"ETH",decimals:18,chainId:n};let i=y(e);return i.toLowerCase()===E.toLowerCase()?{address:E,symbol:"USDG",decimals:Xe,chainId:n}:i.toLowerCase()===te.toLowerCase()?{address:te,symbol:"WETH",decimals:18,chainId:n}:{address:i,symbol:i.slice(0,10),decimals:18,chainId:n}}async function N(e,n,i=m){if(X(n))return an(n,i);let r=y(n);if(r.toLowerCase()===E.toLowerCase()||r.toLowerCase()===te.toLowerCase())return an(r,i);let[c,s]=await Promise.all([e.readContract({address:r,abi:We,functionName:"symbol"}),e.readContract({address:r,abi:We,functionName:"decimals"})]);if(!Number.isInteger(Number(s))||Number(s)<0||Number(s)>77)throw new o(`Token ${r} reports invalid decimals.`);return{address:r,symbol:ze(c,r),decimals:Number(s),chainId:i}}function j(e,n){if(typeof e!="string"||!/^\d+$/.test(e))throw new o(`${n} must be a non-negative integer string in base units.`);return U(e)}function cn(e,n,i,r){let c=e===void 0?U(Ce(n.toString(),i)):j(e,r);if(c<=1n||c>J)throw new o(`${r} must exceed 1 base unit and fit in uint128; the simulated amount may be too small.`);return c}async function kn(e,n){if(typeof n=="number"&&Number.isFinite(n)&&n>0)return BigInt(Math.floor(n>1e11?n/1e3:n));if(typeof n=="string"&&/^\d+$/.test(n.trim()))return BigInt(n.trim());try{let i=await e.request({method:"eth_getBlockByNumber",params:["latest",!1]});if(i&&typeof i.timestamp=="string")return BigInt(i.timestamp)}catch{}return BigInt(Math.floor(Date.now()/1e3))}async function Me(e,n,i){let r=await kn(e,i);if(n==null)return r+1800n;let c=U(String(n));if(c<=r)throw new o(`Transaction deadline ${c} has expired (current timestamp ${r}).`);return c}async function De(e,n){let i=typeof n.poolId=="string"?n.poolId.trim():void 0,r=n.poolKey&&typeof n.poolKey=="object"&&!Array.isArray(n.poolKey)?n.poolKey:void 0,c=r?{currency0:String(r.currency0??k),currency1:String(r.currency1??E),fee:Number(r.fee),tickSpacing:Number(r.tickSpacing),hooks:String(r.hooks??k)}:n.currency0!==void 0&&n.currency1!==void 0&&n.fee!==void 0&&n.tickSpacing!==void 0?{currency0:String(n.currency0),currency1:String(n.currency1),fee:Number(n.fee),tickSpacing:Number(n.tickSpacing),hooks:String(n.hooks??k)}:void 0;if(c){if(X(c.currency0)&&typeof n.token0=="string"&&n.token0.toLowerCase()===te.toLowerCase())throw new o("Native ETH currency0 differs from WETH; do not supply WETH for a native-ETH v4 pool.");let b=be(c,i);return{poolId:fe(b),poolKey:b}}let s=(i??Mn).toLowerCase();if(s===wn)return{poolId:s,poolKey:be(_n,s)};let t=Ke.find(b=>b.poolId.toLowerCase()===s);if(t){if(X(t.key.currency0)&&typeof n.token0=="string"&&n.token0.toLowerCase()===te.toLowerCase())throw new o("Native ETH currency0 differs from WETH; do not supply WETH for a native-ETH v4 pool.");return{poolId:t.poolId,poolKey:t.key}}let d=s.slice(0,52),a=await e.readContract({address:$,abi:F,functionName:"poolKeys",args:[d]}),[p,l,f,u,h]=a;if(p.toLowerCase()===k&&l.toLowerCase()===k&&Number(u)===0)throw new o(`Unknown or uninitialized v4 poolId ${s}.`);let w=be({currency0:p,currency1:l,fee:Number(f),tickSpacing:Number(u),hooks:h},s);return{poolId:s,poolKey:w}}async function ge(e,n,i){try{let[r,c]=await e.readContract({address:$,abi:F,functionName:"getPoolAndPositionInfo",args:[n]}),s=be({currency0:r.currency0,currency1:r.currency1,fee:Number(r.fee),tickSpacing:Number(r.tickSpacing),hooks:r.hooks});if((i.poolKey||i.poolId)&&(await De(e,i)).poolId.toLowerCase()!==fe(s).toLowerCase())throw new o("The supplied PoolKey does not match this v4 position.");let t=Rn(BigInt(c));return{poolKey:s,poolId:fe(s),tickLower:t.tickLower,tickUpper:t.tickUpper}}catch(r){throw new o(`Could not read v4 position #${n}. ${ee(r)}`)}}function zn(e){if(typeof e!="string")throw new o("wallet must be a valid 20-byte hex address.");return T(e),y(e)}async function dn(e,n,i={}){T(n);let r=y(n),c=e.clientFor(m),s=new Set;if(i.tokenIds)for(let d of i.tokenIds)s.add(U(String(d)).toString());if(!i.tokenIds?.length)try{let d=await c.getBlockNumber(),a=10000000n;for(let p=0n;p<=d;p+=a){let l=p+a-1n<d?p+a-1n:d,f=await c.request({method:"eth_getLogs",params:[{address:$.toLowerCase(),topics:[Xn,null,qn(r)],fromBlock:Ge(p),toBlock:Ge(l)}]});if(!Array.isArray(f))throw new o("Invalid v4 position log response.");for(let u of f){if(!Array.isArray(u.topics)||u.topics.length!==4||!/^0x[0-9a-fA-F]{64}$/.test(u.topics[3]??""))throw new o("Invalid v4 position transfer log.");s.add(BigInt(u.topics[3]).toString())}}}catch(d){if(!i.tokenIds)throw new o(`Could not discover v4 positions. ${ee(d)}`)}let t=[];for(let d of s){let a=BigInt(d);try{let p;try{p=await c.readContract({address:$,abi:F,functionName:"ownerOf",args:[a]})}catch(P){if(He(P,3))continue;throw P}if(p.toLowerCase()!==r.toLowerCase())continue;let l=await c.readContract({address:$,abi:F,functionName:"getPositionLiquidity",args:[a]}),f=BigInt(l);if(f===0n&&!i.includeZero)continue;let{poolKey:u,poolId:h,tickLower:w,tickUpper:b}=await ge(c,a,{}),I=await c.readContract({address:le,abi:pe,functionName:"getSlot0",args:[h]}),x=BigInt(I[0]),{amount0:g,amount1:S}=gn({liquidity:f,tickLower:w,tickUpper:b,sqrtPriceX96:x}),[v,D]=await Promise.all([N(c,u.currency0,m),N(c,u.currency1,m)]);t.push({module:"uniswap",id:`uniswap:v4:${a.toString()}`,chainId:m,assets:[{token:v,amount:g.toString()},{token:D,amount:S.toString()}],description:`Uniswap v4 LP position #${a.toString()} (${v.symbol}/${D.symbol}, liquidity=${f.toString()}, ticks=[${w},${b}], poolId=${h})`})}catch(p){throw new o(`Could not read v4 position #${a}. ${ee(p)}`)}}return t}var Wn={type:"object",properties:{version:{type:"string",enum:["v4"]},poolId:{type:"string",description:"32-byte Uniswap v4 poolId hex string."},poolKey:{type:"object",properties:{currency0:{type:"string"},currency1:{type:"string"},fee:{type:"number"},tickSpacing:{type:"number"},hooks:{type:"string"}}},currency0:{type:"string"},currency1:{type:"string"},fee:{type:"number"},tickSpacing:{type:"number"},hooks:{type:"string"},tickLower:{type:"number"},tickUpper:{type:"number"},fullRange:{type:"boolean"},liquidity:L("Position liquidity in base units."),amount0Max:L("Maximum currency0 base units to spend."),amount1Max:L("Maximum currency1 base units to spend."),recipient:{type:"string"},deadline:L(),permit2Expiration:{type:"string"},hookData:{type:"string"},tokenId:L("Existing v4 position NFT to increase (keeps its tick range). Omit to mint a new position."),initialPrice:{type:"string",description:"Only when the pool does not exist: starting price as token1 per 1 token0 in human units (native ETH is 18 decimals). Needs the full poolKey. Creates the pool then mints the first position in separately confirmed transactions."},sqrtPriceX96:{type:"string",description:"Alternative to initialPrice: exact starting sqrtPriceX96."},acceptPriceDeviation:{type:"boolean",description:"Allow a starting price more than 500 bps from other live pools of the pair."}}},Gn={type:"object",description:"Create and initialize an empty Uniswap v4 pool (permissionless PoolManager.initialize). Add liquidity afterwards with uniswap_add.",properties:{version:{type:"string",enum:["v4"]},poolKey:{type:"object",properties:{currency0:{type:"string"},currency1:{type:"string"},fee:{type:"number"},tickSpacing:{type:"number"},hooks:{type:"string"}}},currency0:{type:"string",description:"Lower sorted currency; the zero address is native ETH."},currency1:{type:"string"},fee:{type:"number",description:"Static LP fee in pips (3000 = 0.30%), at most 1000000."},tickSpacing:{type:"number"},hooks:{type:"string",description:"Hook address; only hooks Oak has measured are accepted. Defaults to none."},initialPrice:{type:"string",description:'Starting price as token1 per 1 token0 in human units, e.g. "3000" for 1 ETH = 3000 USDG.'},sqrtPriceX96:{type:"string",description:"Alternative to initialPrice: exact starting sqrtPriceX96."},acceptPriceDeviation:{type:"boolean",description:"Allow a starting price more than 500 bps from other live pools of the pair."}}},Zn={type:"object",properties:{version:{type:"string",enum:["v4"]},tokenId:L(),poolId:{type:"string"},poolKey:{type:"object"},amount0Min:L(),amount1Min:L(),recipient:{type:"string"},deadline:L(),hookData:{type:"string"}},required:["tokenId"]},Yn={type:"object",properties:{version:{type:"string",enum:["v4"]},tokenId:L(),liquidity:{type:"string",pattern:"^(?:[0-9]+|all)$",description:"Positive base-unit liquidity amount, or all for a full burn."},slippageBps:{type:"integer",minimum:0,maximum:9999,default:Ie},fullExit:{type:"boolean"},burn:{type:"boolean"},amount0Min:L(),amount1Min:L(),poolId:{type:"string"},poolKey:{type:"object"},recipient:{type:"string"},deadline:L(),hookData:{type:"string"}},required:["tokenId"]},Qn={type:"object",properties:{version:{type:"string",enum:["v4"]},tokenIds:{type:"array",items:L()},includeZero:{type:"boolean"}}};function un(e){let n=e.poolKey&&typeof e.poolKey=="object"&&!Array.isArray(e.poolKey)?e.poolKey:e;for(let i of["currency0","currency1","fee","tickSpacing"])if(n[i]===void 0)throw new o(`Creating a pool needs the full poolKey (currency0, currency1, fee, tickSpacing, hooks); ${i} is missing. A poolId alone cannot describe a pool that does not exist yet.`)}function ln(e,n,i){if(e.initialPrice!==void 0&&e.sqrtPriceX96!==void 0)throw new o("Provide initialPrice or sqrtPriceX96, not both.");if(e.sqrtPriceX96!==void 0){if(typeof e.sqrtPriceX96!="string"||!/^\d+$/.test(e.sqrtPriceX96))throw new o("sqrtPriceX96 must be a non-negative integer string.");return je(BigInt(e.sqrtPriceX96))}return Re(e.initialPrice,n,i)}async function Jn(e,n,i){let r;try{r=await e.readContract({address:$,abi:F,functionName:"ownerOf",args:[n]})}catch(c){throw new o(`Could not verify owner of Uniswap v4 position #${n}. ${ee(c)}`)}if(y(r)!==y(i))throw new o(`Wallet ${y(i)} is not the owner of Uniswap v4 position #${n} (owned by ${y(r)}).`)}async function pn(e,n){let i=fe(n).toLowerCase(),r=new Map;for(let s of Ke)s.key.currency0.toLowerCase()===n.currency0.toLowerCase()&&s.key.currency1.toLowerCase()===n.currency1.toLowerCase()&&r.set(s.poolId.toLowerCase(),s.key);let c=[];for(let[s,t]of r){if(s===i||BigInt(await e.readContract({address:le,abi:pe,functionName:"getLiquidity",args:[s]}))===0n)continue;let a=await e.readContract({address:le,abi:pe,functionName:"getSlot0",args:[s]});BigInt(a[0])>0n&&c.push({label:`v4 fee ${t.fee} spacing ${t.tickSpacing} pool ${s}`,sqrtPriceX96:BigInt(a[0])})}return c}function fn(e,n,i,r,c,s){return e.unsignedTx({to:Tn.toLowerCase(),data:ne({abi:Vn,functionName:"initialize",args:[{currency0:n.currency0.toLowerCase(),currency1:n.currency1.toLowerCase(),fee:n.fee,tickSpacing:n.tickSpacing,hooks:n.hooks.toLowerCase()},r]}),value:"0",chainId:m,description:`Create and initialize Uniswap v4 pool ${i} (${c.symbol}/${s.symbol}, fee ${n.fee}, tickSpacing ${n.tickSpacing}) at ${ye(r,c.decimals,s.decimals)} ${s.symbol} per ${c.symbol}.`})}var et=e=>({tools:[{name:"uniswap_add",inputSchema:Wn,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=t.tokenId===void 0?void 0:U(String(t.tokenId));if(a!==void 0&&a<=0n)throw new o("Provide a positive v4 position tokenId.");let p=t.initialPrice!==void 0||t.sqrtPriceX96!==void 0;if(a!==void 0&&p)throw new o("initialPrice cannot be combined with tokenId.");if(t.amount0Min!==void 0||t.amount1Min!==void 0||t.slippageBps!==void 0)throw new o("V4 mint encodes fixed liquidity and amount0Max/amount1Max; amount minima and slippageBps are not supported for minting.");let l=e.clientFor(m);p&&un(t);let f,u,h,w;if(a!==void 0){if(t.tickLower!==void 0||t.tickUpper!==void 0||t.fullRange!==void 0)throw new o("An existing v4 position keeps its tick range; omit tickLower, tickUpper and fullRange when increasing.");await Jn(l,a,d),{poolId:f,poolKey:u,tickLower:h,tickUpper:w}=await ge(l,a,t)}else{({poolId:f,poolKey:u}=await De(l,t));let q=Bn(u.tickSpacing);h=t.fullRange===!0&&t.tickLower===void 0?q.tickLower:Number(t.tickLower),w=t.fullRange===!0&&t.tickUpper===void 0?q.tickUpper:Number(t.tickUpper),On(h,w,u.tickSpacing)}let[b,I]=await Promise.all([N(l,u.currency0,m),N(l,u.currency1,m)]),x=j(t.amount0Max??t.amount0Desired,"amount0Max"),g=j(t.amount1Max??t.amount1Desired,"amount1Max");if(x<=0n&&g<=0n||x>J||g>J)throw new o("Provide positive amount0Max/amount1Max within uint128.");let S=await l.readContract({address:le,abi:pe,functionName:"getSlot0",args:[f]}),v=BigInt(S[0]),D=Number(S[3]),P;if(p){if(v>0n)throw new o(`Pool ${f} already exists; remove initialPrice/sqrtPriceX96 to add liquidity at its current price.`);let q=ln(t,b.decimals,I.decimals),K=Le(q,await pn(l,u),t.acceptPriceDeviation===!0,b.decimals,I.decimals);P={sqrtPriceX96:q,note:K},v=q}else if(v<=0n)throw new o(`Pool ${f} is not initialized on StateView. To create it and add the first liquidity in one tool call with separately confirmed transactions, pass the full poolKey plus initialPrice (token1 per 1 token0, human units); to create it without liquidity use uniswap_create_pool.`);let C=t.liquidity!==void 0?j(t.liquidity,"liquidity"):jn({amount0:Ye(x),amount1:Ye(g),tickLower:h,tickUpper:w,sqrtPriceX96:v});if(C<=0n||C>J)throw new o("Position liquidity must be a positive integer within uint128.");let{amount0:V,amount1:z}=gn({liquidity:C,tickLower:h,tickUpper:w,sqrtPriceX96:v,roundUp:!0});if(V>x||z>g)throw new o("Liquidity requires more tokens than amount0Max or amount1Max.");let ie=Qe(V,x),oe=Qe(z,g),W=t.recipient!==void 0?String(t.recipient):d;if(T(W),y(W)!==y(d))throw new o("Uniswap recipient must be the signing wallet.");let G=await kn(l),re=await Me(l,t.deadline,G.toString()),_=re<G+Ze?re:G+Ze,M=t.permit2Expiration===void 0?_:U(String(t.permit2Expiration));if(M<=G||M>_||M>mn)throw new o("Permit2 expiration must be in the next 30 minutes and no later than the transaction deadline.");let Z=typeof t.hookData=="string"?t.hookData:"0x",Y=((q,K)=>{let R=P?[fn(e,u,f,P.sqrtPriceX96,b,I)]:[];if(!X(u.currency0)&&q>0n){let se=u.currency0.toLowerCase();R.push(e.approval(se,_e.toLowerCase(),q.toString(),m)),R.push(tn(se,$.toLowerCase(),q.toString(),M.toString(),m))}if(!X(u.currency1)&&K>0n){let se=u.currency1.toLowerCase();R.push(e.approval(se,_e.toLowerCase(),K.toString(),m)),R.push(tn(se,$.toLowerCase(),K.toString(),M.toString(),m))}let H={currency0:u.currency0.toLowerCase(),currency1:u.currency1.toLowerCase(),fee:u.fee,tickSpacing:u.tickSpacing,hooks:u.hooks.toLowerCase()},Se=A(Un,[H,h,w,C,q,K,W.toLowerCase(),Z]),Pn=A(Kn,[H.currency0,H.currency1]),Ve=A(Nn,[k,W.toLowerCase()]),vn=A(we,[a??0n,C,q,K,Z]),An=a===void 0?A(de,["0x020d14",[Se,Pn,Ve]]):A(de,["0x00121214",[vn,A(Je,[H.currency0]),A(Je,[H.currency1]),Ve]]),xn=ne({abi:F,functionName:"modifyLiquidities",args:[An,re]}),Sn=X(u.currency0)?q.toString():"0";return R.push(e.unsignedTx({to:$.toLowerCase(),data:xn,value:Sn,chainId:m,description:a!==void 0?`Increase Uniswap v4 position #${a} on pool ${f} (liquidity +${C}).`:`Mint Uniswap v4 position on pool ${f} (ticks [${h}, ${w}], liquidity ${C}).`})),R})(ie,oe),O=await e.preview(Y,d),Fe=(q,K)=>{let R=X(K)?ae:K.toLowerCase();return-q.changes.filter(H=>H.token.address.toLowerCase()===R).reduce((H,Se)=>H+BigInt(Se.amount),0n)},ve=Fe(O,u.currency0),Ae=Fe(O,u.currency1);if(ve<0n||Ae<0n||ve>ie||Ae>oe||ve===0n&&Ae===0n&&a===void 0)throw new o("Invalid simulated v4 mint spend. Refresh the liquidity preview.");let hn=$e(O.changes,e.formatAmount),xe=nn(u,D);return{txs:Y,preview:O,poolId:f,poolKey:u,tickLower:h,tickUpper:w,liquidity:C.toString(),amount0Max:{token:b,amount:x.toString()},amount1Max:{token:I,amount:g.toString()},dynamicFee:xe.dynamicFee,swapsAreFree:xe.swapsAreFree,action:a!==void 0?"increase":P?"createAndMint":"mint",...a!==void 0?{tokenId:a.toString()}:{},...P?{poolCreated:!0,sqrtPriceX96:P.sqrtPriceX96.toString(),initialPrice:ye(P.sqrtPriceX96,b.decimals,I.decimals),initialTick:qe(P.sqrtPriceX96),priceCheck:P.note}:{},summary:`${a!==void 0?`Increase Uniswap v4 position #${a}`:P?"Create Uniswap v4 pool and add first liquidity":"Add Uniswap v4 liquidity"} (${C} L, ticks [${h}, ${w}]) on pool ${f}. Preview deltas: ${hn.join(", ")||"none"}. A partial spend can leave ERC-20 and Permit2 allowances equal to grant minus spent, bounded by your caps. Use oak_cleanup_allowances to revoke remaining allowances. ${xe.feeNote}${P?` ${P.note}`:""}`}}},{name:"uniswap_collect",inputSchema:Zn,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=U(String(t.tokenId??""));if(a<=0n)throw new o("Provide a positive v4 position tokenId.");let p=e.clientFor(m),l=t.recipient!==void 0?String(t.recipient):d;if(T(l),y(l)!==y(d))throw new o("Uniswap recipient must be the signing wallet.");let f=await Me(p,t.deadline,t.now),u=t.amount0Min!==void 0?j(t.amount0Min,"amount0Min"):0n,h=t.amount1Min!==void 0?j(t.amount1Min,"amount1Min"):0n;if(u>J||h>J)throw new o("amount0Min and amount1Min must fit in uint128.");let w=typeof t.hookData=="string"?t.hookData:"0x",{poolKey:b,poolId:I}=await ge(p,a,t),[x,g]=await Promise.all([N(p,b.currency0,m),N(p,b.currency1,m)]),S=A(we,[a,0n,u,h,w]),v=A(Te,[b.currency0.toLowerCase(),b.currency1.toLowerCase(),l.toLowerCase()]),D=A(de,["0x0111",[S,v]]),P=ne({abi:F,functionName:"modifyLiquidities",args:[D,f]}),C=[e.unsignedTx({to:$.toLowerCase(),data:P,value:"0",chainId:m,description:`Collect Uniswap v4 fees from position #${a} to ${l}.`})],V=await e.preview(C,d),z=$e(V.changes,e.formatAmount);return{txs:C,preview:V,tokenId:a.toString(),poolId:I,recipient:l,currencies:[x,g],summary:`Collect Uniswap v4 fees for position #${a} (actions 0x0111). Preview deltas: ${z.join(", ")||"0"}.`}}},{name:"uniswap_remove",inputSchema:Yn,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=U(String(t.tokenId??""));if(a<=0n)throw new o("Provide a positive v4 position tokenId.");let p=e.clientFor(m),l=t.recipient!==void 0?String(t.recipient):d;if(T(l),y(l)!==y(d))throw new o("Uniswap recipient must be the signing wallet.");let f=await Me(p,t.deadline,t.now),{poolKey:u,poolId:h}=await ge(p,a,t),[w,b]=await Promise.all([N(p,u.currency0,m),N(p,u.currency1,m)]),I=t.slippageBps??Ie;if(typeof I!="number")throw new o("Slippage must be an integer from 0 to 9999 bps.");Ce("0",I);let x=typeof t.hookData=="string"?t.hookData:"0x",g=t.fullExit===!0||t.burn===!0||t.liquidity==="all";if(!g&&t.liquidity===void 0)throw new o('Provide a liquidity amount or explicitly choose liquidity "all" for a full exit.');let S=t.liquidity===void 0||t.liquidity==="all"?void 0:j(t.liquidity,"liquidity");if(S!==void 0&&(S<0n||S===0n&&!g||S>J))throw new o("Provide positive liquidity within uint128 for v4 removal.");let v;try{v=BigInt(await p.readContract({address:$,abi:F,functionName:"getPositionLiquidity",args:[a]}))}catch(_){throw new o(`Could not read v4 position liquidity. ${ee(_)}`)}if(v<0n||v===0n&&!g||S!==void 0&&S>v)throw new o("Removal requires a nonempty position and cannot exceed its liquidity.");if(g&&S!==void 0&&S!==v)throw new o("A full burn must match the position liquidity; omit the amount when explicitly choosing all.");let D=g?"0x0311":"0x0111",P=(_,M,Z)=>{let me=g?A(Fn,[a,_,M,x]):A(we,[a,S,_,M,x]),Y=A(Te,[u.currency0,u.currency1,Z]);return e.unsignedTx({to:$.toLowerCase(),data:ne({abi:F,functionName:"modifyLiquidities",args:[A(de,[D,[me,Y]]),f]}),value:"0",chainId:m,description:`${g?"Burn and exit":"Decrease"} Uniswap v4 position #${a} (${D}).`})},C=0n,V=0n;if(v>0n&&(t.amount0Min===void 0||t.amount1Min===void 0)){let _=e.unsignedTx({to:$.toLowerCase(),data:ne({abi:F,functionName:"modifyLiquidities",args:[A(de,["0x0111",[A(we,[a,0n,0n,0n,x]),A(Te,[u.currency0,u.currency1,$])]]),f]}),value:"0",chainId:m,description:"Simulation only: separate fees from removal principal."}),M=await e.preview([_,P(2n,2n,d)],d),Z=me=>M.changes.reduce((Y,O)=>O.token.chainId===m&&O.token.address.toLowerCase()===me.address.toLowerCase()?Y+BigInt(O.amount):Y,0n);if(C=Z(w),V=Z(b),C<0n||V<0n)throw new o("Removal simulation did not return the expected currencies.")}let z=(_,M)=>{if(_!==void 0&&j(_,M)!==0n)throw new o(`${M} must be zero for an empty position burn.`);return 0n},ie=v===0n?z(t.amount0Min,"amount0Min"):cn(t.amount0Min,C,I,"amount0Min"),oe=v===0n?z(t.amount1Min,"amount1Min"):cn(t.amount1Min,V,I,"amount1Min"),W=[P(ie,oe,l)],G=await e.preview(W,d),re=$e(G.changes,e.formatAmount);return{txs:W,preview:G,action:D,tokenId:a.toString(),poolId:h,amount0Min:{token:w,amount:ie.toString()},amount1Min:{token:b,amount:oe.toString()},summary:`${g?"Full exit":"Partial remove"} Uniswap v4 position #${a} (${D})${g?`; burns position #${a} at ${$}`:""}. Preview deltas: ${re.join(", ")||"none"}.`}}},{name:"uniswap_list_positions",inputSchema:Qn,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=Array.isArray(t.tokenIds)?t.tokenIds:void 0,p=t.includeZero===!0,l=t.wallet===void 0?y(d):zn(t.wallet),f=await dn(e,l,{tokenIds:a,includeZero:p});return{version:"v4",positions:f,summary:`Found ${f.length} active Uniswap v4 position(s) for ${l}.`}}},{name:"uniswap_create_pool",inputSchema:Gn,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');un(t);let a=e.clientFor(m),{poolId:p,poolKey:l}=await De(a,t),[f,u]=await Promise.all([N(a,l.currency0,m),N(a,l.currency1,m)]),h=await a.readContract({address:le,abi:pe,functionName:"getSlot0",args:[p]});if(BigInt(h[0])>0n)throw new o(`Uniswap v4 pool ${p} already exists. Use uniswap_add to provide liquidity.`);let w=ln(t,f.decimals,u.decimals),b=Le(w,await pn(a,l),t.acceptPriceDeviation===!0,f.decimals,u.decimals),I=ye(w,f.decimals,u.decimals),x=[fn(e,l,p,w,f,u)],g=await e.preview(x,d),S=nn(l,l.fee);return{txs:x,preview:g,poolId:p,poolKey:l,sqrtPriceX96:w.toString(),initialPrice:I,initialTick:qe(w),priceCheck:b,action:"createPool",summary:`${x[0].description} The pool starts empty: nothing trades until liquidity is added with uniswap_add. ${S.feeNote} ${b}`}}}],positions:t=>dn(e,t)}),pt=et;export{Tn as a,$ as b,le as c,_e as d,lt as e,te as f,E as g,k as h,Ue as i,Ee as j,ke as k,Mn as l,Ke as m,Ne as n,wn as o,_n as p,En as q,X as r,fe as s,bn as t,nn as u,be as v,Bn as w,On as x,tn as y,Rn as z,gn as A,jn as B,$e as C,an as D,N as E,ge as F,dn as G,Wn as H,Gn as I,Zn as J,Yn as K,Qn as L,pn as M,et as N,pt as O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as R}from"./
|
|
1
|
+
import{b as R}from"./VYAJXLND.js";import{a as w}from"./43LI5NKJ.js";import{g as S}from"./NWNYJ26T.js";import{a as o,i as k,j as v}from"./FWD4L3CJ.js";import{a as t}from"./XSD5NL7J.js";import{encodeFunctionData as x,getAddress as h,keccak256 as A,parseAbi as O,parseAbiItem as T,toHex as C,zeroHash as E}from"viem";var i=h(k[o].vaults.spark.address),g={admin:E,setter:A(C("SETTER_ROLE")),taker:A(C("TAKER_ROLE"))},D=[["drip()","any"],["setVsr(uint256 rate)","setter"],["setVsrBounds(uint256 minimum,uint256 maximum)","admin"],["setDepositCap(uint256 cap)","admin"],["take(uint256 assets)","taker"],["grantRole(bytes32 role,address account)","admin"],["revokeRole(bytes32 role,address account)","admin"],["renounceRole(bytes32 role,address account)","any"],["upgradeToAndCall(address implementation,bytes data)","admin"]],N=D.map(([r,a])=>({abi:T(`function ${r}`),authority:a})),p=O(["function asset() view returns (address)","function hasRole(bytes32,address) view returns (bool)","function getRoleMemberCount(bytes32) view returns (uint256)","function getRoleMember(bytes32,uint256) view returns (address)"]);function _(r){return[{name:"spark_roles",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(a,s)=>{try{if(w(s),Object.keys(a).length)throw new t("Spark roles takes no arguments.");let e=r.clientFor(o);if(await e.getChainId()!==o)throw new t("Spark requires chain 4663.");let u=await e.getBlockNumber({cacheTime:0}),c=await Promise.all(Object.entries(g).map(async([f,d])=>{let l=await e.readContract({address:i,abi:p,functionName:"getRoleMemberCount",args:[d],blockNumber:u});if(l>256n)throw new t("Spark role membership exceeds this reader\u2019s supported size.");let[b,n]=await Promise.all([e.readContract({address:i,abi:p,functionName:"hasRole",args:[d,s],blockNumber:u}),Promise.all(Array.from({length:Number(l)},(y,m)=>e.readContract({address:i,abi:p,functionName:"getRoleMember",args:[d,BigInt(m)],blockNumber:u})))]);return{name:f,role:d,heldByWallet:b,members:n.map(y=>h(y))}}));return{vault:i,chainId:o,blockNumber:u.toString(),roles:c}}catch(e){throw new t(r.plainError(e))}}},{name:"spark_manage",inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:N.map(a=>a.abi.name)},values:{type:"array",maxItems:2,items:{type:"string"},description:"Ordered contract inputs; all integers are decimal base-unit strings."}}},execute:async(a,s)=>{try{if(w(s),Object.keys(a).some(n=>!["operation","values"].includes(n)))throw new t("Unexpected Spark management argument.");let e=N.find(n=>n.abi.name===a.operation);if(!e||!Array.isArray(a.values)||a.values.length!==e.abi.inputs.length)throw new t("Provide a supported Spark operation and its exact ordered values.");let u=e.abi.inputs.map((n,y)=>{let m=a.values[y];if(n.type==="bytes32"){if(typeof m!="string"||!Object.values(g).includes(m))throw new t("Provide a documented Spark role identifier.");return m}return R(n.type,m)});if(e.abi.name==="renounceRole"&&!S(String(u[1]),s))throw new t("Role renunciation must name this wallet.");let c=r.clientFor(o);if(await c.getChainId()!==o)throw new t("Spark requires chain 4663.");let f=await c.readContract({address:i,abi:p,functionName:"asset"});if(h(f)!==h(v))throw new t("Spark does not use canonical USDG.");if(e.authority!=="any"&&await c.readContract({address:i,abi:p,functionName:"hasRole",args:[g[e.authority],s]})!==!0)throw new t("This wallet does not hold the required Spark role. No transaction was built.");let d=`${e.abi.name} on Spark ${i}; ordered values ${JSON.stringify(a.values)}. ${e.abi.name==="upgradeToAndCall"?"Replaces vault implementation; Oak must review and re-pin upgraded code before subsequent use.":e.abi.name==="take"?"Pulls vault liquidity to this role-authorized wallet; it mints no savings shares.":""}`,l=[r.unsignedTx({to:i,data:x({abi:[e.abi],functionName:e.abi.name,args:u}),value:"0",chainId:o,description:d})],b=await r.preview(l,s);return{txs:l,preview:b,summary:`${d} ${b.summary} Role and rate bounds are enforced again by the contract at execution.`}}catch(e){throw new t(r.plainError(e))}}}]}export{N as a,_ as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Q}from"./WIRBCS4W.js";import{c as X}from"./PXT5YTWU.js";import{b as Y}from"./BTPXJAUX.js";import{b as z}from"./RUC7KH7A.js";import{a as ee}from"./U5PMVP56.js";import{a as K,b as R,c as S,d as $,g as q,h as I,k as E,l as v,n as V,p as W,r as J,s as U,t as O,v as D,x as G,y as Z}from"./N4Q6GN65.js";import{a as h}from"./X5V2Z2NM.js";import{b as B}from"./SPJCSEKP.js";import{a as N}from"./43LI5NKJ.js";import{c as j,e as k,g as w}from"./NWNYJ26T.js";import{a as c,d as L}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{Buffer as te}from"node:buffer";import{decodeEventLog as ne,encodeFunctionData as P,getAddress as se,hexToString as de,parseAbiItem as ce,toEventSelector as re}from"viem";var $e={register:"erc8004_register"},ie="https://eips.ethereum.org/EIPS/eip-8004#registration-v1",ge={type:"object",required:["type","name","description","image","services","x402Support","active","registrations"],properties:{type:{const:ie},name:{type:"string",minLength:1},description:{type:"string"},image:{type:"string"},services:{type:"array",items:{type:"object",required:["name","endpoint"]}},x402Support:{type:"boolean"},active:{type:"boolean"},registrations:{type:"array"},tags:{type:"array",items:{type:"string"}},supportedTrust:{type:"array",items:{type:"string"}}}};function F(e,t,a=!1){if(typeof e!="string"||!a&&!e.trim())throw new c(`Provide a valid profile ${t}.`)}function fe(e,t){F(e,t);try{let a=new URL(e);if(!["https:","ipfs:"].includes(a.protocol)||!a.hostname||a.username||a.password)throw new Error}catch{throw new c(`Profile ${t} must be an HTTPS or IPFS URI without credentials.`)}}function ue(e,t,a,n){let{registryId:d}=I(e);if(!k(t))throw new c("Provide a registration-v1 profile object.");if(a!==void 0&&typeof a!="boolean")throw new c("The tag option must be a boolean.");if(t.type!==ie)throw new c("Use the ERC-8004 registration-v1 profile type.");if(F(t.name,"name"),F(t.description,"description",!0),fe(t.image,"image"),typeof t.active!="boolean"||typeof t.x402Support!="boolean")throw new c("Profile active and x402Support must be booleans.");if(!Array.isArray(t.services)||!Array.isArray(t.registrations))throw new c("Profile services and registrations must be arrays.");for(let r of t.services)z(r);for(let r of["tags","supportedTrust"])if(t[r]!==void 0&&(!Array.isArray(t[r])||!t[r].every(g=>typeof g=="string"&&g.trim())))throw new c(`Profile ${r} must be an array of nonempty strings.`);let s=t.registrations.map(r=>{if(!k(r)||typeof r.agentRegistry!="string"||!/^eip155:[1-9][0-9]*:0x[0-9a-fA-F]{40}$/.test(r.agentRegistry))throw new c("Provide a valid agentRegistry for every registration.");let g=typeof r.agentId=="number"&&Number.isSafeInteger(r.agentId)?String(r.agentId):r.agentId,p=v(g);if(w(r.agentRegistry,d)){if(n===void 0)throw new c("Do not predict a registration ID; obtain it from the mined Registered receipt.");if(p!==n)throw new c("Profile registration ID does not match the agent being updated.")}return{...r}});n!==void 0&&!s.some(r=>w(r.agentRegistry,d))&&s.push({agentId:n.toString(),agentRegistry:d});let i=[...new Set((t.tags??[]).filter(r=>r!==R))];a!==!1&&i.push(R);let f={...t,registrations:s,...i.length?{tags:i}:{}};i.length||delete f.tags;let o;try{if(o=JSON.stringify(f),te.byteLength(o)>65536)throw new Error;JSON.parse(o)}catch{throw new c("Profile must be JSON data no larger than 64 KiB.")}return`data:application/json;base64,${te.from(o,"utf8").toString("base64")}`}async function x(e,t){try{let{chainId:a,registry:n}=I(e),d=v(t),s=e.clientFor(a),i=await s.readContract({address:n,abi:h,functionName:"ownerOf",args:[d]}).catch(g=>{throw L(g)?new c(`Agent ${d} does not exist in this ERC-8004 registry: the owner lookup reverted. Check the agent ID.`):g});N(i);let[f,o,r]=await Promise.all([s.readContract({address:n,abi:h,functionName:"tokenURI",args:[d]}),s.readContract({address:n,abi:h,functionName:"getAgentWallet",args:[d]}),s.readContract({address:n,abi:h,functionName:"getMetadata",args:[d,R]})]);if(N(o),typeof f!="string"||typeof r!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(r))throw new c("The registry returned invalid identity data.");return{agentId:d.toString(),chainId:a,registry:n,owner:i,uri:f,agentWallet:o,registrarMetadata:r,registryValidated:!1,summary:K}}catch(a){throw new c(e.plainError(a))}}async function Ee(e,t){let a=await x(e,t);return{...a,uri:A(a.uri)}}async function le(e,t,a,n,d,s){let{registry:i}=I(e),f=await D(e,t,a,d),o=s===void 0?"Registered":"URIUpdated",r=re(s===void 0?"Registered(uint256,string,address)":"URIUpdated(uint256,string,address)"),g=f.logs.filter(T=>w(T.address,i)&&T.topics[0]===r&&!T.removed);if(g.length!==1)throw new c(`The receipt must contain one matching ${o} event.`);let p=g[0],u=ne({abi:h,eventName:o,topics:p.topics,data:p.data,strict:!0}),b=u.args.agentId,l=u.eventName==="Registered"?u.args.agentURI:u.args.newURI,y=u.eventName==="Registered"?u.args.owner:u.args.updatedBy;if(s!==void 0&&b!==s||l!==n||!w(y,a))throw new c("The registry event does not match the expected agent, URI and wallet.");let m=await x(e,b.toString());if(m.uri!==n||s===void 0&&!w(m.owner,a))throw new c("The current agent owner or URI does not match the confirmed operation.");return m}function H(e,t){let{chainId:a,registry:n}=I(e);return e.unsignedTx({to:n,chainId:a,value:"0",data:P({abi:h,functionName:"setMetadata",args:[t,R,S]}),description:`Set mutable oak.registrar metadata to oak for agent ${t}.`})}async function pe(e,t,a,n){let{registry:d}=I(e),s=v(n.agentId),i=await D(e,t,a,H(e,s).data),f=re("MetadataSet(uint256,string,string,bytes)"),o=i.logs.filter(u=>w(u.address,d)&&u.topics[0]===f&&!u.removed);if(o.length!==1)throw new c("The receipt must contain one matching MetadataSet event.");let r=o[0],{args:g}=ne({abi:h,eventName:"MetadataSet",topics:r.topics,data:r.data,strict:!0});if(g.agentId!==s||g.metadataKey!==R||g.metadataValue!==S)throw new c("The metadata event does not match this agent and registrar marker.");let p=await x(e,n.agentId);if(p.registrarMetadata!==S||p.uri!==n.uri||!w(p.owner,n.owner))throw new c("The current agent metadata, owner or URI does not match the confirmed operation.");return p}async function me(e,t){let{chainId:a,registry:n}=I(e),d=e.clientFor(a),s=await d.readContract({address:n,abi:h,functionName:"balanceOf",args:[t]});if(s===0n)return;if(typeof s!="bigint"||s<0n)throw new c("Registry balance is unavailable; registration was not built.");let i=await d.getBlockNumber({cacheTime:0}),f=new Set;for(;;){let o=i>9999999n?i-9999999n:0n,r=await d.getLogs({address:n,event:ce("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:t},fromBlock:o,toBlock:i,strict:!0});for(let g of r){let p=g.args.tokenId.toString();if(g.removed||f.has(p))continue;f.add(p);let u=await x(e,p);if(w(u.owner,t))return u}if(o===0n)throw new c("Owned identity could not be located; registration was not built. Run oak setup link <agentId>.");i=o-1n}}function he(e){if(e===void 0)return[];if(!Array.isArray(e)||e.length>16)throw new c("Provide at most 16 metadata entries as { key, value } with value as 0x hex or text.");let t=new Set;return e.map(a=>{if(!k(a))throw new c("Provide each metadata entry as { key, value } or { key, text }.");let n=G(a.key);if(t.has(n))throw new c(`Metadata key ${A(n)} is repeated.`);return t.add(n),{metadataKey:n,metadataValue:Z(a)}})}function oe(e,t,a){let n=J(t);if(!n)return;let{registryId:d}=I(e);return Array.isArray(n.registrations)&&n.registrations.some(s=>k(s)&&typeof s.agentRegistry=="string"&&w(s.agentRegistry,d)&&String(s.agentId)===a.toString())}function ye(e,t,a){let n=oe(e,t.uri,BigInt(t.agentId));return n===!0?{...t,profileComplete:!0}:{...t,profileComplete:n===void 0?null:!1,nextStep:{tool:"erc8004_update",arguments:{agentId:t.agentId,profile:a??"a registration-v1 profile object"},why:"The minted profile does not list its own registry and agent ID yet (registrations is empty). erc8004_update appends it automatically. It is a normal action: it needs a verified identity link and an active subscription, so link with oak_setup first."}}}async function ae(e,t,a,n){let{chainId:d,registry:s}=I(e);N(n),V(e,a.chainId);let i=t?v(a.agentId):void 0,f=!t&&a.profile===void 0,o=f?"":ue(e,a.profile,a.tag,i),r=t?[]:he(a.metadata);if(f&&r.length)throw new c("Metadata entries are registered together with a profile; provide a profile, or set metadata afterwards with erc8004_set_metadata.");let g=a.tag!==!1;if(a.metadataTransactionHash!==void 0&&(!g||a.transactionHash===void 0))throw new c("A metadata transaction hash requires tagging and the profile transaction hash.");let p=i!==void 0?P({abi:h,functionName:"setAgentURI",args:[i,o]}):r.length?P({abi:h,functionName:"register",args:[o,r]}):f?P({abi:h,functionName:"register"}):P({abi:h,functionName:"register",args:[o]}),u=l=>i===void 0?ye(e,l,a.profile):l;if(a.transactionHash!==void 0){let l=await le(e,a.transactionHash,n,o,p,i);if(!g)return u(l);if(a.metadataTransactionHash!==void 0)return u(await pe(e,a.metadataTransactionHash,n,l));let y=v(l.agentId);await O(e,y,n);let m=await U(e,[H(e,y)],n,`Profile transaction confirmed for agent ${y}; onchain registrar metadata is pending. Submit this metadata transaction locally if not already submitted, then repeat the original arguments with transactionHash and metadataTransactionHash to verify both calls.`);return{...l,...m}}if(!t){let l=await me(e,n);if(l){let y={...l,registrationResumed:!0};if(!g||l.registrarMetadata===S)return u(y);let m=await U(e,[H(e,v(l.agentId))],n,`Resume registrar metadata for owned agent ${l.agentId}; no new identity will be minted.`);return{...y,...m}}}i!==void 0&&await O(e,i,n);let b=[e.unsignedTx({to:s,data:p,value:"0",chainId:d,description:i===void 0?"Register an ERC-8004 agent profile.":`Update ERC-8004 agent ${i} profile.`})];return i!==void 0&&g&&b.push(H(e,i)),U(e,b,n,`Submit locally, then repeat the original arguments with transactionHash to verify the profile receipt and URI.${g?i===void 0?" The mined Registered event supplies the actual agent ID; confirmation then builds a separate setMetadata transaction for oak.registrar. Both transactions require network gas.":" Submit the profile and metadata transactions in order, then supply metadataTransactionHash as well to verify the onchain oak.registrar marker. Both transactions require network gas.":" No registrar metadata transaction is built; --no-tag does not clear existing onchain metadata."}${i===void 0?" Update the profile registrations with the mined ID afterward.":""}`)}async function we(e,t){let a=await x(e,t.agentId),{chainId:n,registry:d}=I(e),s=e.clientFor(n),i=BigInt(a.agentId),f=t.metadataKeys===void 0?[]:(()=>{if(!Array.isArray(t.metadataKeys)||t.metadataKeys.length>16)throw new c("Provide at most 16 metadata keys.");return t.metadataKeys.map(m=>W(m,"metadata key",128,!1))})(),o=t.operator===void 0?void 0:se(String(t.operator)),[r,g,...p]=await Promise.allSettled([s.readContract({address:d,abi:h,functionName:"getApproved",args:[i]}),o?s.readContract({address:d,abi:h,functionName:"isApprovedForAll",args:[a.owner,o]}):Promise.resolve(void 0),...f.map(m=>s.readContract({address:d,abi:h,functionName:"getMetadata",args:[i,m]}))]),u=m=>m.status==="fulfilled"?m.value:void 0,b=u(r),l=E(a.agentWallet)?"unset":w(a.agentWallet,a.owner)?"owner":"verified-other",y=oe(e,a.uri,i);return{...a,approved:typeof b=="string"&&E(b)?null:b??"unavailable",...o?{operator:o,operatorApproved:u(g)??"unavailable"}:{},walletState:l,walletNote:l==="unset"?"No verified payment wallet: it starts as the minting owner, and any NFT transfer or erc8004_unset_wallet clears it. Re-verify with erc8004_wallet_proof then erc8004_set_wallet.":l==="owner"?"The payment wallet is the current owner.":"The payment wallet was proven by a signature from that wallet and is not the owner.",profile:{selfRegistered:y??null,fetched:!1,note:y===void 0?"The URI is external or not decodable; Oak does not fetch it.":void 0},...f.length?{metadata:Object.fromEntries(f.map((m,T)=>{let _=u(p[T]),M=typeof _=="string"&&/^0x([0-9a-fA-F]{2})*$/.test(_)?_:void 0,C;if(M&&M!=="0x")try{C=A(de(M))}catch{C=void 0}return[A(m),{hex:M??"unavailable",...C?{text:C}:{}}]}))}:{}}}var Ie={type:"object",additionalProperties:!1,required:["key"],properties:{key:{type:"string",minLength:1,maxLength:128},value:q,text:{type:"string"}}},be=e=>{let t=(n,d,s)=>({name:n,inputSchema:d,execute:async(i,f)=>{try{let o=await s(i,f);return k(o)&&typeof o.uri=="string"?{...o,uri:A(o.uri)}:o}catch(o){throw new c(e.plainError(o))}}}),a=n=>({type:"object",additionalProperties:!1,required:n?["agentId","profile"]:[],properties:{profile:{...ge,description:n?void 0:"Omit for the standard blank register(): the profile is attached later with erc8004_update."},tag:{type:"boolean",default:!0,description:"Set false for --no-tag; removes the profile tag and skips setMetadata, leaving existing onchain metadata unchanged."},transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"After local submission, verify exact calldata, event and URI; if tagged, build the metadata follow-up unless metadataTransactionHash is supplied."},metadataTransactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Hash of the separate setMetadata transaction; supplied with transactionHash to complete tagged confirmation."},...n?{agentId:$}:{metadata:{type:"array",maxItems:16,items:Ie,description:"Optional extra onchain metadata written by register(agentURI, metadata[]). The key agentWallet is reserved."}}}});return{tools:[t("erc8004_register",a(!1),(n,d)=>ae(e,!1,n,d)),t("erc8004_update",a(!0),(n,d)=>ae(e,!0,n,d)),t("erc8004_identity",{type:"object",additionalProperties:!1,required:["agentId"],properties:{agentId:$,metadataKeys:{type:"array",maxItems:16,items:{type:"string",minLength:1,maxLength:128},description:"Also read these onchain metadata keys."},operator:{...j,description:"Also report whether this address is approved for all of the owner's agents."}}},n=>we(e,n))]}},Oe=e=>B("erc8004",[be(e),X(e),Y(e),ee(e),Q(e)]);export{$e as a,Ee as b,oe as c,be as d,Oe as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as U,b as N,c as _}from"./HKEMQBFA.js";import{e as S}from"./Q42YI3EP.js";import{b as k,c as R}from"./QU5XKRGK.js";import{a as q,c as f,d as h,f as I,g as D}from"./4HG6FRVH.js";import{g as B}from"./H43RNCX2.js";import{a as b,c as O}from"./43LI5NKJ.js";import{b as v}from"./66F5ZH34.js";import{a as A}from"./FWD4L3CJ.js";import{a as s}from"./XSD5NL7J.js";import{erc20Abi as $}from"viem";var K=a=>{function w(e,n){if(Object.keys(e).some(m=>!n.includes(m)))throw new s("Use only the inputs shown for this Pendle tool. YT and LP actions are not supported.")}function j(e){if(typeof e!="string"||!/^[0-9]+$/.test(e)||e.length>78)throw new s("Provide a positive decimal base-unit amount as a string.");return k(BigInt(e),!0)}function C(e,n){let m=e==="stable"?100:200,r=n===void 0?e==="stable"?50:100:n;if(typeof r!="number"||!Number.isInteger(r)||r<0)throw new s("Slippage must be a whole number of basis points.");if(r>m)throw new s(`Oak won't accept a price move that big. The most it allows is ${m/100}%.`);return r}async function y(e,n,m){w(n,["market","amount","slippageBps"]),f(h(m,a.wallet),"wallet does not match this request"),b(n.market);for(let r=0;r<2;r++){let t=await a.verify(n.market);f(h(t.market,n.market),"verified market does not match the request");let d=await a.client.getBlock();if(t.expired||d.timestamp>=BigInt(t.expiry))throw new s("This Pendle term has ended. Use pendle_redeem to cash out.");let p=C(t.kind,n.slippageBps),o=e==="sell"&&n.amount==="max"?k(await a.client.readContract({address:t.pt,abi:$,functionName:"balanceOf",args:[a.wallet],blockNumber:d.number}),!0):j(n.amount),i=e==="buy"?t.inputToken:t.pt,l=e==="buy"?t.pt:t.inputToken,u=await B(a.http,{inputToken:i,outputToken:l,amount:o,wallet:a.wallet,slippageBps:p}),c=(e==="buy"?I:D)(u.body,{market:t,wallet:a.wallet,amount:o,slippageBps:p});if(Math.abs(c.priceImpact)>.03)throw new s("This is a thin market and your size moves the price too much. Try a smaller amount.");if(Date.now()-u.receivedAt>3e4)continue;await R(a.client,t,e,o,c.amountOut,c.priceImpact);let T=Date.now()-u.receivedAt;if(T<0||T>3e4)continue;let x=e==="sell"?{wallet:a.wallet,market:t.market,pt:t.pt,outputToken:l,amountIn:o.toString(),amountOut:c.amountOut.toString(),minOut:c.minOut.toString(),ptDecimals:t.ptDecimals,outputDecimals:t.inputDecimals,endsAt:t.expiry,feeUsd:c.feeUsd,receivedAt:u.receivedAt,data:c.tx.data}:void 0;return{txs:[O(i,q,o.toString(),A),c.tx],...x?{pendleSellQuote:x}:{},summary:e==="buy"?"Approve the exact input amount, then buy Pendle PT.":"Approve the exact PT amount, then sell early at today\u2019s market price."}}throw new s("Pendle\u2019s quote became too old. Try again for a fresh price.")}async function M(e,n){w(e,["market","minOutBps"]),f(h(n,a.wallet),"wallet does not match this request");let m=U(e.minOutBps),r;if(e.market==="all")try{r=await S(a.client)}catch{throw new s("Oak could not read ended Pendle markets from the chain. Provide one ended market address to cash it out.")}else b(e.market),r=[e.market];let t=[];for(let o of r){let i=await a.verify(o);if(f(h(i.market,o),"verified market does not match the request"),e.market==="all"&&!i.expired)continue;let l=k(await a.client.readContract({address:i.pt,abi:$,functionName:"balanceOf",args:[a.wallet]}));l!==0n&&t.push({verified:i,balance:l})}if(t.length>1)throw new s(`Ended Pendle terms are cashed out one at a time. Run pendle_redeem with one of these market addresses: ${t.map(({verified:o})=>o.market).join(", ")}.`);let d=[],p=[];for(let{verified:o,balance:i}of t){let l=await N(a,o,i,m);d.push(...l.txs);let u=await _(a,o,i,l.expected,m);u&&p.push(u)}return{txs:d,summary:d.length?["Cash out ended Pendle PT balances to each market\u2019s input token.",...p].join(" "):"No PT balance in the selected ended Pendle terms."}}let g={type:"string",pattern:"^0x[0-9a-fA-F]{40}$",description:"Pendle market address returned by pendle_list."},P={type:"integer",minimum:0,maximum:200,description:"USDG: default 50, cap 100 bps. Stock tokens: default 100, cap 200 bps; the verified market determines the cap."};return[{name:"pendle_buy",inputSchema:{type:"object",properties:{market:g,amount:v("Positive decimal base units of the market input token; read its decimals first."),slippageBps:P},required:["market","amount"],additionalProperties:!1},execute:(e,n)=>y("buy",e,n)},{name:"pendle_sell",inputSchema:{type:"object",properties:{market:g,amount:{type:"string",anyOf:[{pattern:"^[0-9]+$"},{const:"max"}],description:"PT decimal base units, or max for the full PT balance."},slippageBps:P},required:["market","amount"],additionalProperties:!1},execute:(e,n)=>y("sell",e,n)},{name:"pendle_redeem",inputSchema:{type:"object",properties:{market:{type:"string",anyOf:[{pattern:"^0x[0-9a-fA-F]{40}$"},{const:"all"}],description:"Ended market address, or all ended markets held by this wallet."},minOutBps:{type:"integer",minimum:0,maximum:50,default:10,description:"Maximum reduction from the on-chain redemption estimate, in basis points."}},required:["market"],additionalProperties:!1},execute:M}]};export{K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as u,f as h}from"./C5ZZAYXD.js";import{i as g,j as k}from"./W6BS3T7S.js";import{d as p,f}from"./BTD5SMOW.js";import{q as m}from"./IY7BXLT4.js";import{a as d}from"./SPJCSEKP.js";import{g as l}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";var w=["hoodlock_lock","hoodlock_burn","hoodlock_airdrop_create","hoodlock_airdrop_claim",...p,...u];async function H(e,r,t,s){if(!w.includes(e))throw new i("Unknown HoodLock action; nothing was signed.");let o=async()=>{throw new i("HoodLock does not require a swap for this action.")},n=d({clientFor:()=>s,http:fetch,preview:async a=>({txs:a,changes:[],summary:"Locally reconstructed HoodLock intent."}),quoteSwap:o,buildSwap:o}),c=await[g(n),k(n),...m(n).tools,...f(n).tools,...h(n).tools].find(a=>a.name===e).execute(r,t);if(!Array.isArray(c.txs)||c.txs.length===0)throw new i("HoodLock action has no transactions; use the read route.");return c.txs.map(a=>({...a}))}function I(e,r){if(!r.length||e.length!==r.length||e.some((t,s)=>{let o=r[s];return t.chainId!==o.chainId||!l(t.to,o.to)||!l(t.data,o.data)||t.value!==o.value}))throw new i("HoodLock transaction differs from the locally reconstructed request; nothing was signed.")}export{w as a,H as b,I as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as R,s as g}from"./G6HCV67X.js";import{a as w}from"./5YS5V2LK.js";import{isDeepStrictEqual as b}from"node:util";import{isAddress as x}from"viem";var O=2592e3,v=1n<<128n,m=new Set(["order","offer","link","consent"]),y=new Set(["order","offer","consent"]),E=new Set(["order","offer","link"]),I=3600,S=1e11;function l(e){return new w(`Local signing guard: ${e}; nothing was signed.`)}var V=e=>m.has(e.class);function T(e,r){let t=new Map,n=(s,a,o)=>{let u=e[s];if(!u||o>8)throw l("typed-data types changed");for(let c of u){let f=c.type.replace(/(\[[0-9]*\])+$/,""),i=`${a}${c.name}${c.type===f?"":"[]"}`;e[f]?n(f,`${i}.`,o+1):t.set(i,c.type)}};return n(r,"",0),t}function N(e,r){let t=new Set,n=s=>{if(!(t.has(s)||!e[s])){t.add(s);for(let a of e[s])n(a.type.replace(/(\[[0-9]*\])+$/,""))}};return n(r),t}function A(e=[]){let r=new Set(e.map(n=>n.toLowerCase())),t=(n,s)=>{if(!(s>12)){if(typeof n=="string"){x(n,{strict:!1})&&r.add(n.toLowerCase());return}if(n&&typeof n=="object")for(let a of Object.values(n))t(a,s+1)}};return t(R,0),t(g,0),r}function j(e,r=A()){let t=[],n=(i,d)=>t.push(`${i} ${e.id}: ${d}`),s=Object.entries(e.fields),a=i=>s.filter(([,d])=>d.role===i),o=i=>s.filter(([,d])=>d.role==="derived"&&d.yields?.includes(i)).length;["order","cancel","link","offer","consent","auth","relayed"].includes(e.class)||n("R5","unknown signature class; link-accept is a display role only"),e.expiryBinding&&!["signed","program-link","auth-window","cancel-only"].includes(e.expiryBinding)&&n("R5","unknown expiry binding"),(!e.id||!/^[a-z0-9]+(?:[.-][a-z0-9]+)+$/.test(e.id))&&n("ID","id must be dotted lower-case"),(!e.tools.length||new Set(e.tools).size!==e.tools.length)&&n("ID","tools must be a non-empty unique list");let u=e.network==="testnet"?g.testnet.chainId:g.mainnet.chainId;if(e.encoding==="eip712"){let i=e.domain;i?(Object.hasOwn(i,"salt")&&n("R1","domain must not carry a salt"),i.name||n("R1","domain name is missing"),!i.version&&e.class!=="relayed"&&n("R1","domain version is missing"),i.chainId!==u&&n("R1",`domain chain must be ${u}`),i.verifyingContract?r.has(i.verifyingContract.toLowerCase())||n("R1","verifying contract is not a pinned address"):e.class!=="cancel"&&e.class!=="auth"&&n("R1","verifying contract is missing")):n("R1","EIP-712 spec has no domain")}else e.domain&&n("R1","only EIP-712 specs carry a domain");if(e.encoding==="eip191-packed-hash"){let i=a("pinned").map(([,d])=>d.value);i.some(d=>d===u||d===String(u))||n("R1","packed layout must pin the chain id"),i.some(d=>typeof d=="string"&&r.has(d.toLowerCase()))||n("R1","packed layout must pin the verifying contract")}let c=new Map,f=e.class==="relayed"&&!Object.keys(e.types).length;if(e.encoding==="eip712"&&!f){Object.hasOwn(e.types,"EIP712Domain")&&n("R2","types must never carry EIP712Domain");try{c=T(e.types,e.primaryType);let i=N(e.types,e.primaryType);for(let d of Object.keys(e.types))i.has(d)||n("R2",`type ${d} is not reachable from ${e.primaryType}`)}catch{n("R2",`types do not resolve from ${e.primaryType}`)}for(let i of c.keys())Object.hasOwn(e.fields,i)||n("R3",`message path ${i} has no role`);for(let[i]of s)c.has(i)||n("R3",`declared field ${i} is not in the typed struct`)}else e.encoding!=="eip712"&&Object.keys(e.types).length&&n("R2","only EIP-712 specs carry types");for(let[i,d]of s)(!d.meaning||d.meaning.length>160)&&n("R3",`field ${i} needs a plain-English meaning`);(e.class==="order"||e.class==="offer")&&!s.some(([,i])=>i.role==="amount"&&i.side==="out")&&!o("amount-out")&&n("R4",`${e.class} must show the most that can leave`);for(let[i,d]of s){if(d.role==="amount"||d.role==="fee"){let h=d.token;(x(h,{strict:!1})?r.has(h.toLowerCase()):e.fields[h]?.role==="token")||n("R4",`amount ${i} does not name a token field or a pinned token`)}c.get(i)==="bytes"&&d.role!=="pinned"&&d.role!=="derived"&&n("R4",`bytes field ${i} must be pinned or derived`)}if(e.maxLifetimeSeconds>0&&e.maxLifetimeSeconds<=O||n("R5","maxLifetimeSeconds must be within 30 days"),y.has(e.class)){let i=a("expiry").length+o("expiry");i!==1&&n("R5",`${e.class} needs exactly one expiry (found ${i})`),e.expiry&&n("R5","API-only expiry is not a signed expiry"),e.expiryBinding&&e.expiryBinding!=="signed"&&n("R5",`${e.class} requires signed expiry`)}if(e.expiryBinding==="program-link"&&e.class!=="link"&&n("R5","only link can use program-link"),e.class==="link"&&e.expiryBinding!=="program-link"&&a("expiry").length+o("expiry")!==1&&n("R5","link needs signed expiry or program-link binding"),e.expiryBinding==="auth-window"){let i=e.authWindow;(e.class!=="auth"||!i||!c.has(i.field)||!Number.isSafeInteger(i.maxAgeSeconds)||i.maxAgeSeconds<=0||i.maxAgeSeconds>e.maxLifetimeSeconds||!Number.isSafeInteger(i.maxFutureSeconds)||i.maxFutureSeconds<0||i.maxFutureSeconds>e.maxLifetimeSeconds)&&n("R5","auth-window needs a signed timestamp and pinned acceptance window")}else e.authWindow&&n("R5","authWindow requires auth-window binding");return e.expiryBinding==="cancel-only"&&(e.class!=="cancel"||!a("nonce").length&&!o("nonce")&&!e.revoke?.staysExecutableUntilExpiry)&&n("R5","cancel-only needs a single-use nonce or targeted non-revoking hide"),(e.class==="auth"||e.class==="cancel")&&(s.some(([,i])=>i.role==="amount"&&i.side==="out")||o("amount-out"))&&n("R4","auth and cancel cannot grant spending authority"),E.has(e.class)&&!(e.revoke?.onchainTool||e.revoke?.offchainSpec)&&!(e.revoke?.none&&e.maxLifetimeSeconds<=I)&&n("R6",`${e.class} needs a revocation path (only a one-shot approval of at most one hour may declare none)`),e.submit.by==="addon"&&(!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(e.submit.host)||!/^\/[A-Za-z0-9/_.-]*$/.test(e.submit.path))&&n("R9","add-on submission needs a bare HTTPS host and a fixed path"),e.submit.by==="server-continuation"&&!e.submit.reason&&n("R9","server-continuation needs its recorded reason"),e.submit.by==="transaction"&&e.class!=="relayed"&&e.class!=="consent"&&n("R9","only relayed and consent signatures are consumed by a transaction"),(!/^[A-Za-z0-9 .'-]{1,40}$/.test(e.program)||!/^[A-Za-z0-9 .'-]{1,60}$/.test(e.purpose))&&n("R10","program and purpose must be short constant text"),m.has(e.class)&&!e.requireHuman&&!e.humanException&&n("C13",`${e.class} must require a human`),!m.has(e.class)&&e.humanException&&n("C13","only a value class can name a human exception"),e.relayedPaths&&e.class!=="relayed"&&n("ID","only relayed specs accept caller signatures"),e.enabled===!1&&!e.disabledReason&&n("ID","a disabled spec states why"),t}function z(e,r=A()){let t=e.filter(a=>a.enabled!==!1).flatMap(a=>j(a,r)),n=new Set,s=new Set;for(let a of e){n.has(a.id)&&t.push(`ID ${a.id}: duplicate spec id`),n.add(a.id);let o=C(a);s.has(o)&&t.push(`ID ${a.id}: another spec already covers ${o}`),s.add(o)}return t}function C(e){return`${e.network??"mainnet"}:${e.encoding}:${(e.domain?.verifyingContract??"-").toLowerCase()}:${e.primaryType}`}function k(e,r,t,n,s){let a=r.replace(/(\[[0-9]*\])+$/,"");if(a!==r){if(!Array.isArray(t))throw l(`message field ${n||r} is not declared`);for(let i of t)k(e,r.replace(/\[[0-9]*\]$/,""),i,`${n}[]`,s+1);return}let o=e[a];if(!o)return;if(s>8||!t||typeof t!="object"||Array.isArray(t))throw l(`message field ${n||r} is not declared`);let u=Object.keys(t),c=o.map(i=>i.name);if(u.find(i=>!c.includes(i))!==void 0)throw l(`an undeclared message field${n?` under ${n}`:""} is present`);for(let i of o){if(!Object.hasOwn(t,i.name))throw l(`message field ${n?`${n}.`:""}${i.name} is missing`);k(e,i.type,t[i.name],`${n?`${n}.`:""}${i.name}`,s+1)}}function W(e,r){if(e.encoding!=="eip712"||!e.domain)throw l("Oak has no signing contract for this request");if(!r||typeof r!="object"||!r.domain||typeof r.domain!="object")throw l("domain, chain or verifying contract is not the pinned one");let t=Object.fromEntries(Object.entries(e.domain).filter(([,n])=>n!==void 0));if(!b(Object.keys(r.domain).sort(),Object.keys(t).sort())||!b({...r.domain},t))throw l("domain, chain or verifying contract is not the pinned one");if(!r.types||typeof r.types!="object"||Object.hasOwn(r.types,"EIP712Domain")||!b(r.types,e.types)||r.primaryType!==e.primaryType)throw l("typed-data types changed");k(e.types,e.primaryType,r.message,"",0)}function p(e,r){let t=e;for(let n of r.split(".")){if(n.endsWith("[]")||!t||typeof t!="object"||Array.isArray(t))return;t=t[n]}return t}var $=e=>typeof e=="string"?e:typeof e=="number"||typeof e=="bigint"?String(e):void 0;function D(e,r){let t={},n=s=>x(s,{strict:!1})?s:$(p(r,s));for(let[s,a]of Object.entries(e.fields)){let o=$(p(r,s));if(o!==void 0)switch(a.role){case"signer":t.signer=o;break;case"account":t.account=o;break;case"recipient":t.recipient=o;break;case"delegate":t.delegate=o;break;case"counterparty":t.counterparty=o;break;case"token":a.side==="out"?t.tokenOut=o:t.tokenIn=o;break;case"amount":a.side==="out"?(t.amountOut=o,t.tokenOut??=n(a.token)):(t.minAmountIn=o,t.tokenIn??=n(a.token));break;case"fee":(t.fees??=[]).push({token:n(a.token)??a.token,value:o});break;case"expiry":t.expiry=/^[0-9]+$/.test(o)?Number(o):Number.NaN;break;case"nonce":t.nonce=o;break;default:break}}return t}function L(e,r,t){let n=Math.min(e.maxLifetimeSeconds,O),s=y.has(e.class)||e.humanException?60:1;if(!Number.isSafeInteger(t)||t<0||!Number.isFinite(n)||n<=0||r===void 0||!Number.isSafeInteger(r)||r<=0||r>=S||r<t+s||r>t+n)throw l(`expiry is missing, past or beyond ${n>=86400?`${Math.floor(n/86400)} days`:`${Math.ceil(n/60)} minutes`}`)}function U(e,r,t,n){if(e.enabled===!1)throw l("Oak has no signing contract for this request");if(!Number.isSafeInteger(t)||t<0||t>=S)throw l("signing time is unavailable");if(e.expiryBinding==="auth-window"){let o=e.authWindow,u=o&&p(r,o.field),c=typeof u=="number"?u:typeof u=="string"&&/^[0-9]+$/.test(u)?Number(u):NaN;if(e.class!=="auth"||!o||!Number.isSafeInteger(c)||c<=0||c>=S||c<t-o.maxAgeSeconds||c>t+o.maxFutureSeconds)throw l("authentication time is outside the pinned window");return c+o.maxAgeSeconds}if(e.expiryBinding==="cancel-only"){if(e.class!=="cancel")throw l("Oak has no signing contract for this request");return n}if(e.expiryBinding==="program-link")throw l("program link authority is not configured");if(y.has(e.class)&&(e.expiry||e.expiryBinding&&e.expiryBinding!=="signed"))throw l("order expiry must be signed");let s=D(e,r).expiry??n,a=Object.values(e.fields).some(o=>o.role==="expiry"||o.role==="derived"&&o.yields?.includes("expiry"));if(y.has(e.class)&&!a)throw l("order expiry must be signed");return(a||m.has(e.class))&&L(e,s,t),s}function H(e){if(e===void 0||!/^[0-9]{1,78}$/.test(e))throw l("open-ended or out-of-range amount");let r=BigInt(e);if(r<=0n||r>=v)throw l("open-ended or out-of-range amount");return r}function J(e,r){return Object.entries(e.fields).map(([t,n])=>{let s=t.includes("[]")?"(each item, listed below)":p(r,t),a=typeof s=="object"&&s!==null?JSON.stringify(s):String(s);a.length>200&&(a=`${a.slice(0,200)}\u2026`);let o=JSON.stringify(a).replace(/[\u007f-\u009f\u2028\u2029\u202a-\u202e\u2066-\u2069]/g,u=>`\\u${u.charCodeAt(0).toString(16).padStart(4,"0")}`);return`${t} = ${o} - ${n.meaning}`})}export{O as a,v as b,m as c,l as d,V as e,T as f,A as g,j as h,z as i,C as j,W as k,p as l,D as m,L as n,U as o,H as p,J as q};
|
|
1
|
+
import{i as R,s as g}from"./FWD4L3CJ.js";import{a as w}from"./XSD5NL7J.js";import{isDeepStrictEqual as b}from"node:util";import{isAddress as x}from"viem";var O=2592e3,v=1n<<128n,m=new Set(["order","offer","link","consent"]),y=new Set(["order","offer","consent"]),E=new Set(["order","offer","link"]),I=3600,S=1e11;function l(e){return new w(`Local signing guard: ${e}; nothing was signed.`)}var V=e=>m.has(e.class);function T(e,r){let t=new Map,n=(s,a,o)=>{let u=e[s];if(!u||o>8)throw l("typed-data types changed");for(let c of u){let f=c.type.replace(/(\[[0-9]*\])+$/,""),i=`${a}${c.name}${c.type===f?"":"[]"}`;e[f]?n(f,`${i}.`,o+1):t.set(i,c.type)}};return n(r,"",0),t}function N(e,r){let t=new Set,n=s=>{if(!(t.has(s)||!e[s])){t.add(s);for(let a of e[s])n(a.type.replace(/(\[[0-9]*\])+$/,""))}};return n(r),t}function A(e=[]){let r=new Set(e.map(n=>n.toLowerCase())),t=(n,s)=>{if(!(s>12)){if(typeof n=="string"){x(n,{strict:!1})&&r.add(n.toLowerCase());return}if(n&&typeof n=="object")for(let a of Object.values(n))t(a,s+1)}};return t(R,0),t(g,0),r}function j(e,r=A()){let t=[],n=(i,d)=>t.push(`${i} ${e.id}: ${d}`),s=Object.entries(e.fields),a=i=>s.filter(([,d])=>d.role===i),o=i=>s.filter(([,d])=>d.role==="derived"&&d.yields?.includes(i)).length;["order","cancel","link","offer","consent","auth","relayed"].includes(e.class)||n("R5","unknown signature class; link-accept is a display role only"),e.expiryBinding&&!["signed","program-link","auth-window","cancel-only"].includes(e.expiryBinding)&&n("R5","unknown expiry binding"),(!e.id||!/^[a-z0-9]+(?:[.-][a-z0-9]+)+$/.test(e.id))&&n("ID","id must be dotted lower-case"),(!e.tools.length||new Set(e.tools).size!==e.tools.length)&&n("ID","tools must be a non-empty unique list");let u=e.network==="testnet"?g.testnet.chainId:g.mainnet.chainId;if(e.encoding==="eip712"){let i=e.domain;i?(Object.hasOwn(i,"salt")&&n("R1","domain must not carry a salt"),i.name||n("R1","domain name is missing"),!i.version&&e.class!=="relayed"&&n("R1","domain version is missing"),i.chainId!==u&&n("R1",`domain chain must be ${u}`),i.verifyingContract?r.has(i.verifyingContract.toLowerCase())||n("R1","verifying contract is not a pinned address"):e.class!=="cancel"&&e.class!=="auth"&&n("R1","verifying contract is missing")):n("R1","EIP-712 spec has no domain")}else e.domain&&n("R1","only EIP-712 specs carry a domain");if(e.encoding==="eip191-packed-hash"){let i=a("pinned").map(([,d])=>d.value);i.some(d=>d===u||d===String(u))||n("R1","packed layout must pin the chain id"),i.some(d=>typeof d=="string"&&r.has(d.toLowerCase()))||n("R1","packed layout must pin the verifying contract")}let c=new Map,f=e.class==="relayed"&&!Object.keys(e.types).length;if(e.encoding==="eip712"&&!f){Object.hasOwn(e.types,"EIP712Domain")&&n("R2","types must never carry EIP712Domain");try{c=T(e.types,e.primaryType);let i=N(e.types,e.primaryType);for(let d of Object.keys(e.types))i.has(d)||n("R2",`type ${d} is not reachable from ${e.primaryType}`)}catch{n("R2",`types do not resolve from ${e.primaryType}`)}for(let i of c.keys())Object.hasOwn(e.fields,i)||n("R3",`message path ${i} has no role`);for(let[i]of s)c.has(i)||n("R3",`declared field ${i} is not in the typed struct`)}else e.encoding!=="eip712"&&Object.keys(e.types).length&&n("R2","only EIP-712 specs carry types");for(let[i,d]of s)(!d.meaning||d.meaning.length>160)&&n("R3",`field ${i} needs a plain-English meaning`);(e.class==="order"||e.class==="offer")&&!s.some(([,i])=>i.role==="amount"&&i.side==="out")&&!o("amount-out")&&n("R4",`${e.class} must show the most that can leave`);for(let[i,d]of s){if(d.role==="amount"||d.role==="fee"){let h=d.token;(x(h,{strict:!1})?r.has(h.toLowerCase()):e.fields[h]?.role==="token")||n("R4",`amount ${i} does not name a token field or a pinned token`)}c.get(i)==="bytes"&&d.role!=="pinned"&&d.role!=="derived"&&n("R4",`bytes field ${i} must be pinned or derived`)}if(e.maxLifetimeSeconds>0&&e.maxLifetimeSeconds<=O||n("R5","maxLifetimeSeconds must be within 30 days"),y.has(e.class)){let i=a("expiry").length+o("expiry");i!==1&&n("R5",`${e.class} needs exactly one expiry (found ${i})`),e.expiry&&n("R5","API-only expiry is not a signed expiry"),e.expiryBinding&&e.expiryBinding!=="signed"&&n("R5",`${e.class} requires signed expiry`)}if(e.expiryBinding==="program-link"&&e.class!=="link"&&n("R5","only link can use program-link"),e.class==="link"&&e.expiryBinding!=="program-link"&&a("expiry").length+o("expiry")!==1&&n("R5","link needs signed expiry or program-link binding"),e.expiryBinding==="auth-window"){let i=e.authWindow;(e.class!=="auth"||!i||!c.has(i.field)||!Number.isSafeInteger(i.maxAgeSeconds)||i.maxAgeSeconds<=0||i.maxAgeSeconds>e.maxLifetimeSeconds||!Number.isSafeInteger(i.maxFutureSeconds)||i.maxFutureSeconds<0||i.maxFutureSeconds>e.maxLifetimeSeconds)&&n("R5","auth-window needs a signed timestamp and pinned acceptance window")}else e.authWindow&&n("R5","authWindow requires auth-window binding");return e.expiryBinding==="cancel-only"&&(e.class!=="cancel"||!a("nonce").length&&!o("nonce")&&!e.revoke?.staysExecutableUntilExpiry)&&n("R5","cancel-only needs a single-use nonce or targeted non-revoking hide"),(e.class==="auth"||e.class==="cancel")&&(s.some(([,i])=>i.role==="amount"&&i.side==="out")||o("amount-out"))&&n("R4","auth and cancel cannot grant spending authority"),E.has(e.class)&&!(e.revoke?.onchainTool||e.revoke?.offchainSpec)&&!(e.revoke?.none&&e.maxLifetimeSeconds<=I)&&n("R6",`${e.class} needs a revocation path (only a one-shot approval of at most one hour may declare none)`),e.submit.by==="addon"&&(!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(e.submit.host)||!/^\/[A-Za-z0-9/_.-]*$/.test(e.submit.path))&&n("R9","add-on submission needs a bare HTTPS host and a fixed path"),e.submit.by==="server-continuation"&&!e.submit.reason&&n("R9","server-continuation needs its recorded reason"),e.submit.by==="transaction"&&e.class!=="relayed"&&e.class!=="consent"&&n("R9","only relayed and consent signatures are consumed by a transaction"),(!/^[A-Za-z0-9 .'-]{1,40}$/.test(e.program)||!/^[A-Za-z0-9 .'-]{1,60}$/.test(e.purpose))&&n("R10","program and purpose must be short constant text"),m.has(e.class)&&!e.requireHuman&&!e.humanException&&n("C13",`${e.class} must require a human`),!m.has(e.class)&&e.humanException&&n("C13","only a value class can name a human exception"),e.relayedPaths&&e.class!=="relayed"&&n("ID","only relayed specs accept caller signatures"),e.enabled===!1&&!e.disabledReason&&n("ID","a disabled spec states why"),t}function z(e,r=A()){let t=e.filter(a=>a.enabled!==!1).flatMap(a=>j(a,r)),n=new Set,s=new Set;for(let a of e){n.has(a.id)&&t.push(`ID ${a.id}: duplicate spec id`),n.add(a.id);let o=C(a);s.has(o)&&t.push(`ID ${a.id}: another spec already covers ${o}`),s.add(o)}return t}function C(e){return`${e.network??"mainnet"}:${e.encoding}:${(e.domain?.verifyingContract??"-").toLowerCase()}:${e.primaryType}`}function k(e,r,t,n,s){let a=r.replace(/(\[[0-9]*\])+$/,"");if(a!==r){if(!Array.isArray(t))throw l(`message field ${n||r} is not declared`);for(let i of t)k(e,r.replace(/\[[0-9]*\]$/,""),i,`${n}[]`,s+1);return}let o=e[a];if(!o)return;if(s>8||!t||typeof t!="object"||Array.isArray(t))throw l(`message field ${n||r} is not declared`);let u=Object.keys(t),c=o.map(i=>i.name);if(u.find(i=>!c.includes(i))!==void 0)throw l(`an undeclared message field${n?` under ${n}`:""} is present`);for(let i of o){if(!Object.hasOwn(t,i.name))throw l(`message field ${n?`${n}.`:""}${i.name} is missing`);k(e,i.type,t[i.name],`${n?`${n}.`:""}${i.name}`,s+1)}}function W(e,r){if(e.encoding!=="eip712"||!e.domain)throw l("Oak has no signing contract for this request");if(!r||typeof r!="object"||!r.domain||typeof r.domain!="object")throw l("domain, chain or verifying contract is not the pinned one");let t=Object.fromEntries(Object.entries(e.domain).filter(([,n])=>n!==void 0));if(!b(Object.keys(r.domain).sort(),Object.keys(t).sort())||!b({...r.domain},t))throw l("domain, chain or verifying contract is not the pinned one");if(!r.types||typeof r.types!="object"||Object.hasOwn(r.types,"EIP712Domain")||!b(r.types,e.types)||r.primaryType!==e.primaryType)throw l("typed-data types changed");k(e.types,e.primaryType,r.message,"",0)}function p(e,r){let t=e;for(let n of r.split(".")){if(n.endsWith("[]")||!t||typeof t!="object"||Array.isArray(t))return;t=t[n]}return t}var $=e=>typeof e=="string"?e:typeof e=="number"||typeof e=="bigint"?String(e):void 0;function D(e,r){let t={},n=s=>x(s,{strict:!1})?s:$(p(r,s));for(let[s,a]of Object.entries(e.fields)){let o=$(p(r,s));if(o!==void 0)switch(a.role){case"signer":t.signer=o;break;case"account":t.account=o;break;case"recipient":t.recipient=o;break;case"delegate":t.delegate=o;break;case"counterparty":t.counterparty=o;break;case"token":a.side==="out"?t.tokenOut=o:t.tokenIn=o;break;case"amount":a.side==="out"?(t.amountOut=o,t.tokenOut??=n(a.token)):(t.minAmountIn=o,t.tokenIn??=n(a.token));break;case"fee":(t.fees??=[]).push({token:n(a.token)??a.token,value:o});break;case"expiry":t.expiry=/^[0-9]+$/.test(o)?Number(o):Number.NaN;break;case"nonce":t.nonce=o;break;default:break}}return t}function L(e,r,t){let n=Math.min(e.maxLifetimeSeconds,O),s=y.has(e.class)||e.humanException?60:1;if(!Number.isSafeInteger(t)||t<0||!Number.isFinite(n)||n<=0||r===void 0||!Number.isSafeInteger(r)||r<=0||r>=S||r<t+s||r>t+n)throw l(`expiry is missing, past or beyond ${n>=86400?`${Math.floor(n/86400)} days`:`${Math.ceil(n/60)} minutes`}`)}function U(e,r,t,n){if(e.enabled===!1)throw l("Oak has no signing contract for this request");if(!Number.isSafeInteger(t)||t<0||t>=S)throw l("signing time is unavailable");if(e.expiryBinding==="auth-window"){let o=e.authWindow,u=o&&p(r,o.field),c=typeof u=="number"?u:typeof u=="string"&&/^[0-9]+$/.test(u)?Number(u):NaN;if(e.class!=="auth"||!o||!Number.isSafeInteger(c)||c<=0||c>=S||c<t-o.maxAgeSeconds||c>t+o.maxFutureSeconds)throw l("authentication time is outside the pinned window");return c+o.maxAgeSeconds}if(e.expiryBinding==="cancel-only"){if(e.class!=="cancel")throw l("Oak has no signing contract for this request");return n}if(e.expiryBinding==="program-link")throw l("program link authority is not configured");if(y.has(e.class)&&(e.expiry||e.expiryBinding&&e.expiryBinding!=="signed"))throw l("order expiry must be signed");let s=D(e,r).expiry??n,a=Object.values(e.fields).some(o=>o.role==="expiry"||o.role==="derived"&&o.yields?.includes("expiry"));if(y.has(e.class)&&!a)throw l("order expiry must be signed");return(a||m.has(e.class))&&L(e,s,t),s}function H(e){if(e===void 0||!/^[0-9]{1,78}$/.test(e))throw l("open-ended or out-of-range amount");let r=BigInt(e);if(r<=0n||r>=v)throw l("open-ended or out-of-range amount");return r}function J(e,r){return Object.entries(e.fields).map(([t,n])=>{let s=t.includes("[]")?"(each item, listed below)":p(r,t),a=typeof s=="object"&&s!==null?JSON.stringify(s):String(s);a.length>200&&(a=`${a.slice(0,200)}\u2026`);let o=JSON.stringify(a).replace(/[\u007f-\u009f\u2028\u2029\u202a-\u202e\u2066-\u2069]/g,u=>`\\u${u.charCodeAt(0).toString(16).padStart(4,"0")}`);return`${t} = ${o} - ${n.meaning}`})}export{O as a,v as b,m as c,l as d,V as e,T as f,A as g,j as h,z as i,C as j,W as k,p as l,D as m,L as n,U as o,H as p,J as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as y,i as A}from"./KIFSRO5K.js";import{b as p,e as f,g as v}from"./T2WHOZXM.js";import{c as l}from"./NWNYJ26T.js";import{a as g}from"./FWD4L3CJ.js";import{a as r}from"./XSD5NL7J.js";import{parseAbi as I,zeroAddress as N}from"viem";var S=I(["function observe(uint32[] secondsAgos) view returns (int56[] tickCumulatives,uint160[] secondsPerLiquidityCumulativeX128s)"]);function j(s){return{tools:[{name:"uniswap_oracle",inputSchema:{type:"object",additionalProperties:!1,required:["token0","token1","fee","secondsAgo"],properties:{token0:l,token1:l,fee:{type:"integer",minimum:0,maximum:999999},secondsAgo:{type:"integer",minimum:1,maximum:4294967295}}},async execute(t){v(t,["token0","token1","fee","secondsAgo"]);let a=p(t.token0),c=p(t.token1),o=t.fee,e=t.secondsAgo;if(BigInt(a)>=BigInt(c))throw new r("Oracle tokens must be strictly sorted token0 < token1.");if(typeof o!="number"||!Number.isInteger(o)||o<0||o>=1e6||typeof e!="number"||!Number.isInteger(e)||e<=0||e>4294967295)throw new r("Provide integer fee pips and a positive uint32 secondsAgo.");let m=s.clientFor(g),i=await m.getBlockNumber(),u=await m.readContract({address:y.factory,abi:A,functionName:"getPool",args:[a,c,o],blockNumber:i});if(u===N)throw new r("No factory-verified v3 pool exists for this oracle.");let[[n,k],w,h]=await Promise.all([m.readContract({address:u,abi:S,functionName:"observe",args:[[e,0]],blockNumber:i}),f(s,a,i),f(s,c,i)]);if(n.length!==2||k.length!==2)throw new r("Oracle returned an unexpected observation count.");let d=n[1]-n[0],b=BigInt(e),P=d/b-(d<0n&&d%b!==0n?1n:0n);return{pool:u,token0:w,token1:h,secondsAgo:e,blockNumber:i.toString(),tickCumulatives:n.map(String),secondsPerLiquidityCumulativeX128s:k.map(String),arithmeticMeanTick:P.toString(),summary:"V3 time-weighted arithmetic mean tick, rounded toward negative infinity. Price is token1-base-units per token0-base-unit before decimal adjustment. Insufficient pool history reverts; an unavailable oracle is never reported as zero."}}}]}}export{j as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,d as H,m as M}from"./
|
|
1
|
+
import{c as g,d as H,m as M}from"./QZZ4O34L.js";import{f as k,g as C}from"./T2WHOZXM.js";import{d,e as s,y as _}from"./GEIFITAQ.js";import{g as h}from"./NWNYJ26T.js";import{a as w}from"./FWD4L3CJ.js";import{a as t}from"./XSD5NL7J.js";import{decodeFunctionData as b,encodeFunctionData as B,erc20Abi as $,getAddress as O}from"viem";function K(u){return{tools:[{name:"uniswap_swap_batch",inputSchema:{type:"object",additionalProperties:!1,required:["routes"],properties:{routes:{type:"array",minItems:1,maxItems:20,items:{type:"object",description:"Complete uniswap_swap arguments, including an absolute minAmountOut or maxAmountIn."}}}},async execute(n,v){if(C(n,["routes"]),!Array.isArray(n.routes)||n.routes.length<1||n.routes.length>20)throw new t("Provide 1 to 20 explicit bounded Uniswap routes.");let c=new Map,i="0x",A=0n,a,m=[],y=new Set;for(let e of n.routes){if(!e||typeof e!="object"||Array.isArray(e))throw new t("Each route must contain uniswap_swap arguments.");let I=await M(u,e,v,!1);if(!("txs"in I))throw new t("Route did not build swap transactions.");let E=I.txs;for(let r of E.slice(0,-1))if(h(r.to,d)){let[o,D,N,S]=b({abi:H,data:r.data}).args;if(D!==s)throw new t("Unexpected route approval spender.");let T=o.toLowerCase(),p=c.get(T),U=(p?.amount??0n)+N;if(U>=1n<<160n)throw new t("Combined input approvals exceed uint160.");c.set(T,{token:o,amount:U,expiration:p&&p.expiration<BigInt(S)?p.expiration:BigInt(S)})}else{let o=b({abi:$,data:r.data});if(o.functionName!=="approve"||!h(o.args[0],d))throw new t("Unexpected route prerequisite.")}let f=E.at(-1);if(f.to!==s)throw new t("Route does not use the pinned Universal Router.");A+=BigInt(f.value);let[j,x,P]=b({abi:g,data:f.data}).args,R=j.slice(2).match(/../g)??[];if(R.length!==x.length)throw new t("Unexpected route command/parameter count.");R.forEach((r,o)=>{r==="04"?y.add(x[o]):(i=`${i}${r}`,m.push(x[o]))}),a=a===void 0||P<a?P:a}for(let e of y)i=`${i}04`,m.push(e);let l=[];for(let e of c.values())l.push(u.approval(O(e.token),d,e.amount.toString(),w),_(e.token,s,e.amount.toString(),e.expiration.toString()));return l.push(u.unsignedTx({to:s,data:B({abi:g,functionName:"execute",args:[i,m,a]}),value:A.toString(),chainId:w,description:`Atomically execute ${n.routes.length} caller-selected v2/v3/v4 routes, preserving each route's trade bound.`})),k(u,l,v,"Explicit mixed-version/split routes; every route must meet its own bound. No automatic best-route search or allow-revert branch. The wallet must fund each independently previewed route.")}}]}}export{K as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./VEQBHI6O.js";import{a as l,c}from"./OTXSKFUD.js";import{a as s}from"./XSD5NL7J.js";import{isAddress as u}from"viem";var m="https://api-v2.pendle.finance/core/v3/sdk/4663/convert",o=class extends s{constructor(a,n){super(n);this.kind=a}kind};function d(e){if(!e||typeof e!="object"||Array.isArray(e))throw new o("malformed","Pendle sent an incomplete or malformed quote. Try again.");return e}function b(e){if(typeof e!="string"||!/^[0-9]+$/.test(e)||e.length>78||BigInt(e)>=1n<<256n)throw new o("malformed","Pendle sent a malformed token amount. Try again.");return BigInt(e)}function w(e){if(typeof e!="string"||!u(e,{strict:!1}))throw new o("malformed","Pendle sent a malformed token or contract address. Try again.");return e}function g(e){let t=d(e);if(!Array.isArray(t.routes)||!t.routes.length||!Array.isArray(t.requiredApprovals))throw new o("malformed","Pendle sent an incomplete quote. Try again.");let a=d(t.routes[0]),n=d(a.tx);if(w(n.to),typeof n.data!="string"||!/^0x(?:[0-9a-fA-F]{2})+$/.test(n.data)||!Array.isArray(a.outputs)||!a.outputs.length)throw new o("malformed","Pendle sent incomplete transaction details. Try again.");return d(a.data),a}async function k(e,t){if(!Number.isInteger(t.slippageBps)||t.slippageBps<0||t.slippageBps>1e4||t.amount<=0n||t.amount>=1n<<256n)throw new s("Provide a positive token amount and a valid slippage limit.");let a=Date.now(),n;try{n=await e(m,{method:"POST",headers:{"User-Agent":"oak-core/pendle","Content-Type":"application/json"},body:JSON.stringify({inputs:[{token:t.inputToken,amount:t.amount.toString()}],outputs:[t.outputToken],receiver:t.wallet,slippage:t.slippageBps/1e4,enableAggregator:!1}),signal:AbortSignal.timeout(15e3)})}catch(r){if(r instanceof f)n=r.response;else throw c(r)||r instanceof s&&r.message==="The request was cancelled."?r:r instanceof DOMException&&r.name==="AbortError"?new s("The request was cancelled."):r instanceof s&&r.message==="The service returned malformed JSON."?new o("malformed","Pendle sent a malformed quote. Try again."):new o("unavailable","Pendle's price service isn't answering. Try again later.")}if(n.status===429){let r=n.headers.get("Retry-After"),p=r===null?1:/^\d+(\.\d+)?$/.test(r)?Number(r):(Date.parse(r)-Date.now())/1e3;throw new l("Pendle",Number.isFinite(p)?p:1)}let i;try{i=await n.json()}catch{throw n.status===403?new o("forbidden","Pendle's price service refused the request. Try again later."):n.ok?new o("malformed","Pendle sent a malformed quote. Try again."):new o("http","Pendle's price service isn't answering. Try again later.")}if(!n.ok)throw JSON.stringify(i).includes("INPUT_VALUATION_TOO_LOW")?new o("dust","This amount is too small for Pendle to quote. Try a larger amount."):n.status===403?new o("forbidden","Pendle's price service refused the request. Try again later."):new o("http","Pendle's price service isn't answering. Try again later.");return g(i),{body:i,receivedAt:a}}export{m as a,o as b,d as c,b as d,w as e,g as f,k as g};
|