@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./XSD5NL7J.js";var u="0x856bb126188bDB5e425D3ac9D59E9ffBD12e6ECf",r=4663,d=46630,p=18,h=6,A=30,v="recipient",x="direct",P="totalSupply",o={4663:{layerbank:{pool:{address:"0x433e21dC2BF027910B1635653c2Eb630bC7dAD43",source:"https://docs.layerbank.finance/",pointer:"/robinhood/pool",block:null,blockKind:"read"},aToken:{address:"0xAd9b5C0ea95Cf998C1A31Aaa8aC7a24de94BeE69",source:"https://docs.layerbank.finance/",pointer:"/robinhood/USDG/aToken",block:null,blockKind:"read"}},pendle:{router:{address:"0x888888888889758F76e7103c6CbF23ABbF58F946",source:"https://docs.pendle.finance/",pointer:"/4663/router",block:null,blockKind:"read"},marketFactory:{address:"0x544BF81c855AE84c1e8b65d5E38770898D01EeE2",source:"https://docs.pendle.finance/",pointer:"/4663/marketFactory",block:null,blockKind:"read"}},pons:{factory:{address:"0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e",source:"Recorded chain and API observations",pointer:"/pons/factory",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},launchAndBuyRouter:{address:"0xe33E9E479dF8802cb0866d5d05258bEc4cF62948",source:"Recorded chain and API observations",pointer:"/pons/launchAndBuyRouter",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},memeHook:{address:"0xE5e702641Ea86F4ae6cC3cDaeD2B886f976Be044",source:"Recorded chain and API observations",pointer:"/pons/memeHook",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},feeEscrow:{address:"0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9e",source:"Recorded chain and API observations",pointer:"/pons/feeEscrow",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},buybackVault:{address:"0x42df2a798f82289E177311362e8f5ccC45c1219c",source:"Recorded chain and API observations",pointer:"/pons/buybackVault",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},locker:{address:"0x267444D099b10fB5Ed7c3Cc7B7c767AdcA574952",source:"Recorded chain and API observations",pointer:"/pons/locker",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},launchDeployer:{address:"0x3711ceA4feaDE896C913C68F01Eda97Cb06D1A42",source:"Recorded chain and API observations",pointer:"/pons/launchDeployer",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},graduationExecutor:{address:"0xC7819B64A1dAECD7eC19856d026cb14EfBd89046",source:"Recorded chain and API observations",pointer:"/pons/graduationExecutor",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},graduationGuard:{address:"0xf5695117b99B6f6401e67d4195BD653628176C6C",source:"Recorded chain and API observations",pointer:"/pons/graduationGuard",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},poolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/pons/poolManager",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"},positionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/pons/positionManager",block:"100307770",blockKind:"read",blockPointer:"/pinnedBlocks/ponsReads"}},oracle:{ethUsdgPool:{address:"0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca",source:"Recorded chain and API observations",pointer:"/ethUsdgPool/address",block:"100307735",blockKind:"read",blockPointer:"/ethUsdgPool/rawReading/block"}},tokens:{USDG:{address:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",source:"Recorded chain and API observations",pointer:"/usdg/address",block:null,blockKind:"latest",caveat:"Token reads around head 100305826; not individually pinned (Part B section 1.2)."},WETH:{address:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",source:"Recorded chain and API observations",pointer:"/routers/wrappedNative",block:null,blockKind:"latest"}},routes:{kyberswap:{address:"0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",source:"Recorded chain and API observations",pointer:"/routers/kyberswap/router",block:null,blockKind:"latest",caveat:"Historical API target; validate each fresh quote/build chain and target."},velora:{address:"0x6a000f20005980200259b80c5102003040001068",source:"Recorded chain and API observations",pointer:"/routers/velora/router",block:null,blockKind:"latest",caveat:"Historical API target; validate each fresh quote/build chain and target."}},ponsClaims:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",source:"Recorded chain and API observations",pointer:"/addresses/multicall3/address",block:null,blockKind:"unanchored",caveat:"Code present in the source snapshot; exact code-read block not recorded."}},ponsTrade:{universal_router:{address:"0x204faca1764b154221e35c0d20abb3c525710498",source:"Recorded chain and API observations",pointer:"/contracts/universal_router/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},pool_manager:{address:"0x8366a39cc670b4001a1121b8f6a443a643e40951",source:"Recorded chain and API observations",pointer:"/contracts/pool_manager/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},state_view:{address:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",source:"Recorded chain and API observations",pointer:"/contracts/state_view/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},quoter:{address:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",source:"Recorded chain and API observations",pointer:"/contracts/quoter/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"},permit2:{address:"0x000000000022d473030f116ddee9f6b43ac78ba3",source:"Recorded chain and API observations",pointer:"/contracts/permit2/address",block:"100372649",blockKind:"read",blockPointer:"/limitations/0"}},uniswap:{v3_factory:{address:"0x1f7d7550b1b028f7571e69a784071f0205fd2efa",source:"Recorded chain and API observations",pointer:"/addresses/v3_factory/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},v3_position_manager:{address:"0x73991a25c818bf1f1128deaab1492d45638de0d3",source:"Recorded chain and API observations",pointer:"/addresses/v3_position_manager/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},v4_pool_manager:{address:"0x8366a39cc670b4001a1121b8f6a443a643e40951",source:"Recorded chain and API observations",pointer:"/addresses/v4_pool_manager/address",block:"100363029",blockKind:"snapshot",blockPointer:"/snapshots/v4_block"},v4_position_manager:{address:"0x58daec3116aae6d93017baaea7749052e8a04fa7",source:"Recorded chain and API observations",pointer:"/addresses/v4_position_manager/address",block:"100363029",blockKind:"snapshot",blockPointer:"/snapshots/v4_block"},v4_state_view:{address:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",source:"Recorded chain and API observations",pointer:"/addresses/v4_state_view/address",block:"100363029",blockKind:"snapshot",blockPointer:"/snapshots/v4_block"},swap_router02:{address:"0xcaf681a66d020601342297493863e78c959e5cb2",source:"Recorded chain and API observations",pointer:"/addresses/swap_router02/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},permit2:{address:"0x000000000022d473030f116ddee9f6b43ac78ba3",source:"Recorded chain and API observations",pointer:"/addresses/permit2/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},WETH:{address:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",source:"Recorded chain and API observations",pointer:"/addresses/WETH/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"},USDG:{address:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",source:"Recorded chain and API observations",pointer:"/addresses/USDG/address",block:"100361663",blockKind:"snapshot",blockPointer:"/snapshots/v3_block/number"}},clanker:{factory:{address:"0xD3f2cC1731b7Fd17f28798835C2E02f0a1839A94",source:"Recorded chain and API observations",pointer:"/contracts/factory/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},locker:{address:"0xE4910b09709423aFafD995dD76D8A81CF9134A09",source:"Recorded chain and API observations",pointer:"/contracts/locker/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},legacy_locker_v1:{address:"0x290f735f63824bb5836cde24a35f5103a5b5bc99",source:"Recorded chain and API observations",pointer:"/contracts/legacy_locker_v1/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},fee_locker:{address:"0x88db2340bE5991B2b5Fca2Baee39B5CE048Cd70c",source:"Recorded chain and API observations",pointer:"/contracts/fee_locker/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},fee_static_hook_v2:{address:"0x48B8F6AD3A1b4aA477314c9a23035b8F84dDe8cc",source:"Recorded chain and API observations",pointer:"/contracts/fee_static_hook_v2/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},fee_dynamic_hook_v2:{address:"0x65efDF8Cce99b53C925DF878Df275Df21cB6E8Cc",source:"Recorded chain and API observations",pointer:"/contracts/fee_dynamic_hook_v2/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},mev_module:{address:"0xEA1Fe197dF140e5d88fC6B49f2d21Ea05092299e",source:"Recorded chain and API observations",pointer:"/contracts/mev_module/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},devbuy:{address:"0xa27b1986e5c7e5371Cb6507f87918fBD0302fF5a",source:"Recorded chain and API observations",pointer:"/contracts/devbuy/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},vault:{address:"0x99B2a80ed21c7af1F5cc1A97383DADeEC7DD1427",source:"Recorded chain and API observations",pointer:"/contracts/vault/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},airdrop:{address:"0x6f27372FF493A3855E6746b9a4fe6Ed2Cc3034B5",source:"Recorded chain and API observations",pointer:"/contracts/airdrop/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},paired_weth:{address:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",source:"Recorded chain and API observations",pointer:"/contracts/paired_weth/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"}},clankerDependencies:{pool_manager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/pool_manager/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},position_manager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/position_manager/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},universal_router:{address:"0x53BF6B0684Ec7eF91e1387Da3D1a1769bC5A6F77",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/universal_router/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"},permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Recorded chain and API observations",pointer:"/contracts/uniswap_v4_dependencies/permit2/address",block:"100375756",blockKind:"fork",blockPointer:"/chain/fork_block_number"}},hoodag:{market:{address:"0xd37C9f7D1a59bceB2BDa47325f14f5789f1176a1",source:"packages/core/test/modules/hoodag/fixtures.json (U5a read-only SIM)",pointer:"/referralRateProbe/market/address",blockPointer:"/referralRateProbe/blockNumber",block:"108260235",blockKind:"read"},registry:{address:"0x3E717dc89AAF4605b607324329EEeB0a8B3C8A1c",source:"Recorded chain and API observations",pointer:"/contracts/registry/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},universalResolver:{address:"0xa9ed3C73F522875F18DAa631429125da893D8E53",source:"Recorded chain and API observations",pointer:"/contracts/universalResolver/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},registrar:{address:"0x9a122C54e15B6287c164b90833bcDA6E16520D50",source:"Recorded chain and API observations",pointer:"/contracts/registrar/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},publicResolver:{address:"0x072C7a66a6D52B23274470b86096AFCBF816CA0B",source:"Recorded chain and API observations",pointer:"/contracts/publicResolver/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},registrarController:{address:"0x7900b2B8Cc3f0616B18C68AdA7E115A9022Ca04a",source:"Recorded chain and API observations",pointer:"/contracts/registrarController/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"},reverseRegistrar:{address:"0x4be6D0379f56404B563afAe17c6b095b1dfcf479",source:"Recorded chain and API observations",pointer:"/contracts/reverseRegistrar/address",block:null,blockKind:"range",blockPointer:"/measuredBlockRange"}},hoodlock:{locker:{address:"0xd0f7d8c6e9f6d80c297bebe4f7fd1b9c8125c32f",source:"Recorded chain and API observations",pointer:"/contracts/locker/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"},burner:{address:"0x6bf43ca706faa8ea46803299c191484e82280652",source:"Recorded chain and API observations",pointer:"/contracts/burner/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"},airdrop:{address:"0x6B1fE7b821001144Ee74EEA258b0AafdE20102E8",source:"Recorded chain and API observations",pointer:"/contracts/airdrop/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"},liquidityLocker:{address:"0x91Aa2dA1956C77F8448E18DCaf53383bCc658e67",source:"Recorded chain and API observations",pointer:"/contracts/liquidityLocker/address",block:"100356379",blockKind:"read",blockPointer:"/chain/liveStateBlock"}},hookrLauncherV1:{launcherV1:{address:"0x70a66ADF39B5c9FfEE4A9F081C182edfbb7DBD0C",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/launcherV1",block:"104346779",blockKind:"read"},rootV1:{address:"0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/rootV1",block:"104346779",blockKind:"read"},rulesV1:{address:"0x342bAA22e202954593b04B7eD1663621E0565d46",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/rulesV1",block:"104346779",blockKind:"read"},agentGateV1:{address:"0x3b1aC66a6Fd9e9d8F063d145003cf29eac4Fb0C9",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/agentGateV1",block:"104346779",blockKind:"read"},agentGateV2:{address:"0xF95e6c8eEdA88b4D8Dfd43A087D153059A5107b0",source:"Hookr commit dd675a2 and public named-block runtime read",pointer:"Hookr runtime pins#/roles/agentGateV2",block:"111518773",blockKind:"read"},recaptureExecutor:{address:"0x4B4c16681401454140a9dBca55e5c186BBE8D728",source:"Public named-block runtime read; source not public",pointer:"Hookr runtime pins#/roles/recaptureExecutor",block:"111518773",blockKind:"read"},familyRouterV1:{address:"0xbc56F48f873841d26a5a02575263d82f68e12864",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/familyRouterV1",block:"104346779",blockKind:"read"},familyLockV1:{address:"0x5248AF9139DaDEf0C5296342b7BE441deDf0adC2",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/familyLockV1",block:"104346779",blockKind:"read"},poolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/poolManager",block:"104346779",blockKind:"read"},positionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/positionManager",block:"104346779",blockKind:"read"},permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/permit2",block:"104346779",blockKind:"read"},registry:{address:"0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/registry",block:"104346779",blockKind:"read"},router:{address:"0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/router",block:"104346779",blockKind:"read"},identity:{address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/identity",block:"104346779",blockKind:"read"},reputation:{address:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",source:"Hookr verified sources and named-block runtime reads",pointer:"ops/growth/hookr-launch-lp-2026-11/DESIGN.md#deployments-and-release-boundaries/reputation",block:"104346779",blockKind:"read"}},hookr:{HookrLimitOrders:{address:"0x0c376cc30b1AC98b8ef80a4F516212D3B99402fA",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrLimitOrders/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRoot:{address:"0x89c9FB50d1f03192230FFB1c279BB6E7d3Fe6aCc",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRoot/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRouter:{address:"0xC2Bc9a3fe6c4Ce8C2F7EB4655b0869b01D8c93C9",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRouter/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrQuoter:{address:"0x445D7891381Aa7F91F5048EdBC6a611ccBDe7865",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrQuoter/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrLauncher:{address:"0x1cf2748A6670572425eAbf9Ab9e5BC4eb2eB8Ef4",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrLauncher/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRules:{address:"0x4a71c270b1520F94064268102AebD744b0DE7942",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRules/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRegistry:{address:"0x463c82beA1a52F4Cc05ca0741a24F0AD24bA4602",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRegistry/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrTreasury:{address:"0x2242F7FC75606500503075f29ea8cDA684EfB4a9",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrTreasury/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrForwarder:{address:"0xe7863CC0E2Fb783b44c279aB159bcD812c2ceA1c",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrForwarder/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrOwnedRootFactory:{address:"0xA6c2a401597301dFf57A59bC8F70a9622499f3ec",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrOwnedRootFactory/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrRootFactory:{address:"0x21E438FaBE10770afb4407cF6b09d32369CBdCE4",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrRootFactory/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrFamilyRouter:{address:"0x854f3Fa7AC342B244DF0d9A8c8F597b051aAE559",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrFamilyRouter/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HookrFamilyLock:{address:"0xfAFEcE64099C1E791C4B46189c277f00c0c7e00b",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HookrFamilyLock/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},PoolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/PoolManager/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"},HOOKR_Token:{address:"0x18E674231A58c239Dc7DaeDcffE15Ec3A24cff5c",source:"Recorded chain and API observations",pointer:"/q1_liveness/contracts/HOOKR_Token/address",block:"100371423",blockKind:"fork",blockPointer:"/fork_block_number"}},merkl:{distributor:{address:"0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae",source:"Recorded chain and API observations",pointer:"/contracts/distributor/address",block:null,blockKind:"latest"},distributionCreator:{address:"0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd",source:"Recorded chain and API observations",pointer:"/contracts/distributionCreator/address",block:null,blockKind:"latest"},accessControlManager:{address:"0x5D36e13F076f34eE2Bf69fEAEa784887754465f8",source:"Recorded chain and API observations",pointer:"/contracts/accessControlManager/address",block:null,blockKind:"latest"}},poolsTrade:{liquidityLauncher:{address:"0x0000FffFBE8efE702c8703aE3477FF5dE3d319C0",source:"Recorded chain and API observations",pointer:"/contracts/liquidityLauncher/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},instantLaunchStrategyFeesOn:{address:"0x7c48DDe3B447381F4d986334679b3Afc7F2D35C2",source:"Recorded chain and API observations",pointer:"/contracts/instantLaunchStrategyFeesOn/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},instantLaunchStrategyFeesOff:{address:"0xC9566675b1Ea42861546f3c5B74Ace2c79c49572",source:"Recorded chain and API observations",pointer:"/contracts/instantLaunchStrategyFeesOff/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},feeSplitterFeesOn:{address:"0x9411fa7F956f64aa7981AA27cB3bC6eC0415449C",source:"Recorded chain and API observations",pointer:"/contracts/feeSplitterFeesOn/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},feeSplitterFeesOff:{address:"0x882Ae5e2095435A62Fd1BBDEfcb637f5CeAFc0ee",source:"Recorded chain and API observations",pointer:"/contracts/feeSplitterFeesOff/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},uerc20BeneficiaryVault:{address:"0x26d2F7AcB07707034406a0dC458351Bb63C02553",source:"Recorded chain and API observations",pointer:"/contracts/uerc20BeneficiaryVault/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},compoundingClaimRecipient:{address:"0xf585b5D728A8fdE743027307BF5F3556E3B9C58D",source:"Recorded chain and API observations",pointer:"/contracts/compoundingClaimRecipient/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},universalRouterStrategyApp:{address:"0x1242c9439d589cAE85E121B1f79f2aF51e91DCEE",source:"Recorded chain and API observations",pointer:"/contracts/universalRouterStrategyApp/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},uerc20Factory:{address:"0x000000e200088D55C39a11F609E5F667729ad49b",source:"Recorded chain and API observations",pointer:"/contracts/uerc20Factory/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},universalRouter:{address:"0x8876789976dEcBfCbBbe364623C63652db8C0904",source:"Recorded chain and API observations",pointer:"/contracts/universalRouter/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},v4PoolManager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/contracts/v4PoolManager/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},v4PositionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/contracts/v4PositionManager/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Recorded chain and API observations",pointer:"/contracts/permit2/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},v4Quoter:{address:"0x8Dc178eFB8111BB0973Dd9d722ebeFF267c98F94",source:"Recorded chain and API observations",pointer:"/contracts/v4Quoter/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"},protocolFeeController:{address:"0x6d0009504D129CF5002Dba61D9Ae8575AA79314c",source:"Recorded chain and API observations",pointer:"/contracts/protocolFeeController/address",block:"100369897",blockKind:"census",blockPointer:"/chain/headAtFirstCensus"}},priors:{pool:{address:"0x281210097f0de7A8FB6F87310AF0f089c9C8DE21",source:"Recorded chain and API observations",pointer:"/contracts/pool/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},lens:{address:"0x9d7035722bd42C551f82FEB9FDDd17453AEF3D9B",source:"Recorded chain and API observations",pointer:"/contracts/lens/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},usdg:{address:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",source:"Recorded chain and API observations",pointer:"/contracts/usdg/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},registry:{address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",source:"Recorded chain and API observations",pointer:"/contracts/registry/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"},stockVault:{address:"0xbEcd07EC689988e16b870C121756C4c2C8cb02B6",source:"Recorded chain and API observations",pointer:"/contracts/stockVault/address",block:null,blockKind:"latest",blockPointer:"/recorded-calls/8"}},morpho:{morpho_blue:{address:"0x9D53d5E3bd5E8d4Cbfa6DB1ca238AEA02E651010",source:"Recorded chain and API observations",pointer:"/addresses/morpho_blue/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"},adaptive_curve_irm:{address:"0x2BD3d5965B26B51814AC95127B2b80dD6CcC0fa1",source:"Recorded chain and API observations",pointer:"/addresses/adaptive_curve_irm/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"},USDG:{address:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",source:"Recorded chain and API observations",pointer:"/addresses/USDG/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"},WETH:{address:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",source:"Recorded chain and API observations",pointer:"/addresses/WETH/address",block:"100362239",blockKind:"read",blockPointer:"/chain/read_block"}},tickerSpring:{limitOrderHook:{address:"0xa31729621a2280C0Ff9Aaff5B3F357cFF1bEC040",source:"Recorded chain and API observations",pointer:"/liveness/contracts/limitOrderHook/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},gridStrategy:{address:"0xd597785134307B5324f469A9506066fAd4827730",source:"Recorded chain and API observations",pointer:"/liveness/contracts/gridStrategy/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},ladderStrategy:{address:"0x23c7906D8fa3ede698A00AbE66D28605A41b4177",source:"Recorded chain and API observations",pointer:"/liveness/contracts/ladderStrategy/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},basketZap:{address:"0xFca65c50325b83F8f1E07cD103c00De0cEa4Fb39",source:"Recorded chain and API observations",pointer:"/liveness/contracts/basketZap/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"},usdg:{address:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",source:"Recorded chain and API observations",pointer:"/liveness/contracts/usdg/address",block:null,blockKind:"range",blockPointer:"/chain/verifiedAtBlockRange"}},orbio:{credit:{address:"0xe33322da1380e61e5ae5dfb21e7f62924c73004c",source:"Recorded chain and API observations",pointer:"/orbio/credit/address",block:"100313751",blockKind:"fork",caveat:"Fork anchor block recorded from chain observations; individual code reads were latest."},exchange:{address:"0x6951ffd32630b05e06f50062aea801625a58ebc0",source:"Recorded chain and API observations",pointer:"/orbio/exchange/address",block:"100313751",blockKind:"fork",caveat:"Fork anchor block recorded from chain observations; individual code reads were latest."}},vaults:{steakhouse:{address:"0xBeEff033F34C046626B8D0A041844C5d1A5409dd",source:"Recorded chain and API observations",pointer:"/vaults/eligible/0/address",block:"100320900",blockKind:"read",blockPointer:"/vaults/verifiedAtBlock",caveat:"Historical eligibility only; recheck asset and >=1e12 USDG totalAssets on every listing."},spark:{address:"0xde770c84fe66e063336b31737cfe9790f18c4087",source:"Recorded chain and API observations",pointer:"/vaults/eligible/1/address",block:"100320900",blockKind:"read",blockPointer:"/vaults/verifiedAtBlock",caveat:"Historical eligibility only; recheck asset and >=1e12 USDG totalAssets on every listing."},netnet:{address:"0x99347d5F70D3838763f6Bddcf80304C8aa953B57",source:"Recorded chain and API observations",pointer:"/vaults/eligible/2/address",block:"100320900",blockKind:"read",blockPointer:"/vaults/verifiedAtBlock",caveat:"Historical eligibility only; recheck asset and >=1e12 USDG totalAssets on every listing."},morphoV2Factory:{address:"0x0fbad98595b0186da120e41f77c102beb49f803c",source:"Recorded chain and API observations",pointer:"/vaults/morphoVaultV2Factory",block:null,blockKind:"latest"},longbowCore:{address:"0x026df18fbd2A7639089D0a16293383ec687A5Ca1",source:"Recorded chain and API observations",pointer:"/projects/0/deployments/0/address",block:"100355967",blockKind:"read",blockPointer:"/projects/0/deployments/0/read_block",caveat:"Below USDG threshold or wrong asset at measurement; deployment context only."},longbowFrontier:{address:"0x65dC90cd3a0BCDE967c8AE6019d6790b616E78F7",source:"Recorded chain and API observations",pointer:"/projects/0/deployments/1/address",block:"100355967",blockKind:"read",blockPointer:"/projects/0/deployments/1/read_block",caveat:"Below USDG threshold or wrong asset at measurement; deployment context only."},longbowEth:{address:"0xe129D4Cb2d454C4ACFAc909d1576453A9b835f61",source:"Recorded chain and API observations",pointer:"/projects/0/deployments/2/address",block:"100355967",blockKind:"read",blockPointer:"/projects/0/deployments/2/read_block",caveat:"Below USDG threshold or wrong asset at measurement; deployment context only."},beefyTestedLpVault:{address:"0xC447184BF75a84Ace3087515CCFFb54937838FC8",source:"Recorded chain and API observations",pointer:"/projects/1/tested_lp_vault",block:"100357163",blockKind:"fork",blockPointer:"/fork_environment/fork_block",caveat:"LP adapter only; not an eligible USDG ERC-4626 vault. Other per-vault/strategy addresses remain dynamic."},groveAlm:{address:"0xBEEff039907422219Fb367e525954DDC092854d9",source:"Recorded chain and API observations",pointer:"/projects/2/address",block:"100355967",blockKind:"read",blockPointer:"/raw_reads/longbow_grove_control/4/block",caveat:"Public Grove x Steakhouse USDG ERC-4626 vault; below $1M USDG threshold at measurement."}},identity:{identityRegistry:{address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",source:"Recorded chain and API observations",pointer:"/erc8004/identityRegistry",block:null,blockKind:"latest"},reputationRegistry:{address:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63",source:"Recorded chain and API observations",pointer:"/erc8004/reputationRegistry",block:null,blockKind:"latest"},validationRegistry:{address:"0x8004Cc8439f36fd5F9F049D9fF86523Df6dAAB58",source:"Recorded chain and API observations",pointer:"/erc8004/validationRegistry",block:null,blockKind:"latest"}},meridian:{PredictionMarketEscrow:{address:"0xE4cea507b19796362A5a28Fa7cb705A3F1866213",source:"Recorded chain and API observations",pointer:"/addresses/PredictionMarketEscrow/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."},SecondaryMarketEscrow:{address:"0x7E318ef37c3bC3d0cBA205Af2D1Fc9F9CeFEB5df",source:"Recorded chain and API observations",pointer:"/addresses/SecondaryMarketEscrow/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."},MeridianRobinhoodVault:{address:"0x79cB914f3F336426E89FaB55A9488AB25770552D",source:"Recorded chain and API observations",pointer:"/addresses/MeridianRobinhoodVault/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."},CollateralToken_USDe:{address:"0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34",source:"Recorded chain and API observations",pointer:"/addresses/CollateralToken_USDe/address",block:null,blockKind:"latest",caveat:"Code census not individually block-pinned; fork execution at 100370553 is separate."}},relay:{depository:{address:"0x4cd00e387622c35bddb9b4c962c136462338bc31",source:"Recorded chain and API observations",pointer:"/addresses/depository_4663",block:"100355691",blockKind:"fork",blockPointer:"/fork/fork_block",caveat:"Only quoted depositNative path fork-tested; bridge settlement is external and unmeasured."}},lighter:{settlement:{address:"0x94bAB9693Ba2f6358507eFfcbd372b0660AFfF9d",source:"Recorded chain and API observations",pointer:"/contracts_on_4663/lighter_rh_settlement_proxy/address",block:"100355574",blockKind:"read",blockPointer:"/block_number",caveat:"Settlement/custody metadata only; funding tool uses HTTP, not this contract."}},heyResearch:{heyToken:{address:"0xB33eb16782776b4D738c0Fd643577cb0284Db610",source:"Recorded chain and API observations",pointer:"/addresses/heyToken/address",block:null,blockKind:"unanchored",caveat:"API-only tools; source has time range but no block anchor."}}},46630:{deployments:{test_USDG:{address:"0x7E955252E15c84f5768B83c41a71F9eba181802F",source:"Recorded chain and API observations",pointer:"/code_probes/0/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/0/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_WETH:{address:"0x7943e237c7F95DA44E0301572D358911207852Fa",source:"Recorded chain and API observations",pointer:"/code_probes/1/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/1/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_gateway:{address:"0x77bF00A6A90c600f214b34BAFBB7918c0cF113A8",source:"Recorded chain and API observations",pointer:"/code_probes/2/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/2/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_identity:{address:"0x8004A818BFB912233c491871b3d84c89A494BD9e",source:"Recorded chain and API observations",pointer:"/code_probes/3/address",block:"144387817",blockKind:"read",blockPointer:"/code_probes/3/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_USDG_implementation:{address:"0xf0863d7a29a55d0c4263c11bfac754312ff078df",source:"Recorded chain and API observations",pointer:"/code_probes/15/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/15/block",caveat:"Code presence alone does not establish a complete testnet integration."},facet_0xef55bec6:{address:"0x08f560a85db40a7d4ac49b4F44f1D38e5B8aB811",source:"Recorded chain and API observations",pointer:"/code_probes/17/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/17/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v4_production_poolmanager:{address:"0x8366a39CC670B4001A1121B8F6A443A643e40951",source:"Recorded chain and API observations",pointer:"/code_probes/22/address",block:"144389821",blockKind:"read",blockPointer:"/code_probes/22/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v3_community_test_candidate:{address:"0xFECCB63CD759d768538458Ea56F47eA8004323c1",source:"Recorded chain and API observations",pointer:"/code_probes/50/address",block:"144389821",blockKind:"read",blockPointer:"/code_probes/50/block",caveat:"Community v3 is not canonically endorsed; v4 native stack is incomplete."},Uniswap_v4_PositionManager:{address:"0x58daec3116aae6D93017bAAea7749052E8a04fA7",source:"Recorded chain and API observations",pointer:"/code_probes/52/address",block:"144390120",blockKind:"read",blockPointer:"/code_probes/52/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v4_Quoter:{address:"0x8Dc178eFB8111BB0973Dd9d722ebeFF267c98F94",source:"Recorded chain and API observations",pointer:"/code_probes/54/address",block:"144390120",blockKind:"read",blockPointer:"/code_probes/54/block",caveat:"Code presence alone does not establish a complete testnet integration."},Uniswap_v4_StateView:{address:"0xF3334192D15450CdD385c8B70e03f9A6bD9E673b",source:"Recorded chain and API observations",pointer:"/code_probes/56/address",block:"144390120",blockKind:"read",blockPointer:"/code_probes/56/block",caveat:"Code presence alone does not establish a complete testnet integration."},test_Permit2:{address:"0x000000000022D473030F116dDEE9F6B43aC78BA3",source:"Recorded chain and API observations",pointer:"/code_probes/77/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/77/block",caveat:"Code presence alone does not establish a complete testnet integration."},v3_test_WETH9:{address:"0x37E402B8081eFcE1D82A09a066512278006e4691",source:"Recorded chain and API observations",pointer:"/code_probes/78/address",block:"latest",blockKind:"latest",blockPointer:"/code_probes/78/block",caveat:"Community v3 is not canonically endorsed; v4 native stack is incomplete."}}}},t=o[4663].tokens.USDG.address,i=o[46630].deployments.test_USDG.address,m=o[4663].pons.factory.address,_=o[4663].pons.memeHook.address,R=o[4663].pons.poolManager.address,E=o[4663].pons.feeEscrow.address,C=o[4663].oracle.ethUsdgPool.address,b={name:"Global Dollar",version:"1",chainId:r,verifyingContract:t},l={name:"Global Dollar",version:"1",chainId:d,verifyingContract:i},c={mainnet:{chainId:r,usdg:t,usdgDomain:b,weth:o[r].tokens.WETH.address,identityRegistry:o[r].identity.identityRegistry.address},testnet:{chainId:d,usdg:i,usdgDomain:l,weth:o[d].deployments.test_WETH.address,identityRegistry:o[d].deployments.test_identity.address}};function F(e="mainnet"){if(e!=="mainnet"&&e!=="testnet")throw new a("Set OAK_NETWORK to mainnet or testnet.");return e}function B(e,s){if(s.toLowerCase()!==c[e].usdg.toLowerCase())throw new a(`USDG does not match the pinned ${e} deployment on chain ${c[e].chainId}.`)}async function D(e,s){let n=await s.getChainId();if(n!==c[e].chainId)throw new a(`RPC chain ${n} does not match OAK_NETWORK ${e} (chain ${c[e].chainId}).`)}var y={4663:{kyberswap:"0xe21fd0e9",velora:"0xe3ead59e"}},k={4663:{kyberswap:{address:"0x8F10B468b06c6FD214B65F87778827F7D113f996",source:"https://raw.githubusercontent.com/KyberNetwork/kyberswap-documentation/main/developer-guide/aggregator-api/contracts.md",pointer:"Robinhood / AggregationExecutorProxy",block:"100861304",blockKind:"read",caveat:"Corroborated by successful transaction 0x4a2474960f846f412d4d1cbdebb86727c81f92a0859ad743425fdc544d8973e8; approveTarget is zero."},velora:{address:"0x006d0e0d006109f0020f3050000a713780b7b000",source:"https://rpc.mainnet.chain.robinhood.com",pointer:"eth_getTransactionByHash / 0x70bc411f8427d622798ff82e6088d6cf3c011ae04b063c731664215f982ecfba / input / executor",block:"100861280",blockKind:"read",caveat:"Observed v6.2 executor, corroborated by six fresh Velora builds on 2026-10-29; no vendor executor list for 4663. Inner route targets vary; this pin does not authenticate them."}}},g=BigInt("0x45a6e007c874ffc6321d6fb90eac272dd6864bfa")<<96n|1n<<92n|1n,I=[k[4663].velora.address,"0x082738d007001080a00099a000004f3006152085"],K=[{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x1266261289d815650a6bcdb308766be36efa8149",codeHash:"0xa38c335d383c1ac060df1f3f4687917a6da673bbf6e37a3b5241b49760194d6d"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x3e2db9ed1693964d599dfeba87181a36fffc8ed8",codeHash:"0xbc971642d398135438c4d2cf9f2229ffe5f8c321584673c4a2535b6df47c01ef"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x664aafe2bd40e581aa4f8c5a594c9ee168b92d4f",codeHash:"0xda9b31df9b098e520e7f6a5b94356920d32a66c736c8788cf2af3035781babc9"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0x9d215290f43366bbceff40a79fbac9dd23325379",codeHash:"0x8d15c4f2b99c6b24daa0f2383c0cfd998879b89b36e9359b18345fc9e7686333"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0xa685fc7cef9eb4c1e8337f11019aeba111e48c31",codeHash:"0xd5cb6ac468476cda0e4069cb53097412c45dc4fcc23d61db05426e8047aa7a9b"},{chainId:4663,proxy:"0x888888888889758f76e7103c6cbf23abbf58f946",proxyCodeHash:"0xbd969810d4bcf7417666e8692b6c73077a44516db4c4f62c35f70c83ff3c205f",implementation:"0xf475964cb5235641f23e99c8d7828996c4289ac4",codeHash:"0x399cd0fb5f0a36db2d3221fab8d04c78c88239a128c9463f6c27aa2120a1f6ff"}],H=[{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x0a48ea27489881d84288776d1e0588d633945ad6",proxyCodeHash:"0xd460046af3bffad2aa81503173711d1b70a88a56155b8d0cd0ca53a3fee23078",implementation:"0xcf319d0021dfde8c676a54f8a36ead8fd2e48984",codeHash:"0x503caa96fd60bb34d6c4e290019d4f931bc36340b8e07b669f0e99059055d092"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxyCodeHash:"0xd460046af3bffad2aa81503173711d1b70a88a56155b8d0cd0ca53a3fee23078",implementation:"0x50fa4b08d75586603d678fadbeabf1f4d8d2113b",codeHash:"0xa157bf9c94b218a72d8ebe2c4321817d5d53a58e81553928c2a8cbfaf9edb628"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxyCodeHash:"0xd460046af3bffad2aa81503173711d1b70a88a56155b8d0cd0ca53a3fee23078",implementation:"0xb8ea4704fe518c5ccbf429fc6db1b2c4c4ca7193",codeHash:"0x5577c0b6a060fce1ceffb8ef0c80305bf8391d7af789742c8d1f2d00457aa955"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x5685f0b21126d87f60810780ce23c43ea45cb61e",proxyCodeHash:"0xd8500e5bf9af5e118e73c61f9c78ad630740b50d86cf38aaa26543a239cb1db2",implementation:"0xb20e7d58987b2b606d242f220cdb8cd9c676b526",codeHash:"0xbccc9c0d786a46f9d9810fb887905cc89ba453c5d2a1d9846e2267f71bfa877d"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0xad9b5c0ea95cf998c1a31aaa8ac7a24de94bee69",proxyCodeHash:"0xd8500e5bf9af5e118e73c61f9c78ad630740b50d86cf38aaa26543a239cb1db2",implementation:"0x0a75d1a1800e98fb0df13cdb4ecee3e4ea1685ca",codeHash:"0xaac5c7ab1c270883872ca5817bc80aca7cdce1ad8500acbe02e2943465fe9d36"},{chainId:4663,entry:"0x433e21dc2bf027910b1635653c2eb630bc7dad43",proxy:"0x5fc5360d0400a0fd4f2af552add042d716f1d168",proxyCodeHash:"0x864cc9ad53b338b82da1f7cab85ab0b3d5c8861acb422b6fec63cf36234f36a6",implementation:"0x68184c449e1a8f34fa18d289737129fd27b66f8f",codeHash:"0x3a551ac5c744af57e68a1d1431ac403c0f516ffd7d224a75746aee11fc4f3baf"}];export{u as a,r as b,d as c,p as d,h as e,A as f,v as g,x as h,P as i,o as j,t as k,i as l,m,_ as n,R as o,E as p,C as q,b as r,l as s,c as t,F as u,B as v,D as w,y as x,k as y,g as z,I as A,K as B,H as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as p}from"./
|
|
1
|
+
import{q as p}from"./BIFANUTV.js";import{b as c,e as d}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{b as a}from"./JXOEJPJ4.js";var f=/^(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?\.)+[\p{L}]{2,}$/u,m=/^did:[a-z0-9]+:[A-Za-z0-9._%:;=@/?#-]{1,512}$/,u=/^[^\s@<>()[\]\\,;:"]{1,64}@[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?\.[A-Za-z]{2,}$/,w=/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}:[-.%a-zA-Z0-9]{1,128}$/,l=["web","a2a","mcp","oasf"],P=["web","A2A","MCP","OASF","ENS","DID","email","agentWallet"];function s(e,r){if(typeof e!="string"||!e.trim()||e.length>2048||a(e))throw new n(`Provide a valid profile ${r}.`);return e}function h(e){return/^[a-z][a-z0-9+.-]*:\/\//i.test(e)}function z(e){if(!d(e))throw new n("Provide valid profile services.");let r=s(e.name,"service name"),t=s(e.endpoint,"service endpoint");e.version!==void 0&&s(e.version,"service version");let i=r.toLowerCase(),o=()=>{try{p(t,"Profile service endpoint")}catch{throw new n("Profile service endpoint must be an HTTPS or IPFS URI without credentials.")}};if(l.includes(i))return o();if(i==="ens"){if(!f.test(t))throw new n("An ENS service endpoint must be an ENS name such as agent.eth.");return}if(i==="did"){if(!m.test(t))throw new n("A DID service endpoint must be a DID such as did:web:agent.example.");return}if(i==="email"){if(!u.test(t))throw new n("An email service endpoint must be an email address.");return}if(i==="agentwallet"||i==="wallet"){if(!w.test(t)&&!c.test(t))throw new n("A wallet service endpoint must be a CAIP-10 account such as eip155:4663:0x\u2026 or an 0x address.");return}if(h(t)||/^(?:ipfs|https):/.test(t))return o();if(!(f.test(t)||m.test(t)||u.test(t)||w.test(t)))throw new n("Profile service endpoint must be an HTTPS or IPFS URI, an ENS name, a DID, an email address or a CAIP-10 account.")}export{P as a,z as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as T}from"./5RXALTDT.js";import{b as p,c as C,j as S}from"./
|
|
1
|
+
import{b as T}from"./5RXALTDT.js";import{b as p,c as C,j as S}from"./EWZFZUVF.js";import{a as l}from"./XSD5NL7J.js";import{AsyncLocalStorage as W}from"node:async_hooks";import{custom as X}from"viem";import{createPublicClient as U,custom as x,defineChain as q}from"viem";var A="https://rpc.mainnet.chain.robinhood.com",D="https://api.oakagentkit.org/v1/rpc",E=8453,ce=[p,E];function j(e){return e===p?A:e===E?D:void 0}var B="oak-core/0.1.0",z=S[4663].ponsClaims.multicall3.address,L=new Set(["eth_sendTransaction","eth_sendRawTransaction","eth_sign","personal_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","wallet_sendTransaction","wallet_sign"]);function O(e=p,t=A){if(!Number.isSafeInteger(e)||e<=0)throw new l("Provide a positive integer chain ID.");let n=e===p?"Robinhood Chain":e===C?"Robinhood Chain Testnet":`Chain ${e}`;return q({id:e,name:n,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:[t]}},...e===p?{contracts:{multicall3:{address:z}}}:{}})}function ue(e=p,t){if(t?.chain&&t.chain.id===e)return t.chain.contracts?.multicall3?.address;if(!(!Number.isSafeInteger(e)||e<=0))return O(e).contracts?.multicall3?.address}function G(e,t,n){let o=e?.trim()||n?.rpcUrl?.trim()||n?.rpcUrls?.[t]?.trim(),r=t===p?(process.env[`OAK_RPC_URL_${t}`]??process.env.OAK_RPC_URL)?.trim():t===C?(process.env.OAK_TESTNET_RPC_URL??process.env.OAK_RPC_URL)?.trim():process.env[`OAK_RPC_URL_${t}`]?.trim(),s=o||r||j(t);if(!s)throw new l(`No RPC URL configured for chain ${t}.`);if(s===D&&!n?.transport)throw new l(`Hosted RPC needs a local session transport; configure OAK_RPC_URL_${t} for a direct core/server client.`);if((n?.requireKeyedRpc??process.env.NODE_ENV==="production")&&t===p&&s===A)throw new l("Production requires a keyed OAK_RPC_URL.");return s}var J=1e4;async function v(e,t=J){if(!Number.isFinite(t)||t<=0||t>3e4)throw new l("RPC timeout must be greater than zero and at most 30000 ms.");let n=new AbortController,o;try{return await Promise.race([new Promise((r,s)=>{o=setTimeout(()=>{s(new l("The RPC request timed out. Please try again.")),n.abort()},t)}),e(n.signal)])}finally{clearTimeout(o)}}function V(e,t=p,n){let o=typeof e=="object"&&e!==null,r=o?e:n??{},s=typeof e=="string"?e:r.rpcUrl,i=o?r.chainId??t:t;if(!Number.isSafeInteger(i)||i<=0)throw new l("Provide a positive integer chain ID.");if(r.timeoutMs!==void 0&&(!Number.isFinite(r.timeoutMs)||r.timeoutMs<=0||r.timeoutMs>3e4))throw new l("RPC timeout must be greater than zero and at most 30000 ms.");let d=G(s,i,r),a=O(i,d);if(r.transport){let c=r.transport({chain:a,retryCount:0});return U({chain:a,transport:x({request:f=>{if(L.has(f.method)||/^(eth_send|eth_sign|personal_sign|wallet_)/i.test(f.method))throw new l("Read-only RPC client does not allow this method.");return v(()=>c.request(f),r.timeoutMs)}},{retryCount:0})})}let u=M({url:d,chainId:i,fetch:r.fetch,userAgent:r.userAgent?.trim()||B,retries:r.retries,retryDelayMs:r.retryDelayMs,maxRetryDelayMs:r.maxRetryDelayMs,timeoutMs:r.timeoutMs,fallbackUrls:r.rpcFallbackUrls?.[i]??r.fallbackRpcUrls??P(process.env[`OAK_RPC_FALLBACK_URLS_${i}`]??(i===p?process.env.OAK_RPC_FALLBACK_URLS:void 0))})({chain:a,retryCount:0}),b=x({request:c=>{if(L.has(c.method)||/^(eth_send|eth_sign|personal_sign|wallet_)/i.test(c.method))throw new l("Read-only RPC client does not allow this method.");return u.request(c)}},{retryCount:0});return U({chain:a,transport:b})}function le(e={}){let t=new Map;return n=>{let o=t.get(n);if(o)return o;let r=V(e.rpcUrls?.[n],n,e);return t.set(n,r),r}}var y=class extends l{},Q=16,k=new Map;async function Y(e,t,n){t.throwIfAborted();let o=new URL(e).origin,r=k.get(o);r||(r={active:0,waiters:new Set},k.set(o,r));let s=r;s.active<Q?s.active++:await new Promise((i,d)=>{let a=()=>{t.removeEventListener("abort",h),i()},h=()=>{s.waiters.delete(a),t.removeEventListener("abort",h),d(t.reason)};s.waiters.add(a),t.addEventListener("abort",h,{once:!0})});try{return t.throwIfAborted(),await n()}finally{let i=s.waiters.values().next().value;i?(s.waiters.delete(i),i()):--s.active===0&&k.delete(o)}}function I(e){let t=[];for(;e&&typeof e=="object"&&!t.includes(e);)t.push(e),e=e.cause;return t}function Z(e){return I(e).find(t=>t instanceof y)}function ee(e){if(!Z(e))for(let t of I(e)){let n=Number(t.status??t.code);if(n===429||n>=500&&n<=599)return{status:n,delay:typeof t.retryAfterMs=="number"?t.retryAfterMs:void 0};if(/rate.?limit|too many requests/i.test(String(t.message??"")))return{status:429}}}async function N(e,t,n={},o){let r=T();r&&r!==o&&(o=o?AbortSignal.any([r,o]):r);let s=n.retries??3,i=n.retryDelayMs??250,d=n.maxRetryDelayMs??2e3;if(!Number.isInteger(s)||s<0||s>5||!Number.isFinite(i)||i<0||!Number.isFinite(d)||d<0||d>3e4)throw new l("RPC retries must be 0 to 5; backoff must be non-negative and at most 30000 ms.");for(let a=0;;a++){o?.throwIfAborted();try{return await e()}catch(h){o?.throwIfAborted();let u=ee(h);if(!u)throw h;let b=Math.min(d,i*2**a),c=Math.max(Math.min(d,b+Math.floor(Math.random()*b/4)),u.delay??0);if(a>=s||c>d){let f=u.status===429?"public RPC rate-limited":`RPC returned HTTP ${u.status}`,m=u.delay?` Retry after ${Math.max(1,Math.ceil(u.delay/1e3))} seconds.`:"";throw new y(`${f}, retried ${a} times (${t}).${m} ${u.status===429?"The RPC rate limit remains active. ":""}Configure a keyed OAK_RPC_URL or comma-separated OAK_RPC_FALLBACK_URLS for this chain.`)}await new Promise((f,m)=>{let w=()=>{clearTimeout(R),m(o?.reason)},R=setTimeout(()=>{o?.removeEventListener("abort",w),f()},c);o?.addEventListener("abort",w,{once:!0}),o?.aborted&&w()})}}}function P(e){if(e===void 0||e.trim()==="")return[];let t=e.split(",").map(n=>n.trim());if(t.length>4)throw new l("Configure at most four ordered fallback RPC URLs.");for(let n of t){let o;try{o=new URL(n)}catch{throw new l("Fallback RPC URLs must use HTTP or HTTPS.")}if(!["http:","https:"].includes(o.protocol))throw new l("Fallback RPC URLs must use HTTP or HTTPS.")}return t}var g=new Map;async function te(e,t,n){let o=g.get(e)??Promise.resolve(),r,s=new Promise(d=>{r=d}),i=o.then(()=>s);g.set(e,i);try{return await o,n.throwIfAborted(),await t()}finally{r(),g.get(e)===i&&g.delete(e)}}var K=new W,F=new Map,H=e=>{let t=new URL(e).origin,n=F.get(t);return n||(n={interactive:0},F.set(t,n)),n};async function re(e,t){let n=K.getStore(),o=[...new Set(e.map(H))].filter(r=>!n?.has(r));o.forEach(r=>{r.interactive++});try{let r=o.flatMap(s=>s.background?[s.background.catch(()=>{})]:[]);return r.length&&await Promise.all(r),await t()}finally{o.forEach(r=>{r.interactive--})}}async function ye(e,t,n=o=>new Promise(r=>{setTimeout(r,o).unref()})){let o=H(e);for(;o.interactive||o.background;)await n(100);let r=Promise.resolve().then(()=>K.run(new Set([o]),t));o.background=r;try{return await r}finally{o.background===r&&(o.background=void 0)}}function M(e){let t=[...new Set([e.url,...e.fallbackUrls??[]])];P(t.slice(1).join(","));let n=new Set,o=0;return X({request:({method:r,params:s})=>re(t,()=>v(async i=>{let d=T(),a=d?AbortSignal.any([d,i]):i;a.throwIfAborted();let h;for(let u of t){a.throwIfAborted();let b=async(c,f=[])=>Y(u,a,async()=>{a.throwIfAborted();let m=await(e.fetch??globalThis.fetch)(u,{method:"POST",redirect:"error",signal:a,headers:{"content-type":"application/json","user-agent":e.userAgent??"oak-core/0.1.0"},body:JSON.stringify({jsonrpc:"2.0",id:++o,method:c,params:f})});if(!m.ok){let R=m.headers.get("retry-after"),_=R===null?void 0:/^\d+(\.\d+)?$/.test(R.trim())?Number(R)*1e3:Math.max(0,Date.parse(R)-Date.now()),$=typeof _=="number"&&Number.isFinite(_)?_:void 0;throw await m.body?.cancel(),m.status===429||m.status>=500?Object.assign(new Error("Transient RPC HTTP failure"),{status:m.status,retryAfterMs:$}):new y(`RPC returned HTTP ${m.status} (${c}).`)}let w;try{w=await m.json()}catch{throw new y("The RPC endpoint returned malformed JSON.")}if(w.error)throw Object.assign(new Error(w.error.message??"RPC error"),{code:w.error.code,data:w.error.data});return w.result});try{if(u!==t[0]&&r!=="eth_chainId"&&(!n.has(u)||r==="eth_sendRawTransaction")){let m=await N(()=>b("eth_chainId"),"eth_chainId",e,a);if(Number(m)!==e.chainId)throw new y("RPC chain does not match the requested chain.");n.add(u)}let c=()=>N(()=>b(r,s),r,e,a),f=await(r==="eth_simulateV1"?te(u,c,a):c());if(r==="eth_chainId")if(Number(f)!==e.chainId){if(u!==t[0])throw new y("RPC chain does not match the requested chain.")}else n.add(u);return f}catch(c){if(a.throwIfAborted(),h=c,!(c instanceof y)||!/rate-limited|HTTP 5\d\d|chain does not match/.test(c.message))throw c}}throw h},e.timeoutMs))},{retryCount:0})}export{y as a,Q as b,Z as c,N as d,P as e,re as f,ye as g,M as h,A as i,D as j,E as k,ce as l,j as m,B as n,z as o,O as p,ue as q,J as r,v as s,V as t,le as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as T,f as de,g as B,i as ce,j as O}from"./JDHPMS7X.js";import{F as I,a as te,b as se,c as _,f as L,h as S,m as ne,n as y,r as z,s as ie,t as re,v as ae}from"./FRT6AC6M.js";import{f as W,g as oe}from"./3BQ5XHDJ.js";import{a as U}from"./YEIM6BZQ.js";import{a as K}from"./Z7FGEWO2.js";import{h as ee}from"./QA6Z2CYP.js";import{c as Q}from"./CFPJDLTZ.js";import{a as J}from"./43LI5NKJ.js";import{g as E}from"./NWNYJ26T.js";import{b as k,n as Z}from"./TI727O2H.js";import{a as b,b as F,e as Y}from"./XSD5NL7J.js";import{decodeAbiParameters as be,getAddress as v,pad as le,parseAbi as me,parseAbiParameters as ke,toEventSelector as ye,toHex as ue,zeroAddress as he}from"viem";var Ae=ye("Initialize(bytes32,address,address,uint24,int24,address,uint160,int24)"),Ie=ke("uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick"),ve=10000000n,Ce=10000n,ge=25,X=200,q=16,Se=3e3,_e=500,Le=500n,R=100,$=me(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Ne=me(["function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)"]);function Ee(o){let e=o.trim().toLowerCase();return e==="eth"||e==="native"||e===he||e===K.toLowerCase()}function fe(o,e){if(o!=null){if(typeof o!="string")throw new b(`${e} must be a token address, or "eth" for native ETH.`);return Ee(o)?{eth:!0}:(J(o),{eth:!1,address:v(o)})}}var we=(o,e)=>BigInt(o)<BigInt(e)?-1:BigInt(o)>BigInt(e)?1:0;function H(o){return{address:o.address,symbol:o.symbol,decimals:o.decimals}}async function Pe(o,e,r,i,a){let[t,s,f]=await Promise.all([o.readContract({address:e,abi:O,functionName:"slot0"}),o.readContract({address:e,abi:O,functionName:"liquidity"}),o.readContract({address:e,abi:O,functionName:"tickSpacing"})]),n=BigInt(t[0]);return{version:"v3",id:e,feePercent:U(a),highFee:a>=5e4,token0:H(r),token1:H(i),fee:a,tickSpacing:Number(f),initialized:n>0n,liquidity:BigInt(s).toString(),sqrtPriceX96:n.toString(),tick:Number(t[1]),price:n>0n?W(n,r.decimals,i.decimals):"0",addSupported:!0}}async function x(o,e,r){let i=r??re(e),[a,t]=await Promise.all([I(o,e.currency0,k),I(o,e.currency1,k)]),[s,f]=await Promise.all([o.readContract({address:_,abi:$,functionName:"getSlot0",args:[i]}),o.readContract({address:_,abi:$,functionName:"getLiquidity",args:[i]})]),n=BigInt(s[0]),w=ae(e,Number(s[3]));return{version:"v4",id:i,feePercent:U((e.fee&8388608)!==0?Number(s[3]):e.fee),highFee:((e.fee&8388608)!==0?Number(s[3]):e.fee)>=5e4,token0:H(a),token1:H(t),fee:e.fee,tickSpacing:e.tickSpacing,hooks:v(e.hooks),initialized:n>0n,liquidity:BigInt(f).toString(),sqrtPriceX96:n.toString(),tick:Number(s[1]),price:n>0n?W(n,a.decimals,t.decimals):"0",addSupported:z.has(e.hooks.toLowerCase()),feeNote:w.feeNote,...z.has(e.hooks.toLowerCase())?{}:{note:i.toLowerCase()===Q.poolId?ee:e.hooks.toLowerCase()===Z.toLowerCase()?new ne(ie(e.currency0)?e.currency1:void 0).message:`Hook ${v(e.hooks)} is not one Oak has measured, so uniswap_add will refuse this pool.`}}}async function Te(o,e,r,i){let a=await o.getBlockNumber(),t=[],s=new Set,f=!1,n=ve;for(let d=a;;){let u=d+1n>n?d-n+1n:0n,l;try{l=await o.request({method:"eth_getLogs",params:[{address:te.toLowerCase(),topics:[Ae,null,e?le(e):null,r?le(r):null],fromBlock:ue(u),toBlock:ue(d)}]})}catch(p){if(F(p,-32601)||n<=Ce)throw p;n/=2n;continue}if(!Array.isArray(l))throw new b("Invalid v4 Initialize log response.");let P=[];for(let p of l){if(!Array.isArray(p.topics)||p.topics.length!==4||typeof p.data!="string")throw new b("Invalid v4 Initialize log.");let[A,C,N]=be(Ie,p.data),D={currency0:v(`0x${p.topics[2].slice(-40)}`),currency1:v(`0x${p.topics[3].slice(-40)}`),fee:Number(A),tickSpacing:Number(C),hooks:v(N)};P.push({key:D,id:p.topics[1]}),s.add(p.topics[1].toLowerCase())}if(t.push(P),u===0n)break;if(s.size>=i){f=!0;break}d=u-1n}let w=new Map;for(let d of t.reverse())for(let u of d)w.set(u.id.toLowerCase(),u);return{pools:[...w.values()],cut:f}}async function Be(o,e,r){let i=e.eth?T.weth:e.address,a=r.eth?T.weth:r.address;if(i===a)return[];let[t,s]=we(i,a)<0?[i,a]:[a,i],[f,n]=await Promise.all([I(o,t,k),I(o,s,k)]),w=[];for(let d of Object.keys(de).map(Number)){let u=v(String(await o.readContract({address:T.factory,abi:ce,functionName:"getPool",args:[t,s,d]})));u!==he&&w.push(await Pe(o,u,f,n,d))}return w}function pe(o){return o?o.eth?[S,L]:o.address===L?[L,S]:[o.address]:null}async function Oe(o,e){let r=new Map;if(e.length===0)return r;if(typeof o.multicall=="function"&&o.chain?.contracts?.multicall3)try{return(await o.multicall({allowFailure:!0,contracts:e.map(a=>({address:_,abi:$,functionName:"getLiquidity",args:[a]}))})).forEach((a,t)=>r.set(e[t].toLowerCase(),a.status==="success"?BigInt(a.result):0n)),r}catch{}for(let i=0;i<e.length;i+=q)(await Promise.allSettled(e.slice(i,i+q).map(async t=>BigInt(await o.readContract({address:_,abi:$,functionName:"getLiquidity",args:[t]}))))).forEach((t,s)=>r.set(e[i+s].toLowerCase(),t.status==="fulfilled"?t.value:0n));return r}async function Re(o,e,r,i){let a=pe(e),t=pe(r),s=new Map,f=(c,h)=>{if(c&&h){if(c===h)return;let[m,g]=we(c,h)<0?[c,h]:[h,c];s.set(`${m}/${g}`,[m,g])}else if(c||h){let m=c??h;s.set(`${m}/*0`,[m,null]),s.set(`${m}/*1`,[null,m])}};for(let c of a??[null])for(let h of t??[null])f(c,h);let n=new Map;for(let c of y)[...s.values()].some(([m,g])=>(!m||E(c.key.currency0,m))&&(!g||E(c.key.currency1,g)))&&n.set(c.poolId.toLowerCase(),{key:c.key,id:c.poolId});let d=typeof o.multicall=="function"&&!!o.chain?.contracts?.multicall3?Se:_e,u=!1;for(let[c,h]of s.values()){let m=await Te(o,c,h,d+y.length);u||=m.cut;for(let g of m.pools)n.set(g.id.toLowerCase(),g)}let l=new Set(y.map(c=>c.poolId.toLowerCase())),P=[...n.values()],p=P.filter(c=>l.has(c.id.toLowerCase())),A=P.filter(c=>!l.has(c.id.toLowerCase())).reverse();(A.length>d||u)&&i.push(`${u?"At least ":""}${A.length} v4 pools match; only the newest ${d} non-measured ones were considered. Pass both tokens, or a poolId, to narrow.`);let C=A.slice(0,d),N=await Oe(o,C.map(c=>c.id)),D=C.sort((c,h)=>{let m=N.get(c.id.toLowerCase())??0n,g=N.get(h.id.toLowerCase())??0n;return m===g?0:m<g?1:-1}),V=[...p,...D];V.length>X&&i.push(`${V.length} v4 pools match; full state was read for Oak's measured pools plus the deepest of the rest (${X} total). Pass both tokens, or a poolId, to narrow.`);let G=[],M=0,j=V.slice(0,X);for(let c=0;c<j.length;c+=q){let h=await Promise.allSettled(j.slice(c,c+q).map(({key:m,id:g})=>x(o,m,g)));for(let m of h)m.status==="fulfilled"?G.push(m.value):M++}return M>0&&i.push(`${M} pool(s) were skipped because a token or pool state could not be read.`),G}async function qe(o,e){let r=y.find(n=>E(n.poolId,e));if(r)return x(o,r.key,r.poolId);let[i,a,t,s,f]=await o.readContract({address:se,abi:Ne,functionName:"poolKeys",args:[e.slice(0,52)]});if(i===S&&a===S&&Number(s)===0)throw new b(`No Uniswap v4 pool ${e} is known to the PositionManager (no position was ever minted in it, or it is not initialized). Search by token pair instead.`);return x(o,{currency0:i,currency1:a,fee:Number(t),tickSpacing:Number(s),hooks:f},e)}function $e(o){let e=new Set([...y.map(t=>t.poolId.toLowerCase()),...B.map(t=>t.address.toLowerCase())]),r=new Set([S,K.toLowerCase(),L.toLowerCase()]),i=t=>r.has(t.address.toLowerCase())?"ETH":t.address.toLowerCase(),a=new Map;for(let t of o.filter(s=>s.initialized&&BigInt(s.liquidity)>0n)){let s=`${i(t.token0)}/${i(t.token1)}`;a.set(s,[...a.get(s)??[],t])}for(let t of a.values()){let s=t.filter(d=>e.has(d.id.toLowerCase()));if(s.length===0&&t.length<3)continue;let n=(s.length>0?s:t).map(d=>BigInt(d.sqrtPriceX96)).sort((d,u)=>d<u?-1:d>u?1:0),w=n[Math.floor(n.length/2)];for(let d of t){if(e.has(d.id.toLowerCase()))continue;let u=oe(BigInt(d.sqrtPriceX96),w);u>Le&&(d.priceOutlierBps=Number(u),d.note=`${d.note?`${d.note} `:""}Price differs ${u} bps from the ${s.length>0?"Oak-measured":"median"} price for this pair; do not treat this pool as the market price.`)}}}async function He(o,e){let r=e.version;if(r!==void 0&&r!=="v3"&&r!=="v4")throw new b('version must be "v3" or "v4"; omit it to search both.');let i=e.limit===void 0?ge:Number(e.limit);if(!Number.isInteger(i)||i<1||i>R)throw new b(`limit must be an integer from 1 to ${R}.`);let a=fe(e.tokenA,"tokenA"),t=fe(e.tokenB,"tokenB");if(!a&&t)throw new b("Provide tokenA when searching by token; tokenB narrows the search to a pair.");let s=o.clientFor(k),f=[],n=[];if(e.poolId!==void 0){if(typeof e.poolId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.poolId))throw new b("poolId must be a 32-byte hex v4 poolId. For v3 search by tokenA/tokenB.");n=[await qe(s,e.poolId)]}else if(a){if(r!=="v4"&&(t?n.push(...await Be(s,a,t)):f.push("v3 pools are looked up per pair; pass tokenB to include them.")),r!=="v3")try{n.push(...await Re(s,a,t,f))}catch(l){throw F(l,-32601)?l:new b(`Could not search v4 pools. ${Y(l)}`)}}else{f.push("No token filter given: showing the pools Oak has measured. Pass tokenA (and tokenB) to search the chain for every pool of a pair.");let l=await Promise.all(B.map(async p=>{let[A,C]=await Promise.all([I(s,p.token0,k),I(s,p.token1,k)]);return Pe(s,p.address,A,C,p.fee)})),P=await Promise.all(y.map(p=>x(s,p.key,p.poolId)));n=[...r==="v4"?[]:l,...r==="v3"?[]:P]}$e(n);let w=new Set([...y.map(l=>l.poolId.toLowerCase()),...B.map(l=>l.address.toLowerCase())]),d=0;n=n.filter(l=>!l.highFee||w.has(l.id.toLowerCase())?!0:e.includeHighFeePools===!0?(l.note=`Do not trade here: ${l.feePercent} fee.${l.note?` ${l.note}`:""}`,!0):(d++,!1)),d&&f.push(`${d} pools with fees of 5% or more were left out. To see them, pass includeHighFeePools: true.`),n.sort((l,P)=>BigInt(P.liquidity)>BigInt(l.liquidity)?1:BigInt(P.liquidity)<BigInt(l.liquidity)?-1:0),n.length>i&&f.push(`Showing the ${i} deepest of ${n.length} pools found; raise limit (max ${R}) to see more.`),n=n.slice(0,i);let u=n.filter(l=>l.initialized&&BigInt(l.liquidity)>0n).length;return n.length===0&&d===0&&f.push("No pool exists for this pair. Create one with uniswap_create_pool, or create it and add the first liquidity together with uniswap_add plus initialPrice."),{pools:n,notes:f,summary:`Found ${n.length} Uniswap pool(s), ${u} with active liquidity. price is token1 per 1 token0.`}}function Ye(o){return{tools:[{name:"uniswap_pools",inputSchema:{type:"object",description:"Read-only pool discovery on Robinhood Chain (4663): every Uniswap v3 and v4 pool for a token pair with fee, tick spacing, hook, liquidity and price, or one v4 pool by poolId. No tokens given: the measured pools.",properties:{version:{type:"string",enum:["v3","v4"],description:"Limit to one version; omit to search both."},tokenA:{type:"string",description:'Token address, or "eth" for native ETH (searches v3 WETH and v4 native/WETH pools).'},tokenB:{type:"string",description:"Second token of the pair. Required for v3 lookups."},poolId:{type:"string",description:"32-byte v4 poolId to inspect."},includeHighFeePools:{description:"Include pools above the usual fee threshold in discovery.",type:"boolean"},limit:{description:"Maximum number of results to return, within the stated bounds.",type:"integer",minimum:1,maximum:R,default:ge}}},execute:async r=>He(o,r)}]}}export{He as a,Ye as b};
|
|
1
|
+
import{e as T,f as de,g as B,i as ce,j as O}from"./5DWQUEBA.js";import{F as I,a as te,b as se,c as _,f as L,h as S,m as ne,n as y,r as z,s as ie,t as re,v as ae}from"./5677LZOV.js";import{f as U,g as oe}from"./6EWSLHXL.js";import{a as W}from"./YEIM6BZQ.js";import{a as K}from"./7WXAS54T.js";import{h as ee}from"./QA6Z2CYP.js";import{c as Q}from"./CFPJDLTZ.js";import{a as J}from"./43LI5NKJ.js";import{g as E}from"./NWNYJ26T.js";import{b as k,n as Z}from"./EWZFZUVF.js";import{a as b,b as F,e as Y}from"./XSD5NL7J.js";import{decodeAbiParameters as be,getAddress as v,pad as le,parseAbi as me,parseAbiParameters as ke,toEventSelector as ye,toHex as ue,zeroAddress as he}from"viem";var Ae=ye("Initialize(bytes32,address,address,uint24,int24,address,uint160,int24)"),Ie=ke("uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick"),ve=10000000n,Ce=10000n,ge=25,X=200,q=16,Se=3e3,_e=500,Le=500n,R=100,$=me(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Ne=me(["function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)"]);function Ee(o){let e=o.trim().toLowerCase();return e==="eth"||e==="native"||e===he||e===K.toLowerCase()}function fe(o,e){if(o!=null){if(typeof o!="string")throw new b(`${e} must be a token address, or "eth" for native ETH.`);return Ee(o)?{eth:!0}:(J(o),{eth:!1,address:v(o)})}}var we=(o,e)=>BigInt(o)<BigInt(e)?-1:BigInt(o)>BigInt(e)?1:0;function H(o){return{address:o.address,symbol:o.symbol,decimals:o.decimals}}async function Pe(o,e,r,i,a){let[t,s,f]=await Promise.all([o.readContract({address:e,abi:O,functionName:"slot0"}),o.readContract({address:e,abi:O,functionName:"liquidity"}),o.readContract({address:e,abi:O,functionName:"tickSpacing"})]),n=BigInt(t[0]);return{version:"v3",id:e,feePercent:W(a),highFee:a>=5e4,token0:H(r),token1:H(i),fee:a,tickSpacing:Number(f),initialized:n>0n,liquidity:BigInt(s).toString(),sqrtPriceX96:n.toString(),tick:Number(t[1]),price:n>0n?U(n,r.decimals,i.decimals):"0",addSupported:!0}}async function x(o,e,r){let i=r??re(e),[a,t]=await Promise.all([I(o,e.currency0,k),I(o,e.currency1,k)]),[s,f]=await Promise.all([o.readContract({address:_,abi:$,functionName:"getSlot0",args:[i]}),o.readContract({address:_,abi:$,functionName:"getLiquidity",args:[i]})]),n=BigInt(s[0]),w=ae(e,Number(s[3]));return{version:"v4",id:i,feePercent:W((e.fee&8388608)!==0?Number(s[3]):e.fee),highFee:((e.fee&8388608)!==0?Number(s[3]):e.fee)>=5e4,token0:H(a),token1:H(t),fee:e.fee,tickSpacing:e.tickSpacing,hooks:v(e.hooks),initialized:n>0n,liquidity:BigInt(f).toString(),sqrtPriceX96:n.toString(),tick:Number(s[1]),price:n>0n?U(n,a.decimals,t.decimals):"0",addSupported:z.has(e.hooks.toLowerCase()),feeNote:w.feeNote,...z.has(e.hooks.toLowerCase())?{}:{note:i.toLowerCase()===Q.poolId?ee:e.hooks.toLowerCase()===Z.toLowerCase()?new ne(ie(e.currency0)?e.currency1:void 0).message:`Hook ${v(e.hooks)} is not one Oak has measured, so uniswap_add will refuse this pool.`}}}async function Te(o,e,r,i){let a=await o.getBlockNumber(),t=[],s=new Set,f=!1,n=ve;for(let d=a;;){let u=d+1n>n?d-n+1n:0n,l;try{l=await o.request({method:"eth_getLogs",params:[{address:te.toLowerCase(),topics:[Ae,null,e?le(e):null,r?le(r):null],fromBlock:ue(u),toBlock:ue(d)}]})}catch(p){if(F(p,-32601)||n<=Ce)throw p;n/=2n;continue}if(!Array.isArray(l))throw new b("Invalid v4 Initialize log response.");let P=[];for(let p of l){if(!Array.isArray(p.topics)||p.topics.length!==4||typeof p.data!="string")throw new b("Invalid v4 Initialize log.");let[A,C,N]=be(Ie,p.data),D={currency0:v(`0x${p.topics[2].slice(-40)}`),currency1:v(`0x${p.topics[3].slice(-40)}`),fee:Number(A),tickSpacing:Number(C),hooks:v(N)};P.push({key:D,id:p.topics[1]}),s.add(p.topics[1].toLowerCase())}if(t.push(P),u===0n)break;if(s.size>=i){f=!0;break}d=u-1n}let w=new Map;for(let d of t.reverse())for(let u of d)w.set(u.id.toLowerCase(),u);return{pools:[...w.values()],cut:f}}async function Be(o,e,r){let i=e.eth?T.weth:e.address,a=r.eth?T.weth:r.address;if(i===a)return[];let[t,s]=we(i,a)<0?[i,a]:[a,i],[f,n]=await Promise.all([I(o,t,k),I(o,s,k)]),w=[];for(let d of Object.keys(de).map(Number)){let u=v(String(await o.readContract({address:T.factory,abi:ce,functionName:"getPool",args:[t,s,d]})));u!==he&&w.push(await Pe(o,u,f,n,d))}return w}function pe(o){return o?o.eth?[S,L]:o.address===L?[L,S]:[o.address]:null}async function Oe(o,e){let r=new Map;if(e.length===0)return r;if(typeof o.multicall=="function"&&o.chain?.contracts?.multicall3)try{return(await o.multicall({allowFailure:!0,contracts:e.map(a=>({address:_,abi:$,functionName:"getLiquidity",args:[a]}))})).forEach((a,t)=>r.set(e[t].toLowerCase(),a.status==="success"?BigInt(a.result):0n)),r}catch{}for(let i=0;i<e.length;i+=q)(await Promise.allSettled(e.slice(i,i+q).map(async t=>BigInt(await o.readContract({address:_,abi:$,functionName:"getLiquidity",args:[t]}))))).forEach((t,s)=>r.set(e[i+s].toLowerCase(),t.status==="fulfilled"?t.value:0n));return r}async function Re(o,e,r,i){let a=pe(e),t=pe(r),s=new Map,f=(c,h)=>{if(c&&h){if(c===h)return;let[m,g]=we(c,h)<0?[c,h]:[h,c];s.set(`${m}/${g}`,[m,g])}else if(c||h){let m=c??h;s.set(`${m}/*0`,[m,null]),s.set(`${m}/*1`,[null,m])}};for(let c of a??[null])for(let h of t??[null])f(c,h);let n=new Map;for(let c of y)[...s.values()].some(([m,g])=>(!m||E(c.key.currency0,m))&&(!g||E(c.key.currency1,g)))&&n.set(c.poolId.toLowerCase(),{key:c.key,id:c.poolId});let d=typeof o.multicall=="function"&&!!o.chain?.contracts?.multicall3?Se:_e,u=!1;for(let[c,h]of s.values()){let m=await Te(o,c,h,d+y.length);u||=m.cut;for(let g of m.pools)n.set(g.id.toLowerCase(),g)}let l=new Set(y.map(c=>c.poolId.toLowerCase())),P=[...n.values()],p=P.filter(c=>l.has(c.id.toLowerCase())),A=P.filter(c=>!l.has(c.id.toLowerCase())).reverse();(A.length>d||u)&&i.push(`${u?"At least ":""}${A.length} v4 pools match; only the newest ${d} non-measured ones were considered. Pass both tokens, or a poolId, to narrow.`);let C=A.slice(0,d),N=await Oe(o,C.map(c=>c.id)),D=C.sort((c,h)=>{let m=N.get(c.id.toLowerCase())??0n,g=N.get(h.id.toLowerCase())??0n;return m===g?0:m<g?1:-1}),V=[...p,...D];V.length>X&&i.push(`${V.length} v4 pools match; full state was read for Oak's measured pools plus the deepest of the rest (${X} total). Pass both tokens, or a poolId, to narrow.`);let G=[],M=0,j=V.slice(0,X);for(let c=0;c<j.length;c+=q){let h=await Promise.allSettled(j.slice(c,c+q).map(({key:m,id:g})=>x(o,m,g)));for(let m of h)m.status==="fulfilled"?G.push(m.value):M++}return M>0&&i.push(`${M} pool(s) were skipped because a token or pool state could not be read.`),G}async function qe(o,e){let r=y.find(n=>E(n.poolId,e));if(r)return x(o,r.key,r.poolId);let[i,a,t,s,f]=await o.readContract({address:se,abi:Ne,functionName:"poolKeys",args:[e.slice(0,52)]});if(i===S&&a===S&&Number(s)===0)throw new b(`No Uniswap v4 pool ${e} is known to the PositionManager (no position was ever minted in it, or it is not initialized). Search by token pair instead.`);return x(o,{currency0:i,currency1:a,fee:Number(t),tickSpacing:Number(s),hooks:f},e)}function $e(o){let e=new Set([...y.map(t=>t.poolId.toLowerCase()),...B.map(t=>t.address.toLowerCase())]),r=new Set([S,K.toLowerCase(),L.toLowerCase()]),i=t=>r.has(t.address.toLowerCase())?"ETH":t.address.toLowerCase(),a=new Map;for(let t of o.filter(s=>s.initialized&&BigInt(s.liquidity)>0n)){let s=`${i(t.token0)}/${i(t.token1)}`;a.set(s,[...a.get(s)??[],t])}for(let t of a.values()){let s=t.filter(d=>e.has(d.id.toLowerCase()));if(s.length===0&&t.length<3)continue;let n=(s.length>0?s:t).map(d=>BigInt(d.sqrtPriceX96)).sort((d,u)=>d<u?-1:d>u?1:0),w=n[Math.floor(n.length/2)];for(let d of t){if(e.has(d.id.toLowerCase()))continue;let u=oe(BigInt(d.sqrtPriceX96),w);u>Le&&(d.priceOutlierBps=Number(u),d.note=`${d.note?`${d.note} `:""}Price differs ${u} bps from the ${s.length>0?"Oak-measured":"median"} price for this pair; do not treat this pool as the market price.`)}}}async function He(o,e){let r=e.version;if(r!==void 0&&r!=="v3"&&r!=="v4")throw new b('version must be "v3" or "v4"; omit it to search both.');let i=e.limit===void 0?ge:Number(e.limit);if(!Number.isInteger(i)||i<1||i>R)throw new b(`limit must be an integer from 1 to ${R}.`);let a=fe(e.tokenA,"tokenA"),t=fe(e.tokenB,"tokenB");if(!a&&t)throw new b("Provide tokenA when searching by token; tokenB narrows the search to a pair.");let s=o.clientFor(k),f=[],n=[];if(e.poolId!==void 0){if(typeof e.poolId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.poolId))throw new b("poolId must be a 32-byte hex v4 poolId. For v3 search by tokenA/tokenB.");n=[await qe(s,e.poolId)]}else if(a){if(r!=="v4"&&(t?n.push(...await Be(s,a,t)):f.push("v3 pools are looked up per pair; pass tokenB to include them.")),r!=="v3")try{n.push(...await Re(s,a,t,f))}catch(l){throw F(l,-32601)?l:new b(`Could not search v4 pools. ${Y(l)}`)}}else{f.push("No token filter given: showing the pools Oak has measured. Pass tokenA (and tokenB) to search the chain for every pool of a pair.");let l=await Promise.all(B.map(async p=>{let[A,C]=await Promise.all([I(s,p.token0,k),I(s,p.token1,k)]);return Pe(s,p.address,A,C,p.fee)})),P=await Promise.all(y.map(p=>x(s,p.key,p.poolId)));n=[...r==="v4"?[]:l,...r==="v3"?[]:P]}$e(n);let w=new Set([...y.map(l=>l.poolId.toLowerCase()),...B.map(l=>l.address.toLowerCase())]),d=0;n=n.filter(l=>!l.highFee||w.has(l.id.toLowerCase())?!0:e.includeHighFeePools===!0?(l.note=`Do not trade here: ${l.feePercent} fee.${l.note?` ${l.note}`:""}`,!0):(d++,!1)),d&&f.push(`${d} pools with fees of 5% or more were left out. To see them, pass includeHighFeePools: true.`),n.sort((l,P)=>BigInt(P.liquidity)>BigInt(l.liquidity)?1:BigInt(P.liquidity)<BigInt(l.liquidity)?-1:0),n.length>i&&f.push(`Showing the ${i} deepest of ${n.length} pools found; raise limit (max ${R}) to see more.`),n=n.slice(0,i);let u=n.filter(l=>l.initialized&&BigInt(l.liquidity)>0n).length;return n.length===0&&d===0&&f.push("No pool exists for this pair. Create one with uniswap_create_pool, or create it and add the first liquidity together with uniswap_add plus initialPrice."),{pools:n,notes:f,summary:`Found ${n.length} Uniswap pool(s), ${u} with active liquidity. price is token1 per 1 token0.`}}function Ye(o){return{tools:[{name:"uniswap_pools",inputSchema:{type:"object",description:"Read-only pool discovery on Robinhood Chain (4663): every Uniswap v3 and v4 pool for a token pair with fee, tick spacing, hook, liquidity and price, or one v4 pool by poolId. No tokens given: the measured pools.",properties:{version:{type:"string",enum:["v3","v4"],description:"Limit to one version; omit to search both."},tokenA:{type:"string",description:'Token address, or "eth" for native ETH (searches v3 WETH and v4 native/WETH pools).'},tokenB:{type:"string",description:"Second token of the pair. Required for v3 lookups."},poolId:{type:"string",description:"32-byte v4 poolId to inspect."},includeHighFeePools:{description:"Include pools above the usual fee threshold in discovery.",type:"boolean"},limit:{description:"Maximum number of results to return, within the stated bounds.",type:"integer",minimum:1,maximum:R,default:ge}}},execute:async r=>He(o,r)}]}}export{He as a,Ye as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f}from"./
|
|
1
|
+
import{e as f}from"./MXI7LX2F.js";import{c as k}from"./SCG5HWMN.js";import{a as u}from"./66F5ZH34.js";import{i as p}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";var _="hoodlock_public",r="https://hoodlock.tech",h=["lp_locks","lp_lock","airdrop_history","airdrop_list","airdrop_list_by_root","featured","feature_tiers","buyback_status","referral_available","links"];function v(c){return{tools:[{name:_,inputSchema:{type:"object",properties:{route:{type:"string",enum:[...h],description:"Public HoodLock page to read: LP lock list or one lock, airdrop history or list, featured and feature tiers, buyback status, referral code check, or links."},id:u("Record id as a decimal string, for lp_lock, airdrop_list and links."),account:{type:"string",description:"Wallet address for airdrop_history. Defaults to the connected wallet."},token:{type:"string",description:"Token address, for the links route to build its token page link."},root:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Airdrop Merkle root as 0x followed by 64 hex digits, for airdrop_list_by_root."},code:{type:"string",minLength:1,maxLength:64,description:"Referral code to check, for referral_available."}},required:["route"],additionalProperties:!1},async execute(e,b){try{let a=String(e.route);if(!h.includes(a))throw new i("Choose a published HoodLock public read route.");let m=e.account??b,s=t=>p(t,"Provide a checksummed wallet or token address."),n=()=>f(e.id,"id").toString(),o;switch(a){case"links":{let t=e.id===void 0?void 0:n();return{source:r,links:{lockChecker:`${r}/lock-checker`,liquidityChecker:`${r}/liquidity-lock-checker`,burnChecker:`${r}/burn-checker`,vestingChecker:`${r}/vesting-checker`,embedDocs:`${r}/docs/embed`,badgeDocs:`${r}/docs/badge`,...e.token===void 0?{}:{token:`${r}/token/${s(e.token)}`},...t===void 0?{}:Object.fromEntries(["lock","burn","vesting","position"].map(l=>[l,`${r}/proof/${l}/${t}`]))},summary:"HoodLock-only records and integration links. Empty HoodLock results do not establish that no external locks or burns exist."}}case"lp_locks":o="/api/lp/locks";break;case"lp_lock":o=`/api/lp/lock/${n()}`;break;case"airdrop_history":o=`/api/airdrop/history?address=${s(m)}`;break;case"airdrop_list":o=`/api/airdrop/${n()}/list.json`;break;case"airdrop_list_by_root":if(typeof e.root!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.root))throw new i("Provide a bytes32 Merkle root.");o=`/api/airdrop/list-by-root/${e.root}.json`;break;case"featured":o="/api/featured";break;case"feature_tiers":o="/api/feature/tiers";break;case"referral_available":if(typeof e.code!="string"||e.code.length<1||e.code.length>64)throw new i("Provide a referral code with 1 to 64 characters.");o=`/api/aff/available?code=${encodeURIComponent(e.code)}`;break;default:o="/api/revenue/pool"}let d=`${r}${o}`,y=await k(c.http,d,{method:"GET",redirect:"error",signal:AbortSignal.timeout(1e4)},t=>t!==null&&typeof t=="object");return{source:d,data:y,untrusted:!0,summary:"Public off-chain HoodLock data. Verify custody, proofs, balances and authority on chain; API labels and indexes may lag. No transaction, authentication, payment or publication was performed."}}catch(a){throw new i(c.plainError(a))}}}]}}export{_ as a,v as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as mt}from"./O4S6XAYV.js";import{b as ht}from"./65OITTDL.js";import{b as bt}from"./LKUZAJPZ.js";import{b as gt}from"./R66NSNNQ.js";import{b as ft}from"./OY5W7ZSL.js";import{c as pt}from"./SX5YNFHG.js";import{b as wt}from"./GDOHHXNH.js";import{h as ut}from"./VXCGMALF.js";import{a as C,b as L,c as Ie,d as me,e as Ge,g as st,h as Ve,j as U,l as E,o as Fe,p as at,q as dt,r as Me,s as lt,t as qe,u as ct}from"./4NBXBKOX.js";import{i as rt}from"./2GXHYI23.js";import{b as ot,o as it}from"./GYPMUYB5.js";import{b as et}from"./SPJCSEKP.js";import{a as z}from"./43LI5NKJ.js";import{a as tt,c as nt}from"./SCG5HWMN.js";import{a as Pe}from"./66F5ZH34.js";import{b as ee}from"./IX3GZMTM.js";import{b as $,e as N,j as ce}from"./TI727O2H.js";import{a}from"./XSD5NL7J.js";import{a as Ee}from"./JXOEJPJ4.js";import{BaseError as _t,ContractFunctionRevertedError as Ye,decodeEventLog as zt,decodeFunctionResult as Jt,encodeFunctionData as X,erc20Abi as Xt,getAddress as B,parseAbi as ke,parseAbiItem as Yt,recoverAddress as Zt,recoverMessageAddress as Kt,recoverTypedDataAddress as Qt}from"viem";var en="https://priors.trade/api/check",He=604800n,yt=50n,$t=10000n,We=5000000n,St=500000000n,je=86400n,At=2592000n,Ze=`Register one with oak_setup {"mode":"register"}, then open Priors' 5 USDG starter line with priors_starter_line (a refundable 5 USDG bond, an invite from Priors' invite bot, your pool consent; each transaction and signature is confirmed).`,tn="0x6982e39521a070a3c40782548bfbed6dc8f566ef",nn=["0xcbb95bbf36099d34da091dc6fa6f49efa257cee3","0x284358abc07f9359f19f4b5b4ac91901be2597ba"],c={pool:B(ce[4663].priors.pool.address),lens:B(ce[4663].priors.lens.address),usdg:B(ce[4663].priors.usdg.address),registry:B(ce[4663].priors.registry.address),stockVault:B(ce[4663].priors.stockVault.address)},te={address:c.usdg,symbol:"USDG",decimals:N,chainId:$},S=ke(["function deposit(uint256 assets, address receiver, uint256 minShares) returns (uint256 minted)","function withdraw(uint256 shares_, address receiver) returns (uint256 out)","function quoteFee(uint256 agentId, uint256 principal, uint64 term) view returns (uint256 fee, uint256 sponsorCut, uint256 reserveCut, uint256 premium)","function borrow(uint256 agentId, uint256 amount, uint64 term, address to, uint256 maxFee) returns (uint256 loanId)","function repay(uint256 loanId, uint256 expectedAgentId, uint256 maxDue)","function shares(address lender) view returns (uint256)","function convertToAssets(uint256 shares_) view returns (uint256)","function lastDepositAt(address lender) view returns (uint64)","function isController(uint256 id, address who) view returns (bool)","function delegateOf(uint256 id) view returns (address)","function getAgent(uint256 id) view returns (bool enrolled, bool isRoot, bool defaulted, bool frozen, bool importedFromV1, uint64 enrolledAt, uint64 lastBorrowAt, uint64 lastRepayAt, uint256 sponsor, uint256 delegatedIn, uint256 delegatedOut, uint256 principalOut, uint256 activeLoans, uint256 premiumBps, uint256 premiumCap, uint256 loansRepaid, uint256 volumeRepaid, uint256 feesPaid, uint256 recourseHonored, uint256 childrenDefaulted, uint256 qualifiedRepaid, uint256 dollarSecondsRepaid)","function nonces(uint256 id) view returns (uint256)","function consentDigest((uint256 agentId, uint256 sponsorId, address owner, uint256 maxPremiumBps, uint256 nonce, uint256 deadline) c) view returns (bytes32)","function leave(uint256 agentId)","function loansOf(uint256 id) view returns (uint256[])","function getLoan(uint256 loanId) view returns (uint256 agentId, uint256 sponsorId, uint256 principal, uint256 fee, uint256 sponsorCut, uint256 reserveCut, uint256 premium, address owner, uint64 issuedAt, uint64 dueAt, uint64 defaultableAt, uint64 minScoreTerm, uint64 closedAt, uint8 status)","event Borrowed(uint256 indexed loanId, uint256 indexed agentId, uint256 indexed sponsorId, uint256 principal, uint256 fee, uint64 dueAt, address to)"]),vt=ke(["function available(uint256 agentId) view returns (uint256)","function score(uint256 id) view returns (uint256)"]),kt=ke(["function ownerOf(uint256 agentId) view returns (address)","function balanceOf(address owner) view returns (uint256)","function getAgentWallet(uint256 agentId) view returns (address)"]),Pt=ke(["function borrowRoom(uint256 agentId) view returns (uint256)","function assetList() view returns (address[])","function assets(address token) view returns (address feed, uint32 heartbeat, uint8 tokenDecimals, uint8 feedDecimals, bool enabled, uint16 ltvBps, uint256 lineCap)"]);function Y(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function on(e){return e.chainId===$&&e.address.toLowerCase()===c.usdg.toLowerCase()}function rn(e,i){let g=i.amount.trim(),u=g.startsWith("-"),f=u||g.startsWith("+")?g.slice(1):g,R=e.formatAmount(f,i.token.decimals),A=on(i.token)?"USDG":i.token.address;return`${u?"-":"+"}${R} ${A}`}function ne(e,i,g){if(!g.length)return i;let u=g.map(f=>rn(e,f)).join(", ");return`${i} Preview changes: ${u}.`}function It(e,i,g,u){let f=e[i]===void 0?void 0:ee(e[i]),R=e[g]===void 0?void 0:ee(e[g]);if(f!==void 0)return f;if(R!==void 0)return R;throw new a(`Provide ${u} as an integer string in base units ("${i}" or "${g}").`)}async function De(e,i,g){try{return B(await e.clientFor($).readContract({address:c.registry,abi:kt,functionName:"ownerOf",args:[i],blockNumber:g}))}catch(u){throw u instanceof _t&&u.walk(f=>f instanceof Ye)?new a(`ERC-8004 agent ${i} does not exist in registry ${c.registry}: it has no owner. Check the agent ID.`):new a(`Could not read the owner of ERC-8004 agent ${i} from registry ${c.registry}. Check the agent ID and retry when the registry is available.`)}}function pe(e,i){if(typeof e=="bigint"&&e>0n)return e;if(typeof e=="number"&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if(typeof e=="string"&&/^\d+$/.test(e.trim())){let g=BigInt(e.trim());if(g>0n)return g}throw new a(`Provide a positive integer ${i}.`)}function sn(e,i){let g=i!==void 0?pe(i,"agentId"):void 0,u=[];for(let f of e)if(!(!f||typeof f.address!="string")&&f.address.toLowerCase()===c.pool.toLowerCase()&&!(!Array.isArray(f.topics)||f.topics.length===0))try{let R=zt({abi:S,eventName:"Borrowed",data:f.data,topics:f.topics});if(g!==void 0&&R.args.agentId!==g)continue;u.push(R.args.loanId)}catch{continue}return u.length===0?null:u[u.length-1].toString()}function we(e){return{enrolled:!!e[0],isRoot:!!e[1],defaulted:!!e[2],frozen:!!e[3],importedFromV1:!!e[4],enrolledAt:BigInt(e[5]),lastBorrowAt:BigInt(e[6]),lastRepayAt:BigInt(e[7]),sponsor:BigInt(e[8]),delegatedIn:BigInt(e[9]),delegatedOut:BigInt(e[10]),principalOut:BigInt(e[11]),activeLoans:BigInt(e[12]),premiumBps:BigInt(e[13]),premiumCap:BigInt(e[14]),loansRepaid:BigInt(e[15]),volumeRepaid:BigInt(e[16]),feesPaid:BigInt(e[17]),recourseHonored:BigInt(e[18]),childrenDefaulted:BigInt(e[19]),qualifiedRepaid:BigInt(e[20]),dollarSecondsRepaid:BigInt(e[21])}}function Ce(e,i){return{loanId:e,agentId:BigInt(i[0]),sponsorId:BigInt(i[1]),principal:BigInt(i[2]),fee:BigInt(i[3]),sponsorCut:BigInt(i[4]),reserveCut:BigInt(i[5]),premium:BigInt(i[6]),owner:B(String(i[7])),issuedAt:BigInt(i[8]),dueAt:BigInt(i[9]),defaultableAt:BigInt(i[10]),minScoreTerm:BigInt(i[11]),closedAt:BigInt(i[12]),status:Number(i[13])}}async function _e(e,i){let g=e.clientFor($),u=await g.getBlockNumber({cacheTime:0}),f=await g.readContract({address:c.registry,abi:kt,functionName:"balanceOf",args:[i],blockNumber:u});if(f===0n)return[];if(typeof f!="bigint"||f<0n)throw new a("Registry balance is unavailable. Retry or provide an explicit agentId.");let R=[],A=new Set,x=u;for(;;){let H=x>9999999n?x-9999999n:0n,oe=await g.getLogs({address:c.registry,event:Yt("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:i},fromBlock:H,toBlock:x,strict:!0});for(let O of oe){let J=O.args.tokenId;if(O.removed||A.has(J))continue;if(A.add(J),(await De(e,J,u)).toLowerCase()===i.toLowerCase()&&R.push(J),BigInt(R.length)===f)return R.sort((Z,se)=>Z<se?-1:Z>se?1:0)}if(H===0n)throw new a("Owned identities could not all be located. Retry or provide an explicit agentId.");x=H-1n}}async function Re(e,i,g){if(i.agentId!==void 0&&i.agentId!==null&&String(i.agentId).trim()!=="")return pe(i.agentId,"agentId");let u=await _e(e,g);if(u.length===0)throw new a(`Priors borrowing needs an ERC-8004 agent identity with a Priors credit line, and this wallet owns no identity. ${Ze}`);return u[0]}async function ze(e,i,g){let u=e.clientFor($),f=await De(e,i),[R,A]=await Promise.all([u.readContract({address:c.pool,abi:S,functionName:"delegateOf",args:[i]}),u.readContract({address:c.pool,abi:S,functionName:"isController",args:[i,g]})]),x=B(R);if(!A)throw new a(`Wallet ${g} is not an on-chain controller for ERC-8004 agent ${i} (ownerOf=${f}, delegateOf=${x}). An off-chain /api/check paymentWallet match alone does not grant CreditPoolV2 control.`);return{owner:f,delegate:x}}function an(e,i){if(!i.enrolled||i.isRoot||i.sponsor===0n)throw new a(`ERC-8004 agent ${e} has no sponsor-backed Priors credit line on CreditPoolV2 yet (enrolled=${i.enrolled}, sponsor=${i.sponsor}, isRoot=${i.isRoot}). For an agent with no Priors record, priors_starter_line opens Priors' 5 USDG treasury line (a refundable 5 USDG bond, an invite from Priors' invite bot, your pool consent), then borrow.`);if(i.defaulted||i.frozen)throw new a(`ERC-8004 agent ${e} is not eligible to borrow on CreditPoolV2 (defaulted=${i.defaulted}, frozen=${i.frozen}).`);let g=i.delegatedIn>i.principalOut?i.delegatedIn-i.principalOut:0n;if(g<=0n)throw new a(`ERC-8004 agent ${e} has 0 USDG remaining credit capacity (delegatedIn=${i.delegatedIn}, principalOut=${i.principalOut}).`);return g}function dn(e){let i=e.borrowReceiptLogs??(Y(e.borrowReceipt)?e.borrowReceipt.logs:void 0);if(!Array.isArray(i))return[];let g=[];for(let u of i)Y(u)&&(typeof u.address!="string"||!Array.isArray(u.topics)||typeof u.data!="string"||g.push({address:u.address,topics:u.topics,data:u.data}));return g}var Je="0x0000000000000000000000000000000000000000",ue=()=>Math.floor(Date.now()/1e3),G=e=>new Date(Number(e)*1e3).toISOString(),V=(e,i)=>e.toLowerCase()===i.toLowerCase();function ye(e){let i=(g,u)=>Array.isArray(e)?e[u]:e[g];return{depositor:B(String(i("depositor",0))),at:BigInt(i("at",1)),amount:BigInt(i("amount",2))}}async function he(e,i,g){let u=e.clientFor($),f=await u.getBlockNumber({cacheTime:0}),[R,A,x,H,oe,O,J,ge,Z,se,Te]=await Promise.all([De(e,i,f),u.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[i],blockNumber:f}),u.readContract({address:L,abi:E,functionName:"firstLined",args:[i],blockNumber:f}),u.readContract({address:L,abi:E,functionName:"agentId",blockNumber:f}),u.readContract({address:L,abi:E,functionName:"rules",blockNumber:f}),u.readContract({address:L,abi:E,functionName:"epochRoom",blockNumber:f}),u.readContract({address:C,abi:U,functionName:"bonds",args:[i],blockNumber:f}),u.readContract({address:C,abi:U,functionName:"amount",blockNumber:f}),u.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[i],blockNumber:f}),u.readContract({address:C,abi:U,functionName:"unusedAfter",blockNumber:f}),u.readContract({address:c.usdg,abi:Xt,functionName:"balanceOf",args:[g],blockNumber:f})]);return{owner:R,agent:we(A),firstLined:x===!0,root:BigInt(H),firstLineAmount:BigInt(oe[1]),epochRoom:BigInt(O),bond:ye(J),bondAmount:BigInt(ge),releaseAt:BigInt(Z),unusedAfter:BigInt(se),usdg:BigInt(Te)}}function Ct(e,i){return e.enrolled||e.enrolledAt>0n||e.isRoot||e.defaulted||e.importedFromV1||e.loansRepaid>0n||e.sponsor!==0n||i}function Rt(e,i,g,u){let f=R=>`${e.formatAmount(R.toString(),N)} USDG`;if(i.defaulted)return"it defaulted: the pool marks it, and Priors never lends to it again";if(i.isRoot)return"it is a root: it backs other agents' lines";if(i.delegatedIn>0n){let R=i.sponsor===g?`Priors' treasury (root #${g})`:`root #${i.sponsor}`;return`it has a ${f(i.delegatedIn)} line from ${R}${i.activeLoans>0n?` with ${i.activeLoans} loan(s) open`:""}`}return`it has no line now${i.enrolledAt>0n?` (it enrolled at ${G(i.enrolledAt)})`:""}${u?`; Priors' treasury opened a line for it once, and another needs a person at ${Ge}`:""}`}async function Xe(e,i){let g;try{g=await e.http(me,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(i)})}catch(f){if(!(f instanceof tt))throw new a(`Priors' invite bot (${me}) could not be reached: ${e.plainError(f)}`);g=f.response}let u;try{u=JSON.parse(await g.text())}catch{u=void 0}if(!Y(u))throw new a(`Priors' invite bot (${me}) answered HTTP ${g.status} without a readable JSON object.`);return u}var be=e=>Ee(typeof e=="string"&&e?e:"no reason given");function ln(e,i){let g=i instanceof _t?i.walk(x=>x instanceof Ye):void 0,u=g instanceof Ye?g.data:void 0,f=u?.args??[],R=x=>`${e.formatAmount(String(x),N)} USDG`,A=u?.errorName;switch(A){case"EpochCapReached":return`Priors' treasury has no room for a new line this week (wanted ${R(f[0])}, ${R(f[1])} left); the treasury caps new lines each week, so ask again next week.`;case"InsufficientBacking":return`Priors' treasury root lacks free backing for the line now (requested ${R(f[1])}, free ${R(f[2])}); try again later.`;case"InviteExpired":return"the invite expired; call priors_starter_line again for a new one.";case"InviteUsed":return"the invite was already used.";case"NotInvited":return`the invite's signer ${String(f[1])} is not an inviter TreasurySponsorV4 names.`;case"AlreadyLined":return"the agent is already on a treasury line.";case"OwnerDefaulted":return"a default on this wallet's Priors record stops new treasury lines.";case"BadConsent":return"the pool refused the consent (its owner, nonce or signature no longer matches); call priors_starter_line again.";case"ConsentExpired":return"the consent expired; call priors_starter_line again.";case"Paused":return"the Priors pool is paused for new risk; try again later.";case void 0:return e.plainError(i);default:return`${A}(${f.map(String).join(", ")}).`}}var cn=e=>{let i={name:"priors_lend",inputSchema:{type:"object",properties:{assets:{type:"string",pattern:"^[0-9]+$",description:'USDG deposit amount in 6-decimal base units (e.g. "1000000" for 1 USDG).'},amount:{type:"string",pattern:"^[0-9]+$",description:'Alias for assets: USDG amount in base units (6 decimals). Example: "1000000" = 1 USDG.'},receiver:{type:"string",description:"Optional share receiver address (must be the signing wallet)."},minShares:{type:"string",pattern:"^[0-9]+$",description:"Minimum pool shares in base units; defaults to simulated minted shares less slippage."},slippageBps:{type:"integer",minimum:0,maximum:9999,description:"Slippage in basis points for the simulated share minimum (defaults to 50)."}}},async execute(n,s){z(s);let o=B(s),t=o;if(n.receiver!==void 0&&(typeof n.receiver!="string"||n.receiver.trim().toLowerCase()!==o.toLowerCase()))throw new a("Priors receiver must be the signing wallet.");let r=It(n,"assets","amount","USDG deposit amount");if(r<=0n)throw new a("Deposit amount must be greater than zero.");let p=n.minShares===void 0?void 0:ee(n.minShares),d=e.approval(c.usdg,c.pool,r.toString(),$);if(p===void 0){let l;try{let v=await e.clientFor($).simulateCalls({account:o,calls:[{to:d.to,data:d.data},{to:c.pool,data:X({abi:S,functionName:"deposit",args:[r,t,0n]})}]}),[I,_]=v.results;if(I?.status!=="success"||_?.status!=="success")throw new a("Approval or deposit simulation failed.");l=Jt({abi:S,functionName:"deposit",data:_.data})}catch(v){throw new a(`Could not simulate Priors deposit shares: ${e.plainError(v)}`)}if(p=ee(it(l.toString(),n.slippageBps??ot)),p===0n)throw new a("The simulated deposit cannot provide a positive minimum share amount.")}let w=e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"deposit",args:[r,t,p]}),value:"0",chainId:$,description:`Deposit ${r} USDG base units into Priors CreditPoolV2 (${c.pool}) for ${t}.`}),b=[d,w],m=await e.preview(b,o),P=`Approve ${e.formatAmount(r.toString(),N)} USDG and deposit into Priors CreditPoolV2 (${c.pool}) for ${t} (minShares=${p}; 7-day MIN_HOLD applies a 0.5% early-exit fee on early withdrawals).`;return{txs:b,summary:ne(e,P,m.changes)}}},g={name:"priors_withdraw",inputSchema:{type:"object",properties:{shares:{type:"string",pattern:"^[0-9]+$",description:"Pool share count in base units to redeem (not USDG amount; omit to redeem full wallet share balance)."},receiver:{type:"string",description:"Optional USDG receiver address (must be the signing wallet)."}}},async execute(n,s){z(s);let o=B(s),t=o;if(n.receiver!==void 0&&(typeof n.receiver!="string"||n.receiver.trim().toLowerCase()!==o.toLowerCase()))throw new a("Priors receiver must be the signing wallet.");let r=e.clientFor($),p=n.shares!==void 0?ee(n.shares):await r.readContract({address:c.pool,abi:S,functionName:"shares",args:[o]});if(p<=0n)throw new a(`Wallet ${o} has no Priors CreditPoolV2 shares to withdraw.`);let[d,w,b]=await Promise.all([r.readContract({address:c.pool,abi:S,functionName:"convertToAssets",args:[p]}),r.readContract({address:c.pool,abi:S,functionName:"lastDepositAt",args:[o]}),r.getBlock()]),m=w>0n&&b.timestamp<w+He,h=m?d*yt/$t:0n,P=d-h,v=[e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"withdraw",args:[p,t]}),value:"0",chainId:$,description:`Withdraw ${p} shares from Priors CreditPoolV2 (${c.pool}) to ${t}.`})],I=await e.preview(v,o),_=e.formatAmount(P.toString(),N),F=e.formatAmount(d.toString(),N),k=e.formatAmount(h.toString(),N),D=m?`inside 7-day MIN_HOLD: ${k} USDG (0.5%) early-exit fee stays in pool, net payout ${_} USDG from ${F} USDG gross`:`outside 7-day MIN_HOLD: no early-exit fee, net payout ${_} USDG`,M=`Withdraw ${p} shares from Priors CreditPoolV2 (${c.pool}) to ${t} (${D}).`;return{txs:v,summary:ne(e,M,I.changes)}}},u={name:"priors_borrow",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"ERC-8004 agent token ID with an already-funded Priors credit line."},principal:{type:"string",pattern:"^[0-9]+$",description:'Borrow principal in 6-decimal USDG base units (min "5000000" = 5 USDG).'},amount:{type:"string",pattern:"^[0-9]+$",description:'Alias for principal: USDG amount in base units (6 decimals). Example: "5000000" = 5 USDG.'},term:{type:"string",description:'Loan term in seconds (between 86400 and 2592000; defaults to "86400"). The origination fee is pro-rated by term, so a longer term costs more.'},recipient:{type:"string",description:"Optional USDG recipient address (must be the signing wallet)."},maxFee:{type:"string",description:"Optional fee ceiling in USDG base units (6 decimals); must equal the pool quote for this principal and term. Omit to use it. The fee is pro-rated by term, not flat: 1666 for 5 USDG over 1 day."}}},async execute(n,s){z(s);let o=B(s),t=o;if(n.recipient!==void 0&&(typeof n.recipient!="string"||n.recipient.trim().toLowerCase()!==o.toLowerCase()))throw new a("Priors recipient must be the signing wallet.");let r=await Re(e,n,o);await ze(e,r,o);let p=e.clientFor($),d=await p.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[r]}),w=we(d),b=an(r,w),m=It(n,"principal","amount","USDG borrow principal");if(m<We||m>St)throw new a(`Borrow principal must be between ${We} (5 USDG) and ${St} (500 USDG) base units.`);if(m>b)throw new a(`Borrow principal ${m} exceeds available credit line capacity ${b} USDG base units for agent ${r}.`);let h=n.term!==void 0&&String(n.term).trim()!==""?pe(n.term,"term"):je;if(h<je||h>At)throw new a(`Loan term must be between ${je} (1 day) and ${At} (30 days) seconds.`);let P=await p.readContract({address:c.pool,abi:S,functionName:"quoteFee",args:[r,m,h]}),l=P[0],v=n.maxFee!==void 0?ee(n.maxFee):l;if(v<l)throw new a(`Provided maxFee ${v} is below the origination fee the pool quotes for this term, ${l} USDG base units.`);if(v>l)throw new a(`Provided maxFee ${v} is above the quoted origination fee ${l} USDG base units. Use the quoted fee or omit maxFee.`);let I=m+l,_=m+v,k=[e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"borrow",args:[r,m,h,t,v]}),value:"0",chainId:$,description:`Borrow ${m} USDG base units on Priors CreditPoolV2 for agent ${r} to ${t} (quoted fee ${l}, expected debt ${I}, maxFee ${v}, debt ceiling ${_}).`})],D=await e.preview(k,o),M=e.formatAmount(m.toString(),N),W=e.formatAmount(l.toString(),N),ae=e.formatAmount(I.toString(),N),j=e.formatAmount(v.toString(),N),$e=e.formatAmount(_.toString(),N),q=P[1]+P[3],K=P[2],de=l-q-K,ie=`Borrow ${M} USDG for ERC-8004 agent ${r} to recipient ${t} on Priors CreditPoolV2 (${c.pool}) for ${h}s: expected origination fee ${W} USDG (${l} base units; pro-rated by term, set when the loan opens, none refunded on early repayment), expected total repayment due ${ae} USDG (${I} base units); fee ceiling ${j} USDG (${v} base units), debt ceiling ${$e} USDG (${_} base units). Fee recipient on repayment: CreditPoolV2 (${c.pool}), allocating the quoted fee to sponsor ${w.sponsor} (${q} base units including premium), reserve (${K} base units), and lenders (${de} base units).`;return{txs:k,summary:ne(e,ie,D.changes)}}},f={name:"priors_repay",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"ERC-8004 agent token ID that owns the active loan."},loanId:{type:"string",description:"Optional explicit per-agent loan ID (otherwise recovered from Borrowed receipt logs or loansOf(agentId))."},borrowReceiptLogs:{type:"array",description:"Optional receipt logs array from the borrow transaction to decode the exact Borrowed(loanId, agentId, ...) event."},maxDue:{type:"string",description:"Optional maximum USDG base units to repay; must equal the exact fixed principal + fee. Omit to use that debt."}}},async execute(n,s){z(s);let o=B(s),t=await Re(e,n,o);await ze(e,t,o);let r=e.clientFor($),p;if(n.loanId!==void 0&&n.loanId!==null&&String(n.loanId).trim()!=="")p=pe(n.loanId,"loanId");else{let k=dn(n);if(k.length>0){let D=sn(k,t);D!==null&&(p=BigInt(D))}}let d;if(p!==void 0){let k=await r.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[p]}),D=Ce(p,k);if(D.agentId!==t)throw new a(`Loan ${p} belongs to agent ${D.agentId}, not agent ${t}. Recover loan IDs from the Borrowed receipt or loansOf(agentId), never global loanCount().`);if(D.status!==1)throw new a(`Loan ${p} for agent ${t} is not active (status=${D.status}).`);d=D}else{let k=await r.readContract({address:c.pool,abi:S,functionName:"loansOf",args:[t]});if(k.length===0)throw new a(`ERC-8004 agent ${t} has no recorded loans on Priors CreditPoolV2.`);let M=(await Promise.all(k.map(async W=>{let ae=await r.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[W]});return Ce(W,ae)}))).filter(W=>W.agentId===t&&W.status===1);if(M.length===0)throw new a(`ERC-8004 agent ${t} has no active loans to repay.`);d=M[M.length-1]}let w=d.principal+d.fee,b=n.maxDue!==void 0?ee(n.maxDue):w;if(b<w)throw new a(`Provided maxDue ${b} is below the exact fixed loan debt ${w} USDG base units (principal ${d.principal} + fixed fee ${d.fee}).`);if(b>w)throw new a(`Provided maxDue ${b} is above the exact fixed loan debt ${w} USDG base units. Use the fixed debt or omit maxDue.`);let m=e.approval(c.usdg,c.pool,w.toString(),$),h=e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"repay",args:[d.loanId,t,b]}),value:"0",chainId:$,description:`Repay fixed debt ${w} USDG base units (principal ${d.principal} + fee ${d.fee}) for loan ${d.loanId} (agent ${t}).`}),P=[m,h],l=await e.preview(P,o),v=e.formatAmount(w.toString(),N),I=e.formatAmount(d.principal.toString(),N),_=e.formatAmount(d.fee.toString(),N),F=`Approve and repay ${v} USDG (${w} base units: ${I} USDG principal + ${_} USDG fixed fee) for Priors loan ${d.loanId} (agent ${t}).`;return{txs:P,summary:ne(e,F,l.changes)}}},R={name:"priors_status",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"Optional ERC-8004 agent ID to inspect on CreditPoolV2, PriorsLens, and StockVault."},includeApiCheck:{type:"boolean",description:"Optional flag to query https://priors.trade/api/check for supplemental off-chain metadata."}}},async execute(n,s){z(s);let o=B(s),t=e.clientFor($),[r,p,d,w]=await Promise.all([t.readContract({address:c.pool,abi:S,functionName:"shares",args:[o]}),t.readContract({address:c.pool,abi:S,functionName:"lastDepositAt",args:[o]}),t.getBlock(),t.readContract({address:c.stockVault,abi:Pt,functionName:"assetList"})]),b=r>0n?await t.readContract({address:c.pool,abi:S,functionName:"convertToAssets",args:[r]}):0n,m=r>0n&&p>0n&&d.timestamp<p+He,h=m?b*yt/$t:0n,P=b-h,l=null;if(n.agentId!==void 0&&n.agentId!==null&&String(n.agentId).trim()!=="")l=pe(n.agentId,"agentId");else{let q=await _e(e,o);q.length>0&&(l=q[0])}let v=null,I=!1,_=[],F=null,k=null,D=null,M=null,W=null,ae=null,j=`This wallet owns no ERC-8004 agent identity. ${Ze}`;if(l!==null){let[q,K,de,ie,Ut,Et,Be,Ne,xe]=await Promise.all([t.readContract({address:c.lens,abi:vt,functionName:"score",args:[l]}),t.readContract({address:L,abi:E,functionName:"firstLined",args:[l]}),t.readContract({address:L,abi:E,functionName:"agentId"}),t.readContract({address:L,abi:E,functionName:"rules"}),t.readContract({address:L,abi:E,functionName:"epochRoom"}),t.readContract({address:C,abi:U,functionName:"bonds",args:[l]}),t.readContract({address:C,abi:U,functionName:"amount"}),t.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[l]}),t.readContract({address:C,abi:U,functionName:"releasable",args:[l]})]),[Gt,Vt,Ft,Mt,qt,Ht]=await Promise.all([t.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[l]}),t.readContract({address:c.pool,abi:S,functionName:"loansOf",args:[l]}),t.readContract({address:c.lens,abi:vt,functionName:"available",args:[l]}),t.readContract({address:c.stockVault,abi:Pt,functionName:"borrowRoom",args:[l]}),t.readContract({address:c.pool,abi:S,functionName:"delegateOf",args:[l]}),t.readContract({address:c.pool,abi:S,functionName:"isController",args:[l,o]})]),Le=await De(e,l),Wt=B(qt),Ke=Ht,y=we(Gt),Se=y.delegatedIn>y.principalOut?y.delegatedIn-y.principalOut:0n;I=y.enrolled&&!y.isRoot&&!y.defaulted&&!y.frozen&&y.sponsor>0n&&y.delegatedIn>0n,F=Ft.toString(),k=Mt.toString();let jt=await Promise.all(Vt.map(async T=>{let le=await t.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[T]});return Ce(T,le)}));for(let T of jt)if(T.agentId===l&&T.status===1){let le=T.principal+T.fee;_.push({loanId:T.loanId.toString(),agentId:T.agentId.toString(),sponsorId:T.sponsorId.toString(),principal:T.principal.toString(),fee:T.fee.toString(),due:le.toString(),dueAt:T.dueAt.toString(),issuedAt:T.issuedAt.toString(),owner:T.owner,token:te})}v={agentId:l.toString(),owner:Le,delegate:Wt,isAuthorizedController:Ke,enrolled:y.enrolled,isRoot:y.isRoot,defaulted:y.defaulted,frozen:y.frozen,sponsorId:y.sponsor.toString(),delegatedIn:y.delegatedIn.toString(),delegatedOut:y.delegatedOut.toString(),principalOut:y.principalOut.toString(),availableCapacity:Se.toString(),activeLoansCount:y.activeLoans.toString(),loansRepaid:y.loansRepaid.toString(),volumeRepaid:y.volumeRepaid.toString(),feesPaid:y.feesPaid.toString(),importedFromV1:y.importedFromV1,qualifiedRepaid:y.qualifiedRepaid.toString(),dollarSecondsRepaid:y.dollarSecondsRepaid.toString()};let Ae=BigInt(de),Oe=K===!0,Q=ye(Et),re=Q.depositor!==Je,ve=re&&V(Q.depositor,o),Qe=Ct(y,Oe),Ue=V(Le,o);D={onchain:BigInt(q).toString(),scale:"0-1000",source:`CreditLensV2.score(${l}) at ${c.lens}, the score the pool computes on chain`,scoreV2:null},M={open:y.sponsor!==0n&&y.delegatedIn>0n,amount:y.delegatedIn.toString(),drawn:y.principalOut.toString(),available:Se.toString(),sponsorId:y.sponsor.toString(),backer:y.sponsor===0n?null:y.sponsor===Ae?`Priors' treasury v4 (root #${Ae})`:`root #${y.sponsor}`,token:te},W={contract:C,posted:re,depositor:re?Q.depositor:null,postedByWallet:ve,postedAt:re?Q.at.toString():null,amount:(re?Q.amount:BigInt(Be)).toString(),releasable:re&&xe===!0,releaseAt:re?BigInt(Ne).toString():null,rule:"Back to its depositor once the agent holds no line and has no loan open, from 4 days after it was posted (close a line first with priors_close_line); a default forfeits it to Priors' Safe."},ae={eligible:Ue&&!Qe,firstLined:Oe,lineAmount:BigInt(ie[1]).toString(),bondAmount:BigInt(Be).toString(),treasuryRoot:Ae.toString(),treasuryRoomThisWeek:BigInt(Ut).toString(),note:"Not instant: Priors' invite bot decides each invite, and the treasury caps new lines each week."};let fe=_.map(T=>({id:String(T.loanId),dueAt:BigInt(String(T.dueAt))})).sort((T,le)=>T.dueAt<le.dueAt?-1:T.dueAt>le.dueAt?1:0);y.defaulted?j=`Agent #${l} defaulted; Priors never lends to it again${ve?" and its bond is forfeited":""}.`:!Ke&&!Ue?j=`This wallet does not control agent #${l} on CreditPoolV2 (owner ${Le}); act from its owner or delegate.`:fe.length?j=`Repay loan ${fe[0].id} with priors_repay before it is due at ${G(fe[0].dueAt)}${fe.length>1?` (${fe.length} loans open)`:""}.`:I&&Se>=We?j=`Borrow with priors_borrow (5 USDG minimum, up to ${A(Se)}; the fee is pro-rated by term); Priors counts loans held 7 days or more toward the score.`:!Qe&&Ue?j=ve?`Call priors_starter_line again: the ${A(Q.amount)} bond is posted, and it goes on with the invite bot's ownership proof and the invite's redemption${xe===!0?", or priors_release_bond returns the bond":""}.`:`Call priors_starter_line: a refundable ${A(BigInt(Be))} bond, an invite from Priors' invite bot and your pool consent open a ${A(BigInt(ie[1]))} line from Priors' treasury (each transaction and signature is confirmed).`:ve?j=xe===!0?`Release the ${A(Q.amount)} invite bond with priors_release_bond.`:y.delegatedIn>0n?`The line is open with nothing to draw; to take the bond back, close it with priors_close_line, then priors_release_bond from ${G(BigInt(Ne))}.`:`The ${A(Q.amount)} invite bond comes back with priors_release_bond from ${G(BigInt(Ne))}.`:j=`Agent #${l} has a Priors record but no line to draw now; ${Rt(e,y,Ae,Oe)}.`}let $e=null;if(n.includeApiCheck){let q=l!==null?`agent=${l.toString()}`:`address=${o}`,K=await nt(e.http,`${en}?${q}`,{method:"GET"},Y),de=Array.isArray(K.agents)?K.agents.find(ie=>Y(ie)&&String(ie.agentId)===String(l)):void 0;D&&Y(de)&&(D.scoreV2=de.scoreV2??null),$e={...K,grantsPoolControl:!1,controlRule:"Off-chain /api/check identity or paymentWallet match never grants CreditPoolV2 control; on-chain isController(agentId, wallet) must authorize the caller; stale delegates do not qualify."}}return{chainId:$,blockNumber:d.number?.toString()??null,blockTimestamp:d.timestamp.toString(),wallet:o,token:te,contracts:c,lender:{shares:r.toString(),grossAssets:b.toString(),earlyExitFeeAssets:h.toString(),netWithdrawAssets:P.toString(),lastDepositAt:p.toString(),withinMinHoldWindow:m,minHoldSeconds:He.toString()},hasFundedLine:I,agentId:l!==null?l.toString():null,nextStep:j,score:D,line:M,bond:W,starterLine:ae,agent:v,activeLoans:_,lens:{address:c.lens,available:F,caveat:"PriorsLens.available(agentId) is a status capacity hint for already-funded lines; backer hooks may still refuse borrows."},stockVault:{address:c.stockVault,borrowRoom:k,onchainAssetCount:w.length,hostedMcpStockCount:35,extraNonStockAsset:B(tn),zeroCapAssets:nn.map(q=>B(q)),caveat:"Use priors_stock_assets and priors_stock_asset_state for current collateral rules, then priors_stock_open. This summary is an observed asset-count snapshot, not a fixed allowlist; live caps, lending holds and prices control admission."},apiCheck:$e,limitations:["Borrowing and repayment require a sponsor-backed ERC-8004 credit line (enrolled && !isRoot && sponsor != 0) authorized on-chain by isController(agentId, wallet).","Priors line routes are exposed by priors_line_options and priors_capabilities: treasury starter, V5 move/raise, direct sponsor, stock and owner PRIORS backing. Ethos execution uses Priors own owner workflow because its worker supplies no unsigned final transaction.","score.onchain is the pool's on-chain score (CreditLensV2); score.scoreV2 is Priors Score v2 from /api/check, present only with includeApiCheck.","Loan debt is the principal plus the origination fee the pool quotes for the term. The fee is pro-rated by term, not flat (1666 base units for 5 USDG over 1 day, observed live 2026-10-31; priors_borrow shows the exact quote), and is fixed once the loan opens: variable interest is never invented, and early repayment refunds none of it.","Loan IDs are recovered from decoded Borrowed receipts or per-agent loansOf(agentId), never global loanCount().","Historical archive event queries and zero-position StockVault lines on public RPCs remain subject to archive retention and live backer state."]}}},A=n=>`${e.formatAmount(n.toString(),N)} USDG`;function x(n){let s=V(n.bond.depositor,n.owner)&&n.bond.amount>0n?n.bond.amount:n.bondAmount;return`Bond first: ${A(s)} is locked in Priors' InviteBond for at least ${n.unusedAfter} seconds (${Number(n.unusedAfter)/86400} days) after posting${n.releaseAt>0n?`; unusedReleaseAt is ${G(n.releaseAt)}`:"; the exact release time is read after posting"}. Release requires no line and no open loan; default can forfeit the bond. Invites are not guaranteed. The credit score can lag qualifying repayments. `}function H(n,s,o){if(!V(o.owner,s))throw new a(`This wallet (${s}) does not own ERC-8004 agent ${n} (its owner is ${o.owner}). The bond, the ownership proof and the pool consent are the owner's. Nothing was signed.`);if(o.root!==Ie)throw new a(`TreasurySponsorV4 (${L}) answers root #${o.root}, not the pinned #${Ie}. Nothing was signed; update Oak.`);if(Ct(o.agent,o.firstLined))throw new a(`Agent #${n} already has a Priors record, so priors_starter_line posts no bond and signs nothing: ${Rt(e,o.agent,o.root,o.firstLined)}; ${o.agent.loansRepaid} loan(s) repaid. The starter line is only for an identity with no record; priors_status shows this one.`)}let oe="stays posted in InviteBond";function O(n){let s=n.agent.delegatedIn>0n?`with a line open it comes back only after priors_close_line (no loan open), then priors_release_bond from ${G(n.releaseAt)} at the earliest`:`while the agent holds no line it comes back with priors_release_bond from ${G(n.releaseAt)} (${Number(n.unusedAfter)/86400} days after it was posted)`;return`The ${A(n.bond.amount>0n?n.bond.amount:n.bondAmount)} bond ${oe} (${C}), posted from this wallet; ${s}, and priors_starter_line never posts a second bond.`}async function J(n,s,o){try{return await o()}catch(t){let r=t instanceof a?t.message:e.plainError(t);if(r.includes(oe)||n===void 0||!/^[0-9]{1,78}$/.test(n))throw t;let p;try{let d=await he(e,BigInt(n),s);p=V(d.bond.depositor,s)?O(d):""}catch{p=`If the bond transactions mined, the invite bond ${oe} (${C}) remains locked until its on-chain release conditions are met; priors_status shows the exact amount and time (its state could not be read just now).`}throw p?new a(`${r} ${p}`):t}}async function ge(n,s,o){let t=lt(await Xe(e,{agentId:n}),{agentId:n,owner:s,now:ue()});if(!t.ok&&t.refused)throw new a(`Priors' invite bot gave no ownership proof to sign for agent #${n}: ${be(t.why)}. Nothing was signed. ${o}`.trim());if(!t.ok)throw new a(`Not signed: the invite bot's answer for agent #${n} is not one Oak signs: ${t.why}. Oak signs only the bot's own start-page text, rebuilt locally for this agent and this wallet. ${o}`.trim());if(t.exp-ue()<120)throw new a(`Not signed: the invite bot's proof for agent #${n} expires in under 2 minutes; call priors_starter_line again for a new one. ${o}`.trim());return t}function Z(n,s,o,t){return{steps:[{kind:"message",message:o.message}],continuation:{stage:"proof",wallet:s,chainId:$,agentId:n,n:o.n,exp:o.exp},summary:`${x(t)}Priors starter line for ERC-8004 agent ${n}, step 2 of 3: sign Priors' invite-bot ownership proof. It is a message signature (EIP-191) only: it sends no transaction and moves no funds. The text is the bot's own form, rebuilt locally for agent #${n} and this wallet, request ${o.n}, expiring ${G(o.exp)}. Oak then sends the signature to ${me}, and the bot decides the invite. ${O(t)}`}}function se(n,s,o){if(n.chainId!==$||typeof n.wallet!="string"||!V(n.wallet,s)||typeof n.agentId!="string"||!/^[1-9][0-9]{0,29}$/.test(n.agentId))throw new a("Priors starter-line continuation does not match this wallet or chain 4663; start priors_starter_line again.");if(o.agentId!==void 0&&String(o.agentId)!==n.agentId)throw new a("Priors starter-line continuation is for another agent; start priors_starter_line again.");return BigInt(n.agentId)}async function Te(n,s){let o;if(n.agentId!==void 0&&n.agentId!==null&&String(n.agentId).trim()!=="")o=pe(n.agentId,"agentId");else{let l=await _e(e,s);if(!l.length)throw new a(`Priors' starter line needs an ERC-8004 agent identity, and this wallet owns none. ${Ze}`);o=l[0]}let t=await he(e,o,s);H(o,s,t);let r=o.toString(),p=V(t.bond.depositor,s);if(!p){if(t.usdg<t.bondAmount)throw new a(`This wallet holds ${A(t.usdg)} on Robinhood Chain, and Priors' treasury invite asks a ${A(t.bondAmount)} bond first (InviteBond ${C}), posted from this wallet. Nothing was signed: add USDG, then call priors_starter_line again.`);if(t.epochRoom<t.firstLineAmount)return{summary:`${x(t)}Not submitted. Priors' treasury has ${A(t.epochRoom)} of room left this week and a first line is ${A(t.firstLineAmount)}, so priors_starter_line posted no bond and signed nothing. The treasury caps new lines each week: ask again next week.`,starterLine:{agentId:r,open:!1,reason:"room",epochRoom:t.epochRoom.toString()}};let l=await Xe(e,{check:!0,owner:s.toLowerCase()});if(l.check!==!0)throw new a("Priors' invite bot did not answer its check, so whether an invite is open cannot be told. Nothing was signed.");if(l.ok!==!0)throw new a(`Whether an automatic invite is open could not be told: Priors' invite bot says ${be(l.error)}. Nothing was signed; try again later.`);if(l.open!==!0){let v=typeof l.reason=="string"?l.reason.replace(/[^a-z-]/g,"").slice(0,24):"",I=typeof l.reopensAt=="number"&&Number.isSafeInteger(l.reopensAt)&&l.reopensAt>0?l.reopensAt:null;return{summary:`${x(t)}Not submitted. No automatic invite is open to this wallet right now, so priors_starter_line posted no bond and signed nothing. Priors' invite bot answers: closed, reason ${Ee(v||"none given")}${I?`, reopens ${G(I)}`:""}. ${ct({...l,reason:v})} Priors lists its other ways to a first line (the Ethos lane, a stock line, the owner's $PRIORS stake) at https://priors.trade/skill.md.`,starterLine:{agentId:r,open:!1,reason:v||null,reopensAt:I}}}}let d=await ge(r,s,p?O(t):"");if(p)return Z(r,s,d,t);let w=[e.approval(c.usdg,C,t.bondAmount.toString(),$),e.unsignedTx({to:C,data:X({abi:U,functionName:"deposit",args:[o]}),value:"0",chainId:$,description:`Post the ${t.bondAmount} USDG base-unit Priors invite bond for agent ${r} in InviteBond (${C}).`})],b=await e.preview(w,s),m=t.bond.depositor!==Je?` This deposit replaces the bond ${t.bond.depositor} posted for this agent; InviteBond returns that bond to it in the same transaction.`:"",h=`${x(t)}Priors starter line for ERC-8004 agent ${r}, step 1 of 3: approve exactly ${A(t.bondAmount)} to Priors' InviteBond (${C}) and post it as the agent's refundable invite bond (InviteBond.deposit).${m} Priors' invite bot says an automatic invite is open now and gave the ownership proof to sign next. Step 2 signs that proof (a message, no transaction); step 3 signs your pool consent and redeems the invite (TreasurySponsorV4.firstLine, ${L}) for a ${A(t.firstLineAmount)} line from Priors' treasury (root #${t.root}). The invite is the bot's decision, not a promise: if it refuses, or any later step fails, the bond stays posted and comes back with priors_release_bond after the on-chain lock and release conditions are met. With a line, the bond comes back only once the line is closed with no loan open (priors_close_line, then priors_release_bond); a default forfeits it to Priors' Safe.`;return{steps:w.map(l=>({kind:"tx",tx:l})),continuation:{stage:"bond",wallet:s,chainId:$,agentId:r,n:d.n,exp:d.exp},summary:ne(e,h,b.changes)}}async function Dt(n,s,o){let t=await he(e,n,s);H(n,s,t);let r=n.toString();if(!V(t.bond.depositor,s))throw new a(`The invite bond for agent #${r} is not on chain from this wallet, so nothing more was signed. Check the deposit transaction, then call priors_starter_line again.`);return typeof o.n=="string"&&Ve.test(o.n)&&typeof o.exp=="number"&&Number.isSafeInteger(o.exp)&&o.exp-ue()>=300?Z(r,s,{n:o.n,exp:o.exp,message:Me(r,o.n,o.exp)},t):Z(r,s,await ge(r,s,O(t)),t)}async function Tt(n,s,o,t){let r=n.toString();if(typeof o.n!="string"||!Ve.test(o.n)||typeof o.exp!="number"||!Number.isSafeInteger(o.exp))throw new a("Invalid Priors starter-line proof continuation; start priors_starter_line again.");if(typeof t!="string"||!/^0x[0-9a-fA-F]{130}$/.test(t))throw new a("Provide this wallet's signature of the invite bot's ownership proof.");if(o.exp<=ue())throw new a(`The invite bot's proof for agent #${r} expired before it reached the bot; nothing was sent to it. Call priors_starter_line again for a fresh proof (the bond is not posted again).`);let p=Me(r,o.n,o.exp);if(!V(await Kt({message:p,signature:t}),s))throw new a("The ownership-proof signature is not this wallet's; nothing was sent to the invite bot.");let d=await he(e,n,s);if(H(n,s,d),!V(d.bond.depositor,s))throw new a(`The invite bond for agent #${r} is not on chain from this wallet; nothing was sent to the invite bot. Call priors_starter_line again.`);let w=await Xe(e,{n:o.n,signature:t});if(w.ok!==!0)throw new a(`Priors' invite bot gave no invite for agent #${r}: ${be(w.error)}. ${O(d)}`);if(typeof w.code!="string")throw new a(`Priors' invite bot gave no invite for agent #${r}${w.reason?`: ${be(w.reason)}`:""}${typeof w.decided=="string"?` (its decision: ${be(w.decided)})`:""}. ${O(d)}`);let b=qe(w.code,r,ue()+60);if(!b.ok)throw new a(`Priors' invite bot's code for agent #${r} is not one Oak redeems: ${b.why}. Nothing more was signed. ${O(d)}`);let m=e.clientFor($),h=await m.readContract({address:L,abi:E,functionName:"inviteDigest",args:[n,b.expiry]});if(h.toLowerCase()!==dt(n,b.expiry).toLowerCase())throw new a("TreasurySponsorV4's invite digest differs from its pinned EIP-712 domain; nothing more was signed. Update Oak.");let P=await Zt({hash:h,signature:b.signature}),[l,v]=await Promise.all([m.readContract({address:L,abi:E,functionName:"inviters",args:[P]}),m.readContract({address:L,abi:E,functionName:"inviteUsed",args:[h]})]);if(l!==!0)throw new a(`Priors' invite for agent #${r} was signed by ${P}, which TreasurySponsorV4 does not name an inviter, so the treasury would refuse it. Nothing more was signed. ${O(d)}`);if(v===!0)throw new a(`Priors' invite for agent #${r} was already used. Nothing more was signed. ${O(d)}`);let[I,_]=await Promise.all([m.readContract({address:c.pool,abi:S,functionName:"nonces",args:[n]}),m.getBlock()]),F=_.timestamp+BigInt(st),k=Fe({agentId:r,owner:s,nonce:I.toString(),deadline:F.toString()}),D=await m.readContract({address:c.pool,abi:S,functionName:"consentDigest",args:[{agentId:n,sponsorId:d.root,owner:s,maxPremiumBps:0n,nonce:I,deadline:F}]});if(D.toLowerCase()!==at(k).toLowerCase())throw new a(`The pool's consentDigest (${D}) differs from the consent Oak builds for CreditPoolV2 (${c.pool}), so the pool would refuse it. Nothing more was signed. ${O(d)}`);return{steps:[{kind:"typedData",request:k}],continuation:{stage:"consent",wallet:s,chainId:$,agentId:r,invite:w.code,request:k},summary:`Priors starter line for ERC-8004 agent ${r}, step 3 of 3: Priors' invite bot gave an invite (signed by ${P}, an inviter TreasurySponsorV4 names; it expires ${G(b.expiry)}). Sign your pool consent (EIP-712 "Priors Credit" version 2 on CreditPoolV2 ${c.pool}): it lets Priors' treasury (root #${d.root}) back a line for agent #${r} with premium 0, nonce ${I}, valid until ${G(F)}. A transaction redeeming the invite (TreasurySponsorV4.firstLine) follows for your confirmation. ${O(d)}`}}async function Bt(n,s,o,t){let r=n.toString();if(typeof t!="string"||!/^0x[0-9a-fA-F]{130}$/.test(t))throw new a("Provide this wallet's signature of the Priors pool consent.");let p=qe(o.invite,r,ue()+60);if(!p.ok)throw new a(`The invite for agent #${r} is not one Oak redeems now: ${p.why}. Call priors_starter_line again for a new one.`);let d=Y(o.request)&&Y(o.request.message)?o.request.message:void 0;if(!d||typeof d.nonce!="string"||!/^[0-9]{1,78}$/.test(d.nonce)||typeof d.deadline!="string"||!/^[0-9]{1,20}$/.test(d.deadline))throw new a("Invalid Priors starter-line consent continuation; start priors_starter_line again.");let w=Fe({agentId:r,owner:s,nonce:d.nonce,deadline:d.deadline});if(!V(await Qt({...w,signature:t}),s))throw new a("The pool-consent signature is not this wallet's for the consent Oak built; nothing was offered.");let b=await he(e,n,s);H(n,s,b);let m=e.clientFor($),[h,P]=await Promise.all([m.readContract({address:c.pool,abi:S,functionName:"nonces",args:[n]}),m.getBlock()]);if(h.toString()!==d.nonce)throw new a(`Agent #${r}'s consent nonce moved on chain since it was signed; nothing was offered. Call priors_starter_line again.`);if(P.timestamp>=BigInt(d.deadline))throw new a(`The pool consent for agent #${r} expired at ${G(BigInt(d.deadline))}; nothing was offered. Call priors_starter_line again.`);let l={agentId:n,sponsorId:Ie,owner:s,maxPremiumBps:0n,nonce:h,deadline:BigInt(d.deadline)},v=[n,p.expiry,p.signature,l,t];try{await m.simulateContract({address:L,abi:E,functionName:"firstLine",args:v,account:s})}catch(k){throw new a(`TreasurySponsorV4.firstLine for agent #${r} would be refused: ${ln(e,k)} Nothing was offered. ${O(b)}`)}let I=e.unsignedTx({to:L,data:X({abi:E,functionName:"firstLine",args:v}),value:"0",chainId:$,description:`Redeem Priors' invite for agent ${r}: TreasurySponsorV4.firstLine opens a ${b.firstLineAmount} USDG base-unit line from root ${b.root} with the owner's consent.`}),_=await e.preview([I],s),F=`Redeem agent #${r}'s Priors invite: TreasurySponsorV4.firstLine (${L}) opens a ${A(b.firstLineAmount)} line from Priors' treasury (root #${b.root}) with your signed consent. No USDG moves in this transaction. Then priors_status shows the line and priors_borrow draws it (5 USDG minimum; the fee is pro-rated by term; Priors counts loans held 7 days or more toward the score). The ${A(b.bondAmount)} bond stays in InviteBond until the line is closed with no loan open (priors_close_line, then priors_release_bond, from ${G(b.releaseAt)} at the earliest); a default forfeits it.`;return{txs:[I],summary:ne(e,F,_.changes)}}let Nt={name:"priors_starter_line",inputSchema:{description:"Bond first: the launch bond is 5 USDG, locked at least 4 days. The first result reads amount(), unusedAfter() and unusedReleaseAt(agentId) for current terms before any approval. Invites are not guaranteed; the credit score can lag. Release needs no line or open loan; default can forfeit the bond.",type:"object",additionalProperties:!1,properties:{agentId:Pe("ERC-8004 agent ID this wallet owns, with no Priors record yet (default: the first identity this wallet owns)."),continuation:{type:"object",description:"Opaque state from the previous starter-line step; pass it back unchanged. Omit on the first call; never build it by hand."},signature:{type:"string",pattern:"^0x([0-9a-fA-F]{2})+$",description:"Local signature for the confirmed starter-line step, as 0x hex; the bridge supplies it. Never a key."}}},async execute(n,s){z(s);let o=B(s);if(n.continuation===void 0){if(n.signature!==void 0)throw new a("A signature needs its Priors starter-line continuation; start priors_starter_line again.");return J(typeof n.agentId=="string"?n.agentId:void 0,o,()=>Te(n,o))}if(!Y(n.continuation))throw new a("Invalid Priors starter-line continuation; start priors_starter_line again.");let t=n.continuation,r=se(t,o,n),p=d=>J(r.toString(),o,d);if(t.stage==="bond"){if(n.signature!==void 0)throw new a("The bond stage takes no signature; start priors_starter_line again.");return p(()=>Dt(r,o,t))}if(t.stage==="proof")return p(()=>Tt(r,o,t,n.signature));if(t.stage==="consent")return p(()=>Bt(r,o,t,n.signature));throw new a("Unknown Priors starter-line stage; start priors_starter_line again.")}},xt={name:"priors_close_line",inputSchema:{type:"object",properties:{agentId:Pe("ERC-8004 agent ID whose Priors line to close (default: the first identity this wallet owns).")}},async execute(n,s){z(s);let o=B(s),t=await Re(e,n,o);await ze(e,t,o);let r=e.clientFor($),[p,d,w,b]=await Promise.all([r.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[t]}),r.readContract({address:C,abi:U,functionName:"bonds",args:[t]}),r.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[t]}),r.readContract({address:L,abi:E,functionName:"agentId"})]),m=we(p);if(m.sponsor===0n)throw new a(`Agent #${t} has no Priors line to close (no sponsor on CreditPoolV2).`);if(m.activeLoans>0n)throw new a(`Agent #${t} has ${m.activeLoans} loan(s) open; repay them with priors_repay first. The pool's leave refuses while a loan is open.`);let h=ye(d),P=m.sponsor===BigInt(b),l=e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"leave",args:[t]}),value:"0",chainId:$,description:`Close agent ${t}'s Priors line on CreditPoolV2 (leave): the ${m.delegatedIn} USDG base-unit line returns to root ${m.sponsor}.`}),v=await e.preview([l],o),I=V(h.depositor,o)?` Its ${A(h.amount)} invite bond can then come back with priors_release_bond from ${G(w)} (4 days after it was posted).`:"",_=`Close agent #${t}'s Priors line (CreditPoolV2.leave, ${c.pool}): the whole ${A(m.delegatedIn)} line goes back to its backer (${P?`Priors' treasury, root #${b}`:`root #${m.sponsor}`}) and the agent can no longer borrow on it. This does not reopen: ${P?`priors_starter_line opens no second treasury line for an agent with a Priors record; another needs a person at ${Ge}.`:"a new line needs a backer's new consent."}${I} No USDG moves in this transaction.`;return{txs:[l],summary:ne(e,_,v.changes)}}},Lt={name:"priors_release_bond",inputSchema:{type:"object",properties:{agentId:Pe("ERC-8004 agent ID whose InviteBond bond this wallet posted (default: the first identity this wallet owns).")}},async execute(n,s){z(s);let o=B(s),t=await Re(e,n,o),r=e.clientFor($),[p,d,w,b,m]=await Promise.all([r.readContract({address:C,abi:U,functionName:"bonds",args:[t]}),r.readContract({address:C,abi:U,functionName:"releasable",args:[t]}),r.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[t]}),r.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[t]}),r.getBlock()]),h=ye(p);if(h.depositor===Je)throw new a(`Agent #${t} has no bond in Priors' InviteBond (${C}).`);if(!V(h.depositor,o))throw new a(`Agent #${t}'s InviteBond bond was posted by ${h.depositor}, not this wallet, and InviteBond.release pays the depositor. Oak releases only a bond this wallet posted.`);if(d!==!0){let I=we(b),_=I.defaulted?"the agent defaulted, so the bond is forfeited to Priors' Safe (InviteBond.slash)":I.activeLoans>0n?`the agent has ${I.activeLoans} loan(s) open: repay with priors_repay, close the line with priors_close_line, then release`:I.delegatedIn>0n?`the agent still holds a ${A(I.delegatedIn)} line: close it with priors_close_line (no loan may be open), then release`:m.timestamp<w?`it comes back 4 days after it was posted, from ${G(w)}`:"InviteBond does not release it yet";throw new a(`Agent #${t}'s ${A(h.amount)} invite bond cannot be released now: ${_}. Nothing was signed.`)}let P=e.unsignedTx({to:C,data:X({abi:U,functionName:"release",args:[t]}),value:"0",chainId:$,description:`Release agent ${t}'s ${h.amount} USDG base-unit Priors invite bond from InviteBond (${C}) to its depositor ${h.depositor}.`}),l=await e.preview([P],o),v=`Release agent #${t}'s ${A(h.amount)} invite bond from Priors' InviteBond (${C}): InviteBond.release returns it to its depositor, this wallet (${o}).`;return{txs:[P],summary:ne(e,v,l.changes)}}};async function Ot(n){z(n);let s=B(n),o=e.clientFor($),[t,r]=await Promise.all([o.readContract({address:c.pool,abi:S,functionName:"shares",args:[s]}),_e(e,s)]),p=[];if(t>0n){let d=await o.readContract({address:c.pool,abi:S,functionName:"convertToAssets",args:[t]});p.push({module:"priors",id:`priors:lender:${s.toLowerCase()}`,chainId:$,assets:[{token:te,amount:d.toString()}],description:`Priors CreditPoolV2 lender position (${t} shares = ${e.formatAmount(d.toString(),N)} USDG gross).`})}for(let d of r){let w=await o.readContract({address:c.pool,abi:S,functionName:"loansOf",args:[d]}),b=await Promise.all(w.map(async h=>{let P=await o.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[h]});return Ce(h,P)}));for(let h of b)if(h.agentId===d&&h.status===1){let P=h.principal+h.fee;p.push({module:"priors",id:`priors:loan:${h.loanId.toString()}`,chainId:$,assets:[],liabilities:[{token:te,amount:P.toString()}],economics:{principal:[],debt:[rt({token:te,amount:P.toString(),source:"priors.loan.fixedDue",dueAt:h.dueAt.toString()})],rewards:[],backing:[],coverage:{complete:!0}},description:`Priors CreditPoolV2 active loan ${h.loanId} for agent ${d} (fixed due ${e.formatAmount(P.toString(),N)} USDG = ${h.principal} principal + ${h.fee} fee).`})}let m=ye(await o.readContract({address:C,abi:U,functionName:"bonds",args:[d]}));m.amount>0n&&V(m.depositor,s)&&p.push({module:"priors",id:`priors:bond:${d.toString()}`,chainId:$,assets:[{token:te,amount:m.amount.toString()}],description:`Priors invite bond for agent ${d} in InviteBond (${C}): ${A(m.amount)}, back with priors_release_bond once the agent holds no line and no loan, from 4 days after posting; a default forfeits it.`})}return p.push(...await ft(e,s,r,te)),p}return{tools:[i,g,u,f,R,Nt,xt,Lt],positions:Ot}},un=e=>{let i=cn(e),g=[i,ut(e),pt(e),mt(e),ht(e),bt(e),wt(e),gt()];return{...i,tools:g.flatMap(u=>u.tools)}},Bn=e=>et("priors",[un(e)]);export{en as a,He as b,yt as c,$t as d,We as e,St as f,je as g,At as h,c as i,te as j,sn as k,un as l,Bn as m};
|
|
1
|
+
import{b as wt}from"./RLX6YTNT.js";import{c as mt}from"./O7L55XM3.js";import{b as ht}from"./W73SLWBT.js";import{b as bt}from"./DV2HVFTM.js";import{b as gt}from"./2BKZLF5A.js";import{c as pt}from"./4GAU3JLN.js";import{b as ft}from"./2H2OZE6X.js";import{h as ut}from"./BWE5PXRE.js";import{a as C,b as L,c as Ie,d as me,e as Ge,g as st,h as Ve,j as U,l as E,o as Fe,p as at,q as dt,r as Me,s as lt,t as qe,u as ct}from"./OD7CY6BY.js";import{i as rt}from"./2GXHYI23.js";import{b as ot,o as it}from"./TTBB6EFN.js";import{b as et}from"./SPJCSEKP.js";import{a as z}from"./43LI5NKJ.js";import{a as tt,c as nt}from"./SCG5HWMN.js";import{a as Pe}from"./66F5ZH34.js";import{b as ee}from"./IX3GZMTM.js";import{b as $,e as N,j as ce}from"./EWZFZUVF.js";import{a}from"./XSD5NL7J.js";import{a as Ee}from"./JXOEJPJ4.js";import{BaseError as _t,ContractFunctionRevertedError as Ye,decodeEventLog as zt,decodeFunctionResult as Jt,encodeFunctionData as X,erc20Abi as Xt,getAddress as B,parseAbi as ke,parseAbiItem as Yt,recoverAddress as Zt,recoverMessageAddress as Kt,recoverTypedDataAddress as Qt}from"viem";var en="https://priors.trade/api/check",He=604800n,yt=50n,$t=10000n,We=5000000n,St=500000000n,je=86400n,At=2592000n,Ze=`Register one with oak_setup {"mode":"register"}, then open Priors' 5 USDG starter line with priors_starter_line (a refundable 5 USDG bond, an invite from Priors' invite bot, your pool consent; each transaction and signature is confirmed).`,tn="0x6982e39521a070a3c40782548bfbed6dc8f566ef",nn=["0xcbb95bbf36099d34da091dc6fa6f49efa257cee3","0x284358abc07f9359f19f4b5b4ac91901be2597ba"],c={pool:B(ce[4663].priors.pool.address),lens:B(ce[4663].priors.lens.address),usdg:B(ce[4663].priors.usdg.address),registry:B(ce[4663].priors.registry.address),stockVault:B(ce[4663].priors.stockVault.address)},te={address:c.usdg,symbol:"USDG",decimals:N,chainId:$},S=ke(["function deposit(uint256 assets, address receiver, uint256 minShares) returns (uint256 minted)","function withdraw(uint256 shares_, address receiver) returns (uint256 out)","function quoteFee(uint256 agentId, uint256 principal, uint64 term) view returns (uint256 fee, uint256 sponsorCut, uint256 reserveCut, uint256 premium)","function borrow(uint256 agentId, uint256 amount, uint64 term, address to, uint256 maxFee) returns (uint256 loanId)","function repay(uint256 loanId, uint256 expectedAgentId, uint256 maxDue)","function shares(address lender) view returns (uint256)","function convertToAssets(uint256 shares_) view returns (uint256)","function lastDepositAt(address lender) view returns (uint64)","function isController(uint256 id, address who) view returns (bool)","function delegateOf(uint256 id) view returns (address)","function getAgent(uint256 id) view returns (bool enrolled, bool isRoot, bool defaulted, bool frozen, bool importedFromV1, uint64 enrolledAt, uint64 lastBorrowAt, uint64 lastRepayAt, uint256 sponsor, uint256 delegatedIn, uint256 delegatedOut, uint256 principalOut, uint256 activeLoans, uint256 premiumBps, uint256 premiumCap, uint256 loansRepaid, uint256 volumeRepaid, uint256 feesPaid, uint256 recourseHonored, uint256 childrenDefaulted, uint256 qualifiedRepaid, uint256 dollarSecondsRepaid)","function nonces(uint256 id) view returns (uint256)","function consentDigest((uint256 agentId, uint256 sponsorId, address owner, uint256 maxPremiumBps, uint256 nonce, uint256 deadline) c) view returns (bytes32)","function leave(uint256 agentId)","function loansOf(uint256 id) view returns (uint256[])","function getLoan(uint256 loanId) view returns (uint256 agentId, uint256 sponsorId, uint256 principal, uint256 fee, uint256 sponsorCut, uint256 reserveCut, uint256 premium, address owner, uint64 issuedAt, uint64 dueAt, uint64 defaultableAt, uint64 minScoreTerm, uint64 closedAt, uint8 status)","event Borrowed(uint256 indexed loanId, uint256 indexed agentId, uint256 indexed sponsorId, uint256 principal, uint256 fee, uint64 dueAt, address to)"]),vt=ke(["function available(uint256 agentId) view returns (uint256)","function score(uint256 id) view returns (uint256)"]),kt=ke(["function ownerOf(uint256 agentId) view returns (address)","function balanceOf(address owner) view returns (uint256)","function getAgentWallet(uint256 agentId) view returns (address)"]),Pt=ke(["function borrowRoom(uint256 agentId) view returns (uint256)","function assetList() view returns (address[])","function assets(address token) view returns (address feed, uint32 heartbeat, uint8 tokenDecimals, uint8 feedDecimals, bool enabled, uint16 ltvBps, uint256 lineCap)"]);function Y(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function on(e){return e.chainId===$&&e.address.toLowerCase()===c.usdg.toLowerCase()}function rn(e,i){let g=i.amount.trim(),u=g.startsWith("-"),f=u||g.startsWith("+")?g.slice(1):g,R=e.formatAmount(f,i.token.decimals),A=on(i.token)?"USDG":i.token.address;return`${u?"-":"+"}${R} ${A}`}function ne(e,i,g){if(!g.length)return i;let u=g.map(f=>rn(e,f)).join(", ");return`${i} Preview changes: ${u}.`}function It(e,i,g,u){let f=e[i]===void 0?void 0:ee(e[i]),R=e[g]===void 0?void 0:ee(e[g]);if(f!==void 0)return f;if(R!==void 0)return R;throw new a(`Provide ${u} as an integer string in base units ("${i}" or "${g}").`)}async function De(e,i,g){try{return B(await e.clientFor($).readContract({address:c.registry,abi:kt,functionName:"ownerOf",args:[i],blockNumber:g}))}catch(u){throw u instanceof _t&&u.walk(f=>f instanceof Ye)?new a(`ERC-8004 agent ${i} does not exist in registry ${c.registry}: it has no owner. Check the agent ID.`):new a(`Could not read the owner of ERC-8004 agent ${i} from registry ${c.registry}. Check the agent ID and retry when the registry is available.`)}}function pe(e,i){if(typeof e=="bigint"&&e>0n)return e;if(typeof e=="number"&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if(typeof e=="string"&&/^\d+$/.test(e.trim())){let g=BigInt(e.trim());if(g>0n)return g}throw new a(`Provide a positive integer ${i}.`)}function sn(e,i){let g=i!==void 0?pe(i,"agentId"):void 0,u=[];for(let f of e)if(!(!f||typeof f.address!="string")&&f.address.toLowerCase()===c.pool.toLowerCase()&&!(!Array.isArray(f.topics)||f.topics.length===0))try{let R=zt({abi:S,eventName:"Borrowed",data:f.data,topics:f.topics});if(g!==void 0&&R.args.agentId!==g)continue;u.push(R.args.loanId)}catch{continue}return u.length===0?null:u[u.length-1].toString()}function we(e){return{enrolled:!!e[0],isRoot:!!e[1],defaulted:!!e[2],frozen:!!e[3],importedFromV1:!!e[4],enrolledAt:BigInt(e[5]),lastBorrowAt:BigInt(e[6]),lastRepayAt:BigInt(e[7]),sponsor:BigInt(e[8]),delegatedIn:BigInt(e[9]),delegatedOut:BigInt(e[10]),principalOut:BigInt(e[11]),activeLoans:BigInt(e[12]),premiumBps:BigInt(e[13]),premiumCap:BigInt(e[14]),loansRepaid:BigInt(e[15]),volumeRepaid:BigInt(e[16]),feesPaid:BigInt(e[17]),recourseHonored:BigInt(e[18]),childrenDefaulted:BigInt(e[19]),qualifiedRepaid:BigInt(e[20]),dollarSecondsRepaid:BigInt(e[21])}}function Ce(e,i){return{loanId:e,agentId:BigInt(i[0]),sponsorId:BigInt(i[1]),principal:BigInt(i[2]),fee:BigInt(i[3]),sponsorCut:BigInt(i[4]),reserveCut:BigInt(i[5]),premium:BigInt(i[6]),owner:B(String(i[7])),issuedAt:BigInt(i[8]),dueAt:BigInt(i[9]),defaultableAt:BigInt(i[10]),minScoreTerm:BigInt(i[11]),closedAt:BigInt(i[12]),status:Number(i[13])}}async function _e(e,i){let g=e.clientFor($),u=await g.getBlockNumber({cacheTime:0}),f=await g.readContract({address:c.registry,abi:kt,functionName:"balanceOf",args:[i],blockNumber:u});if(f===0n)return[];if(typeof f!="bigint"||f<0n)throw new a("Registry balance is unavailable. Retry or provide an explicit agentId.");let R=[],A=new Set,x=u;for(;;){let H=x>9999999n?x-9999999n:0n,oe=await g.getLogs({address:c.registry,event:Yt("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:i},fromBlock:H,toBlock:x,strict:!0});for(let O of oe){let J=O.args.tokenId;if(O.removed||A.has(J))continue;if(A.add(J),(await De(e,J,u)).toLowerCase()===i.toLowerCase()&&R.push(J),BigInt(R.length)===f)return R.sort((Z,se)=>Z<se?-1:Z>se?1:0)}if(H===0n)throw new a("Owned identities could not all be located. Retry or provide an explicit agentId.");x=H-1n}}async function Re(e,i,g){if(i.agentId!==void 0&&i.agentId!==null&&String(i.agentId).trim()!=="")return pe(i.agentId,"agentId");let u=await _e(e,g);if(u.length===0)throw new a(`Priors borrowing needs an ERC-8004 agent identity with a Priors credit line, and this wallet owns no identity. ${Ze}`);return u[0]}async function ze(e,i,g){let u=e.clientFor($),f=await De(e,i),[R,A]=await Promise.all([u.readContract({address:c.pool,abi:S,functionName:"delegateOf",args:[i]}),u.readContract({address:c.pool,abi:S,functionName:"isController",args:[i,g]})]),x=B(R);if(!A)throw new a(`Wallet ${g} is not an on-chain controller for ERC-8004 agent ${i} (ownerOf=${f}, delegateOf=${x}). An off-chain /api/check paymentWallet match alone does not grant CreditPoolV2 control.`);return{owner:f,delegate:x}}function an(e,i){if(!i.enrolled||i.isRoot||i.sponsor===0n)throw new a(`ERC-8004 agent ${e} has no sponsor-backed Priors credit line on CreditPoolV2 yet (enrolled=${i.enrolled}, sponsor=${i.sponsor}, isRoot=${i.isRoot}). For an agent with no Priors record, priors_starter_line opens Priors' 5 USDG treasury line (a refundable 5 USDG bond, an invite from Priors' invite bot, your pool consent), then borrow.`);if(i.defaulted||i.frozen)throw new a(`ERC-8004 agent ${e} is not eligible to borrow on CreditPoolV2 (defaulted=${i.defaulted}, frozen=${i.frozen}).`);let g=i.delegatedIn>i.principalOut?i.delegatedIn-i.principalOut:0n;if(g<=0n)throw new a(`ERC-8004 agent ${e} has 0 USDG remaining credit capacity (delegatedIn=${i.delegatedIn}, principalOut=${i.principalOut}).`);return g}function dn(e){let i=e.borrowReceiptLogs??(Y(e.borrowReceipt)?e.borrowReceipt.logs:void 0);if(!Array.isArray(i))return[];let g=[];for(let u of i)Y(u)&&(typeof u.address!="string"||!Array.isArray(u.topics)||typeof u.data!="string"||g.push({address:u.address,topics:u.topics,data:u.data}));return g}var Je="0x0000000000000000000000000000000000000000",ue=()=>Math.floor(Date.now()/1e3),G=e=>new Date(Number(e)*1e3).toISOString(),V=(e,i)=>e.toLowerCase()===i.toLowerCase();function ye(e){let i=(g,u)=>Array.isArray(e)?e[u]:e[g];return{depositor:B(String(i("depositor",0))),at:BigInt(i("at",1)),amount:BigInt(i("amount",2))}}async function he(e,i,g){let u=e.clientFor($),f=await u.getBlockNumber({cacheTime:0}),[R,A,x,H,oe,O,J,ge,Z,se,Te]=await Promise.all([De(e,i,f),u.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[i],blockNumber:f}),u.readContract({address:L,abi:E,functionName:"firstLined",args:[i],blockNumber:f}),u.readContract({address:L,abi:E,functionName:"agentId",blockNumber:f}),u.readContract({address:L,abi:E,functionName:"rules",blockNumber:f}),u.readContract({address:L,abi:E,functionName:"epochRoom",blockNumber:f}),u.readContract({address:C,abi:U,functionName:"bonds",args:[i],blockNumber:f}),u.readContract({address:C,abi:U,functionName:"amount",blockNumber:f}),u.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[i],blockNumber:f}),u.readContract({address:C,abi:U,functionName:"unusedAfter",blockNumber:f}),u.readContract({address:c.usdg,abi:Xt,functionName:"balanceOf",args:[g],blockNumber:f})]);return{owner:R,agent:we(A),firstLined:x===!0,root:BigInt(H),firstLineAmount:BigInt(oe[1]),epochRoom:BigInt(O),bond:ye(J),bondAmount:BigInt(ge),releaseAt:BigInt(Z),unusedAfter:BigInt(se),usdg:BigInt(Te)}}function Ct(e,i){return e.enrolled||e.enrolledAt>0n||e.isRoot||e.defaulted||e.importedFromV1||e.loansRepaid>0n||e.sponsor!==0n||i}function Rt(e,i,g,u){let f=R=>`${e.formatAmount(R.toString(),N)} USDG`;if(i.defaulted)return"it defaulted: the pool marks it, and Priors never lends to it again";if(i.isRoot)return"it is a root: it backs other agents' lines";if(i.delegatedIn>0n){let R=i.sponsor===g?`Priors' treasury (root #${g})`:`root #${i.sponsor}`;return`it has a ${f(i.delegatedIn)} line from ${R}${i.activeLoans>0n?` with ${i.activeLoans} loan(s) open`:""}`}return`it has no line now${i.enrolledAt>0n?` (it enrolled at ${G(i.enrolledAt)})`:""}${u?`; Priors' treasury opened a line for it once, and another needs a person at ${Ge}`:""}`}async function Xe(e,i){let g;try{g=await e.http(me,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(i)})}catch(f){if(!(f instanceof tt))throw new a(`Priors' invite bot (${me}) could not be reached: ${e.plainError(f)}`);g=f.response}let u;try{u=JSON.parse(await g.text())}catch{u=void 0}if(!Y(u))throw new a(`Priors' invite bot (${me}) answered HTTP ${g.status} without a readable JSON object.`);return u}var be=e=>Ee(typeof e=="string"&&e?e:"no reason given");function ln(e,i){let g=i instanceof _t?i.walk(x=>x instanceof Ye):void 0,u=g instanceof Ye?g.data:void 0,f=u?.args??[],R=x=>`${e.formatAmount(String(x),N)} USDG`,A=u?.errorName;switch(A){case"EpochCapReached":return`Priors' treasury has no room for a new line this week (wanted ${R(f[0])}, ${R(f[1])} left); the treasury caps new lines each week, so ask again next week.`;case"InsufficientBacking":return`Priors' treasury root lacks free backing for the line now (requested ${R(f[1])}, free ${R(f[2])}); try again later.`;case"InviteExpired":return"the invite expired; call priors_starter_line again for a new one.";case"InviteUsed":return"the invite was already used.";case"NotInvited":return`the invite's signer ${String(f[1])} is not an inviter TreasurySponsorV4 names.`;case"AlreadyLined":return"the agent is already on a treasury line.";case"OwnerDefaulted":return"a default on this wallet's Priors record stops new treasury lines.";case"BadConsent":return"the pool refused the consent (its owner, nonce or signature no longer matches); call priors_starter_line again.";case"ConsentExpired":return"the consent expired; call priors_starter_line again.";case"Paused":return"the Priors pool is paused for new risk; try again later.";case void 0:return e.plainError(i);default:return`${A}(${f.map(String).join(", ")}).`}}var cn=e=>{let i={name:"priors_lend",inputSchema:{type:"object",properties:{assets:{type:"string",pattern:"^[0-9]+$",description:'USDG deposit amount in 6-decimal base units (e.g. "1000000" for 1 USDG).'},amount:{type:"string",pattern:"^[0-9]+$",description:'Alias for assets: USDG amount in base units (6 decimals). Example: "1000000" = 1 USDG.'},receiver:{type:"string",description:"Optional share receiver address (must be the signing wallet)."},minShares:{type:"string",pattern:"^[0-9]+$",description:"Minimum pool shares in base units; defaults to simulated minted shares less slippage."},slippageBps:{type:"integer",minimum:0,maximum:9999,description:"Slippage in basis points for the simulated share minimum (defaults to 50)."}}},async execute(n,s){z(s);let o=B(s),t=o;if(n.receiver!==void 0&&(typeof n.receiver!="string"||n.receiver.trim().toLowerCase()!==o.toLowerCase()))throw new a("Priors receiver must be the signing wallet.");let r=It(n,"assets","amount","USDG deposit amount");if(r<=0n)throw new a("Deposit amount must be greater than zero.");let p=n.minShares===void 0?void 0:ee(n.minShares),d=e.approval(c.usdg,c.pool,r.toString(),$);if(p===void 0){let l;try{let v=await e.clientFor($).simulateCalls({account:o,calls:[{to:d.to,data:d.data},{to:c.pool,data:X({abi:S,functionName:"deposit",args:[r,t,0n]})}]}),[I,_]=v.results;if(I?.status!=="success"||_?.status!=="success")throw new a("Approval or deposit simulation failed.");l=Jt({abi:S,functionName:"deposit",data:_.data})}catch(v){throw new a(`Could not simulate Priors deposit shares: ${e.plainError(v)}`)}if(p=ee(it(l.toString(),n.slippageBps??ot)),p===0n)throw new a("The simulated deposit cannot provide a positive minimum share amount.")}let w=e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"deposit",args:[r,t,p]}),value:"0",chainId:$,description:`Deposit ${r} USDG base units into Priors CreditPoolV2 (${c.pool}) for ${t}.`}),b=[d,w],m=await e.preview(b,o),P=`Approve ${e.formatAmount(r.toString(),N)} USDG and deposit into Priors CreditPoolV2 (${c.pool}) for ${t} (minShares=${p}; 7-day MIN_HOLD applies a 0.5% early-exit fee on early withdrawals).`;return{txs:b,summary:ne(e,P,m.changes)}}},g={name:"priors_withdraw",inputSchema:{type:"object",properties:{shares:{type:"string",pattern:"^[0-9]+$",description:"Pool share count in base units to redeem (not USDG amount; omit to redeem full wallet share balance)."},receiver:{type:"string",description:"Optional USDG receiver address (must be the signing wallet)."}}},async execute(n,s){z(s);let o=B(s),t=o;if(n.receiver!==void 0&&(typeof n.receiver!="string"||n.receiver.trim().toLowerCase()!==o.toLowerCase()))throw new a("Priors receiver must be the signing wallet.");let r=e.clientFor($),p=n.shares!==void 0?ee(n.shares):await r.readContract({address:c.pool,abi:S,functionName:"shares",args:[o]});if(p<=0n)throw new a(`Wallet ${o} has no Priors CreditPoolV2 shares to withdraw.`);let[d,w,b]=await Promise.all([r.readContract({address:c.pool,abi:S,functionName:"convertToAssets",args:[p]}),r.readContract({address:c.pool,abi:S,functionName:"lastDepositAt",args:[o]}),r.getBlock()]),m=w>0n&&b.timestamp<w+He,h=m?d*yt/$t:0n,P=d-h,v=[e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"withdraw",args:[p,t]}),value:"0",chainId:$,description:`Withdraw ${p} shares from Priors CreditPoolV2 (${c.pool}) to ${t}.`})],I=await e.preview(v,o),_=e.formatAmount(P.toString(),N),F=e.formatAmount(d.toString(),N),k=e.formatAmount(h.toString(),N),D=m?`inside 7-day MIN_HOLD: ${k} USDG (0.5%) early-exit fee stays in pool, net payout ${_} USDG from ${F} USDG gross`:`outside 7-day MIN_HOLD: no early-exit fee, net payout ${_} USDG`,M=`Withdraw ${p} shares from Priors CreditPoolV2 (${c.pool}) to ${t} (${D}).`;return{txs:v,summary:ne(e,M,I.changes)}}},u={name:"priors_borrow",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"ERC-8004 agent token ID with an already-funded Priors credit line."},principal:{type:"string",pattern:"^[0-9]+$",description:'Borrow principal in 6-decimal USDG base units (min "5000000" = 5 USDG).'},amount:{type:"string",pattern:"^[0-9]+$",description:'Alias for principal: USDG amount in base units (6 decimals). Example: "5000000" = 5 USDG.'},term:{type:"string",description:'Loan term in seconds (between 86400 and 2592000; defaults to "86400"). The origination fee is pro-rated by term, so a longer term costs more.'},recipient:{type:"string",description:"Optional USDG recipient address (must be the signing wallet)."},maxFee:{type:"string",description:"Optional fee ceiling in USDG base units (6 decimals); must equal the pool quote for this principal and term. Omit to use it. The fee is pro-rated by term, not flat: 1666 for 5 USDG over 1 day."}}},async execute(n,s){z(s);let o=B(s),t=o;if(n.recipient!==void 0&&(typeof n.recipient!="string"||n.recipient.trim().toLowerCase()!==o.toLowerCase()))throw new a("Priors recipient must be the signing wallet.");let r=await Re(e,n,o);await ze(e,r,o);let p=e.clientFor($),d=await p.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[r]}),w=we(d),b=an(r,w),m=It(n,"principal","amount","USDG borrow principal");if(m<We||m>St)throw new a(`Borrow principal must be between ${We} (5 USDG) and ${St} (500 USDG) base units.`);if(m>b)throw new a(`Borrow principal ${m} exceeds available credit line capacity ${b} USDG base units for agent ${r}.`);let h=n.term!==void 0&&String(n.term).trim()!==""?pe(n.term,"term"):je;if(h<je||h>At)throw new a(`Loan term must be between ${je} (1 day) and ${At} (30 days) seconds.`);let P=await p.readContract({address:c.pool,abi:S,functionName:"quoteFee",args:[r,m,h]}),l=P[0],v=n.maxFee!==void 0?ee(n.maxFee):l;if(v<l)throw new a(`Provided maxFee ${v} is below the origination fee the pool quotes for this term, ${l} USDG base units.`);if(v>l)throw new a(`Provided maxFee ${v} is above the quoted origination fee ${l} USDG base units. Use the quoted fee or omit maxFee.`);let I=m+l,_=m+v,k=[e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"borrow",args:[r,m,h,t,v]}),value:"0",chainId:$,description:`Borrow ${m} USDG base units on Priors CreditPoolV2 for agent ${r} to ${t} (quoted fee ${l}, expected debt ${I}, maxFee ${v}, debt ceiling ${_}).`})],D=await e.preview(k,o),M=e.formatAmount(m.toString(),N),W=e.formatAmount(l.toString(),N),ae=e.formatAmount(I.toString(),N),j=e.formatAmount(v.toString(),N),$e=e.formatAmount(_.toString(),N),q=P[1]+P[3],K=P[2],de=l-q-K,ie=`Borrow ${M} USDG for ERC-8004 agent ${r} to recipient ${t} on Priors CreditPoolV2 (${c.pool}) for ${h}s: expected origination fee ${W} USDG (${l} base units; pro-rated by term, set when the loan opens, none refunded on early repayment), expected total repayment due ${ae} USDG (${I} base units); fee ceiling ${j} USDG (${v} base units), debt ceiling ${$e} USDG (${_} base units). Fee recipient on repayment: CreditPoolV2 (${c.pool}), allocating the quoted fee to sponsor ${w.sponsor} (${q} base units including premium), reserve (${K} base units), and lenders (${de} base units).`;return{txs:k,summary:ne(e,ie,D.changes)}}},f={name:"priors_repay",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"ERC-8004 agent token ID that owns the active loan."},loanId:{type:"string",description:"Optional explicit per-agent loan ID (otherwise recovered from Borrowed receipt logs or loansOf(agentId))."},borrowReceiptLogs:{type:"array",description:"Optional receipt logs array from the borrow transaction to decode the exact Borrowed(loanId, agentId, ...) event."},maxDue:{type:"string",description:"Optional maximum USDG base units to repay; must equal the exact fixed principal + fee. Omit to use that debt."}}},async execute(n,s){z(s);let o=B(s),t=await Re(e,n,o);await ze(e,t,o);let r=e.clientFor($),p;if(n.loanId!==void 0&&n.loanId!==null&&String(n.loanId).trim()!=="")p=pe(n.loanId,"loanId");else{let k=dn(n);if(k.length>0){let D=sn(k,t);D!==null&&(p=BigInt(D))}}let d;if(p!==void 0){let k=await r.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[p]}),D=Ce(p,k);if(D.agentId!==t)throw new a(`Loan ${p} belongs to agent ${D.agentId}, not agent ${t}. Recover loan IDs from the Borrowed receipt or loansOf(agentId), never global loanCount().`);if(D.status!==1)throw new a(`Loan ${p} for agent ${t} is not active (status=${D.status}).`);d=D}else{let k=await r.readContract({address:c.pool,abi:S,functionName:"loansOf",args:[t]});if(k.length===0)throw new a(`ERC-8004 agent ${t} has no recorded loans on Priors CreditPoolV2.`);let M=(await Promise.all(k.map(async W=>{let ae=await r.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[W]});return Ce(W,ae)}))).filter(W=>W.agentId===t&&W.status===1);if(M.length===0)throw new a(`ERC-8004 agent ${t} has no active loans to repay.`);d=M[M.length-1]}let w=d.principal+d.fee,b=n.maxDue!==void 0?ee(n.maxDue):w;if(b<w)throw new a(`Provided maxDue ${b} is below the exact fixed loan debt ${w} USDG base units (principal ${d.principal} + fixed fee ${d.fee}).`);if(b>w)throw new a(`Provided maxDue ${b} is above the exact fixed loan debt ${w} USDG base units. Use the fixed debt or omit maxDue.`);let m=e.approval(c.usdg,c.pool,w.toString(),$),h=e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"repay",args:[d.loanId,t,b]}),value:"0",chainId:$,description:`Repay fixed debt ${w} USDG base units (principal ${d.principal} + fee ${d.fee}) for loan ${d.loanId} (agent ${t}).`}),P=[m,h],l=await e.preview(P,o),v=e.formatAmount(w.toString(),N),I=e.formatAmount(d.principal.toString(),N),_=e.formatAmount(d.fee.toString(),N),F=`Approve and repay ${v} USDG (${w} base units: ${I} USDG principal + ${_} USDG fixed fee) for Priors loan ${d.loanId} (agent ${t}).`;return{txs:P,summary:ne(e,F,l.changes)}}},R={name:"priors_status",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"Optional ERC-8004 agent ID to inspect on CreditPoolV2, PriorsLens, and StockVault."},includeApiCheck:{type:"boolean",description:"Optional flag to query https://priors.trade/api/check for supplemental off-chain metadata."}}},async execute(n,s){z(s);let o=B(s),t=e.clientFor($),[r,p,d,w]=await Promise.all([t.readContract({address:c.pool,abi:S,functionName:"shares",args:[o]}),t.readContract({address:c.pool,abi:S,functionName:"lastDepositAt",args:[o]}),t.getBlock(),t.readContract({address:c.stockVault,abi:Pt,functionName:"assetList"})]),b=r>0n?await t.readContract({address:c.pool,abi:S,functionName:"convertToAssets",args:[r]}):0n,m=r>0n&&p>0n&&d.timestamp<p+He,h=m?b*yt/$t:0n,P=b-h,l=null;if(n.agentId!==void 0&&n.agentId!==null&&String(n.agentId).trim()!=="")l=pe(n.agentId,"agentId");else{let q=await _e(e,o);q.length>0&&(l=q[0])}let v=null,I=!1,_=[],F=null,k=null,D=null,M=null,W=null,ae=null,j=`This wallet owns no ERC-8004 agent identity. ${Ze}`;if(l!==null){let[q,K,de,ie,Ut,Et,Be,Ne,xe]=await Promise.all([t.readContract({address:c.lens,abi:vt,functionName:"score",args:[l]}),t.readContract({address:L,abi:E,functionName:"firstLined",args:[l]}),t.readContract({address:L,abi:E,functionName:"agentId"}),t.readContract({address:L,abi:E,functionName:"rules"}),t.readContract({address:L,abi:E,functionName:"epochRoom"}),t.readContract({address:C,abi:U,functionName:"bonds",args:[l]}),t.readContract({address:C,abi:U,functionName:"amount"}),t.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[l]}),t.readContract({address:C,abi:U,functionName:"releasable",args:[l]})]),[Gt,Vt,Ft,Mt,qt,Ht]=await Promise.all([t.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[l]}),t.readContract({address:c.pool,abi:S,functionName:"loansOf",args:[l]}),t.readContract({address:c.lens,abi:vt,functionName:"available",args:[l]}),t.readContract({address:c.stockVault,abi:Pt,functionName:"borrowRoom",args:[l]}),t.readContract({address:c.pool,abi:S,functionName:"delegateOf",args:[l]}),t.readContract({address:c.pool,abi:S,functionName:"isController",args:[l,o]})]),Le=await De(e,l),Wt=B(qt),Ke=Ht,y=we(Gt),Se=y.delegatedIn>y.principalOut?y.delegatedIn-y.principalOut:0n;I=y.enrolled&&!y.isRoot&&!y.defaulted&&!y.frozen&&y.sponsor>0n&&y.delegatedIn>0n,F=Ft.toString(),k=Mt.toString();let jt=await Promise.all(Vt.map(async T=>{let le=await t.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[T]});return Ce(T,le)}));for(let T of jt)if(T.agentId===l&&T.status===1){let le=T.principal+T.fee;_.push({loanId:T.loanId.toString(),agentId:T.agentId.toString(),sponsorId:T.sponsorId.toString(),principal:T.principal.toString(),fee:T.fee.toString(),due:le.toString(),dueAt:T.dueAt.toString(),issuedAt:T.issuedAt.toString(),owner:T.owner,token:te})}v={agentId:l.toString(),owner:Le,delegate:Wt,isAuthorizedController:Ke,enrolled:y.enrolled,isRoot:y.isRoot,defaulted:y.defaulted,frozen:y.frozen,sponsorId:y.sponsor.toString(),delegatedIn:y.delegatedIn.toString(),delegatedOut:y.delegatedOut.toString(),principalOut:y.principalOut.toString(),availableCapacity:Se.toString(),activeLoansCount:y.activeLoans.toString(),loansRepaid:y.loansRepaid.toString(),volumeRepaid:y.volumeRepaid.toString(),feesPaid:y.feesPaid.toString(),importedFromV1:y.importedFromV1,qualifiedRepaid:y.qualifiedRepaid.toString(),dollarSecondsRepaid:y.dollarSecondsRepaid.toString()};let Ae=BigInt(de),Oe=K===!0,Q=ye(Et),re=Q.depositor!==Je,ve=re&&V(Q.depositor,o),Qe=Ct(y,Oe),Ue=V(Le,o);D={onchain:BigInt(q).toString(),scale:"0-1000",source:`CreditLensV2.score(${l}) at ${c.lens}, the score the pool computes on chain`,scoreV2:null},M={open:y.sponsor!==0n&&y.delegatedIn>0n,amount:y.delegatedIn.toString(),drawn:y.principalOut.toString(),available:Se.toString(),sponsorId:y.sponsor.toString(),backer:y.sponsor===0n?null:y.sponsor===Ae?`Priors' treasury v4 (root #${Ae})`:`root #${y.sponsor}`,token:te},W={contract:C,posted:re,depositor:re?Q.depositor:null,postedByWallet:ve,postedAt:re?Q.at.toString():null,amount:(re?Q.amount:BigInt(Be)).toString(),releasable:re&&xe===!0,releaseAt:re?BigInt(Ne).toString():null,rule:"Back to its depositor once the agent holds no line and has no loan open, from 4 days after it was posted (close a line first with priors_close_line); a default forfeits it to Priors' Safe."},ae={eligible:Ue&&!Qe,firstLined:Oe,lineAmount:BigInt(ie[1]).toString(),bondAmount:BigInt(Be).toString(),treasuryRoot:Ae.toString(),treasuryRoomThisWeek:BigInt(Ut).toString(),note:"Not instant: Priors' invite bot decides each invite, and the treasury caps new lines each week."};let fe=_.map(T=>({id:String(T.loanId),dueAt:BigInt(String(T.dueAt))})).sort((T,le)=>T.dueAt<le.dueAt?-1:T.dueAt>le.dueAt?1:0);y.defaulted?j=`Agent #${l} defaulted; Priors never lends to it again${ve?" and its bond is forfeited":""}.`:!Ke&&!Ue?j=`This wallet does not control agent #${l} on CreditPoolV2 (owner ${Le}); act from its owner or delegate.`:fe.length?j=`Repay loan ${fe[0].id} with priors_repay before it is due at ${G(fe[0].dueAt)}${fe.length>1?` (${fe.length} loans open)`:""}.`:I&&Se>=We?j=`Borrow with priors_borrow (5 USDG minimum, up to ${A(Se)}; the fee is pro-rated by term); Priors counts loans held 7 days or more toward the score.`:!Qe&&Ue?j=ve?`Call priors_starter_line again: the ${A(Q.amount)} bond is posted, and it goes on with the invite bot's ownership proof and the invite's redemption${xe===!0?", or priors_release_bond returns the bond":""}.`:`Call priors_starter_line: a refundable ${A(BigInt(Be))} bond, an invite from Priors' invite bot and your pool consent open a ${A(BigInt(ie[1]))} line from Priors' treasury (each transaction and signature is confirmed).`:ve?j=xe===!0?`Release the ${A(Q.amount)} invite bond with priors_release_bond.`:y.delegatedIn>0n?`The line is open with nothing to draw; to take the bond back, close it with priors_close_line, then priors_release_bond from ${G(BigInt(Ne))}.`:`The ${A(Q.amount)} invite bond comes back with priors_release_bond from ${G(BigInt(Ne))}.`:j=`Agent #${l} has a Priors record but no line to draw now; ${Rt(e,y,Ae,Oe)}.`}let $e=null;if(n.includeApiCheck){let q=l!==null?`agent=${l.toString()}`:`address=${o}`,K=await nt(e.http,`${en}?${q}`,{method:"GET"},Y),de=Array.isArray(K.agents)?K.agents.find(ie=>Y(ie)&&String(ie.agentId)===String(l)):void 0;D&&Y(de)&&(D.scoreV2=de.scoreV2??null),$e={...K,grantsPoolControl:!1,controlRule:"Off-chain /api/check identity or paymentWallet match never grants CreditPoolV2 control; on-chain isController(agentId, wallet) must authorize the caller; stale delegates do not qualify."}}return{chainId:$,blockNumber:d.number?.toString()??null,blockTimestamp:d.timestamp.toString(),wallet:o,token:te,contracts:c,lender:{shares:r.toString(),grossAssets:b.toString(),earlyExitFeeAssets:h.toString(),netWithdrawAssets:P.toString(),lastDepositAt:p.toString(),withinMinHoldWindow:m,minHoldSeconds:He.toString()},hasFundedLine:I,agentId:l!==null?l.toString():null,nextStep:j,score:D,line:M,bond:W,starterLine:ae,agent:v,activeLoans:_,lens:{address:c.lens,available:F,caveat:"PriorsLens.available(agentId) is a status capacity hint for already-funded lines; backer hooks may still refuse borrows."},stockVault:{address:c.stockVault,borrowRoom:k,onchainAssetCount:w.length,hostedMcpStockCount:35,extraNonStockAsset:B(tn),zeroCapAssets:nn.map(q=>B(q)),caveat:"Use priors_stock_assets and priors_stock_asset_state for current collateral rules, then priors_stock_open. This summary is an observed asset-count snapshot, not a fixed allowlist; live caps, lending holds and prices control admission."},apiCheck:$e,limitations:["Borrowing and repayment require a sponsor-backed ERC-8004 credit line (enrolled && !isRoot && sponsor != 0) authorized on-chain by isController(agentId, wallet).","Priors line routes are exposed by priors_line_options and priors_capabilities: treasury starter, V5 move/raise, direct sponsor, stock and owner PRIORS backing. Ethos execution uses Priors own owner workflow because its worker supplies no unsigned final transaction.","score.onchain is the pool's on-chain score (CreditLensV2); score.scoreV2 is Priors Score v2 from /api/check, present only with includeApiCheck.","Loan debt is the principal plus the origination fee the pool quotes for the term. The fee is pro-rated by term, not flat (1666 base units for 5 USDG over 1 day, observed live 2026-10-31; priors_borrow shows the exact quote), and is fixed once the loan opens: variable interest is never invented, and early repayment refunds none of it.","Loan IDs are recovered from decoded Borrowed receipts or per-agent loansOf(agentId), never global loanCount().","Historical archive event queries and zero-position StockVault lines on public RPCs remain subject to archive retention and live backer state."]}}},A=n=>`${e.formatAmount(n.toString(),N)} USDG`;function x(n){let s=V(n.bond.depositor,n.owner)&&n.bond.amount>0n?n.bond.amount:n.bondAmount;return`Bond first: ${A(s)} is locked in Priors' InviteBond for at least ${n.unusedAfter} seconds (${Number(n.unusedAfter)/86400} days) after posting${n.releaseAt>0n?`; unusedReleaseAt is ${G(n.releaseAt)}`:"; the exact release time is read after posting"}. Release requires no line and no open loan; default can forfeit the bond. Invites are not guaranteed. The credit score can lag qualifying repayments. `}function H(n,s,o){if(!V(o.owner,s))throw new a(`This wallet (${s}) does not own ERC-8004 agent ${n} (its owner is ${o.owner}). The bond, the ownership proof and the pool consent are the owner's. Nothing was signed.`);if(o.root!==Ie)throw new a(`TreasurySponsorV4 (${L}) answers root #${o.root}, not the pinned #${Ie}. Nothing was signed; update Oak.`);if(Ct(o.agent,o.firstLined))throw new a(`Agent #${n} already has a Priors record, so priors_starter_line posts no bond and signs nothing: ${Rt(e,o.agent,o.root,o.firstLined)}; ${o.agent.loansRepaid} loan(s) repaid. The starter line is only for an identity with no record; priors_status shows this one.`)}let oe="stays posted in InviteBond";function O(n){let s=n.agent.delegatedIn>0n?`with a line open it comes back only after priors_close_line (no loan open), then priors_release_bond from ${G(n.releaseAt)} at the earliest`:`while the agent holds no line it comes back with priors_release_bond from ${G(n.releaseAt)} (${Number(n.unusedAfter)/86400} days after it was posted)`;return`The ${A(n.bond.amount>0n?n.bond.amount:n.bondAmount)} bond ${oe} (${C}), posted from this wallet; ${s}, and priors_starter_line never posts a second bond.`}async function J(n,s,o){try{return await o()}catch(t){let r=t instanceof a?t.message:e.plainError(t);if(r.includes(oe)||n===void 0||!/^[0-9]{1,78}$/.test(n))throw t;let p;try{let d=await he(e,BigInt(n),s);p=V(d.bond.depositor,s)?O(d):""}catch{p=`If the bond transactions mined, the invite bond ${oe} (${C}) remains locked until its on-chain release conditions are met; priors_status shows the exact amount and time (its state could not be read just now).`}throw p?new a(`${r} ${p}`):t}}async function ge(n,s,o){let t=lt(await Xe(e,{agentId:n}),{agentId:n,owner:s,now:ue()});if(!t.ok&&t.refused)throw new a(`Priors' invite bot gave no ownership proof to sign for agent #${n}: ${be(t.why)}. Nothing was signed. ${o}`.trim());if(!t.ok)throw new a(`Not signed: the invite bot's answer for agent #${n} is not one Oak signs: ${t.why}. Oak signs only the bot's own start-page text, rebuilt locally for this agent and this wallet. ${o}`.trim());if(t.exp-ue()<120)throw new a(`Not signed: the invite bot's proof for agent #${n} expires in under 2 minutes; call priors_starter_line again for a new one. ${o}`.trim());return t}function Z(n,s,o,t){return{steps:[{kind:"message",message:o.message}],continuation:{stage:"proof",wallet:s,chainId:$,agentId:n,n:o.n,exp:o.exp},summary:`${x(t)}Priors starter line for ERC-8004 agent ${n}, step 2 of 3: sign Priors' invite-bot ownership proof. It is a message signature (EIP-191) only: it sends no transaction and moves no funds. The text is the bot's own form, rebuilt locally for agent #${n} and this wallet, request ${o.n}, expiring ${G(o.exp)}. Oak then sends the signature to ${me}, and the bot decides the invite. ${O(t)}`}}function se(n,s,o){if(n.chainId!==$||typeof n.wallet!="string"||!V(n.wallet,s)||typeof n.agentId!="string"||!/^[1-9][0-9]{0,29}$/.test(n.agentId))throw new a("Priors starter-line continuation does not match this wallet or chain 4663; start priors_starter_line again.");if(o.agentId!==void 0&&String(o.agentId)!==n.agentId)throw new a("Priors starter-line continuation is for another agent; start priors_starter_line again.");return BigInt(n.agentId)}async function Te(n,s){let o;if(n.agentId!==void 0&&n.agentId!==null&&String(n.agentId).trim()!=="")o=pe(n.agentId,"agentId");else{let l=await _e(e,s);if(!l.length)throw new a(`Priors' starter line needs an ERC-8004 agent identity, and this wallet owns none. ${Ze}`);o=l[0]}let t=await he(e,o,s);H(o,s,t);let r=o.toString(),p=V(t.bond.depositor,s);if(!p){if(t.usdg<t.bondAmount)throw new a(`This wallet holds ${A(t.usdg)} on Robinhood Chain, and Priors' treasury invite asks a ${A(t.bondAmount)} bond first (InviteBond ${C}), posted from this wallet. Nothing was signed: add USDG, then call priors_starter_line again.`);if(t.epochRoom<t.firstLineAmount)return{summary:`${x(t)}Not submitted. Priors' treasury has ${A(t.epochRoom)} of room left this week and a first line is ${A(t.firstLineAmount)}, so priors_starter_line posted no bond and signed nothing. The treasury caps new lines each week: ask again next week.`,starterLine:{agentId:r,open:!1,reason:"room",epochRoom:t.epochRoom.toString()}};let l=await Xe(e,{check:!0,owner:s.toLowerCase()});if(l.check!==!0)throw new a("Priors' invite bot did not answer its check, so whether an invite is open cannot be told. Nothing was signed.");if(l.ok!==!0)throw new a(`Whether an automatic invite is open could not be told: Priors' invite bot says ${be(l.error)}. Nothing was signed; try again later.`);if(l.open!==!0){let v=typeof l.reason=="string"?l.reason.replace(/[^a-z-]/g,"").slice(0,24):"",I=typeof l.reopensAt=="number"&&Number.isSafeInteger(l.reopensAt)&&l.reopensAt>0?l.reopensAt:null;return{summary:`${x(t)}Not submitted. No automatic invite is open to this wallet right now, so priors_starter_line posted no bond and signed nothing. Priors' invite bot answers: closed, reason ${Ee(v||"none given")}${I?`, reopens ${G(I)}`:""}. ${ct({...l,reason:v})} Priors lists its other ways to a first line (the Ethos lane, a stock line, the owner's $PRIORS stake) at https://priors.trade/skill.md.`,starterLine:{agentId:r,open:!1,reason:v||null,reopensAt:I}}}}let d=await ge(r,s,p?O(t):"");if(p)return Z(r,s,d,t);let w=[e.approval(c.usdg,C,t.bondAmount.toString(),$),e.unsignedTx({to:C,data:X({abi:U,functionName:"deposit",args:[o]}),value:"0",chainId:$,description:`Post the ${t.bondAmount} USDG base-unit Priors invite bond for agent ${r} in InviteBond (${C}).`})],b=await e.preview(w,s),m=t.bond.depositor!==Je?` This deposit replaces the bond ${t.bond.depositor} posted for this agent; InviteBond returns that bond to it in the same transaction.`:"",h=`${x(t)}Priors starter line for ERC-8004 agent ${r}, step 1 of 3: approve exactly ${A(t.bondAmount)} to Priors' InviteBond (${C}) and post it as the agent's refundable invite bond (InviteBond.deposit).${m} Priors' invite bot says an automatic invite is open now and gave the ownership proof to sign next. Step 2 signs that proof (a message, no transaction); step 3 signs your pool consent and redeems the invite (TreasurySponsorV4.firstLine, ${L}) for a ${A(t.firstLineAmount)} line from Priors' treasury (root #${t.root}). The invite is the bot's decision, not a promise: if it refuses, or any later step fails, the bond stays posted and comes back with priors_release_bond after the on-chain lock and release conditions are met. With a line, the bond comes back only once the line is closed with no loan open (priors_close_line, then priors_release_bond); a default forfeits it to Priors' Safe.`;return{steps:w.map(l=>({kind:"tx",tx:l})),continuation:{stage:"bond",wallet:s,chainId:$,agentId:r,n:d.n,exp:d.exp},summary:ne(e,h,b.changes)}}async function Dt(n,s,o){let t=await he(e,n,s);H(n,s,t);let r=n.toString();if(!V(t.bond.depositor,s))throw new a(`The invite bond for agent #${r} is not on chain from this wallet, so nothing more was signed. Check the deposit transaction, then call priors_starter_line again.`);return typeof o.n=="string"&&Ve.test(o.n)&&typeof o.exp=="number"&&Number.isSafeInteger(o.exp)&&o.exp-ue()>=300?Z(r,s,{n:o.n,exp:o.exp,message:Me(r,o.n,o.exp)},t):Z(r,s,await ge(r,s,O(t)),t)}async function Tt(n,s,o,t){let r=n.toString();if(typeof o.n!="string"||!Ve.test(o.n)||typeof o.exp!="number"||!Number.isSafeInteger(o.exp))throw new a("Invalid Priors starter-line proof continuation; start priors_starter_line again.");if(typeof t!="string"||!/^0x[0-9a-fA-F]{130}$/.test(t))throw new a("Provide this wallet's signature of the invite bot's ownership proof.");if(o.exp<=ue())throw new a(`The invite bot's proof for agent #${r} expired before it reached the bot; nothing was sent to it. Call priors_starter_line again for a fresh proof (the bond is not posted again).`);let p=Me(r,o.n,o.exp);if(!V(await Kt({message:p,signature:t}),s))throw new a("The ownership-proof signature is not this wallet's; nothing was sent to the invite bot.");let d=await he(e,n,s);if(H(n,s,d),!V(d.bond.depositor,s))throw new a(`The invite bond for agent #${r} is not on chain from this wallet; nothing was sent to the invite bot. Call priors_starter_line again.`);let w=await Xe(e,{n:o.n,signature:t});if(w.ok!==!0)throw new a(`Priors' invite bot gave no invite for agent #${r}: ${be(w.error)}. ${O(d)}`);if(typeof w.code!="string")throw new a(`Priors' invite bot gave no invite for agent #${r}${w.reason?`: ${be(w.reason)}`:""}${typeof w.decided=="string"?` (its decision: ${be(w.decided)})`:""}. ${O(d)}`);let b=qe(w.code,r,ue()+60);if(!b.ok)throw new a(`Priors' invite bot's code for agent #${r} is not one Oak redeems: ${b.why}. Nothing more was signed. ${O(d)}`);let m=e.clientFor($),h=await m.readContract({address:L,abi:E,functionName:"inviteDigest",args:[n,b.expiry]});if(h.toLowerCase()!==dt(n,b.expiry).toLowerCase())throw new a("TreasurySponsorV4's invite digest differs from its pinned EIP-712 domain; nothing more was signed. Update Oak.");let P=await Zt({hash:h,signature:b.signature}),[l,v]=await Promise.all([m.readContract({address:L,abi:E,functionName:"inviters",args:[P]}),m.readContract({address:L,abi:E,functionName:"inviteUsed",args:[h]})]);if(l!==!0)throw new a(`Priors' invite for agent #${r} was signed by ${P}, which TreasurySponsorV4 does not name an inviter, so the treasury would refuse it. Nothing more was signed. ${O(d)}`);if(v===!0)throw new a(`Priors' invite for agent #${r} was already used. Nothing more was signed. ${O(d)}`);let[I,_]=await Promise.all([m.readContract({address:c.pool,abi:S,functionName:"nonces",args:[n]}),m.getBlock()]),F=_.timestamp+BigInt(st),k=Fe({agentId:r,owner:s,nonce:I.toString(),deadline:F.toString()}),D=await m.readContract({address:c.pool,abi:S,functionName:"consentDigest",args:[{agentId:n,sponsorId:d.root,owner:s,maxPremiumBps:0n,nonce:I,deadline:F}]});if(D.toLowerCase()!==at(k).toLowerCase())throw new a(`The pool's consentDigest (${D}) differs from the consent Oak builds for CreditPoolV2 (${c.pool}), so the pool would refuse it. Nothing more was signed. ${O(d)}`);return{steps:[{kind:"typedData",request:k}],continuation:{stage:"consent",wallet:s,chainId:$,agentId:r,invite:w.code,request:k},summary:`Priors starter line for ERC-8004 agent ${r}, step 3 of 3: Priors' invite bot gave an invite (signed by ${P}, an inviter TreasurySponsorV4 names; it expires ${G(b.expiry)}). Sign your pool consent (EIP-712 "Priors Credit" version 2 on CreditPoolV2 ${c.pool}): it lets Priors' treasury (root #${d.root}) back a line for agent #${r} with premium 0, nonce ${I}, valid until ${G(F)}. A transaction redeeming the invite (TreasurySponsorV4.firstLine) follows for your confirmation. ${O(d)}`}}async function Bt(n,s,o,t){let r=n.toString();if(typeof t!="string"||!/^0x[0-9a-fA-F]{130}$/.test(t))throw new a("Provide this wallet's signature of the Priors pool consent.");let p=qe(o.invite,r,ue()+60);if(!p.ok)throw new a(`The invite for agent #${r} is not one Oak redeems now: ${p.why}. Call priors_starter_line again for a new one.`);let d=Y(o.request)&&Y(o.request.message)?o.request.message:void 0;if(!d||typeof d.nonce!="string"||!/^[0-9]{1,78}$/.test(d.nonce)||typeof d.deadline!="string"||!/^[0-9]{1,20}$/.test(d.deadline))throw new a("Invalid Priors starter-line consent continuation; start priors_starter_line again.");let w=Fe({agentId:r,owner:s,nonce:d.nonce,deadline:d.deadline});if(!V(await Qt({...w,signature:t}),s))throw new a("The pool-consent signature is not this wallet's for the consent Oak built; nothing was offered.");let b=await he(e,n,s);H(n,s,b);let m=e.clientFor($),[h,P]=await Promise.all([m.readContract({address:c.pool,abi:S,functionName:"nonces",args:[n]}),m.getBlock()]);if(h.toString()!==d.nonce)throw new a(`Agent #${r}'s consent nonce moved on chain since it was signed; nothing was offered. Call priors_starter_line again.`);if(P.timestamp>=BigInt(d.deadline))throw new a(`The pool consent for agent #${r} expired at ${G(BigInt(d.deadline))}; nothing was offered. Call priors_starter_line again.`);let l={agentId:n,sponsorId:Ie,owner:s,maxPremiumBps:0n,nonce:h,deadline:BigInt(d.deadline)},v=[n,p.expiry,p.signature,l,t];try{await m.simulateContract({address:L,abi:E,functionName:"firstLine",args:v,account:s})}catch(k){throw new a(`TreasurySponsorV4.firstLine for agent #${r} would be refused: ${ln(e,k)} Nothing was offered. ${O(b)}`)}let I=e.unsignedTx({to:L,data:X({abi:E,functionName:"firstLine",args:v}),value:"0",chainId:$,description:`Redeem Priors' invite for agent ${r}: TreasurySponsorV4.firstLine opens a ${b.firstLineAmount} USDG base-unit line from root ${b.root} with the owner's consent.`}),_=await e.preview([I],s),F=`Redeem agent #${r}'s Priors invite: TreasurySponsorV4.firstLine (${L}) opens a ${A(b.firstLineAmount)} line from Priors' treasury (root #${b.root}) with your signed consent. No USDG moves in this transaction. Then priors_status shows the line and priors_borrow draws it (5 USDG minimum; the fee is pro-rated by term; Priors counts loans held 7 days or more toward the score). The ${A(b.bondAmount)} bond stays in InviteBond until the line is closed with no loan open (priors_close_line, then priors_release_bond, from ${G(b.releaseAt)} at the earliest); a default forfeits it.`;return{txs:[I],summary:ne(e,F,_.changes)}}let Nt={name:"priors_starter_line",inputSchema:{description:"Bond first: the launch bond is 5 USDG, locked at least 4 days. The first result reads amount(), unusedAfter() and unusedReleaseAt(agentId) for current terms before any approval. Invites are not guaranteed; the credit score can lag. Release needs no line or open loan; default can forfeit the bond.",type:"object",additionalProperties:!1,properties:{agentId:Pe("ERC-8004 agent ID this wallet owns, with no Priors record yet (default: the first identity this wallet owns)."),continuation:{type:"object",description:"Opaque state from the previous starter-line step; pass it back unchanged. Omit on the first call; never build it by hand."},signature:{type:"string",pattern:"^0x([0-9a-fA-F]{2})+$",description:"Local signature for the confirmed starter-line step, as 0x hex; the bridge supplies it. Never a key."}}},async execute(n,s){z(s);let o=B(s);if(n.continuation===void 0){if(n.signature!==void 0)throw new a("A signature needs its Priors starter-line continuation; start priors_starter_line again.");return J(typeof n.agentId=="string"?n.agentId:void 0,o,()=>Te(n,o))}if(!Y(n.continuation))throw new a("Invalid Priors starter-line continuation; start priors_starter_line again.");let t=n.continuation,r=se(t,o,n),p=d=>J(r.toString(),o,d);if(t.stage==="bond"){if(n.signature!==void 0)throw new a("The bond stage takes no signature; start priors_starter_line again.");return p(()=>Dt(r,o,t))}if(t.stage==="proof")return p(()=>Tt(r,o,t,n.signature));if(t.stage==="consent")return p(()=>Bt(r,o,t,n.signature));throw new a("Unknown Priors starter-line stage; start priors_starter_line again.")}},xt={name:"priors_close_line",inputSchema:{type:"object",properties:{agentId:Pe("ERC-8004 agent ID whose Priors line to close (default: the first identity this wallet owns).")}},async execute(n,s){z(s);let o=B(s),t=await Re(e,n,o);await ze(e,t,o);let r=e.clientFor($),[p,d,w,b]=await Promise.all([r.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[t]}),r.readContract({address:C,abi:U,functionName:"bonds",args:[t]}),r.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[t]}),r.readContract({address:L,abi:E,functionName:"agentId"})]),m=we(p);if(m.sponsor===0n)throw new a(`Agent #${t} has no Priors line to close (no sponsor on CreditPoolV2).`);if(m.activeLoans>0n)throw new a(`Agent #${t} has ${m.activeLoans} loan(s) open; repay them with priors_repay first. The pool's leave refuses while a loan is open.`);let h=ye(d),P=m.sponsor===BigInt(b),l=e.unsignedTx({to:c.pool,data:X({abi:S,functionName:"leave",args:[t]}),value:"0",chainId:$,description:`Close agent ${t}'s Priors line on CreditPoolV2 (leave): the ${m.delegatedIn} USDG base-unit line returns to root ${m.sponsor}.`}),v=await e.preview([l],o),I=V(h.depositor,o)?` Its ${A(h.amount)} invite bond can then come back with priors_release_bond from ${G(w)} (4 days after it was posted).`:"",_=`Close agent #${t}'s Priors line (CreditPoolV2.leave, ${c.pool}): the whole ${A(m.delegatedIn)} line goes back to its backer (${P?`Priors' treasury, root #${b}`:`root #${m.sponsor}`}) and the agent can no longer borrow on it. This does not reopen: ${P?`priors_starter_line opens no second treasury line for an agent with a Priors record; another needs a person at ${Ge}.`:"a new line needs a backer's new consent."}${I} No USDG moves in this transaction.`;return{txs:[l],summary:ne(e,_,v.changes)}}},Lt={name:"priors_release_bond",inputSchema:{type:"object",properties:{agentId:Pe("ERC-8004 agent ID whose InviteBond bond this wallet posted (default: the first identity this wallet owns).")}},async execute(n,s){z(s);let o=B(s),t=await Re(e,n,o),r=e.clientFor($),[p,d,w,b,m]=await Promise.all([r.readContract({address:C,abi:U,functionName:"bonds",args:[t]}),r.readContract({address:C,abi:U,functionName:"releasable",args:[t]}),r.readContract({address:C,abi:U,functionName:"unusedReleaseAt",args:[t]}),r.readContract({address:c.pool,abi:S,functionName:"getAgent",args:[t]}),r.getBlock()]),h=ye(p);if(h.depositor===Je)throw new a(`Agent #${t} has no bond in Priors' InviteBond (${C}).`);if(!V(h.depositor,o))throw new a(`Agent #${t}'s InviteBond bond was posted by ${h.depositor}, not this wallet, and InviteBond.release pays the depositor. Oak releases only a bond this wallet posted.`);if(d!==!0){let I=we(b),_=I.defaulted?"the agent defaulted, so the bond is forfeited to Priors' Safe (InviteBond.slash)":I.activeLoans>0n?`the agent has ${I.activeLoans} loan(s) open: repay with priors_repay, close the line with priors_close_line, then release`:I.delegatedIn>0n?`the agent still holds a ${A(I.delegatedIn)} line: close it with priors_close_line (no loan may be open), then release`:m.timestamp<w?`it comes back 4 days after it was posted, from ${G(w)}`:"InviteBond does not release it yet";throw new a(`Agent #${t}'s ${A(h.amount)} invite bond cannot be released now: ${_}. Nothing was signed.`)}let P=e.unsignedTx({to:C,data:X({abi:U,functionName:"release",args:[t]}),value:"0",chainId:$,description:`Release agent ${t}'s ${h.amount} USDG base-unit Priors invite bond from InviteBond (${C}) to its depositor ${h.depositor}.`}),l=await e.preview([P],o),v=`Release agent #${t}'s ${A(h.amount)} invite bond from Priors' InviteBond (${C}): InviteBond.release returns it to its depositor, this wallet (${o}).`;return{txs:[P],summary:ne(e,v,l.changes)}}};async function Ot(n){z(n);let s=B(n),o=e.clientFor($),[t,r]=await Promise.all([o.readContract({address:c.pool,abi:S,functionName:"shares",args:[s]}),_e(e,s)]),p=[];if(t>0n){let d=await o.readContract({address:c.pool,abi:S,functionName:"convertToAssets",args:[t]});p.push({module:"priors",id:`priors:lender:${s.toLowerCase()}`,chainId:$,assets:[{token:te,amount:d.toString()}],description:`Priors CreditPoolV2 lender position (${t} shares = ${e.formatAmount(d.toString(),N)} USDG gross).`})}for(let d of r){let w=await o.readContract({address:c.pool,abi:S,functionName:"loansOf",args:[d]}),b=await Promise.all(w.map(async h=>{let P=await o.readContract({address:c.pool,abi:S,functionName:"getLoan",args:[h]});return Ce(h,P)}));for(let h of b)if(h.agentId===d&&h.status===1){let P=h.principal+h.fee;p.push({module:"priors",id:`priors:loan:${h.loanId.toString()}`,chainId:$,assets:[],liabilities:[{token:te,amount:P.toString()}],economics:{principal:[],debt:[rt({token:te,amount:P.toString(),source:"priors.loan.fixedDue",dueAt:h.dueAt.toString()})],rewards:[],backing:[],coverage:{complete:!0}},description:`Priors CreditPoolV2 active loan ${h.loanId} for agent ${d} (fixed due ${e.formatAmount(P.toString(),N)} USDG = ${h.principal} principal + ${h.fee} fee).`})}let m=ye(await o.readContract({address:C,abi:U,functionName:"bonds",args:[d]}));m.amount>0n&&V(m.depositor,s)&&p.push({module:"priors",id:`priors:bond:${d.toString()}`,chainId:$,assets:[{token:te,amount:m.amount.toString()}],description:`Priors invite bond for agent ${d} in InviteBond (${C}): ${A(m.amount)}, back with priors_release_bond once the agent holds no line and no loan, from 4 days after posting; a default forfeits it.`})}return p.push(...await ft(e,s,r,te)),p}return{tools:[i,g,u,f,R,Nt,xt,Lt],positions:Ot}},un=e=>{let i=cn(e),g=[i,ut(e),pt(e),mt(e),ht(e),bt(e),wt(e),gt()];return{...i,tools:g.flatMap(u=>u.tools)}},Bn=e=>et("priors",[un(e)]);export{en as a,He as b,yt as c,$t as d,We as e,St as f,je as g,At as h,c as i,te as j,sn as k,un as l,Bn as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as u,f as a,i as n}from"./UMY6SP7C.js";import{a as i}from"./XSD5NL7J.js";import{zeroAddress as c}from"viem";function d(e,o){if(u(o,["id","buy","sell","recipient"],["id","buy","sell","recipient"]),o.id!=="swap-cut")throw new i("Choose Hook Block swap-cut.");let r=a(o.buy,8),t=a(o.sell,8),s=n(o.recipient);if(!r&&!t||r>100n||t>100n||s===c||e.royaltyTo!==c&&e.royaltyTo.toLowerCase()!==s.toLowerCase()||(e.potEveryNBuys&(131071|7<<24))!==0)throw new i("Swap Cut requires rates 0\u2013100 with at least one positive rate, an unoccupied carrier and one compatible nonzero recipient.");return{...e,royaltyTo:s,potEveryNBuys:e.potEveryNBuys|1<<30|Number(r)|Number(t<<7n)|65536}}function m(e,o){return`Swap Cut: buy ${(e.potEveryNBuys&127)*1e3} and sell ${(e.potEveryNBuys>>7&127)*1e3} gross quote pips; Hookr ${o} receives ceil(carved charge * ${e.protocolShareBps}/10000) quote base units; ${e.royaltyTo} receives the carved charge minus that share as a claim. Each carved charge is floor(total collected Rules quote fee * this charge pips / final quote-take pips); residual rounding stays with Hookr.`}export{d as a,m as b};
|