@oakagentkit/core 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/api/addresses.d.ts +14 -0
- package/build/dist/api/addresses.js +1 -1
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/history.d.ts +2 -0
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/identity-link.js +1 -1
- package/build/dist/api/metadata.js +1 -1
- package/build/dist/api/modules/beefy/boosts.js +1 -1
- package/build/dist/api/modules/beefy/clm.js +1 -1
- package/build/dist/api/modules/beefy/guard.js +1 -1
- package/build/dist/api/modules/beefy/index.js +1 -1
- package/build/dist/api/modules/beefy/liquidity.js +1 -1
- package/build/dist/api/modules/beefy/management.js +1 -1
- package/build/dist/api/modules/beefy/vaults.js +1 -1
- package/build/dist/api/modules/borro/actions.js +1 -1
- package/build/dist/api/modules/borro/index.js +1 -1
- package/build/dist/api/modules/borro/liquidity.js +1 -1
- package/build/dist/api/modules/borro/positions.js +1 -1
- package/build/dist/api/modules/borro/reader.js +1 -1
- package/build/dist/api/modules/chop/display.js +1 -1
- package/build/dist/api/modules/chop/guard.js +1 -1
- package/build/dist/api/modules/chop/index.js +1 -1
- package/build/dist/api/modules/clanker/extensions.js +1 -1
- package/build/dist/api/modules/clanker/index.js +1 -1
- package/build/dist/api/modules/clanker/manage.js +1 -1
- package/build/dist/api/modules/clanker/pool-config.js +1 -1
- package/build/dist/api/modules/clanker/protocol.js +1 -1
- package/build/dist/api/modules/clanker/state.js +1 -1
- package/build/dist/api/modules/earn/index.js +1 -1
- package/build/dist/api/modules/erc8004/common.js +1 -1
- package/build/dist/api/modules/erc8004/domain.js +1 -1
- package/build/dist/api/modules/erc8004/index.js +1 -1
- package/build/dist/api/modules/erc8004/management.js +1 -1
- package/build/dist/api/modules/erc8004/reputation.js +1 -1
- package/build/dist/api/modules/erc8004/services.js +1 -1
- package/build/dist/api/modules/erc8004/thesis.js +1 -1
- package/build/dist/api/modules/erc8004/validation.js +1 -1
- package/build/dist/api/modules/fobo/index.js +1 -1
- package/build/dist/api/modules/fobo/intent.js +1 -1
- package/build/dist/api/modules/fobo/steps.js +1 -1
- package/build/dist/api/modules/fobo/verify.js +1 -1
- package/build/dist/api/modules/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
- package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
- package/build/dist/api/modules/hoodag/index.js +1 -1
- package/build/dist/api/modules/hoodag/management.js +1 -1
- package/build/dist/api/modules/hoodag/public-reads.js +1 -1
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/buyback.js +1 -1
- package/build/dist/api/modules/hoodlock/commerce.js +1 -1
- package/build/dist/api/modules/hoodlock/fee.js +1 -1
- package/build/dist/api/modules/hoodlock/guard.js +1 -1
- package/build/dist/api/modules/hoodlock/index.js +1 -1
- package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
- package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
- package/build/dist/api/modules/hoodlock/public.js +1 -1
- package/build/dist/api/modules/hookr/actions.d.ts +39 -2
- package/build/dist/api/modules/hookr/actions.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.d.ts +14 -2
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/agent-link.d.ts +17 -0
- package/build/dist/api/modules/hookr/agent-link.js +1 -0
- package/build/dist/api/modules/hookr/api-client.d.ts +9 -0
- package/build/dist/api/modules/hookr/api-client.js +1 -0
- package/build/dist/api/modules/hookr/blocks/advisory.d.ts +41 -0
- package/build/dist/api/modules/hookr/blocks/advisory.js +1 -0
- package/build/dist/api/modules/hookr/blocks/buy-sell-block.d.ts +7 -0
- package/build/dist/api/modules/hookr/blocks/buy-sell-block.js +1 -0
- package/build/dist/api/modules/hookr/blocks/core-settings.d.ts +6 -0
- package/build/dist/api/modules/hookr/blocks/core-settings.js +1 -0
- package/build/dist/api/modules/hookr/blocks/exit-clock.d.ts +14 -0
- package/build/dist/api/modules/hookr/blocks/exit-clock.js +1 -0
- package/build/dist/api/modules/hookr/blocks/holder-pot.d.ts +30 -0
- package/build/dist/api/modules/hookr/blocks/holder-pot.js +1 -0
- package/build/dist/api/modules/hookr/blocks/managed-fee.d.ts +96 -0
- package/build/dist/api/modules/hookr/blocks/managed-fee.js +1 -0
- package/build/dist/api/modules/hookr/blocks/market-guard.d.ts +116 -0
- package/build/dist/api/modules/hookr/blocks/market-guard.js +1 -0
- package/build/dist/api/modules/hookr/blocks/market-hours-fee.d.ts +87 -0
- package/build/dist/api/modules/hookr/blocks/market-hours-fee.js +1 -0
- package/build/dist/api/modules/hookr/blocks/pay-later.d.ts +199 -0
- package/build/dist/api/modules/hookr/blocks/pay-later.js +1 -0
- package/build/dist/api/modules/hookr/blocks/sandwich-guard.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/sandwich-guard.js +1 -0
- package/build/dist/api/modules/hookr/blocks/storm-fee.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/storm-fee.js +1 -0
- package/build/dist/api/modules/hookr/blocks/swap-cut.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/swap-cut.js +1 -0
- package/build/dist/api/modules/hookr/blocks/swap-reward-mint.d.ts +125 -0
- package/build/dist/api/modules/hookr/blocks/swap-reward-mint.js +1 -0
- package/build/dist/api/modules/hookr/blocks/wallet-cap.d.ts +3 -0
- package/build/dist/api/modules/hookr/blocks/wallet-cap.js +1 -0
- package/build/dist/api/modules/hookr/blocks/zap-source.d.ts +161 -0
- package/build/dist/api/modules/hookr/blocks/zap-source.js +1 -0
- package/build/dist/api/modules/hookr/blocks/zap-target.d.ts +51 -0
- package/build/dist/api/modules/hookr/blocks/zap-target.js +1 -0
- package/build/dist/api/modules/hookr/claims.d.ts +53 -0
- package/build/dist/api/modules/hookr/claims.js +1 -0
- package/build/dist/api/modules/hookr/contracts.d.ts +3 -1
- package/build/dist/api/modules/hookr/contracts.js +1 -1
- package/build/dist/api/modules/hookr/create-cancel.js +1 -1
- package/build/dist/api/modules/hookr/discovery.d.ts +2 -2
- package/build/dist/api/modules/hookr/discovery.js +1 -1
- package/build/dist/api/modules/hookr/fill-bounty.d.ts +2 -0
- package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
- package/build/dist/api/modules/hookr/gas.d.ts +48 -0
- package/build/dist/api/modules/hookr/gas.js +1 -0
- package/build/dist/api/modules/hookr/gates.d.ts +51 -0
- package/build/dist/api/modules/hookr/gates.js +1 -0
- package/build/dist/api/modules/hookr/hook-blocks.d.ts +304 -0
- package/build/dist/api/modules/hookr/hook-blocks.js +1 -0
- package/build/dist/api/modules/hookr/index.d.ts +4 -2
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/jobs.d.ts +7 -0
- package/build/dist/api/modules/hookr/jobs.js +1 -0
- package/build/dist/api/modules/hookr/launch-options.d.ts +52 -3
- package/build/dist/api/modules/hookr/launch-options.js +1 -1
- package/build/dist/api/modules/hookr/launch-profile.d.ts +8 -0
- package/build/dist/api/modules/hookr/launch-profile.js +1 -1
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.d.ts +24 -0
- package/build/dist/api/modules/hookr/launch.js +1 -1
- package/build/dist/api/modules/hookr/liquidity.js +1 -1
- package/build/dist/api/modules/hookr/lp-positions.js +1 -1
- package/build/dist/api/modules/hookr/lp-reads.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.d.ts +90 -2
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/pay-later-actions.d.ts +52 -0
- package/build/dist/api/modules/hookr/pay-later-actions.js +1 -0
- package/build/dist/api/modules/hookr/pins.d.ts +5 -0
- package/build/dist/api/modules/hookr/pins.js +1 -1
- package/build/dist/api/modules/hookr/pm-liquidity.d.ts +215 -0
- package/build/dist/api/modules/hookr/pm-liquidity.js +1 -0
- package/build/dist/api/modules/hookr/public-reads.d.ts +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/hookr/revenue.d.ts +4 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/hookr/scan.d.ts +25 -0
- package/build/dist/api/modules/hookr/scan.js +1 -0
- package/build/dist/api/modules/hookr/swap.d.ts +161 -0
- package/build/dist/api/modules/hookr/swap.js +1 -0
- package/build/dist/api/modules/kyberswap/index.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/abi.js +1 -1
- package/build/dist/api/modules/layerbank/actions.js +1 -1
- package/build/dist/api/modules/layerbank/checks.js +1 -1
- package/build/dist/api/modules/layerbank/index.js +1 -1
- package/build/dist/api/modules/layerbank/merkl.js +1 -1
- package/build/dist/api/modules/layerbank/reader.js +1 -1
- package/build/dist/api/modules/layerbank/reserve.js +1 -1
- package/build/dist/api/modules/lighter/index.js +1 -1
- package/build/dist/api/modules/longbow/administration.js +1 -1
- package/build/dist/api/modules/longbow/analytics.js +1 -1
- package/build/dist/api/modules/longbow/fixed.js +1 -1
- package/build/dist/api/modules/longbow/index.js +1 -1
- package/build/dist/api/modules/longbow/nft.js +1 -1
- package/build/dist/api/modules/longbow/rebates.js +1 -1
- package/build/dist/api/modules/longbow/staking.js +1 -1
- package/build/dist/api/modules/meridian/index.js +1 -1
- package/build/dist/api/modules/meridian/markets.js +1 -1
- package/build/dist/api/modules/meridian/rfq.js +1 -1
- package/build/dist/api/modules/merkl/discovery.js +1 -1
- package/build/dist/api/modules/merkl/index.js +1 -1
- package/build/dist/api/modules/merkl/manage.js +1 -1
- package/build/dist/api/modules/merkl/protocol.js +1 -1
- package/build/dist/api/modules/morpho/allocator.js +1 -1
- package/build/dist/api/modules/morpho/bundles.js +1 -1
- package/build/dist/api/modules/morpho/in-kind.js +1 -1
- package/build/dist/api/modules/morpho/index.js +1 -1
- package/build/dist/api/modules/morpho/local-guard.js +1 -1
- package/build/dist/api/modules/morpho/midnight.js +1 -1
- package/build/dist/api/modules/morpho/protocol.js +1 -1
- package/build/dist/api/modules/morpho/vault-management.js +1 -1
- package/build/dist/api/modules/morpho/vault-tools.js +1 -1
- package/build/dist/api/modules/morpho/vault-v2.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.js +1 -1
- package/build/dist/api/modules/netnet/desk-read.js +1 -1
- package/build/dist/api/modules/netnet/financial.js +1 -1
- package/build/dist/api/modules/netnet/index.js +1 -1
- package/build/dist/api/modules/netnet/staking.js +1 -1
- package/build/dist/api/modules/orbio/index.js +1 -1
- package/build/dist/api/modules/orbio/positions.js +1 -1
- package/build/dist/api/modules/pendle/costs.js +1 -1
- package/build/dist/api/modules/pendle/index.js +1 -1
- package/build/dist/api/modules/pendle/markets.js +1 -1
- package/build/dist/api/modules/pendle/positions.js +1 -1
- package/build/dist/api/modules/pendle/pricecheck.js +1 -1
- package/build/dist/api/modules/pendle/reader.js +1 -1
- package/build/dist/api/modules/pendle/redeem.js +1 -1
- package/build/dist/api/modules/pendle/trade.js +1 -1
- package/build/dist/api/modules/pendle/validate.js +1 -1
- package/build/dist/api/modules/pendle/verify.js +1 -1
- package/build/dist/api/modules/pons/claim.js +1 -1
- package/build/dist/api/modules/pons/index.js +1 -1
- package/build/dist/api/modules/pons/launch-status.js +1 -1
- package/build/dist/api/modules/pons/prices.js +1 -1
- package/build/dist/api/modules/pons/reads.js +1 -1
- package/build/dist/api/modules/pons/swap-terms.js +1 -1
- package/build/dist/api/modules/pons/trade.js +1 -1
- package/build/dist/api/modules/poolstrade/index.js +1 -1
- package/build/dist/api/modules/priors/coverage.js +1 -1
- package/build/dist/api/modules/priors/discovery.js +1 -1
- package/build/dist/api/modules/priors/features.js +1 -1
- package/build/dist/api/modules/priors/holdings.js +1 -1
- package/build/dist/api/modules/priors/index.js +1 -1
- package/build/dist/api/modules/priors/integration.js +1 -1
- package/build/dist/api/modules/priors/market.js +1 -1
- package/build/dist/api/modules/priors/pt.js +1 -1
- package/build/dist/api/modules/priors/savings-exit.js +1 -1
- package/build/dist/api/modules/priors/starter-line.js +1 -1
- package/build/dist/api/modules/priors/stock-swap.js +1 -1
- package/build/dist/api/modules/raeto/index.js +1 -1
- package/build/dist/api/modules/relay/bootstrap.js +1 -1
- package/build/dist/api/modules/relay/discovery.js +1 -1
- package/build/dist/api/modules/relay/inbound.js +1 -1
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/reads.js +1 -1
- package/build/dist/api/modules/spark/actions.js +1 -1
- package/build/dist/api/modules/spark/details.js +1 -1
- package/build/dist/api/modules/spark/index.js +1 -1
- package/build/dist/api/modules/spark/management.js +1 -1
- package/build/dist/api/modules/steakhouse/analytics.js +1 -1
- package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
- package/build/dist/api/modules/steakhouse/index.js +1 -1
- package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
- package/build/dist/api/modules/steakhouse/management.js +1 -1
- package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
- package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
- package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
- package/build/dist/api/modules/tickerspring/discovery.js +1 -1
- package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
- package/build/dist/api/modules/tickerspring/guards.js +1 -1
- package/build/dist/api/modules/tickerspring/index.js +1 -1
- package/build/dist/api/modules/tickerspring/journeys.js +1 -1
- package/build/dist/api/modules/tickerspring/ladder.js +1 -1
- package/build/dist/api/modules/tickerspring/maker.js +1 -1
- package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
- package/build/dist/api/modules/tickerspring/research.js +1 -1
- package/build/dist/api/modules/tickerspring/strategies.js +1 -1
- package/build/dist/api/modules/uniswap/auction-create.js +1 -1
- package/build/dist/api/modules/uniswap/auction.js +1 -1
- package/build/dist/api/modules/uniswap/batch.js +1 -1
- package/build/dist/api/modules/uniswap/common.js +1 -1
- package/build/dist/api/modules/uniswap/fees.js +1 -1
- package/build/dist/api/modules/uniswap/index.js +1 -1
- package/build/dist/api/modules/uniswap/local-guard.js +1 -1
- package/build/dist/api/modules/uniswap/oracle.js +1 -1
- package/build/dist/api/modules/uniswap/pool-math.js +1 -1
- package/build/dist/api/modules/uniswap/pools.js +1 -1
- package/build/dist/api/modules/uniswap/position.js +1 -1
- package/build/dist/api/modules/uniswap/protocol.js +1 -1
- package/build/dist/api/modules/uniswap/quote-guard.js +1 -1
- package/build/dist/api/modules/uniswap/stock-prices.d.ts +25 -0
- package/build/dist/api/modules/uniswap/stock-prices.js +1 -1
- package/build/dist/api/modules/uniswap/stocks.js +1 -1
- package/build/dist/api/modules/uniswap/token-jar.js +1 -1
- package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
- package/build/dist/api/modules/uniswap/trade.js +1 -1
- package/build/dist/api/modules/uniswap/v2.js +1 -1
- package/build/dist/api/modules/uniswap/v3.js +1 -1
- package/build/dist/api/modules/uniswap/v4.js +1 -1
- package/build/dist/api/modules/uniswap/wrap.js +1 -1
- package/build/dist/api/modules/upoch/index.js +1 -1
- package/build/dist/api/modules/upoch/reads.js +1 -1
- package/build/dist/api/modules/velora/claims.js +1 -1
- package/build/dist/api/modules/velora/delta-reads.js +1 -1
- package/build/dist/api/modules/velora/index.js +1 -1
- package/build/dist/api/modules/wormhole/index.js +1 -1
- package/build/dist/api/modules/wormhole/scan-text.d.ts +1 -1
- package/build/dist/api/positions.js +1 -1
- package/build/dist/api/pricenote.js +1 -1
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/rpc.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/signing.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.d.ts +2 -0
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.d.ts +9 -1
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/universal-router.js +1 -1
- package/build/dist/api/usd-estimate.js +1 -1
- package/build/dist/chunks/{DMDOSHV7.js → 266VIESP.js} +1 -1
- package/build/dist/chunks/{R66NSNNQ.js → 2BKZLF5A.js} +1 -1
- package/build/dist/chunks/{HFVXNKA5.js → 2BM2WX2G.js} +1 -1
- package/build/dist/chunks/{OY5W7ZSL.js → 2H2OZE6X.js} +1 -1
- package/build/dist/chunks/{E76Z2TT4.js → 2QQ5CGQI.js} +1 -1
- package/build/dist/chunks/{4PLLS6CT.js → 2VYA6WIN.js} +1 -1
- package/build/dist/chunks/{LCH6F5HT.js → 342OZP53.js} +1 -1
- package/build/dist/chunks/{C57DITTF.js → 3HF6WE4L.js} +1 -1
- package/build/dist/chunks/3M7RMROZ.js +1 -0
- package/build/dist/chunks/3RGED2KO.js +1 -0
- package/build/dist/chunks/{4HQEJHCD.js → 3XIJCHT7.js} +1 -1
- package/build/dist/chunks/3XY44BP5.js +1 -0
- package/build/dist/chunks/3YNXQ3EZ.js +1 -0
- package/build/dist/chunks/45QP74CE.js +1 -0
- package/build/dist/chunks/{SX5YNFHG.js → 4GAU3JLN.js} +1 -1
- package/build/dist/chunks/{Y2QADJOB.js → 4P6DRKY3.js} +1 -1
- package/build/dist/chunks/{W3DGFMQE.js → 4RTXP2YP.js} +1 -1
- package/build/dist/chunks/{QMIH6HXH.js → 4SXRXNHG.js} +1 -1
- package/build/dist/chunks/{ZTKT3ZQK.js → 53VBLEYS.js} +1 -1
- package/build/dist/chunks/{FRT6AC6M.js → 5677LZOV.js} +1 -1
- package/build/dist/chunks/{ADIPEGNN.js → 5AO2QPWE.js} +1 -1
- package/build/dist/chunks/{GQITAJVF.js → 5BPFF7NX.js} +1 -1
- package/build/dist/chunks/{JDHPMS7X.js → 5DWQUEBA.js} +1 -1
- package/build/dist/chunks/{WAKZWSHB.js → 5KKAN7XQ.js} +1 -1
- package/build/dist/chunks/{VVAM3EAK.js → 5N6YJFFA.js} +1 -1
- package/build/dist/chunks/{QIB6OMQV.js → 5O67QQIY.js} +1 -1
- package/build/dist/chunks/5PNFV7HH.js +1 -0
- package/build/dist/chunks/5RAZFRO4.js +1 -0
- package/build/dist/chunks/{FAH7FKUT.js → 5UWVXEPD.js} +1 -1
- package/build/dist/chunks/5VKVAUFQ.js +1 -0
- package/build/dist/chunks/5Y457HYC.js +1 -0
- package/build/dist/chunks/64LAWFBE.js +1 -0
- package/build/dist/chunks/{3BQ5XHDJ.js → 6EWSLHXL.js} +1 -1
- package/build/dist/chunks/{6F527FLN.js → 6HNQAYBM.js} +1 -1
- package/build/dist/chunks/{FUP53K6G.js → 6LDC5D2S.js} +1 -1
- package/build/dist/chunks/{TZ7S5KRB.js → 6QXTL65K.js} +1 -1
- package/build/dist/chunks/6RVAV6BB.js +1 -0
- package/build/dist/chunks/{WSILNJS2.js → 6STUQOFL.js} +1 -1
- package/build/dist/chunks/{RUHNLNVX.js → 6Y2546JA.js} +1 -1
- package/build/dist/chunks/{4Z3IGMU6.js → 7AYP4ATZ.js} +1 -1
- package/build/dist/chunks/{YGW4ODAP.js → 7EPU3XGY.js} +1 -1
- package/build/dist/chunks/7GL547YZ.js +1 -0
- package/build/dist/chunks/7JTXYMNP.js +1 -0
- package/build/dist/chunks/{A3BJSQ23.js → 7VU5VCTL.js} +1 -1
- package/build/dist/chunks/{Z7FGEWO2.js → 7WXAS54T.js} +1 -1
- package/build/dist/chunks/{WQ2XTDHO.js → 7X5JVF3F.js} +1 -1
- package/build/dist/chunks/{DRLBTB4E.js → A72ADVYF.js} +1 -1
- package/build/dist/chunks/{ANIF3JMV.js → AG66NM3J.js} +1 -1
- package/build/dist/chunks/AODUTN65.js +1 -0
- package/build/dist/chunks/{DBOGRUPS.js → AONO47JX.js} +1 -1
- package/build/dist/chunks/{JTPHZCO3.js → AQJLEG6B.js} +1 -1
- package/build/dist/chunks/AZBTNUXF.js +1 -0
- package/build/dist/chunks/{TOIKOIY6.js → B5BU645H.js} +1 -1
- package/build/dist/chunks/{ZX43P4BK.js → B75SS7H6.js} +1 -1
- package/build/dist/chunks/{GBIBRYOV.js → B7HVPHSS.js} +1 -1
- package/build/dist/chunks/{LT5P6PZW.js → B7WZJHIJ.js} +1 -1
- package/build/dist/chunks/{3A2IKFTV.js → BIFANUTV.js} +1 -1
- package/build/dist/chunks/BM4KHOFB.js +1 -0
- package/build/dist/chunks/{N65J3L2H.js → BSV65PCA.js} +1 -1
- package/build/dist/chunks/{ZVY7GGSP.js → BW755PNH.js} +1 -1
- package/build/dist/chunks/{VXCGMALF.js → BWE5PXRE.js} +1 -1
- package/build/dist/chunks/{7U62MMUQ.js → BY2OWKZB.js} +1 -1
- package/build/dist/chunks/{CNDIAF3P.js → C2H3BWN5.js} +1 -1
- package/build/dist/chunks/{F7MGYRPU.js → CCPG6PRL.js} +1 -1
- package/build/dist/chunks/{OI3N4EW4.js → CG7ABZXH.js} +1 -1
- package/build/dist/chunks/CJMVRV34.js +1 -0
- package/build/dist/chunks/CQPIR6ER.js +1 -0
- package/build/dist/chunks/{A4K5GXVO.js → CR7DPGI6.js} +1 -1
- package/build/dist/chunks/{UUF4Z6K6.js → CVVNAFUE.js} +1 -1
- package/build/dist/chunks/{MI5HZDMH.js → D6JOXK7Q.js} +1 -1
- package/build/dist/chunks/{2PS4GCOZ.js → DJRS3TR5.js} +1 -1
- package/build/dist/chunks/{IZFED3R2.js → DLNDJZR4.js} +1 -1
- package/build/dist/chunks/{MQXSCNUL.js → DPSFR3ZS.js} +1 -1
- package/build/dist/chunks/{LKUZAJPZ.js → DV2HVFTM.js} +1 -1
- package/build/dist/chunks/{NMJVQX5M.js → DWRRIFXS.js} +1 -1
- package/build/dist/chunks/{3ZH5SOC2.js → EFOC337C.js} +1 -1
- package/build/dist/chunks/EHQRAA3R.js +1 -0
- package/build/dist/chunks/{A4FLWHLP.js → EJIP7RBG.js} +1 -1
- package/build/dist/chunks/EWZFZUVF.js +1 -0
- package/build/dist/chunks/{OB7BFDOV.js → EYE3ZAJB.js} +1 -1
- package/build/dist/chunks/{MQ5F2VOK.js → EZUQMTLE.js} +1 -1
- package/build/dist/chunks/{O2QBSINK.js → F36IA5RI.js} +1 -1
- package/build/dist/chunks/{XTXXWRN2.js → F74ARK4H.js} +1 -1
- package/build/dist/chunks/{HPS4KOU4.js → FGGDAAHW.js} +1 -1
- package/build/dist/chunks/FMEO7RX7.js +1 -0
- package/build/dist/chunks/{FHB7QYJO.js → FN6XY6ET.js} +1 -1
- package/build/dist/chunks/G4IX4CYN.js +1 -0
- package/build/dist/chunks/G53U6Y4L.js +1 -0
- package/build/dist/chunks/{HDBZZOHJ.js → GBIL2I2K.js} +1 -1
- package/build/dist/chunks/{MJGEGNDU.js → GCFHKJIO.js} +1 -1
- package/build/dist/chunks/{O5QTITN6.js → GRHBE4MQ.js} +1 -1
- package/build/dist/chunks/GTJ6LBGB.js +1 -0
- package/build/dist/chunks/GV6Z3MET.js +1 -0
- package/build/dist/chunks/{GK3D7OKG.js → GVCNTGLC.js} +1 -1
- package/build/dist/chunks/GX2RCAHG.js +1 -0
- package/build/dist/chunks/{7TRO6MBQ.js → H5KU4DUU.js} +1 -1
- package/build/dist/chunks/H7ZJ7LAB.js +1 -0
- package/build/dist/chunks/{DCGNVMKG.js → HC3QFA5I.js} +1 -1
- package/build/dist/chunks/{6CKCZJ3F.js → HEQBTHFS.js} +1 -1
- package/build/dist/chunks/{C76D54YG.js → HGSFRN57.js} +1 -1
- package/build/dist/chunks/HJI7KO6F.js +1 -0
- package/build/dist/chunks/{KO7ANIKY.js → HNBYPHTA.js} +1 -1
- package/build/dist/chunks/{MSRCJ2BS.js → HPBTSJW7.js} +1 -1
- package/build/dist/chunks/HPO673QQ.js +1 -0
- package/build/dist/chunks/{4IOHSX3Z.js → HRGLFGFL.js} +1 -1
- package/build/dist/chunks/{DGDMRATN.js → ICHT3H3W.js} +1 -1
- package/build/dist/chunks/IJVBCEA2.js +1 -0
- package/build/dist/chunks/{N742W5KX.js → IKVRFAUP.js} +1 -1
- package/build/dist/chunks/IM7ZF7XZ.js +1 -0
- package/build/dist/chunks/{I4473OC6.js → IMD33NQS.js} +1 -1
- package/build/dist/chunks/IR7KDBFU.js +1 -0
- package/build/dist/chunks/{X24YTJST.js → IY7FWTAL.js} +1 -1
- package/build/dist/chunks/IYOWMW5B.js +1 -0
- package/build/dist/chunks/J2J73XYU.js +1 -0
- package/build/dist/chunks/JCS24YBB.js +1 -0
- package/build/dist/chunks/JQVTHPUO.js +1 -0
- package/build/dist/chunks/{USGMGKAG.js → JTWJT2O3.js} +1 -1
- package/build/dist/chunks/{W7BFM6CK.js → K4CYAWNL.js} +1 -1
- package/build/dist/chunks/{7VH6JQ2H.js → K5C6QBOO.js} +1 -1
- package/build/dist/chunks/K5OXLIPK.js +1 -0
- package/build/dist/chunks/{ZKBOPZH5.js → K6GECT3F.js} +1 -1
- package/build/dist/chunks/{6LVHN33V.js → KB2JWQZ4.js} +1 -1
- package/build/dist/chunks/{YW4W3LPQ.js → KHLM6NIZ.js} +1 -1
- package/build/dist/chunks/{OIQTZOBN.js → KKGHXNM4.js} +1 -1
- package/build/dist/chunks/{SUNTJ6IU.js → KYANIEPX.js} +1 -1
- package/build/dist/chunks/{JJSCDDQO.js → L3IAEXQR.js} +1 -1
- package/build/dist/chunks/{ZZ6FZGHF.js → L4UFGM7M.js} +1 -1
- package/build/dist/chunks/{YWVPK3DV.js → L76P6WIH.js} +1 -1
- package/build/dist/chunks/{QMNUB2GM.js → LBT6WR4U.js} +1 -1
- package/build/dist/chunks/LD3A2KLN.js +1 -0
- package/build/dist/chunks/{WRUTW6CG.js → LFSNAQ7V.js} +1 -1
- package/build/dist/chunks/{ZQPC54J5.js → LKRAUTYI.js} +1 -1
- package/build/dist/chunks/{23HNDJ76.js → M2SWILNG.js} +1 -1
- package/build/dist/chunks/{IT2JLILU.js → MFKDNAHB.js} +1 -1
- package/build/dist/chunks/MFQTBUSD.js +1 -0
- package/build/dist/chunks/{V4UJMUIB.js → MLN5KTG7.js} +1 -1
- package/build/dist/chunks/{S4JUFCT4.js → MSQNOK3I.js} +1 -1
- package/build/dist/chunks/{O4P5IQCP.js → MXI7LX2F.js} +1 -1
- package/build/dist/chunks/N6YNJGEF.js +1 -0
- package/build/dist/chunks/{DXAPKN7H.js → NLC36QHL.js} +1 -1
- package/build/dist/chunks/NUTTPUYJ.js +1 -0
- package/build/dist/chunks/{O4S6XAYV.js → O7L55XM3.js} +1 -1
- package/build/dist/chunks/{NAO7VWZF.js → OCIEVYPR.js} +1 -1
- package/build/dist/chunks/{4NBXBKOX.js → OD7CY6BY.js} +1 -1
- package/build/dist/chunks/{RUTSEGGD.js → OHZHQSCA.js} +1 -1
- package/build/dist/chunks/{E47UYYK4.js → OIGTTRN5.js} +1 -1
- package/build/dist/chunks/{2I7XHRTI.js → P6JE2NRA.js} +1 -1
- package/build/dist/chunks/PD5NXIRT.js +1 -0
- package/build/dist/chunks/{TXGZ6NWN.js → PG7HZIZL.js} +1 -1
- package/build/dist/chunks/{VREGY7E6.js → PMFR47H3.js} +1 -1
- package/build/dist/chunks/{PV7FEVBD.js → PXVF2SHU.js} +1 -1
- package/build/dist/chunks/{2FOI2625.js → Q43WPRYU.js} +1 -1
- package/build/dist/chunks/QAAKUIWE.js +1 -0
- package/build/dist/chunks/{ZXFJKW6H.js → QAVP3CWL.js} +1 -1
- package/build/dist/chunks/{YXXK6EPI.js → QBHY2QRC.js} +1 -1
- package/build/dist/chunks/{ELHRXA5U.js → QFK335LC.js} +1 -1
- package/build/dist/chunks/{3PHJUFU2.js → QFUSCK5C.js} +1 -1
- package/build/dist/chunks/{IPU656WB.js → QKH7ED6B.js} +1 -1
- package/build/dist/chunks/{XW3VGWXK.js → QMWHQRYC.js} +1 -1
- package/build/dist/chunks/{ZXRIJG6H.js → QP2B7AYX.js} +1 -1
- package/build/dist/chunks/{TJU644I7.js → QZ6V6J6W.js} +1 -1
- package/build/dist/chunks/{MDLJFCT4.js → R5Z4HPCA.js} +1 -1
- package/build/dist/chunks/RKJFSDGV.js +1 -0
- package/build/dist/chunks/RKS3M7L5.js +1 -0
- package/build/dist/chunks/{GDOHHXNH.js → RLX6YTNT.js} +1 -1
- package/build/dist/chunks/{IZP3EKKS.js → RYEQIZ2H.js} +1 -1
- package/build/dist/chunks/{USEF3QKG.js → S432S6NA.js} +1 -1
- package/build/dist/chunks/{2OVJ2BTJ.js → SEXKWYUM.js} +1 -1
- package/build/dist/chunks/{KKTOBXIT.js → SRYX65GZ.js} +1 -1
- package/build/dist/chunks/{GKUPC4DO.js → TMENUIBC.js} +1 -1
- package/build/dist/chunks/{BSX4LFYI.js → TNHU5UBQ.js} +1 -1
- package/build/dist/chunks/{PDPTJMTJ.js → TT2ST3Q3.js} +1 -1
- package/build/dist/chunks/TTBB6EFN.js +1 -0
- package/build/dist/chunks/{FRVCSDKU.js → TWVDWNTG.js} +1 -1
- package/build/dist/chunks/TZG7HTVM.js +1 -0
- package/build/dist/chunks/{OVM4QIET.js → U4MSIH4G.js} +1 -1
- package/build/dist/chunks/{G5AMH4IP.js → UGFRBJDQ.js} +1 -1
- package/build/dist/chunks/{OB3YMTDI.js → UIVOYAO2.js} +1 -1
- package/build/dist/chunks/{XRDLMTBJ.js → UMY6SP7C.js} +1 -1
- package/build/dist/chunks/UNBRUWSV.js +1 -0
- package/build/dist/chunks/{LGLWEGPY.js → UPX3OWKA.js} +1 -1
- package/build/dist/chunks/{TGXEKBLV.js → URTQNYWU.js} +1 -1
- package/build/dist/chunks/{4RCYYN6O.js → V7HTGO23.js} +1 -1
- package/build/dist/chunks/{HZSYMGJ2.js → VS7ZA4OF.js} +1 -1
- package/build/dist/chunks/{BJ2U2VXJ.js → VTWAVH74.js} +1 -1
- package/build/dist/chunks/{LZM3DO5Q.js → W5GWK72I.js} +1 -1
- package/build/dist/chunks/{65OITTDL.js → W73SLWBT.js} +1 -1
- package/build/dist/chunks/{3YH5B5NQ.js → WUONMIA2.js} +1 -1
- package/build/dist/chunks/{XL3W7DAQ.js → X3BB6WME.js} +1 -1
- package/build/dist/chunks/{XADHV2DT.js → X53QVHBC.js} +1 -1
- package/build/dist/chunks/{GBPB7JIB.js → XSQJOOEY.js} +1 -1
- package/build/dist/chunks/XUDQYSPU.js +1 -0
- package/build/dist/chunks/{S37D7HOK.js → XWZ5SL5Q.js} +1 -1
- package/build/dist/chunks/{NIWAVMDR.js → XXLQDQEX.js} +1 -1
- package/build/dist/chunks/{QBNASL3T.js → Y5T36EEU.js} +1 -1
- package/build/dist/chunks/{R73R4KN3.js → YBLJ2MCR.js} +1 -1
- package/build/dist/chunks/ZSGW2ZSO.js +1 -0
- package/build/dist/chunks/{HRAHGYNK.js → ZTNBX4VH.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/5H7NVE6O.js +0 -1
- package/build/dist/chunks/7OOCAZBE.js +0 -1
- package/build/dist/chunks/DFM4T6ZE.js +0 -1
- package/build/dist/chunks/FCVH4FYH.js +0 -1
- package/build/dist/chunks/GDUKZYE2.js +0 -1
- package/build/dist/chunks/GYPMUYB5.js +0 -1
- package/build/dist/chunks/J7OZLXSG.js +0 -1
- package/build/dist/chunks/JFC2QCMW.js +0 -1
- package/build/dist/chunks/M6JNGU4E.js +0 -1
- package/build/dist/chunks/M7OVMIIE.js +0 -1
- package/build/dist/chunks/MQK6OP7S.js +0 -1
- package/build/dist/chunks/N624NR7Y.js +0 -1
- package/build/dist/chunks/OSMOBKRQ.js +0 -1
- package/build/dist/chunks/Q3Q3YHEX.js +0 -1
- package/build/dist/chunks/QQD4PV64.js +0 -1
- package/build/dist/chunks/RN3WUJIO.js +0 -1
- package/build/dist/chunks/RP5VCG54.js +0 -1
- package/build/dist/chunks/TI727O2H.js +0 -1
- package/build/dist/chunks/UHIJMDD2.js +0 -1
- package/build/dist/chunks/W32UECOL.js +0 -1
- package/build/dist/chunks/WWNAGOCD.js +0 -1
- package/build/dist/chunks/XWC6IC5E.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./MSRCJ2BS.js";import{b as Y,d as Z,e as Q}from"./V74F6IDY.js";import{a as J}from"./GBPB7JIB.js";import{a as W,c as x,d as B,h as F,i as E,j as L}from"./4CEV4FDG.js";import{ea as z,ja as H}from"./HHYE42JG.js";import{a as P}from"./IBL6TL2Q.js";import{o as j}from"./7OOCAZBE.js";import{k as M}from"./N624NR7Y.js";import{a as $}from"./IOYRL6AY.js";import{e as O,h as U}from"./NWNYJ26T.js";import{a as v}from"./XSD5NL7J.js";import{erc20Abi as X,formatUnits as G,parseAbiItem as q}from"viem";var ee=q("event CreateVaultV2(address indexed caller,address indexed owner,bytes32 salt,address indexed vault)"),te=r=>H("unverified",{...r?{vaultLabel:r}:{}});function ae(r){if(!O(r)||!O(r.chain)||r.chain.id!==4663||!Array.isArray(r.contracts)||!Array.isArray(r.markets)||r.contracts.length>1e3||r.markets.length>1e3)throw new v("Borro vault discovery returned an unreadable candidate list.");let i=[...r.contracts.filter(O).filter(e=>e.name==="BorroUSDGVault").map(e=>e.address),...r.markets.filter(O).map(e=>O(e.vault)?e.vault.address:void 0)];return[...new Set(i.map(x))]}function se(r){return r.sort((i,e)=>+(e.symbol==="USDG")-+(i.symbol==="USDG")||0)}var re=6e4;function oe(r,i={}){let e=i.resolveAllowedAsset??E(i.officialStockTokens),g=L({resolveAllowedAsset:e}),S=new WeakMap,A=s=>{let t=S.get(s);return t||(t={},S.set(s,t)),t},m=s=>{if(s?.aborted)throw new v("Borro read was cancelled.")};async function h(s,t,u){let c=A(s);if(c.inventory&&Date.now()<c.inventory.expiresAt)return structuredClone(c.inventory);let a={items:[],sources:[],incomplete:!1,warnings:[],expiresAt:0},o=new Map;m(u);try{for(let l of ae(await Y(r.http,"contracts",u)))o.set(l.toLowerCase(),{vault:l});a.sources.push("contracts.json")}catch{a.incomplete=!0,a.warnings.push("Borro candidate discovery is unavailable; this inventory may be incomplete.")}if(i.factoryEvents!==!1)try{let l=new Map;for(let p=BigInt(P.factory.fromBlock);p<=t;p+=10000000n){m(u);let k=p+9999999n<t?p+9999999n:t,y=await s.getLogs({address:P.factory.address,event:ee,fromBlock:p,toBlock:k,strict:!0});if(y.length>1e3)throw new v("Borro factory inventory exceeds the read limit.");for(let d of y){let n=x(d.args.vault);if(d.removed||!U(d.address,P.factory.address)||d.blockNumber===null||d.blockNumber<p||d.blockNumber>k||l.has(n.toLowerCase()))throw new v("Borro factory events are unreadable.");l.set(n.toLowerCase(),{vault:n,block:d.blockNumber})}if(l.size>1e3)throw new v("Borro factory inventory exceeds the read limit.")}for(let[p,k]of l)o.set(p,k);a.sources.push("factory-events")}catch{a.incomplete=!0,a.warnings.push("Borro factory discovery is unavailable; vault creation dates or inventory may be incomplete.")}return m(u),a.items=[...o.values()],a.expiresAt=Date.now()+re,a.incomplete||(c.inventory=structuredClone(a)),a}let w=async(s,t={})=>{m(t.signal);let u=await F(s),c=A(s);if(!t.wallet&&c.verified&&Date.now()<c.verified.expiresAt)return structuredClone(c.verified.result);let a=await h(s,u,t.signal),o={vaults:[],refused:[],sources:a.sources,incomplete:a.incomplete,warnings:a.warnings,measuredAtBlock:u.toString()},l=a.items;if(t.heldOnly){if(!t.wallet)throw new v("Provide a wallet for Borro holdings.");m(t.signal);let y=l.length?await s.multicall({allowFailure:!1,batchSize:0,contracts:l.map(({vault:d})=>({address:d,abi:X,functionName:"balanceOf",args:[t.wallet]})),blockNumber:u}):[];if(!Array.isArray(y)||y.length!==l.length)throw new v("Borro share balances could not be read completely. Please try again.");o.shareBalances=l.map((d,n)=>({vault:d.vault,amount:B(y[n]).toString()})),l=l.filter((d,n)=>BigInt(o.shareBalances[n].amount)>0n)}m(t.signal);let p=e;if(l.length&&!i.resolveAllowedAsset&&!i.officialStockTokens)try{p=E(await M({http:r.http,allowAmbiguousSymbols:!0}))}catch{o.incomplete=!0,o.warnings.push("Official stock identities could not be checked; held-share exits remain available by vault address.")}let k=L({resolveAllowedAsset:p});for(let y=0;y<l.length;y+=4){m(t.signal);let d=await Promise.all(l.slice(y,y+4).map(async n=>{try{let b=await k(s,n.vault,t.wallet?"withdraw":"deposit",{blockNumber:u,...t.wallet?{wallet:t.wallet}:{}});if(n.block!==void 0)try{let V=await s.getBlock({blockNumber:n.block}),f=B(V.timestamp);f<=8640000000000n&&V.number===n.block&&(b.deployedAt=new Date(Number(f)*1e3).toISOString())}catch{}return{facts:b}}catch{return{rejected:{vault:n.vault,reason:te(n.vault)}}}}));for(let n of d)n.facts&&o.vaults.push(n.facts),n.rejected&&o.refused.push(n.rejected)}return m(t.signal),se(o.vaults),!t.wallet&&!o.incomplete&&(c.verified={result:structuredClone(o),expiresAt:a.expiresAt}),o},T=async(s,t={})=>{m(t.signal);let u=A(s),c;if(t.wallet||t.signal)c=await w(s,t);else{let a=u.pending??w(s);u.pending=a;try{c=structuredClone(await a)}finally{u.pending===a&&(u.pending=void 0)}}return m(t.signal),{...c,vaults:c.vaults.filter(a=>!t.asset||a.symbol.toUpperCase()===t.asset.toUpperCase())}};return{discoverVaults:T,verifyVault:g,resolveVault:async(s,t,u,c)=>{if(t.asset!==void 0&&!/^[A-Za-z0-9.$_-]{1,32}$/.test(t.asset))throw new v("Provide an official asset symbol.");if(t.vault){let y=await g(s,t.vault,u,{wallet:c});if(t.asset&&y.symbol.toUpperCase()!==t.asset.toUpperCase())throw new v("The asset symbol does not match the verified vault.");return y}if(!t.asset)throw new v("Provide an asset symbol or the vault address.");let a=await T(s,{asset:t.asset,...u==="withdraw"?{wallet:c}:{}});if(a.incomplete)throw new v("Borro discovery is incomplete. Provide the vault address for on-chain verification.");let o=a.vaults.length===1?a.vaults[0]:void 0;if(!o&&t.asset.toUpperCase()==="USDG"&&a.vaults.length>1){let y=await F(s);try{if(a.vaults.some(f=>!U(f.asset,P.assetRule.usdg.address)||f.assetDecimals!==6))throw new v("Unreadable USDG identity.");let d=a.vaults.filter(f=>f.setup.drift.length===0&&f.assetAllowed),n=await Promise.all(d.map(async f=>({facts:f,total:B(await s.readContract({address:f.vault,abi:W,functionName:"totalAssets",blockNumber:y}))})));n.sort((f,_)=>f.total>_.total?-1:f.total<_.total?1:0);let[b,V]=n;b&&b.total>=100000000n&&(!V||b.total>=V.total*10n)&&(o=b.facts)}catch{}}if(!o)throw new v(a.vaults.length?"More than one Borro vault uses this symbol. Provide the vault address.":"No verified Borro vault matched this asset. Provide the vault address to check it on chain.");let l=e;if(!i.resolveAllowedAsset&&!i.officialStockTokens&&!U(o.asset,P.assetRule.usdg.address))try{l=E(await M({http:r.http,allowAmbiguousSymbols:!0}))}catch{}let k=await L({resolveAllowedAsset:l})(s,o.vault,u,{wallet:c});if(k.symbol.toUpperCase()!==t.asset.toUpperCase())throw new v("The asset symbol does not match the verified vault.");return{...k,...o.deployedAt?{deployedAt:o.deployedAt}:{}}}}}var N=(r,i)=>({token:r,amount:i.toString()});async function ne(r,i,e){try{let[g,S]=await Promise.all([i.getGasPrice(),j("ETH",{client:i,http:r.http,chainId:4663,blockNumber:e})]);if(!/^\d+$/.test(S.usdE18)||BigInt(S.usdE18)<=0n||B(g)===0n)return{};let A=w=>Number(G(w*g*BigInt(S.usdE18)/10n**18n,18)),m=A($*2n),h=A($);return[m,h].every(w=>Number.isFinite(w)&&w>0)?{gasInUsd:m,gasOutUsd:h}:{}}catch{return{}}}async function ie(r,i,e,g,S=new Map,A){let m={vault:e.vault,verified:!0,symbol:e.symbol,vaultSymbol:e.vaultSymbol,setup:e.setup,measuredAtBlock:(A??BigInt(e.measuredAtBlock)).toString(),verifiedAtBlock:e.measuredAtBlock,...e.owner?{owner:e.owner}:{},...e.curator?{curator:e.curator}:{},...e.deployedAt?{deployedAt:e.deployedAt}:{}};try{let h=A??BigInt(e.measuredAtBlock),w={address:e.asset,symbol:e.symbol,decimals:e.assetDecimals,chainId:4663},T={address:e.vault,symbol:e.vaultSymbol,decimals:18,chainId:4663},R=(D,C,I=[])=>i.readContract({address:D,abi:[...W,...X],functionName:C,args:I,blockNumber:h}),[s,t,u,c,a,o,l]=await Promise.all([R(e.vault,"totalAssets"),R(e.vault,"performanceFee"),R(e.asset,"balanceOf",[g]),R(e.vault,"balanceOf",[g]),J(i,e,h),ne(r,i,h),i.getBlock({blockNumber:h})]),p=B(c),k=B(t);if(k>10n**18n)throw new v("Borro performance fee is unreadable.");let y=B(await R(e.vault,"convertToAssets",[p])),d={};if(e.owner)try{let[D,C]=await Promise.all([R(e.owner,"getThreshold"),R(e.owner,"getOwners")]),I=B(D);if(!Array.isArray(C)||C.length>1e3||new Set(C.map(x)).size!==C.length||I<1n||I>BigInt(C.length))throw new v("Unreadable group wallet.");d={safeThreshold:Number(I),safeOwners:C.length}}catch{}let n;if(U(e.asset,P.assetRule.usdg.address))try{let D=(await K(i,h)).rateBasePct;Number.isFinite(D)&&D>=0&&(n=D)}catch{}let b=Q(S,w,e.vault);if(l.number!==h)throw new v("Borro block timestamp could not be verified.");let V=Number(B(l.timestamp)),f=e.deployedAt?Date.parse(e.deployedAt)/1e3:void 0,_=z({symbol:e.symbol,kind:U(e.asset,P.assetRule.usdg.address)?"usdg":"stock",nowSeconds:V,...f===void 0?{}:{deployedAtSeconds:f},threshold:d.safeThreshold,owners:d.safeOwners,borroRatePct:b.apr===void 0?void 0:b.apr*100,feePct:Number(G(k,16)),layerbankRatePct:n,totalAmount:G(B(s),e.assetDecimals),readyAmount:a.readyBase===void 0?void 0:G(a.readyBase,e.assetDecimals),gasInUsd:o.gasInUsd===void 0?void 0:`up to $${o.gasInUsd.toFixed(4)}`,gasOutUsd:o.gasOutUsd===void 0?void 0:`up to $${o.gasOutUsd.toFixed(4)}`});return{...m,asset:w,shares:T,totalAssets:N(w,B(s)),performanceFeeWad:k.toString(),walletAssetBalance:N(w,B(u)),walletShares:N(T,p),walletShareValue:N(w,y),liquidityKind:a.kind,...a.readyBase===void 0?{}:{cashOnHand:N(w,a.readyBase)},...d,...o,...n===void 0?{}:{layerbankRateBasePct:n},...b.apr===void 0?{}:{apr:b.apr,rateSource:b.source},...b.readyToWithdraw?{vendorReadyToWithdraw:b.readyToWithdraw}:{},...f!==void 0&&f<=V?{ageSeconds:String(Math.floor(V-f))}:{},risk:{title:"Lending on Borro",text:_,source:"Oak"}}}catch{return{...m,error:"This Borro vault can't be read right now. Please try again."}}}async function ge(r,i,e={},g={},S){if(e.vault&&!g.resolveAllowedAsset&&!g.officialStockTokens)try{g={...g,officialStockTokens:await M({http:r.http,allowAmbiguousSymbols:!0})}}catch{}let A=r.clientFor(4663),m=S??oe(r,g);x(i);let h;if(e.vault){let s=await m.resolveVault(A,e,"deposit",i);h={vaults:[s],refused:[],sources:[],incomplete:!1,warnings:[],measuredAtBlock:s.measuredAtBlock}}else h=await m.discoverVaults(A,e.asset?{asset:e.asset}:{});let[w,T]=await Promise.all([Z(r.http),F(A)]),R=[];for(let s=0;s<h.vaults.length;s+=4)R.push(...await Promise.all(h.vaults.slice(s,s+4).map(t=>ie(r,A,t,i,w,T))));return{...h,vaults:R}}export{ae as a,se as b,oe as c,N as d,ie as e,ge as f};
|
|
1
|
+
import{a as K}from"./HPBTSJW7.js";import{b as Y,d as Z,e as Q}from"./V74F6IDY.js";import{a as J}from"./XSQJOOEY.js";import{a as W,c as x,d as B,h as F,i as E,j as L}from"./4CEV4FDG.js";import{ea as z,ja as H}from"./HHYE42JG.js";import{a as P}from"./IBL6TL2Q.js";import{o as j}from"./IR7KDBFU.js";import{k as M}from"./5PNFV7HH.js";import{a as $}from"./IOYRL6AY.js";import{e as O,h as U}from"./NWNYJ26T.js";import{a as v}from"./XSD5NL7J.js";import{erc20Abi as X,formatUnits as G,parseAbiItem as q}from"viem";var ee=q("event CreateVaultV2(address indexed caller,address indexed owner,bytes32 salt,address indexed vault)"),te=r=>H("unverified",{...r?{vaultLabel:r}:{}});function ae(r){if(!O(r)||!O(r.chain)||r.chain.id!==4663||!Array.isArray(r.contracts)||!Array.isArray(r.markets)||r.contracts.length>1e3||r.markets.length>1e3)throw new v("Borro vault discovery returned an unreadable candidate list.");let i=[...r.contracts.filter(O).filter(e=>e.name==="BorroUSDGVault").map(e=>e.address),...r.markets.filter(O).map(e=>O(e.vault)?e.vault.address:void 0)];return[...new Set(i.map(x))]}function se(r){return r.sort((i,e)=>+(e.symbol==="USDG")-+(i.symbol==="USDG")||0)}var re=6e4;function oe(r,i={}){let e=i.resolveAllowedAsset??E(i.officialStockTokens),g=L({resolveAllowedAsset:e}),S=new WeakMap,A=s=>{let t=S.get(s);return t||(t={},S.set(s,t)),t},m=s=>{if(s?.aborted)throw new v("Borro read was cancelled.")};async function h(s,t,u){let c=A(s);if(c.inventory&&Date.now()<c.inventory.expiresAt)return structuredClone(c.inventory);let a={items:[],sources:[],incomplete:!1,warnings:[],expiresAt:0},o=new Map;m(u);try{for(let l of ae(await Y(r.http,"contracts",u)))o.set(l.toLowerCase(),{vault:l});a.sources.push("contracts.json")}catch{a.incomplete=!0,a.warnings.push("Borro candidate discovery is unavailable; this inventory may be incomplete.")}if(i.factoryEvents!==!1)try{let l=new Map;for(let p=BigInt(P.factory.fromBlock);p<=t;p+=10000000n){m(u);let k=p+9999999n<t?p+9999999n:t,y=await s.getLogs({address:P.factory.address,event:ee,fromBlock:p,toBlock:k,strict:!0});if(y.length>1e3)throw new v("Borro factory inventory exceeds the read limit.");for(let d of y){let n=x(d.args.vault);if(d.removed||!U(d.address,P.factory.address)||d.blockNumber===null||d.blockNumber<p||d.blockNumber>k||l.has(n.toLowerCase()))throw new v("Borro factory events are unreadable.");l.set(n.toLowerCase(),{vault:n,block:d.blockNumber})}if(l.size>1e3)throw new v("Borro factory inventory exceeds the read limit.")}for(let[p,k]of l)o.set(p,k);a.sources.push("factory-events")}catch{a.incomplete=!0,a.warnings.push("Borro factory discovery is unavailable; vault creation dates or inventory may be incomplete.")}return m(u),a.items=[...o.values()],a.expiresAt=Date.now()+re,a.incomplete||(c.inventory=structuredClone(a)),a}let w=async(s,t={})=>{m(t.signal);let u=await F(s),c=A(s);if(!t.wallet&&c.verified&&Date.now()<c.verified.expiresAt)return structuredClone(c.verified.result);let a=await h(s,u,t.signal),o={vaults:[],refused:[],sources:a.sources,incomplete:a.incomplete,warnings:a.warnings,measuredAtBlock:u.toString()},l=a.items;if(t.heldOnly){if(!t.wallet)throw new v("Provide a wallet for Borro holdings.");m(t.signal);let y=l.length?await s.multicall({allowFailure:!1,batchSize:0,contracts:l.map(({vault:d})=>({address:d,abi:X,functionName:"balanceOf",args:[t.wallet]})),blockNumber:u}):[];if(!Array.isArray(y)||y.length!==l.length)throw new v("Borro share balances could not be read completely. Please try again.");o.shareBalances=l.map((d,n)=>({vault:d.vault,amount:B(y[n]).toString()})),l=l.filter((d,n)=>BigInt(o.shareBalances[n].amount)>0n)}m(t.signal);let p=e;if(l.length&&!i.resolveAllowedAsset&&!i.officialStockTokens)try{p=E(await M({http:r.http,allowAmbiguousSymbols:!0}))}catch{o.incomplete=!0,o.warnings.push("Official stock identities could not be checked; held-share exits remain available by vault address.")}let k=L({resolveAllowedAsset:p});for(let y=0;y<l.length;y+=4){m(t.signal);let d=await Promise.all(l.slice(y,y+4).map(async n=>{try{let b=await k(s,n.vault,t.wallet?"withdraw":"deposit",{blockNumber:u,...t.wallet?{wallet:t.wallet}:{}});if(n.block!==void 0)try{let V=await s.getBlock({blockNumber:n.block}),f=B(V.timestamp);f<=8640000000000n&&V.number===n.block&&(b.deployedAt=new Date(Number(f)*1e3).toISOString())}catch{}return{facts:b}}catch{return{rejected:{vault:n.vault,reason:te(n.vault)}}}}));for(let n of d)n.facts&&o.vaults.push(n.facts),n.rejected&&o.refused.push(n.rejected)}return m(t.signal),se(o.vaults),!t.wallet&&!o.incomplete&&(c.verified={result:structuredClone(o),expiresAt:a.expiresAt}),o},T=async(s,t={})=>{m(t.signal);let u=A(s),c;if(t.wallet||t.signal)c=await w(s,t);else{let a=u.pending??w(s);u.pending=a;try{c=structuredClone(await a)}finally{u.pending===a&&(u.pending=void 0)}}return m(t.signal),{...c,vaults:c.vaults.filter(a=>!t.asset||a.symbol.toUpperCase()===t.asset.toUpperCase())}};return{discoverVaults:T,verifyVault:g,resolveVault:async(s,t,u,c)=>{if(t.asset!==void 0&&!/^[A-Za-z0-9.$_-]{1,32}$/.test(t.asset))throw new v("Provide an official asset symbol.");if(t.vault){let y=await g(s,t.vault,u,{wallet:c});if(t.asset&&y.symbol.toUpperCase()!==t.asset.toUpperCase())throw new v("The asset symbol does not match the verified vault.");return y}if(!t.asset)throw new v("Provide an asset symbol or the vault address.");let a=await T(s,{asset:t.asset,...u==="withdraw"?{wallet:c}:{}});if(a.incomplete)throw new v("Borro discovery is incomplete. Provide the vault address for on-chain verification.");let o=a.vaults.length===1?a.vaults[0]:void 0;if(!o&&t.asset.toUpperCase()==="USDG"&&a.vaults.length>1){let y=await F(s);try{if(a.vaults.some(f=>!U(f.asset,P.assetRule.usdg.address)||f.assetDecimals!==6))throw new v("Unreadable USDG identity.");let d=a.vaults.filter(f=>f.setup.drift.length===0&&f.assetAllowed),n=await Promise.all(d.map(async f=>({facts:f,total:B(await s.readContract({address:f.vault,abi:W,functionName:"totalAssets",blockNumber:y}))})));n.sort((f,_)=>f.total>_.total?-1:f.total<_.total?1:0);let[b,V]=n;b&&b.total>=100000000n&&(!V||b.total>=V.total*10n)&&(o=b.facts)}catch{}}if(!o)throw new v(a.vaults.length?"More than one Borro vault uses this symbol. Provide the vault address.":"No verified Borro vault matched this asset. Provide the vault address to check it on chain.");let l=e;if(!i.resolveAllowedAsset&&!i.officialStockTokens&&!U(o.asset,P.assetRule.usdg.address))try{l=E(await M({http:r.http,allowAmbiguousSymbols:!0}))}catch{}let k=await L({resolveAllowedAsset:l})(s,o.vault,u,{wallet:c});if(k.symbol.toUpperCase()!==t.asset.toUpperCase())throw new v("The asset symbol does not match the verified vault.");return{...k,...o.deployedAt?{deployedAt:o.deployedAt}:{}}}}}var N=(r,i)=>({token:r,amount:i.toString()});async function ne(r,i,e){try{let[g,S]=await Promise.all([i.getGasPrice(),j("ETH",{client:i,http:r.http,chainId:4663,blockNumber:e})]);if(!/^\d+$/.test(S.usdE18)||BigInt(S.usdE18)<=0n||B(g)===0n)return{};let A=w=>Number(G(w*g*BigInt(S.usdE18)/10n**18n,18)),m=A($*2n),h=A($);return[m,h].every(w=>Number.isFinite(w)&&w>0)?{gasInUsd:m,gasOutUsd:h}:{}}catch{return{}}}async function ie(r,i,e,g,S=new Map,A){let m={vault:e.vault,verified:!0,symbol:e.symbol,vaultSymbol:e.vaultSymbol,setup:e.setup,measuredAtBlock:(A??BigInt(e.measuredAtBlock)).toString(),verifiedAtBlock:e.measuredAtBlock,...e.owner?{owner:e.owner}:{},...e.curator?{curator:e.curator}:{},...e.deployedAt?{deployedAt:e.deployedAt}:{}};try{let h=A??BigInt(e.measuredAtBlock),w={address:e.asset,symbol:e.symbol,decimals:e.assetDecimals,chainId:4663},T={address:e.vault,symbol:e.vaultSymbol,decimals:18,chainId:4663},R=(D,C,I=[])=>i.readContract({address:D,abi:[...W,...X],functionName:C,args:I,blockNumber:h}),[s,t,u,c,a,o,l]=await Promise.all([R(e.vault,"totalAssets"),R(e.vault,"performanceFee"),R(e.asset,"balanceOf",[g]),R(e.vault,"balanceOf",[g]),J(i,e,h),ne(r,i,h),i.getBlock({blockNumber:h})]),p=B(c),k=B(t);if(k>10n**18n)throw new v("Borro performance fee is unreadable.");let y=B(await R(e.vault,"convertToAssets",[p])),d={};if(e.owner)try{let[D,C]=await Promise.all([R(e.owner,"getThreshold"),R(e.owner,"getOwners")]),I=B(D);if(!Array.isArray(C)||C.length>1e3||new Set(C.map(x)).size!==C.length||I<1n||I>BigInt(C.length))throw new v("Unreadable group wallet.");d={safeThreshold:Number(I),safeOwners:C.length}}catch{}let n;if(U(e.asset,P.assetRule.usdg.address))try{let D=(await K(i,h)).rateBasePct;Number.isFinite(D)&&D>=0&&(n=D)}catch{}let b=Q(S,w,e.vault);if(l.number!==h)throw new v("Borro block timestamp could not be verified.");let V=Number(B(l.timestamp)),f=e.deployedAt?Date.parse(e.deployedAt)/1e3:void 0,_=z({symbol:e.symbol,kind:U(e.asset,P.assetRule.usdg.address)?"usdg":"stock",nowSeconds:V,...f===void 0?{}:{deployedAtSeconds:f},threshold:d.safeThreshold,owners:d.safeOwners,borroRatePct:b.apr===void 0?void 0:b.apr*100,feePct:Number(G(k,16)),layerbankRatePct:n,totalAmount:G(B(s),e.assetDecimals),readyAmount:a.readyBase===void 0?void 0:G(a.readyBase,e.assetDecimals),gasInUsd:o.gasInUsd===void 0?void 0:`up to $${o.gasInUsd.toFixed(4)}`,gasOutUsd:o.gasOutUsd===void 0?void 0:`up to $${o.gasOutUsd.toFixed(4)}`});return{...m,asset:w,shares:T,totalAssets:N(w,B(s)),performanceFeeWad:k.toString(),walletAssetBalance:N(w,B(u)),walletShares:N(T,p),walletShareValue:N(w,y),liquidityKind:a.kind,...a.readyBase===void 0?{}:{cashOnHand:N(w,a.readyBase)},...d,...o,...n===void 0?{}:{layerbankRateBasePct:n},...b.apr===void 0?{}:{apr:b.apr,rateSource:b.source},...b.readyToWithdraw?{vendorReadyToWithdraw:b.readyToWithdraw}:{},...f!==void 0&&f<=V?{ageSeconds:String(Math.floor(V-f))}:{},risk:{title:"Lending on Borro",text:_,source:"Oak"}}}catch{return{...m,error:"This Borro vault can't be read right now. Please try again."}}}async function ge(r,i,e={},g={},S){if(e.vault&&!g.resolveAllowedAsset&&!g.officialStockTokens)try{g={...g,officialStockTokens:await M({http:r.http,allowAmbiguousSymbols:!0})}}catch{}let A=r.clientFor(4663),m=S??oe(r,g);x(i);let h;if(e.vault){let s=await m.resolveVault(A,e,"deposit",i);h={vaults:[s],refused:[],sources:[],incomplete:!1,warnings:[],measuredAtBlock:s.measuredAtBlock}}else h=await m.discoverVaults(A,e.asset?{asset:e.asset}:{});let[w,T]=await Promise.all([Z(r.http),F(A)]),R=[];for(let s=0;s<h.vaults.length;s+=4)R.push(...await Promise.all(h.vaults.slice(s,s+4).map(t=>ie(r,A,t,i,w,T))));return{...h,vaults:R}}export{ae as a,se as b,oe as c,N as d,ie as e,ge as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as Fe,t as se,y as ce}from"./5677LZOV.js";import{d as $,e as Q,f as he,h as Be}from"./7GL547YZ.js";import{a as Z}from"./G2LAO23N.js";import{a as Se,b as ye,c as Ce,e as fe,f as ve,g as Re,h as K,i as b,j as u,k as O,l as Y,m as T,n as ne,o as j,p as R,q as M,s as X,u as ae,v as te}from"./UMY6SP7C.js";import{a as ge,b as E,f as xe,i as W,j as ie,k as He,l as Ie}from"./CJMVRV34.js";import{c as pe}from"./NWNYJ26T.js";import{a}from"./XSD5NL7J.js";import{concatHex as De,encodeAbiParameters as we,getAddress as ue,keccak256 as ee,parseAbi as Ve,toHex as re,zeroAddress as J,zeroHash as oe}from"viem";var Le=n=>j(n.launcher===ue(E.launcherV1)?"launcherV1":"launcher");function Te(n){let t=ee(we([{type:"bytes32"},{type:"bytes32"}],[n,"0x3c0d3d8cba92527b3a48aa783c8734a4e170057eb16401c9df8a7c8a6588b900"]));return re(BigInt(t)+5n,{size:32})}async function Ke(n,t){try{let e="0x0000000000000000000000000000000000000a11",l=await n.request({method:"eth_call",params:[{to:e,data:"0x"},re(t.number),{[e]:{code:"0x4360005260206000f3"}}]});return BigInt(K(l))}catch{throw new a("Hookr parent-block clock is unavailable. Retry with an RPC supporting named-block eth_call state overrides; child-chain height cannot establish lock expiry.")}}async function mn(n,t,e){let l=await ie(n);await W(n,l.number,[e.launcher,M,X]);let r=(k,p=[])=>R(n,e.launcher,Le(e),k,p,l.number),[h,o,m,d]=await Promise.all([r("familyOwner",[e.familyId]),r("memberCount",[e.familyId]),r("position",[e.familyId,Number(e.member)]),r("poolManager")]),i=b(h);if(i===J||i!==t)throw new a("Only the current Hookr family owner can add, collect or remove this position. Use its signing wallet.");if(d!==X||u(o,8)<1n||u(o,8)>8n||BigInt(e.member)>=u(o,8))throw new a("Hookr family member or PoolManager differs from the reviewed deployment.");let c=T(m),g=be(c.key),P=u(c.liquidity,128);if(typeof c.tickLower!="number"||typeof c.tickUpper!="number")throw new a("Hookr family range is unavailable.");let f=c.tickLower,H=c.tickUpper;ce(f,H,g.tickSpacing);let v=se(g);if(await r("poolFamily",[v])!==e.familyId)throw new a("Hookr pool does not belong to this Launcher family.");let S=T(await R(n,M,j("rootV1"),"poolConfig",[v],l.number)),V=b(S.rules),A=ae(V);if(b(S.liquidityOwner)!==e.launcher||![g.currency0,g.currency1].includes(b(S.subject))||![g.currency0,g.currency1].includes(b(S.quote))||S.subject===S.quote)throw new a("Hookr pool configuration differs from this family key.");await W(n,l.number,[V]);let[q,C]=await Promise.all([Promise.all([g.currency0,g.currency1].map(k=>te(n,k,l.number))),R(n,X,Ve(["function extsload(bytes32[] slots) view returns (bytes32[])"]),"extsload",[ke(v,e.launcher,e.familyId,Number(e.member),f,H)],l.number)]),s=Y(C,10).map(k=>BigInt(K(k))),x=s[0]&(1n<<160n)-1n,w=Number(BigInt.asIntN(24,s[0]>>160n));if(!x||w<-887272||w>887272||s[7]!==P)throw new a("Hookr PoolManager state differs from the family position. Retry the full read.");let y=[0,1].map(k=>de(P,le(s[1+k],s[3+k],s[5+k],w,f,H),s[8+k]));return{position:e,block:l,owner:i,key:g,poolId:v,liquidity:P,tickLower:f,tickUpper:H,sqrtPriceX96:x,fees:y,tokens:q,pc:S,core:V,role:A}}async function qe(n,t){let{position:e,block:l,poolId:r,core:h,role:o}=t,[m,d,i,c]=await Promise.all([R(n,e.launcher,Le(e),"principalLockedUntil",[e.familyId],l.number),R(n,h,j(o),"removalLockedUntil",[r],l.number),n.getStorageAt({address:M,slot:Te(r),blockNumber:l.number}),Ke(n,l)]),g=BigInt(K(i));if(ue(re(g&(1n<<160n)-1n,{size:20}))!==e.launcher)throw new a("Hookr frozen Root lock storage does not match the family owner contract.");let P=g>>160n&(1n<<40n)-1n,f=u(m),H=u(d);return{clock:"parent-block",parentBlock:c.toString(),familyUntilParentBlock:f.toString(),poolRulesUntilParentBlock:H.toString(),rootUntilParentBlock:P.toString(),currentlyLocked:c<f||c<H||c<P,feesCollectableDuringPrincipalLocks:!0}}async function je(n,t,e,l){let r=re(BigInt(Te(e))-4n,{size:32}),h=BigInt(K(await n.getStorageAt({address:M,slot:r,blockNumber:t}))),o=(g,P)=>h>>g&(1n<<P)-1n,m=T(l.caps),d=o(192n,24n),i=o(216n,24n),c=o(160n,32n);if(o(0n,24n)!==u(m.maxLpFeePips,24)||o(24n,24n)!==u(m.maxQuoteTakePips,24)||o(48n,16n)!==u(m.maxSubjectTakeBps,16)||c!==u(l.advisoryGasLimit,32)||o(240n,8n)!==0n||l.advisoryFailOpen!==!1||u(l.advisoryPhases,8)!==1n||c<400000n||c>2000000n||d>50000n||i!==0n)throw new a("Hookr frozen pool advisory caps or configuration are unsupported.");return{maxLpFeePips:d,maxQuoteTakePips:i,advisoryGasLimit:c}}async function Ue(n,t,e,l,r){let h=b(l);await W(n,t,[E.registry,E.rootV1]);let o=(p,I=[],N=j("agentGateV2"))=>n.readContract({address:h,abi:N,functionName:p,args:I,blockNumber:t}),[m,d]=await Promise.all([n.getCode({address:h,blockNumber:t}),o("configSchemaHash")]);if(!m||m==="0x"||m.startsWith("0xef0100"))throw new a("Hookr gate runtime is unavailable or delegated.");let i=ee(m),c=Be(h,d),g=xe[h];if(g&&g.codeHash!==i)throw new a("Hookr listed gate runtime drifted. Refresh the reviewed pin.");c.listed&&await W(n,t,[h]);let[P,f,H,v,S,V,A,q,C,s,x,w]=await Promise.all([o("identity"),o("reputation"),o("poolManager"),o(c.healthFunction,[],c.abi),o("MIN_ADVISORY_GAS"),o("MAX_ADVISORY_GAS"),o("linkOf",[J]),o("isAgent",[J]),o("reviewerSet",[oe]),o("terms",[E.rootV1,oe],c.abi),o("scoreOf",[J,oe]),o("explainLiquidity",[E.rootV1,oe,J])]);if(b(P)!==$||b(f)!==Q||b(H)!==ue(E.poolManager)||u(S)!==400000n||u(V)!==2000000n)throw new a("Hookr gate dependency wiring or gas bounds changed.");if(O(v),O(q),!Array.isArray(A)||A.length!==2||!Array.isArray(C)||C.length!==2||!Array.isArray(C[0])||typeof C[1]!="string"||!Array.isArray(x)||x.length!==2||typeof x[1]!="bigint"||!Array.isArray(w)||w.length!==2)throw new a("Hookr gate expected read is incomplete.");O(A[0]),u(A[1]),O(x[0]),O(w[0]),u(w[1],8);let y=T(s);O(y.bound);for(let[p,I]of[["flags",16],["minScore",32],["tierScore",32],["tierPips",24]])u(y[p],I);if(b(y.launcher),b(y.curatedRouter),typeof y.reviewers!="string"||!/^0x[0-9a-fA-F]{64}$/.test(y.reviewers))throw new a("Hookr gate reviewer ID read is incomplete.");if(c.supportsAge){let[p,I,N]=await Promise.all([o("positionManager"),o("ageOf",[J]),o("pins")]);u(y.minAge,32),u(I);let B=T(N);if(b(p)!==he||["identityCode","identityVersion","reputationCode","reputationVersion"].some(D=>typeof B[D]!="string"||!/^0x[0-9a-fA-F]{64}$/.test(B[D])))throw new a("Hookr gate position manager or registry pins are incomplete.");await W(n,t,[he,$,Q])}let k=await je(n,t,e,r);return{profile:c,codeHash:i,admission:null,frozenCaps:k,inactive:O(v),warnings:c.warning?[c.warning+"; the gate can refuse trades at any time"]:[]}}var Oe=Ve(["function getVersion() view returns (string)"]);async function pn(n,t,e,l,r,h,o=[]){let m=await Ue(n,t,l,r,h),d=m.profile,i=(L,F=[])=>R(n,d.address,d.abi,L,F,t),[c,g,P,f,H,v,S,V,A,q,C,s]=await Promise.all([i("configSchemaHash"),Promise.resolve(m.admission),i(d.healthFunction),i("identity"),i("reputation"),i("poolManager"),i("isAgent",[e]),i("linkOf",[e]),i("MIN_ADVISORY_GAS"),i("MAX_ADVISORY_GAS"),R(n,$,Oe,"getVersion",[],t),R(n,Q,Oe,"getVersion",[],t)]),x=g;if(c!==d.schemaHash)throw new a("Hookr gate schema changed during the read.");if(f!==$||H!==Q||v!==X||u(A)!==400000n||u(q)!==2000000n)throw new a("Hookr gate dependencies or gas limits differ from the reviewed profile.");let w=L=>{if(typeof L!="string"||!d.supportsAge&&new TextEncoder().encode(L).length>32)throw new a("Hookr registry version read is incomplete.");let F=we([{type:"string"}],[L]),U=(F.length-2)/2;return ee(d.supportsAge&&U>256?De([F.slice(0,514),re(U,{size:32})]):F)},y,k;if(d.supportsAge){let[L,F,U]=await Promise.all([i("pins"),n.getCode({address:$,blockNumber:t}),n.getCode({address:Q,blockNumber:t})]),z=T(L);for(let _ of["identityCode","identityVersion","reputationCode","reputationVersion"])K(z[_]);if(!F||F==="0x"||!U||U==="0x")throw new a("Hookr registry runtime is unavailable.");y=ee(F)!==z.identityCode||w(C)!==z.identityVersion,k=ee(U)!==z.reputationCode||w(s)!==z.reputationVersion}else y=w(C)!==ge.gateVersions.identity,k=w(s)!==ge.gateVersions.reputation;let p=y||k,I=O(P),N=Y(V,2),B=await Promise.all(o.map(async L=>{let[F,U]=Y(await i("reviewerSet",[L]),2);if(!Array.isArray(F)||F.length===0||F.length>32||typeof U!="string")throw new a("Reviewer set is unregistered or unavailable. Supply an existing registered bytes32 set ID.");let z=F.map(_=>ue(String(_)));if(z.some(_=>BigInt(_)===0n)||ee(we([{type:"address[]"},{type:"string"}],[z,U]))!==L.toLowerCase())throw new a("Hookr reviewer set does not match its registered ID.");return{id:L,clients:z,tag:U}})),D=d.supportsAge?u(await i("ageOf",[e])).toString():null;return{address:d.address,frozenCaps:ne(m.frozenCaps),listed:d.listed,warnings:m.warnings,age:D,suspended:d.supportsAge?I:null,healthy:!I&&!p,healthyIdentityOnly:!I&&!y,healthyForScores:!I&&!p,retired:I,registryVersionDrift:p,schemaHash:c,admission:ne(x),identity:$,reputation:Q,walletAgent:O(S),link:{linked:O(N[0]),agentId:u(N[1]).toString()},reviewerSets:B,reviewerSetsComplete:!1,reviewerSetsNotice:"Only explicitly requested registered set IDs are read. This is not an enumeration. No reviewed Priors alias is configured; provide a registered bytes32 set ID.",termsSchema:{flags:"uint16",minScore:"uint32",tierScore:"uint32",tierPips:"uint24",reviewers:"bytes32",...d.supportsAge?{minAge:"uint32"}:{}},defaults:{flags:"1",minScore:"0",tierScore:"0",tierPips:"0",reviewers:oe,...d.supportsAge?{minAge:"0"}:{}},maxTierPips:"50000",minGas:"400000",maxGas:"2000000"}}async function ze(n,t,e,l,r,h){if(r===J)return{gated:!1,admissionRequiredForCollectOrRemove:!1};let{profile:o,warnings:m,frozenCaps:d}=await Ue(n,t,e,r,h),[i,c,g]=await Promise.all([R(n,r,o.abi,"terms",[M,e],t),R(n,r,o.abi,"explainLiquidity",[M,e,l],t),R(n,r,o.abi,o.healthFunction,[],t)]),P=T(i),[f,H]=Y(c,2);if(!O(P.bound)||b(P.launcher)!==l)throw new a("Hookr gate is not bound to this family Launcher.");for(let[v,S]of[["flags",16],["minScore",32],["tierScore",32],["tierPips",24]])u(P[v],S);if(K(P.reviewers),o.supportsAge&&u(P.minAge,32),u(P.tierPips,24)>d.maxLpFeePips)throw new a("Hookr gate surcharge exceeds its frozen pool cap.");return{gated:!0,gate:r,warnings:m,frozenCaps:ne(d),terms:ne(P),retired:O(g),suspended:o.supportsAge?O(g):null,liquidityEntryAllowed:O(f),entryReason:u(H,8).toString(),admissionRequiredForCollectOrRemove:!1}}import{encodeAbiParameters as Ge,encodePacked as Ee,getAddress as We,keccak256 as Ae,parseAbi as Xe,toHex as Ye,zeroAddress as $e}from"viem";var Qe=1n<<256n,Je=1n<<128n,Ze=Xe(["function extsload(bytes32[] slots) view returns (bytes32[])"]),me=(n,t,e)=>({type:"object",additionalProperties:!1,properties:n,required:t,...e===void 0?{}:{description:e}}),en={description:"Hookr LP position, chosen by kind: a launcher family member, a position NFT, or an agent-account position.",oneOf:[me({kind:{const:"family",description:Z.enumValues({family:"one member position of a Hookr launcher family"})},launcher:{...pe,description:"Address of the Hookr launcher contract that created the family."},familyId:{...ye,description:"Bytes32 hex id of the launcher family (0x plus 64 hex digits)."},member:{type:"string",enum:["0","1","2","3","4","5","6","7"],description:'Member index within the family, a decimal string from "0" to "7".'}},["kind","launcher","familyId","member"],"Hookr family LP position: one member of a launcher family, identified by launcher, familyId and member."),me({kind:{const:"nft",description:Z.enumValues({nft:"a position held as an NFT"})},tokenId:{...Se,description:Z.id("position NFT")}},["kind","tokenId"]),me({kind:{const:"agent-account",description:Z.enumValues({"agent-account":"a position held by an agent account"})},account:{...pe,description:Z.address("agent account that holds the position")},positionId:{...ye,description:"Bytes32 hex id of the position within the agent account (0x plus 64 hex digits)."}},["kind","account","positionId"])]};function nn(n){let t=T(n);if(t.kind!=="family")throw new a("This step supports Launcher family positions only. NFT and agent-account position reads are reserved for a later integration.");fe(t,["kind","launcher","familyId","member"],["kind","launcher","familyId","member"]);let e=ve(t.member,8);if(e>7n)throw new a("Hookr family member must be a decimal string from 0 to 7.");return{kind:"family",launcher:Ie(t.launcher),familyId:K(t.familyId),member:e.toString()}}var G=n=>Ye(BigInt.asUintN(256,n),{size:32}),Pe=(n,t)=>Ae(Ge([{type:"bytes32"},{type:"bytes32"}],[n,t]));function ke(n,t,e,l,r,h){let o=Pe(n,G(6n)),m=g=>Pe(G(BigInt(g)),G(BigInt(o)+4n)),d=Ae(Ge([{type:"bytes32"},{type:"uint8"}],[e,l])),i=Ae(Ee(["address","int24","int24","bytes32"],[t,r,h,d])),c=Pe(i,G(BigInt(o)+6n));return[o,G(BigInt(o)+1n),G(BigInt(o)+2n),G(BigInt(m(r))+1n),G(BigInt(m(r))+2n),G(BigInt(m(h))+1n),G(BigInt(m(h))+2n),c,G(BigInt(c)+1n),G(BigInt(c)+2n)]}function le(n,t,e,l,r,h){return BigInt.asUintN(256,l<r?t-e:l>=h?e-t:n-t-e)}function de(n,t,e){if(n<0n||n>=1n<<128n||[t,e].some(l=>l<0n||l>=Qe))throw new a("Hookr fee inputs are outside the verified v4 layout.");return n*BigInt.asUintN(256,t-e)/Je}function be(n){let t=T(n),e={currency0:b(t.currency0),currency1:b(t.currency1),fee:Number(u(t.fee,24)),tickSpacing:Number(u(t.tickSpacing,24)),hooks:b(t.hooks)};if(BigInt(e.currency0)>=BigInt(e.currency1)||e.fee!==8388608||e.hooks!==M||e.tickSpacing<1||e.tickSpacing>32767)throw new a("Hookr family PoolKey is not a supported Root dynamic-fee pool.");return e}async function tn(n,t,e,l){let r=await ie(n,l),h={},o=new Set,m=(s,x=[])=>R(n,e.launcher,j(e.launcher===We(E.launcherV1)?"launcherV1":"launcher"),s,x,r.number),d=async(s,x)=>{try{return await x()}catch(w){return h[s]=w instanceof a?w.message:`Hookr ${s} read failed at block ${r.number}. Retry the named-block read; no zero or empty result is implied.`,null}},i={chainId:4663,blockNumber:r.number.toString(),blockHash:r.hash,position:e,owner:null,ownedByWallet:null,poolId:null,poolKey:null,range:null,liquidity:null,tokens:null,principal:null,uncollectedLpFees:null,collectedLpFees:null,claimableCoreCredits:null,poolPendingRecapture:null,inRange:null,gateStatus:null,locks:null},c=async()=>(await He(n,r),{...i,readStatus:{status:Object.keys(h).length?"partial":"complete",reasons:h},warnings:["collectedLpFees is null: no complete collection-history reconstruction is available in this step.","LP fees can include donations already released into v4 fee growth. Pending recapture is pool-level, unallocated and excluded from LP fees.","Principal is current withdrawable token inventory before fees, gas or price changes; it is not the original deposit value."]});if(await d("pins",async()=>(await W(n,r.number,[e.launcher,M,X],o),!0))===null)return c();let g=await d("owner",async()=>{let s=b(await m("familyOwner",[e.familyId]));if(s===$e)throw new a("Hookr family does not exist at this block. Check its Launcher and family ID.");return s});if(g===null)return c();i.owner=g,i.ownedByWallet=g===t;let P=await d("position",async()=>{let[s,x,w]=await Promise.all([m("memberCount",[e.familyId]),m("position",[e.familyId,Number(e.member)]),m("poolManager")]);if(w!==X||u(s,8)>8n||BigInt(e.member)>=u(s,8))throw new a("Hookr family member or PoolManager is invalid.");let y=T(x),k=be(y.key);if(typeof y.tickLower!="number"||typeof y.tickUpper!="number")throw new a("Hookr position range is incomplete.");ce(y.tickLower,y.tickUpper,k.tickSpacing);let p=u(y.liquidity,128),I=se(k);if(await m("poolFamily",[I])!==e.familyId)throw new a("Hookr pool does not belong to this family.");return{key:k,id:I,tickLower:y.tickLower,tickUpper:y.tickUpper,liquidity:p}});if(P===null)return c();let{key:f,id:H,tickLower:v,tickUpper:S,liquidity:V}=P;i.poolKey=f,i.poolId=H,i.range={tickLower:v,tickUpper:S},i.liquidity=V.toString();let[A,q,C]=await Promise.all([d("tokens",()=>Promise.all([te(n,f.currency0,r.number),te(n,f.currency1,r.number)])),d("feeGrowth",async()=>{let s=ke(H,e.launcher,e.familyId,Number(e.member),v,S),x=await R(n,X,Ze,"extsload",[s],r.number),w=Y(x,10).map(Ne=>BigInt(K(Ne))),[y,k,p,I,N,B,D,L,F,U]=w,z=y&(1n<<160n)-1n,_=Number(BigInt.asIntN(24,y>>160n));if(z===0n||_<-887272||_>887272||L!==V)throw new a("Hookr PoolManager position is uninitialized or differs from the Launcher liquidity. No principal or fee amount is inferred.");let _e=le(k,I,B,_,v,S),Me=le(p,N,D,_,v,S);return{sqrtPriceX96:z,tick:_,fee0:de(V,_e,F),fee1:de(V,Me,U)}}),d("poolConfig",async()=>{let s=T(await R(n,M,j("rootV1"),"poolConfig",[H],r.number));if(b(s.liquidityOwner)!==e.launcher||![f.currency0,f.currency1].includes(b(s.subject))||![f.currency0,f.currency1].includes(b(s.quote))||s.subject===s.quote)throw new a("Hookr pool configuration differs from this family position.");let x=b(s.rules),w=ae(x);return await W(n,r.number,[x],o),{pc:s,core:x,role:w}})]);if(i.tokens=A,q&&(i.inRange=q.tick>=v&&q.tick<S,A)){let s=Fe({liquidity:V,tickLower:v,tickUpper:S,sqrtPriceX96:q.sqrtPriceX96});i.principal=[{token:A[0],amount:s.amount0.toString()},{token:A[1],amount:s.amount1.toString()}],i.uncollectedLpFees=[{token:A[0],amount:q.fee0.toString()},{token:A[1],amount:q.fee1.toString()}]}if(C){let s=(p,I=[])=>R(n,C.core,j("rulesV1"),p,I,r.number),[x,w,y,k]=await Promise.all([d("gateStatus",async()=>{let p=b(C.pc.advisory);return ze(n,r.number,H,e.launcher,p,C.pc)}),d("locks",async()=>qe(n,{position:e,block:r,poolId:H,core:C.core,role:C.role})),d("claimableCoreCredits",async()=>{if(!A)throw new a("Read token metadata before displaying core credits.");let p=await s("poolAccruedCurrencies",[H]);if(!Array.isArray(p)||p.length>32||p.some(B=>B!==f.currency0&&B!==f.currency1))throw new a("Core accrual includes unmeasured currencies; read the core directly before collecting.");let[I,N]=await Promise.all([Promise.all([f.currency0,f.currency1].map(B=>s("poolAccrued",[H,B]))),Promise.all([f.currency0,f.currency1].map(B=>R(n,C.core,j(C.role),"claimable",[B,t],r.number)))]);return{core:C.core,familyOwnerAccrual:I.map((B,D)=>({token:A[D],amount:u(B).toString()})),walletCredits:N.map((B,D)=>({token:A[D],amount:u(B).toString()})),walletCreditsScope:"Core-wide wallet credits, not attributed to this position. Do not add them to LP fees."}}),d("poolPendingRecapture",async()=>{if(!A)throw new a("Read token metadata before displaying pending recapture.");let p=Y(await s("pendingDonation",[H]),5).map(I=>u(I));return{due:[{token:A[0],amount:p[0].toString()},{token:A[1],amount:p[1].toString()}],fresh:[{token:A[0],amount:p[2].toString()},{token:A[1],amount:p[3].toString()}],freshChildBlock:p[4].toString(),scope:"pool",allocatedToPosition:!1}})]);i.gateStatus=x,i.locks=w,i.claimableCoreCredits=y,i.poolPendingRecapture=k}return c()}function xn(n){return[{name:"hookr_lp_position",inputSchema:me({position:en,...Ce},["position"]),execute:async(t,e)=>{fe(t,["position","blockNumber"],["position"]);let l=nn(t.position);if(n.network==="testnet")throw new a("Hookr LP reads are configured only on mainnet, chain 4663.");try{return await tn(n.clientFor(4663),e,l,Re(t))}catch(r){throw r instanceof a?r:new a("Hookr position block is unavailable. Retry the complete named-block read; no zero position or fee is implied.")}}}]}export{en as a,nn as b,ke as c,le as d,de as e,be as f,tn as g,xn as h,Le as i,Te as j,Ke as k,mn as l,qe as m,je as n,Ue as o,pn as p,ze as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as s,f as i}from"./UMY6SP7C.js";import{a as t}from"./XSD5NL7J.js";function p(o,n){if(s(n,["id","ceiling","floor"],["id","ceiling","floor"]),n.id!=="storm-fee")throw new t("Choose Hook Block storm-fee.");let e=i(n.ceiling,8),r=i(n.floor,8);if(!e||e>200n||r>e||e*500n*BigInt(o.protocolShareBps)<10000n||o.potEveryNBuys&1<<22||o.potMinBuyQuote>>63n&(1n<<22n)-1n)throw new t("Storm Fee needs a ceiling of 1\u2013200, floor no higher than ceiling, and an unoccupied field with a nonzero protocol slice.");return{...o,potEveryNBuys:o.potEveryNBuys|1<<30|1<<22,potMinBuyQuote:o.potMinBuyQuote|e<<63n|r<<71n}}function l(o,n){let e=o.potMinBuyQuote>>63n&255n;return`Storm Fee: ${(o.potMinBuyQuote>>71n&255n)*500n}\u2013${e*500n} gross pips, tempo 0; Hookr ${n} receives floor(charged pips * ${o.protocolShareBps}/10000) in quote and in-range LPs receive the remainder as LP fee, subject to LP fee room.`}export{p as a,l as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as j}from"./USGMGKAG.js";import{h as me,k as ke}from"./2GXHYI23.js";import{b as S}from"./N624NR7Y.js";import{b as le}from"./SPJCSEKP.js";import{a as _}from"./43LI5NKJ.js";import{g as B,i as ue}from"./NWNYJ26T.js";import{b as H}from"./IX3GZMTM.js";import{b as d,j as N}from"./TI727O2H.js";import{a as u}from"./XSD5NL7J.js";import{a as de}from"./JXOEJPJ4.js";import{encodeFunctionData as K,erc20Abi as pe,getAddress as m,isAddress as ye,parseAbi as U,zeroAddress as fe}from"viem";var T=m(N[d].hoodlock.locker.address),F=m(N[d].hoodlock.burner.address),v=m(N[d].hoodlock.liquidityLocker.address),O=m(N[d].uniswap.v3_position_manager.address),V=m(N[d].uniswap.v4_position_manager.address),We="0x000000000000000000000000000000000000dEaD",$e=3153600000n,Le=1000000000000n,we=65535,D=U(["function fee() view returns (uint256)","function lock(address token, uint256 amount, uint256 unlockTime) payable returns (uint256 lockId)","function getLock(uint256 lockId) view returns (address owner, address token, uint256 amount, uint256 unlockTime, bool withdrawn)","function locksByOwner(address owner) view returns (uint256[])","function locksByToken(address token) view returns (uint256[])"]),te=U(["function fee() view returns (uint256)","function burn(address token, uint256 amount) payable returns (uint256 burnId)","function DEAD() view returns (address)","function getBurn(uint256 burnId) view returns (address burner, address token, uint256 amount, uint256 timestamp)","function totalBurnedOf(address token) view returns (uint256)"]),q=U(["function fixedFee() view returns (uint256)","function collectFeeBps() view returns (uint16)","function paused() view returns (bool)","function lock(address manager, uint256 tokenId, uint256 unlockTime, address feeRecipient, bool acceptUnverifiedHook, uint16 maxCollectFeeBps) payable returns (uint256 lockId)","function lockIdOf(address manager, uint256 tokenId) view returns (uint256)","function getLock(uint256 lockId) view returns (address owner, uint40 unlockTime, uint16 collectFeeBps, bool isV4, bool hookVerified, bool withdrawn, address feeRecipient, address token0, address token1, uint256 tokenId)","function locksOf(address owner) view returns (uint256[])"]),Se=U(["function approve(address to, uint256 tokenId)"]);function xe(e,o,t){let a=o.trim();if(a.startsWith("-")){let k=a.slice(1),i=e(k,t);return i==="0"?"0":`-${i}`}return e(a,t)}function ge(e,o){return o.length===0?"no ERC-20 transfer deltas":o.map(t=>`${xe(e.formatAmount,t.amount,t.token.decimals)} ${t.token.symbol}`).join(", ")}function E(e,o="token"){if(typeof e!="string"||!e.trim())throw new u(`Provide a valid ${o} contract address.`);if(!ye(e,{strict:!1}))throw new u(`Identify ${o} by chain and contract address, not by symbol.`);return m(e)}async function W(e,o){try{return await o()}catch(t){throw new u(e.plainError(t))}}function ve(e){let o=H(e);if(o<=0n)throw new u("Amount must be greater than zero.");return o}async function be(e){let o=await e.getBlock();if(!o||typeof o.timestamp!="bigint")throw new u("Could not read the current chain timestamp. Please try again.");return o.timestamp}function he(e,o){if(typeof e!="string"||!/^\d+$/.test(e.trim()))throw new u("unlockTime must be a non-negative integer string in Unix seconds.");let t=BigInt(e.trim());if(t>=Le)throw new u("unlockTime appears to be in milliseconds; provide Unix seconds at most 100 years (3153600000 seconds) in the future.");if(t<=o)throw new u(`unlockTime (${t}) must be in the future (greater than current timestamp ${o}).`);let a=o+$e;if(t>a)throw new u(`unlockTime (${t}) exceeds the 100-year maximum lock duration (3153600000 seconds; max ${a}).`);return t}async function ie(e,o,t=d){let a=m(o),[k,i]=await Promise.all([e.readContract({address:a,abi:pe,functionName:"symbol"}),e.readContract({address:a,abi:pe,functionName:"decimals"})]);return{address:a,symbol:de(String(k)),decimals:Number(i),chainId:t}}function Ie(e,o){if(e==null)return o;let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number(e.trim()):NaN;if(!Number.isInteger(t)||t<0||t>we)throw new u("maxCollectFeeBps must be an integer between 0 and 65535.");if(t<o)throw new u(`Live collectFeeBps (${o}) exceeds maxCollectFeeBps (${t}): collect fee changed.`);return Math.min(t,o)}function Pe(e){return e.tokenId!==void 0||e.manager!==void 0||e.feeRecipient!==void 0||e.maxCollectFeeBps!==void 0||e.acceptUnverifiedHook!==void 0||e.kind==="v3"||e.kind==="lp"||e.kind==="v4"||e.version==="v3"||e.version==="v4"}async function Ce(e,o,t){_(t);let a=m(t),k=o.kind==="v4"||o.version==="v4",i=o.manager!==void 0?E(o.manager,"manager"):k?V:O,g=i===V;if(i!==O&&!g)throw new u(`Unsupported position manager ${i}; use the configured Uniswap v3 or v4 manager.`);if(k&&!g||g&&(o.kind==="v3"||o.version==="v3"))throw new u("The requested version disagrees with the position manager.");if(o.acceptUnverifiedHook!==void 0&&typeof o.acceptUnverifiedHook!="boolean")throw new u("acceptUnverifiedHook must be a boolean.");let b=o.acceptUnverifiedHook===!0;if(!g&&b)throw new u("Uniswap v3 has no hooks; omit acceptUnverifiedHook.");let s=g?"v4":"v3";if(typeof o.tokenId!="string")throw new u("Provide an NFT tokenId as a decimal string.");let p=String(o.tokenId).trim(),c=H(p),l=ue(o.feeRecipient,"Provide an explicit feeRecipient address for LP position locks."),w=e.clientFor(d),[x,I,h]=await Promise.all([be(w),w.readContract({address:v,abi:q,functionName:"fixedFee"}),w.readContract({address:v,abi:q,functionName:"collectFeeBps"})]),y,$=!0;if(g){let C=U(["function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey, uint256 info)","function getPositionLiquidity(uint256 tokenId) view returns (uint128)","function ownerOf(uint256 tokenId) view returns (address)"]),[Y,J,M]=await Promise.all([w.readContract({address:i,abi:C,functionName:"getPoolAndPositionInfo",args:[c]}),w.readContract({address:i,abi:C,functionName:"getPositionLiquidity",args:[c]}),w.readContract({address:i,abi:C,functionName:"ownerOf",args:[c]})]);if(m(M)!==a)throw new u("This wallet does not own that v4 position NFT.");if(J<=0n)throw new u("The v4 position has no liquidity to lock.");if(y=m(Y[0].hooks),$=y===fe||await w.readContract({address:v,abi:U(["function hookAllowed(address) view returns (bool)"]),functionName:"hookAllowed",args:[y]}),!$&&!b)throw new u(`Unverified v4 hook ${y}; review its risks and explicitly set acceptUnverifiedHook: true to proceed.`)}let A=he(o.unlockTime,x),n=BigInt(I),r=Number(h);if(!Number.isInteger(r)||r<0||r>we)throw new u(`Invalid on-chain collectFeeBps (${String(h)}).`);if(o.maxFee!==void 0){let C=H(String(o.maxFee));if(n>C)throw new u(`Live fixedFee (${n}) exceeds maxFee (${C}).`)}let f=Ie(o.maxCollectFeeBps,r),L=(r/100).toString(),R=e.unsignedTx({to:i,data:K({abi:Se,functionName:"approve",args:[v,c]}),value:"0",chainId:d,description:`Approve Uniswap ${s} position NFT #${c} on ${i} for HoodLock LiquidityLocker ${v}.`}),P=e.unsignedTx({to:v,data:K({abi:q,functionName:"lock",args:[i,c,A,l,b,f]}),value:n.toString(),chainId:d,description:`Lock Uniswap ${s} NFT #${c} in HoodLock LiquidityLocker (${v}) until ${A} with feeRecipient ${l}, upfront fixedFee ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei), and ongoing collect fee ${r} bps (${L}% of collected LP fees, frozen per lock).`}),X=[R,P],z=await e.preview(X,a),Q=`Approve and lock Uniswap ${s} NFT #${c} (manager ${i}) in HoodLock LiquidityLocker ${v} until Unix ${A}. Upfront fixedFee: ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei). Ongoing LP fee share: ${r} bps (${L}% of collected LP fees, frozen per lock; maxCollectFeeBps=${f}) with feeRecipient ${l}. V4 hook: ${y??"none"}, reviewed: ${$}; acceptUnverifiedHook=${b}.`;return j(e,{txs:z.txs,summary:Q,preview:z,kind:s,contract:v,manager:i,tokenId:c.toString(),unlockTime:A.toString(),feeRecipient:l,acceptUnverifiedHook:b,collectFeeBps:r,maxCollectFeeBps:f,fixedFee:{token:S,amount:n.toString()}},v,n)}async function Fe(e,o,t){_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([be(i),i.readContract({address:T,abi:D,functionName:"fee"}),ie(i,k,d)]),p=ve(o.amount),c=he(o.unlockTime,g),l=BigInt(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(l>A)throw new u(`Live lock fee (${l}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,T,p.toString(),d),x=e.unsignedTx({to:T,data:K({abi:D,functionName:"lock",args:[s.address,p,c]}),value:l.toString(),chainId:d,description:`Lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until ${c} with exact fee ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until Unix ${c}. Exact fee: ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,kind:"token",contract:T,token:s,amount:p.toString(),unlockTime:c.toString(),fee:{token:S,amount:l.toString()}},T,l)}function Re(e){return{name:"hoodlock_lock",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["token","v2","v3","v4"],description:"Lock mode: token/v2 LP via Locker, or Uniswap v3/v4 NFT via LiquidityLocker."},token:{type:"string",description:"ERC-20 token or v2 LP token contract address on chain 4663 (for token/v2 locks)."},amount:{type:"string",description:"Token amount as an integer string in base units (for token/v2 locks)."},manager:{type:"string",description:"Configured Uniswap v3 or v4 position manager; inferred from kind when omitted."},tokenId:{type:"string",description:"Uniswap NFT position tokenId as a decimal string."},feeRecipient:{type:"string",description:"Explicit recipient address for collected LP fees during a position lock."},acceptUnverifiedHook:{type:"boolean",description:"Explicit v4 unreviewed-hook consent; default false. A reviewed hook is not a safety guarantee."},maxFee:{type:"string",description:"Maximum upfront ETH fee in wei; the exact live fee is sent."},maxCollectFeeBps:{type:"number",description:"Maximum acceptable ongoing LP collect fee in bps (uint16, must be >= live collectFeeBps)."},unlockTime:{type:"string",description:"Unlock timestamp in Unix seconds (must be > now and <= now + 100 years)."}},required:["unlockTime"],additionalProperties:!1},async execute(o,t){return W(e,async()=>Pe(o)?Ce(e,o,t):Fe(e,o,t))}}}function Ne(e){return{name:"hoodlock_burn",inputSchema:{type:"object",properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663 to send to the dead address via HoodLock Burner."},amount:{type:"string",description:"Amount to burn as an integer string in base units."}},required:["token","amount"],additionalProperties:!1},async execute(o,t){return W(e,async()=>{_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([i.readContract({address:F,abi:te,functionName:"fee"}),i.readContract({address:F,abi:te,functionName:"DEAD"}),ie(i,k,d)]),p=ve(o.amount),c=BigInt(g),l=m(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(c>A)throw new u(`Live burn fee (${c}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,F,p.toString(),d),x=e.unsignedTx({to:F,data:K({abi:te,functionName:"burn",args:[s.address,p]}),value:c.toString(),chainId:d,description:`Send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F} (totalSupply is unchanged) with exact fee ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F}. Note: tokens are transferred to ${l} and totalSupply is unchanged. Exact fee: ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,contract:F,deadAddress:l,token:s,amount:p.toString(),fee:{token:S,amount:c.toString()},totalSupplyReduced:!1},F,c)})}}}async function Ae(e,o,t){_(o);let a=m(o),k=t?E(t,"token"):void 0,i=e.clientFor(d),g=[],b=new Set,s=n=>{for(let r of n){let f=r.toString();b.has(f)||(b.add(f),g.push(r))}};if(k){let[n,r]=await Promise.all([i.readContract({address:T,abi:D,functionName:"locksByToken",args:[k]}),i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]})]);s(n),s(r)}else{let n=await i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]});s(n)}let c=(await Promise.all(g.map(async n=>{let r=await i.readContract({address:T,abi:D,functionName:"getLock",args:[n]});return{id:n,owner:m(r[0]),token:m(r[1]),amount:BigInt(r[2]),unlockTime:BigInt(r[3]),withdrawn:!!r[4]}}))).filter(n=>!n.withdrawn&&n.amount>0n&&B(n.owner,a)&&(!k||B(n.token,k))),l=new Map,w=async n=>{let r=n.toLowerCase(),f=l.get(r);if(f)return f;let L=n===fe?S:await ie(i,n,d);return l.set(r,L),L},x=[],I=[];for(let n of c){let r=await w(n.token),f=n.amount.toString(),L=n.unlockTime.toString(),R={token:r,amount:f};x.push({lockId:n.id.toString(),kind:"token",contract:T,chainId:d,owner:n.owner,token:r,amount:f,asset:R,unlockTime:L,withdrawn:!1}),I.push({module:"hoodlock",id:`lock:${n.id.toString()}`,chainId:d,assets:[R],economics:{principal:[me("locked",{token:r,amount:f,source:"hoodlock.lock.amount",dueAt:L})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`HoodLock token lock #${n.id} of ${e.formatAmount(f,r.decimals)} ${r.symbol} (${r.address}) until Unix ${L}.`})}let h=await i.readContract({address:v,abi:q,functionName:"locksOf",args:[a]}),y=[...new Set(h.map(n=>n.toString()))].map(n=>BigInt(n)),$=[];for(let n of y){let r=await i.readContract({address:v,abi:q,functionName:"getLock",args:[n]}),[f,L,R,P,X,z,Q,C,Y,J]=r,M=m(f);if(z||!B(M,a))continue;let re=m(C),se=m(Y);if(k&&!B(re,k)&&!B(se,k))continue;let[Z,ee]=await Promise.all([w(re),w(se)]),ae=m(Q),ce=Number(R),oe=BigInt(L).toString(),ne=BigInt(J).toString();$.push({lockId:n.toString(),kind:P?"v4":"v3",contract:v,manager:P?V:O,chainId:d,owner:M,tokenId:ne,unlockTime:oe,collectFeeBps:ce,feeRecipient:ae,hookVerified:!!X,token0:Z,token1:ee,withdrawn:!1}),I.push({module:"hoodlock",id:`lp-lock:${n.toString()}`,chainId:d,assets:[{token:{address:P?V:O,symbol:`UNI-${P?"V4":"V3"} #${ne}`,decimals:0,chainId:d},amount:"1"}],economics:{principal:[],debt:[],rewards:[],backing:[Z,ee].map(Te=>ke({token:Te,amount:null,source:"hoodlock.lpLock.underlying",unknownReason:"HoodLock does not read the locked LP's underlying amounts.",heldAs:P?V:O,dueAt:oe})),coverage:{complete:!0}},description:`HoodLock Uniswap ${P?"v4":"v3"} LP lock #${n} (NFT #${ne}, ${Z.symbol}/${ee.symbol}, feeRecipient ${ae}, collectFeeBps ${ce}) until Unix ${oe}. One NFT held in LiquidityLocker custody for ${M}. Underlying token amounts are not valued.`})}let A=`Found ${x.length} active token lock(s) and ${$.length} active Uniswap v3/v4 LP lock(s) for ${a}.`;return{locks:x,lpLocks:$,positions:I,summary:A}}function He(e){return{name:"hoodlock_list_locks",inputSchema:{type:"object",properties:{owner:{type:"string",description:"Optional owner wallet address to query (defaults to the authenticated wallet)."},token:{type:"string",description:"Optional ERC-20 or LP token address to filter active locks owned by the wallet."}},additionalProperties:!1},async execute(o,t){let a=o.owner!==void 0?E(o.owner,"owner"):m(t),k=o.token!==void 0?E(o.token,"token"):void 0;return W(e,()=>Ae(e,a,k))}}}function Be(e){return async o=>(await W(e,()=>Ae(e,o))).positions}var G=e=>({tools:[Re(e),Ne(e),He(e)],positions:Be(e)}),Ge=G,Xe=G,Qe=e=>le("hoodlock",[G(e)]),Ye=G;export{T as a,F as b,v as c,O as d,V as e,We as f,$e as g,xe as h,Re as i,Ne as j,He as k,Be as l,G as m,Ge as n,Xe as o,Qe as p,Ye as q};
|
|
1
|
+
import{b as j}from"./JTWJT2O3.js";import{h as me,k as ke}from"./2GXHYI23.js";import{b as S}from"./5PNFV7HH.js";import{b as le}from"./SPJCSEKP.js";import{a as _}from"./43LI5NKJ.js";import{g as B,i as ue}from"./NWNYJ26T.js";import{b as H}from"./IX3GZMTM.js";import{b as d,j as N}from"./EWZFZUVF.js";import{a as u}from"./XSD5NL7J.js";import{a as de}from"./JXOEJPJ4.js";import{encodeFunctionData as K,erc20Abi as pe,getAddress as m,isAddress as ye,parseAbi as U,zeroAddress as fe}from"viem";var T=m(N[d].hoodlock.locker.address),F=m(N[d].hoodlock.burner.address),v=m(N[d].hoodlock.liquidityLocker.address),O=m(N[d].uniswap.v3_position_manager.address),V=m(N[d].uniswap.v4_position_manager.address),We="0x000000000000000000000000000000000000dEaD",$e=3153600000n,Le=1000000000000n,we=65535,D=U(["function fee() view returns (uint256)","function lock(address token, uint256 amount, uint256 unlockTime) payable returns (uint256 lockId)","function getLock(uint256 lockId) view returns (address owner, address token, uint256 amount, uint256 unlockTime, bool withdrawn)","function locksByOwner(address owner) view returns (uint256[])","function locksByToken(address token) view returns (uint256[])"]),te=U(["function fee() view returns (uint256)","function burn(address token, uint256 amount) payable returns (uint256 burnId)","function DEAD() view returns (address)","function getBurn(uint256 burnId) view returns (address burner, address token, uint256 amount, uint256 timestamp)","function totalBurnedOf(address token) view returns (uint256)"]),q=U(["function fixedFee() view returns (uint256)","function collectFeeBps() view returns (uint16)","function paused() view returns (bool)","function lock(address manager, uint256 tokenId, uint256 unlockTime, address feeRecipient, bool acceptUnverifiedHook, uint16 maxCollectFeeBps) payable returns (uint256 lockId)","function lockIdOf(address manager, uint256 tokenId) view returns (uint256)","function getLock(uint256 lockId) view returns (address owner, uint40 unlockTime, uint16 collectFeeBps, bool isV4, bool hookVerified, bool withdrawn, address feeRecipient, address token0, address token1, uint256 tokenId)","function locksOf(address owner) view returns (uint256[])"]),Se=U(["function approve(address to, uint256 tokenId)"]);function xe(e,o,t){let a=o.trim();if(a.startsWith("-")){let k=a.slice(1),i=e(k,t);return i==="0"?"0":`-${i}`}return e(a,t)}function ge(e,o){return o.length===0?"no ERC-20 transfer deltas":o.map(t=>`${xe(e.formatAmount,t.amount,t.token.decimals)} ${t.token.symbol}`).join(", ")}function E(e,o="token"){if(typeof e!="string"||!e.trim())throw new u(`Provide a valid ${o} contract address.`);if(!ye(e,{strict:!1}))throw new u(`Identify ${o} by chain and contract address, not by symbol.`);return m(e)}async function W(e,o){try{return await o()}catch(t){throw new u(e.plainError(t))}}function ve(e){let o=H(e);if(o<=0n)throw new u("Amount must be greater than zero.");return o}async function be(e){let o=await e.getBlock();if(!o||typeof o.timestamp!="bigint")throw new u("Could not read the current chain timestamp. Please try again.");return o.timestamp}function he(e,o){if(typeof e!="string"||!/^\d+$/.test(e.trim()))throw new u("unlockTime must be a non-negative integer string in Unix seconds.");let t=BigInt(e.trim());if(t>=Le)throw new u("unlockTime appears to be in milliseconds; provide Unix seconds at most 100 years (3153600000 seconds) in the future.");if(t<=o)throw new u(`unlockTime (${t}) must be in the future (greater than current timestamp ${o}).`);let a=o+$e;if(t>a)throw new u(`unlockTime (${t}) exceeds the 100-year maximum lock duration (3153600000 seconds; max ${a}).`);return t}async function ie(e,o,t=d){let a=m(o),[k,i]=await Promise.all([e.readContract({address:a,abi:pe,functionName:"symbol"}),e.readContract({address:a,abi:pe,functionName:"decimals"})]);return{address:a,symbol:de(String(k)),decimals:Number(i),chainId:t}}function Ie(e,o){if(e==null)return o;let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number(e.trim()):NaN;if(!Number.isInteger(t)||t<0||t>we)throw new u("maxCollectFeeBps must be an integer between 0 and 65535.");if(t<o)throw new u(`Live collectFeeBps (${o}) exceeds maxCollectFeeBps (${t}): collect fee changed.`);return Math.min(t,o)}function Pe(e){return e.tokenId!==void 0||e.manager!==void 0||e.feeRecipient!==void 0||e.maxCollectFeeBps!==void 0||e.acceptUnverifiedHook!==void 0||e.kind==="v3"||e.kind==="lp"||e.kind==="v4"||e.version==="v3"||e.version==="v4"}async function Ce(e,o,t){_(t);let a=m(t),k=o.kind==="v4"||o.version==="v4",i=o.manager!==void 0?E(o.manager,"manager"):k?V:O,g=i===V;if(i!==O&&!g)throw new u(`Unsupported position manager ${i}; use the configured Uniswap v3 or v4 manager.`);if(k&&!g||g&&(o.kind==="v3"||o.version==="v3"))throw new u("The requested version disagrees with the position manager.");if(o.acceptUnverifiedHook!==void 0&&typeof o.acceptUnverifiedHook!="boolean")throw new u("acceptUnverifiedHook must be a boolean.");let b=o.acceptUnverifiedHook===!0;if(!g&&b)throw new u("Uniswap v3 has no hooks; omit acceptUnverifiedHook.");let s=g?"v4":"v3";if(typeof o.tokenId!="string")throw new u("Provide an NFT tokenId as a decimal string.");let p=String(o.tokenId).trim(),c=H(p),l=ue(o.feeRecipient,"Provide an explicit feeRecipient address for LP position locks."),w=e.clientFor(d),[x,I,h]=await Promise.all([be(w),w.readContract({address:v,abi:q,functionName:"fixedFee"}),w.readContract({address:v,abi:q,functionName:"collectFeeBps"})]),y,$=!0;if(g){let C=U(["function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey, uint256 info)","function getPositionLiquidity(uint256 tokenId) view returns (uint128)","function ownerOf(uint256 tokenId) view returns (address)"]),[Y,J,M]=await Promise.all([w.readContract({address:i,abi:C,functionName:"getPoolAndPositionInfo",args:[c]}),w.readContract({address:i,abi:C,functionName:"getPositionLiquidity",args:[c]}),w.readContract({address:i,abi:C,functionName:"ownerOf",args:[c]})]);if(m(M)!==a)throw new u("This wallet does not own that v4 position NFT.");if(J<=0n)throw new u("The v4 position has no liquidity to lock.");if(y=m(Y[0].hooks),$=y===fe||await w.readContract({address:v,abi:U(["function hookAllowed(address) view returns (bool)"]),functionName:"hookAllowed",args:[y]}),!$&&!b)throw new u(`Unverified v4 hook ${y}; review its risks and explicitly set acceptUnverifiedHook: true to proceed.`)}let A=he(o.unlockTime,x),n=BigInt(I),r=Number(h);if(!Number.isInteger(r)||r<0||r>we)throw new u(`Invalid on-chain collectFeeBps (${String(h)}).`);if(o.maxFee!==void 0){let C=H(String(o.maxFee));if(n>C)throw new u(`Live fixedFee (${n}) exceeds maxFee (${C}).`)}let f=Ie(o.maxCollectFeeBps,r),L=(r/100).toString(),R=e.unsignedTx({to:i,data:K({abi:Se,functionName:"approve",args:[v,c]}),value:"0",chainId:d,description:`Approve Uniswap ${s} position NFT #${c} on ${i} for HoodLock LiquidityLocker ${v}.`}),P=e.unsignedTx({to:v,data:K({abi:q,functionName:"lock",args:[i,c,A,l,b,f]}),value:n.toString(),chainId:d,description:`Lock Uniswap ${s} NFT #${c} in HoodLock LiquidityLocker (${v}) until ${A} with feeRecipient ${l}, upfront fixedFee ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei), and ongoing collect fee ${r} bps (${L}% of collected LP fees, frozen per lock).`}),X=[R,P],z=await e.preview(X,a),Q=`Approve and lock Uniswap ${s} NFT #${c} (manager ${i}) in HoodLock LiquidityLocker ${v} until Unix ${A}. Upfront fixedFee: ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei). Ongoing LP fee share: ${r} bps (${L}% of collected LP fees, frozen per lock; maxCollectFeeBps=${f}) with feeRecipient ${l}. V4 hook: ${y??"none"}, reviewed: ${$}; acceptUnverifiedHook=${b}.`;return j(e,{txs:z.txs,summary:Q,preview:z,kind:s,contract:v,manager:i,tokenId:c.toString(),unlockTime:A.toString(),feeRecipient:l,acceptUnverifiedHook:b,collectFeeBps:r,maxCollectFeeBps:f,fixedFee:{token:S,amount:n.toString()}},v,n)}async function Fe(e,o,t){_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([be(i),i.readContract({address:T,abi:D,functionName:"fee"}),ie(i,k,d)]),p=ve(o.amount),c=he(o.unlockTime,g),l=BigInt(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(l>A)throw new u(`Live lock fee (${l}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,T,p.toString(),d),x=e.unsignedTx({to:T,data:K({abi:D,functionName:"lock",args:[s.address,p,c]}),value:l.toString(),chainId:d,description:`Lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until ${c} with exact fee ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until Unix ${c}. Exact fee: ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,kind:"token",contract:T,token:s,amount:p.toString(),unlockTime:c.toString(),fee:{token:S,amount:l.toString()}},T,l)}function Re(e){return{name:"hoodlock_lock",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["token","v2","v3","v4"],description:"Lock mode: token/v2 LP via Locker, or Uniswap v3/v4 NFT via LiquidityLocker."},token:{type:"string",description:"ERC-20 token or v2 LP token contract address on chain 4663 (for token/v2 locks)."},amount:{type:"string",description:"Token amount as an integer string in base units (for token/v2 locks)."},manager:{type:"string",description:"Configured Uniswap v3 or v4 position manager; inferred from kind when omitted."},tokenId:{type:"string",description:"Uniswap NFT position tokenId as a decimal string."},feeRecipient:{type:"string",description:"Explicit recipient address for collected LP fees during a position lock."},acceptUnverifiedHook:{type:"boolean",description:"Explicit v4 unreviewed-hook consent; default false. A reviewed hook is not a safety guarantee."},maxFee:{type:"string",description:"Maximum upfront ETH fee in wei; the exact live fee is sent."},maxCollectFeeBps:{type:"number",description:"Maximum acceptable ongoing LP collect fee in bps (uint16, must be >= live collectFeeBps)."},unlockTime:{type:"string",description:"Unlock timestamp in Unix seconds (must be > now and <= now + 100 years)."}},required:["unlockTime"],additionalProperties:!1},async execute(o,t){return W(e,async()=>Pe(o)?Ce(e,o,t):Fe(e,o,t))}}}function Ne(e){return{name:"hoodlock_burn",inputSchema:{type:"object",properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663 to send to the dead address via HoodLock Burner."},amount:{type:"string",description:"Amount to burn as an integer string in base units."}},required:["token","amount"],additionalProperties:!1},async execute(o,t){return W(e,async()=>{_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([i.readContract({address:F,abi:te,functionName:"fee"}),i.readContract({address:F,abi:te,functionName:"DEAD"}),ie(i,k,d)]),p=ve(o.amount),c=BigInt(g),l=m(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(c>A)throw new u(`Live burn fee (${c}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,F,p.toString(),d),x=e.unsignedTx({to:F,data:K({abi:te,functionName:"burn",args:[s.address,p]}),value:c.toString(),chainId:d,description:`Send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F} (totalSupply is unchanged) with exact fee ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F}. Note: tokens are transferred to ${l} and totalSupply is unchanged. Exact fee: ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,contract:F,deadAddress:l,token:s,amount:p.toString(),fee:{token:S,amount:c.toString()},totalSupplyReduced:!1},F,c)})}}}async function Ae(e,o,t){_(o);let a=m(o),k=t?E(t,"token"):void 0,i=e.clientFor(d),g=[],b=new Set,s=n=>{for(let r of n){let f=r.toString();b.has(f)||(b.add(f),g.push(r))}};if(k){let[n,r]=await Promise.all([i.readContract({address:T,abi:D,functionName:"locksByToken",args:[k]}),i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]})]);s(n),s(r)}else{let n=await i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]});s(n)}let c=(await Promise.all(g.map(async n=>{let r=await i.readContract({address:T,abi:D,functionName:"getLock",args:[n]});return{id:n,owner:m(r[0]),token:m(r[1]),amount:BigInt(r[2]),unlockTime:BigInt(r[3]),withdrawn:!!r[4]}}))).filter(n=>!n.withdrawn&&n.amount>0n&&B(n.owner,a)&&(!k||B(n.token,k))),l=new Map,w=async n=>{let r=n.toLowerCase(),f=l.get(r);if(f)return f;let L=n===fe?S:await ie(i,n,d);return l.set(r,L),L},x=[],I=[];for(let n of c){let r=await w(n.token),f=n.amount.toString(),L=n.unlockTime.toString(),R={token:r,amount:f};x.push({lockId:n.id.toString(),kind:"token",contract:T,chainId:d,owner:n.owner,token:r,amount:f,asset:R,unlockTime:L,withdrawn:!1}),I.push({module:"hoodlock",id:`lock:${n.id.toString()}`,chainId:d,assets:[R],economics:{principal:[me("locked",{token:r,amount:f,source:"hoodlock.lock.amount",dueAt:L})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`HoodLock token lock #${n.id} of ${e.formatAmount(f,r.decimals)} ${r.symbol} (${r.address}) until Unix ${L}.`})}let h=await i.readContract({address:v,abi:q,functionName:"locksOf",args:[a]}),y=[...new Set(h.map(n=>n.toString()))].map(n=>BigInt(n)),$=[];for(let n of y){let r=await i.readContract({address:v,abi:q,functionName:"getLock",args:[n]}),[f,L,R,P,X,z,Q,C,Y,J]=r,M=m(f);if(z||!B(M,a))continue;let re=m(C),se=m(Y);if(k&&!B(re,k)&&!B(se,k))continue;let[Z,ee]=await Promise.all([w(re),w(se)]),ae=m(Q),ce=Number(R),oe=BigInt(L).toString(),ne=BigInt(J).toString();$.push({lockId:n.toString(),kind:P?"v4":"v3",contract:v,manager:P?V:O,chainId:d,owner:M,tokenId:ne,unlockTime:oe,collectFeeBps:ce,feeRecipient:ae,hookVerified:!!X,token0:Z,token1:ee,withdrawn:!1}),I.push({module:"hoodlock",id:`lp-lock:${n.toString()}`,chainId:d,assets:[{token:{address:P?V:O,symbol:`UNI-${P?"V4":"V3"} #${ne}`,decimals:0,chainId:d},amount:"1"}],economics:{principal:[],debt:[],rewards:[],backing:[Z,ee].map(Te=>ke({token:Te,amount:null,source:"hoodlock.lpLock.underlying",unknownReason:"HoodLock does not read the locked LP's underlying amounts.",heldAs:P?V:O,dueAt:oe})),coverage:{complete:!0}},description:`HoodLock Uniswap ${P?"v4":"v3"} LP lock #${n} (NFT #${ne}, ${Z.symbol}/${ee.symbol}, feeRecipient ${ae}, collectFeeBps ${ce}) until Unix ${oe}. One NFT held in LiquidityLocker custody for ${M}. Underlying token amounts are not valued.`})}let A=`Found ${x.length} active token lock(s) and ${$.length} active Uniswap v3/v4 LP lock(s) for ${a}.`;return{locks:x,lpLocks:$,positions:I,summary:A}}function He(e){return{name:"hoodlock_list_locks",inputSchema:{type:"object",properties:{owner:{type:"string",description:"Optional owner wallet address to query (defaults to the authenticated wallet)."},token:{type:"string",description:"Optional ERC-20 or LP token address to filter active locks owned by the wallet."}},additionalProperties:!1},async execute(o,t){let a=o.owner!==void 0?E(o.owner,"owner"):m(t),k=o.token!==void 0?E(o.token,"token"):void 0;return W(e,()=>Ae(e,a,k))}}}function Be(e){return async o=>(await W(e,()=>Ae(e,o))).positions}var G=e=>({tools:[Re(e),Ne(e),He(e)],positions:Be(e)}),Ge=G,Xe=G,Qe=e=>le("hoodlock",[G(e)]),Ye=G;export{T as a,F as b,v as c,O as d,V as e,We as f,$e as g,xe as h,Re as i,Ne as j,He as k,Be as l,G as m,Ge as n,Xe as o,Qe as p,Ye as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as n,f as a,i as s,j as l,k as u}from"./
|
|
1
|
+
import{d as n,f as a,i as s,j as l,k as u}from"./IY7FWTAL.js";import{c as e}from"./5PNFV7HH.js";var m="In-kind exits are a separate unsupported flow.";function b(t,i){return n(t,i,e)}function V(t,i,o,r,x,p){return a(t,i,o,r,x,p,e)}function A(t,i,o){return s(t,i,o,e,m)}function P(t){return l(t,e.symbol)}function S(t,i,o,r){u(t,i,o,r,e)}export{b as a,V as b,A as c,P as d,S as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,f as I,g}from"./6JCEJ66K.js";import{a as P}from"./43LI5NKJ.js";import{m as B}from"./NWNYJ26T.js";import{b as e,j as _}from"./
|
|
1
|
+
import{a as u,f as I,g}from"./6JCEJ66K.js";import{a as P}from"./43LI5NKJ.js";import{m as B}from"./NWNYJ26T.js";import{b as e,j as _}from"./EWZFZUVF.js";import{a as m}from"./XSD5NL7J.js";import{erc20Abi as C,getAddress as l}from"viem";var b=l(u.staking),f=l(u.agentVault),p=l(u.orbio),w={address:l(_[e].orbio.credit.address),chainId:e,symbol:"CREDIT",decimals:6},D=g.find(o=>o.type==="event"&&o.name==="AgentLaunched"),$=10000000n,A=o=>B(o,"Orbio returned an invalid on-chain amount.");async function F(o,N){try{P(N);let i=l(N),n=o.clientFor(e);if(await n.getChainId()!==e)throw new m(`Orbio requires chain ${e}.`);let a=await n.getBlockNumber(),[s,v,E,S,T]=await Promise.all([n.readContract({address:p,abi:C,functionName:"decimals",blockNumber:a}),n.readContract({address:b,abi:I,functionName:"positionOf",args:[i],blockNumber:a}),n.readContract({address:b,abi:I,functionName:"settledOf",args:[i],blockNumber:a}),n.readContract({address:p,abi:C,functionName:"balanceOf",args:[i],blockNumber:a}),n.readContract({address:w.address,abi:C,functionName:"balanceOf",args:[i],blockNumber:a})]);if(typeof s!="number"||!Number.isInteger(s)||s<0||s>36)throw new m("Orbio returned invalid ORBIO decimals.");let h={address:p,chainId:e,symbol:"ORBIO",decimals:s},R=[],d=(t,r,c,k)=>{let O=A(c);O!==0n&&R.push({module:"orbio",id:`${e}:${t}`,chainId:e,assets:[{token:{...r},amount:O.toString()}],description:`${k}: ${O} ${r.symbol} base units (${r.decimals} decimals).`})};d(`${b}:principal`,h,v,"Staked ORBIO principal; withdraw with orbio_unstake"),d(`${b}:credit`,w,E,"Claim settled staking CREDIT with orbio_claim_staking"),d(`${p}:held`,h,S,"Held ORBIO in this wallet"),d(`${w.address}:held`,w,T,"Held unactivated CREDIT in this wallet");let y=new Set;for(let t=0n;t<=a;t+=$){let r=t+$-1n<a?t+$-1n:a,c=await n.getLogs({address:f,event:D,args:{owner:i},fromBlock:t,toBlock:r,strict:!0});for(let k of c)y.add(A(k.args.agentId))}for(let t of y){let[r,c]=await Promise.all([n.readContract({address:f,abi:g,functionName:"stakeOf",args:[t],blockNumber:a}),n.readContract({address:f,abi:g,functionName:"unlocksAt",args:[t],blockNumber:a})]);d(`${f}:agent:${t}`,h,r,`ORBIO principal staked for owned agent ${t}; principal unlock time ${A(c)} (Unix seconds); withdraw with orbio_agent_withdraw_principal`)}return R}catch(i){throw new m(o.plainError(i))}}export{F as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as T,f as j}from"./G4IX4CYN.js";import{t as V,y as q}from"./5677LZOV.js";import{e as O,h as F,i as N,j as S,m as D,o as M,p as U}from"./UMY6SP7C.js";import{a as v,b as h,i as R,j as H,k as _}from"./CJMVRV34.js";import{a as n}from"./XSD5NL7J.js";import{randomUUID as Q}from"node:crypto";import{getAddress as k,parseAbiItem as E}from"viem";var Y=E("event FamilyLaunched(bytes32 indexed familyId,address indexed owner,address indexed subject,address root)"),Z=E("event FamilyTransferred(bytes32 indexed familyId,address indexed owner)"),z=100000n,ee=64,K=512,$=300*1e3;function le(P){let l=new Map,b=[k(h.launcherLegacy),k(h.launcherV1)],L=v.launcherDeployments,W=b.reduce((r,d)=>BigInt(L[d].blockNumber)<r?BigInt(L[d].blockNumber):r,BigInt(v.blockNumber));return{name:"hookr_lp_positions",inputSchema:{type:"object",additionalProperties:!1,properties:{cursor:{type:"string",minLength:1,maxLength:64,description:"Opaque, wallet-bound cursor from the preceding page; expires after five minutes. Restart without it if expired."},limit:{type:"integer",minimum:1,maximum:20,description:"Position summaries per page; defaults to 10. A page scans at most 100000 blocks and 32 family checks."}}},execute:async(r,d)=>{if(O(r,["cursor","limit"]),P.network==="testnet")throw new n("Hookr LP reads are configured only on mainnet, chain 4663.");let f=r.limit??10;if(typeof f!="number"||!Number.isInteger(f)||f<1||f>20)throw new n("Provide a Hookr position page limit from 1 to 20.");for(let[t,s]of l)s.expires<=Date.now()&&l.delete(t);let p=P.clientFor(4663),e;if(r.cursor!==void 0){if(typeof r.cursor!="string"||!l.has(r.cursor))throw new n("Hookr position cursor is unknown or expired. Restart without cursor; completeness has not been established.");let t=l.get(r.cursor);if(t.wallet!==d)throw new n("Hookr position cursor belongs to a different wallet. Restart without cursor.");if((await H(p,t.block.number)).hash!==t.block.hash)throw new n("Hookr position snapshot changed. Restart without cursor.");e={...t,candidates:[...t.candidates],seen:new Set(t.seen)}}else{let t=await H(p);e={wallet:d,block:t,nextBlock:t.number,firstBlock:W,candidates:[],member:0,seen:new Set,expires:Date.now()+$}}await R(p,e.block.number,[...b,h.rootV1]);let y=[],w=[],A=[],g=!1;if(e.candidates.length===0&&e.nextBlock>=e.firstBlock){let t=e.nextBlock,s=t-z+1n>e.firstBlock?t-z+1n:e.firstBlock;try{let i=(await Promise.all(b.flatMap(o=>[Y,Z].map(c=>p.getLogs({address:o,event:c,args:{owner:d},fromBlock:s,toBlock:t,strict:!0}))))).flat();if(i.length>K*2)throw new n("Hookr event page exceeds the bounded discovery limit. A dedicated position index is required.");let m=new Map;for(let o of i){let c=k(o.address),u=F(o.args.familyId);if(o.removed||!o.blockNumber||o.blockNumber<s||o.blockNumber>t||!b.includes(c)||o.args.owner!==d)throw new n("Hookr event page is incomplete or inconsistent with the requested wallet and block range.");let a=`${c}:${u}`;e.seen.has(a)||m.set(a,{launcher:c,familyId:u})}if(e.seen.size+m.size>K)throw new n("Hookr wallet history exceeds the bounded discovery limit. Completeness requires a dedicated position index.");e.candidates=[...m.values()];for(let o of m.keys())e.seen.add(o);e.nextBlock=s-1n}catch(i){g=!0,y.push(i instanceof n?i.message:"Hookr event history is unavailable for this block range. Retry this cursor; an empty page does not establish no positions.")}}let X=0;for(;!g&&e.candidates.length&&w.length<f&&X++<32;){let t=e.candidates[0],s=(i,m)=>U(p,t.launcher,M(t.launcher===k(h.launcherV1)?"launcherV1":"launcher"),i,m,e.block.number);try{let[i,m]=await Promise.all([s("familyOwner",[t.familyId]),s("memberCount",[t.familyId])]),o=N(i);if(BigInt(o)===0n)throw new n("Hookr family owner is unavailable for an indexed family.");if(o!==d){let u=t.launcher===k(h.launcherV1);A.push({launcher:t.launcher,familyId:t.familyId,owner:o,note:`This wallet launched or received this family but does not own it now, so it is not listed as a position.${u?` If it was moved into a Pay Later vault, read it with hookr_pay_later_vault {"familyId": "${t.familyId}"} (run_read_tool).`:""}`}),e.candidates.shift(),e.member=0;continue}let c=Number(S(m,8));if(c<1||c>8)throw new n("Hookr family member count is invalid.");for(;e.member<c&&w.length<f;){let u=e.member,a=D(await s("position",[t.familyId,u])),I=j(a.key);if(typeof a.tickLower!="number"||typeof a.tickUpper!="number")throw new n("Hookr family range is incomplete.");q(a.tickLower,a.tickUpper,I.tickSpacing);let G=S(a.liquidity,128),C=V(I);if(await s("poolFamily",[C])!==t.familyId)throw new n("Hookr position does not belong to this family.");let J=T({kind:"family",...t,member:String(u)});w.push({position:J,poolId:C,owner:d,liquidity:G.toString(),range:{tickLower:a.tickLower,tickUpper:a.tickUpper},poolKey:I}),e.member++}e.member===c&&(e.candidates.shift(),e.member=0)}catch(i){g=!0,y.push(i instanceof n?i.message:"Hookr family state is unavailable. Retry this cursor; no zero position is inferred.")}}await _(p,e.block);let x=!g&&e.nextBlock<e.firstBlock&&e.candidates.length===0;x||y.push("Discovery is incomplete. Continue nextCursor, including after an empty page. Current ownership is checked at the fixed snapshot; history gaps are not evidence of no positions.");let B=null;if(!x){for(;l.size>=ee;)l.delete(l.keys().next().value);B=Q(),e.expires=Date.now()+$,l.set(B,e)}return typeof r.cursor=="string"&&l.delete(r.cursor),{chainId:4663,blockNumber:e.block.number.toString(),blockHash:e.block.hash,positions:w,notOwned:A,nextCursor:B,complete:x,warnings:y,coverage:{custody:"reviewed Launcher families only",historyStartBlock:e.firstBlock.toString(),scannedFromBlock:e.nextBlock<e.block.number?(e.nextBlock+1n).toString():null,scannedThroughBlock:e.nextBlock<e.block.number?e.block.number.toString():null,snapshotBlock:e.block.number.toString()}}}}}export{le as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as B}from"./XSD5NL7J.js";import{getAddress as S,parseAbi as u}from"viem";var b={chainId:4663,usdg:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",v4:{poolManager:"0x8366a39CC670B4001A1121B8F6A443A643e40951",swapper:"0x7Cd4E04E433E69e588728c86A3832753B5F846d4",quoter:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b"},v3:{router:"0xCaf681a66D020601342297493863E78C959E5cb2",quoter:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA"},tokens:[{symbol:"AAPL",token:"0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",pools:[{v:3,fee:500,pool:"0xAae0d815EE56e4092a5E5C2911E676Fea50B2d6D"},{v:4,fee:3e3,tickSpacing:60,id:"0xc748f4671a867db48b552f6b7650bf3255e05f80f00e3f7aad1b17ccb7898fdb"},{v:3,fee:3e3,pool:"0x783C9bbB765047CFdD2b84b92b2Ca9F11D34b7Ed"}]},{symbol:"AMD",token:"0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",pools:[{v:3,fee:3e3,pool:"0x48D284A2A4d3DC1b3Da08231Fe44317e7e7Aa51f"}]},{symbol:"AMZN",token:"0x12f190a9F9d7D37a250758b26824B97CE941bF54",pools:[{v:3,fee:3e3,pool:"0x8AC92DA74AB5F3b1d024Dc1943Ad7e15Dc4179Ef"},{v:4,fee:2400,tickSpacing:24,id:"0xefc94885c96b02696b9b45de43eeeb8ac53c0199cab42b4daae4911b96fb8825"}]},{symbol:"ASML",token:"0x47F93d52cBeC7C6D2CfC080e154002370a60dAEA",pools:[{v:3,fee:1e4,pool:"0xedb22516B14Eb2d1C86927Db373B0E8bF70F5cD1"}]},{symbol:"BABA",token:"0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x1791fc651cc794a282e5dbcb56d0b2b38eff8754b677c8876e86901521ecc439"},{v:3,fee:3e3,pool:"0xa57ab582b310dd6f9e934EA1EEEa152741545E6A"}]},{symbol:"COIN",token:"0x6330D8C3178a418788dF01a47479c0ce7CCF450b",pools:[{v:4,fee:2500,tickSpacing:25,id:"0xe2e1a0e32205e854525e0fb1d3667a53bd3b4919f032b9bcd2a038b6b6dac314"},{v:4,fee:1e4,tickSpacing:200,id:"0x007a13fa152f6dc383cad20a8eaab4e1e2538b606936eae2a424f8aa47d6db31"}]},{symbol:"CRCL",token:"0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",pools:[{v:3,fee:3e3,pool:"0x654E4143e82a5824445Ade0824351C2A9ACD95a8"},{v:4,fee:3e3,tickSpacing:30,id:"0x628c98ab436ee34a6a7decd606242890582591bdf7c9a35d90e0d08021c31ea0"},{v:4,fee:1500,tickSpacing:15,id:"0x5177eac8c2176468bbf15e44081e151d35c2e7d068e96d3db94f496a4dc944b2"}]},{symbol:"CRWV",token:"0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x237014478f7ef98afbe7412ac35b6a3f96b8fb111de48b7c4dbf49dba4bd9c4b"}]},{symbol:"DELL",token:"0x941AE714EC6D8130c7B75d67160Ca08f1e7d11Dd",pools:[{v:3,fee:1e4,pool:"0xc30c89cB7815A1488b7998D15eEC73961707Fc5a"}]},{symbol:"GME",token:"0x1b0E319c6A659F002271B69dB8A7df2F911c153E",pools:[{v:3,fee:500,pool:"0xE2b46c905E12Ab8E2f864e4821a4325884C1B126"}]},{symbol:"GOOGL",token:"0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",pools:[{v:3,fee:500,pool:"0x34D0dC122CF9A8Eb296fC5e0D3A233625D7d19b7"},{v:4,fee:300,tickSpacing:3,id:"0x43fe16b75cabbf38f5b185d16142b02d1d9200d8f1ba17cb6cf899f562c6197f"},{v:4,fee:3e3,tickSpacing:60,id:"0xd4ecb79fdc521d7725d22b33ed43cb4e47aa96bfad76aa29577e3151f723ac5e"}]},{symbol:"INTC",token:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",pools:[{v:3,fee:3e3,pool:"0x2e5a92f5013a64661A49312111be2e8aBd33F56a"}]},{symbol:"META",token:"0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",pools:[{v:4,fee:310,tickSpacing:3,id:"0xc58bb68060bcb7b3ea0f6d4a4afef1e57f628722e808db12afb6d1733552872f"},{v:3,fee:3e3,pool:"0x107a7Cb40d8665360ba10E59471Af06150A50922"},{v:4,fee:3e3,tickSpacing:60,id:"0x5875d407a42965b0e768c8925cea290e06fa50603ef34fc99eb92a1050e6ae36"}]},{symbol:"MSFT",token:"0xe93237C50D904957Cf27E7B1133b510C669c2e74",pools:[{v:3,fee:3e3,pool:"0xeb60bCD1D920ad6E102690CCFC6fB488899E1510"},{v:4,fee:3e3,tickSpacing:60,id:"0x9194a557b6a6bb2236b49ea7e2bbccec5d3eeb705aef00903be4b3de1d949579"}]},{symbol:"MSTR",token:"0xec262a75e413fAfD0dF80480274532C79D42da09",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x319bac87e616a89e241c10aeb8afd4892a852cdd8b373cd9765ecddc40b87cfe"},{v:4,fee:2400,tickSpacing:24,id:"0xc105b8300ff65d750a0e4e63c7a879e20504069b770713464a5315e797735326"}]},{symbol:"MU",token:"0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD",pools:[{v:3,fee:3e3,pool:"0xd057B1Bc54917855BBee58eAd58647f47caB35E5"}]},{symbol:"NBIS",token:"0x9D9c6684F596F66a64C030B93A886D51Fd4D7931",pools:[{v:4,fee:9900,tickSpacing:99,id:"0x7c2f9ce1214ba9baf56d1b6a1fc640c1b63e9a711172c0c7d10e5a9c4a3d4f0c"}]},{symbol:"NVDA",token:"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",pools:[{v:3,fee:500,pool:"0xd4EB21209C4D6093f80B5b84f5C45cc093EA14a3"},{v:4,fee:100,tickSpacing:1,id:"0x6444a8e0b267406a15db74ca00c4a24bdfa81ed3180f5b6d0851f8ed6f4f29c5"},{v:4,fee:3e3,tickSpacing:60,id:"0x3bb34a44f1b2b5f32c034c38a53065a521a47b199700fa9bd19d60985ff24bf1"}]},{symbol:"ORCL",token:"0xb0992820E760d836549ba69BC7598b4af75dEE03",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0xc2ce4784e1e72cf0221b51b30c8aaadf6c0b12863cf03ab3687854fb7b1d850a"}]},{symbol:"PLTR",token:"0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",pools:[{v:4,fee:1500,tickSpacing:15,id:"0xc59eaeda6d1a6f031bc7e1d039772f2d675e7b4de2c8668610f4471bd60b3802"},{v:3,fee:3e3,pool:"0x851680416A4f4E1c463d45171d61ACDdBc8554c0"}]},{symbol:"QQQ",token:"0xD5f3879160bc7c32ebb4dC785F8a4F505888de68",pools:[{v:3,fee:500,pool:"0xD60A5d14dB690B7Afad71F76B108071D7175597d"}]},{symbol:"SGOV",token:"0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5",pools:[{v:3,fee:500,pool:"0x6Ba50150B17Ffd0972915Aaf04fFd5E8f4Fa49b4"},{v:3,fee:3e3,pool:"0xfAb520051f96F4D2a32c22B6a3dD7fFfdf231bFe"}]},{symbol:"SLV",token:"0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f",pools:[{v:3,fee:3e3,pool:"0x8cB787e6c315D464775289BaD00FDD67d53Ecb3D"},{v:3,fee:1e4,pool:"0x0Fa7BC480885DCf58Ad2ef63eC7289cF2481D51c"}]},{symbol:"SNDK",token:"0xB90A19fF0Af67f7779afF50A882A9CfF42446400",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0x2707cb88a6a40fa0f948f58958051ba097d6f6a3cf7f87929bd68ccc5becea24"}]},{symbol:"SPCX",token:"0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",pools:[{v:3,fee:500,pool:"0xc61284332117c3FB23A2A56cceFFD07F7aF60029"},{v:3,fee:3e3,pool:"0xEb07d9587eFD1778dFb9c385Ec43EF6d5F9fE401"}]},{symbol:"SPY",token:"0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",pools:[{v:4,fee:100,tickSpacing:1,id:"0xe1ae6a4c6ccc9f037389a8d50a4f577bde1a9fe01d85d88ecbbd39955ce53288"},{v:3,fee:500,pool:"0xa7Bb1AC63BBaB0C44316E6c8C455213441689167"},{v:4,fee:500,tickSpacing:5,id:"0xe5923c8a8be481ec89a2ca784a2bbfa4235de6d88f92260fd66b660c4babf907"}]},{symbol:"TSLA",token:"0x322F0929c4625eD5bAd873c95208D54E1c003b2d",pools:[{v:3,fee:3e3,pool:"0xf4ACdAEEB7022862A763C9B1B885e11191c889E3"},{v:4,fee:3e3,tickSpacing:60,id:"0x8517f8071ae5b831b738052f12125e8e3d6c158b78728aa44ce3b25e5104d32e"}]},{symbol:"TSM",token:"0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",pools:[{v:4,fee:7500,tickSpacing:75,id:"0x0ba5d53d2f6255f334b7c8ead4f56b6aef5af3402c5e4d11180afd38c6b85fb1"},{v:3,fee:1e4,pool:"0x07e8Ea83D4C1340774c8965125e26e12bf943bf1"}]},{symbol:"USAR",token:"0xd917B029C761D264c6A312BBbcDA868658eF86a6",pools:[{v:3,fee:3e3,pool:"0x04391780F519B7d3ba59c9590459D76e23d225C4"}]},{symbol:"USO",token:"0xa30FA36Db767ad9eD3f7a60fC79526fB4d56D344",pools:[{v:4,fee:1200,tickSpacing:15,id:"0x1f2ad5a274a776d8e1408292bde1d92d8fa7b6444acf14ad60b9c3e4e5b66420"},{v:3,fee:3e3,pool:"0x02175608F1b5E6b5ed221cCFdC7Be197D111D915"}]}],priceReferences:[{symbol:"AMC",token:"0x05a3d1Cd21d0C88145E82600E62e7E496e0F222B",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x7499938c352d5b5b8f0c648722aca5ee964ef9b85c3a3041f1ec379726291d9d"},{v:3,fee:3e3,pool:"0xaA34feA710a1A737840329051D81D3B0B7C564d5"},{v:4,fee:500,tickSpacing:5,id:"0x06b9732431bd134599dd112a93c708fe80cadd2fb7dc750fe632e1cbf49fd8c0"}]},{symbol:"AVGO",token:"0x156E175DD063a8cE274C50654eF40e0032b3fbcF",pools:[{v:3,fee:3e3,pool:"0x5B7C404f1d7d77F9f3885aB13d7764F8a173028c"}]},{symbol:"AXON",token:"0xC27dBD474aF5181c5A8777903690D8D262D12648",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x76e3dd1779473383d64c232fd03862f3d8c31136141ab1aae52bcdf2ce897b6e"}]},{symbol:"BA",token:"0x4D21483a44Bf67a86b77E3dA301411880797D452",pools:[{v:3,fee:3e3,pool:"0xc6517047b189c72D3bAa9eF37D1d28F27a63638a"}]},{symbol:"BB",token:"0x48E39E56aCdbA37b09020C0b734A613C9a2f100A",pools:[{v:3,fee:1e4,pool:"0xc424e56e816F148a8B30ccbde2128e04d21f51e9"}]},{symbol:"BE",token:"0x822CC93fFD030293E9842c30BBD678F530701867",pools:[{v:3,fee:3e3,pool:"0x1baD145C8F06444E0dF81c28257cd20231Bd1f16"}]},{symbol:"CEG",token:"0xaE517A2903E68bd929Dfd15be875F8369D53e94a",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x21e190d0a42ad1b36f957bf2490eef78825d13a579d3a326bf10aadc1d634f4f"},{v:3,fee:1e4,pool:"0xc9529b7dc74BF15da6Cee01a282908E8C7aB6BA3"}]},{symbol:"COST",token:"0x4EA005168D7F09a7A0Ba9D1DEf21a479950E44C2",pools:[{v:3,fee:3e3,pool:"0x0a2121A50A09eD0796ae81F9c53fF9398355a398"}]},{symbol:"CRWD",token:"0xea72Ecca2d0f6bFA1394DBBCff85b52CD4233931",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0xb11086b1ff40749a1e619c0f87299e5c67ac84a8feceee0c039d574e5cd4c520"}]},{symbol:"DIS",token:"0x501B1B3B79750313AD2C4CcCD08586c4C17d7283",pools:[{v:3,fee:3e3,pool:"0x75F7109Eb00Eab50426f19b00Fb05783bD1a0501"}]},{symbol:"DJT",token:"0x1D11f0496982706C5e14A514D4E79F2e6BdE4516",pools:[{v:3,fee:1e4,pool:"0x31a89afd92F9397465649AD03226c52292fc1ae5"}]},{symbol:"F",token:"0x25C288E6D899b9BC30160965aD9644c67e73bE0C",pools:[{v:3,fee:3e3,pool:"0x4dbAC19E895322ac5b93abad9008691632bFFC05"}]},{symbol:"FIG",token:"0x41F4267525a8AFf329540eF24fD83d9044758B33",pools:[{v:3,fee:3e3,pool:"0xca5904C0a9d42F0Ec1Bf760FDf779907877144fD"}]},{symbol:"GLD",token:"0xC9a981FEE1F9DEc688bb123ccDeCc63D0deBFC4e",pools:[{v:3,fee:3e3,pool:"0x7A6A053eCCf1446A2633E05aA6D40D09381997ec"},{v:3,fee:500,pool:"0xBA2f1ed4cEB2169D538d1e614D847E83C5A55913"},{v:3,fee:1e4,pool:"0x32cb909aCF78354E08aa45639Ff5CD33767E730a"}]},{symbol:"GLXY",token:"0x2D427692E928fa156ec22acfaBaFA0447C5805B7",pools:[{v:3,fee:3e3,pool:"0xC67C2D200E0b7E5D99F4CFBede8CB09B48892f2c"}]},{symbol:"HIMS",token:"0xCceE82fE024c36fA15E1005edE3E9e4787e23D09",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0x68d4f28f1432e0ad714658853edb2e6b0b1ac4060355ff3d169fea656b1d1c52"},{v:3,fee:3e3,pool:"0xC8C90d3a1c1a24967E773ac2aD0d456BA3E31F64"}]},{symbol:"IBM",token:"0x980dcf6766FA79f5Cf0c4AAdb3ab477ff15a9619",pools:[{v:3,fee:3e3,pool:"0x8cD848ce18b829C5c769AFf27164078bB52e0E97"},{v:3,fee:1e4,pool:"0xA0A79bC62fC822f3bcDF0EBbc586031781c53a5B"},{v:4,fee:1500,tickSpacing:15,id:"0xfefcd3697193dacac74626b2c8ca15937479605b4ee074670186f746b448028a"},{v:4,fee:9e3,tickSpacing:90,id:"0xd43a51c85ca0b12309a46a8b6c68dd76837fbd3dba5d413cd4686b85a52f9081"}]},{symbol:"INDA",token:"0xACEF2e09adb47aD6aBeBAD9fF06689E60615C2B6",pools:[{v:4,fee:2e3,tickSpacing:20,id:"0x7d0895d8162b0be326ef944faeb5a84f4a08377b9bc9f010e38fa4d268a94469"},{v:3,fee:3e3,pool:"0x2171c94d8073C4913f4653a0766D18aA8A29D1f6"}]},{symbol:"JBL",token:"0xEAf2512dFC1bEAc608F8794B3793CD4E02894Aa6",pools:[{v:4,fee:2500,tickSpacing:25,id:"0xe0c9d8c4ca2e0f2435bb7d07ed6c9a4273397dd097e72fa4d9ba4ee476abfd3f"}]},{symbol:"JNJ",token:"0x03DfbBE0AC4E7bCDaFd08eD41A400326B77D8c80",pools:[{v:3,fee:3e3,pool:"0x7F0aCE18D1dCEd47063CF26e649bc8AB14D09e67"},{v:3,fee:1e4,pool:"0x8d39388EF11Bb78843130Bd74AB0e5d89fA76b30"}]},{symbol:"JPM",token:"0x07c44dA0848960bFf894F17584dB8B2F60B2409E",pools:[{v:3,fee:3e3,pool:"0x3ebDBc2a316F87BaeD3A9d1229E03b0a49A27eC3"}]},{symbol:"KTOS",token:"0x7FD06a4d81cCfA3F351394E144d5191874C31313",pools:[{v:4,fee:2500,tickSpacing:25,id:"0x2204b8dffc2cf19091c5fb124ca745459e41ba5bf6db69f3723c7f5908688819"}]},{symbol:"LLY",token:"0x8005d266423c7ea827372c9c864491e5786600ea",pools:[{v:3,fee:500,pool:"0xF212D02146a897F5F686E9d629F6A73da534324a"},{v:3,fee:3e3,pool:"0xD2038788ebe1e0BFd7C0A6112f09778F3aeAecA6"},{v:3,fee:1e4,pool:"0xF4274130137eeE20bAD928B593d992716516CEB9"}]},{symbol:"LMT",token:"0x329fcACEb9AD6F9580DD5F643fed0646900D043c",pools:[{v:3,fee:3e3,pool:"0x54f160Bea60EC5207918C539d86E0b906b4DA297"},{v:4,fee:5e3,tickSpacing:50,id:"0x0b118d2480ebdb11374d3ad2ea1b935e9458a9f704222004b3b8de07bc98f1eb"}]},{symbol:"LULU",token:"0x4e62068525Ab11FE768e29dfD00ef909B9803016",pools:[{v:3,fee:3e3,pool:"0x0F4227D27082B3BCA6818381b9ea6460275e49f4"}]},{symbol:"MCD",token:"0x2fdaa4604F10F4AE7f66fa48A174bCd25b1ece20",pools:[{v:3,fee:3e3,pool:"0x2e97F9Ec9C6BAC972aB5BC1b8a1A7973B701dd97"}]},{symbol:"MRNA",token:"0x43B07D15cE533bEc5476d70C22a78a1B2B662155",pools:[{v:3,fee:3e3,pool:"0xB40196272A6d2EB5edF6d93bc4DC39856AD95E0E"},{v:3,fee:1e4,pool:"0xA34d0667334074DF2d5BfD259e79E6B9cf1fA8Bf"}]},{symbol:"MRVL",token:"0x62fd0668e10D8B72339BE2DCF7643001688ff13B",pools:[{v:3,fee:3e3,pool:"0xb5E892F0fC6dAAdDA5b927266FE7907e623e4843"}]},{symbol:"NET",token:"0x116F00968269B7bfbaD4109cE591d6E74c0601d4",pools:[{v:3,fee:3e3,pool:"0xA9Caebb1b2fB2b954F192572b309aEf1cAf6a330"}]},{symbol:"NFLX",token:"0xE0444EF8BF4eD74f74FD73686e2ddF4C1c5591E8",pools:[{v:3,fee:3e3,pool:"0x59895C0302F41aEaa129D2fa2442CEc01E7eF45E"},{v:4,fee:1e4,tickSpacing:100,id:"0xe4930a6215f21aa3b37c01adbded3362f56ae31b9a60066f5f9641e601d5111f"}]},{symbol:"NU",token:"0x408c14038a04f7bD235329E26d2bf569ee20e250",pools:[{v:3,fee:1e4,pool:"0xb6d047637151f6De1d02028acdd187Aa9cb7AFE3"},{v:3,fee:3e3,pool:"0x0E3FaEd512E7909758EB924E6919e0057Bd6b45E"}]},{symbol:"ON",token:"0xbBD09F72b025360FeE5C928053Dca6248d35be54",pools:[{v:3,fee:1e4,pool:"0xfcE637eeAd7D62d9ED27F81D9767de03e9E534Cf"}]},{symbol:"P",token:"0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D",pools:[{v:4,fee:1e4,tickSpacing:100,id:"0x2300c9273ea3f89e86787cfb01d522ca36be342d40ed754c15feca69f3afbe6a"}]},{symbol:"PANW",token:"0xB039597eD45CBa7B6E2fb9E8BE51802969CEe5Be",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0xb544fd24f37f3d7a6ee3c20e4b4f7797807d92603ccae703149e374337d5013a"}]},{symbol:"PFE",token:"0x7066A64c24e4206CD62E83bf198c1E7EB361F51e",pools:[{v:3,fee:3e3,pool:"0xC7d573Fcda6D2107C97fb582ae18411F9Db32E7f"},{v:4,fee:1500,tickSpacing:15,id:"0x632d9bdccf26e13dbf23b185f29cba47e237371010e1abf7aceaeff653f66be4"},{v:3,fee:1e4,pool:"0xA26dF7296ef5DFc727f3bc6F1E9050E6B62e6abF"}]},{symbol:"POET",token:"0xcf6B2D875361be807EAfa57458c80f28521F9333",pools:[{v:3,fee:1e4,pool:"0xa1C781ed62AC2d0283f50fF5A843647a56ddd80a"}]},{symbol:"PYPL",token:"0xa45aBDc77918F7B9199b022eEe400C0BC5712BD2",pools:[{v:3,fee:3e3,pool:"0x4F59397a5F742dcF91C69763de550f406af7EbfF"}]},{symbol:"QUBT",token:"0x59818904ab4cE163b3cE4FfB64f2D6Ca02c434B4",pools:[{v:3,fee:1e4,pool:"0x2E2a857C08aD6C09f1d1EC4FDB4Cc7cd06cF17f4"},{v:3,fee:3e3,pool:"0x227Bbce9A81B3694b01754298a983Be3F9E44A93"}]},{symbol:"RBLX",token:"0xF0C4BF4C582cb3836e98394b1d4e7B7281101bE8",pools:[{v:3,fee:3e3,pool:"0x1BDB8e3A79Cb1a7F228808739311E23098D33d43"},{v:3,fee:1e4,pool:"0x2ef5945cd5664876b6481FdacFaA2942995a4DA8"},{v:4,fee:1e3,tickSpacing:10,id:"0xf807376333cd408c36d48a11a96309b92c5bd2bca9ba9f0b21800636cb3a30da"}]},{symbol:"RCAT",token:"0xFDE6b5d9BB419B10C23268c74e369AbFF39C0460",pools:[{v:3,fee:1e4,pool:"0x64710a70839585Af718e1B1FAEf9E7f1665F1116"}]},{symbol:"RDDT",token:"0x05b37Fb53A299a1b874A619e1c4C404D52C36F4C",pools:[{v:3,fee:1e4,pool:"0xa8744E76aED23B05F0126335E7BD38f7935D19fe"},{v:4,fee:1e4,tickSpacing:200,id:"0xec481672a94cfe42e2d8c996b7eaeee8a93093d56bd01c1714341971e3f406c1"}]},{symbol:"RIVN",token:"0xB1BF26c1D20ff267A4f93550d1E0d06ac40a114B",pools:[{v:3,fee:3e3,pool:"0xF9e71558eEf115b6C8fbFc9ad5fda00033E9d69C"},{v:3,fee:1e4,pool:"0xb30A75B200D98A600a3766869344928E35823E23"}]},{symbol:"RKLB",token:"0x3b14C39E89D60D627b42a1A4CA45b5bb45Fc12e2",pools:[{v:4,fee:9e3,tickSpacing:90,id:"0xbbc15d66fef8391f53569e19016e86545be9de3f302b82db93ed6165236d22f3"}]},{symbol:"SHOP",token:"0xF53F66751B1Eff985311b693531E3290F600c410",pools:[{v:3,fee:1e4,pool:"0x18A1aFa849A6940870c2163B7ECBCC85d455Ad99"},{v:4,fee:1e4,tickSpacing:100,id:"0x8baff387b51c50e2747e85bcddf87da78fee6efb45629743e1af4dfb07ad13ee"}]},{symbol:"SKHY",token:"0x84CAb63bc87912E71ad199ff14A0bA45de68FeF8",pools:[{v:3,fee:3e3,pool:"0x5F2a5025feb93a4C44DA4E3B37e4fD3Fb0ab5171"}]},{symbol:"SNAP",token:"0xF6589F11Bc40b669e584073F428B05562F568733",pools:[{v:3,fee:3e3,pool:"0x0EbD4650C9e641E9745b5A508A2D46935DFE753E"}]},{symbol:"SNOW",token:"0xBa0CAB75495255d0cB58E22B648bFED4ECD1F47E",pools:[{v:4,fee:1e4,tickSpacing:200,id:"0xac720e95589b7124f0affbdb9e66c7ec6e824c68eae00dc54f9e11b0b294bac8"}]},{symbol:"TE",token:"0xb1969f6604CA1AE7a2cD3F1827876e914594CA2D",pools:[{v:4,fee:1e3,tickSpacing:10,id:"0x87d302c27b610c19114a51f848ba27acd197933493458bea30c558df5cae6cd8"}]},{symbol:"TTWO",token:"0x5e81213613b6B86EaB4c6c50d718d34359459786",pools:[{v:3,fee:3e3,pool:"0xD9Ab4b7fAe6DC2f7020134Ec744A8F53Ef3E5E24"},{v:4,fee:1e4,tickSpacing:200,id:"0x131e6ebeeedb524a1e7590aa3eea3bc8782b5425a78d5128c0ca955190d0ea69"}]},{symbol:"UBER",token:"0xbd335Aa5A1693F0121A5c0Ef18A080E9958DA78b",pools:[{v:3,fee:3e3,pool:"0x0DF328152A3708F99f6cf13fb3c820BbBF9115C1"}]},{symbol:"UPS",token:"0xf23250dac154D05Bb671CB0d0eBEf3c635c79CE2",pools:[{v:3,fee:1e4,pool:"0x3Ab74C45DceCC6A62898204Dd42143a816B44CB1"},{v:3,fee:3e3,pool:"0x5c67a84Ec5494ffE24E217B28dEbb96341014c86"}]},{symbol:"V",token:"0x9BFF87700337babF5099e99F322F888DafB1d551",pools:[{v:3,fee:3e3,pool:"0xfE67885765C29C25A589d99003C19C082664c26f"}]},{symbol:"VTI",token:"0x0594134DF3f171a354D9C85eBD65b7A6148F6D09",pools:[{v:3,fee:1e4,pool:"0xb78DD1A97fa544c65d7D1f12453EcaAF1e05c36d"}]}],unpriced:{AAOI:{token:"0x521Cf887E6531c6F667b5BC4D896E5d9bfE8EB2E",reason:"thin"},ABCL:{token:"0x3139D77Ace0cbAA5bDfD38bD1F1911a794AF0B0e",reason:"no-pool"},ADBE:{token:"0x232B8ed6377BE97813853B0Ac104c4Cda8378d1B",reason:"thin"},AEHR:{token:"0x5F604fBA1162193A4388A5DFa56F556f3E133cC2",reason:"no-pool"},AEIS:{token:"0xfAf9cb261B5FCC1f404Bb10CD39C5c6C1974E612",reason:"no-pool"},ALAB:{token:"0x748c32c3ca24eDf31ea597Db1F3d330a7a6DA3Dc",reason:"no-pool"},AMAT:{token:"0x36046893810a7E7fCE501229d57dc3FC8c8716d0",reason:"thin"},AMBA:{token:"0x99D9D8663545151603863C5AcbD6FC3218899009",reason:"no-pool"},AMKR:{token:"0xDd356AA38F40A7b7076755aC854B6FBb1F0D305B",reason:"thin"},ANET:{token:"0x28bABD556b60E53663B8615036479a29c2CDd1Bf",reason:"thin"},APLD:{token:"0xb8DBf92F9741c9ac1c32115E78581f23509916FD",reason:"thin"},APP:{token:"0xA249BAF1063Af884807C1E1400AEf7784836917E",reason:"no-pool"},ASTS:{token:"0x1AF6446f07eb1d97c546AFC8c9544cBDF3AD5137",reason:"no-pool"},AUR:{token:"0x373C06c4f7BDe527D7Dae4BA169E42b55E393CeD",reason:"no-pool"},AVAV:{token:"0xF6290b5e7C26502e2dA514C31509849718EA76A5",reason:"no-pool"},AXTI:{token:"0x141eEa040c2250eEc0314e336975e81f85f6585e",reason:"no-pool"},BMNR:{token:"0x9a7842EDed60b0FE1e03eEc342C82A397c821eD0",reason:"no-pool"},BND:{token:"0x2F62fC9fAbb470C690f141c28340eD832bB27020",reason:"no-pool"},BULL:{token:"0xceF9027c7d6985b85f0BA431125073529A947A68",reason:"no-pool"},CBRS:{token:"0x5c90450Bbb4273D7b2f17CF6917AEB237A569679",reason:"thin"},CCL:{token:"0x9651342CeA770aE9a2969Ba2A52611523146aef9",reason:"thin"},CELH:{token:"0x8cF07C5A878945185d327aAa6e33FAa95F95e7bF",reason:"no-pool"},CIEN:{token:"0x44f6D488021f8233B9416294d1FE9b1fEe28382d",reason:"no-pool"},CLOV:{token:"0x62200915e7DEab1eC7f79fb246daDbB80eACdDd0",reason:"thin"},CLS:{token:"0xBf449977089c718C004a66C554B26B94ef3Ad4De",reason:"thin"},CLSK:{token:"0xcBB95BBF36099d34dA091dc6Fa6F49EfA257Cee3",reason:"no-pool"},COHR:{token:"0x92F9F459F1a9a5AD266b182BE7Bffd1C6c666894",reason:"no-pool"},CRDO:{token:"0x4D67253bc223e6b0e104F1084c1fb2b669dDC41b",reason:"no-pool"},CRM:{token:"0xd95B44124e475743a7589e68F3D74008A5536D44",reason:"thin"},CSCO:{token:"0xF543967EEBB6f1917992eF0E68De63ab07a5a0dA",reason:"no-pool"},CTSH:{token:"0x63D5a3b6939a33f1e75d8Bcd85759858239600DB",reason:"no-pool"},CVNA:{token:"0xa4f319104089FE321dc8093C6E707d4fE190A988",reason:"no-pool"},DDOG:{token:"0x27c99fBde9D0d2AA4f4Bfb4943f237843DdF6958",reason:"thin"},DOCN:{token:"0xc02f12B9fe9E707079EC0d546f3050d3F6C1F8bD",reason:"no-pool"},ELF:{token:"0x39EC44Bee4F6A116c6F9B8De566848a985C53C60",reason:"quote-failed"},EWT:{token:"0x1c690498150252222C275A5CEd69d3A6b1f52D5E",reason:"no-pool"},EWY:{token:"0x7f0aBeF0C07280F82c6a08ead09dEd6BAE2C13Fc",reason:"thin"},FICO:{token:"0xa48F22A46C0F1C46CA7D111CB6c137c271987180",reason:"no-pool"},FISV:{token:"0x9ECe29A4A2397C0a35fb5fA8EE2b9509130a98cc",reason:"no-pool"},FIX:{token:"0x93Dbb1d2Dc5D63F4abACFF30485273f538Df68Ac",reason:"thin"},FLNC:{token:"0x282e87451E10fA6679BC7D76C69BE44cD3fC777C",reason:"no-pool"},FLY:{token:"0x03BC731Ffb162cdd7B98D3C6542bFC291126075d",reason:"thin"},FTNT:{token:"0x3FB8976980d486084b2eb4a404BD12e72823958f",reason:"thin"},FUTU:{token:"0xeB30663bDFf0622Ef4e4E5cBb4E975F19f33f51D",reason:"no-pool"},GDX:{token:"0xBDFa7A06458Aa26b8E736E0fC87aD37C3BB8Ac2e",reason:"no-pool"},GE:{token:"0x63b814DDBd6BF339f25Fed8c36158a008D5B373e",reason:"no-pool"},GEV:{token:"0x94B8AAE43A1cCc08Aa64B7D1F29b4D920aF4a0C9",reason:"no-pool"},GLW:{token:"0x7c04E6A3368F2A1DE3874f0e80d2e0A1a9915da6",reason:"no-pool"},HII:{token:"0xEB61c0Ed490A367d4E3631cCf8a74B3bfc7E775D",reason:"no-pool"},HPE:{token:"0x59dd09d4900C2E4B5F75b7c0d4E6796fcc234Cb1",reason:"thin"},HWM:{token:"0xAEa445c5F3DB1a462998ccC422A875A361ee5d99",reason:"thin"},IBRX:{token:"0x7c148F74ac7445D1F28366b7FcDC6792a9Fcd0Cf",reason:"no-pool"},INFQ:{token:"0xB853bC83a753342a4f8320ea680b4B1E84118D21",reason:"no-pool"},INOD:{token:"0xf1953DAB6FaD537488d5A022361FfAa8B4c95eC6",reason:"no-pool"},INTU:{token:"0x56d23beE5f41A7120170b0c603Dae30128e460e9",reason:"no-pool"},IONQ:{token:"0x558378E000D634A36593E338eBacdd6207640EfE",reason:"thin"},IREN:{token:"0xF0AB0c93bE6F41369d302e55db1A96b3c430212D",reason:"thin"},JOBY:{token:"0xb334C5cE741B80B5B671F47F5C269Cb193fe8E24",reason:"no-pool"},KLAC:{token:"0x96b933C74eCB4A0926b9210cef7b743EF46be2E9",reason:"no-pool"},KSS:{token:"0x12e3c047bf9AeCAF9dDC98c05C31BFD1dd043993",reason:"no-pool"},LHX:{token:"0x48d60243c66437c6ac3c2495Be94747aEd5Dfe25",reason:"no-pool"},LITE:{token:"0x8eF20885F94e3D9bc7eB3080279188Bd5ED7c08C",reason:"thin"},LRCX:{token:"0x57b0030166DB0C31690d1A5aA167e2e26e2C29a4",reason:"no-pool"},LUNR:{token:"0xa5D4968421bA94814Be3B136b15cf422101aC1a3",reason:"no-pool"},MDB:{token:"0xDdf2266b79abf0B48898959B0ed6E6adf512be74",reason:"no-pool"},MOD:{token:"0xc6Cbad1016b38B797610c25E1dc7D95988B1f362",reason:"no-pool"},MPWR:{token:"0x52D50D0280AD1054b43f052bD70a49a212A1b128",reason:"thin"},MTSI:{token:"0xC93f4d80e268AB922e871bd169156C3CC41894e6",reason:"no-pool"},MXL:{token:"0x48961813349333209994750ffA89b3c5C22eC969",reason:"no-pool"},NAVN:{token:"0xf7181b63Fdb858558A74ba96BC42732684cd7965",reason:"no-pool"},NNE:{token:"0xBEF75684C43c4ea7BD18Dd532a2244674Ee8b926",reason:"thin"},NOW:{token:"0x0C3260aF4B8f13a69c4c2dFb84fD667890CDFa14",reason:"thin"},NVTS:{token:"0xbE6702d7b70315376dC48a3293f24f0982F86386",reason:"no-pool"},OKLO:{token:"0x8B2f88497f15A18E9D4FFa1a8fFB8538399aE774",reason:"no-pool"},ONTO:{token:"0x8ff63eAeEe3fE54Ba450c4F5538064Ec5A893Aef",reason:"no-pool"},OUST:{token:"0x40E7a279850e443f582059ae5dC1c3b6563E6395",reason:"no-pool"},PATH:{token:"0xfb2664f07B6Aadd29ea7a59D8859b1AeB8645cDa",reason:"thin"},PENG:{token:"0x9b23573b156B52565012F5cE02CDF60AFBaa70Be",reason:"no-pool"},PL:{token:"0xAA4d64474c172010aB57719cb9951E6142a100d3",reason:"no-pool"},POWL:{token:"0x237c16D66590F67B886d978ACD362EAeaD8B18c7",reason:"no-pool"},PR:{token:"0x4189F0c66EBBB0bfeF1C31f763131361EF32f77C",reason:"no-pool"},PWR:{token:"0x9Ab02Ead789b6903c3c44d0ED32F9c707CDF12FD",reason:"thin"},QBTS:{token:"0xC583c60aeF9Dc401Da72cEC1B404743a93cea1Cc",reason:"no-pool"},QCOM:{token:"0x0f17206447090e464C277571124dD2688E48AEA9",reason:"no-pool"},RDW:{token:"0x92Ef19E82bD8fF36661DE838D5eaE7e5CEF0EfFE",reason:"no-pool"},RGTI:{token:"0x284358abc07F9359f19f4b5b4aC91901Be2597Ba",reason:"no-pool"},RUN:{token:"0x756Bc80af765C82da966a788858d65aDF14f3793",reason:"thin"},SATS:{token:"0x95052ddcd5DC25641657424A8Cf04834997E1730",reason:"no-pool"},SCHD:{token:"0xd63ABB2C13d7a8421a8017a712802053568e3C1D",reason:"thin"},SHY:{token:"0xBE274710Bf3d9567e1B290eF6a5F9f90ca016FD8",reason:"no-pool"},SIMO:{token:"0x77E655E37F4d913fB9540e0d541D824171a60e81",reason:"no-pool"},SLS:{token:"0x285b231728c7E4333799183DF1094d775246a535",reason:"no-pool"},SMCI:{token:"0xc01aA1fECeC0605b13bc84874ff7256C0f5F562a",reason:"no-pool"},SMH:{token:"0x072f979c2CAc8e1391B0162a87Fee094bF8744a0",reason:"thin"},SMR:{token:"0x1Eebee7F74517e0279dFb09d25B0407bEEc3FDd6",reason:"no-pool"},SOFI:{token:"0x98E75885157C80992A8D41b696D8c9C6Fb30A926",reason:"thin"},SOUN:{token:"0x6E3Dfd9f7e1649BaA14D25cac18C94d62dB10A54",reason:"no-pool"},SOXX:{token:"0x75742c18BC1f1C5c5f448f4C9D9C6F66dafAAa38",reason:"thin"},SPMO:{token:"0xAd622320e520de39e72d41EF07438C3Fd3354875",reason:"no-pool"},TEAM:{token:"0x5B97476b922F3305131B8f0B9D333172E87f4aaE",reason:"no-pool"},TEM:{token:"0xB1CC0EC7Db69Cf43539119814df40071b9d61793",reason:"no-pool"},TER:{token:"0x2778C5024D5cA2CdB0f8eAD671ffc69963AdCD9C",reason:"no-pool"},TSEM:{token:"0x89776d4Cd68193597A2fC132cfaC1fDe36CCeA8a",reason:"no-pool"},TTD:{token:"0x0b5fb4031cae9163db10B169Ee72685F0EdC8545",reason:"no-pool"},UMC:{token:"0x0E6e67Ba88e7b5d9B67636A215c76779B948dE79",reason:"thin"},UNH:{token:"0xcF364ea52787e289De6F32077834056E3E70D6A8",reason:"no-pool"},VICR:{token:"0x6006ed4B2F94110851ff7509D97D034f0EeD9226",reason:"no-pool"},VRT:{token:"0xFA78C12E6488814A0262E4e802749a4a737d5fB7",reason:"thin"},VSAT:{token:"0x26dCbfb34FC83CAbD6990f449674efDc6097fF85",reason:"no-pool"},VST:{token:"0x561e2a49212b7cCF47f2744Ccb83e200722fADBc",reason:"no-pool"},WDAY:{token:"0x82DA4646242e1D962e96e932269Dc644c94a9CaA",reason:"quote-failed"},WDC:{token:"0xF52597345A8Edf418bc4071b4a35112472277D3e",reason:"no-pool"},WULF:{token:"0x348Be1A8663f15edDe5CDf8A96BB69078f7aB6Fd",reason:"thin"},WYFI:{token:"0x9e7ABD3C9139D14E4c86DcE0e455AAB7A0C2FB3E",reason:"thin"},XLK:{token:"0x15Cd20759CE7F3285c29A319dE2D1A2e098c6f43",reason:"thin"},XNDU:{token:"0xA8eB3BCcbf2017eE7CBfb652eB51CF2E1B153289",reason:"no-pool"},XOM:{token:"0xf9B46d3D1B22199D4D1025a9cEDB540A33F1a2d5",reason:"thin"},ZETA:{token:"0xE674C5c071821f48BB2d12CAdb83617Eff438f9e",reason:"no-pool"},ZM:{token:"0x44c4F142009036cF477eD2d09932051843137CF1",reason:"thin"},ZS:{token:"0x7dc013eB55e436f30d7ED1AFE4E36d6e45e3c3f7",reason:"no-pool"}},census:{block:111456101,measuredAt:"2026-11-11T05:12:11.414Z",file:"ops/qa/2026-11-11-stock-census.json",rule:"priceReferences: hookless Uniswap USDG pools with at least 10,000 USDG in range whose 10 USDG quote executed within 2% of the pool spot. unpriced: every other official stock, with the reason: no-pool (no live USDG pool), thin (under 10,000 USDG in range) or quote-failed (enough depth, but the 10 USDG quote failed, so the price is unverified)."},notOffered:{CLSK:"thin",EWY:"thin",IONQ:"thin",RGTI:"thin",RKLB:"thin"},sourceCommit:"02230282d8888e00794207ed271ee01b4ce30309"};var F=u(["function slot0() view returns (uint160,int24,uint16,uint16,uint16,uint8,bool)","function liquidity() view returns (uint128)","function getSlot0(bytes32) view returns (uint160,int24,uint24,uint24)","function getLiquidity(bytes32) view returns (uint128)"]),C=1n<<96n,p=C*C,m=10000n*10n**6n,I="current price in the Uniswap USDG pool; on-chain trading can differ from the stock market",y=[...b.tokens,...b.priceReferences],g=Object.entries(b.unpriced);function h(o){if(o.chainId!==b.chainId)return;let n=o.address.toLowerCase(),e=y.find(f=>f.token.toLowerCase()===n);if(e)return{symbol:e.symbol,pools:e.pools};let a=g.find(([,f])=>f.token.toLowerCase()===n);return a?{symbol:a[0],pools:[],gap:a[1].reason==="no-pool"||a[1].reason==="quote-failed"?a[1].reason:"thin"}:void 0}var i=class extends B{constructor(e,a){super("Pinned stock pools have insufficient in-range USDG depth for a display estimate.");this.symbol=e;this.gap=a}symbol;gap},N=(o,n)=>n==="no-pool"?`no Uniswap USDG pool with liquidity exists for ${o}`:n==="quote-failed"?`Oak's 10 USDG test quote in the Uniswap USDG pool for ${o} failed, so its price is unverified`:`the Uniswap USDG pools for ${o} are too thin to trust (under $10,000 in range)`,M="the RPC did not answer and may be rate limited; try again shortly";function U(o){let n=new Set;for(let e=o;e&&typeof e=="object"&&!n.has(e);e=e.cause){n.add(e);let{status:a,code:f,message:d,name:t}=e,c=Number(a??f);if(c===429||c>=500&&c<=599||t==="RpcFailure"||t==="TimeoutError"||t==="HttpRequestError"||/rate.?limit|too many requests|\b429\b|timed? ?out|fetch failed|RPC endpoint is busy/i.test(String(d??"")))return!0}return!1}async function x(o,n,e){let a=h(o);if(!a)return;if(a.gap)throw new i(a.symbol,a.gap);let f=BigInt(o.address)<BigInt(b.usdg),t=(await Promise.all(a.pools.map(async c=>{let s=c.v===3,l=S(s?c.pool:b.v4.stateView),[k,E]=await Promise.all([n.readContract({address:l,abi:F,functionName:s?"slot0":"getSlot0",args:s?[]:[c.id],blockNumber:e}),n.readContract({address:l,abi:F,functionName:s?"liquidity":"getLiquidity",args:s?[]:[c.id],blockNumber:e})]),D=k[0];if(D<=0n||E<=0n)return;let A=f?E*D/C:E*C/D;return A>=m?{sqrt:D,usdgDepth:A}:void 0}))).filter(c=>c!==void 0);if(!t.length)throw new i(a.symbol,"thin");return t}async function T(o,n,e){return(await x(o,n,e))?.reduce((f,d)=>d.usdgDepth>f.usdgDepth?d:f)}function r(o,n){let e=BigInt(o.address)<BigInt(b.usdg),a=e?n**2n:p,f=e?p:n**2n;return a*10n**BigInt(o.decimals)*10n**18n/(f*10n**6n)}async function w(o,n,e){let a=await T(o,n,e);return a?r(o,a.sqrt):void 0}async function G(o,n,e){return(await x(o,n,e))?.map(f=>r(o,f.sqrt)).reduce((f,d)=>d>f?d:f)}export{b as a,m as b,I as c,h as d,i as e,N as f,M as g,U as h,T as i,w as j,G as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as k,h as A}from"./
|
|
1
|
+
import{g as k,h as A}from"./TNHU5UBQ.js";import{g as i}from"./NWNYJ26T.js";import{b as l,j as m,n as y}from"./EWZFZUVF.js";import{a as r}from"./XSD5NL7J.js";import{decodeFunctionData as P,parseAbi as g}from"viem";var x=g(["function buy(uint256 quoteIn,uint256 minTokensOut,address recipient) payable returns (uint256)","function sell(uint256 tokensIn,uint256 minQuoteOut,address recipient) returns (uint256)"]);function f(s){return k(s)}function K(s,e,o,t){let d=f(s),c=f(e),[p,n]=BigInt(d)<BigInt(c)?[d,c]:[c,d];return{currency0:p,currency1:n,fee:o,tickSpacing:t,hooks:m[l].pons.memeHook.address}}function h(s){let e=A(s,[y]),o=e.legs[0];if(e.permit||e.legs.length!==1||!o)throw new r("Pons router must contain one canonical v4 swap command.");return{swap:{poolKey:o.poolKey,zeroForOne:o.zeroForOne,amountIn:e.amountIn,amountOutMinimum:e.amountOutMinimum,minHopPriceX36:0n,hookData:"0x"},deadline:e.deadline}}function H(s,e){let o=(n,w,a)=>{if(!i(n,w))throw new r(`Built swap ${a} does not match the accepted quote.`)},t=e.ponsPoolToken??e.ponsCurveToken;if(!t||e.ponsPoolToken&&e.ponsCurveToken)throw new r("Pons quote must name exactly one curve or pool token.");let d=i(e.to,t);if(!d&&!i(e.from,t))throw new r("Pons quote must trade its launch token.");let c=d?e.from:e.to;if(i(f(c),t))throw new r("Pons quote pair must differ from its launch token.");if(e.ponsPoolToken){if(o(e.router,m[l].ponsTrade.universal_router.address,"Pons router"),o(e.spender??e.router,m[l].ponsTrade.permit2.address,"Pons spender"),!e.data)throw new r("Pons pool quote must include locally reconstructed calldata.");let{swap:n,deadline:w}=h(s.data),a=h(e.data),u=K(c,t,a.swap.poolKey.fee,a.swap.poolKey.tickSpacing);if(o(n.poolKey.currency0,u.currency0,"pool currency0"),o(n.poolKey.currency1,u.currency1,"pool currency1"),o(n.poolKey.hooks,u.hooks,"pool hook"),n.zeroForOne!==i(f(e.from),u.currency0)||n.poolKey.fee!==a.swap.poolKey.fee||n.poolKey.tickSpacing!==a.swap.poolKey.tickSpacing||w!==a.deadline)throw new r("Pons pool direction, parameters or deadline differ from the accepted quote.");return{from:e.from,to:e.to,wallet:e.wallet,amount:n.amountIn}}let p=P({abi:x,data:s.data});if(p.functionName!==(d?"buy":"sell"))throw new r("Pons curve direction does not match the accepted quote.");return o(e.spender??e.router,e.router,"curve spender"),{from:e.from,to:e.to,wallet:p.args[2],amount:p.args[0]}}export{x as a,f as b,K as c,h as d,H as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as te,b as ie,i as ne,j as ae,l as re,m as se,p as ce,q as de}from"./G4IX4CYN.js";import{B as oe}from"./5677LZOV.js";import{a as m,e as C,f as q,h as I,i as E,j as n,k as ee,l as B,m as x,n as F,o as P,p as A,q as O,r as N}from"./UMY6SP7C.js";import{h as Y,k as Z}from"./CJMVRV34.js";import{a as J}from"./7WXAS54T.js";import{a as s}from"./XSD5NL7J.js";import{encodeFunctionData as me,zeroAddress as $}from"viem";var le=["hookr_lp_add","hookr_lp_remove","hookr_lp_collect"],ye=t=>le.includes(t),U=t=>({type:"object",additionalProperties:!1,properties:t,required:Object.keys(t)}),j=te.oneOf[0],ue={hookr_lp_add:{...U({target:{...U({position:j}),description:"Where to add liquidity: the existing Hookr family position."},liquidity:{...m,description:"Liquidity to add, in v4 liquidity base units (not a token amount); positive, and the position total stays below 2^127."},amount0Max:{...m,description:`Maximum of the pool's currency0 to deposit, in base units of that token (18 decimals: "1000000000000000000" = 1 token).`},amount1Max:{...m,description:`Maximum of the pool's currency1 to deposit, in base units of that token (18 decimals: "1000000000000000000" = 1 token).`},deadline:{...m,description:"Latest time this action may execute, as Unix seconds; must be within the next 300 seconds of chain time."}})},hookr_lp_remove:U({position:j,liquidity:{...m,description:"Liquidity to remove, in v4 liquidity base units (not a token amount); positive and at most the position remaining liquidity."},amount0Min:{...m,description:`Minimum of the pool's currency0 to receive, in base units of that token (18 decimals: "1000000000000000000" = 1 token).`},amount1Min:{...m,description:`Minimum of the pool's currency1 to receive, in base units of that token (18 decimals: "1000000000000000000" = 1 token).`},deadline:{...m,description:"Latest time this action may execute, as Unix seconds; must be within the next 300 seconds of chain time."}}),hookr_lp_collect:U({position:j,deadline:{...m,description:"Latest time this action may execute, as Unix seconds; must be within the next 300 seconds of chain time."}})};function he(t,a){if(!ye(t))throw new s("Choose a supported Hookr family LP action.");let d=ue[t],i=C(a,Object.keys(d.properties),d.required),e=t==="hookr_lp_add",l=t==="hookr_lp_collect",o=ie(e?C(i.target,["position"],["position"]).position:i.position),r=l?0n:q(i.liquidity,127);if(!l&&!r)throw new s("Hookr add/remove liquidity must be an exact positive integer; use collect for fees only.");let v=l?0n:q(i[e?"amount0Max":"amount0Min"],e?128:256),h=l?0n:q(i[e?"amount1Max":"amount1Min"],e?128:256);return{position:o,adding:e,collecting:l,liquidity:r,bound0:v,bound1:h,deadline:q(i.deadline,64)}}async function fe(t,a,d){let{block:i,poolId:e,position:l,pc:o,core:r,role:v}=a,h=(p,L=[])=>A(t,r,P(v),p,L,i.number),[M,S,H,R]=await Promise.all([h("config",[e]),A(t,N,P("registry"),"admission",[O,r],i.number),h("configSchemaHash"),h("recaptureConfig",[e])]),k=x(M),y=x(S),u=x(y.caps),g=x(o.caps);if(y.implementation!==r||y.codeHash!==Y(r).codeHash||y.schemaHash!==I(H)||n(y.kind,8)!==0n||!n(y.gasLimit,32)||n(u.maxLpFeePips,24)>600000n||n(u.maxQuoteTakePips,24)>=1000000n||n(u.maxSubjectTakeBps,16)>1000n)throw new s("Hookr core admission or fee caps are unavailable or outside the reviewed limits.");let f=n(g.maxLpFeePips,24),T=n(g.maxQuoteTakePips,24),b=n(g.maxSubjectTakeBps,16),c=n(k.burnBps,16),w=n(k.lpBps,16),D=n(k.protocolShareBps,16);if(f>600000n||f>n(u.maxLpFeePips,24)||n(o.baseLpFeePips,24)>f||n(k.maxFeePips,24)>f||T>n(u.maxQuoteTakePips,24)||b>n(u.maxSubjectTakeBps,16)||c+w>1000n||D<2000n||D>5000n)throw new s("Hookr pool fee settings exceed the reviewed entry caps. Exit tools remain available.");let _=E(o.advisory),z={gated:!1},G="";if(_!==$){if(o.advisoryFailOpen!==!1||n(o.advisoryPhases,8)!==1n)throw new s("Hookr entry requires the reviewed fail-closed agent gate configuration.");let p=await ce(t,i.number,d,e,_,o),L=await de(t,i.number,e,l.launcher,_,o);if(!p.healthyIdentityOnly||!p.walletAgent||!("liquidityEntryAllowed"in L)||!L.liquidityEntryAllowed)throw new s("Hookr family entry needs a healthy gate and a current on-chain agent identity. Collect/remove do not need Hookr gate eligibility.");let pe=x(L.terms),X=q(pe.tierPips,24);if(X>50000n||n(o.baseLpFeePips,24)+X>f||n(o.advisoryGasLimit,32)<400000n||n(o.advisoryGasLimit,32)>2000000n)throw new s("Hookr gate surcharge or gas exceeds the pool caps.");z=L,G=` Gate ${_}; ${p.listed?"listed by Oak":"new gate, Oak has not read its code"}.`}let V=x(B(R,3)[0]);ee(V.on);let K=null,Q=BigInt(I(await t.getStorageAt({address:O,slot:ae(e),blockNumber:i.number})));if(BigInt(l.launcher)!==(Q&(1n<<160n)-1n))throw new s("Hookr frozen Root record differs from the family Launcher.");let W=(Q>>200n&255n)!==0n;if(W){let p=B(await A(t,N,P("registry"),"activeLaneOf",[O],i.number),4);if(E(p[0]),I(p[1]),n(p[2],32),n(p[3],16)>10000n)throw new s("Hookr recapture switch is malformed.");K=F({activeSwapSwitch:p,swapExecutorUsedByLpAction:!1,liquidityCallbackFloor:300000n+300000n/63n+5000n,floorSource:"Pinned HookrLane._flush; sender estimates the complete transaction, including EIP-150 overhead."})}return{terms:F({config:k,poolCaps:g,gateStatus:z,reportedRecaptureConfig:V,laneLiquidity:W,lane:K}),summary:G}}async function ke(t,a,d,i){let e=he(t,d);if(a.network==="testnet")throw new s("Hookr family LP actions require Robinhood Chain 4663.");let l=a.clientFor(4663),o=await re(l,i,e.position);if(e.deadline<=o.block.timestamp||e.deadline>o.block.timestamp+300n)throw new s("Set a fresh Hookr LP deadline within the next 300 seconds of chain time.");if(!e.adding&&e.liquidity>o.liquidity)throw new s("Remove no more than the exact remaining Hookr family liquidity.");if(e.adding&&e.liquidity+o.liquidity>=1n<<127n)throw new s("Hookr resulting liquidity must fit int128 max.");let r=oe({liquidity:e.liquidity,tickLower:o.tickLower,tickUpper:o.tickUpper,sqrtPriceX96:o.sqrtPriceX96,roundUp:e.adding});if(e.adding&&(!r.amount0&&!r.amount1||r.amount0>=1n<<127n||r.amount1>=1n<<127n||r.amount0>e.bound0||r.amount1>e.bound1))throw new s("Hookr rounded-up principal debts must fit the exact finite funding caps.");let v=t==="hookr_lp_remove"?await se(l,o):null;if(v?.currentlyLocked)throw new s("Hookr principal is locked on the parent-block clock. Collect fees now or wait until all principal locks expire.");let h=e.adding?await fe(l,o,i):null,M=h?.terms??null,S=null,H=null;try{S=(await Promise.all([o.key.currency0,o.key.currency1].map(c=>A(l,o.core,P("rulesV1"),"poolAccrued",[o.poolId,c],o.block.number)))).map((c,w)=>({token:o.tokens[w],amount:n(c).toString()}))}catch{H="Core credit forecast unavailable; receipt verification must identify any core payment separately. No zero is inferred."}let R=e.adding?"Add":e.collecting?"Collect LP fees with zero principal removed from":"Remove",k=`${o.key.currency0} / ${o.key.currency1}`,y=`${R} Hookr family ${e.position.familyId}, member ${e.position.member}, Launcher ${e.position.launcher}. ${e.adding||!e.collecting?`Exact liquidity ${e.liquidity}; existing ticks ${o.tickLower} to ${o.tickUpper}.`:""} Recipient ${i}. Currencies ${k} (base units; decimals ${o.tokens[0].decimals}/${o.tokens[1].decimals}). ${e.adding?`Deposit caps ${e.bound0}/${e.bound1}; current rounded-up principal debts ${r.amount0}/${r.amount1}. Exact finite approvals are reset first and revoked after the add; unused funding returns to ${i} in the add transaction.`:`Principal minimums ${e.bound0}/${e.bound1}; current principal forecast ${r.amount0}/${r.amount1}. Fees cannot satisfy a principal minimum.`} Uncollected LP fee forecast ${o.fees[0]}/${o.fees[1]}, paid separately from principal. Any family accrual moved into the wallet\u2019s core claim ledger is reported separately after mining; this credit is not a wallet token receipt; pool pending recapture is not earned position fees. ${H??"Core credit forecast is separate in terms."} Deadline ${e.deadline}.${h?.summary??""}`,u=[],g=[],f=[];if(e.adding)for(let[b,c]of[o.key.currency0,o.key.currency1].entries()){let w=b===0?e.bound0:e.bound1;w&&(f.push({token:c===$?J:c,amount:w,...c===$?{to:e.position.launcher}:{}}),c!==$&&(u.push(a.approval(c,e.position.launcher,"0",4663),a.approval(c,e.position.launcher,w.toString(),4663)),g.push(a.approval(c,e.position.launcher,"0",4663))))}let T=u.length;return u.push(a.unsignedTx({to:e.position.launcher,chainId:4663,value:e.adding&&o.key.currency0===$?e.bound0.toString():"0",description:y,data:me({abi:ne(e.position),functionName:e.adding?"addLiquidity":"withdraw",args:e.adding?[e.position.familyId,Number(e.position.member),e.liquidity,e.bound0,e.bound1,e.deadline]:[e.position.familyId,Number(e.position.member),e.liquidity,e.bound0,e.bound1,i,e.deadline]})}),...g),await Z(l,o.block),{txs:u,inputs:f,summary:y,state:o,request:e,actionIndex:T,terms:F({request:d,blockNumber:o.block.number,blockHash:o.block.hash,poolId:o.poolId,poolKey:o.key,owner:i,recipient:i,range:{tickLower:o.tickLower,tickUpper:o.tickUpper},liquidityBefore:o.liquidity,liquidityDelta:e.adding?e.liquidity:-e.liquidity,principal:r,principalBounds:[e.bound0,e.bound1],uncollectedLpFees:o.fees.map((b,c)=>({token:o.tokens[c],amount:b})),coreCredits:S,coreCreditsReason:H,locks:v,entry:M,exactApprovals:u.filter((b,c)=>c!==T),refunds:e.adding?[e.bound0-r.amount0,e.bound1-r.amount1]:null,gasEstimate:null,gasEstimateReason:"Local sender estimates the ordered calls and confirms the maximum network fee."})}}function ge(t){if(!Array.isArray(t)||!t.length||t.length>7)throw new s("Hookr LP requires only its exact finite approvals, one family action and cleanup.");for(let a of t)C(a,["to","data","value","chainId","description"],["to","data","value","chainId","description"])}function Ae(t,a){if(ge(t),t.length!==a.length||t.some((d,i)=>d.to!==a[i].to||d.data!==a[i].data||d.value!==a[i].value||d.chainId!==4663))throw new s("Hookr LP differs from the locally reconstructed exact family action, recipient, bounds, approvals or cleanup.")}function $e(t){return le.map(a=>({name:a,inputSchema:ue[a],execute:async(d,i)=>{let e=await ke(a,t,d,i);return{txs:e.txs,preview:await t.preview(e.txs,i),terms:e.terms,summary:e.summary}}}))}export{le as a,ye as b,ue as c,he as d,ke as e,ge as f,Ae as g,$e as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Q}from"./SUNTJ6IU.js";import{b as X}from"./ADIPEGNN.js";import{b as Z}from"./OB7BFDOV.js";import{i as ee}from"./ANIF3JMV.js";import{a as Y}from"./E76Z2TT4.js";import{b as z}from"./GBIBRYOV.js";import{a as D,b as k,c as R,d as N,g as V,h as I,k as _,l as x,n as B,p as W,r as $,s as U,t as q,v as E,x as J,y as G}from"./3A2IKFTV.js";import{a as y}from"./X5V2Z2NM.js";import{b as K}from"./SPJCSEKP.js";import{a as O}from"./43LI5NKJ.js";import{c as L,e as T,g as w}from"./NWNYJ26T.js";import{a as g,d as j}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{Buffer as te}from"node:buffer";import{decodeEventLog as re,encodeFunctionData as H,getAddress as se,hexToString as de,parseAbiItem as ce,toEventSelector as ie}from"viem";var Ke={register:"erc8004_register"},ge="Oak now always adds the public oak.registrar marker when it registers an agent, so tag: false and --no-tag are no longer available. Remove the option and register again. To use an agent ID you already own without the marker, link it with oak setup link <agentId>.",fe="The registration went through, but Oak could not find its oak.registrar marker on Robinhood Chain. Nothing else was sent. Ask me to check the agent with erc8004_identity.",le="One transaction registers your agent and writes the public marker oak.registrar = oak. Anyone can see on Robinhood Chain that this agent was registered through Oak. The marker is self-reported, not proof of anything, and the transaction stays in the public history even if the marker is changed later. It needs gas.",F="https://eips.ethereum.org/EIPS/eip-8004#registration-v1",ue={type:"object",required:["type","name","description","image","services","x402Support","active","registrations"],properties:{type:{const:F,description:"ERC-8004 registration-v1 profile type URI."},name:{type:"string",minLength:1,description:"Short public name for the agent."},description:{type:"string",description:"Public text describing what the agent does; may be empty."},image:{type:"string",description:"Public HTTPS or IPFS image URI without credentials."},services:{type:"array",items:{type:"object",required:["name","endpoint"]},description:"Service endpoint objects with name and endpoint; use an empty list for none."},x402Support:{type:"boolean",description:"Whether the agent supports x402 payments."},active:{type:"boolean",description:"Whether this agent is active."},registrations:{type:"array",description:"Registry references with agentRegistry and agentId; leave empty before first registration."},tags:{type:"array",items:{type:"string"},description:"Optional public text labels for the agent."},supportedTrust:{type:"array",items:{type:"string"},description:"Optional trust mechanism labels supported by the agent."}}};function pe(e){if(typeof e!="string"||!e.trim())return!1;try{let t=new URL(e);return["https:","ipfs:"].includes(t.protocol)&&!!t.hostname&&!t.username&&!t.password}catch{return!1}}var me=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"&&t.trim()),he=e=>e.replace(/\.$/,"");function ye(e,t,a,n){let{registryId:d}=I(e);if(!T(t))throw new g("Provide a registration-v1 profile object.");if(a!==void 0&&typeof a!="boolean")throw new g("The tag option must be a boolean.");let o=[],r=(i,c)=>o.push(`${i}: ${c}`);t.type!==F&&r("type",`use "${F}"`),(typeof t.name!="string"||!t.name.trim())&&r("name",'a short name for your agent, such as "Oak Agent 1"'),typeof t.description!="string"&&r("description","a sentence about what your agent does (it may be empty text)"),pe(t.image)||r("image","an HTTPS or IPFS link to a picture, with no username or password in it"),typeof t.active!="boolean"&&r("active","true or false"),typeof t.x402Support!="boolean"&&r("x402Support","true or false"),Array.isArray(t.services)?t.services.forEach((i,c)=>{try{Z(i)}catch(p){if(!(p instanceof g))throw p;r(`services item ${c+1}`,he(p.message))}}):r("services","a list of endpoints, or [] for none");for(let i of["tags","supportedTrust"])t[i]!==void 0&&!me(t[i])&&r(i,"a list of nonempty text labels, or leave it out");if(Array.isArray(t.registrations)?t.registrations.forEach((i,c)=>{let p=`registrations item ${c+1}`;if(!T(i)||typeof i.agentRegistry!="string"||!/^eip155:[1-9][0-9]*:0x[0-9a-fA-F]{40}$/.test(i.agentRegistry))return r(p,"an agentRegistry such as eip155:4663:0x\u2026 and its agentId");let f=typeof i.agentId=="number"&&Number.isSafeInteger(i.agentId)?String(i.agentId):i.agentId,b;try{b=x(f)}catch{return r(p,'an agentId as a whole number, such as "1"')}w(i.agentRegistry,d)&&(n===void 0?r(p,"remove the entry for this registry; its ID comes from the mined Registered receipt, and erc8004_update adds it afterwards"):b!==n&&r(p,`the agentId does not match the agent being updated; use "${n}" or remove the entry`))}):r("registrations","a list, or [] before the first registration"),o.length)throw new g(`This profile needs: ${o.join("; ")}. Fix all of these and try again.`);let u=t.registrations.map(i=>({...i}));n!==void 0&&!u.some(i=>w(i.agentRegistry,d))&&u.push({agentId:n.toString(),agentRegistry:d});let s=[...new Set((t.tags??[]).filter(i=>i!==k))];a!==!1&&s.push(k);let m={...t,registrations:u,...s.length?{tags:s}:{}};s.length||delete m.tags;let l;try{if(l=JSON.stringify(m),te.byteLength(l)>65536)throw new Error;JSON.parse(l)}catch{throw new g("Profile must be JSON data no larger than 64 KiB.")}return`data:application/json;base64,${te.from(l,"utf8").toString("base64")}`}async function M(e,t){try{let{chainId:a,registry:n}=I(e),d=x(t),o=e.clientFor(a),r=await o.readContract({address:n,abi:y,functionName:"ownerOf",args:[d]}).catch(l=>{throw j(l)?new g(`Agent ${d} does not exist in this ERC-8004 registry: the owner lookup reverted. Check the agent ID.`):l});O(r);let[u,s,m]=await Promise.all([o.readContract({address:n,abi:y,functionName:"tokenURI",args:[d]}),o.readContract({address:n,abi:y,functionName:"getAgentWallet",args:[d]}),o.readContract({address:n,abi:y,functionName:"getMetadata",args:[d,k]})]);if(O(s),typeof u!="string"||typeof m!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(m))throw new g("The registry returned invalid identity data.");return{agentId:d.toString(),chainId:a,registry:n,owner:r,uri:u,agentWallet:s,registrarMetadata:m,registryValidated:!1,summary:D}}catch(a){throw new g(e.plainError(a))}}async function De(e,t){let a=await M(e,t);return{...a,uri:A(a.uri)}}async function we(e,t,a,n,d,o){let{registry:r}=I(e),u=await E(e,t,a,d),s=o===void 0?"Registered":"URIUpdated",m=ie(o===void 0?"Registered(uint256,string,address)":"URIUpdated(uint256,string,address)"),l=u.logs.filter(v=>w(v.address,r)&&v.topics[0]===m&&!v.removed);if(l.length!==1)throw new g(`The receipt must contain one matching ${s} event.`);let i=l[0],c=re({abi:y,eventName:s,topics:i.topics,data:i.data,strict:!0}),p=c.args.agentId,f=c.eventName==="Registered"?c.args.agentURI:c.args.newURI,b=c.eventName==="Registered"?c.args.owner:c.args.updatedBy;if(o!==void 0&&p!==o||f!==n||!w(b,a))throw new g("The registry event does not match the expected agent, URI and wallet.");let h=await M(e,p.toString());if(h.uri!==n||o===void 0&&!w(h.owner,a))throw new g("The current agent owner or URI does not match the confirmed operation.");return h}function be(e,t){let{chainId:a,registry:n}=I(e);return e.unsignedTx({to:n,chainId:a,value:"0",data:H({abi:y,functionName:"setMetadata",args:[t,k,R]}),description:`Set mutable oak.registrar metadata to oak for agent ${t}.`})}async function ae(e,t,a,n){let{registry:d}=I(e),o=x(n.agentId),r=await E(e,t,a,H({abi:y,functionName:"setMetadata",args:[o,k,R]})),u=ie("MetadataSet(uint256,string,string,bytes)"),s=r.logs.filter(c=>w(c.address,d)&&c.topics[0]===u&&!c.removed);if(s.length!==1)throw new g("The receipt must contain one matching MetadataSet event.");let m=s[0],{args:l}=re({abi:y,eventName:"MetadataSet",topics:m.topics,data:m.data,strict:!0});if(l.agentId!==o||l.metadataKey!==k||l.metadataValue!==R)throw new g("The metadata event does not match this agent and registrar marker.");let i=await M(e,n.agentId);if(i.registrarMetadata!==R||i.uri!==n.uri||!w(i.owner,n.owner))throw new g("The current agent metadata, owner or URI does not match the confirmed operation.");return i}async function ke(e,t){let{chainId:a,registry:n}=I(e),d=e.clientFor(a),o=await d.readContract({address:n,abi:y,functionName:"balanceOf",args:[t]});if(o===0n)return;if(typeof o!="bigint"||o<0n)throw new g("Registry balance is unavailable; registration was not built.");let r=await d.getBlockNumber({cacheTime:0}),u=new Set;for(;;){let s=r>9999999n?r-9999999n:0n,m=await d.getLogs({address:n,event:ce("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:t},fromBlock:s,toBlock:r,strict:!0});for(let l of m){let i=l.args.tokenId.toString();if(l.removed||u.has(i))continue;u.add(i);let c=await M(e,i);if(w(c.owner,t))return c}if(s===0n)throw new g("Owned identity could not be located; registration was not built. Run oak setup link <agentId>.");r=s-1n}}function Ie(e){if(e===void 0)return[];if(!Array.isArray(e)||e.length>15)throw new g("Provide at most 15 user metadata entries as { key, value } with value as 0x hex or text.");let t=new Set;return e.map(a=>{if(!T(a))throw new g("Provide each metadata entry as { key, value } or { key, text }.");let n=J(a.key);if(n===k)throw new g("The key oak.registrar is reserved for the registration marker. Remove that metadata entry.");if(t.has(n))throw new g(`Metadata key ${A(n)} is repeated.`);return t.add(n),{metadataKey:n,metadataValue:G(a)}})}function oe(e,t,a){let n=$(t);if(!n)return;let{registryId:d}=I(e);return Array.isArray(n.registrations)&&n.registrations.some(o=>T(o)&&typeof o.agentRegistry=="string"&&w(o.agentRegistry,d)&&String(o.agentId)===a.toString())}function ve(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 ne(e,t,a,n){let{chainId:d,registry:o}=I(e);O(n),B(e,a.chainId);let r=t?x(a.agentId):void 0;if(!t&&(a.tag===!1||a.noTag!==void 0||a["--no-tag"]!==void 0))throw new g(ge);if(a.tag!==void 0&&typeof a.tag!="boolean")throw new g("The tag option must be a boolean.");let s=!t&&a.profile===void 0?"":ye(e,a.profile,a.tag,r),m=t?[]:Ie(a.metadata),l=a.tag!==!1;if(t&&a.metadataTransactionHash!==void 0&&(!l||a.transactionHash===void 0))throw new g("A metadata transaction hash requires tagging and the profile transaction hash.");let i=r!==void 0?H({abi:y,functionName:"setAgentURI",args:[r,s]}):H({abi:y,functionName:"register",args:[s,[...m,{metadataKey:k,metadataValue:R}]]}),c=f=>r===void 0?ve(e,f,a.profile):f;if(a.transactionHash!==void 0){let f=await we(e,a.transactionHash,n,s,i,r);if(!t){if(!w(f.registrarMetadata,R))throw new g(fe);if(a.metadataTransactionHash!==void 0)throw new g("Registration already writes oak.registrar in one transaction. Omit metadataTransactionHash.");return c(f)}return l&&a.metadataTransactionHash!==void 0?c(await ae(e,a.metadataTransactionHash,n,f)):c(f)}if(!t){let f=await ke(e,n);if(f){let b={...f,registrationResumed:!0},h=$(f.uri),v=Array.isArray(h?.tags)&&h.tags.includes(k);if(a.metadataTransactionHash!==void 0){if(!v)throw new g("Only a legacy Oak profile can resume its registrar metadata. Link this agent with oak setup link <agentId>.");return c({...await ae(e,a.metadataTransactionHash,n,f),registrationResumed:!0})}if(!v||f.registrarMetadata!=="0x")return c(b);let S=await U(e,[be(e,x(f.agentId))],n,`Resume registrar metadata for legacy Oak agent ${f.agentId}; no new identity will be minted. Submit locally, then repeat these arguments with metadataTransactionHash to verify the marker receipt.`);return{...b,...S}}if(a.metadataTransactionHash!==void 0)throw new g("No owned legacy Oak identity was found; no metadata transaction was built.")}r!==void 0&&await q(e,r,n);let p=[e.unsignedTx({to:o,data:i,value:"0",chainId:d,description:r===void 0?"Register an ERC-8004 agent profile.":`Update ERC-8004 agent ${r} profile.`})];return t?U(e,p,n,"Submit locally, then repeat the original arguments with transactionHash to verify the profile receipt and URI. The tag option changes the profile tag only; existing onchain metadata is unchanged."):U(e,p,n,`${le} Submit locally, then repeat the original arguments with transactionHash to verify the registration receipt, URI and marker. Update the profile registrations with the mined ID afterward.`)}async function Re(e,t){let a=await M(e,t.agentId),{chainId:n,registry:d}=I(e),o=e.clientFor(n),r=BigInt(a.agentId),u=t.metadataKeys===void 0?[]:(()=>{if(!Array.isArray(t.metadataKeys)||t.metadataKeys.length>16)throw new g("Provide at most 16 metadata keys.");return t.metadataKeys.map(h=>W(h,"metadata key",128,!1))})(),s=t.operator===void 0?void 0:se(String(t.operator)),[m,l,...i]=await Promise.allSettled([o.readContract({address:d,abi:y,functionName:"getApproved",args:[r]}),s?o.readContract({address:d,abi:y,functionName:"isApprovedForAll",args:[a.owner,s]}):Promise.resolve(void 0),...u.map(h=>o.readContract({address:d,abi:y,functionName:"getMetadata",args:[r,h]}))]),c=h=>h.status==="fulfilled"?h.value:void 0,p=c(m),f=_(a.agentWallet)?"unset":w(a.agentWallet,a.owner)?"owner":"verified-other",b=oe(e,a.uri,r);return{...a,approved:typeof p=="string"&&_(p)?null:p??"unavailable",...s?{operator:s,operatorApproved:c(l)??"unavailable"}:{},walletState:f,walletNote:f==="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.":f==="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:b??null,fetched:!1,note:b===void 0?"The URI is external or not decodable; Oak does not fetch it.":void 0},...u.length?{metadata:Object.fromEntries(u.map((h,v)=>{let S=c(i[v]),P=typeof S=="string"&&/^0x([0-9a-fA-F]{2})*$/.test(S)?S:void 0,C;if(P&&P!=="0x")try{C=A(de(P))}catch{C=void 0}return[A(h),{hex:P??"unavailable",...C?{text:C}:{}}]}))}:{}}}var Ae={type:"object",additionalProperties:!1,required:["key"],properties:{key:{type:"string",minLength:1,maxLength:128,description:"Metadata key; agentWallet and oak.registrar are reserved during registration."},value:{...V,description:"Metadata bytes as 0x-prefixed hex; provide value or text."},text:{type:"string",description:"Metadata as UTF-8 text; provide text or value."}}},Te=e=>{let t=(n,d,o)=>({name:n,inputSchema:d,execute:async(r,u)=>{try{let s=await o(r,u);return T(s)&&typeof s.uri=="string"?{...s,uri:A(s.uri)}:s}catch(s){throw new g(e.plainError(s))}}}),a=n=>({type:"object",additionalProperties:!1,required:n?["agentId","profile"]:[],properties:{profile:{...ue,description:n?"Registration-v1 profile object to publish for this agent.":"Omit for an empty URI; register(uri, metadata[]) still writes the public oak.registrar marker. Attach a profile later with erc8004_update."},tag:{type:"boolean",default:!0,description:n?"Set false to remove the profile tag. Profile updates leave existing onchain metadata unchanged.":"Accepted only as true. Oak always adds the oak.registrar marker when it registers."},transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Verify the exact profile transaction, event and URI.":"After local submission, verify exact registration calldata, event, URI and oak.registrar marker."},metadataTransactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Optional legacy metadata transaction hash, supplied with transactionHash to verify a previously sent two-transaction update.":"Only for a resumed legacy Oak profile: verify its separate metadata transaction without transactionHash."},...n?{agentId:N}:{noTag:{type:"boolean",description:"Removed option: omit it and register again."},"--no-tag":{type:"boolean",description:"Removed option: omit it and register again."},metadata:{type:"array",maxItems:15,items:Ae,description:"Up to 15 user entries plus the mandatory oak.registrar marker. The keys agentWallet and oak.registrar are reserved."}}}});return{tools:[t("erc8004_register",a(!1),(n,d)=>ne(e,!1,n,d)),t("erc8004_update",a(!0),(n,d)=>ne(e,!0,n,d)),t("erc8004_identity",{type:"object",additionalProperties:!1,required:["agentId"],properties:{agentId:N,metadataKeys:{type:"array",maxItems:16,items:{type:"string",minLength:1,maxLength:128},description:"Also read these onchain metadata keys."},operator:{...L,description:"Also report whether this address is approved for all of the owner's agents."}}},n=>Re(e,n))]}},Ve=e=>K("erc8004",[Te(e),Q(e),X(e),Y(e),z(e),ee(e)]);export{Ke as a,De as b,oe as c,Te as d,Ve as e};
|
|
1
|
+
import{c as Q}from"./KYANIEPX.js";import{b as X}from"./5AO2QPWE.js";import{b as Z}from"./EYE3ZAJB.js";import{i as ee}from"./AG66NM3J.js";import{a as Y}from"./2QQ5CGQI.js";import{b as z}from"./B7HVPHSS.js";import{a as D,b as k,c as R,d as N,g as V,h as I,k as _,l as x,n as B,p as W,r as $,s as U,t as q,v as E,x as J,y as G}from"./BIFANUTV.js";import{a as y}from"./X5V2Z2NM.js";import{b as K}from"./SPJCSEKP.js";import{a as O}from"./43LI5NKJ.js";import{c as L,e as T,g as w}from"./NWNYJ26T.js";import{a as g,d as j}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{Buffer as te}from"node:buffer";import{decodeEventLog as re,encodeFunctionData as H,getAddress as se,hexToString as de,parseAbiItem as ce,toEventSelector as ie}from"viem";var Ke={register:"erc8004_register"},ge="Oak now always adds the public oak.registrar marker when it registers an agent, so tag: false and --no-tag are no longer available. Remove the option and register again. To use an agent ID you already own without the marker, link it with oak setup link <agentId>.",fe="The registration went through, but Oak could not find its oak.registrar marker on Robinhood Chain. Nothing else was sent. Ask me to check the agent with erc8004_identity.",le="One transaction registers your agent and writes the public marker oak.registrar = oak. Anyone can see on Robinhood Chain that this agent was registered through Oak. The marker is self-reported, not proof of anything, and the transaction stays in the public history even if the marker is changed later. It needs gas.",F="https://eips.ethereum.org/EIPS/eip-8004#registration-v1",ue={type:"object",required:["type","name","description","image","services","x402Support","active","registrations"],properties:{type:{const:F,description:"ERC-8004 registration-v1 profile type URI."},name:{type:"string",minLength:1,description:"Short public name for the agent."},description:{type:"string",description:"Public text describing what the agent does; may be empty."},image:{type:"string",description:"Public HTTPS or IPFS image URI without credentials."},services:{type:"array",items:{type:"object",required:["name","endpoint"]},description:"Service endpoint objects with name and endpoint; use an empty list for none."},x402Support:{type:"boolean",description:"Whether the agent supports x402 payments."},active:{type:"boolean",description:"Whether this agent is active."},registrations:{type:"array",description:"Registry references with agentRegistry and agentId; leave empty before first registration."},tags:{type:"array",items:{type:"string"},description:"Optional public text labels for the agent."},supportedTrust:{type:"array",items:{type:"string"},description:"Optional trust mechanism labels supported by the agent."}}};function pe(e){if(typeof e!="string"||!e.trim())return!1;try{let t=new URL(e);return["https:","ipfs:"].includes(t.protocol)&&!!t.hostname&&!t.username&&!t.password}catch{return!1}}var me=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"&&t.trim()),he=e=>e.replace(/\.$/,"");function ye(e,t,a,n){let{registryId:d}=I(e);if(!T(t))throw new g("Provide a registration-v1 profile object.");if(a!==void 0&&typeof a!="boolean")throw new g("The tag option must be a boolean.");let o=[],r=(i,c)=>o.push(`${i}: ${c}`);t.type!==F&&r("type",`use "${F}"`),(typeof t.name!="string"||!t.name.trim())&&r("name",'a short name for your agent, such as "Oak Agent 1"'),typeof t.description!="string"&&r("description","a sentence about what your agent does (it may be empty text)"),pe(t.image)||r("image","an HTTPS or IPFS link to a picture, with no username or password in it"),typeof t.active!="boolean"&&r("active","true or false"),typeof t.x402Support!="boolean"&&r("x402Support","true or false"),Array.isArray(t.services)?t.services.forEach((i,c)=>{try{Z(i)}catch(p){if(!(p instanceof g))throw p;r(`services item ${c+1}`,he(p.message))}}):r("services","a list of endpoints, or [] for none");for(let i of["tags","supportedTrust"])t[i]!==void 0&&!me(t[i])&&r(i,"a list of nonempty text labels, or leave it out");if(Array.isArray(t.registrations)?t.registrations.forEach((i,c)=>{let p=`registrations item ${c+1}`;if(!T(i)||typeof i.agentRegistry!="string"||!/^eip155:[1-9][0-9]*:0x[0-9a-fA-F]{40}$/.test(i.agentRegistry))return r(p,"an agentRegistry such as eip155:4663:0x\u2026 and its agentId");let f=typeof i.agentId=="number"&&Number.isSafeInteger(i.agentId)?String(i.agentId):i.agentId,b;try{b=x(f)}catch{return r(p,'an agentId as a whole number, such as "1"')}w(i.agentRegistry,d)&&(n===void 0?r(p,"remove the entry for this registry; its ID comes from the mined Registered receipt, and erc8004_update adds it afterwards"):b!==n&&r(p,`the agentId does not match the agent being updated; use "${n}" or remove the entry`))}):r("registrations","a list, or [] before the first registration"),o.length)throw new g(`This profile needs: ${o.join("; ")}. Fix all of these and try again.`);let u=t.registrations.map(i=>({...i}));n!==void 0&&!u.some(i=>w(i.agentRegistry,d))&&u.push({agentId:n.toString(),agentRegistry:d});let s=[...new Set((t.tags??[]).filter(i=>i!==k))];a!==!1&&s.push(k);let m={...t,registrations:u,...s.length?{tags:s}:{}};s.length||delete m.tags;let l;try{if(l=JSON.stringify(m),te.byteLength(l)>65536)throw new Error;JSON.parse(l)}catch{throw new g("Profile must be JSON data no larger than 64 KiB.")}return`data:application/json;base64,${te.from(l,"utf8").toString("base64")}`}async function M(e,t){try{let{chainId:a,registry:n}=I(e),d=x(t),o=e.clientFor(a),r=await o.readContract({address:n,abi:y,functionName:"ownerOf",args:[d]}).catch(l=>{throw j(l)?new g(`Agent ${d} does not exist in this ERC-8004 registry: the owner lookup reverted. Check the agent ID.`):l});O(r);let[u,s,m]=await Promise.all([o.readContract({address:n,abi:y,functionName:"tokenURI",args:[d]}),o.readContract({address:n,abi:y,functionName:"getAgentWallet",args:[d]}),o.readContract({address:n,abi:y,functionName:"getMetadata",args:[d,k]})]);if(O(s),typeof u!="string"||typeof m!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(m))throw new g("The registry returned invalid identity data.");return{agentId:d.toString(),chainId:a,registry:n,owner:r,uri:u,agentWallet:s,registrarMetadata:m,registryValidated:!1,summary:D}}catch(a){throw new g(e.plainError(a))}}async function De(e,t){let a=await M(e,t);return{...a,uri:A(a.uri)}}async function we(e,t,a,n,d,o){let{registry:r}=I(e),u=await E(e,t,a,d),s=o===void 0?"Registered":"URIUpdated",m=ie(o===void 0?"Registered(uint256,string,address)":"URIUpdated(uint256,string,address)"),l=u.logs.filter(v=>w(v.address,r)&&v.topics[0]===m&&!v.removed);if(l.length!==1)throw new g(`The receipt must contain one matching ${s} event.`);let i=l[0],c=re({abi:y,eventName:s,topics:i.topics,data:i.data,strict:!0}),p=c.args.agentId,f=c.eventName==="Registered"?c.args.agentURI:c.args.newURI,b=c.eventName==="Registered"?c.args.owner:c.args.updatedBy;if(o!==void 0&&p!==o||f!==n||!w(b,a))throw new g("The registry event does not match the expected agent, URI and wallet.");let h=await M(e,p.toString());if(h.uri!==n||o===void 0&&!w(h.owner,a))throw new g("The current agent owner or URI does not match the confirmed operation.");return h}function be(e,t){let{chainId:a,registry:n}=I(e);return e.unsignedTx({to:n,chainId:a,value:"0",data:H({abi:y,functionName:"setMetadata",args:[t,k,R]}),description:`Set mutable oak.registrar metadata to oak for agent ${t}.`})}async function ae(e,t,a,n){let{registry:d}=I(e),o=x(n.agentId),r=await E(e,t,a,H({abi:y,functionName:"setMetadata",args:[o,k,R]})),u=ie("MetadataSet(uint256,string,string,bytes)"),s=r.logs.filter(c=>w(c.address,d)&&c.topics[0]===u&&!c.removed);if(s.length!==1)throw new g("The receipt must contain one matching MetadataSet event.");let m=s[0],{args:l}=re({abi:y,eventName:"MetadataSet",topics:m.topics,data:m.data,strict:!0});if(l.agentId!==o||l.metadataKey!==k||l.metadataValue!==R)throw new g("The metadata event does not match this agent and registrar marker.");let i=await M(e,n.agentId);if(i.registrarMetadata!==R||i.uri!==n.uri||!w(i.owner,n.owner))throw new g("The current agent metadata, owner or URI does not match the confirmed operation.");return i}async function ke(e,t){let{chainId:a,registry:n}=I(e),d=e.clientFor(a),o=await d.readContract({address:n,abi:y,functionName:"balanceOf",args:[t]});if(o===0n)return;if(typeof o!="bigint"||o<0n)throw new g("Registry balance is unavailable; registration was not built.");let r=await d.getBlockNumber({cacheTime:0}),u=new Set;for(;;){let s=r>9999999n?r-9999999n:0n,m=await d.getLogs({address:n,event:ce("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:t},fromBlock:s,toBlock:r,strict:!0});for(let l of m){let i=l.args.tokenId.toString();if(l.removed||u.has(i))continue;u.add(i);let c=await M(e,i);if(w(c.owner,t))return c}if(s===0n)throw new g("Owned identity could not be located; registration was not built. Run oak setup link <agentId>.");r=s-1n}}function Ie(e){if(e===void 0)return[];if(!Array.isArray(e)||e.length>15)throw new g("Provide at most 15 user metadata entries as { key, value } with value as 0x hex or text.");let t=new Set;return e.map(a=>{if(!T(a))throw new g("Provide each metadata entry as { key, value } or { key, text }.");let n=J(a.key);if(n===k)throw new g("The key oak.registrar is reserved for the registration marker. Remove that metadata entry.");if(t.has(n))throw new g(`Metadata key ${A(n)} is repeated.`);return t.add(n),{metadataKey:n,metadataValue:G(a)}})}function oe(e,t,a){let n=$(t);if(!n)return;let{registryId:d}=I(e);return Array.isArray(n.registrations)&&n.registrations.some(o=>T(o)&&typeof o.agentRegistry=="string"&&w(o.agentRegistry,d)&&String(o.agentId)===a.toString())}function ve(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 ne(e,t,a,n){let{chainId:d,registry:o}=I(e);O(n),B(e,a.chainId);let r=t?x(a.agentId):void 0;if(!t&&(a.tag===!1||a.noTag!==void 0||a["--no-tag"]!==void 0))throw new g(ge);if(a.tag!==void 0&&typeof a.tag!="boolean")throw new g("The tag option must be a boolean.");let s=!t&&a.profile===void 0?"":ye(e,a.profile,a.tag,r),m=t?[]:Ie(a.metadata),l=a.tag!==!1;if(t&&a.metadataTransactionHash!==void 0&&(!l||a.transactionHash===void 0))throw new g("A metadata transaction hash requires tagging and the profile transaction hash.");let i=r!==void 0?H({abi:y,functionName:"setAgentURI",args:[r,s]}):H({abi:y,functionName:"register",args:[s,[...m,{metadataKey:k,metadataValue:R}]]}),c=f=>r===void 0?ve(e,f,a.profile):f;if(a.transactionHash!==void 0){let f=await we(e,a.transactionHash,n,s,i,r);if(!t){if(!w(f.registrarMetadata,R))throw new g(fe);if(a.metadataTransactionHash!==void 0)throw new g("Registration already writes oak.registrar in one transaction. Omit metadataTransactionHash.");return c(f)}return l&&a.metadataTransactionHash!==void 0?c(await ae(e,a.metadataTransactionHash,n,f)):c(f)}if(!t){let f=await ke(e,n);if(f){let b={...f,registrationResumed:!0},h=$(f.uri),v=Array.isArray(h?.tags)&&h.tags.includes(k);if(a.metadataTransactionHash!==void 0){if(!v)throw new g("Only a legacy Oak profile can resume its registrar metadata. Link this agent with oak setup link <agentId>.");return c({...await ae(e,a.metadataTransactionHash,n,f),registrationResumed:!0})}if(!v||f.registrarMetadata!=="0x")return c(b);let S=await U(e,[be(e,x(f.agentId))],n,`Resume registrar metadata for legacy Oak agent ${f.agentId}; no new identity will be minted. Submit locally, then repeat these arguments with metadataTransactionHash to verify the marker receipt.`);return{...b,...S}}if(a.metadataTransactionHash!==void 0)throw new g("No owned legacy Oak identity was found; no metadata transaction was built.")}r!==void 0&&await q(e,r,n);let p=[e.unsignedTx({to:o,data:i,value:"0",chainId:d,description:r===void 0?"Register an ERC-8004 agent profile.":`Update ERC-8004 agent ${r} profile.`})];return t?U(e,p,n,"Submit locally, then repeat the original arguments with transactionHash to verify the profile receipt and URI. The tag option changes the profile tag only; existing onchain metadata is unchanged."):U(e,p,n,`${le} Submit locally, then repeat the original arguments with transactionHash to verify the registration receipt, URI and marker. Update the profile registrations with the mined ID afterward.`)}async function Re(e,t){let a=await M(e,t.agentId),{chainId:n,registry:d}=I(e),o=e.clientFor(n),r=BigInt(a.agentId),u=t.metadataKeys===void 0?[]:(()=>{if(!Array.isArray(t.metadataKeys)||t.metadataKeys.length>16)throw new g("Provide at most 16 metadata keys.");return t.metadataKeys.map(h=>W(h,"metadata key",128,!1))})(),s=t.operator===void 0?void 0:se(String(t.operator)),[m,l,...i]=await Promise.allSettled([o.readContract({address:d,abi:y,functionName:"getApproved",args:[r]}),s?o.readContract({address:d,abi:y,functionName:"isApprovedForAll",args:[a.owner,s]}):Promise.resolve(void 0),...u.map(h=>o.readContract({address:d,abi:y,functionName:"getMetadata",args:[r,h]}))]),c=h=>h.status==="fulfilled"?h.value:void 0,p=c(m),f=_(a.agentWallet)?"unset":w(a.agentWallet,a.owner)?"owner":"verified-other",b=oe(e,a.uri,r);return{...a,approved:typeof p=="string"&&_(p)?null:p??"unavailable",...s?{operator:s,operatorApproved:c(l)??"unavailable"}:{},walletState:f,walletNote:f==="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.":f==="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:b??null,fetched:!1,note:b===void 0?"The URI is external or not decodable; Oak does not fetch it.":void 0},...u.length?{metadata:Object.fromEntries(u.map((h,v)=>{let S=c(i[v]),P=typeof S=="string"&&/^0x([0-9a-fA-F]{2})*$/.test(S)?S:void 0,C;if(P&&P!=="0x")try{C=A(de(P))}catch{C=void 0}return[A(h),{hex:P??"unavailable",...C?{text:C}:{}}]}))}:{}}}var Ae={type:"object",additionalProperties:!1,required:["key"],properties:{key:{type:"string",minLength:1,maxLength:128,description:"Metadata key; agentWallet and oak.registrar are reserved during registration."},value:{...V,description:"Metadata bytes as 0x-prefixed hex; provide value or text."},text:{type:"string",description:"Metadata as UTF-8 text; provide text or value."}}},Te=e=>{let t=(n,d,o)=>({name:n,inputSchema:d,execute:async(r,u)=>{try{let s=await o(r,u);return T(s)&&typeof s.uri=="string"?{...s,uri:A(s.uri)}:s}catch(s){throw new g(e.plainError(s))}}}),a=n=>({type:"object",additionalProperties:!1,required:n?["agentId","profile"]:[],properties:{profile:{...ue,description:n?"Registration-v1 profile object to publish for this agent.":"Omit for an empty URI; register(uri, metadata[]) still writes the public oak.registrar marker. Attach a profile later with erc8004_update."},tag:{type:"boolean",default:!0,description:n?"Set false to remove the profile tag. Profile updates leave existing onchain metadata unchanged.":"Accepted only as true. Oak always adds the oak.registrar marker when it registers."},transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Verify the exact profile transaction, event and URI.":"After local submission, verify exact registration calldata, event, URI and oak.registrar marker."},metadataTransactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Optional legacy metadata transaction hash, supplied with transactionHash to verify a previously sent two-transaction update.":"Only for a resumed legacy Oak profile: verify its separate metadata transaction without transactionHash."},...n?{agentId:N}:{noTag:{type:"boolean",description:"Removed option: omit it and register again."},"--no-tag":{type:"boolean",description:"Removed option: omit it and register again."},metadata:{type:"array",maxItems:15,items:Ae,description:"Up to 15 user entries plus the mandatory oak.registrar marker. The keys agentWallet and oak.registrar are reserved."}}}});return{tools:[t("erc8004_register",a(!1),(n,d)=>ne(e,!1,n,d)),t("erc8004_update",a(!0),(n,d)=>ne(e,!0,n,d)),t("erc8004_identity",{type:"object",additionalProperties:!1,required:["agentId"],properties:{agentId:N,metadataKeys:{type:"array",maxItems:16,items:{type:"string",minLength:1,maxLength:128},description:"Also read these onchain metadata keys."},operator:{...L,description:"Also report whether this address is approved for all of the owner's agents."}}},n=>Re(e,n))]}},Ve=e=>K("erc8004",[Te(e),Q(e),X(e),Y(e),z(e),ee(e)]);export{Ke as a,De as b,oe as c,Te as d,Ve as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as t}from"./342OZP53.js";import{c as o}from"./5PNFV7HH.js";function s(e,n,a){return t(e,n,a,o)}export{s as a};
|