@oakagentkit/core 0.2.6 → 0.3.0
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/abort-scope.d.ts +2 -0
- package/build/dist/api/abort-scope.js +1 -0
- package/build/dist/api/addresses.d.ts +9 -0
- package/build/dist/api/addresses.js +1 -1
- package/build/dist/api/chain.d.ts +4 -0
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/http.js +1 -1
- package/build/dist/api/identity-link.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/abi.d.ts +54 -0
- package/build/dist/api/modules/borro/abi.js +1 -1
- package/build/dist/api/modules/borro/actions.d.ts +14 -1
- package/build/dist/api/modules/borro/actions.js +1 -1
- package/build/dist/api/modules/borro/checks.js +1 -1
- package/build/dist/api/modules/borro/copy.d.ts +23 -10
- package/build/dist/api/modules/borro/copy.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/pins.d.ts +30 -14
- package/build/dist/api/modules/borro/pins.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/borro/types.d.ts +1 -0
- package/build/dist/api/modules/chop/abi.d.ts +31 -0
- package/build/dist/api/modules/chop/abi.js +1 -1
- package/build/dist/api/modules/chop/actions.js +1 -1
- package/build/dist/api/modules/chop/checks.d.ts +13 -5
- package/build/dist/api/modules/chop/checks.js +1 -1
- package/build/dist/api/modules/chop/copy.d.ts +11 -1
- package/build/dist/api/modules/chop/copy.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/chop/positions.js +1 -1
- package/build/dist/api/modules/chop/reader.d.ts +132 -7
- package/build/dist/api/modules/chop/reader.js +1 -1
- package/build/dist/api/modules/chop/types.d.ts +12 -0
- package/build/dist/api/modules/clanker/extensions.d.ts +9 -0
- package/build/dist/api/modules/clanker/extensions.js +1 -1
- package/build/dist/api/modules/clanker/index.js +1 -1
- package/build/dist/api/modules/clanker/manage.js +1 -1
- package/build/dist/api/modules/clanker/pool-config.d.ts +15 -0
- package/build/dist/api/modules/clanker/pool-config.js +1 -1
- package/build/dist/api/modules/clanker/protocol.js +1 -1
- package/build/dist/api/modules/clanker/state.js +1 -1
- package/build/dist/api/modules/earn/copy.d.ts +36 -14
- package/build/dist/api/modules/earn/copy.js +1 -1
- package/build/dist/api/modules/earn/cost.d.ts +11 -1
- package/build/dist/api/modules/earn/cost.js +1 -1
- package/build/dist/api/modules/earn/index.js +1 -1
- package/build/dist/api/modules/earn/lp.d.ts +14 -1
- package/build/dist/api/modules/earn/lp.js +1 -1
- package/build/dist/api/modules/earn/options.d.ts +6 -4
- package/build/dist/api/modules/earn/options.js +1 -1
- package/build/dist/api/modules/erc8004/common.d.ts +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.d.ts +61 -0
- package/build/dist/api/modules/erc8004/thesis.js +1 -0
- package/build/dist/api/modules/erc8004/validation.js +1 -1
- package/build/dist/api/modules/factor/abi.d.ts +642 -0
- package/build/dist/api/modules/factor/abi.js +1 -0
- package/build/dist/api/modules/factor/actions.d.ts +15 -0
- package/build/dist/api/modules/factor/actions.js +1 -0
- package/build/dist/api/modules/factor/api.d.ts +7 -0
- package/build/dist/api/modules/factor/api.js +1 -0
- package/build/dist/api/modules/factor/checks.d.ts +11 -0
- package/build/dist/api/modules/factor/checks.js +1 -0
- package/build/dist/api/modules/factor/copy.d.ts +33 -0
- package/build/dist/api/modules/factor/copy.js +1 -0
- package/build/dist/api/modules/factor/guard.d.ts +12 -0
- package/build/dist/api/modules/factor/guard.js +1 -0
- package/build/dist/api/modules/factor/index.d.ts +16 -0
- package/build/dist/api/modules/factor/index.js +8 -0
- package/build/dist/api/modules/factor/messages.d.ts +46 -0
- package/build/dist/api/modules/factor/messages.js +1 -0
- package/build/dist/api/modules/factor/pins.d.ts +64 -0
- package/build/dist/api/modules/factor/pins.js +1 -0
- package/build/dist/api/modules/factor/reader.d.ts +17 -0
- package/build/dist/api/modules/factor/reader.js +1 -0
- package/build/dist/api/modules/factor/types.d.ts +18 -0
- package/build/dist/api/modules/factor/types.js +0 -0
- package/build/dist/api/modules/gloam/copy.d.ts +4 -3
- package/build/dist/api/modules/gloam/copy.js +2 -2
- package/build/dist/api/modules/gloam/index.js +1 -1
- package/build/dist/api/modules/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/public-reads.d.ts +29 -1
- package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/scan.js +1 -1
- package/build/dist/api/modules/heyresearch/status-labels.d.ts +2 -0
- package/build/dist/api/modules/heyresearch/status-labels.js +1 -1
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
- package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
- package/build/dist/api/modules/hoodag/index.d.ts +12 -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.d.ts +14 -0
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/buyback.js +1 -1
- package/build/dist/api/modules/hoodlock/commerce.js +1 -1
- package/build/dist/api/modules/hoodlock/fee.js +1 -1
- package/build/dist/api/modules/hoodlock/guard.js +1 -1
- package/build/dist/api/modules/hoodlock/index.js +1 -1
- package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
- package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
- package/build/dist/api/modules/hoodlock/public.js +1 -1
- package/build/dist/api/modules/hookr/actions.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/contracts.d.ts +2 -1
- package/build/dist/api/modules/hookr/contracts.js +1 -1
- package/build/dist/api/modules/hookr/create-cancel.js +1 -1
- package/build/dist/api/modules/hookr/discovery.js +1 -1
- package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/launch-options.js +1 -1
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.js +1 -1
- package/build/dist/api/modules/hookr/liquidity.js +1 -1
- package/build/dist/api/modules/hookr/lp-positions.js +1 -1
- package/build/dist/api/modules/hookr/lp-reads.d.ts +2 -0
- package/build/dist/api/modules/hookr/lp-reads.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/kyberswap/index.d.ts +2 -1
- package/build/dist/api/modules/kyberswap/index.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/abi.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/perps-batch.js +1 -1
- package/build/dist/api/modules/meridian/perps-stream.js +1 -1
- package/build/dist/api/modules/meridian/perps.js +1 -1
- package/build/dist/api/modules/meridian/predict-read.js +1 -1
- package/build/dist/api/modules/meridian/rfq.js +1 -1
- package/build/dist/api/modules/merkl/discovery.js +1 -1
- package/build/dist/api/modules/merkl/index.js +1 -1
- package/build/dist/api/modules/merkl/manage.js +1 -1
- package/build/dist/api/modules/merkl/protocol.js +1 -1
- package/build/dist/api/modules/morpho/allocator.js +1 -1
- package/build/dist/api/modules/morpho/bundles.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.d.ts +2 -0
- 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-policy.d.ts +1 -0
- package/build/dist/api/modules/netnet/card-policy.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.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/gateway.js +1 -1
- package/build/dist/api/modules/orbio/index.d.ts +6 -0
- 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/convert.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/holder-directory.js +1 -1
- package/build/dist/api/modules/pons/index.js +1 -1
- package/build/dist/api/modules/pons/launch-status.js +1 -1
- package/build/dist/api/modules/pons/prices.js +1 -1
- package/build/dist/api/modules/pons/reads.js +1 -1
- package/build/dist/api/modules/pons/swap-terms.js +1 -1
- package/build/dist/api/modules/pons/trade.d.ts +3 -2
- 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.d.ts +1 -0
- 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/authorization.d.ts +30 -0
- package/build/dist/api/modules/raeto/authorization.js +1 -0
- package/build/dist/api/modules/raeto/copy.d.ts +46 -0
- package/build/dist/api/modules/raeto/copy.js +1 -0
- package/build/dist/api/modules/raeto/errors.d.ts +4 -0
- package/build/dist/api/modules/raeto/errors.js +1 -0
- package/build/dist/api/modules/raeto/estimate.d.ts +2 -0
- package/build/dist/api/modules/raeto/estimate.js +1 -0
- package/build/dist/api/modules/raeto/index.d.ts +16 -0
- package/build/dist/api/modules/raeto/index.js +1 -0
- package/build/dist/api/modules/raeto/pairing.d.ts +40 -0
- package/build/dist/api/modules/raeto/pairing.js +1 -0
- package/build/dist/api/modules/raeto/pins.d.ts +24 -0
- package/build/dist/api/modules/raeto/pins.js +1 -0
- package/build/dist/api/modules/raeto/templates.d.ts +22 -0
- package/build/dist/api/modules/raeto/templates.js +1 -0
- package/build/dist/api/modules/raeto/terms.d.ts +8 -0
- package/build/dist/api/modules/raeto/terms.js +1 -0
- package/build/dist/api/modules/raeto/types.d.ts +64 -0
- package/build/dist/api/modules/raeto/types.js +0 -0
- package/build/dist/api/modules/relay/api.d.ts +16 -0
- package/build/dist/api/modules/relay/api.js +1 -1
- package/build/dist/api/modules/relay/bootstrap.js +1 -1
- package/build/dist/api/modules/relay/discovery.js +1 -1
- package/build/dist/api/modules/relay/inbound.js +1 -1
- package/build/dist/api/modules/relay/index.d.ts +1 -0
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/order.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/readiness.d.ts +1 -0
- package/build/dist/api/modules/relay/readiness.js +1 -1
- package/build/dist/api/modules/relay/reads.js +1 -1
- package/build/dist/api/modules/relay/vaults.js +1 -1
- package/build/dist/api/modules/spark/actions.js +1 -1
- package/build/dist/api/modules/spark/details.js +1 -1
- package/build/dist/api/modules/spark/index.js +1 -1
- package/build/dist/api/modules/spark/management.js +1 -1
- package/build/dist/api/modules/steakhouse/analytics.js +1 -1
- package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
- package/build/dist/api/modules/steakhouse/index.js +1 -1
- package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
- package/build/dist/api/modules/steakhouse/management.js +1 -1
- package/build/dist/api/modules/steakhouse/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.d.ts +1 -0
- 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/fee-percent.d.ts +4 -0
- package/build/dist/api/modules/uniswap/fee-percent.js +1 -0
- 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.d.ts +2 -0
- 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.d.ts +2 -0
- 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.d.ts +38 -0
- package/build/dist/api/modules/uniswap/quote-guard.js +1 -0
- 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.d.ts +10 -3
- 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.d.ts +6 -0
- 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/copy.d.ts +5 -0
- package/build/dist/api/modules/upoch/copy.js +1 -0
- package/build/dist/api/modules/upoch/index.d.ts +8 -0
- package/build/dist/api/modules/upoch/index.js +1 -0
- package/build/dist/api/modules/upoch/pins.d.ts +8 -0
- package/build/dist/api/modules/upoch/pins.js +1 -0
- package/build/dist/api/modules/upoch/reads.d.ts +509 -0
- package/build/dist/api/modules/upoch/reads.js +1 -0
- 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.js +1 -1
- package/build/dist/api/modules/wormhole/swap-token-verdict.js +1 -1
- package/build/dist/api/modules/wormhole/third-party-text.d.ts +14 -3
- package/build/dist/api/modules/wormhole/third-party-text.js +1 -1
- package/build/dist/api/modules/wormhole/token-check.js +1 -1
- package/build/dist/api/modules/wormhole/x402-client.d.ts +17 -1
- package/build/dist/api/modules/wormhole/x402-client.js +1 -1
- package/build/dist/api/oak-fee.d.ts +12 -0
- package/build/dist/api/oak-fee.js +1 -0
- package/build/dist/api/param-text.d.ts +22 -0
- package/build/dist/api/param-text.js +1 -0
- package/build/dist/api/position-economics.d.ts +70 -0
- package/build/dist/api/position-economics.js +1 -0
- package/build/dist/api/positions.d.ts +8 -5
- package/build/dist/api/positions.js +1 -1
- package/build/dist/api/pricenote.js +1 -1
- package/build/dist/api/prices.d.ts +3 -0
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/pricing.js +1 -1
- package/build/dist/api/progress.d.ts +7 -0
- package/build/dist/api/progress.js +1 -0
- package/build/dist/api/read-budgets.d.ts +4 -0
- package/build/dist/api/read-budgets.js +1 -0
- package/build/dist/api/read-shape.d.ts +45 -0
- package/build/dist/api/read-shape.js +1 -0
- package/build/dist/api/revert.d.ts +23 -0
- package/build/dist/api/revert.js +1 -0
- package/build/dist/api/routes.js +1 -1
- package/build/dist/api/rpc.d.ts +1 -0
- package/build/dist/api/rpc.js +1 -1
- package/build/dist/api/secret-fields.d.ts +2 -0
- package/build/dist/api/secret-fields.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.d.ts +8 -0
- 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 +4 -0
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.d.ts +1 -0
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.d.ts +1 -0
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/types.d.ts +3 -0
- package/build/dist/api/untrusted-unwrap.d.ts +1 -0
- package/build/dist/api/untrusted-unwrap.js +1 -0
- package/build/dist/api/usd-estimate.d.ts +23 -0
- package/build/dist/api/usd-estimate.js +1 -0
- package/build/dist/api/vendor-limits.js +1 -1
- package/build/dist/chunks/23HNDJ76.js +2 -0
- package/build/dist/chunks/24Q3FNGX.js +1 -0
- package/build/dist/chunks/25C4DTVA.js +1 -0
- package/build/dist/chunks/2GXHYI23.js +1 -0
- package/build/dist/chunks/2HN3U6OG.js +1 -0
- package/build/dist/chunks/{QU5XKRGK.js → 2OVJ2BTJ.js} +1 -1
- package/build/dist/chunks/{FUDAXV5X.js → 2QGLPY2D.js} +1 -1
- package/build/dist/chunks/2WRXH6BL.js +1 -0
- package/build/dist/chunks/2ZBSE2LD.js +2 -0
- package/build/dist/chunks/2ZQ7X223.js +1 -0
- package/build/dist/chunks/2ZWKIBJT.js +1 -0
- package/build/dist/chunks/3A2IKFTV.js +1 -0
- package/build/dist/chunks/3CH2IPQL.js +1 -0
- package/build/dist/chunks/3PU2SD3U.js +2 -0
- package/build/dist/chunks/{ER47KGRM.js → 3ZH5SOC2.js} +1 -1
- package/build/dist/chunks/4NBXBKOX.js +2 -0
- package/build/dist/chunks/{WV3A3OUU.js → 4PLLS6CT.js} +1 -1
- package/build/dist/chunks/4R3G3H42.js +1 -0
- package/build/dist/chunks/4TTDAF4B.js +1 -0
- package/build/dist/chunks/4Z3IGMU6.js +1 -0
- package/build/dist/chunks/5DPJQCKJ.js +68 -0
- package/build/dist/chunks/{SJJR4ZBZ.js → 5GQJVKVY.js} +1 -1
- package/build/dist/chunks/5R576SDB.js +1 -0
- package/build/dist/chunks/5RXALTDT.js +1 -0
- package/build/dist/chunks/5TUXSOMI.js +1 -0
- package/build/dist/chunks/5UAXLWJ2.js +1 -0
- package/build/dist/chunks/{QQECG3WP.js → 5W74Z4WZ.js} +1 -1
- package/build/dist/chunks/5XAXJEWM.js +5 -0
- package/build/dist/chunks/65356YKW.js +1 -0
- package/build/dist/chunks/65OITTDL.js +1 -0
- package/build/dist/chunks/6F527FLN.js +1 -0
- package/build/dist/chunks/6MDYKE2O.js +1 -0
- package/build/dist/chunks/6OCLWSMZ.js +1 -0
- package/build/dist/chunks/75SULXNT.js +1 -0
- package/build/dist/chunks/{WU7XIAXB.js → 7EACRKFV.js} +1 -1
- package/build/dist/chunks/7U62MMUQ.js +1 -0
- package/build/dist/chunks/{DW4V5PUY.js → 7VH6JQ2H.js} +1 -1
- package/build/dist/chunks/A2V4NFVA.js +1 -0
- package/build/dist/chunks/A3BJSQ23.js +1 -0
- package/build/dist/chunks/ACH4BSME.js +3 -0
- package/build/dist/chunks/ADIPEGNN.js +1 -0
- package/build/dist/chunks/AHUCYDBC.js +1 -0
- package/build/dist/chunks/ANIF3JMV.js +4 -0
- package/build/dist/chunks/{ALLLYOUG.js → ATEVAJ5Y.js} +1 -1
- package/build/dist/chunks/B2HSLY5F.js +1 -0
- package/build/dist/chunks/{WTXC3XKW.js → B7BNDW35.js} +1 -1
- package/build/dist/chunks/BE3A7677.js +1 -0
- package/build/dist/chunks/{PAY5PD4H.js → BX46C5ZP.js} +1 -1
- package/build/dist/chunks/C3WBHFLX.js +1 -0
- package/build/dist/chunks/C6VJAL5B.js +1 -0
- package/build/dist/chunks/C76D54YG.js +1 -0
- package/build/dist/chunks/CD2JQ32C.js +1 -0
- package/build/dist/chunks/CI5ENLYA.js +1 -0
- package/build/dist/chunks/CNLL4NCR.js +1 -0
- package/build/dist/chunks/{P5PYFK7L.js → CQ5WRWV4.js} +1 -1
- package/build/dist/chunks/CSOO4SW7.js +1 -0
- package/build/dist/chunks/CZL6T2ZQ.js +1 -0
- package/build/dist/chunks/CZQ2CGYV.js +1 -0
- package/build/dist/chunks/D2IYA4LP.js +1 -0
- package/build/dist/chunks/D7QXZM3S.js +1 -0
- package/build/dist/chunks/{GNC6RXLT.js → DBOGRUPS.js} +1 -1
- package/build/dist/chunks/DGCJZ3HO.js +1 -0
- package/build/dist/chunks/DGDMRATN.js +1 -0
- package/build/dist/chunks/DMB64UIN.js +1 -0
- package/build/dist/chunks/DMDOSHV7.js +1 -0
- package/build/dist/chunks/DRLBTB4E.js +1 -0
- package/build/dist/chunks/E76Z2TT4.js +1 -0
- package/build/dist/chunks/EFESPGA2.js +1 -0
- package/build/dist/chunks/EHK7CDTU.js +1 -0
- package/build/dist/chunks/ELHRXA5U.js +1 -0
- package/build/dist/chunks/F7MGYRPU.js +1 -0
- package/build/dist/chunks/{MRMR4QHA.js → FAH7FKUT.js} +1 -1
- package/build/dist/chunks/{QBIY6FQN.js → FGEGJOAA.js} +1 -1
- package/build/dist/chunks/FHTNMGFR.js +1 -0
- package/build/dist/chunks/FN6GNTPR.js +1 -0
- package/build/dist/chunks/{EGYVRQUR.js → FTMA24EC.js} +1 -1
- package/build/dist/chunks/FXOFR432.js +1 -0
- package/build/dist/chunks/{VHV6WQ5F.js → G2AA73ZE.js} +1 -1
- package/build/dist/chunks/G2LAO23N.js +1 -0
- package/build/dist/chunks/{WIRBCS4W.js → GBIBRYOV.js} +1 -1
- package/build/dist/chunks/GDOHHXNH.js +1 -0
- package/build/dist/chunks/{GSBIERZD.js → GP6YO24Z.js} +1 -1
- package/build/dist/chunks/GQ3XZFRL.js +1 -0
- package/build/dist/chunks/{4HG6FRVH.js → GQITAJVF.js} +1 -1
- package/build/dist/chunks/H3E7UD2X.js +1 -0
- package/build/dist/chunks/HFVXNKA5.js +1 -0
- package/build/dist/chunks/HHYE42JG.js +21 -0
- package/build/dist/chunks/HRAHGYNK.js +1 -0
- package/build/dist/chunks/HS5HWBMU.js +1 -0
- package/build/dist/chunks/{BND2UFVW.js → HVFMIURK.js} +1 -1
- package/build/dist/chunks/IBL6TL2Q.js +1 -0
- package/build/dist/chunks/IT2JLILU.js +1 -0
- package/build/dist/chunks/IV4K7FMD.js +1 -0
- package/build/dist/chunks/{PNA6UIE5.js → JDSSYT6R.js} +1 -1
- package/build/dist/chunks/JFWJBZ7M.js +1 -0
- package/build/dist/chunks/JI5DXDMY.js +1 -0
- package/build/dist/chunks/JJGZ7W3V.js +1 -0
- package/build/dist/chunks/JPPQDELB.js +18 -0
- package/build/dist/chunks/{OLSP46ZD.js → K4P5VYDP.js} +1 -1
- package/build/dist/chunks/{JFYBH3DX.js → K6D6SDIG.js} +1 -1
- package/build/dist/chunks/K7HTDKAT.js +1 -0
- package/build/dist/chunks/KBU3PYP7.js +1 -0
- package/build/dist/chunks/KH4QFN72.js +3 -0
- package/build/dist/chunks/KMSAUFYV.js +1 -0
- package/build/dist/chunks/{RTAHNWHN.js → KOTGFD2V.js} +1 -1
- package/build/dist/chunks/KZA5GYZR.js +1 -0
- package/build/dist/chunks/LCH6F5HT.js +1 -0
- package/build/dist/chunks/LDJI2JAL.js +1 -0
- package/build/dist/chunks/LEV5SNNC.js +3 -0
- package/build/dist/chunks/{SPRVVJXI.js → LFSJDFMY.js} +1 -1
- package/build/dist/chunks/{PIIHOXWF.js → LJJYYUEG.js} +1 -1
- package/build/dist/chunks/LKX5WDOQ.js +1 -0
- package/build/dist/chunks/LVFI74ST.js +1 -0
- package/build/dist/chunks/M7BUKZW2.js +1 -0
- package/build/dist/chunks/{C5ZZAYXD.js → MI5HZDMH.js} +1 -1
- package/build/dist/chunks/MMCM3GSM.js +1 -0
- package/build/dist/chunks/MQ5F2VOK.js +1 -0
- package/build/dist/chunks/MSMHS456.js +1 -0
- package/build/dist/chunks/{JKD2B6OX.js → MSRCJ2BS.js} +1 -1
- package/build/dist/chunks/{XSKFKBDR.js → N64JJN37.js} +1 -1
- package/build/dist/chunks/NAO7VWZF.js +1 -0
- package/build/dist/chunks/ND32LJWI.js +1 -0
- package/build/dist/chunks/{Q42YI3EP.js → NMJVQX5M.js} +1 -1
- package/build/dist/chunks/NMQBOBWJ.js +1 -0
- package/build/dist/chunks/NQ4MTIU3.js +1 -0
- package/build/dist/chunks/NWPAQER2.js +1 -0
- package/build/dist/chunks/O2J5I4VA.js +1 -0
- package/build/dist/chunks/O4S6XAYV.js +1 -0
- package/build/dist/chunks/{TAEZTP4L.js → O5QTITN6.js} +1 -1
- package/build/dist/chunks/{RUC7KH7A.js → OB7BFDOV.js} +1 -1
- package/build/dist/chunks/OEZ7FCLF.js +1 -0
- package/build/dist/chunks/{GW5IXLKU.js → OI3N4EW4.js} +1 -1
- package/build/dist/chunks/{WP6RHXGN.js → OIQTZOBN.js} +1 -1
- package/build/dist/chunks/OODSXDIH.js +1 -0
- package/build/dist/chunks/OOPMZIG7.js +1 -0
- package/build/dist/chunks/OQFNUDMQ.js +1 -0
- package/build/dist/chunks/ORG6LVKJ.js +1 -0
- package/build/dist/chunks/{CBLMQ5UU.js → OSMOBKRQ.js} +1 -1
- package/build/dist/chunks/OTLUQWLF.js +1 -0
- package/build/dist/chunks/{2MT3G7YZ.js → OTYB6BHK.js} +1 -1
- package/build/dist/chunks/{H43RNCX2.js → OUROA7XR.js} +1 -1
- package/build/dist/chunks/{SMYWWIE6.js → OVM4QIET.js} +1 -1
- package/build/dist/chunks/OYDKAIS2.js +1 -0
- package/build/dist/chunks/P6OB2AFW.js +1 -0
- package/build/dist/chunks/PDPTJMTJ.js +1 -0
- package/build/dist/chunks/PEHXHQVA.js +1 -0
- package/build/dist/chunks/PMFR47H3.js +1 -0
- package/build/dist/chunks/PQXYTOV5.js +1 -0
- package/build/dist/chunks/PSGRZWES.js +1 -0
- package/build/dist/chunks/PZEF5LBL.js +2 -0
- package/build/dist/chunks/Q7L3BX6U.js +1 -0
- package/build/dist/chunks/QBYV7NXH.js +1 -0
- package/build/dist/chunks/QIB6OMQV.js +1 -0
- package/build/dist/chunks/QLAOBULN.js +1 -0
- package/build/dist/chunks/QLFPAN6S.js +1 -0
- package/build/dist/chunks/QMEGAKLI.js +1 -0
- package/build/dist/chunks/QMNUB2GM.js +2 -0
- package/build/dist/chunks/QMZEGT5B.js +1 -0
- package/build/dist/chunks/R73R4KN3.js +1 -0
- package/build/dist/chunks/RN3WUJIO.js +1 -0
- package/build/dist/chunks/RNCMXKKS.js +1 -0
- package/build/dist/chunks/ROQQ62LP.js +1 -0
- package/build/dist/chunks/RUTSEGGD.js +1 -0
- package/build/dist/chunks/{TFDPEAVZ.js → S4JUFCT4.js} +1 -1
- package/build/dist/chunks/{2VXLVXIB.js → S4UJDZGN.js} +1 -1
- package/build/dist/chunks/SCG5HWMN.js +1 -0
- package/build/dist/chunks/{XQA5LCL6.js → SENOU5JR.js} +1 -1
- package/build/dist/chunks/SMSXZ3FN.js +1 -0
- package/build/dist/chunks/SUNTJ6IU.js +1 -0
- package/build/dist/chunks/SZ466I5X.js +1 -0
- package/build/dist/chunks/TGFQQCRY.js +1 -0
- package/build/dist/chunks/{K4DHHQBI.js → THL4TMQW.js} +2 -2
- package/build/dist/chunks/TI727O2H.js +1 -0
- package/build/dist/chunks/{UD2XMNIT.js → TMRAF2L2.js} +1 -1
- package/build/dist/chunks/TNJTET4G.js +1 -0
- package/build/dist/chunks/TVIMP5CK.js +1 -0
- package/build/dist/chunks/{PV5FDT6O.js → TXGZ6NWN.js} +1 -1
- package/build/dist/chunks/U243AWCH.js +1 -0
- package/build/dist/chunks/U762746N.js +1 -0
- package/build/dist/chunks/U7UPLF4F.js +1 -0
- package/build/dist/chunks/{7QIO77VE.js → UPKVD7WG.js} +1 -1
- package/build/dist/chunks/{ZQAFFWDK.js → URBEK2VV.js} +1 -1
- package/build/dist/chunks/USEF3QKG.js +1 -0
- package/build/dist/chunks/UVAR6BHU.js +1 -0
- package/build/dist/chunks/V5YSJKRH.js +70 -0
- package/build/dist/chunks/VB36EHIR.js +1 -0
- package/build/dist/chunks/VMZYFO6I.js +1 -0
- package/build/dist/chunks/{TX2EOIRS.js → VST6LFUB.js} +1 -1
- package/build/dist/chunks/{U4JGEMKT.js → VVAM3EAK.js} +1 -1
- package/build/dist/chunks/VVJO6OYK.js +1 -0
- package/build/dist/chunks/VVWFB53Q.js +1 -0
- package/build/dist/chunks/VXCGMALF.js +1 -0
- package/build/dist/chunks/VZVW5J7J.js +1 -0
- package/build/dist/chunks/W32UECOL.js +1 -0
- package/build/dist/chunks/{XD6X3KTC.js → W4RYRLL5.js} +1 -1
- package/build/dist/chunks/{2MZXTOZU.js → WAKZWSHB.js} +1 -1
- package/build/dist/chunks/WBNFRPAT.js +1 -0
- package/build/dist/chunks/{AFBEZXNV.js → WNWRF4HE.js} +1 -1
- package/build/dist/chunks/{4DP2VPXR.js → WOGWLFAL.js} +1 -1
- package/build/dist/chunks/{HM72DH4V.js → WRUTW6CG.js} +1 -1
- package/build/dist/chunks/{VYYSL557.js → WSILNJS2.js} +1 -1
- package/build/dist/chunks/X24YTJST.js +1 -0
- package/build/dist/chunks/{IPN6Z4JM.js → X5AL3DUK.js} +1 -1
- package/build/dist/chunks/XBNZ7GTY.js +1 -0
- package/build/dist/chunks/{XL3LLGIR.js → XEBMS5KU.js} +1 -1
- package/build/dist/chunks/XEPCDGN2.js +1 -0
- package/build/dist/chunks/{KIFZ5ZSK.js → XL3W7DAQ.js} +1 -1
- package/build/dist/chunks/{DL6AEWEM.js → XPWGPZ2C.js} +1 -1
- package/build/dist/chunks/{T7TFUH5K.js → XRDLMTBJ.js} +1 -1
- package/build/dist/chunks/XTFRPI4G.js +1 -0
- package/build/dist/chunks/XV3YJ4P6.js +1 -0
- package/build/dist/chunks/XW3VGWXK.js +1 -0
- package/build/dist/chunks/{6WD4HHID.js → Y2QADJOB.js} +1 -1
- package/build/dist/chunks/Y64GFBTA.js +1 -0
- package/build/dist/chunks/YARZE7SJ.js +1 -0
- package/build/dist/chunks/YBLJ75U5.js +1 -0
- package/build/dist/chunks/YEIM6BZQ.js +1 -0
- package/build/dist/chunks/YRSAZTTC.js +7 -0
- package/build/dist/chunks/YXXK6EPI.js +1 -0
- package/build/dist/chunks/Z3IBPCY4.js +2 -0
- package/build/dist/chunks/{QHBS3PVU.js → Z7FGEWO2.js} +1 -1
- package/build/dist/chunks/ZNPVBNC5.js +1 -0
- package/build/dist/chunks/ZQ6AF3VX.js +1 -0
- package/build/dist/chunks/ZTKT3ZQK.js +1 -0
- package/build/dist/chunks/{4BVP652W.js → ZZ6FZGHF.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/2THSW4QN.js +0 -1
- package/build/dist/chunks/2TK3ETUO.js +0 -1
- package/build/dist/chunks/35KR3VSS.js +0 -1
- package/build/dist/chunks/3GQ7A3VB.js +0 -1
- package/build/dist/chunks/3XNZUIRU.js +0 -1
- package/build/dist/chunks/46547QT3.js +0 -1
- package/build/dist/chunks/4EN6MQEI.js +0 -1
- package/build/dist/chunks/4I3OU56B.js +0 -1
- package/build/dist/chunks/52ELWNXJ.js +0 -2
- package/build/dist/chunks/5AXWBSPG.js +0 -1
- package/build/dist/chunks/5N3O42X6.js +0 -1
- package/build/dist/chunks/5SMVQCAP.js +0 -1
- package/build/dist/chunks/5SZPNZG4.js +0 -1
- package/build/dist/chunks/64GOINYS.js +0 -1
- package/build/dist/chunks/6I4NTKB2.js +0 -1
- package/build/dist/chunks/6JAXZNZ3.js +0 -1
- package/build/dist/chunks/6O3Q5B6M.js +0 -1
- package/build/dist/chunks/6OGDTEGH.js +0 -1
- package/build/dist/chunks/6WZX7C4T.js +0 -2
- package/build/dist/chunks/6YB3VOUL.js +0 -1
- package/build/dist/chunks/7GJ6SLEV.js +0 -1
- package/build/dist/chunks/7KWZ5QJU.js +0 -1
- package/build/dist/chunks/7QZOTRSA.js +0 -2
- package/build/dist/chunks/7WSHW7KW.js +0 -1
- package/build/dist/chunks/A7I4IWUB.js +0 -1
- package/build/dist/chunks/ABPL3ZZI.js +0 -1
- package/build/dist/chunks/ACW63WIL.js +0 -20
- package/build/dist/chunks/AEL62KCG.js +0 -1
- package/build/dist/chunks/AKYF5264.js +0 -7
- package/build/dist/chunks/AW7AXQCZ.js +0 -1
- package/build/dist/chunks/AXRL3REN.js +0 -1
- package/build/dist/chunks/BBTPRZ6T.js +0 -1
- package/build/dist/chunks/BOVMED7R.js +0 -1
- package/build/dist/chunks/BTPXJAUX.js +0 -1
- package/build/dist/chunks/C7AXJHBT.js +0 -1
- package/build/dist/chunks/CBG5HARQ.js +0 -2
- package/build/dist/chunks/CDPSMI3Z.js +0 -1
- package/build/dist/chunks/CHXBOXOD.js +0 -1
- package/build/dist/chunks/CQEJSCFQ.js +0 -1
- package/build/dist/chunks/DBNTZEAJ.js +0 -1
- package/build/dist/chunks/DHUDSOGR.js +0 -18
- package/build/dist/chunks/DJN3JAWB.js +0 -1
- package/build/dist/chunks/E3RACZUY.js +0 -1
- package/build/dist/chunks/FEYAY6OZ.js +0 -1
- package/build/dist/chunks/FJ4S4GHY.js +0 -1
- package/build/dist/chunks/FWD4L3CJ.js +0 -1
- package/build/dist/chunks/GG6Y4OCJ.js +0 -1
- package/build/dist/chunks/GGHBFLRC.js +0 -1
- package/build/dist/chunks/GGSAKCND.js +0 -1
- package/build/dist/chunks/GRQYTVNT.js +0 -1
- package/build/dist/chunks/H6T5FXEX.js +0 -1
- package/build/dist/chunks/HHXBUYHO.js +0 -1
- package/build/dist/chunks/HKEMQBFA.js +0 -1
- package/build/dist/chunks/HQUVB7Z5.js +0 -3
- package/build/dist/chunks/HU7IMNBI.js +0 -1
- package/build/dist/chunks/HWX36XJI.js +0 -1
- package/build/dist/chunks/I26DMNJG.js +0 -1
- package/build/dist/chunks/I55MURSJ.js +0 -1
- package/build/dist/chunks/IMO3GDA5.js +0 -1
- package/build/dist/chunks/IPRVIKYC.js +0 -1
- package/build/dist/chunks/IVX4R5OL.js +0 -1
- package/build/dist/chunks/JQOQMFWD.js +0 -3
- package/build/dist/chunks/JUZ5JU6D.js +0 -70
- package/build/dist/chunks/JZS3E66E.js +0 -1
- package/build/dist/chunks/K3RDPI5J.js +0 -1
- package/build/dist/chunks/KBKK7UNY.js +0 -1
- package/build/dist/chunks/KVFZKPJT.js +0 -1
- package/build/dist/chunks/L5BLHY34.js +0 -1
- package/build/dist/chunks/LKXO2BQS.js +0 -1
- package/build/dist/chunks/LKZX4CAA.js +0 -1
- package/build/dist/chunks/LYMNHO5T.js +0 -1
- package/build/dist/chunks/M2UXYCKH.js +0 -1
- package/build/dist/chunks/M37654RL.js +0 -1
- package/build/dist/chunks/M6LC6DRE.js +0 -1
- package/build/dist/chunks/MOE3EVAL.js +0 -1
- package/build/dist/chunks/N4Q6GN65.js +0 -1
- package/build/dist/chunks/NAZPDRIF.js +0 -1
- package/build/dist/chunks/NKX3FE34.js +0 -1
- package/build/dist/chunks/NKZKKCK2.js +0 -1
- package/build/dist/chunks/NOFUKKP5.js +0 -1
- package/build/dist/chunks/O6ROOKY2.js +0 -1
- package/build/dist/chunks/OJ4WJUPP.js +0 -1
- package/build/dist/chunks/OOZSE2R7.js +0 -1
- package/build/dist/chunks/OTXSKFUD.js +0 -1
- package/build/dist/chunks/P5AJSLZ7.js +0 -1
- package/build/dist/chunks/PACN53TR.js +0 -1
- package/build/dist/chunks/PAHXBLCS.js +0 -1
- package/build/dist/chunks/PK66GCDT.js +0 -1
- package/build/dist/chunks/PSBQWDYI.js +0 -1
- package/build/dist/chunks/PXT5YTWU.js +0 -1
- package/build/dist/chunks/PZGGE5D3.js +0 -1
- package/build/dist/chunks/QA2RRIES.js +0 -1
- package/build/dist/chunks/QA3UHEO3.js +0 -1
- package/build/dist/chunks/QFNT73OF.js +0 -1
- package/build/dist/chunks/QW2OPEYJ.js +0 -1
- package/build/dist/chunks/QYVREJYC.js +0 -1
- package/build/dist/chunks/ROFPXEQ5.js +0 -2
- package/build/dist/chunks/RTGS7RIO.js +0 -1
- package/build/dist/chunks/RUX3RY7Y.js +0 -1
- package/build/dist/chunks/RVDUSNWW.js +0 -1
- package/build/dist/chunks/S5CBVFHY.js +0 -1
- package/build/dist/chunks/SIYUNOLI.js +0 -1
- package/build/dist/chunks/TEJ7W534.js +0 -1
- package/build/dist/chunks/TPBAFS7K.js +0 -1
- package/build/dist/chunks/TVWMTMEF.js +0 -1
- package/build/dist/chunks/U2RMUVVY.js +0 -1
- package/build/dist/chunks/U5PMVP56.js +0 -1
- package/build/dist/chunks/V5JWGWXC.js +0 -1
- package/build/dist/chunks/VCOTCVKN.js +0 -1
- package/build/dist/chunks/VEQBHI6O.js +0 -1
- package/build/dist/chunks/VNV6ZISN.js +0 -1
- package/build/dist/chunks/VYAJXLND.js +0 -1
- package/build/dist/chunks/WCNHZYQQ.js +0 -1
- package/build/dist/chunks/WLMWWEP7.js +0 -2
- package/build/dist/chunks/X2P55AC3.js +0 -1
- package/build/dist/chunks/XBE3B6Y2.js +0 -1
- package/build/dist/chunks/XKSVTN5X.js +0 -1
- package/build/dist/chunks/XSRIJUFU.js +0 -1
- package/build/dist/chunks/YCZPSMZ5.js +0 -1
- package/build/dist/chunks/YDNTY67T.js +0 -1
- package/build/dist/chunks/YN56C7PN.js +0 -1
- package/build/dist/chunks/YRNXGQJC.js +0 -1
- package/build/dist/chunks/YWRLY5EA.js +0 -1
- package/build/dist/chunks/YWSX6IE6.js +0 -1
- package/build/dist/chunks/YXTSWRV5.js +0 -1
- package/build/dist/chunks/Z6LZGCVW.js +0 -1
- package/build/dist/chunks/ZQWZGH7V.js +0 -1
- package/build/dist/chunks/ZSN4IRI5.js +0 -1
- package/build/dist/chunks/ZV5HIQXC.js +0 -1
- package/build/dist/chunks/ZXJ24B4L.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C,b as O}from"./HVFMIURK.js";import{a as f,b as k}from"./DMDOSHV7.js";import{d as i}from"./XV6F3RET.js";import{a as y,c as w}from"./LFSJDFMY.js";import{b as d}from"./TI727O2H.js";import{a}from"./XSD5NL7J.js";var x=r=>({tools:[{name:"netnet_card_read",inputSchema:{type:"object",additionalProperties:!1,required:["program"],properties:{program:{enum:Object.keys(i),description:"Card program to read: turbo (card collection), blackjack or feed."},method:{type:"string",description:"Exact read-only ABI signature from the catalog. Omit to list all available reads."},values:{type:"array",maxItems:16,description:"Ordered inputs for the chosen method: decimal strings for integers, 0x addresses or hex bytes, booleans, or arrays/tuples of them."}}},execute:async t=>{if(Object.keys(t).some(e=>!["program","method","values"].includes(e))||typeof t.program!="string"||!Object.hasOwn(i,t.program))throw new a("Choose turbo, blackjack or feed.");let o=i[t.program],u=o.abi.filter(e=>e.type==="function"&&["view","pure"].includes(e.stateMutability));if(t.method===void 0){if(t.values!==void 0)throw new a("values requires an exact read method.");return{chainId:d,contract:o.address,methods:u.map(e=>({method:f(e),inputs:e.inputs,outputs:e.outputs})),units:"Card amounts are whole counts, identified by collection and series ID. Metadata is untrusted text. Reads grant no signing authority."}}let n=u.find(e=>f(e)===t.method),m=t.values??[];if(!n||!Array.isArray(m)||m.length!==n.inputs.length)throw new a("Choose an exact catalog read signature and its ordered inputs. Writes and signing are unavailable.");let l=r.clientFor(d);if(await l.getChainId()!==d)throw new a("NetNet cards require chain 4663.");let p=await l.getBlock(),c=n.inputs.map((e,s)=>k(e,m[s])),E=await l.readContract({address:o.address,abi:[n],functionName:n.name,args:c,blockNumber:p.number}),g=t.program==="turbo"&&n.name==="balanceOf"?[c[1]]:t.program==="blackjack"&&["unclaimedChips","unclaimedTotalOf"].includes(n.name)?[c[0]]:n.inputs.flatMap((e,s)=>e.type==="uint256"&&["id","seriesId"].includes(e.name??"")?[c[s]]:e.type==="uint256[]"&&e.name==="ids"?c[s]:[]),b;if(g.length){let e=await l.readContract({address:i.turbo.address,abi:i.turbo.abi,functionName:"seriesCount",blockNumber:p.number});b=[...new Set(g)].map(s=>({id:s.toString(),status:s>0n&&s<=e?"known":"unknown-series"}))}return{chainId:d,collection:i.turbo.address,contract:o.address,blockNumber:String(p.number),blockHash:p.hash,method:t.method,outputs:n.outputs,...b?{seriesStatus:b}:{},data:h(E)}}},{name:"netnet_card_capabilities",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async t=>{if(Object.keys(t).length)throw new a("Card capabilities takes no arguments.");return{chainId:d,collection:i.turbo.address,blackjack:i.blackjack.address,active:["netnet_card_read","netnet_card_capabilities",...y],candidateOnly:{turbo:[...C,...O],recovery:[]},activation:"Only self-only finalize, expire and parked-chip claim are enabled, with local human confirmation and durable recovery. TURBO writes, seating, channel signatures and collection approvals remain disabled.",refused:w}}}]});function h(r,t=0){if(t>12)throw new a("Card read result exceeds the supported nesting.");if(typeof r=="bigint")return r.toString();if(typeof r=="string"){if(r.length>8194)throw new a("Card read result exceeds the supported length.");return/^0x[0-9a-f]*$/i.test(r)?r:`untrusted ${JSON.stringify(r)}`}if(Array.isArray(r)){if(r.length>4096)throw new a("Choose a bounded card read.");return r.map(o=>h(o,t+1))}return r&&typeof r=="object"?Object.fromEntries(Object.entries(r).map(([o,u])=>[o,h(u,t+1)])):r}export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as X}from"./ADIPEGNN.js";import{b as Z}from"./OB7BFDOV.js";import{i as ee}from"./ANIF3JMV.js";import{a as Y}from"./E76Z2TT4.js";import{b as z}from"./GBIBRYOV.js";import{c as Q}from"./SUNTJ6IU.js";import{a as D,b as k,c as R,d as N,g as V,h as I,k as _,l as x,n as B,p as W,r as $,s as U,t as q,v as E,x as J,y as G}from"./3A2IKFTV.js";import{a as y}from"./X5V2Z2NM.js";import{b as K}from"./SPJCSEKP.js";import{a as O}from"./43LI5NKJ.js";import{c as L,e as T,g as w}from"./NWNYJ26T.js";import{a as g,d as j}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{Buffer as te}from"node:buffer";import{decodeEventLog as re,encodeFunctionData as H,getAddress as se,hexToString as de,parseAbiItem as ce,toEventSelector as ie}from"viem";var Ke={register:"erc8004_register"},ge="Oak now always adds the public oak.registrar marker when it registers an agent, so tag: false and --no-tag are no longer available. Remove the option and register again. To use an agent ID you already own without the marker, link it with oak setup link <agentId>.",fe="The registration went through, but Oak could not find its oak.registrar marker on Robinhood Chain. Nothing else was sent. Ask me to check the agent with erc8004_identity.",le="One transaction registers your agent and writes the public marker oak.registrar = oak. Anyone can see on Robinhood Chain that this agent was registered through Oak. The marker is self-reported, not proof of anything, and the transaction stays in the public history even if the marker is changed later. It needs gas.",F="https://eips.ethereum.org/EIPS/eip-8004#registration-v1",ue={type:"object",required:["type","name","description","image","services","x402Support","active","registrations"],properties:{type:{const:F,description:"ERC-8004 registration-v1 profile type URI."},name:{type:"string",minLength:1,description:"Short public name for the agent."},description:{type:"string",description:"Public text describing what the agent does; may be empty."},image:{type:"string",description:"Public HTTPS or IPFS image URI without credentials."},services:{type:"array",items:{type:"object",required:["name","endpoint"]},description:"Service endpoint objects with name and endpoint; use an empty list for none."},x402Support:{type:"boolean",description:"Whether the agent supports x402 payments."},active:{type:"boolean",description:"Whether this agent is active."},registrations:{type:"array",description:"Registry references with agentRegistry and agentId; leave empty before first registration."},tags:{type:"array",items:{type:"string"},description:"Optional public text labels for the agent."},supportedTrust:{type:"array",items:{type:"string"},description:"Optional trust mechanism labels supported by the agent."}}};function pe(e){if(typeof e!="string"||!e.trim())return!1;try{let t=new URL(e);return["https:","ipfs:"].includes(t.protocol)&&!!t.hostname&&!t.username&&!t.password}catch{return!1}}var me=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"&&t.trim()),he=e=>e.replace(/\.$/,"");function ye(e,t,a,n){let{registryId:d}=I(e);if(!T(t))throw new g("Provide a registration-v1 profile object.");if(a!==void 0&&typeof a!="boolean")throw new g("The tag option must be a boolean.");let o=[],r=(i,c)=>o.push(`${i}: ${c}`);t.type!==F&&r("type",`use "${F}"`),(typeof t.name!="string"||!t.name.trim())&&r("name",'a short name for your agent, such as "Oak Agent 1"'),typeof t.description!="string"&&r("description","a sentence about what your agent does (it may be empty text)"),pe(t.image)||r("image","an HTTPS or IPFS link to a picture, with no username or password in it"),typeof t.active!="boolean"&&r("active","true or false"),typeof t.x402Support!="boolean"&&r("x402Support","true or false"),Array.isArray(t.services)?t.services.forEach((i,c)=>{try{Z(i)}catch(p){if(!(p instanceof g))throw p;r(`services item ${c+1}`,he(p.message))}}):r("services","a list of endpoints, or [] for none");for(let i of["tags","supportedTrust"])t[i]!==void 0&&!me(t[i])&&r(i,"a list of nonempty text labels, or leave it out");if(Array.isArray(t.registrations)?t.registrations.forEach((i,c)=>{let p=`registrations item ${c+1}`;if(!T(i)||typeof i.agentRegistry!="string"||!/^eip155:[1-9][0-9]*:0x[0-9a-fA-F]{40}$/.test(i.agentRegistry))return r(p,"an agentRegistry such as eip155:4663:0x\u2026 and its agentId");let f=typeof i.agentId=="number"&&Number.isSafeInteger(i.agentId)?String(i.agentId):i.agentId,b;try{b=x(f)}catch{return r(p,'an agentId as a whole number, such as "1"')}w(i.agentRegistry,d)&&(n===void 0?r(p,"remove the entry for this registry; its ID comes from the mined Registered receipt, and erc8004_update adds it afterwards"):b!==n&&r(p,`the agentId does not match the agent being updated; use "${n}" or remove the entry`))}):r("registrations","a list, or [] before the first registration"),o.length)throw new g(`This profile needs: ${o.join("; ")}. Fix all of these and try again.`);let u=t.registrations.map(i=>({...i}));n!==void 0&&!u.some(i=>w(i.agentRegistry,d))&&u.push({agentId:n.toString(),agentRegistry:d});let s=[...new Set((t.tags??[]).filter(i=>i!==k))];a!==!1&&s.push(k);let m={...t,registrations:u,...s.length?{tags:s}:{}};s.length||delete m.tags;let l;try{if(l=JSON.stringify(m),te.byteLength(l)>65536)throw new Error;JSON.parse(l)}catch{throw new g("Profile must be JSON data no larger than 64 KiB.")}return`data:application/json;base64,${te.from(l,"utf8").toString("base64")}`}async function M(e,t){try{let{chainId:a,registry:n}=I(e),d=x(t),o=e.clientFor(a),r=await o.readContract({address:n,abi:y,functionName:"ownerOf",args:[d]}).catch(l=>{throw j(l)?new g(`Agent ${d} does not exist in this ERC-8004 registry: the owner lookup reverted. Check the agent ID.`):l});O(r);let[u,s,m]=await Promise.all([o.readContract({address:n,abi:y,functionName:"tokenURI",args:[d]}),o.readContract({address:n,abi:y,functionName:"getAgentWallet",args:[d]}),o.readContract({address:n,abi:y,functionName:"getMetadata",args:[d,k]})]);if(O(s),typeof u!="string"||typeof m!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(m))throw new g("The registry returned invalid identity data.");return{agentId:d.toString(),chainId:a,registry:n,owner:r,uri:u,agentWallet:s,registrarMetadata:m,registryValidated:!1,summary:D}}catch(a){throw new g(e.plainError(a))}}async function De(e,t){let a=await M(e,t);return{...a,uri:A(a.uri)}}async function we(e,t,a,n,d,o){let{registry:r}=I(e),u=await E(e,t,a,d),s=o===void 0?"Registered":"URIUpdated",m=ie(o===void 0?"Registered(uint256,string,address)":"URIUpdated(uint256,string,address)"),l=u.logs.filter(v=>w(v.address,r)&&v.topics[0]===m&&!v.removed);if(l.length!==1)throw new g(`The receipt must contain one matching ${s} event.`);let i=l[0],c=re({abi:y,eventName:s,topics:i.topics,data:i.data,strict:!0}),p=c.args.agentId,f=c.eventName==="Registered"?c.args.agentURI:c.args.newURI,b=c.eventName==="Registered"?c.args.owner:c.args.updatedBy;if(o!==void 0&&p!==o||f!==n||!w(b,a))throw new g("The registry event does not match the expected agent, URI and wallet.");let h=await M(e,p.toString());if(h.uri!==n||o===void 0&&!w(h.owner,a))throw new g("The current agent owner or URI does not match the confirmed operation.");return h}function be(e,t){let{chainId:a,registry:n}=I(e);return e.unsignedTx({to:n,chainId:a,value:"0",data:H({abi:y,functionName:"setMetadata",args:[t,k,R]}),description:`Set mutable oak.registrar metadata to oak for agent ${t}.`})}async function ae(e,t,a,n){let{registry:d}=I(e),o=x(n.agentId),r=await E(e,t,a,H({abi:y,functionName:"setMetadata",args:[o,k,R]})),u=ie("MetadataSet(uint256,string,string,bytes)"),s=r.logs.filter(c=>w(c.address,d)&&c.topics[0]===u&&!c.removed);if(s.length!==1)throw new g("The receipt must contain one matching MetadataSet event.");let m=s[0],{args:l}=re({abi:y,eventName:"MetadataSet",topics:m.topics,data:m.data,strict:!0});if(l.agentId!==o||l.metadataKey!==k||l.metadataValue!==R)throw new g("The metadata event does not match this agent and registrar marker.");let i=await M(e,n.agentId);if(i.registrarMetadata!==R||i.uri!==n.uri||!w(i.owner,n.owner))throw new g("The current agent metadata, owner or URI does not match the confirmed operation.");return i}async function ke(e,t){let{chainId:a,registry:n}=I(e),d=e.clientFor(a),o=await d.readContract({address:n,abi:y,functionName:"balanceOf",args:[t]});if(o===0n)return;if(typeof o!="bigint"||o<0n)throw new g("Registry balance is unavailable; registration was not built.");let r=await d.getBlockNumber({cacheTime:0}),u=new Set;for(;;){let s=r>9999999n?r-9999999n:0n,m=await d.getLogs({address:n,event:ce("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:t},fromBlock:s,toBlock:r,strict:!0});for(let l of m){let i=l.args.tokenId.toString();if(l.removed||u.has(i))continue;u.add(i);let c=await M(e,i);if(w(c.owner,t))return c}if(s===0n)throw new g("Owned identity could not be located; registration was not built. Run oak setup link <agentId>.");r=s-1n}}function Ie(e){if(e===void 0)return[];if(!Array.isArray(e)||e.length>15)throw new g("Provide at most 15 user metadata entries as { key, value } with value as 0x hex or text.");let t=new Set;return e.map(a=>{if(!T(a))throw new g("Provide each metadata entry as { key, value } or { key, text }.");let n=J(a.key);if(n===k)throw new g("The key oak.registrar is reserved for the registration marker. Remove that metadata entry.");if(t.has(n))throw new g(`Metadata key ${A(n)} is repeated.`);return t.add(n),{metadataKey:n,metadataValue:G(a)}})}function oe(e,t,a){let n=$(t);if(!n)return;let{registryId:d}=I(e);return Array.isArray(n.registrations)&&n.registrations.some(o=>T(o)&&typeof o.agentRegistry=="string"&&w(o.agentRegistry,d)&&String(o.agentId)===a.toString())}function ve(e,t,a){let n=oe(e,t.uri,BigInt(t.agentId));return n===!0?{...t,profileComplete:!0}:{...t,profileComplete:n===void 0?null:!1,nextStep:{tool:"erc8004_update",arguments:{agentId:t.agentId,profile:a??"a registration-v1 profile object"},why:"The minted profile does not list its own registry and agent ID yet (registrations is empty). erc8004_update appends it automatically. It is a normal action: it needs a verified identity link and an active subscription, so link with oak_setup first."}}}async function ne(e,t,a,n){let{chainId:d,registry:o}=I(e);O(n),B(e,a.chainId);let r=t?x(a.agentId):void 0;if(!t&&(a.tag===!1||a.noTag!==void 0||a["--no-tag"]!==void 0))throw new g(ge);if(a.tag!==void 0&&typeof a.tag!="boolean")throw new g("The tag option must be a boolean.");let s=!t&&a.profile===void 0?"":ye(e,a.profile,a.tag,r),m=t?[]:Ie(a.metadata),l=a.tag!==!1;if(t&&a.metadataTransactionHash!==void 0&&(!l||a.transactionHash===void 0))throw new g("A metadata transaction hash requires tagging and the profile transaction hash.");let i=r!==void 0?H({abi:y,functionName:"setAgentURI",args:[r,s]}):H({abi:y,functionName:"register",args:[s,[...m,{metadataKey:k,metadataValue:R}]]}),c=f=>r===void 0?ve(e,f,a.profile):f;if(a.transactionHash!==void 0){let f=await we(e,a.transactionHash,n,s,i,r);if(!t){if(!w(f.registrarMetadata,R))throw new g(fe);if(a.metadataTransactionHash!==void 0)throw new g("Registration already writes oak.registrar in one transaction. Omit metadataTransactionHash.");return c(f)}return l&&a.metadataTransactionHash!==void 0?c(await ae(e,a.metadataTransactionHash,n,f)):c(f)}if(!t){let f=await ke(e,n);if(f){let b={...f,registrationResumed:!0},h=$(f.uri),v=Array.isArray(h?.tags)&&h.tags.includes(k);if(a.metadataTransactionHash!==void 0){if(!v)throw new g("Only a legacy Oak profile can resume its registrar metadata. Link this agent with oak setup link <agentId>.");return c({...await ae(e,a.metadataTransactionHash,n,f),registrationResumed:!0})}if(!v||f.registrarMetadata!=="0x")return c(b);let S=await U(e,[be(e,x(f.agentId))],n,`Resume registrar metadata for legacy Oak agent ${f.agentId}; no new identity will be minted. Submit locally, then repeat these arguments with metadataTransactionHash to verify the marker receipt.`);return{...b,...S}}if(a.metadataTransactionHash!==void 0)throw new g("No owned legacy Oak identity was found; no metadata transaction was built.")}r!==void 0&&await q(e,r,n);let p=[e.unsignedTx({to:o,data:i,value:"0",chainId:d,description:r===void 0?"Register an ERC-8004 agent profile.":`Update ERC-8004 agent ${r} profile.`})];return t?U(e,p,n,"Submit locally, then repeat the original arguments with transactionHash to verify the profile receipt and URI. The tag option changes the profile tag only; existing onchain metadata is unchanged."):U(e,p,n,`${le} Submit locally, then repeat the original arguments with transactionHash to verify the registration receipt, URI and marker. Update the profile registrations with the mined ID afterward.`)}async function Re(e,t){let a=await M(e,t.agentId),{chainId:n,registry:d}=I(e),o=e.clientFor(n),r=BigInt(a.agentId),u=t.metadataKeys===void 0?[]:(()=>{if(!Array.isArray(t.metadataKeys)||t.metadataKeys.length>16)throw new g("Provide at most 16 metadata keys.");return t.metadataKeys.map(h=>W(h,"metadata key",128,!1))})(),s=t.operator===void 0?void 0:se(String(t.operator)),[m,l,...i]=await Promise.allSettled([o.readContract({address:d,abi:y,functionName:"getApproved",args:[r]}),s?o.readContract({address:d,abi:y,functionName:"isApprovedForAll",args:[a.owner,s]}):Promise.resolve(void 0),...u.map(h=>o.readContract({address:d,abi:y,functionName:"getMetadata",args:[r,h]}))]),c=h=>h.status==="fulfilled"?h.value:void 0,p=c(m),f=_(a.agentWallet)?"unset":w(a.agentWallet,a.owner)?"owner":"verified-other",b=oe(e,a.uri,r);return{...a,approved:typeof p=="string"&&_(p)?null:p??"unavailable",...s?{operator:s,operatorApproved:c(l)??"unavailable"}:{},walletState:f,walletNote:f==="unset"?"No verified payment wallet: it starts as the minting owner, and any NFT transfer or erc8004_unset_wallet clears it. Re-verify with erc8004_wallet_proof then erc8004_set_wallet.":f==="owner"?"The payment wallet is the current owner.":"The payment wallet was proven by a signature from that wallet and is not the owner.",profile:{selfRegistered:b??null,fetched:!1,note:b===void 0?"The URI is external or not decodable; Oak does not fetch it.":void 0},...u.length?{metadata:Object.fromEntries(u.map((h,v)=>{let S=c(i[v]),P=typeof S=="string"&&/^0x([0-9a-fA-F]{2})*$/.test(S)?S:void 0,C;if(P&&P!=="0x")try{C=A(de(P))}catch{C=void 0}return[A(h),{hex:P??"unavailable",...C?{text:C}:{}}]}))}:{}}}var Ae={type:"object",additionalProperties:!1,required:["key"],properties:{key:{type:"string",minLength:1,maxLength:128,description:"Metadata key; agentWallet and oak.registrar are reserved during registration."},value:{...V,description:"Metadata bytes as 0x-prefixed hex; provide value or text."},text:{type:"string",description:"Metadata as UTF-8 text; provide text or value."}}},Te=e=>{let t=(n,d,o)=>({name:n,inputSchema:d,execute:async(r,u)=>{try{let s=await o(r,u);return T(s)&&typeof s.uri=="string"?{...s,uri:A(s.uri)}:s}catch(s){throw new g(e.plainError(s))}}}),a=n=>({type:"object",additionalProperties:!1,required:n?["agentId","profile"]:[],properties:{profile:{...ue,description:n?"Registration-v1 profile object to publish for this agent.":"Omit for an empty URI; register(uri, metadata[]) still writes the public oak.registrar marker. Attach a profile later with erc8004_update."},tag:{type:"boolean",default:!0,description:n?"Set false to remove the profile tag. Profile updates leave existing onchain metadata unchanged.":"Accepted only as true. Oak always adds the oak.registrar marker when it registers."},transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Verify the exact profile transaction, event and URI.":"After local submission, verify exact registration calldata, event, URI and oak.registrar marker."},metadataTransactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:n?"Optional legacy metadata transaction hash, supplied with transactionHash to verify a previously sent two-transaction update.":"Only for a resumed legacy Oak profile: verify its separate metadata transaction without transactionHash."},...n?{agentId:N}:{noTag:{type:"boolean",description:"Removed option: omit it and register again."},"--no-tag":{type:"boolean",description:"Removed option: omit it and register again."},metadata:{type:"array",maxItems:15,items:Ae,description:"Up to 15 user entries plus the mandatory oak.registrar marker. The keys agentWallet and oak.registrar are reserved."}}}});return{tools:[t("erc8004_register",a(!1),(n,d)=>ne(e,!1,n,d)),t("erc8004_update",a(!0),(n,d)=>ne(e,!0,n,d)),t("erc8004_identity",{type:"object",additionalProperties:!1,required:["agentId"],properties:{agentId:N,metadataKeys:{type:"array",maxItems:16,items:{type:"string",minLength:1,maxLength:128},description:"Also read these onchain metadata keys."},operator:{...L,description:"Also report whether this address is approved for all of the owner's agents."}}},n=>Re(e,n))]}},Ve=e=>K("erc8004",[Te(e),Q(e),X(e),Y(e),z(e),ee(e)]);export{Ke as a,De as b,oe as c,Te as d,Ve as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as q}from"./IX3GZMTM.js";import{
|
|
1
|
+
import{b as q}from"./IX3GZMTM.js";import{d as h}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";var Y="12333333",I=1800,N=9000n,O=9607n,C=150n,U=(1n<<256n)-1n,f=10000n,g=10n**18n,X=10n**30n,R=1n<<192n,D=20n*g,E=75n*g,_=100n*g,x=300n*g,P=100000n*g,S=500000n*g,w=1000000n*g,B=10000000n*g;function c(n){let t=typeof n=="bigint"?n:q(n);if(t<0n||t>U)throw new o("Amount must be within the uint256 range.");return t}function p(n){if(typeof n=="bigint")return n;if(typeof n=="number"){if(!Number.isSafeInteger(n))throw new o("Integer parameter must be a safe integer.");return BigInt(n)}if(typeof n!="string"||!/^-?\d+$/.test(n))throw new o("Value must be a signed integer decimal string.");return BigInt(n)}function A(n,t=77){let i=typeof n=="number"?n:typeof n=="string"&&/^\d+$/.test(n)?Number(n):NaN;if(!Number.isInteger(i)||i<0||i>t)throw new o(`Token decimals must be an integer from 0 to ${t}.`);return i}function k(n){return 10n**BigInt(n)}function T(n,t="Result"){if(n<0n||n>U)throw new o(`${t} exceeds uint256 bounds.`);return n}function b(n,t,i="Factor"){return T(n*t,i)}function a(n,t,i,s="floor"){if(i<=0n)throw new o("The denominator must be positive.");let e=n*t;if(e===0n)return 0n;let r=s==="ceil"?e/i+(e%i===0n?0n:1n):e/i;return T(r,"Math.mulDiv result")}function $(n){let t=c(n);return t<P?D.toString():t<S?(D+a(t-P,E-D,S-P)).toString():t<w?(E+a(t-S,_-E,w-S)).toString():t<B?(_+a(t-w,x-_,B-w)).toString():x.toString()}function Q(n){let t=c(n);return T(9000000n+t/1000000000000n/6n,"noHoldPriceBase").toString()}function j(n){let t=c(n);return a(t,5n,100n,"ceil").toString()}function z(n,t){let i=c(n),s=c(t);if(s<=0n)throw new o("OAK-per-ETH price must be positive.");return a(i,g,s,"floor").toString()}function G(n,t,i=h){let s=c(n),e=c(t);if(e<=0n)throw new o("OAK USD price must be positive.");let r=k(A(i));return a(s,r,e,"ceil").toString()}function J(n,t,i=h){let s=c(n),e=c(t),r=k(A(i));return a(s,e,r,"floor").toString()}function Z(n,t){let i=c(n),s=c(t);if(i>f||s>f)throw new o("FeePolicyOutOfBounds: hook fee or creator tax exceeds 10000 bps.");let e=i+s+C;if(e>f-N)throw new o("FeePolicyOutOfBounds: fees and impact allowance exceed 1000 bps.");let r=f-e;return(r>O?O:r).toString()}function nn(n,t,i,s,e){let r=A(s,83);if(r<6)throw new o("OAK decimals must be at least 6 for burner conversion.");let u=c(e);if(u<N||u>O)throw new o("InvalidBurnerFloor: floor must be from 9000 to 9607 bps.");let m=c(n),d=c(t),l=c(i);if(l<=0n)throw new o("ETH USD price must be positive.");let v=k(r-6),y=b(m,v,"burnerMinOut usdgIn * decimalScale"),W=b(d,u,"burnerMinOut oakPerEthE18 * floorBps"),M=b(l,f,"burnerMinOut ethUsdE18 * 10000");return a(y,W,M,"floor").toString()}function tn(n,t,i=I){let s=p(n),e=p(t),r=p(i);if(r<=0n)throw new o("Observation window seconds must be positive.");let u=e-s,d=u/r-(u<0n&&u%r!==0n?1n:0n);return Number(d)}function en(n){let t=c(n);if(t<=0n)throw new o("sqrtRatioX96 must be positive.");let i=b(t,t,"sqrtRatioX96 squared");return a(i,X,R,"floor").toString()}function F(n){let t=c(n);if(t<=0n)throw new o("sqrtPriceX96 must be positive.");let i=b(t,t,"sqrtPriceX96 squared");return a(i,g,R,"floor").toString()}function L(n){let t="ethAmountWei"in n&&n.ethAmountWei!==void 0?n.ethAmountWei:"ethVolumeWei"in n?n.ethVolumeWei:void 0;if(t===void 0)throw new o("SwapTrade must provide ethAmountWei.");let i=p(t),s=i<0n?-i:i;if(s<=0n)throw new o("SwapTrade ETH volume must be positive.");let e;n.sqrtPriceX96!==void 0&&n.sqrtPriceX96!==""&&n.sqrtPriceX96!=="0"&&(e=BigInt(F(n.sqrtPriceX96)));let r;if(n.oakPerEthE18!==void 0&&n.oakPerEthE18!==""&&(r=c(n.oakPerEthE18)),e!==void 0&&r!==void 0&&e!==r)throw new o("SwapTrade oakPerEthE18 does not match post-swap sqrtPriceX96.");let u=e??r;if(u===void 0||u<=0n)throw new o("SwapTrade must provide a positive post-swap price.");let m=n.timestamp!==void 0&&n.timestamp!==""?c(n.timestamp):void 0;return{volumeWei:s,oakPerEth:u,timestamp:m}}function rn(n,t){if(!Array.isArray(n)||n.length===0)throw new o("At least one SwapTrade is required to compute the 30-minute average.");let i=t?.windowEnd!==void 0?c(BigInt(t.windowEnd)):t?.now!==void 0?c(BigInt(t.now)):void 0,s=t?.windowStart!==void 0?c(BigInt(t.windowStart)):i!==void 0?i-BigInt(I):void 0,e=0n,r=0n;for(let u of n){let{volumeWei:m,oakPerEth:d,timestamp:l}=L(u);s!==void 0&&i!==void 0&&l!==void 0&&(l<s||l>=i)||(e+=m*d,r+=m)}if(r<=0n)throw new o("No trades with positive ETH volume fell inside the 30-minute window.");return(e/r).toString()}export{Y as a,I as b,N as c,O as d,C as e,$ as f,Q as g,j as h,z as i,G as j,J as k,Z as l,nn as m,tn as n,en as o,F as p,rn as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as S}from"./LCH6F5HT.js";import{a as w}from"./43LI5NKJ.js";import{g as R}from"./NWNYJ26T.js";import{b as o,j as k,k as v}from"./TI727O2H.js";import{a as t}from"./XSD5NL7J.js";import{encodeFunctionData as O,getAddress as h,keccak256 as C,parseAbi as T,parseAbiItem as x,toHex as A,zeroHash as D}from"viem";var s=h(k[o].vaults.spark.address),g={admin:D,setter:C(A("SETTER_ROLE")),taker:C(A("TAKER_ROLE"))},E=[["drip()","any"],["setVsr(uint256 rate)","setter"],["setVsrBounds(uint256 minimum,uint256 maximum)","admin"],["setDepositCap(uint256 cap)","admin"],["take(uint256 assets)","taker"],["grantRole(bytes32 role,address account)","admin"],["revokeRole(bytes32 role,address account)","admin"],["renounceRole(bytes32 role,address account)","any"],["upgradeToAndCall(address implementation,bytes data)","admin"]],N=E.map(([r,a])=>({abi:x(`function ${r}`),authority:a})),p=T(["function asset() view returns (address)","function hasRole(bytes32,address) view returns (bool)","function getRoleMemberCount(bytes32) view returns (uint256)","function getRoleMember(bytes32,uint256) view returns (address)"]);function _(r){return[{name:"spark_roles",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(a,i)=>{try{if(w(i),Object.keys(a).length)throw new t("Spark roles takes no arguments.");let e=r.clientFor(o);if(await e.getChainId()!==o)throw new t("Spark requires chain 4663.");let u=await e.getBlockNumber({cacheTime:0}),c=await Promise.all(Object.entries(g).map(async([f,d])=>{let m=await e.readContract({address:s,abi:p,functionName:"getRoleMemberCount",args:[d],blockNumber:u});if(m>256n)throw new t("Spark role membership exceeds this reader\u2019s supported size.");let[b,n]=await Promise.all([e.readContract({address:s,abi:p,functionName:"hasRole",args:[d,i],blockNumber:u}),Promise.all(Array.from({length:Number(m)},(y,l)=>e.readContract({address:s,abi:p,functionName:"getRoleMember",args:[d,BigInt(l)],blockNumber:u})))]);return{name:f,role:d,heldByWallet:b,members:n.map(y=>h(y))}}));return{vault:s,chainId:o,blockNumber:u.toString(),roles:c}}catch(e){throw new t(r.plainError(e))}}},{name:"spark_manage",inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:N.map(a=>a.abi.name),description:"Role-gated vault admin call: drip, setVsr, setVsrBounds, setDepositCap, take, grantRole, revokeRole, renounceRole or upgradeToAndCall. Pass its inputs in values; Oak checks your role."},values:{type:"array",maxItems:2,items:{type:"string"},description:"Ordered contract inputs; all integers are decimal base-unit strings."}}},execute:async(a,i)=>{try{if(w(i),Object.keys(a).some(n=>!["operation","values"].includes(n)))throw new t("Unexpected Spark management argument.");let e=N.find(n=>n.abi.name===a.operation);if(!e||!Array.isArray(a.values)||a.values.length!==e.abi.inputs.length)throw new t("Provide a supported Spark operation and its exact ordered values.");let u=e.abi.inputs.map((n,y)=>{let l=a.values[y];if(n.type==="bytes32"){if(typeof l!="string"||!Object.values(g).includes(l))throw new t("Provide a documented Spark role identifier.");return l}return S(n.type,l)});if(e.abi.name==="renounceRole"&&!R(String(u[1]),i))throw new t("Role renunciation must name this wallet.");let c=r.clientFor(o);if(await c.getChainId()!==o)throw new t("Spark requires chain 4663.");let f=await c.readContract({address:s,abi:p,functionName:"asset"});if(h(f)!==h(v))throw new t("Spark does not use canonical USDG.");if(e.authority!=="any"&&await c.readContract({address:s,abi:p,functionName:"hasRole",args:[g[e.authority],i]})!==!0)throw new t("This wallet does not hold the required Spark role. No transaction was built.");let d=`${e.abi.name} on Spark ${s}; ordered values ${JSON.stringify(a.values)}. ${e.abi.name==="upgradeToAndCall"?"Replaces vault implementation; Oak must review and re-pin upgraded code before subsequent use.":e.abi.name==="take"?"Pulls vault liquidity to this role-authorized wallet; it mints no savings shares.":""}`,m=[r.unsignedTx({to:s,data:O({abi:[e.abi],functionName:e.abi.name,args:u}),value:"0",chainId:o,description:d})],b=await r.preview(m,i);return{txs:m,preview:b,summary:`${d} ${b.summary} Role and rate bounds are enforced again by the contract at execution.`}}catch(e){throw new t(r.plainError(e))}}}]}export{N as a,_ as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./43LI5NKJ.js";import{m as b}from"./NWNYJ26T.js";import{
|
|
1
|
+
import{a as y}from"./43LI5NKJ.js";import{m as b}from"./NWNYJ26T.js";import{b as i,j as w,k as l}from"./TI727O2H.js";import{a as c}from"./XSD5NL7J.js";import{erc20Abi as v,getAddress as u,parseAbi as G}from"viem";var d=10n**27n,I=1000000021979553151239153027n,a=u(w[i].vaults.spark.address),U="https://docs.spark.finance/dev/savings/spark-vaults-v2",g=G(["function asset() view returns (address)","function vsr() view returns (uint256)","function totalAssets() view returns (uint256)","function depositCap() view returns (uint256)","function minVsr() view returns (uint256)","function maxVsr() view returns (uint256)","function convertToAssets(uint256) view returns (uint256)"]);function n(e){return b(e,"Spark returned an invalid unsigned integer.")}function q(e){if(e<d||e>I)throw new c("Spark savings rate is outside the documented bounds.");let r=31536000n,s=e,t=d;for(;r>0n;)r%2n&&(t=t*s/d),r/=2n,r>0n&&(s=s*s/d);return t-d}function j(e){return{name:"spark_details",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:async(r,s)=>{try{if(y(s),Object.keys(r).length)throw new c("Spark details takes no arguments.");let t=e.clientFor(i);if(await t.getChainId()!==i)throw new c("Spark details requires chain 4663.");let o=await t.getBlockNumber({cacheTime:0}),h=await t.readContract({address:a,abi:g,functionName:"asset",blockNumber:o});if(typeof h!="string"||u(h)!==u(l))throw new c("Spark does not report canonical USDG.");let[k,A,C,D,x,N,R]=await Promise.all([...["vsr","totalAssets","depositCap","minVsr","maxVsr"].map(V=>t.readContract({address:a,abi:g,functionName:V,blockNumber:o})),t.readContract({address:u(l),abi:v,functionName:"balanceOf",args:[a],blockNumber:o}),t.readContract({address:a,abi:v,functionName:"balanceOf",args:[s],blockNumber:o})]),f=n(k),p=n(A),m=n(N),S=n(R),T=n(await t.readContract({address:a,abi:g,functionName:"convertToAssets",args:[S],blockNumber:o}));return{chainId:i,vault:a,blockNumber:o.toString(),asset:{address:u(l),symbol:"USDG",decimals:6,chainId:i},shareToken:{address:a,symbol:"spUSDG",decimals:6,chainId:i},rate:{vsrRay:f.toString(),scale:d.toString(),annualYieldRay:q(f).toString(),secondsPerYear:"31536000",minVsrRay:n(D).toString(),maxVsrRay:n(x).toString(),caveat:"Projection with the current per-second rate held constant; governance can change it. Not a promised return."},totalAssets:p.toString(),idleAssets:m.toString(),depositCapAssets:n(C).toString(),outstandingAssets:(p>m?p-m:0n).toString(),heldShares:S.toString(),positionAssets:T.toString(),backing:{source:U,mechanism:"The permissioned taker deploys liquidity through the Spark Liquidity Layer. totalAssets is share-implied accounting; idle USDG alone funds immediate redemptions.",composition:null,compositionStatus:"Current strategy-by-strategy backing was not measured on this chain; inspect the official Spark app."},risk:["Liquidity deployed by the taker may be unavailable for immediate withdrawal.","Vault upgrades and role-controlled rate/cap changes affect behavior.","Share value and the USDG peg can change; conversion does not prove exit liquidity."]}}catch(t){throw new c(e.plainError(t))}}}}export{q as a,j as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as h,i as y}from"./X5AL3DUK.js";import{b as l,e as f,g as v}from"./LJJYYUEG.js";import{c as p}from"./NWNYJ26T.js";import{b as g}from"./TI727O2H.js";import{a as r}from"./XSD5NL7J.js";import{parseAbi as C,zeroAddress as I}from"viem";var N=C(["function observe(uint32[] secondsAgos) view returns (int56[] tickCumulatives,uint160[] secondsPerLiquidityCumulativeX128s)"]);function B(s){return{tools:[{name:"uniswap_oracle",inputSchema:{type:"object",additionalProperties:!1,required:["token0","token1","fee","secondsAgo"],properties:{token0:{...p,description:"Lower sorted ERC-20 token address; use WETH for native ETH in v3."},token1:{...p,description:"Higher sorted ERC-20 token address."},fee:{description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%).",type:"integer",minimum:0,maximum:999999},secondsAgo:{description:"Oracle lookback duration in seconds; a positive integer.",type:"integer",minimum:1,maximum:4294967295}}},async execute(t){v(t,["token0","token1","fee","secondsAgo"]);let a=l(t.token0),c=l(t.token1),o=t.fee,e=t.secondsAgo;if(BigInt(a)>=BigInt(c))throw new r("Oracle tokens must be strictly sorted token0 < token1.");if(typeof o!="number"||!Number.isInteger(o)||o<0||o>=1e6||typeof e!="number"||!Number.isInteger(e)||e<=0||e>4294967295)throw new r("Provide integer fee pips and a positive uint32 secondsAgo.");let d=s.clientFor(g),i=await d.getBlockNumber(),m=await d.readContract({address:h.factory,abi:y,functionName:"getPool",args:[a,c,o],blockNumber:i});if(m===I)throw new r("No factory-verified v3 pool exists for this oracle.");let[[n,k],w,A]=await Promise.all([d.readContract({address:m,abi:N,functionName:"observe",args:[[e,0]],blockNumber:i}),f(s,a,i),f(s,c,i)]);if(n.length!==2||k.length!==2)throw new r("Oracle returned an unexpected observation count.");let u=n[1]-n[0],b=BigInt(e),P=u/b-(u<0n&&u%b!==0n?1n:0n);return{pool:m,token0:w,token1:A,secondsAgo:e,blockNumber:i.toString(),tickCumulatives:n.map(String),secondsPerLiquidityCumulativeX128s:k.map(String),arithmeticMeanTick:P.toString(),summary:"V3 time-weighted arithmetic mean tick, rounded toward negative infinity. Price is token1-base-units per token0-base-unit before decimal adjustment. Insufficient pool history reverts; an unavailable oracle is never reported as zero."}}}]}}export{B as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k}from"./A3PN3PK3.js";import{g as P}from"./NWNYJ26T.js";import{b}from"./TI727O2H.js";import{a as t}from"./XSD5NL7J.js";import{a as A}from"./JXOEJPJ4.js";import{getAddress as w,parseAbi as L}from"viem";var v={one_hour:3600n,six_hours:21600n,one_day:86400n,seven_days:604800n,thirty_days:2592000n,ninety_days:7776000n,one_year:31536000n},g=L(["function asset() view returns (address)","function decimals() view returns (uint8)","function previewRedeem(uint256) view returns (uint256)"]);async function C(u,o,i){let a=0n,s=i.number,e=await u.getBlock({blockNumber:a});if(e.timestamp>o)throw new t("Longbow has insufficient chain history for this window.");for(let n=0;a+1n<s&&n<64;n++){let r=(a+s)/2n,c=await u.getBlock({blockNumber:r});if(c.number!==r||c.timestamp<e.timestamp||c.timestamp>i.timestamp)throw new t("Longbow historical block response is inconsistent.");c.timestamp<=o?(a=r,e=c):s=r}if(a+1n<s||e.number!==a)throw new t("Longbow historical block search exceeded its bound.");return e}async function _(u,o,i,a="six_hours"){let s=v[a];if(!Object.hasOwn(v,a)||!s)throw new t("Choose a finite Longbow APY lookback from one_hour to one_year; inception is unavailable.");let e=u.clientFor(b);if(await e.getChainId()!==b)throw new t("Longbow APY assessment requires chain 4663.");let n=await e.getBlock({blockTag:"latest"});if(n.number===null||n.timestamp<s)throw new t("Longbow has insufficient chain history for this window.");let r=await C(e,n.timestamp-s,{number:n.number,timestamp:n.timestamp}),c=10n**27n,d=await Promise.all([r,n].map(async m=>{let[S,N,Y,f]=await Promise.all([e.readContract({address:o,abi:g,functionName:"asset",blockNumber:m.number}),e.readContract({address:o,abi:g,functionName:"decimals",blockNumber:m.number}),e.readContract({address:i.address,abi:g,functionName:"decimals",blockNumber:m.number}),e.readContract({address:o,abi:g,functionName:"previewRedeem",args:[c],blockNumber:m.number})]);if(w(S)!==w(i.address)||N!==18||Y!==i.decimals||typeof f!="bigint"||f<0n||f>=1n<<256n)throw new t("Longbow historical share price or token metadata is unavailable or invalid. No zero rate was inferred.");return f})),h=n.timestamp-r.timestamp;if(h<=0n||h>s+300n)throw new t("Longbow historical blocks do not cover the requested APY window within 300 seconds.");if(d[0]===0n)throw new t("Longbow starting share price is zero; a realized APY cannot be calculated.");let l=Number(d[1]-d[0])/Number(d[0]),p=Math.expm1(Math.log1p(l)*31536e3/Number(h));if(!Number.isFinite(p))throw new t("Longbow annualized share-price change is outside the supported numeric range.");let y=await k(e,o,n.number);return{chainId:b,vault:o,asset:{...i,address:w(i.address)},shareToken:{address:o,symbol:y,decimals:18,chainId:b},source:"Oak-computed on-chain",view:"apy",stale:!1,window:{lookback:a,requestedSeconds:s.toString(),elapsedSeconds:h.toString(),fromTimestamp:r.timestamp.toString(),toTimestamp:n.timestamp.toString(),fromBlock:r.number.toString(),toBlock:n.number.toString()},sharePrice:{shareUnits:c.toString(),startAssets:d[0].toString(),endAssets:d[1].toString(),assetDecimals:i.decimals},data:{annualYieldFraction:String(p),annualYieldPercent:String(p*100),lookback:a,basis:"Oak-computed realized APY: (end share price / start share price)^(31536000 / elapsed seconds) - 1, using ERC-4626 previewRedeem at two pinned blocks."},caveat:"Historical share-price change includes what the vault accounts for in previewRedeem, excludes external rewards and gas, and is not a promised return. Archive RPC history is required; missing history is not zero APY."}}async function I(u,o,i,a){if(Object.keys(a).some(d=>!["view","lookback"].includes(d)))throw new t("Longbow APY takes a lookback, not pagination.");let s=a.lookback??"six_hours";if(typeof s!="string"||!Object.hasOwn(v,s))throw new t("Choose a finite Longbow APY lookback from one_hour to one_year; inception is unavailable.");let[e,n]=await Promise.allSettled([O(u,o,i,{view:"published_apy"}),_(u,o,i,s)]),r=e.status==="fulfilled"&&!e.value.stale?e.value:void 0;if(!r&&n.status==="rejected")throw new t(`Longbow APY is unavailable: the vendor figure is unavailable or stale, and the on-chain window could not be measured. ${u.plainError(n.reason)}`);return{...r??(n.status==="fulfilled"?n.value:void 0),view:"apy",shown:r?"Longbow vendor":"Oak-computed on-chain",realized:n.status==="fulfilled"?n.value:null,published:e.status==="fulfilled"?e.value:null,warnings:[...r?[]:["Longbow vendor APY is unavailable or stale; showing Oak-computed realized APY."],...n.status==="rejected"?["Oak-computed APY is unavailable: the archive RPC window could not be measured."]:[]]}}async function O(u,o,i,a){if(Object.keys(a).some(m=>m!=="view")||a.view!=="published_apy")throw new t("published_apy takes no historical lookback, cursor or limit.");let s=u.clientFor(b);if(await s.getChainId()!==b)throw new t("Longbow APY assessment requires chain 4663.");let[e,n]=await Promise.all([s.getBlock(),s.readContract({address:o,abi:L(["function asset() view returns (address)"]),functionName:"asset"})]);if(w(n)!==w(i.address))throw new t("Longbow vault does not use the pinned asset.");let r="https://longbow.credit/api/v2/vaults",c=await u.http(r,{method:"GET",headers:{accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(15e3)});if(!c.ok)throw new t(`Longbow published APY HTTP ${c.status}; the rate is unavailable.`);let d=await c.json();if(!d||typeof d!="object"||!Number.isSafeInteger(d.asOf)||Number(d.asOf)<0||!Array.isArray(d.vaults)||d.vaults.length>100)throw new t("Longbow published APY response has an invalid timestamp or vault inventory.");let h=d.vaults.filter(m=>m&&typeof m=="object"&&typeof m.address=="string"&&P(String(m.address),o));if(h.length!==1)throw new t("Longbow published APY omitted or duplicated this vault; no zero rate is inferred.");let l=h[0];if(l.error||typeof l.asset!="string"||w(l.asset)!==w(i.address)||l.decimals!==i.decimals||typeof l.apy!="number"||!Number.isFinite(l.apy)||l.apy<-100||typeof l.apyBasis!="string"||l.apyBasis.length>64)throw new t("Longbow published APY asset, units, basis or rate is invalid.");let p=BigInt(Number(d.asOf)),y=await k(s,o,e.number);return{chainId:b,vault:o,asset:{...i,address:w(i.address)},shareToken:{address:o,symbol:y,decimals:18,chainId:b},sourceUrl:r,view:"published_apy",asOf:p.toString(),stale:e.timestamp>p+900n||p>e.timestamp+60n,data:{annualYieldPercent:String(l.apy),annualYieldFraction:String(l.apy/100),basis:A(l.apyBasis)},caveat:"Longbow publisher quote, not a realized Morpho lookback series or a promised return. The app formats this field directly as percent (0.03 means 0.03%, not 3%). No bonus, future payout or fee inclusion is inferred. Onchain book and fees remain available through longbow_details."}}export{_ as a,I as b,O as c};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as O,e as T,i as M,j as x,k as V,m as D,n as N}from"./PZEF5LBL.js";import{a as b,b as h,c as R,e as f,f as A,g as k,h as P,i as I,j as v,l as S,m as B,n as $}from"./CSOO4SW7.js";import{a as y}from"./I6PQW2JI.js";import{a as E}from"./K6D6SDIG.js";import{a as c}from"./XSD5NL7J.js";import{encodeFunctionData as j,formatUnits as z}from"viem";var m=(o,e)=>({token:o,amount:e.toString()}),J=6e4;function ie(){let o=new WeakMap;return{entry(e){let r=o.get(e);return(!r||Date.now()>=r.expiresAt)&&(r={logs:new Map,expiresAt:Date.now()+J},o.set(e,r)),r}}}function K(o,e){return{to:o.log.address,data:j({abi:E,functionName:"debond",args:[e,[],[]]}),value:"0",chainId:4663,description:`Unwrap ${e} log base units from ${o.log.address}.`}}async function _(o,e,r,a,t=BigInt(e.measuredAtBlock),s){if(a>BigInt(e.totalSupply))throw new c("Unwrap amount exceeds the issued Chop log supply.");let i=h(await A(o,e.log.address,"convertToAssets",[a],t,r,s)),p=1n<<96n,d=BigInt(e.managedUnderlying)*(a*p/BigInt(e.totalSupply))/p;if(i>d)throw new c("Chop redemption exceeds the measured backing.");return{gross:m(e.underlying,d),fee:m(e.underlying,d-i),net:m(e.underlying,i)}}async function F(o,e){if(f(e),o.network==="testnet")throw new c("Chop requires chain 4663.");let r=o.clientFor(4663),a=await P(r,e),t=I();await v(r,y.registry,a,e,t);let s=await A(r,y.registry.address,"allIndexes",[],a,void 0,e);if(!Array.isArray(s)||s.length>1e3)throw new c("Chop registry inventory is unreadable or too large.");let i=s.filter(n=>n&&n.verified===!0).map(n=>b(n.index));if(new Set(i).size!==i.length)throw new c("Chop registry returned duplicate logs.");let p=[];for(let n=0;n<i.length;n+=4)f(e),p.push(...await Promise.all(i.slice(n,n+4).map(l=>S(r,l,"read",a,e,t))));f(e);let d=p.map(n=>`${n.log.symbol} (${n.log.address}): ${M(n)}`),u=p.flatMap(n=>n.drift.length?[`Code changed for ${n.log.address}: ${n.drift.join(", ")}.`]:[]);return{logs:p.map(n=>({...n,plainSummary:V(n)})),measuredAtBlock:a.toString(),warnings:[...T,...d,...u]}}async function se(o,e,r){if(f(r),!e)return F(o,r);let a=o.clientFor(4663),t=e.entry(a);if(t.inventory)return structuredClone(t.inventory);let s=t.pending;if(!s){let n=new AbortController,l={controller:n,waiters:0,promise:F(o,n.signal)};l.promise=l.promise.then(g=>{f(n.signal),t.inventory=structuredClone(g);for(let w of g.logs)t.logs.set(w.log.address.toLowerCase(),structuredClone(w));return g}).finally(()=>{n.abort(),t.pending===l&&(t.pending=void 0)}),t.pending=s=l}let i=s;i.waiters++;let p,d=!1,u=()=>{d||(d=!0,--i.waiters===0&&t.pending===i&&(i.controller.abort(),t.pending=void 0))};try{let n=await new Promise((l,g)=>{p=()=>{u(),g(new c("Chop read was cancelled."))},r?.addEventListener("abort",p,{once:!0}),i.promise.then(l,g)});return f(r),structuredClone(n)}finally{p&&r?.removeEventListener("abort",p),u()}}async function ae(o,e,r){let{limit:a,offset:t}=r,s=new Set(e.logs.map(l=>`${l.log.symbol} (${l.log.address}): ${M(l)}`)),i=e.warnings.filter(l=>!s.has(l)),p=Object.entries(e).map(([l,g])=>({name:l,chars:JSON.stringify(g).length,...Array.isArray(g)?{items:g.length}:{}})),d=o.clientFor(4663),u=e.logs.slice(t,t+a),n=[];for(let l=0;l<u.length;l+=4)n.push(...await Promise.all(u.slice(l,l+4).map(async g=>{let w=await k(d,[{target:g.pool,fn:"balanceOf",args:[g.staking.address]},{target:g.pool,fn:"totalSupply"}],BigInt(g.measuredAtBlock)),L=h(w[0]),C=h(w[1]);if(L>C)throw new c("Chop staked LP balance exceeds the pool supply.");return{log:g.log.address,symbol:g.log.symbol,backingPerLog:g.backingPerLog,fees:g.fees,pool:g.pool,stakedShare:{stakedLp:L.toString(),totalLp:C.toString(),bps:C===0n?null:Number(L*10000n/C)},riskLines:x(g).split(`
|
|
2
|
+
`).filter(W=>!T.includes(W)).join(`
|
|
3
|
+
`)}})));for(;;){let l=t+n.length,g=`Use detail: "full" for every complete row, or fields: ["logs"] or ["warnings"] for whole sections. ${l<e.logs.length?`Continue with offset: ${l}, limit: ${a}.`:"End of this list; use offset: 0 to start again."} Summary rows omit financial measurements and full contract metadata.`,w={warnings:i,summary:{logs:n,offset:t,total:e.logs.length,omitted:e.logs.length-n.length,measuredAtBlock:e.measuredAtBlock},sections:p,more:g};if(JSON.stringify(w).length<=8e3)return w;if(n.length<=1)throw new c('Chop risk lines exceed the summary budget. Request fields or detail: "full" to read them whole.');n.pop()}}async function de(o,e){let r=o.clientFor(4663),a=[];for(let t=0;t<e.length;t+=4)a.push(...await Promise.all(e.slice(t,t+4).map(async s=>{let[i,p,d,u]=await k(r,[{target:b(y.chop),fn:"balanceOf",args:[s.rewards]},{target:s.pool,fn:"token0"},{target:s.pool,fn:"token1"},{target:s.pool,fn:"getReserves"}],BigInt(s.measuredAtBlock)),n=[b(p),b(d)].map(g=>[s.log,s.paired].find(w=>w.address.toLowerCase()===g.toLowerCase()));if(!n[0]||!n[1]||n[0]===n[1])throw new c("Chop pool tokens disagree with the verified log.");if(!Array.isArray(u)||u.length!==3)throw new c("Chop pool reserves are unavailable.");let l=m(s.underlying,BigInt(s.managedUnderlying));return{...s,backingNow:{...l,humanAmount:z(BigInt(l.amount),s.underlying.decimals)},rewardPot:m({address:b(y.chop),symbol:"CHOP",decimals:18,chainId:4663},h(i)),reserves:[m(n[0],h(u[0])),m(n[1],h(u[1]))]}})));return a}var U=o=>BigInt(o.replace(".","")),H=o=>`${o/100n}.${(o%100n).toString().padStart(2,"0")}`;function le(o){return o.some(e=>e.usdEstimate===null)?{reserves:o,usdEstimate:null,estimateLabel:"price unavailable",estimateReason:"A pool reserve has no USD estimate"}:{reserves:o,usdEstimate:H(o.reduce((e,r)=>e+U(r.usdEstimate),0n)),estimateLabel:"estimate, not a quote",estimateSource:"sum of the two reserve estimates"}}function pe(o,e){let r={label:"rough",pct:null,inputToken:e,assumptions:"Constant-product marginal price move for buying the log with $100 of the paired token; excludes pool and token fees, gas and other trades."};if(o.some(d=>BigInt(d.amount)===0n))return{...r,reason:"The pool is empty on at least one side"};let a=o.find(d=>d.token.address.toLowerCase()===e.address.toLowerCase());if(!a?.usdEstimate||U(a.usdEstimate)===0n)return{...r,reason:"Paired reserve price unavailable or below one cent"};let t=U(a.usdEstimate),i=((t+10000n)**2n-t**2n)*10000n,p=t**2n;return{...r,pct:H((2n*i+p)/(2n*p))}}var q=new WeakMap,Y=10;async function Z(o,e,r,a,t,s){if(f(t),e.length>Y)throw new c("Chop holdings probes support at most ten logs per call.");if(e.length===0)return[];let i=t?q.get(t):void 0;t&&!i&&(i=I(),q.set(t,i)),await v(o,y.whitelist,a,t,i);let p=await k(o,e.flatMap(d=>[{target:d.log.address,fn:"balanceOf",args:[r]},{target:d.staking.address,fn:"balanceOf",args:[r]},{target:d.staking.address,fn:"withdrawableStake",args:[r]},{target:d.rewards,fn:"getUnpaid",args:[y.chop,r]},{target:d.rewards,fn:"getClaimable",args:[y.chop,r]},{target:y.whitelist.address,fn:"paused",args:[y.chop]},{target:d.log.address,fn:"totalSupply"},{target:d.log.address,fn:"totalAssets",args:[d.underlying.address]}]),a,t);return f(t),Promise.all(e.map(async(d,u)=>{let n=await Q(o,d,r,a,t,p.slice(u*8,(u+1)*8));return f(t),s?.(n,u),n}))}async function G(o,e,r,a=BigInt(e.measuredAtBlock),t){return(await Z(o,[e],r,a,t))[0]}async function Q(o,e,r,a,t,s){if(f(t),typeof s[5]!="boolean")throw new c("Chop reward pause state is unavailable.");let i=h(s[0]),p=h(s[6]),d=h(s[7]);if(p===0n)throw new c("This Chop log has no issued supply.");let u={...e,totalSupply:p.toString(),managedUnderlying:d.toString()},n=i===0n?{gross:m(e.underlying,0n),fee:m(e.underlying,0n),net:m(e.underlying,0n)}:await _(o,u,r,i,a,t),l={address:b(y.chop),symbol:"CHOP",decimals:18,chainId:4663};return{log:e.log.address,logTokens:m(e.log,i),...n,stakedLp:m(e.staking,h(s[1])),withdrawableLp:m(e.staking,h(s[2])),pendingChop:m(l,h(s[3])),claimableChop:m(l,h(s[4])),rewardsPaused:s[5],measuredAtBlock:a.toString(),warnings:x(e)}}async function ge(o,e,r,a){let t=o.clientFor(4663);b(r);let s=a?.entry(t),i=b(e).toLowerCase(),p=s?.logs.get(i)??await S(t,e,"read");return s&&!s.logs.has(i)&&s.logs.set(i,structuredClone(p)),G(t,p,r,await P(t))}async function ue(o,e,r,a){let t=R(a),s=o.clientFor(4663);b(r);let i=await S(s,e,"exit"),p=h(await A(s,i.log.address,"balanceOf",[r],BigInt(i.measuredAtBlock)));if(p===0n)throw new c(D(i.log.symbol));if(t>p)throw new c(N(i.log,t,p));let d=await _(s,i,r,t),u=BigInt(d.net.amount);if(u===0n)throw new c("This Chop unwrap would return no underlying.");let n=K(i,t),l=o.unsignedTx(n);B([l],[n]);let g=await o.preview([l],r);B(g.txs,[n]);let w=$(g,[{token:i.log,min:-t,max:-t},{token:i.underlying,min:u}]);return{log:i.log.address,amount:t.toString(),...d,simulatedNet:m(i.underlying,w.get(i.underlying.address.toLowerCase())),quotedNet:d.net.amount,preview:g,measuredAtBlock:i.measuredAtBlock,warning:O,summary:x(i)}}export{m as a,J as b,ie as c,K as d,_ as e,se as f,ae as g,de as h,le as i,pe as j,Y as k,Z as l,G as m,ge as n,ue as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as A,e as G,f as O,h as U,i as x,l as T,m as D,n as L,o as B,p as I,q as j,w as C,z as E}from"./3A2IKFTV.js";import{a as N,b as m}from"./X5V2Z2NM.js";import{a as M}from"./43LI5NKJ.js";import{c as H,g as S}from"./NWNYJ26T.js";import{a as f}from"./XSD5NL7J.js";import{a as $}from"./JXOEJPJ4.js";import{encodeFunctionData as q}from"viem";var z=10n**38n,W=`0x${"00".repeat(32)}`;function _(o,g){let k=o<0n,l=(k?-o:o).toString().padStart(g+1,"0"),P=l.slice(0,l.length-g),v=g?l.slice(l.length-g).replace(/0+$/,""):"";return`${k?"-":""}${P}${v?`.${v}`:""}`}var ie=o=>{let g=(e,a,i)=>({name:e,inputSchema:a,execute:async(t,n)=>{try{return M(n),L(o,t.chainId),await i(t,n)}catch(r){throw new f(o.plainError(r))}}}),k={transactionHash:{...G,description:"After local submission, repeat the same arguments with the mined hash to verify calldata, event and registry state."}},l=(e,a,i)=>o.clientFor(U(o).chainId).readContract({address:e,abi:m,functionName:a,args:i});async function P(e){let{chainId:a,registry:i}=U(o),t=await o.clientFor(a).readContract({address:i,abi:N,functionName:"ownerOf",args:[e]});return M(t),t}let v=e=>{if(typeof e!="string"||!/^[1-9][0-9]{0,18}$/.test(e)||BigInt(e)>=2n**64n)throw new f("Provide feedbackIndex as a decimal integer string of at least 1 (indexes are 1-based).");return BigInt(e)},X=g("erc8004_give_feedback",{type:"object",additionalProperties:!1,required:["agentId","value"],description:"Post public, permanent-by-hash feedback about an agent (ERC-8004 Reputation Registry giveFeedback). You cannot rate an agent you own or operate.",properties:{agentId:A,value:{type:"string",pattern:"^-?[0-9]+$",description:'Signed integer in fixed point, e.g. "87" with valueDecimals 0 is 87; "9977" with valueDecimals 2 is 99.77.'},valueDecimals:{type:"integer",minimum:0,maximum:18,default:0,description:'Decimal places of the signed feedback value, from 0 to 18; "9977" with 2 means 99.77.'},tag1:{type:"string",description:"Optional filter tag such as starred, uptime, successRate, responseTime."},tag2:{type:"string",description:"Second feedback category tag to record or filter."},endpoint:{type:"string",description:"Optional endpoint the feedback is about."},feedbackURI:{type:"string",description:"Optional HTTPS/IPFS URI of an off-chain feedback file."},feedbackHash:{...O,description:"keccak256 of the feedbackURI content; optional for IPFS, recommended for HTTPS."},...k}},async(e,a)=>{let{address:i}=x(o),t=T(e.agentId);if(typeof e.value!="string"||!/^-?[0-9]+$/.test(e.value))throw new f("Provide value as a signed integer string.");let n=BigInt(e.value);if(n>z||n<-z)throw new f("The feedback value is out of range (\xB11e38).");let r=e.valueDecimals===void 0?0:e.valueDecimals;if(typeof r!="number"||!Number.isInteger(r)||r<0||r>18)throw new f("valueDecimals must be an integer from 0 to 18.");let s=I(e.tag1,"tag1",128),b=I(e.tag2,"tag2",128),p=e.endpoint===void 0?"":I(e.endpoint,"endpoint",2048),u=e.feedbackURI===void 0?"":j(e.feedbackURI,"feedbackURI"),w=e.feedbackHash===void 0?W:B(e.feedbackHash,"feedbackHash"),R=q({abi:m,functionName:"giveFeedback",args:[t,n,r,s,b,p,u,w]});return E(o,a,e,{to:i,data:R,description:`Give feedback ${e.value}e-${r} to ERC-8004 agent ${t}.`,summary:`Publishes feedback ${_(n,r)} about agent ${t}${s?` (tag ${$(s)})`:""} from this wallet. Feedback is public and attributable to this wallet; it can be revoked later but never erased. Repeat with transactionHash to read back the feedback index.`,authority:async()=>{await P(t);let{registry:h,chainId:d}=U(o);if(await o.clientFor(d).readContract({address:h,abi:N,functionName:"isAuthorizedOrOwner",args:[a,t]})===!0)throw new f("The registry refuses feedback from the owner or an approved operator of the same agent.")},verify:async h=>{let d=C(h,i,m,"NewFeedback"),c=d.feedbackIndex,F=await l(i,"readFeedback",[t,a,c]);if(d.agentId!==t||!S(String(d.clientAddress),a)||d.value!==n||F[0]!==n||F[4])throw new f("The registry event or stored feedback does not match.");return{agentId:t.toString(),feedbackIndex:c.toString(),value:_(n,r),confirmed:!0}}})}),Y=g("erc8004_revoke_feedback",{type:"object",additionalProperties:!1,required:["agentId","feedbackIndex"],properties:{agentId:A,feedbackIndex:{type:"string",pattern:"^[1-9][0-9]*$",description:"Feedback entry identifier as a one-based decimal string."},...k}},async(e,a)=>{let{address:i}=x(o),t=T(e.agentId),n=v(e.feedbackIndex);return E(o,a,e,{to:i,data:q({abi:m,functionName:"revokeFeedback",args:[t,n]}),description:`Revoke feedback #${n} on ERC-8004 agent ${t}.`,summary:`Marks your feedback #${n} about agent ${t} as revoked. The original entry stays on-chain, flagged revoked. Repeat with transactionHash to verify.`,authority:async()=>{let r=await l(i,"getLastIndex",[t,a]);if(n>r)throw new f(`This wallet has given only ${r} feedback entries on agent ${t}.`);if((await l(i,"readFeedback",[t,a,n]))[4])throw new f("That feedback is already revoked.")},verify:async r=>{let s=C(r,i,m,"FeedbackRevoked"),b=await l(i,"readFeedback",[t,a,n]);if(s.agentId!==t||s.feedbackIndex!==n||!S(String(s.clientAddress),a)||!b[4])throw new f("The registry event or stored feedback does not show a revocation.");return{agentId:t.toString(),feedbackIndex:n.toString(),revoked:!0}}})}),Z=g("erc8004_append_response",{type:"object",additionalProperties:!1,required:["agentId","clientAddress","feedbackIndex","responseURI"],description:"Append a public response to a feedback entry (the agent showing a refund, or anyone tagging spam).",properties:{agentId:A,clientAddress:{...H,description:"The wallet that gave the feedback."},feedbackIndex:{type:"string",pattern:"^[1-9][0-9]*$",description:"Feedback entry identifier as a one-based decimal string."},responseURI:{type:"string",description:"HTTPS or IPFS URI of the response file."},responseHash:{...O,description:"keccak256 of the response content; optional for IPFS."},...k}},async(e,a)=>{let{address:i}=x(o),t=T(e.agentId),n=D(e.clientAddress,"clientAddress"),r=v(e.feedbackIndex),s=j(e.responseURI,"responseURI"),b=e.responseHash===void 0?W:B(e.responseHash,"responseHash");return E(o,a,e,{to:i,data:q({abi:m,functionName:"appendResponse",args:[t,n,r,s,b]}),description:`Append a response to feedback #${r} by ${n} on ERC-8004 agent ${t}.`,summary:`Publishes a response (${$(s)}) under feedback #${r} that ${n} gave agent ${t}, attributed to this wallet. Responses are append-only. Repeat with transactionHash to verify.`,authority:async()=>{let p=await l(i,"getLastIndex",[t,n]);if(r>p)throw new f(`${n} has given only ${p} feedback entries on agent ${t}.`)},verify:async p=>{let u=C(p,i,m,"ResponseAppended");if(u.agentId!==t||u.feedbackIndex!==r||!S(String(u.clientAddress),n)||!S(String(u.responder),a)||u.responseURI!==s)throw new f("The registry event does not match the response.");return{agentId:t.toString(),clientAddress:n,feedbackIndex:r.toString(),responder:a,confirmed:!0}}})}),J=g("erc8004_reputation",{type:"object",additionalProperties:!1,required:["agentId"],description:"Read-only: an agent's feedback summary and entries. Pass the reviewers you trust in clients; without it the summary counts every wallet, which anyone can spam.",properties:{agentId:A,clients:{type:"array",maxItems:200,items:H,description:"Reviewer wallets to count (recommended)."},tag1:{type:"string",description:"First feedback category tag to filter."},tag2:{type:"string",description:"Second feedback category tag to record or filter."},includeRevoked:{type:"boolean",default:!1,description:"Include feedback entries revoked by their authors."},limit:{type:"integer",minimum:1,maximum:200,default:50,description:"Maximum feedback entries to return, from 1 to 200."},clientAddress:{...H,description:"With feedbackIndex: also count responses to that one entry."},feedbackIndex:{type:"string",pattern:"^[1-9][0-9]*$",description:"Feedback entry identifier as a one-based decimal string."}}},async e=>{let{address:a}=x(o),i=T(e.agentId);await P(i);let t=I(e.tag1,"tag1",128),n=I(e.tag2,"tag2",128),r=typeof e.limit=="number"?Math.min(Math.max(1,Math.trunc(e.limit)),200):50,s=Array.isArray(e.clients)?e.clients.map(d=>D(d,"client")):void 0;if(s&&s.length>200)throw new f("Provide at most 200 reviewer wallets.");let b=s??await l(a,"getClients",[i]),p=b.slice(0,200),u={count:"0",value:"0",valueDecimals:0},w=[],R=0;if(p.length){let[d,c]=await Promise.all([l(a,"getSummary",[i,p,t,n]),l(a,"readAllFeedback",[i,p,t,n,e.includeRevoked===!0])]);u={count:d[0].toString(),value:_(d[1],d[2]),valueDecimals:d[2]},R=c[0].length,w=c[0].slice(0,r).map((F,y)=>({clientAddress:F,feedbackIndex:c[1][y].toString(),value:_(c[2][y],c[3][y]),valueDecimals:c[3][y],tag1:$(c[4][y]),tag2:$(c[5][y]),revoked:c[6][y]}))}let h;if(e.clientAddress!==void 0){let d=D(e.clientAddress,"clientAddress"),c=e.feedbackIndex===void 0?0n:v(e.feedbackIndex);h=(await l(a,"getResponseCount",[i,d,c,[]])).toString()}return{agentId:i.toString(),registry:a,clientsTotal:b.length,clientsUsed:p.length,filteredByClients:s!==void 0,summary:u,feedback:w,feedbackTotal:R,truncated:R>w.length||b.length>p.length,...h===void 0?{}:{responseCount:h},note:s?"Summary counts only the reviewers you named.":"Unfiltered: every reviewer wallet counts, and anyone can post feedback for free, so a high score is not evidence. Name trusted reviewers in clients for a meaningful score."}});return{tools:[X,Y,Z,J]}};export{_ as a,ie as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,b as p,c as b,e as y,f as F}from"./JJGZ7W3V.js";import{a as l,b as h}from"./CZL6T2ZQ.js";import{a as d}from"./ZQ6AF3VX.js";import{a as m}from"./K7HTDKAT.js";import{a as u}from"./DGCJZ3HO.js";import{a as o,e as g}from"./XSD5NL7J.js";import{decodeErrorResult as A,getAddress as i,isAddressEqual as w}from"viem";function $(e,r,a=[]){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(t=>!r.includes(t)))throw new o("Unexpected Factor argument.");if(a.some(t=>e[t]===void 0))throw new o("Provide every required Factor input.")}function S(e,r,a=!0){if(typeof e!="string"&&typeof e!="bigint"||!/^[0-9]+$/.test(String(e)))throw new o(`Provide ${r} as a decimal integer string.`);let t=BigInt(e);if(a&&t===0n||t>=2n**256n)throw new o(`${r} must fit a positive uint256.`);return t}function C(e){if(e.chainId!==l.chainId)throw new o("Factor requires Robinhood Chain 4663.");if(!w(i(e.to),h.desk.address))throw new o("Factor calls must target the pinned desk. Nothing was sent.");if(e.value!=="0")throw new o('Factor calls must attach value "0". Nothing was sent.');if(e.gasLimit!==void 0)throw new o("Factor calls use the sender\u2019s gas estimate; omit a fixed gas limit.")}async function x(e,r,a){if(e.network==="testnet")throw new o("Factor requires Robinhood Chain 4663.");let t=i(r),s=e.clientFor(l.chainId),[n,c,T]=await Promise.all([p(s),m(e.http),F(s,t)]);if(f({...n,stateDesk:c==="unreachable"?c:c.desk},a),T)throw new o(u.walletCode);return c}async function E(e,r){return e.readContract({address:h.desk.address,abi:d,functionName:"agent",args:[i(r)]})}async function I(e,r,a){let t=await b(e,S(r,"job"));if(!w(t.agent,i(a)))throw w(await y(e,t.agent),a)?new o(u.lineAccount):new o("Only the job's agent can do this.");return t}function k(e){let r=e;for(let a=0;a<12&&r&&typeof r=="object";a++){let t=r;if(typeof t.data=="string"&&/^0x[0-9a-f]+$/i.test(t.data))try{let s=A({abi:d,data:t.data}),n=s.args?.[0];switch(s.errorName){case"NotAgent":return"Only the job's agent can do this.";case"NotCustomer":return"Only this job\u2019s customer can do this.";case"NotRegistered":return"This wallet has not registered as a Factor agent.";case"AlreadyRegistered":return"This wallet is already registered as a Factor agent.";case"EarlyNotAllowed":return"The customer did not allow an early advance on this job.";case"TooLate":return"It is too late for that on this job.";case"WrongState":return"The job is not in a state that permits this action. Read the job again.";case"OverHalf":return`Advances stop at half the job price; ${String(n)} wei remains drawable.`;case"OverLimit":return`This agent\u2019s pool limit permits ${String(n)} wei now.`;case"PoolShort":return`Factor\u2019s pool has room to advance ${String(n)} wei now.`;case"Barred":return"Factor\u2019s pool no longer advances this agent.";case"ZeroAmount":return"The draw amount must be greater than zero.";case"TooSmall":return`Factor requires at least ${String(n)} wei for a job.`;case"TooSoon":return`Factor permits this action from Unix second ${String(n)}.`;case"BadDueTime":return"The due time must be from 1 hour to 30 days away.";case"GasShort":return"The simulation supplied too little gas for the desk payout. Re-estimate gas.";case"ReentrancyGuardReentrantCall":return"Factor\u2019s desk refused a reentrant call.";case"NothingOwed":return"No Factor payout is waiting for this wallet.";case"OwesThePool":return`The bond cannot leave while ${String(n)} wei is owed to the pool.`;case"OverBond":return`The bond holds only ${String(n)} wei.`;case"PushFailed":return"The recipient refused the Factor payout.";case"ZeroAddress":return"Factor requires a nonzero address."}}catch{}r=typeof t.data=="object"&&t.data!==null?t.data:t.cause??t.error}return g(e)}async function q(e,r,a){C(r);try{await e.call({account:i(a),to:r.to,data:r.data,value:0n})}catch(t){throw new o(`${k(t)} Nothing was sent.`)}}export{$ as a,S as b,C as c,x as d,E as e,I as f,k as g,q as h};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{h as T,s as E,t as F,v as P,w as S}from"./3A2IKFTV.js";import{a as m}from"./X5V2Z2NM.js";import{d as A}from"./HFVXNKA5.js";import{e as g,g as u}from"./NWNYJ26T.js";import{t as v}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";import{a as I}from"./JXOEJPJ4.js";import{encodeFunctionData as k,keccak256 as _,stringToHex as C}from"viem";var x="erc8004_stamp_thesis",q="/v1/agents/thesis",M={type:"object",additionalProperties:!1,required:["text","position"],properties:{text:{type:"string",minLength:1,maxLength:16384,description:"Exact thesis text to hash and publish in the tracker record; up to 16 KiB UTF-8. Only the hash is written on chain."},position:{type:"string",minLength:1,maxLength:256,description:"Canonical position ID, up to 256 UTF-8 bytes. Use oak_plan_run steps [trade, stamp] to approve both together."}}};function b(t,n){if(typeof t!="string"||!t.trim()||Buffer.byteLength(t,"utf8")>16384||/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(t))throw new o("Provide nonempty thesis text up to 16 KiB of valid UTF-8.");if(typeof n!="string"||!n.trim()||Buffer.byteLength(n,"utf8")>256||/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(n))throw new o("Provide a nonempty canonical position ID up to 256 UTF-8 bytes.");let e=_(C(t)),r=`oak.thesis.${_(C(JSON.stringify([n,t]))).slice(2)}`;return{text:t,position:n,key:r,hash:e}}function O(t,n){let e=b(n.text,n.position);if(!/^(0|[1-9][0-9]*)$/.test(n.agentId)||e.key!==n.key||e.hash!==n.hash||typeof n.writtenAfterEntry!="boolean")throw new o("The thesis differs from the locally prepared stamp.");let r=k({abi:m,functionName:"setMetadata",args:[BigInt(n.agentId),e.key,e.hash]}),a=t[0];if(t.length!==1||!a||a.chainId!==4663||!u(a.to,v.mainnet.identityRegistry)||a.value!=="0"||!u(a.data,r))throw new o("The transaction differs from the exact zero-value thesis stamp.")}function J(t){if(t.filter(e=>e.action?.name===x).length>1)throw new o("A plan may contain only one thesis stamp.");for(let[e,r]of t.entries()){if(r.action?.name!==x)continue;let a=r.action.oakThesis;if(!a||a.writtenAfterEntry!==(e===0))throw new o("The thesis disclosure differs from its locally prepared plan context.");O(r.txs,a)}}async function V(t,n,e,r,a={}){let{network:d,chainId:i,registry:y}=T(t);if(d!=="mainnet")throw new o("Thesis stamps are available on Robinhood Chain mainnet.");let c=A(e,d);if(!g(r)||Object.keys(r).some(D=>!["text","position"].includes(D)))throw new o("Provide only text and position; the local verified identity supplies the agent ID.");let s=b(r.text,r.position),l=BigInt(c.agentId);await F(t,l,n,"stamp this thesis");let f={...s,agentId:c.agentId,writtenAfterEntry:a.writtenAfterEntry!==!1},h=k({abi:m,functionName:"setMetadata",args:[l,s.key,s.hash]}),w=t.unsignedTx({to:y,chainId:i,value:"0",data:h,description:"Stamp the thesis hash as ERC-8004 metadata."}),p=f.writtenAfterEntry?`Thesis written after entry on ${new Date((a.now??Date.now)()).toISOString().slice(0,10)}.`:"Trade and thesis approved together in one plan.";return{...await E(t,[w],n,`Stamp the thesis hash ${s.hash} for agent ${c.agentId}. Only the hash is written on chain; the exact text and position are sent to Oak's public tracker record after the stamp is mined. ${p}
|
|
2
|
+
Position: ${JSON.stringify(s.position)}
|
|
3
|
+
Thesis:
|
|
4
|
+
${I(s.text)}`,!1),thesis:f}}async function Z(t,n,e,r,a){let d=!1;try{let i=b(e.text,e.position);if(i.key!==e.key||i.hash!==e.hash||typeof e.writtenAfterEntry!="boolean")throw new Error("invalid_bound_thesis");let{registry:y,chainId:c}=T(t);if(c!==4663||!/^(0|[1-9][0-9]*)$/.test(e.agentId))throw new Error("invalid_stamp_identity");let s=BigInt(e.agentId),l=k({abi:m,functionName:"setMetadata",args:[s,i.key,i.hash]}),f=await P(t,r,n,l),h=S(f,y,m,"MetadataSet");if(h.agentId!==s||h.metadataKey!==i.key||typeof h.metadataValue!="string"||!u(h.metadataValue,i.hash))throw new Error("stamp_event_mismatch");let w=await t.clientFor(c).readContract({address:y,abi:m,functionName:"getMetadata",args:[s,i.key],blockNumber:f.blockNumber});if(typeof w!="string"||!u(w,i.hash))throw new Error("stamp_metadata_mismatch");d=!0;let p=await a({agentId:e.agentId,key:i.key,hash:i.hash,text:i.text,txHash:r,position:i.position,writtenAfterEntry:e.writtenAfterEntry});if(!g(p)||p.ok!==!0||!g(p.data)||p.data.verification!=="confirmed")throw new Error("record_not_confirmed");return{txHash:r,stampMined:!0,recorded:!0,summary:"The thesis stamp is mined and its public tracker record is confirmed."}}catch{return{txHash:r,...d?{stampMined:!0}:{},recorded:!1,summary:d?"The thesis stamp is mined, but its tracker record was not confirmed. Retry recording this stamp without sending another transaction.":"The thesis stamp receipt could not be verified. No thesis record was posted; check the transaction before retrying."}}}var z=t=>({tools:t.network==="testnet"?[]:[{name:x,inputSchema:M,execute:async()=>{throw new o("Prepare this action through the local Oak bridge with a verified identity.")}}]});export{x as a,q as b,M as c,b as d,O as e,J as f,V as g,Z as h,z as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as l}from"./
|
|
1
|
+
import{i as l}from"./UVAR6BHU.js";import{a}from"./XSD5NL7J.js";var m=4295128739n,h=1461446703485210103287273052203988822378723970342n,d=-887272,$=887272;function I(t){if(t<2n)return t;let n=t,i=n+1n>>1n;for(;i<n;)n=i,i=n+t/n>>1n;return n}function w(t,n){if(typeof t!="string"||!/^\d+(?:\.\d+)?$/.test(t.trim()))throw new a(`${n} must be a positive decimal string such as "3000.5".`);let[i,e=""]=t.trim().split("."),r=BigInt(`${i}${e}`);if(r<=0n)throw new a(`${n} must be greater than zero.`);return{n:r,d:10n**BigInt(e.length)}}function _(t,n,i){let{n:e,d:r}=w(t,"initialPrice"),s=e*10n**BigInt(i),o=r*10n**BigInt(n),c=I((s<<192n)/o);return b(c)}function b(t){if(t<m||t>=h)throw new a("Initial price is outside the range Uniswap can represent.");return t}function S(t){b(t);let n=d,i=$;for(;n<i;){let e=Math.ceil((n+i)/2);l(e)<=t?n=e:i=e-1}return n}function f(t,n,i){let r=(t*t*10n**BigInt(n+18)/((1n<<192n)*10n**BigInt(i))).toString().padStart(19,"0"),s=r.slice(0,-18),o=r.slice(-18).replace(/0+$/,"");return o?`${s}.${o}`:s}function x(t,n){let i=t*t,e=n*n;return(i>e?i-e:e-i)*10000n/e}var P=500n;function R(t,n,i,e,r){if(n.length===0)return"No other pool for this pair was found, so the starting price could not be checked against a market. Anyone can trade against a wrong price immediately.";let s=[...n].sort((p,u)=>p.sqrtPriceX96<u.sqrtPriceX96?-1:p.sqrtPriceX96>u.sqrtPriceX96?1:0),o=s[Math.floor(s.length/2)],c=x(t,o.sqrtPriceX96),g=`${f(o.sqrtPriceX96,e,r)} (${o.label})`;if(c>P&&!i)throw new a(`Initial price ${f(t,e,r)} is ${c} bps from the existing market price ${g}. A mispriced new pool is arbitraged against your deposit. Fix the price, or pass acceptPriceDeviation:true if this is intentional.`);return`Existing market price ${g}; starting price deviates ${c} bps.`}function T(t,n){return typeof t=="string"&&/^[A-Za-z0-9][A-Za-z0-9.$_-]{0,15}$/.test(t)?t:`${n.slice(0,6)}\u2026${n.slice(-4)}`}export{m as a,h as b,_ as c,b as d,S as e,f,x as g,P as h,R as i,T as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as j}from"./OTYB6BHK.js";import{h as me,k as ke}from"./2GXHYI23.js";import{b as S}from"./QLFPAN6S.js";import{b as le}from"./SPJCSEKP.js";import{a as _}from"./43LI5NKJ.js";import{g as B,i as ue}from"./NWNYJ26T.js";import{b as H}from"./IX3GZMTM.js";import{b as d,j as N}from"./TI727O2H.js";import{a as u}from"./XSD5NL7J.js";import{a as de}from"./JXOEJPJ4.js";import{encodeFunctionData as K,erc20Abi as pe,getAddress as m,isAddress as ye,parseAbi as U,zeroAddress as fe}from"viem";var T=m(N[d].hoodlock.locker.address),F=m(N[d].hoodlock.burner.address),v=m(N[d].hoodlock.liquidityLocker.address),O=m(N[d].uniswap.v3_position_manager.address),V=m(N[d].uniswap.v4_position_manager.address),We="0x000000000000000000000000000000000000dEaD",$e=3153600000n,Le=1000000000000n,we=65535,D=U(["function fee() view returns (uint256)","function lock(address token, uint256 amount, uint256 unlockTime) payable returns (uint256 lockId)","function getLock(uint256 lockId) view returns (address owner, address token, uint256 amount, uint256 unlockTime, bool withdrawn)","function locksByOwner(address owner) view returns (uint256[])","function locksByToken(address token) view returns (uint256[])"]),te=U(["function fee() view returns (uint256)","function burn(address token, uint256 amount) payable returns (uint256 burnId)","function DEAD() view returns (address)","function getBurn(uint256 burnId) view returns (address burner, address token, uint256 amount, uint256 timestamp)","function totalBurnedOf(address token) view returns (uint256)"]),q=U(["function fixedFee() view returns (uint256)","function collectFeeBps() view returns (uint16)","function paused() view returns (bool)","function lock(address manager, uint256 tokenId, uint256 unlockTime, address feeRecipient, bool acceptUnverifiedHook, uint16 maxCollectFeeBps) payable returns (uint256 lockId)","function lockIdOf(address manager, uint256 tokenId) view returns (uint256)","function getLock(uint256 lockId) view returns (address owner, uint40 unlockTime, uint16 collectFeeBps, bool isV4, bool hookVerified, bool withdrawn, address feeRecipient, address token0, address token1, uint256 tokenId)","function locksOf(address owner) view returns (uint256[])"]),Se=U(["function approve(address to, uint256 tokenId)"]);function xe(e,o,t){let a=o.trim();if(a.startsWith("-")){let k=a.slice(1),i=e(k,t);return i==="0"?"0":`-${i}`}return e(a,t)}function ge(e,o){return o.length===0?"no ERC-20 transfer deltas":o.map(t=>`${xe(e.formatAmount,t.amount,t.token.decimals)} ${t.token.symbol}`).join(", ")}function E(e,o="token"){if(typeof e!="string"||!e.trim())throw new u(`Provide a valid ${o} contract address.`);if(!ye(e,{strict:!1}))throw new u(`Identify ${o} by chain and contract address, not by symbol.`);return m(e)}async function W(e,o){try{return await o()}catch(t){throw new u(e.plainError(t))}}function ve(e){let o=H(e);if(o<=0n)throw new u("Amount must be greater than zero.");return o}async function be(e){let o=await e.getBlock();if(!o||typeof o.timestamp!="bigint")throw new u("Could not read the current chain timestamp. Please try again.");return o.timestamp}function he(e,o){if(typeof e!="string"||!/^\d+$/.test(e.trim()))throw new u("unlockTime must be a non-negative integer string in Unix seconds.");let t=BigInt(e.trim());if(t>=Le)throw new u("unlockTime appears to be in milliseconds; provide Unix seconds at most 100 years (3153600000 seconds) in the future.");if(t<=o)throw new u(`unlockTime (${t}) must be in the future (greater than current timestamp ${o}).`);let a=o+$e;if(t>a)throw new u(`unlockTime (${t}) exceeds the 100-year maximum lock duration (3153600000 seconds; max ${a}).`);return t}async function ie(e,o,t=d){let a=m(o),[k,i]=await Promise.all([e.readContract({address:a,abi:pe,functionName:"symbol"}),e.readContract({address:a,abi:pe,functionName:"decimals"})]);return{address:a,symbol:de(String(k)),decimals:Number(i),chainId:t}}function Ie(e,o){if(e==null)return o;let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number(e.trim()):NaN;if(!Number.isInteger(t)||t<0||t>we)throw new u("maxCollectFeeBps must be an integer between 0 and 65535.");if(t<o)throw new u(`Live collectFeeBps (${o}) exceeds maxCollectFeeBps (${t}): collect fee changed.`);return Math.min(t,o)}function Pe(e){return e.tokenId!==void 0||e.manager!==void 0||e.feeRecipient!==void 0||e.maxCollectFeeBps!==void 0||e.acceptUnverifiedHook!==void 0||e.kind==="v3"||e.kind==="lp"||e.kind==="v4"||e.version==="v3"||e.version==="v4"}async function Ce(e,o,t){_(t);let a=m(t),k=o.kind==="v4"||o.version==="v4",i=o.manager!==void 0?E(o.manager,"manager"):k?V:O,g=i===V;if(i!==O&&!g)throw new u(`Unsupported position manager ${i}; use the configured Uniswap v3 or v4 manager.`);if(k&&!g||g&&(o.kind==="v3"||o.version==="v3"))throw new u("The requested version disagrees with the position manager.");if(o.acceptUnverifiedHook!==void 0&&typeof o.acceptUnverifiedHook!="boolean")throw new u("acceptUnverifiedHook must be a boolean.");let b=o.acceptUnverifiedHook===!0;if(!g&&b)throw new u("Uniswap v3 has no hooks; omit acceptUnverifiedHook.");let s=g?"v4":"v3";if(typeof o.tokenId!="string")throw new u("Provide an NFT tokenId as a decimal string.");let p=String(o.tokenId).trim(),c=H(p),l=ue(o.feeRecipient,"Provide an explicit feeRecipient address for LP position locks."),w=e.clientFor(d),[x,I,h]=await Promise.all([be(w),w.readContract({address:v,abi:q,functionName:"fixedFee"}),w.readContract({address:v,abi:q,functionName:"collectFeeBps"})]),y,$=!0;if(g){let C=U(["function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey, uint256 info)","function getPositionLiquidity(uint256 tokenId) view returns (uint128)","function ownerOf(uint256 tokenId) view returns (address)"]),[Y,J,M]=await Promise.all([w.readContract({address:i,abi:C,functionName:"getPoolAndPositionInfo",args:[c]}),w.readContract({address:i,abi:C,functionName:"getPositionLiquidity",args:[c]}),w.readContract({address:i,abi:C,functionName:"ownerOf",args:[c]})]);if(m(M)!==a)throw new u("This wallet does not own that v4 position NFT.");if(J<=0n)throw new u("The v4 position has no liquidity to lock.");if(y=m(Y[0].hooks),$=y===fe||await w.readContract({address:v,abi:U(["function hookAllowed(address) view returns (bool)"]),functionName:"hookAllowed",args:[y]}),!$&&!b)throw new u(`Unverified v4 hook ${y}; review its risks and explicitly set acceptUnverifiedHook: true to proceed.`)}let A=he(o.unlockTime,x),n=BigInt(I),r=Number(h);if(!Number.isInteger(r)||r<0||r>we)throw new u(`Invalid on-chain collectFeeBps (${String(h)}).`);if(o.maxFee!==void 0){let C=H(String(o.maxFee));if(n>C)throw new u(`Live fixedFee (${n}) exceeds maxFee (${C}).`)}let f=Ie(o.maxCollectFeeBps,r),L=(r/100).toString(),R=e.unsignedTx({to:i,data:K({abi:Se,functionName:"approve",args:[v,c]}),value:"0",chainId:d,description:`Approve Uniswap ${s} position NFT #${c} on ${i} for HoodLock LiquidityLocker ${v}.`}),P=e.unsignedTx({to:v,data:K({abi:q,functionName:"lock",args:[i,c,A,l,b,f]}),value:n.toString(),chainId:d,description:`Lock Uniswap ${s} NFT #${c} in HoodLock LiquidityLocker (${v}) until ${A} with feeRecipient ${l}, upfront fixedFee ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei), and ongoing collect fee ${r} bps (${L}% of collected LP fees, frozen per lock).`}),X=[R,P],z=await e.preview(X,a),Q=`Approve and lock Uniswap ${s} NFT #${c} (manager ${i}) in HoodLock LiquidityLocker ${v} until Unix ${A}. Upfront fixedFee: ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei). Ongoing LP fee share: ${r} bps (${L}% of collected LP fees, frozen per lock; maxCollectFeeBps=${f}) with feeRecipient ${l}. V4 hook: ${y??"none"}, reviewed: ${$}; acceptUnverifiedHook=${b}.`;return j(e,{txs:z.txs,summary:Q,preview:z,kind:s,contract:v,manager:i,tokenId:c.toString(),unlockTime:A.toString(),feeRecipient:l,acceptUnverifiedHook:b,collectFeeBps:r,maxCollectFeeBps:f,fixedFee:{token:S,amount:n.toString()}},v,n)}async function Fe(e,o,t){_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([be(i),i.readContract({address:T,abi:D,functionName:"fee"}),ie(i,k,d)]),p=ve(o.amount),c=he(o.unlockTime,g),l=BigInt(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(l>A)throw new u(`Live lock fee (${l}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,T,p.toString(),d),x=e.unsignedTx({to:T,data:K({abi:D,functionName:"lock",args:[s.address,p,c]}),value:l.toString(),chainId:d,description:`Lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until ${c} with exact fee ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and lock ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) in HoodLock Locker ${T} until Unix ${c}. Exact fee: ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,kind:"token",contract:T,token:s,amount:p.toString(),unlockTime:c.toString(),fee:{token:S,amount:l.toString()}},T,l)}function Re(e){return{name:"hoodlock_lock",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["token","v2","v3","v4"],description:"Lock mode: token/v2 LP via Locker, or Uniswap v3/v4 NFT via LiquidityLocker."},token:{type:"string",description:"ERC-20 token or v2 LP token contract address on chain 4663 (for token/v2 locks)."},amount:{type:"string",description:"Token amount as an integer string in base units (for token/v2 locks)."},manager:{type:"string",description:"Configured Uniswap v3 or v4 position manager; inferred from kind when omitted."},tokenId:{type:"string",description:"Uniswap NFT position tokenId as a decimal string."},feeRecipient:{type:"string",description:"Explicit recipient address for collected LP fees during a position lock."},acceptUnverifiedHook:{type:"boolean",description:"Explicit v4 unreviewed-hook consent; default false. A reviewed hook is not a safety guarantee."},maxFee:{type:"string",description:"Maximum upfront ETH fee in wei; the exact live fee is sent."},maxCollectFeeBps:{type:"number",description:"Maximum acceptable ongoing LP collect fee in bps (uint16, must be >= live collectFeeBps)."},unlockTime:{type:"string",description:"Unlock timestamp in Unix seconds (must be > now and <= now + 100 years)."}},required:["unlockTime"],additionalProperties:!1},async execute(o,t){return W(e,async()=>Pe(o)?Ce(e,o,t):Fe(e,o,t))}}}function Ne(e){return{name:"hoodlock_burn",inputSchema:{type:"object",properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663 to send to the dead address via HoodLock Burner."},amount:{type:"string",description:"Amount to burn as an integer string in base units."}},required:["token","amount"],additionalProperties:!1},async execute(o,t){return W(e,async()=>{_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(d),[g,b,s]=await Promise.all([i.readContract({address:F,abi:te,functionName:"fee"}),i.readContract({address:F,abi:te,functionName:"DEAD"}),ie(i,k,d)]),p=ve(o.amount),c=BigInt(g),l=m(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(c>A)throw new u(`Live burn fee (${c}) exceeds maxFee (${A}).`)}let w=e.approval(s.address,F,p.toString(),d),x=e.unsignedTx({to:F,data:K({abi:te,functionName:"burn",args:[s.address,p]}),value:c.toString(),chainId:d,description:`Send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F} (totalSupply is unchanged) with exact fee ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei).`}),I=[w,x],h=await e.preview(I,a),y=ge(e,h.changes),$=`Approve and send ${e.formatAmount(p.toString(),s.decimals)} ${s.symbol} (${p} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${F}. Note: tokens are transferred to ${l} and totalSupply is unchanged. Exact fee: ${e.formatAmount(c.toString(),S.decimals)} ETH (${c} wei). Preview changes: ${y}.`;return j(e,{txs:h.txs,summary:$,preview:h,contract:F,deadAddress:l,token:s,amount:p.toString(),fee:{token:S,amount:c.toString()},totalSupplyReduced:!1},F,c)})}}}async function Ae(e,o,t){_(o);let a=m(o),k=t?E(t,"token"):void 0,i=e.clientFor(d),g=[],b=new Set,s=n=>{for(let r of n){let f=r.toString();b.has(f)||(b.add(f),g.push(r))}};if(k){let[n,r]=await Promise.all([i.readContract({address:T,abi:D,functionName:"locksByToken",args:[k]}),i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]})]);s(n),s(r)}else{let n=await i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]});s(n)}let c=(await Promise.all(g.map(async n=>{let r=await i.readContract({address:T,abi:D,functionName:"getLock",args:[n]});return{id:n,owner:m(r[0]),token:m(r[1]),amount:BigInt(r[2]),unlockTime:BigInt(r[3]),withdrawn:!!r[4]}}))).filter(n=>!n.withdrawn&&n.amount>0n&&B(n.owner,a)&&(!k||B(n.token,k))),l=new Map,w=async n=>{let r=n.toLowerCase(),f=l.get(r);if(f)return f;let L=n===fe?S:await ie(i,n,d);return l.set(r,L),L},x=[],I=[];for(let n of c){let r=await w(n.token),f=n.amount.toString(),L=n.unlockTime.toString(),R={token:r,amount:f};x.push({lockId:n.id.toString(),kind:"token",contract:T,chainId:d,owner:n.owner,token:r,amount:f,asset:R,unlockTime:L,withdrawn:!1}),I.push({module:"hoodlock",id:`lock:${n.id.toString()}`,chainId:d,assets:[R],economics:{principal:[me("locked",{token:r,amount:f,source:"hoodlock.lock.amount",dueAt:L})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`HoodLock token lock #${n.id} of ${e.formatAmount(f,r.decimals)} ${r.symbol} (${r.address}) until Unix ${L}.`})}let h=await i.readContract({address:v,abi:q,functionName:"locksOf",args:[a]}),y=[...new Set(h.map(n=>n.toString()))].map(n=>BigInt(n)),$=[];for(let n of y){let r=await i.readContract({address:v,abi:q,functionName:"getLock",args:[n]}),[f,L,R,P,X,z,Q,C,Y,J]=r,M=m(f);if(z||!B(M,a))continue;let re=m(C),se=m(Y);if(k&&!B(re,k)&&!B(se,k))continue;let[Z,ee]=await Promise.all([w(re),w(se)]),ae=m(Q),ce=Number(R),oe=BigInt(L).toString(),ne=BigInt(J).toString();$.push({lockId:n.toString(),kind:P?"v4":"v3",contract:v,manager:P?V:O,chainId:d,owner:M,tokenId:ne,unlockTime:oe,collectFeeBps:ce,feeRecipient:ae,hookVerified:!!X,token0:Z,token1:ee,withdrawn:!1}),I.push({module:"hoodlock",id:`lp-lock:${n.toString()}`,chainId:d,assets:[{token:{address:P?V:O,symbol:`UNI-${P?"V4":"V3"} #${ne}`,decimals:0,chainId:d},amount:"1"}],economics:{principal:[],debt:[],rewards:[],backing:[Z,ee].map(Te=>ke({token:Te,amount:null,source:"hoodlock.lpLock.underlying",unknownReason:"HoodLock does not read the locked LP's underlying amounts.",heldAs:P?V:O,dueAt:oe})),coverage:{complete:!0}},description:`HoodLock Uniswap ${P?"v4":"v3"} LP lock #${n} (NFT #${ne}, ${Z.symbol}/${ee.symbol}, feeRecipient ${ae}, collectFeeBps ${ce}) until Unix ${oe}. One NFT held in LiquidityLocker custody for ${M}. Underlying token amounts are not valued.`})}let A=`Found ${x.length} active token lock(s) and ${$.length} active Uniswap v3/v4 LP lock(s) for ${a}.`;return{locks:x,lpLocks:$,positions:I,summary:A}}function He(e){return{name:"hoodlock_list_locks",inputSchema:{type:"object",properties:{owner:{type:"string",description:"Optional owner wallet address to query (defaults to the authenticated wallet)."},token:{type:"string",description:"Optional ERC-20 or LP token address to filter active locks owned by the wallet."}},additionalProperties:!1},async execute(o,t){let a=o.owner!==void 0?E(o.owner,"owner"):m(t),k=o.token!==void 0?E(o.token,"token"):void 0;return W(e,()=>Ae(e,a,k))}}}function Be(e){return async o=>(await W(e,()=>Ae(e,o))).positions}var G=e=>({tools:[Re(e),Ne(e),He(e)],positions:Be(e)}),Ge=G,Xe=G,Qe=e=>le("hoodlock",[G(e)]),Ye=G;export{T as a,F as b,v as c,O as d,V as e,We as f,$e as g,xe as h,Re as i,Ne as j,He as k,Be as l,G as m,Ge as n,Xe as o,Qe as p,Ye as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./DFM4T6ZE.js";import{a as n}from"./
|
|
1
|
+
import{a as P}from"./DFM4T6ZE.js";import{a as n}from"./VXCGMALF.js";import{g as $}from"./NWNYJ26T.js";import{b as s,e as v}from"./TI727O2H.js";import{getAddress as T,parseAbi as b}from"viem";var m={address:n.priors,symbol:"PRIORS",decimals:18,chainId:s},w=8,E="0x0000000000000000000000000000000000000000",x=b(["function balanceOf(address) view returns (uint256)"]),_=b(["function balanceOf(address) view returns (uint256)","function previewRedeem(uint256) view returns (uint256)"]),y=b(["function getPosition(uint256) view returns ((address depositor,address owner,address token,uint64 openedAt,bool closing,uint8 status,uint128 line,uint256 amount))","function assets(address) view returns (address feed,uint64 maxAge,uint8 tokenDecimals,uint8 feedDecimals,bool enabled,uint16 ltvBps,uint128 lineCap)"]),A=b(["function latestGen(uint256) view returns (uint32)","function position(uint256,uint32,uint8,address) view returns ((uint256 counted,uint256 checkpoint,uint256 a0,uint256 a1,uint32 d0,uint32 d1,bool autoAdd))"]);async function L(k,d,C,R){let e=k.clientFor(s),g=async(t,i,o,r)=>{try{return await r()}catch(a){return[{module:"priors",id:`priors:unreadable:${t}`,chainId:s,assets:[],incomplete:!0,description:`Priors ${i} read failed (${k.plainError(a)}). It is not zero: ${o}`}]}},l=(t,i)=>k.formatAmount(t.toString(),i),S=()=>g("savings","savings","check it with priors_savings_balance.",async()=>{let t=await e.readContract({address:n.savings,abi:_,functionName:"balanceOf",args:[d]});if(t===0n)return[];let i=await e.readContract({address:n.savings,abi:_,functionName:"previewRedeem",args:[t]});return[{module:"priors",id:`priors:savings:${d.toLowerCase()}`,chainId:s,assets:[{token:R,amount:i.toString()}],description:`Priors savings in the Morpho vault (${n.savings}): ${t} shares, ${l(i,v)} USDG redeemable now. Exit with priors_savings_withdraw or priors_savings_redeem; vault liquidity applies and no immediate exit is promised.`}]}),O=()=>g("priors-token","PRIORS token","check it with balances.",async()=>{let t=await e.readContract({address:n.priors,abi:x,functionName:"balanceOf",args:[d]});return t===0n?[]:[{module:"priors",id:`priors:token:${d.toLowerCase()}`,chainId:s,assets:[{token:m,amount:t.toString()}],description:`${l(t,m.decimals)} PRIORS held by this wallet (${n.priors}). Stock-collateral and backing stake are listed separately.`}]}),N=t=>g(`stock:${t}`,`stock (agent ${t})`,`check it with priors_stock_state {"agentId":"${t}"}.`,async()=>{let i=await e.readContract({address:n.stock,abi:y,functionName:"getPosition",args:[t]});if(i.amount===0n||i.token===E||!$(i.depositor,d))return[];let o=T(i.token),r=(await e.readContract({address:n.stock,abi:y,functionName:"assets",args:[o]}))[2],a=P.tokens.find(p=>$(p.token,o))?.symbol??"STOCK";return[{module:"priors",id:`priors:stock:${t}`,chainId:s,assets:[{token:{address:o,symbol:a,decimals:r,chainId:s},amount:i.amount.toString()}],description:`Priors stock collateral for agent ${t}: ${l(i.amount,r)} ${a} locked in the stock vault (${n.stock})${i.closing?"; the line is closing":""}. Close the line with priors_stock_close to return it, subject to any default or issuer shortfall.`}]}),I=t=>g(`backing:${t}`,`backing (agent ${t})`,`check it with priors_backing_position {"agentId":"${t}"}.`,async()=>{let i=BigInt(await e.readContract({address:n.backing,abi:A,functionName:"latestGen",args:[t]})),o=i>=BigInt(w)?i-BigInt(w-1):0n,r=[];for(let c=o;c<=i;c++)for(let u of[0,1,2])r.push(e.readContract({address:n.backing,abi:A,functionName:"position",args:[t,Number(c),u,d]}));let a=await Promise.all(r),p=a.reduce((c,u)=>c+u.counted,0n),f=a.reduce((c,u)=>c+u.a0+u.a1,0n),h=[];return o>0n&&h.push({module:"priors",id:`priors:unreadable:backing-generations:${t}`,chainId:s,assets:[],incomplete:!0,description:`Agent ${t} has ${i} backing generations; only the latest ${w} were read. Check older ones with priors_backing_position.`}),p+f>0n&&h.push({module:"priors",id:`priors:backing:${t}`,chainId:s,assets:[{token:m,amount:(p+f).toString()}],description:`Priors backing stake for agent ${t}: ${l(p,m.decimals)} PRIORS counted and ${l(f,m.decimals)} PRIORS pending. It is collateral that a default burns, not a return. Stake already leaving or settled is not included; check priors_backing_record and priors_backing_claimable.`}),h});return(await Promise.all([S(),O(),...C.flatMap(t=>[N(t),I(t)])])).flat()}export{m as a,L as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,c as p}from"./XTFRPI4G.js";var d=256,y=131072;function b(g,r,n={textFields:r.length,truncated:r.length>d,linksOnly:!1}){let i=[],l=r.length>0&&r.length<=d&&!n.truncated,h=0;for(let t of r.slice(0,d)){let e=g;try{if(t.length>32)throw new Error("path_limit");for(let T of t){if(e===null||typeof e!="object")throw new Error("missing_field");let a=Object.getOwnPropertyDescriptor(e,T);if(!a||!("value"in a))throw new Error("unreadable_field");e=a.value}if(typeof e!="string"||!e.trim()||e.length>f)throw new Error("not_scannable");if(h+=Buffer.byteLength(e,"utf8"),h>y)throw new Error("total_limit");let c=p({text:e}),u=c.decision==="refuse"?"flagged":c.decision==="allow"?c.findings.length?"review":"clear":"unknown";i.push({path:[...t],verdict:u,inputHash:c.inputHash}),u==="unknown"&&(l=!1)}catch{l=!1,i.push({path:[...t],verdict:"unknown",inputHash:null})}}let o=i.some(t=>t.verdict==="flagged")?"flagged: instruction-like text found":i.some(t=>t.verdict==="review")?"review: instruction-like text reported (not blocking)":l?"clear":"unknown",s=i.filter(t=>t.verdict!=="unknown").map(t=>t.path),k=o==="clear"?`no instruction-like text in the ${s.length} fields checked`:o.startsWith("review:")?"instruction-like text reported, read it before approving":o.startsWith("flagged:")?"instruction-like text found":"text check incomplete",x=n.truncated?`; checked ${s.length} of ${n.textFields} text fields`:"",w=n.linksOnly?"; links only; this result had no names or descriptions":"";return{verdict:o,scope:"text-only",checked:{fields:s.length,textFields:n.textFields,truncated:n.truncated},label:`Text check only, not a price check: ${k}${x}${w}.`,checkedFields:s,fields:i,complete:l}}export{d as a,b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./
|
|
1
|
+
import{a as k}from"./SCG5HWMN.js";import{e as h}from"./NWNYJ26T.js";import{a as w}from"./XSD5NL7J.js";import{createHash as S,createPublicKey as T,verify as x}from"node:crypto";import{getAddress as I,isAddress as R}from"viem";var v="https://dashboard.agentwormhole.com",f=4663,$="name,symbol,description,logo",C="wormhole-x402@0.11.0",L=5e3,E=65536,O="MCowBQYDK2VwAyEAgzc6812eT397nvzP/off3M93Z+yM5/BmEefSnRnS7o0=",D=T({key:Buffer.from(O,"base64"),format:"der",type:"spki"}),B=S("sha256").update(Buffer.from(O,"base64")).digest("hex"),A=/^[0-9a-f]{64}$/,P=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/,_=["v","metadata_hash","scope","chain_id","token","bundle_hash","verdict","codes","ruleset","issued_at","expires_at"];function z(e,t,a=D){try{if(a.asymmetricKeyType!=="ed25519"||typeof t!="string"||!/^[A-Za-z0-9+/]{86}==$/.test(t))return!1;let s=Buffer.from(t,"base64");return s.length===64&&s.toString("base64")===t&&x(null,Buffer.from(e,"utf8"),a,s)}catch{return!1}}function H(e){return JSON.stringify(Object.fromEntries(_.map(t=>[t,e[t]])))}function K(e){return h(e)&&Object.keys(e).length===_.length&&_.every(t=>Object.hasOwn(e,t))&&e.v===2&&typeof e.metadata_hash=="string"&&A.test(e.metadata_hash)&&typeof e.bundle_hash=="string"&&A.test(e.bundle_hash)&&typeof e.scope=="string"&&Number.isSafeInteger(e.chain_id)&&typeof e.token=="string"&&/^0x[0-9a-f]{40}$/.test(e.token)&&["clean_by_rules","flagged"].includes(String(e.verdict))&&Array.isArray(e.codes)&&e.codes.length<=100&&e.codes.every(t=>typeof t=="string"&&/^[A-Z0-9_-]{1,40}$/.test(t))&&typeof e.ruleset=="string"&&/^wormhole-x402@\d+\.\d+\.\d+$/.test(e.ruleset)&&[e.issued_at,e.expires_at].every(t=>typeof t=="string"&&P.test(t)&&Number.isFinite(Date.parse(t))&&new Date(t).toISOString()===t)}async function j(e,t){let a=e.headers.get("content-length");if(a&&(!/^\d+$/.test(a)||Number(a)>E))throw e.body?.cancel().catch(()=>{}),new Error("oversized_response");let s=e.body?.getReader();if(!s)throw new Error("invalid_response");let d=[],i=0,c=()=>{s.cancel().catch(()=>{})};t.addEventListener("abort",c,{once:!0});try{for(;;){if(t.aborted)throw new Error("timeout");let{value:u,done:l}=await s.read();if(l)break;if(i+=u.byteLength,i>E)throw new Error("oversized_response");d.push(u)}if(t.aborted)throw new Error("timeout");return JSON.parse(Buffer.concat(d).toString("utf8"))}finally{t.removeEventListener("abort",c),s.cancel().catch(()=>{}),s.releaseLock()}}async function F(e,t){if(!h(t)||Object.keys(t).length!==1||typeof t.token!="string"||!R(t.token,{strict:!0})||t.token.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")throw new w("Provide only token: a valid ERC-20 contract address on Robinhood Chain 4663.");let a=I(t.token),s=`${v}/api/v1/token/${f}/${a.toLowerCase()}`,d={token:{address:a,chainId:f},contentBound:!1,mutationCountAuthenticated:!1,attribution:{provider:"Agent Wormhole",source:s,page:`${v}/t/${f}/${a.toLowerCase()}`},keyId:B,unknowns:["Fresh full metadata is not available in the free response; description/logo and current displayed bytes are not bound.","The key was bootstrapped from the same origin, not independently authenticated; key rotation policy is unknown.","No contract code, economics, sellability, linked pages or image bytes were checked. Rules are evadable."]},i=(o,n=!1)=>({...d,status:"unchecked",verdict:null,signatureValid:n,codes:[],reason:o}),c=new AbortController,u,l=new Promise((o,n)=>{u=setTimeout(()=>{c.abort(),n(new Error("timeout"))},L)});try{return await Promise.race([l,(async()=>{let o=await e(s,{method:"GET",redirect:"error",credentials:"omit",headers:{accept:"application/json"},signal:c.signal}).catch(g=>{if(g instanceof k)return g.response;throw g});if(c.signal.aborted)throw new Error("timeout");if(o.redirected)return o.body?.cancel().catch(()=>{}),i("redirect_refused");if(!o.ok)return o.body?.cancel().catch(()=>{}),o.status===404?{...d,status:"unobserved",verdict:null,signatureValid:!1,codes:[],reason:"No attestation. Absence is not a verdict."}:i(o.status===429?"rate_limited":`http_${o.status}`);let n=await j(o,c.signal);if(!h(n)||!K(n.attestation)||typeof n.signature!="string"||!/^[A-Za-z0-9+/]{86}==$/.test(n.signature))return i("invalid_attestation");let r=n.attestation;if(!z(H(r),n.signature))return i("invalid_signature");if(r.chain_id!==f||r.token!==a.toLowerCase()||r.scope!==$)return i("identity_or_scope_mismatch",!0);if(S("sha256").update(JSON.stringify({v:2,chainId:f,address:r.token,metadataHash:r.metadata_hash})).digest("hex")!==r.bundle_hash)return i("bundle_mismatch",!0);if(n.observed!==!0||n.chain_id!==f||typeof n.token!="string"||n.token.toLowerCase()!==r.token||n.bundle_hash!==r.bundle_hash||n.verdict!==r.verdict||JSON.stringify(n.codes)!==JSON.stringify(r.codes))return i("record_mismatch",!0);let m=Date.parse(r.issued_at),p=Date.parse(r.expires_at),b=Date.now();if(m>b||p<=m||p-m>864e5)return i("invalid_time_window",!0);let y=[...b>=p?["expired"]:[],...r.ruleset!==C?["unrecognized_ruleset"]:[],...n.attestation_current!==!0||n.re_attestation!=="current"?["service_reports_not_current"]:[]],N={attestation:r,signature:n.signature,scope:r.scope,metadataHash:r.metadata_hash,bundleHash:r.bundle_hash,ruleset:r.ruleset,issuedAt:r.issued_at,expiresAt:r.expires_at,bundleIdentityValid:!0};return{...d,status:y.length?"stale":"verified",verdict:y.length?null:r.verdict,signatureValid:!0,codes:r.codes,evidence:N,staleReasons:y,mutationCount:Number.isSafeInteger(n.mutations)&&Number(n.mutations)>=0?n.mutations:null,notice:"A verified metadata snapshot is not a safety certificate. Unsigned service history and freshness do not prove no mutation since the scan."}})()])}catch(o){return i(c.signal.aborted||o instanceof Error&&o.message==="timeout"?"timeout":"unavailable_or_malformed_response")}finally{u!==void 0&&clearTimeout(u)}}export{L as a,z as b,F as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as L,k as r,l as $}from"./ACH4BSME.js";import{a as I,e as c,h as v}from"./CSOO4SW7.js";import{j as h,k as p}from"./2GXHYI23.js";async function M(k,b,d={},O){I(b);let o=new AbortController,C=()=>o.abort(),l=()=>c(o.signal);c(d.signal),d.signal?.addEventListener("abort",C,{once:!0});let u=[];try{let f=await L(k,O,o.signal);l();let w=k.clientFor(4663),S=await v(w,o.signal),T=Array.from({length:Math.ceil(f.logs.length/r)},(t,n)=>f.logs.slice(n*r,(n+1)*r));return await Promise.all(T.map(async(t,n)=>{l(),await $(w,t,b,S,o.signal,(e,y)=>{if(l(),BigInt(e.logTokens.amount)===0n&&BigInt(e.stakedLp.amount)===0n&&BigInt(e.pendingChop.amount)===0n&&BigInt(e.claimableChop.amount)===0n)return;let a=t[y],m=BigInt(e.pendingChop.amount),B=BigInt(e.claimableChop.amount),g=B<=m,s=e.rewardsPaused?0n:B,i={principal:[],debt:[],rewards:[],backing:[],coverage:g?{complete:!0}:{complete:!1,reason:"Chop reward reads disagree."}};if(BigInt(e.logTokens.amount)>0n&&i.backing.push(p({...e.net,source:"chop.redemption.net",heldAs:e.logTokens.token.address,measuredAtBlock:e.measuredAtBlock})),BigInt(e.stakedLp.amount)>0n&&i.backing.push(p({token:a.underlying,amount:null,source:"chop.stakedLp",heldAs:e.stakedLp.token.address,measuredAtBlock:e.measuredAtBlock,unknownReason:"Staked log tokens are not redeemed in this read; unstake to see their redemption."})),g){let A={tool:"chop_harvest",args:{log:a.log.address}},P=m-s;P>0n&&i.rewards.push(h("unpaid",{token:e.pendingChop.token,amount:P.toString(),source:"chop.getUnpaid",measuredAtBlock:e.measuredAtBlock,claim:A})),s>0n&&i.rewards.push(h("claimable",{token:e.claimableChop.token,amount:s.toString(),source:"chop.getClaimable",measuredAtBlock:e.measuredAtBlock,claim:A}))}let E=g?`unpaid CHOP ${m-s} base units; claimable CHOP ${s} base units${e.rewardsPaused?"; rewards are paused":""}.`:"Chop reward reads disagree.";u[n*r+y]=[{module:"chop",id:`4663:${a.log.address}`,chainId:4663,assets:[e.logTokens,e.stakedLp,e.pendingChop],economics:i,description:`Chop log held: ${e.logTokens.amount} base units; redeemable net underlying ${e.net.amount} base units (${a.underlying.address}, decimals ${a.underlying.decimals}); staked LP ${e.stakedLp.amount} base units; ${E}`,oakNotice:e.warnings}]})}).map(t=>t.catch(n=>{throw o.abort(),n}))),[...u.flat(),{module:"chop",id:"4663:coverage",chainId:4663,assets:[],incomplete:!0,description:"Chop positions cover currently verified registry logs only. Delisted or unverified log holdings are not included."}]}catch{return o.abort(),c(d.signal),[...u.flat(),{module:"chop",id:"4663:coverage",chainId:4663,assets:[],incomplete:!0,description:"Chop positions are incomplete because a chain read is unavailable. Please try again."}]}finally{d.signal?.removeEventListener("abort",C)}}export{M as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as I}from"./7VH6JQ2H.js";import{b as M}from"./7U62MMUQ.js";import{a as G}from"./DRLBTB4E.js";import{h as C}from"./2GXHYI23.js";import{b as W}from"./SPJCSEKP.js";import{a as U}from"./43LI5NKJ.js";import{a as P}from"./66F5ZH34.js";import{g as $}from"./NWNYJ26T.js";import{b as R}from"./IX3GZMTM.js";import{b as h,e as y,j as T,k as b}from"./TI727O2H.js";import{a as p}from"./XSD5NL7J.js";import{encodeFunctionData as A,erc20Abi as E,parseAbi as N}from"viem";var f=T[h].vaults.spark.address,i={address:b,chainId:h,symbol:"USDG",decimals:y},m={address:f,chainId:h,symbol:"spUSDG",decimals:6},_=(1n<<256n)-1n,k=N(["function asset() view returns (address)","function decimals() view returns (uint8)","function totalAssets() view returns (uint256)","function balanceOf(address owner) view returns (uint256)","function maxDeposit(address receiver) view returns (uint256)","function maxWithdraw(address owner) view returns (uint256)","function maxRedeem(address owner) view returns (uint256)","function previewDeposit(uint256 assets) view returns (uint256)","function previewWithdraw(uint256 assets) view returns (uint256)","function previewRedeem(uint256 shares) view returns (uint256)","function deposit(uint256 assets,address receiver) returns (uint256 shares)","function withdraw(uint256 assets,address receiver,address owner) returns (uint256 shares)","function redeem(uint256 shares,address receiver,address owner) returns (uint256 assets)"]),t=(s,l)=>({token:{...s},amount:l.toString()});function D(s,l,v=!1){if(!s||typeof s!="object"||Array.isArray(s)||Object.keys(s).some(g=>!l||g!=="amount"))throw new p(l?"Provide only the amount for this Spark action.":"Spark listing takes no arguments.");if(!l)return 0n;if(v&&s.amount==="max")return"max";if(typeof s.amount!="string")throw new p("Amount must be a positive integer string in base units.");let n=R(s.amount);if(n===0n||n>_)throw new p("Amount must be positive and within the uint256 range.");return n}var F=s=>{async function l(a){try{return await a()}catch(e){throw new p(s.plainError(e))}}async function v(a){U(a);let e=s.clientFor(h);if(await e.getChainId()!==h)throw new p("Spark requires an endpoint on chain 4663.");let[r,d,o]=await Promise.all([e.readContract({address:f,abi:k,functionName:"asset"}),e.readContract({address:f,abi:k,functionName:"decimals"}),e.readContract({address:b,abi:E,functionName:"decimals"})]);if(typeof r!="string"||!$(r,b))throw new p("Spark does not report the expected USDG asset on chain 4663.");if(d!==m.decimals||o!==i.decimals)throw new p("Spark shares and USDG must both have 6 decimals.");return async(u,x=[])=>{let c=await e.readContract({address:f,abi:k,functionName:u,args:x});if(typeof c!="bigint"||c<0n||c>_)throw new p(`Spark returned an invalid ${u} value.`);return c}}function n(a){let e=a.amount.startsWith("-"),r=e?a.amount.slice(1):a.amount;return`${e?"-":""}${s.formatAmount(r,a.token.decimals)} ${a.token.symbol}`}async function g(a,e,r,d){let o=await s.preview(a,e),u=o.changes.map(n).join(", ");return{txs:a,amounts:r,preview:o,summary:`${d} Preview values can change before execution. ${o.summary}${u?` Changes: ${u}.`:""}`}}return{positions:a=>l(async()=>{let e=await v(a),r=await e("balanceOf",[a]);if(r===0n)return[];let[d,o,u]=await Promise.all([e("previewRedeem",[r]),e("maxRedeem",[a]),e("maxWithdraw",[a])]);return[{module:"spark",id:`${h}:${f}`,chainId:h,assets:[t(m,r)],economics:{principal:d===0n?[]:[C("redeemable",{token:{...i},amount:d.toString(),source:"spark.previewRedeem",heldAs:m.address})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`${n(t(m,r))}; redeem preview ${n(t(i,d))} (rounded down). Current maximum redeem ${n(t(m,o))}; maximum withdrawal ${n(t(i,u))}.`}]}),tools:[I(s),...M(s),...G(s),{name:"spark_list",inputSchema:{type:"object",properties:{},additionalProperties:!1},execute:(a,e)=>l(async()=>{D(a,!1);let r=await v(e),d=await r("totalAssets"),[o,u,x,c,w]=await Promise.all([r("balanceOf",[e]),r("maxDeposit",[e]),r("maxWithdraw",[e]),r("maxRedeem",[e]),r("previewDeposit",[1000000n])]),S=await r("previewRedeem",[o]);return[{chainId:h,address:f,name:"Spark Savings USDG",asset:{...i},shareToken:{...m},totalAssets:t(i,d),balance:t(m,o),maxDeposit:t(i,u),maxWithdraw:t(i,x),maxRedeem:t(m,c),previewDepositAssets:t(i,1000000n),previewDeposit:t(m,w),previewRedeemShares:t(m,o),previewRedeem:t(i,S),rounding:"Deposit shares and redeemed assets round down; exact-asset withdrawals round shares up. Previews can change before execution."}]})},{name:"spark_deposit",inputSchema:{type:"object",properties:{amount:P('Amount of USDG in base units (USDG has 6 decimals). Example: "1000000" = 1 USDG.')},required:["amount"],additionalProperties:!1},execute:(a,e)=>l(async()=>{let r=D(a,!0),d=await v(e),[o,u]=await Promise.all([d("maxDeposit",[e]),d("previewDeposit",[r])]);if(r>o)throw new p("The deposit exceeds Spark\u2019s current maximum deposit.");if(u===0n)throw new p("This deposit would return zero Spark shares.");let x=[s.approval(b,f,r.toString(),h),s.unsignedTx({to:f,data:A({abi:k,functionName:"deposit",args:[r,e]}),value:"0",chainId:h,description:`Deposit ${n(t(i,r))} into Spark for this wallet.`})];return g(x,e,{assets:t(i,r),shares:t(m,u),maxDeposit:t(i,o)},`Approve exactly ${n(t(i,r))} for Spark ${f}, then deposit. Expected ${n(t(m,u))}, rounded down; current maximum deposit ${n(t(i,o))}.`)})},{name:"spark_withdraw",inputSchema:{type:"object",properties:{amount:{type:"string",anyOf:[{pattern:"^[0-9]+$"},{const:"max"}],description:'Amount of USDG in base units (USDG has 6 decimals; "1000000" = 1 USDG), or "max" to redeem all held shares.'}},required:["amount"],additionalProperties:!1},execute:(a,e)=>l(async()=>{let r=D(a,!0,!0),d=await v(e),[o,u,x]=await Promise.all([d("balanceOf",[e]),d("maxWithdraw",[e]),d("maxRedeem",[e])]);if(o===0n)throw new p("This wallet has no Spark shares to withdraw.");let c,w,S;if(r==="max"){if(w=o,w>x)throw new p("The full share balance exceeds Spark\u2019s current maximum redeem. Request an asset amount within the current maximum withdrawal.");c=await d("previewRedeem",[w]),S=A({abi:k,functionName:"redeem",args:[w,e,e]})}else{if(c=r,c>u)throw new p("The withdrawal exceeds Spark\u2019s current maximum withdrawal.");if(w=await d("previewWithdraw",[c]),w>o)throw new p("This wallet has insufficient Spark shares for the withdrawal.");S=A({abi:k,functionName:"withdraw",args:[c,e,e]})}if(c===0n||w===0n)throw new p("Spark returned a zero asset or share preview for this withdrawal.");let j=r==="max"?`Redeem all ${n(t(m,w))} from Spark to this wallet.`:`Withdraw ${n(t(i,c))} from Spark to this wallet.`,O=[s.unsignedTx({to:f,data:S,value:"0",chainId:h,description:j})];return g(O,e,{assets:t(i,c),shares:t(m,w),maxWithdraw:t(i,u),maxRedeem:t(m,x)},r==="max"?`Redeem all ${n(t(m,w))} for an expected ${n(t(i,c))}, rounded down. Current maximum redeem ${n(t(m,x))}.`:`Withdraw ${n(t(i,c))} using an expected ${n(t(m,w))}, rounded up. Current maximum withdrawal ${n(t(i,u))}.`)})}]}};function te(s){return W("spark",[F(s)])}export{F as a,te as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y,b as R,c as S,f as d,g as b,h as O,i as $,j as T,k,l as V}from"./TXGZ6NWN.js";import{c as j}from"./SCG5HWMN.js";import{c as h,e as C,g as A}from"./NWNYJ26T.js";import{b as P}from"./TI727O2H.js";import{a as r}from"./XSD5NL7J.js";import{concat as U,encodeAbiParameters as H,encodeFunctionData as E,keccak256 as M,parseAbi as F,parseAbiParameters as q}from"viem";var _=F(["function allocation(address) view returns (address token,uint256 amountTotal,uint256 amountClaimed,uint256 lockupEndTime,uint256 vestingEndTime,address admin)","function amountAvailableToClaim(address) view returns (uint256)","function claim(address)","function editAllocationAdmin(address,address)"]),D=F(["function airdrops(address) view returns (address admin,bytes32 merkleRoot,uint256 totalSupply,uint256 totalClaimed,uint256 lockupEndTime,uint256 vestingEndTime,uint256 adminClaimTime,bool adminClaimed)","function amountAvailableToClaim(address,address,uint256) view returns (uint256)","function claim(address,address,uint256,bytes32[])","function updateAdmin(address,address)","function updateMerkleRoot(address,bytes32)","function adminClaim(address,address)"]),L={bps:{type:"integer",minimum:1,maximum:9e3,description:"Share of the token supply sent to this extension, in basis points (1000 = 10%). Vault and airdrop together may not exceed 9000."},admin:{...h,description:"Address that administers this allocation. Defaults to the launching wallet."},lockupDuration:{...R,description:"Lockup before anything can be claimed, in seconds, as a decimal string (604800 = 7 days; airdrop minimum 86400 = 1 day)."},vestingDuration:{...R,description:"Linear vesting period after the lockup ends, in seconds, as a decimal string (0 = fully unlocked at lockup end)."}},W={vault:{type:"object",properties:L,required:["bps","lockupDuration","vestingDuration"],additionalProperties:!1},airdrop:{type:"object",properties:{...L,merkleRoot:{...S,description:"Merkle root of the airdrop allocations, as 0x followed by 64 hex digits (from clanker_airdrop_tree)."}},required:["bps","lockupDuration","vestingDuration","merkleRoot"],additionalProperties:!1}};function X(m,f){let g=[];for(let p of["vault","airdrop"]){let l=m[p];if(l===void 0)continue;if(!C(l))throw new r(`Provide ${p} configuration as an object.`);$(l,["bps","admin","lockupDuration","vestingDuration",...p==="airdrop"?["merkleRoot"]:[]]);let w=d(l.admin??f),v=b(l.lockupDuration),e=b(l.vestingDuration);if(v<BigInt(p==="vault"?604800:86400))throw new r(`${p} lockup is below the contract minimum.`);if(v+e+1209600n>=1n<<256n)throw new r("Extension duration exceeds uint256.");g.push({extension:y[p].address,msgValue:0n,extensionBps:O(l.bps,1,9e3),extensionData:p==="vault"?H(q("(address,uint256,uint256)"),[[w,v,e]]):H(q("(address,bytes32,uint256,uint256)"),[[w,T(l.merkleRoot),v,e]])})}if(g.reduce((p,l)=>p+l.extensionBps,0)>9e3)throw new r("Extensions must leave at least 10% of supply for liquidity.");return g}function N(m,f){return M(M(H(q("address,uint256"),[m,f])))}function I(m,f){return M(U(BigInt(m)<BigInt(f)?[m,f]:[f,m]))}var Z=m=>{let f=()=>m.clientFor(P),g=async(e,t)=>{if(!(await V(m,e)).extensions.some(a=>A(a,y[t].address)))throw new r(`This token has no verified Clanker ${t} extension.`)},p=async e=>{await g(e,"vault");let t=await f().readContract({address:y.vault.address,abi:_,functionName:"allocation",args:[e]});if(!Array.isArray(t)||t.length!==6||!A(d(t[0]),e))throw new r("Clanker returned an invalid vault allocation.");return{token:e,amountTotal:k(t[1]),amountClaimed:k(t[2]),lockupEndTime:k(t[3]),vestingEndTime:k(t[4]),admin:d(t[5]),claimable:k(await f().readContract({address:y.vault.address,abi:_,functionName:"amountAvailableToClaim",args:[e]}))}},l=async e=>{await g(e,"airdrop");let t=await f().readContract({address:y.airdrop.address,abi:D,functionName:"airdrops",args:[e]});if(!Array.isArray(t)||t.length!==8||typeof t[7]!="boolean")throw new r("Clanker returned invalid airdrop state.");return{token:e,admin:d(t[0]),merkleRoot:T(t[1]),totalSupply:k(t[2]),totalClaimed:k(t[3]),lockupEndTime:k(t[4]),vestingEndTime:k(t[5]),adminClaimTime:k(t[6]),adminClaimed:t[7]}},w=(e,t,o,a)=>({name:`clanker_${e}`,inputSchema:{type:"object",properties:t,required:o,additionalProperties:!1},execute:async(s,n)=>{try{return $(s,Object.keys(t)),await a(s,d(n))}catch(i){throw new r(m.plainError(i))}}}),v=async(e,t,o,a)=>{let s=[m.unsignedTx({to:e,data:t,chainId:P,value:"0",description:o})],n=await m.preview(s,a);return{txs:s,preview:n,summary:`${o} ${n.summary}`}};return{tools:[w("airdrop_proofs",{token:{...h,description:"Address of the launched Clanker token (ERC-20) on chain 4663."}},["token"],async(e,t)=>{let o=d(e.token),a=await l(o),s=new URL("https://www.clanker.world/api/airdrops/claim");s.searchParams.set("tokenAddress",o),s.searchParams.set("claimerAddress",t);let i=(await j(m.http,s.toString(),{method:"GET"},u=>C(u)&&Array.isArray(u.proofs))).proofs;if(i.length>200)throw new r("Clanker returned too many airdrop proofs.");let c=i.map(u=>{if(!C(u)||!C(u.entry)||!Array.isArray(u.proof)||u.proof.length>64||!A(d(u.entry.account),t))throw new r("Clanker returned invalid airdrop proofs.");let x=b(u.entry.amount),B=u.proof.map(T);if(!x||!A(B.reduce(I,N(t,x)),a.merkleRoot))throw new r("The indexed airdrop proof does not match the active onchain root.");return{allocatedAmount:x.toString(),proof:B}});return{token:o,chainId:P,recipient:t,proofs:c,summary:"Verified against the onchain airdrop root. An empty indexer response does not prove ineligibility; use saved allocation proofs if the tree was not published."}}),w("vault_status",{token:{...h,description:"Address of the launched Clanker token (ERC-20) on chain 4663."}},["token"],e=>p(d(e.token))),w("vault_claim",{token:{...h,description:"Address of the launched Clanker token (ERC-20) on chain 4663."}},["token"],async(e,t)=>{let o=d(e.token),a=await p(o);if(a.claimable==="0")throw new r("No vested Clanker tokens are available to claim.");return v(y.vault.address,E({abi:_,functionName:"claim",args:[o]}),`Claim ${a.claimable} base units of ${o} (18 decimals) to vault admin ${a.admin}.`,t)}),w("vault_update_admin",{token:{...h,description:"Address of the launched Clanker token (ERC-20) on chain 4663."},admin:{...h,description:"Address of the new vault administrator, who then receives all future claims."}},["token","admin"],async(e,t)=>{let o=d(e.token),a=await p(o);if(!A(a.admin,t))throw new r("Only the vault administrator can transfer its allocation.");return v(y.vault.address,E({abi:_,functionName:"editAllocationAdmin",args:[o,d(e.admin)]}),`Transfer all future Clanker vault claims for ${o} to ${d(e.admin)}.`,t)}),w("airdrop_tree",{allocations:{type:"array",minItems:1,maxItems:200,description:"Airdrop recipients and amounts, 1 to 200 rows with unique recipients. Returns the Merkle root and each proof.",items:{type:"object",properties:{recipient:{...h,description:"Address of the wallet eligible to claim this allocation."},amount:{...R,description:'Amount of the launched token allocated to this recipient, in base units (Clanker tokens have 18 decimals). Example: "1000000000000000000" = 1 token.'}},required:["recipient","amount"],additionalProperties:!1}}},["allocations"],async e=>{if(!Array.isArray(e.allocations)||!e.allocations.length||e.allocations.length>200)throw new r("Provide 1 to 200 airdrop allocations.");let t=new Set,o=e.allocations.map(n=>{if(!C(n))throw new r("Provide allocation objects.");$(n,["recipient","amount"]);let i=d(n.recipient),c=b(n.amount);if(!c||t.has(i))throw new r("Airdrop allocations require positive amounts and unique recipients.");return t.add(i),{recipient:i,amount:c.toString(),hash:N(i,c)}}).sort((n,i)=>n.hash.localeCompare(i.hash)),a=[o.map(n=>n.hash)];for(;a.at(-1).length>1;){let n=a.at(-1),i=[];for(let c=0;c<n.length;c+=2)i.push(c+1<n.length?I(n[c],n[c+1]):n[c]);a.push(i)}let s=o.reduce((n,i)=>n+BigInt(i.amount),0n);if(s>=1n<<256n)throw new r("Airdrop total exceeds uint256.");return{merkleRoot:a.at(-1)[0],total:s.toString(),allocations:o.map((n,i)=>{let c=[],u=i;for(let x of a.slice(0,-1))x[u^1]&&c.push(x[u^1]),u=Math.floor(u/2);return{recipient:n.recipient,amount:n.amount,proof:c}}),summary:"Double-hashed ABI(address,uint256) leaves; sorted hash pairs. Save these public proofs. Allocations are token base units, 18 decimals; match their total to the launch extension supply."}}),w("airdrop_status",{token:{...h,description:"Address of the launched Clanker token (ERC-20) on chain 4663."},allocatedAmount:{...R,description:'Optional: your allocation in the airdrop tree, in base units (Clanker tokens have 18 decimals). Example: "1000000000000000000" = 1 token. Adds the claimable amount to the result.'}},["token"],async(e,t)=>{let o=d(e.token);return{...await l(o),...e.allocatedAmount===void 0?{}:{claimable:k(await f().readContract({address:y.airdrop.address,abi:D,functionName:"amountAvailableToClaim",args:[o,t,b(e.allocatedAmount)]}))}}}),w("airdrop_claim",{token:{...h,description:"Address of the launched Clanker token (ERC-20) on chain 4663."},allocatedAmount:{...R,description:'Your full allocation in the airdrop tree, in base units (Clanker tokens have 18 decimals). Example: "1000000000000000000" = 1 token.'},proof:{type:"array",maxItems:64,description:"Merkle proof for your wallet and allocation, as 0x-prefixed 32-byte hex strings (from clanker_airdrop_proofs).",items:S}},["token","allocatedAmount","proof"],async(e,t)=>{let o=d(e.token),a=await l(o),s=b(e.allocatedAmount);if(!s||!Array.isArray(e.proof)||e.proof.length>64)throw new r("Provide a positive allocation and Merkle proof.");let n=e.proof.map(T),i=n.reduce(I,N(t,s));if(!A(i,a.merkleRoot))throw new r("The airdrop proof does not match the active root for this wallet and allocation.");return v(y.airdrop.address,E({abi:D,functionName:"claim",args:[o,t,s,n]}),`Claim vested allocation of ${s} base units of ${o} (18 decimals) to ${t}. Preview determines currently unlocked receipts.`,t)}),w("airdrop_manage",{token:{...h,description:"Address of the launched Clanker token (ERC-20) on chain 4663."},operation:{enum:["admin","root","reclaim"],description:"admin: hand administration to a new address (give admin); root: replace the Merkle root (give merkleRoot); reclaim: send unclaimed tokens to recipient and close claims."},admin:{...h,description:"New airdrop administrator address, for operation admin."},merkleRoot:{...S,description:"New Merkle root as 0x followed by 64 hex digits, for operation root."},recipient:{...h,description:"Address that receives the reclaimed tokens, for operation reclaim."}},["token","operation"],async(e,t)=>{let o=d(e.token),a=await l(o);if(!A(a.admin,t))throw new r("Only the airdrop administrator may manage it.");let s=e.operation==="admin"?"admin":e.operation==="root"?"merkleRoot":"recipient";for(let i of["admin","merkleRoot","recipient"])if(e[i]!==void 0&&i!==s)throw new r(`Input ${i} does not match this airdrop operation.`);let n;if(e.operation==="admin")n=E({abi:D,functionName:"updateAdmin",args:[o,d(e.admin)]});else if(e.operation==="root")n=E({abi:D,functionName:"updateMerkleRoot",args:[o,T(e.merkleRoot)]});else if(e.operation==="reclaim")n=E({abi:D,functionName:"adminClaim",args:[o,d(e.recipient)]});else throw new r("Choose admin, root or reclaim.");return v(y.airdrop.address,n,`Clanker airdrop ${String(e.operation)} for ${o}; ${String(e.admin??e.merkleRoot??e.recipient)}. Reclaim permanently closes recipient claims; contract timing and zero-claim guards apply.`,t)})]}};export{W as a,X as b,Z as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R}from"./G2LAO23N.js";import{C as W,H as X,I as q,L as Y,a as w,z as C}from"./HS5HWBMU.js";import{a as V}from"./66F5ZH34.js";import{f as Q,g as D}from"./NWNYJ26T.js";import{b as K,d as J}from"./IX3GZMTM.js";import{b as k}from"./TI727O2H.js";import{a as i}from"./XSD5NL7J.js";import{encodeFunctionData as oe,erc20Abi as ne,getAddress as I,parseAbi as ie}from"viem";var P="https://hookr.fun/api/mcp",Z=ie(["function fill(uint256 orderId) returns (uint256)","function fillGasFloor(uint256 orderId) view returns (uint256)"]),N={type:"string",pattern:"^[1-9][0-9]*$"},ee={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Hookr v4 pool ID: 32 bytes, 0x followed by 64 hex digits."},te={type:"string",enum:["buy","sell"],description:R.enumValues({buy:"spend the pool quote token to receive the listed token",sell:"spend the listed token to receive the quote token"})},re={cursor:{...N,description:"Order ID to start from, scanning downward (newest first). Use nextCursor from the previous page; omit for the latest order."},limit:{type:"integer",minimum:1,maximum:32,description:"Maximum number of order IDs to scan in this page, 1 to 32. Default 16."}};function B(o,m){if(typeof o!="string"||!/^[1-9][0-9]*$/.test(o)||o.length>78||BigInt(o)>=1n<<256n)throw new i(`Provide ${m} as a positive decimal integer string.`);return BigInt(o)}function g(o){return Q(o,"Hookr returned an invalid read response. Retry later.")}function H(o,m,e,t){return{name:o,inputSchema:{type:"object",description:`Read ${o.replace("hookr_","Hookr ")}. No signature or transaction.`,properties:m,required:e,additionalProperties:!1},execute:async(n,s)=>{if(Object.keys(n).some(a=>!Object.hasOwn(m,a))||e.some(a=>n[a]===void 0))throw new i(`Provide the documented arguments for ${o}.`);return t(n,s)}}}function F(o){if(typeof o!="string"||!/^0x[0-9a-fA-F]{64}$/.test(o))throw new i("Provide a 32-byte Hookr poolId.");return o}function $(o,m){let e=g(o),t=g(e.key);if(typeof t.fee!="number"||!Number.isInteger(t.fee)||t.fee<0||t.fee>16777215||typeof t.tickSpacing!="number"||!Number.isInteger(t.tickSpacing)||t.tickSpacing<=0||t.tickSpacing>8388607)throw new i("Hookr pool key is invalid.");let n={currency0:I(String(t.currency0)),currency1:I(String(t.currency1)),fee:t.fee,tickSpacing:t.tickSpacing,hooks:I(String(t.hooks))},s=m??F(e.poolId);if(BigInt(n.currency0)>=BigInt(n.currency1)||!D(W(n),s))throw new i("Hookr pool key does not match its PoolId.");let a=g(e.token),u=g(e.quote),d=r=>{let b=I(String(r.address));if(typeof r.symbol!="string"||!r.symbol.trim()||typeof r.decimals!="number"||!Number.isInteger(r.decimals)||r.decimals<0||r.decimals>255||![n.currency0,n.currency1].includes(b))throw new i("Hookr listed token metadata is invalid.");return{...r,address:b,chainId:k}},c=d(a),l=d(u);if(c.address===l.address)throw new i("Hookr listed token pair is invalid.");return{...e,poolId:s,key:n,token:c,quote:l}}async function se(o,m,e){try{let t=await o.http(P,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:m,arguments:e}}),signal:AbortSignal.timeout(15e3),redirect:"error"});if(!t.ok)throw new Error(`HTTP ${t.status}`);let n=g(await t.json());if(n.error||n.id!==1)throw new Error("RPC failure");let s=g(n.result);if(s.isError)throw new Error("Tool failure");let a=g(s.structuredContent);if(a.status==="unavailable"||a.error)throw new Error("Unavailable");return a}catch{throw new i(`Hookr ${m} read is unavailable. Retry later; unavailable data is not an empty result.`)}}var O=se;function ke(o){let m=e=>H(e?"hookr_orders":"hookr_open_orders",re,[],async(t,n)=>{let s=t.limit??16;if(typeof s!="number"||!Number.isInteger(s)||s<1||s>32)throw new i("Hookr page limit must be an integer from 1 to 32.");let a=o.clientFor(k),u=await a.getBlock();if(typeof u.number!="bigint"||typeof u.timestamp!="bigint"||u.timestamp<=0n)throw new i("Hookr order reads need a valid chain block and timestamp.");let d=new Proxy(Y(a),{get(h,f,p){return f==="readContract"?y=>h.readContract({...y,blockNumber:u.number}):Reflect.get(h,f,p)}}),c={...o,clientFor:()=>d},l=await d.readContract({address:w,abi:C,functionName:"lastOrderId"});if(typeof l!="bigint"||l<0n)throw new i("Could not read the last Hookr order ID. Coverage is unknown.");let r=t.cursor===void 0?l:B(t.cursor,"cursor");if(r>l)throw new i("Hookr cursor exceeds the latest order ID. Restart pagination.");let b=[],A=new Map,x=r,S=r>BigInt(s)?r-BigInt(s):0n;for(;r>S;){let h=r--,f=X(await d.readContract({address:w,abi:C,functionName:"getOrder",args:[h]}));if(Number(f.status)===0||BigInt(f.owner)===0n)throw new i(`Hookr order #${h} is missing. Coverage is unknown.`);if(e?!D(f.owner,n):Number(f.status)!==1)continue;let p=await q(c,h,{order:f,tokens:A});if(e){b.push(p);continue}let y=null,M=null,G=null,j=null,z=BigInt(p.expiry)<u.timestamp,L=p.fillable&&!z;if(L)try{let _=await d.readContract({address:w,abi:Z,functionName:"fillGasFloor",args:[BigInt(p.orderId)]}),T=await a.estimateGas({account:n,to:w,data:oe({abi:Z,functionName:"fill",args:[BigInt(p.orderId)]}),blockNumber:u.number}),v=await a.getGasPrice();if(typeof _!="bigint"||_<0n||typeof T!="bigint"||T<=0n||typeof v!="bigint"||v<0n)throw new Error("Invalid gas data");let U=(_*6n+4n)/5n,E=T>U?T:U;y=E.toString(),M=v.toString(),G=(E*v).toString(),j=(BigInt(p.bounty)-E*v).toString()}catch{}b.push({...p,fillable:L,expired:z,economics:{gasLimit:y,gasPrice:M,estimatedGasCost:G,bountyLessEstimatedGas:j,note:"Estimate only; excludes bounty claim gas and competition. Recheck the fill preview."}})}return{chainId:k,book:w,blockNumber:u.number.toString(),chainTime:u.timestamp.toString(),orders:b,scanned:{from:x.toString(),through:(r+1n).toString()},nextCursor:r>0n?r.toString():null,complete:r===0n}});return[m(!1),m(!0),H("hookr_order",{orderId:{...N,description:R.id("Hookr limit order")}},["orderId"],async e=>q(o,B(e.orderId,"orderId"))),H("hookr_pools",{token:{type:"string",description:R.address("listed token whose pools to return")},limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of pools to return, 1 to 50."},cursor:{type:"string",pattern:"^[0-9]{1,6}$",description:"Paging cursor: the nextCursor from the previous pools page; omit for the first page."}},[],async e=>{if(e.token!==void 0)try{I(String(e.token))}catch{throw new i("Provide a valid token address.")}if(e.limit!==void 0&&(typeof e.limit!="number"||!Number.isInteger(e.limit)||e.limit<1||e.limit>50))throw new i("Pool page limit must be from 1 to 50.");if(e.cursor!==void 0&&(typeof e.cursor!="string"||!/^[0-9]{1,6}$/.test(e.cursor)))throw new i("Provide the pool nextCursor from the previous page.");let t=await O(o,"hookr_pools",e);if(!Array.isArray(t.pools))throw new i("Hookr pool coverage is unknown. Retry later.");return{...t,pools:t.pools.map(n=>$(n)),chainId:k,source:P}}),H("hookr_pool",{poolId:ee,side:te,amountIn:{...N,description:'Order input amount in base units of the input token (quote token for buy, listed token for sell); read its decimals. Example: "1000000". Give with side and minAmountOut.'},minAmountOut:{...N,description:'Minimum output in base units of the output token (listed token for buy, quote token for sell); read its decimals. Example: "1000000". Give with side and amountIn.'}},["poolId"],async e=>{let t=F(e.poolId),n=[e.side,e.amountIn,e.minAmountOut].some(y=>y!==void 0);if(n&&(e.side!=="buy"&&e.side!=="sell"||e.amountIn===void 0||e.minAmountOut===void 0))throw new i("Provide side, amountIn and minAmountOut together for order-specific bounty bounds.");let s=n?B(e.amountIn,"amountIn"):void 0,a=n?B(e.minAmountOut,"minAmountOut"):void 0;if(s!==void 0&&(s>=1n<<128n||a>=1n<<128n))throw new i("Hookr order amounts must fit uint128 base units.");let u=await O(o,"hookr_pool",{poolId:t}),d=u.listing?$(u.listing,t):void 0,c={...u,...d?{listing:d}:{},chainId:k,source:P};if(!n)return{...c,bountyBounds:{status:"requires-order-terms",note:"The keeper bounty floor depends on the order. Supply side, amountIn and minAmountOut in base units. The batch-1 0.0005 ETH observation is not a permanent floor."}};if(!d)throw new i("Hookr pool key is unavailable; bounty floor is unknown.");let l=d.key,r=g(e.side==="buy"?d.quote:d.token),b=I(String(r.address))===l.currency0,A=o.clientFor(k),x=await A.getBlock(),S=await A.readContract({address:w,abi:C,functionName:"bountyBounds",args:[l,b,s,a],blockNumber:x.number});if(!Array.isArray(S)||S.length!==3||S.some(y=>typeof y!="bigint"||y<0n||y>=1n<<128n))throw new i("Hookr bounty bounds are unavailable; the floor is unknown.");let[h,f,p]=S;return{...c,bountyBounds:{status:"available",blockNumber:x.number.toString(),token:{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",symbol:"ETH",decimals:18,chainId:k},minBounty:h.toString(),defaultBounty:f.toString(),maxBounty:p.toString(),effectiveFloor:(h>0n?h:f).toString(),note:"ETH wei for this order at this block. Oak create uses the positive minimum, or the default when minimum is zero; recheck at creation."}}}),H("hookr_quote",{poolId:ee,side:te,amountIn:{...V(),description:'Amount of the input token in base units (quote token for buy, listed token for sell); read its decimals. Example: "1000000" = 1 token with 6 decimals.'}},["poolId","side","amountIn"],async(e,t)=>{let n=F(e.poolId);if(e.side!=="buy"&&e.side!=="sell")throw new i("Hookr side must be buy or sell.");if(typeof e.amountIn!="string"||K(e.amountIn)<=0n)throw new i("Provide a positive amountIn in base units.");let s=await O(o,"hookr_pool",{poolId:n}),a=$(s.listing,n),u=g(e.side==="buy"?a.quote:a.token),d=I(String(u.address)),c=d==="0x0000000000000000000000000000000000000000"?18:await o.clientFor(k).readContract({address:d,abi:ne,functionName:"decimals"});if(typeof c!="number"||!Number.isInteger(c)||c<0||c>255||typeof u.symbol!="string")throw new i("Hookr input token metadata is unavailable.");let l=J(e.amountIn,c),r=await O(o,"hookr_quote",{poolId:n,side:e.side,amount:l,payer:t}),b=await O(o,"hookr_check_trade",{poolId:n,side:e.side,amount:l,wallet:t});return{chainId:k,source:P,input:{token:{address:d,symbol:u.symbol,decimals:c,chainId:k},amount:e.amountIn},quote:r,check:b,note:"Informational quote. Review pool rules; unknown trade checks do not authorize a trade."}})]}export{se as a,ke as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b}from"./OYDKAIS2.js";import{c as m,f as A}from"./SMSXZ3FN.js";import{c as h}from"./LEV5SNNC.js";import{b as w}from"./JDSSYT6R.js";import{c as u,i as v,l as y}from"./VVJO6OYK.js";import{i as f}from"./QLFPAN6S.js";import{b as p}from"./SPJCSEKP.js";import{a as n}from"./XSD5NL7J.js";var $={asset:{type:"string",pattern:"^[A-Za-z0-9.$_-]{1,32}$",description:"Official asset symbol; for multiple USDG vaults, select the largest only with at least 100 USDG and ten times the runner-up assets. Other ambiguous symbols require a vault address."},vault:{type:"string",pattern:"^0x[0-9a-fA-F]{40}$",description:"Vault address to verify on chain; required for a rebuild without HTTP. If asset is also supplied, both must match."}};function M(e){return{type:"object",additionalProperties:!1,properties:{...$,...e?{amount:{type:"string",pattern:e==="withdraw"?"^(?:[0-9]+|max)$":"^[0-9]+$",description:'Selected vault asset amount in base units using its decimals (USDG has 6: "1000000" = 1 USDG); withdraw also accepts max to redeem all shares.'}}:{}},...e?{required:["amount"],anyOf:[{required:["asset"]},{required:["vault"]}]}:{}}}function O(e,o){if(Object.keys(e).some(s=>!["asset","vault",...o?["amount"]:[]].includes(s)))throw new n("Unexpected Borro argument.");if(e.asset!==void 0&&(typeof e.asset!="string"||!/^[A-Za-z0-9.$_-]{1,32}$/.test(e.asset)))throw new n("Provide an official asset symbol.");if(e.vault!==void 0&&u(e.vault),o&&(typeof e.amount!="string"||!(o==="withdraw"?/^(?:[0-9]+|max)$/:/^[0-9]+$/).test(e.amount)||!e.asset&&!e.vault))throw new n("Provide an asset symbol or vault address and a base-unit amount.")}function x(e,o={}){let s=m(e,o);if(o.resolveAllowedAsset||o.officialStockTokens)return s;let l=m(e,{...o,resolveAllowedAsset:(r,a,i)=>v(f())(r,a,i)}),t=(r,a,i,d)=>(a.vault?l:s).resolveVault(r,a,i,d);return{...l,discoverVaults:s.discoverVaults,resolveVault:t}}function P(e,o={}){let s=x(e,o),l=["deposit","withdraw"].map((t,r)=>({name:`borro_${t}`,inputSchema:M(t),execute:async(a,i)=>{O(a,t),u(i);let d=o.createActionTools??h,T=e.clientFor(4663),c=d({context:e,client:T,wallet:i,verifySetup:y,readLiquidity:w,...s})[r];if(!c||c.name!==`borro_${t}`)throw new n("Borro action wiring is unavailable.");return c.execute(a,i)}}));return{tools:[{name:"borro_list",inputSchema:M(),execute:async(t,r)=>(O(t),A(e,r,{...typeof t.asset=="string"?{asset:t.asset}:{},...t.vault?{vault:u(t.vault)}:{}},o,s))},...l],positions:(t,r)=>b(e,t,{...o,...r,discoverVaults:s.discoverVaults})}}var _=e=>p("borro",e.network==="testnet"?[]:[P(e)]);export{x as a,P as b,_ as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AsyncLocalStorage as u}from"node:async_hooks";var o=new u;function d(t,n){return o.run({sink:t,lastProgress:-1/0,lastSentAt:void 0},n)}function g(t,n,r){let e=o.getStore();if(!e?.sink||!Number.isFinite(t)||t<=e.lastProgress)return;let s=Date.now();if(!(e.lastSentAt!==void 0&&s-e.lastSentAt<250)){e.lastProgress=t,e.lastSentAt=s;try{let i={progress:t,...n===void 0?{}:{total:n},...r===void 0?{}:{message:r}};Promise.resolve(e.sink(i)).catch(()=>{})}catch{}}}export{d as a,g as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l,c as w}from"./
|
|
1
|
+
import{a as l,c as w}from"./SCG5HWMN.js";import{e as d}from"./NWNYJ26T.js";import{a as h}from"./5HCXZWUH.js";import{a as p}from"./XSD5NL7J.js";var m=new WeakMap;async function x(o,r,s){let n=new URL(r);if(!(n.origin==="https://aggregator-api.kyberswap.com"&&n.pathname==="/robinhood/api/v1/routes")&&!(n.origin==="https://api.velora.xyz"&&n.pathname==="/prices"))throw new Error("Only supported public price routes may be shared.");let e=m.get(o);e||(e=new h(3e3),m.set(o,e));let i=await e.read(r,()=>w(o,r,{method:"GET"},s));return{value:i.value,expiresAt:Math.floor(i.started/1e3)+60}}var y="No route through verified sources.",g=new WeakMap;function E(o){let r=g.get(o);return r||(r=async(s,n)=>{let e=new URL(s instanceof Request?s.url:String(s)),i=["aggregator-api.kyberswap.com","api.kyberswap.com"].includes(e.hostname)&&e.pathname.endsWith("/robinhood/api/v1/routes"),u=e.origin==="https://api.velora.xyz"&&e.pathname==="/prices",f=async a=>{if(!(i||u)||![200,400,404].includes(a.status))return!1;let t=await a.clone().json().catch(()=>{});return d(t)?i&&(t.code===4008&&t.message==="route not found"||t.code===40011&&t.message==="filtered liquidity sources")||u&&typeof t.error=="string"&&/^(No routes found|No liquidity|No price route found)/i.test(t.error):!1},c;try{c=await o(s,n)}catch(a){throw a instanceof l&&await f(a.response)?new p(y):a}if(await f(c))throw new p(y);return c},g.set(o,r)),r}export{x as a,y as b,E as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./I6PQW2JI.js";import{a as M}from"./K6D6SDIG.js";import{g as h,i as z,l as N,m as _,n as D}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";import{isHex as ce,keccak256 as pe}from"viem";var l=e=>N(z(e,"Provide a valid Chop address."),"Provide a nonzero Chop address."),P=e=>_(e,"Chop returned an invalid integer."),ye=e=>D(e,"Provide a positive Chop base-unit integer string within uint256.",{positive:!0});function he(e){if(typeof e!="string"||!ce(e,{strict:!0})||e.length<4||e.length%2)throw new i("Chop contract code is unavailable.");return pe(e)}function u(e){if(e?.aborted)throw new i("Chop read was cancelled.")}var B=(e,t,r,o,n,a,s)=>(u(s),e.readContract({address:t,abi:M,functionName:r,args:o,blockNumber:n,...a?{account:a}:{}}));async function L(e,t,r,o){u(o);let n=await e.multicall({allowFailure:!1,batchSize:0,blockNumber:r,contracts:t.map(a=>({address:a.target,abi:M,functionName:a.fn,args:a.args??[]}))});if(!Array.isArray(n)||n.length!==t.length)throw new i("Chop returned incomplete reads.");return n}async function le(e,t){if(u(t),await e.getChainId()!==d.chainId)throw new i("Chop requires chain 4663.");return u(t),P(await e.getBlockNumber({cacheTime:0}))}function b(e){if(!e||typeof e!="object"||Array.isArray(e))throw new i("Chop returned invalid log metadata.");return e}function R(e){if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255)throw new i("Chop token decimals are invalid.");return e}function O(e){return typeof e=="string"&&/^[A-Za-z0-9.$_-]{1,32}$/.test(e)?e:"token"}var be=()=>new WeakMap;function j(e,t){if(!t)return;let r=t.get(e);return r||(r={code:new Map,implementations:new Map},t.set(e,r)),r}var q=(e,t)=>`${e.toLowerCase()}:${t}`;function F(e,t,r){let o=e?.get(t);if(o)return o;let n=r();return e?.set(t,n),n}async function W(e,t,r,o,n){u(o);let a=await F(j(e,n)?.code,q(t,r),async()=>he(await e.getCode({address:t,blockNumber:r})));return u(o),a}async function E(e,t,r,o,n){if(!h(await W(e,t.address,r,o,n),t.codeHash))throw new i("Chop trust-anchor code changed.")}async function V(e,t,r,o,n,a,s,c){await Promise.all([E(e,o,a,s,c),E(e,{address:t,codeHash:r},a,s,c)]),u(s);let A=await F(j(e,c)?.implementations,q(o.address,a),async()=>l(await B(e,o.address,"implementation",[],a,void 0,s))),x=await W(e,A,a,s,c);return{address:A,codeHash:x,changed:!h(x,n)}}function ge(e,t){let r=b(e);if(!h(l(r.index),t)||r.verified!==!0)throw new i("This is not a verified Chop registry log.")}async function Ae(e,t,r,o,n,a){u(n);let s=l(t),c=o??await le(e,n);await E(e,d.registry,c,n,a);let A=await B(e,d.registry.address,"getIndex",[s],c,void 0,n);if(ge(A,s),r==="enter"){if(b(A).makePublic!==!0)throw new i("This verified Chop log is not public for new deposits.");await B(e,d.registry.address,"validateIndex",[s],c,void 0,n)}let[x,T]=await Promise.all([L(e,["getAllAssets","PAIRED_LP_TOKEN","lpStakingPool","lpRewardsToken","v2Pool","fees","decimals","symbol","totalSupply","config"].map(p=>({target:s,fn:p})),c,n),V(e,s,d.proxy.codeHash,d.beacon,d.implementation.codeHash,c,n,a)]),[v,X,Z,G,J,Q,Y,ee,ne,te]=x;if(!Array.isArray(v)||v.length!==1||P(b(v[0]).weighting)!==10n**18n)throw new i("Only verified single-token Chop logs are supported.");let g=l(b(v[0]).token),w=l(X),m=l(Z),C=l(J);if(!h(l(G),d.chop)||[s,g,w,m,C].some(p=>h(p,d.dormantOak))||new Set([s,g,w,m,C].map(p=>p.toLowerCase())).size!==5)throw new i("Chop log token identities do not match the supported setup.");let oe=b(Q),re=Object.fromEntries(["burn","bond","debond","buy","sell","partner"].map(p=>{let f=oe[p];if(typeof f!="number"||!Number.isInteger(f)||f<0||f>1e4)throw new i("Chop returned invalid fees.");return[p,f]})),K=b(te);if(K.hasTransferTax!==!1||K.blacklistTKNpTKNPoolV2!==!1)throw new i("Chop transfer-tax or blocked-pool logs are unsupported.");let k=await L(e,[{target:g,fn:"decimals"},{target:g,fn:"symbol"},{target:w,fn:"decimals"},{target:w,fn:"symbol"},{target:m,fn:"POOL_REWARDS"},{target:s,fn:"totalAssets",args:[g]}],c,n),y=l(k[4]);if([s,g,w,m,C].some(p=>h(p,y)))throw new i("Chop rewards identity is invalid.");let[ae,se,ie]=await Promise.all([L(e,[{target:m,fn:"INDEX_FUND"},{target:m,fn:"stakingToken"},{target:y,fn:"indexFund"},{target:y,fn:"trackingToken"},{target:y,fn:"rewardsToken"}],c,n),V(e,m,d.staking.codeHash,d.stakingBeacon,d.stakingImplementation.codeHash,c,n,a),V(e,y,d.rewards.codeHash,d.rewardsBeacon,d.rewardsImplementation.codeHash,c,n,a)]);if(ae.some((p,f)=>!h(l(p),[s,C,s,m,d.chop][f])))throw new i("Chop staking or rewards links do not match this log.");let H={address:g,decimals:R(k[0]),symbol:h(g,d.oak)?"OAK":O(k[1]),chainId:4663};if(H.symbol.replace(/^\$/,"").toUpperCase()==="OAK"&&!h(g,d.oak))throw new i("Chop underlying OAK is not the canonical Oak token.");let de={address:w,decimals:R(k[2]),symbol:O(k[3]),chainId:4663},U={address:s,decimals:R(Y),symbol:O(ee),chainId:4663},I=[T.changed?"log implementation":"",se.changed?"staking implementation":"",ie.changed?"rewards implementation":""].filter(Boolean);if(r==="enter"&&I.length)throw new i(`Chop implementation changed (${I.join(", ")}); wraps and farms are refused.`);let S=P(ne),$=P(k[5]);if(S===0n)throw new i("This Chop log has no issued supply.");return{log:U,underlying:H,paired:de,staking:{address:m,symbol:"Chop staked LP",decimals:18,chainId:4663},rewards:y,pool:C,fees:re,totalSupply:S.toString(),managedUnderlying:$.toString(),backingPerLog:{token:H,amount:($*10n**BigInt(U.decimals)/S).toString()},implementation:T.address,implementationHash:T.codeHash,drift:I,measuredAtBlock:c.toString()}}function Ce(e,t,r=!1){if(e.length!==t.length||e.some((o,n)=>!h(o.to,t[n].to)||o.data!==t[n].data||o.value!=="0"||o.chainId!==4663||o.gasLimit!==t[n].gasLimit&&!(r&&o.gasLimit===void 0)))throw new i("Chop transaction or exact approval does not match the requested action.")}function Pe(e,t){let r=new Map;for(let o of e.changes){let n=t.find(c=>h(c.token.address,o.token.address));if(!n||o.token.chainId!==4663||o.token.decimals!==n.token.decimals||typeof o.amount!="string"||!/^-?\d+$/.test(o.amount))throw new i("Chop preview showed an unexpected token movement.");let a=BigInt(o.amount);if(P(a<0n?-a:a),n.min>=0n&&a<0n||n.max!==void 0&&n.max<=0n&&a>0n)throw new i("Chop preview showed a reversed token movement.");let s=n.token.address.toLowerCase();r.set(s,(r.get(s)??0n)+a)}for(let o of t){let n=r.get(o.token.address.toLowerCase())??0n;if(n<o.min||o.max!==void 0&&n>o.max)throw new i("Chop preview receipt does not meet the quoted amount.")}return r}export{l as a,P as b,ye as c,he as d,u as e,B as f,L as g,le as h,be as i,E as j,ge as k,Ae as l,Ce as m,Pe as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getAddress as e}from"viem";var c={chainId:4663,blockNumber:107272178n,blockHash:"0x1a641b0acfca30a12686f032664231ed6c0b21b6eefd2c080585c5f797335e11",packCommit:"7faf3ad594ddd19ae8700b02f3efc9d9006eface",sourceCommit:"713df4eca1f41ef27434a7eb8edf484a4c7cdc83"},d={desk:{address:e("0x487Eb282E9Aa56aE871c15A16C5B061b9d2faA6F"),codeHash:"0x62f56fb1f0e0ebf6371132f36d3b8b134f6ac1913a27697cd064ee51ae90eafc"},burnPot:{address:e("0xff54EbC9c6871Fb1c5C9e03ac45250488d923F79"),codeHash:"0xb186b2d260e86cd1b200eaf2843bc61a00c42a650458ec7325278fd35ba3ab60"},gateway:{address:e("0xe4314Ba4DAe5f31582ec23812d5f40287f1eFdE0"),codeHash:"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},line:{address:e("0xc9405ca62ed1e9a4a058f404e5c1c893f7ae67c4"),codeHash:"0x83926b11b8c0522bb06955b943bb2f9272edf6636495024cc21e6b396114b231"},lineAccountImplementation:{address:e("0x8f63D64ACafC6a3c956a9f3B0eFFbc438DB9a869"),codeHash:"0x7086ac2f1b2af935c98c6140d9fb3eebd24d5e5dd698cd9a9dba3328e6a7ace3"},accounts:{address:e("0x3417A303DcB62A84965a641f894ff5803502F8FA"),codeHash:"0x560df7e0b37e4551c4d3047a5c2284a22e6fb9eccd0fced5c5918fd111a265b2"},accountImplementation:{address:e("0x34a6b7A9885E57E28ec868d73652660d5e176358"),codeHash:"0xb957ce9c0530ebfe458eafb7b2cd4a00bb9572c4c922ecbd9466cdea924da133"}},b={BPS:10000n,ADVANCE_MAX_BPS:5000n,ADVANCE_FEE_BPS:100n,JOB_FEE_BPS:200n,REJECTED_BPS:5000n,POOL_OUT_MAX_BPS:8000n,MIN_JOB:1000000000000000n,MIN_DUE:3600n,MAX_DUE:2592000n,GRACE:43200n,REVIEW:86400n,CUSTOMER_FEES_MIN:1000000000000000n},f={"register()":"0x1aa3a008","draw(uint256,uint256,uint8)":"0xe895a7a7","deliver(uint256,bytes32)":"0xd9b42a7f","decline(uint256)":"0xa0355f4e","job(uint256)":"0x2329e48c","agent(address)":"0x92e423b5","canDrawOn(uint256)":"0xdf9343f0","owed(address)":"0xdf18e047","keyOf(address)":"0xfa073d76","burnPot()":"0xdd428d4d","gateway()":"0x116191b6"};export{c as a,d as b,b as c,f as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as q,c as M,d as Y}from"./ROQQ62LP.js";import{e as Q,g as j,i as z,j as F}from"./X5AL3DUK.js";import{F as E,c as W,f as H,n as k,t as R,u as K}from"./WBNFRPAT.js";import{a as L}from"./YEIM6BZQ.js";import{a as O}from"./XSD5NL7J.js";import{getAddress as te,parseAbi as oe,zeroAddress as ne}from"viem";var se=oe(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)"]),G=1n<<192n,m={feeRefusal:t=>`Blocked: this pool charges a ${t} fee on every trade. Oak will not quote or prepare a swap through it. Pick a pool with a normal fee. Only if the person has been told the fee and still wants it, repeat with allowHighFeePools: true.`,lossRefusal:(t,e)=>`Blocked: this route returns about ${t} less than ${e}. Oak will not prepare this swap. Only if the person has been told the loss and still wants it, repeat with acceptValueLoss: true.`,warning:(t,e,i)=>`This route returns about ${t} less than ${e} (pool fee ${i} plus price impact).`,own:"this pool's own current price",noIndependent:"No independent market price was available for this pair, so Oak compared the quote with this pool's own current price only.",feeOverride:t=>`You chose to trade through a pool with a ${t} fee.`,lossOverride:(t,e)=>`This trade returns about ${t} less than ${e}.`},l=t=>t.toLowerCase()===ne?H.toLowerCase():t.toLowerCase(),X=(t,e,i,c)=>l(t)===l(i)&&l(e)===l(c)||l(t)===l(c)&&l(e)===l(i),B=(t,e)=>e?[t*t,G]:[G,t*t];async function de(t,e){let{blockNumber:i}=e,c=[],g=[],T=new Map,V=o=>{let n=R(o),s=T.get(n);return s||(s=t.readContract({address:W,abi:se,functionName:"getSlot0",args:[n],blockNumber:i}),T.set(n,s)),s},C=e.poolKeys??[],x=o=>k.some(n=>n.poolId.toLowerCase()===R(o).toLowerCase()),d=e.version==="v4"?await Promise.all(C.map(async o=>K(o)?Number((await V(o))[3]):o.fee)):e.version==="v3"?e.fees:Array.from({length:e.path.length-1},()=>3e3);for(let o=0;o<d.length;o++){let n=L(d[o]);if(d[o]>=5e4&&!(e.version==="v4"&&x(C[o]))&&!e.allowHighFeePools)throw new O(m.feeRefusal(n));(e.allowHighFeePools||e.acceptValueLoss)&&g.push(m.feeOverride(n))}let I=1n,_=1n,a=e.input,y=[],U=!1;for(let o=0;o<d.length;o++){let n=C[o],s=n?n.currency0===a?n.currency1:n.currency0:e.path[o+1],A=e.references?.[o],p,f;if(A)p=A.numerator,f=A.denominator,y.push(A.label);else{let h=(n&&x(n)?k.find(r=>r.poolId.toLowerCase()===R(n).toLowerCase()):void 0)??k.find(r=>X(a,s,r.key.currency0,r.key.currency1)),v=j.find(r=>X(a,s,r.token0,r.token1));if(h||v){let r=h?h.key.currency0:v.token0,u=h?h.key.currency1:v.token1,J=h?(await V(h.key))[0]:(await t.readContract({address:v.address,abi:F,functionName:"slot0",blockNumber:i}))[0];[p,f]=B(J,l(a)===l(r));let[Z,ee]=await Promise.all([E(t,r),E(t,u)]);y.push(`Oak's measured ${Z.symbol}/${ee.symbol} pool`)}else if(U=!0,y.push(m.own),n)[p,f]=B((await V(n))[0],a===n.currency0);else if(e.version==="v3"){let r=await t.readContract({address:Q.factory,abi:z,functionName:"getPool",args:[a,s,d[o]],blockNumber:i}),u=await t.readContract({address:r,abi:F,functionName:"slot0",blockNumber:i});[p,f]=B(u[0],BigInt(a)<BigInt(s))}else{let r=await t.readContract({address:q,abi:M,functionName:"getPair",args:[a,s],blockNumber:i}),u=await t.readContract({address:r,abi:Y,functionName:"getReserves",blockNumber:i});[p,f]=BigInt(a)<BigInt(s)?[u[1],u[0]]:[u[0],u[1]]}}if(p<=0n||f<=0n)throw new O("No positive Uniswap quote is available.");I*=p,_*=f,a=te(s)}let P=[...new Set(y)].join(" \xD7 "),w=U?m.noIndependent:void 0,b=e.exactOutput?e.quoted*I:e.amount*I,D=e.exactOutput?e.amount*_:e.quoted*_,N=b>D?b-D:0n,S=(N*1000n+b/2n)/b,$=`${S/10n}${S%10n?`.${S%10n}`:""}%`;if(N*10n>=b&&!e.acceptValueLoss)throw new O(`${m.lossRefusal($,P)}${w?` ${w}`:""}`);if((e.allowHighFeePools||e.acceptValueLoss)&&g.push(m.lossOverride($,P)),N*100n>=b*2n){let o=d.reduce((n,s)=>n*BigInt(1e6-s),1000000n)/1000000n**BigInt(d.length);c.push(m.warning($,P,L(Number(1000000n-o))))}return c.unshift(...g),c.length&&w&&c.push(w),{reference:P,...w?{referenceNote:w}:{},...c.length?{warnings:c}:{},confirmationWarnings:g}}export{m as a,de as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as P}from"./JPPQDELB.js";import{a as u}from"./YXXK6EPI.js";import{a as O}from"./43LI5NKJ.js";import{a as A}from"./66F5ZH34.js";import{d as g,i as T}from"./NWNYJ26T.js";import{b as p}from"./TI727O2H.js";import{a as r}from"./XSD5NL7J.js";import{a as k}from"./JXOEJPJ4.js";import{encodeFunctionData as E,getAddress as f,parseAbi as v,zeroAddress as R}from"viem";var w=v(["function owner() view returns (address)","function paused() view returns (bool)","function maximumLoanDuration() view returns (uint256)","function adminFeeInBasisPoints() view returns (uint16)","function pause()","function unpause()","function updateAdminFee(uint16)","function updateMaximumLoanDuration(uint256)","function setERC20Permit(address,bool)","function setERC20Permits(address[],bool[])","function getERC20Permit(address) view returns (bool)","function requestTransferOwnership(address)","function cancelTransferOwnership()","function acceptTransferOwnership()","function rejectTransferOwnership()"]),C=["pause","unpause","updateAdminFee","updateMaximumLoanDuration","setERC20Permit","setERC20Permits","requestTransferOwnership","cancelTransferOwnership","acceptTransferOwnership","rejectTransferOwnership"];function m(d){return T(d,"Provide an explicit checksummed address.",g)}var S=d=>{let h=(n,i,c,e)=>({name:n,inputSchema:{type:"object",properties:i,required:c,additionalProperties:!1},execute:async(s,t)=>{try{if(O(t),Object.keys(s).some(a=>!Object.hasOwn(i,a)))throw new r("Unsupported Longbow administration argument.");return await e(s,t)}catch(a){throw new r(d.plainError(a))}}});async function b(){let n=d.clientFor(p);if(await n.getChainId()!==p)throw new r("Longbow requires chain 4663.");return n}return{tools:[h("longbow_nft_admin",{token:{type:"string",description:"Optional ERC-20 token address to check whether the NFT loan contract permits it as a loan currency."}},[],async n=>{let i=await b(),c=["owner","paused","maximumLoanDuration","adminFeeInBasisPoints"],e=await Promise.all(c.map(s=>i.readContract({address:u,abi:w,functionName:s})));return{chainId:p,contract:u,...Object.fromEntries(c.map((s,t)=>[s,typeof e[t]=="bigint"?String(e[t]):e[t]])),...n.token===void 0?{}:{token:m(n.token),permitted:await i.readContract({address:u,abi:w,functionName:"getERC20Permit",args:[m(n.token)]})}}}),h("longbow_manage_nft",{operation:{type:"string",enum:C,description:"Owner administration call: pause or unpause the protocol, update the admin fee or maximum loan duration, permit tokens, or manage ownership transfer."},value:A("Integer in base units of the setting, as a decimal string. updateAdminFee: basis points (50 = 0.5%, max 10000). updateMaximumLoanDuration: seconds (86400 = 1 day)."),account:{type:"string",description:"Address of the ERC-20 token for setERC20Permit, or of the proposed new owner for requestTransferOwnership."},enabled:{type:"boolean",description:"For setERC20Permit: true permits the token as a loan currency, false removes the permission."},tokens:{type:"array",maxItems:32,description:"For setERC20Permits: unique token addresses to update; pairs by position with permissions.",items:{type:"string",description:"ERC-20 token address."}},permissions:{type:"array",maxItems:32,description:"For setERC20Permits: true/false per token, same length and order as tokens.",items:{type:"boolean",description:"True permits the token at the same index as a loan currency."}}},["operation"],async(n,i)=>{if(typeof n.operation!="string"||!C.includes(n.operation))throw new r("Choose a documented NFT administration operation.");let c=await b(),e=n.operation,s=e.startsWith("update")?["operation","value"]:e==="setERC20Permit"?["operation","account","enabled"]:e==="setERC20Permits"?["operation","tokens","permissions"]:e==="requestTransferOwnership"?["operation","account"]:["operation"];if(Object.keys(n).some(o=>!s.includes(o)))throw new r("Unexpected fields for this NFT administration operation.");if(!["acceptTransferOwnership","rejectTransferOwnership"].includes(e)){let o=await c.readContract({address:u,abi:w,functionName:"owner"});if(f(o)!==f(i))throw new r("This wallet lacks the NFT loan owner role.")}let t=[];if(e.startsWith("update")){let o=P(n.value,!0);if(o>(e==="updateAdminFee"?10000n:(1n<<32n)-1n))throw new r("NFT fee/duration exceeds the contract limit.");t=[e==="updateAdminFee"?Number(o):o]}else if(e==="setERC20Permit"){if(typeof n.enabled!="boolean")throw new r("Provide enabled as a boolean.");t=[m(n.account),n.enabled]}else if(e==="setERC20Permits"){if(!Array.isArray(n.tokens)||!Array.isArray(n.permissions)||!n.tokens.length||n.tokens.length>32||n.tokens.length!==n.permissions.length||n.permissions.some(l=>typeof l!="boolean"))throw new r("Provide equal bounded token and permission arrays.");let o=n.tokens.map(m);if(new Set(o).size!==o.length)throw new r("Currency tokens must be unique.");t=[o,n.permissions]}else if(e==="requestTransferOwnership"){let o=m(n.account);if(o===R)throw new r("New owner must be nonzero.");t=[o]}let a=`Longbow NFT protocol administration ${e} on ${u}, values ${JSON.stringify(t,(o,l)=>typeof l=="bigint"?String(l):l)}. This changes protocol-wide settings or authority. Ownership acceptance/rejection requires the pending owner; the contract preview verifies that role. Permitting a currency here does not qualify it for Oak\u2019s borrower tools.`,y=[d.unsignedTx({to:u,data:E({abi:w,functionName:e,args:t}),value:"0",chainId:p,description:a})];return{txs:y,preview:await d.preview(y,i),summary:a}}),h("longbow_referral",{},[],async(n,i)=>{let c=await d.http(`https://longbow.credit/api/referral/stats/${f(i)}`,{method:"GET",redirect:"error"});if(!c.ok)throw new r(`Longbow referral service returned HTTP ${c.status}; referral state is unavailable.`);let e=await c.json();if(!e||typeof e!="object"||m(e.address)!==f(i))throw new r("Referral response does not match this wallet.");let s=a=>{if(typeof a!="number"||!Number.isSafeInteger(a)||a<0)throw new r("Invalid referral count.");return a},t=e.bonusEarnedAllTime;if(typeof t!="number"||!Number.isFinite(t)||t<0)throw new r("Invalid referral bonus estimate.");if(e.code!==null&&e.code!==void 0&&(typeof e.code!="string"||!/^[a-zA-Z0-9_-]{1,64}$/.test(e.code)))throw new r("Invalid referral code.");return{address:f(i),chainId:p,code:e.code??null,referrals:s(e.referrals),activeThisEpoch:s(e.activeThisEpoch),bonusEstimateUsd:t,source:"Longbow public referral service; off-chain estimates, not verified payments.",warning:k("Referral links are permanent according to the app. Registration/linking publishes wallet associations and requires a separate authorized publication flow. This tool only reads stats; no payout or claim is promised.")}})]}};export{w as a,S as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as T,f as re,g as B,i as ae,j as O}from"./X5AL3DUK.js";import{F as I,a as ee,b as oe,c as _,f as L,h as S,m as te,n as y,r as z,s as se,t as ne,v as ie}from"./WBNFRPAT.js";import{a as U}from"./YEIM6BZQ.js";import{f as W,g as Q}from"./ATEVAJ5Y.js";import{a as K}from"./Z7FGEWO2.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 we,getAddress as v,pad as de,parseAbi as fe,parseAbiParameters as Pe,toEventSelector as be,toHex as ce,zeroAddress as pe}from"viem";var ke=be("Initialize(bytes32,address,address,uint24,int24,address,uint160,int24)"),ye=Pe("uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick"),Ae=10000000n,Ie=10000n,me=25,X=200,R=16,ve=3e3,Ce=500,Se=500n,q=100,$=fe(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),_e=fe(["function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)"]);function Le(o){let e=o.trim().toLowerCase();return e==="eth"||e==="native"||e===pe||e===K.toLowerCase()}function le(o,e){if(o!=null){if(typeof o!="string")throw new b(`${e} must be a token address, or "eth" for native ETH.`);return Le(o)?{eth:!0}:(J(o),{eth:!1,address:v(o)})}}var he=(o,e)=>BigInt(o)<BigInt(e)?-1:BigInt(o)>BigInt(e)?1:0;function x(o){return{address:o.address,symbol:o.symbol,decimals:o.decimals}}async function ge(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:x(r),token1:x(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 H(o,e,r){let i=r??ne(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=ie(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:x(a),token1:x(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:e.hooks.toLowerCase()===Z.toLowerCase()?new te(se(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 Ne(o,e,r,i){let a=await o.getBlockNumber(),t=[],s=new Set,f=!1,n=Ae;for(let d=a;;){let u=d+1n>n?d-n+1n:0n,l;try{l=await o.request({method:"eth_getLogs",params:[{address:ee.toLowerCase(),topics:[ke,null,e?de(e):null,r?de(r):null],fromBlock:ce(u),toBlock:ce(d)}]})}catch(p){if(F(p,-32601)||n<=Ie)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]=we(ye,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 Ee(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]=he(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(re).map(Number)){let u=v(String(await o.readContract({address:T.factory,abi:ae,functionName:"getPool",args:[t,s,d]})));u!==pe&&w.push(await ge(o,u,f,n,d))}return w}function ue(o){return o?o.eth?[S,L]:o.address===L?[L,S]:[o.address]:null}async function Te(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+=R)(await Promise.allSettled(e.slice(i,i+R).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 Be(o,e,r,i){let a=ue(e),t=ue(r),s=new Map,f=(c,h)=>{if(c&&h){if(c===h)return;let[m,g]=he(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?ve:Ce,u=!1;for(let[c,h]of s.values()){let m=await Ne(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 Te(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+=R){let h=await Promise.allSettled(j.slice(c,c+R).map(({key:m,id:g})=>H(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 Oe(o,e){let r=y.find(n=>E(n.poolId,e));if(r)return H(o,r.key,r.poolId);let[i,a,t,s,f]=await o.readContract({address:oe,abi:_e,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 H(o,{currency0:i,currency1:a,fee:Number(t),tickSpacing:Number(s),hooks:f},e)}function qe(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=Q(BigInt(d.sqrtPriceX96),w);u>Se&&(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 Re(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?me:Number(e.limit);if(!Number.isInteger(i)||i<1||i>q)throw new b(`limit must be an integer from 1 to ${q}.`);let a=le(e.tokenA,"tokenA"),t=le(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 Oe(s,e.poolId)]}else if(a){if(r!=="v4"&&(t?n.push(...await Ee(s,a,t)):f.push("v3 pools are looked up per pair; pass tokenB to include them.")),r!=="v3")try{n.push(...await Be(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 ge(s,p.address,A,C,p.fee)})),P=await Promise.all(y.map(p=>H(s,p.key,p.poolId)));n=[...r==="v4"?[]:l,...r==="v3"?[]:P]}qe(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 ${q}) 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 ze(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:q,default:me}}},execute:async r=>Re(o,r)}]}}export{Re as a,ze as b};
|