@oakagentkit/core 0.2.6 → 0.2.7
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/chain.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/http.js +1 -1
- package/build/dist/api/metadata.js +1 -1
- package/build/dist/api/modules/beefy/boosts.js +1 -1
- package/build/dist/api/modules/beefy/clm.js +1 -1
- package/build/dist/api/modules/beefy/guard.js +1 -1
- package/build/dist/api/modules/beefy/index.js +1 -1
- package/build/dist/api/modules/beefy/liquidity.js +1 -1
- package/build/dist/api/modules/beefy/management.js +1 -1
- package/build/dist/api/modules/beefy/vaults.js +1 -1
- package/build/dist/api/modules/borro/actions.js +1 -1
- package/build/dist/api/modules/borro/checks.js +1 -1
- package/build/dist/api/modules/borro/copy.d.ts +15 -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/positions.js +1 -1
- package/build/dist/api/modules/borro/reader.js +1 -1
- 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/earn/copy.d.ts +32 -10
- 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/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.js +1 -1
- package/build/dist/api/modules/hoodag/management.js +1 -1
- package/build/dist/api/modules/hoodag/public-reads.js +1 -1
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/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.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/actions.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/lighter/index.js +1 -1
- package/build/dist/api/modules/longbow/administration.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-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.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/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/reads.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/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/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/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/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/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.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/prices.d.ts +3 -0
- package/build/dist/api/prices.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.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/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.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/{T7TFUH5K.js → 2E4I7CJ7.js} +1 -1
- package/build/dist/chunks/2FHELZ7Y.js +1 -0
- package/build/dist/chunks/2GXHYI23.js +1 -0
- package/build/dist/chunks/2LWBN35N.js +1 -0
- package/build/dist/chunks/{4HG6FRVH.js → 2OKYXT25.js} +1 -1
- package/build/dist/chunks/2SUHQWND.js +1 -0
- package/build/dist/chunks/2ZWKIBJT.js +1 -0
- package/build/dist/chunks/32RXFUOH.js +1 -0
- package/build/dist/chunks/3CH2IPQL.js +1 -0
- package/build/dist/chunks/3DNJTJ2X.js +1 -0
- package/build/dist/chunks/3K2N5VFH.js +1 -0
- package/build/dist/chunks/3VBIRLU3.js +1 -0
- package/build/dist/chunks/3ZABD6ZF.js +2 -0
- package/build/dist/chunks/44MB6SA6.js +1 -0
- package/build/dist/chunks/4D4ZRZUW.js +1 -0
- package/build/dist/chunks/{IPN6Z4JM.js → 4FPV4CRC.js} +1 -1
- package/build/dist/chunks/4GNUXN4K.js +1 -0
- package/build/dist/chunks/{K4DHHQBI.js → 4JRXEN7C.js} +2 -2
- package/build/dist/chunks/4JTTA3BX.js +1 -0
- package/build/dist/chunks/4OVIMYNH.js +2 -0
- package/build/dist/chunks/{7QIO77VE.js → 4Q2ZBZXM.js} +1 -1
- package/build/dist/chunks/4RQAOOO2.js +1 -0
- package/build/dist/chunks/4TTDAF4B.js +1 -0
- package/build/dist/chunks/523ZIR3J.js +1 -0
- package/build/dist/chunks/5DPJQCKJ.js +68 -0
- package/build/dist/chunks/5HIHUYA4.js +1 -0
- package/build/dist/chunks/5PI57UC2.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/5XAXJEWM.js +5 -0
- package/build/dist/chunks/67BWOVET.js +1 -0
- package/build/dist/chunks/6NUNCD5J.js +1 -0
- package/build/dist/chunks/{FJ4S4GHY.js → 6PZGDVHV.js} +1 -1
- package/build/dist/chunks/{RTAHNWHN.js → 6UVGQYZ3.js} +1 -1
- package/build/dist/chunks/753HZZTY.js +1 -0
- package/build/dist/chunks/7D73A6KS.js +1 -0
- package/build/dist/chunks/7MBVTNLU.js +1 -0
- package/build/dist/chunks/7QKYDNF6.js +18 -0
- package/build/dist/chunks/7VC53B5X.js +70 -0
- package/build/dist/chunks/7VNO46LV.js +1 -0
- package/build/dist/chunks/ACH4BSME.js +3 -0
- package/build/dist/chunks/AHUCYDBC.js +1 -0
- package/build/dist/chunks/AI3VAPA3.js +1 -0
- package/build/dist/chunks/AMTRDPVO.js +1 -0
- package/build/dist/chunks/APHNOGNS.js +1 -0
- package/build/dist/chunks/{BND2UFVW.js → ARI72OYT.js} +1 -1
- package/build/dist/chunks/ARLGF5MU.js +1 -0
- package/build/dist/chunks/BAIY32AV.js +1 -0
- package/build/dist/chunks/BB765L75.js +3 -0
- package/build/dist/chunks/BE3A7677.js +1 -0
- package/build/dist/chunks/{PAY5PD4H.js → BX46C5ZP.js} +1 -1
- package/build/dist/chunks/{XL3LLGIR.js → BZ34ZR65.js} +1 -1
- package/build/dist/chunks/C3WBHFLX.js +1 -0
- package/build/dist/chunks/C75MT5SD.js +1 -0
- package/build/dist/chunks/CAWTAR5V.js +1 -0
- package/build/dist/chunks/CNLL4NCR.js +1 -0
- package/build/dist/chunks/CO4GCF4L.js +1 -0
- package/build/dist/chunks/{P5PYFK7L.js → CQ5WRWV4.js} +1 -1
- package/build/dist/chunks/{SJJR4ZBZ.js → CSDN4MYP.js} +1 -1
- package/build/dist/chunks/CSOO4SW7.js +1 -0
- package/build/dist/chunks/CZL6T2ZQ.js +1 -0
- package/build/dist/chunks/D742AYEV.js +1 -0
- package/build/dist/chunks/DGCJZ3HO.js +1 -0
- package/build/dist/chunks/DNNFKDZR.js +1 -0
- package/build/dist/chunks/DPE7SPW7.js +1 -0
- package/build/dist/chunks/DSTMEY5F.js +1 -0
- package/build/dist/chunks/{FUDAXV5X.js → DYYEA5HB.js} +1 -1
- package/build/dist/chunks/EFESPGA2.js +1 -0
- package/build/dist/chunks/EGZREEG2.js +1 -0
- package/build/dist/chunks/EH5G4O3U.js +1 -0
- package/build/dist/chunks/EI6GGPDS.js +20 -0
- package/build/dist/chunks/EVBHQQQG.js +1 -0
- package/build/dist/chunks/EZZM2GQT.js +2 -0
- package/build/dist/chunks/F3VDVTMS.js +1 -0
- package/build/dist/chunks/F4UQEPJT.js +1 -0
- package/build/dist/chunks/FHTNMGFR.js +1 -0
- package/build/dist/chunks/FJLJ7ZQ5.js +1 -0
- package/build/dist/chunks/{WP6RHXGN.js → FL5SSHUL.js} +1 -1
- package/build/dist/chunks/FNGIJKMZ.js +1 -0
- package/build/dist/chunks/{KIFZ5ZSK.js → FOD34G2H.js} +1 -1
- package/build/dist/chunks/{WV3A3OUU.js → FOKEFXGP.js} +1 -1
- package/build/dist/chunks/FV4WZOTD.js +1 -0
- package/build/dist/chunks/FWIFTPSE.js +2 -0
- package/build/dist/chunks/FZ6IJZZM.js +1 -0
- package/build/dist/chunks/G2LAO23N.js +1 -0
- package/build/dist/chunks/GDRQ2ANN.js +1 -0
- package/build/dist/chunks/GG24LO2R.js +1 -0
- package/build/dist/chunks/GLF7WEY2.js +1 -0
- package/build/dist/chunks/GQ3XZFRL.js +1 -0
- package/build/dist/chunks/{QU5XKRGK.js → GQYV4TFO.js} +1 -1
- package/build/dist/chunks/GRSXWQWD.js +1 -0
- package/build/dist/chunks/{DL6AEWEM.js → GSFHM5L3.js} +1 -1
- package/build/dist/chunks/{QHBS3PVU.js → H5DY7CNB.js} +1 -1
- package/build/dist/chunks/HCBX4NFM.js +1 -0
- package/build/dist/chunks/HHO5ISMM.js +1 -0
- package/build/dist/chunks/HIX5N25Z.js +1 -0
- package/build/dist/chunks/HKVQ646Q.js +1 -0
- package/build/dist/chunks/IEG6GLFR.js +1 -0
- package/build/dist/chunks/INOYMBWE.js +1 -0
- package/build/dist/chunks/IV4K7FMD.js +1 -0
- package/build/dist/chunks/{PIIHOXWF.js → J73ATSEQ.js} +1 -1
- package/build/dist/chunks/JBTOZ6IH.js +1 -0
- package/build/dist/chunks/JESMX2UC.js +1 -0
- package/build/dist/chunks/JJGZ7W3V.js +1 -0
- package/build/dist/chunks/JKRBGAX2.js +1 -0
- package/build/dist/chunks/JLRHM2DQ.js +1 -0
- package/build/dist/chunks/JOKL5L6X.js +1 -0
- package/build/dist/chunks/JS53DQVT.js +1 -0
- package/build/dist/chunks/{WIRBCS4W.js → JWR5XVP2.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/{2VXLVXIB.js → KDGSYNOP.js} +1 -1
- package/build/dist/chunks/KKPMOAVI.js +1 -0
- package/build/dist/chunks/KREBNL2D.js +1 -0
- package/build/dist/chunks/L646YWDP.js +1 -0
- package/build/dist/chunks/{GSBIERZD.js → LR4XTZ37.js} +1 -1
- package/build/dist/chunks/LVFI74ST.js +1 -0
- package/build/dist/chunks/{QBIY6FQN.js → M7ZXDLKM.js} +1 -1
- package/build/dist/chunks/MVD3KWPP.js +1 -0
- package/build/dist/chunks/N245WC5R.js +1 -0
- package/build/dist/chunks/{WTXC3XKW.js → N4XNNXOJ.js} +1 -1
- package/build/dist/chunks/N6GIC7HJ.js +1 -0
- package/build/dist/chunks/{RUC7KH7A.js → NA424YAL.js} +1 -1
- package/build/dist/chunks/NUFZUKYS.js +1 -0
- package/build/dist/chunks/{XD6X3KTC.js → O3JWCJIF.js} +1 -1
- package/build/dist/chunks/OARVU3RC.js +1 -0
- package/build/dist/chunks/OEZ7FCLF.js +1 -0
- package/build/dist/chunks/{H43RNCX2.js → OUROA7XR.js} +1 -1
- package/build/dist/chunks/{2MT3G7YZ.js → OYJFXEDU.js} +1 -1
- package/build/dist/chunks/OYPAVXGQ.js +1 -0
- package/build/dist/chunks/{SMYWWIE6.js → OZ5MDUD2.js} +1 -1
- package/build/dist/chunks/P6OMKZMR.js +3 -0
- package/build/dist/chunks/PV4AK32X.js +1 -0
- package/build/dist/chunks/{HKEMQBFA.js → PXVREXCS.js} +1 -1
- package/build/dist/chunks/PZEF5LBL.js +2 -0
- package/build/dist/chunks/Q2ACLVWR.js +1 -0
- package/build/dist/chunks/QFSBDPLN.js +1 -0
- package/build/dist/chunks/QJNLLI6N.js +1 -0
- package/build/dist/chunks/QMZEGT5B.js +1 -0
- package/build/dist/chunks/{PNA6UIE5.js → REWXG6X6.js} +1 -1
- package/build/dist/chunks/{ALLLYOUG.js → RLI4JDOL.js} +1 -1
- package/build/dist/chunks/{UD2XMNIT.js → RLMVA575.js} +1 -1
- package/build/dist/chunks/RPB46QAC.js +1 -0
- package/build/dist/chunks/{Q42YI3EP.js → RT7IU6TI.js} +1 -1
- package/build/dist/chunks/{ER47KGRM.js → SBY4RJ7I.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/SKEKXEUU.js +1 -0
- package/build/dist/chunks/SOTYQGPT.js +1 -0
- package/build/dist/chunks/SZ466I5X.js +1 -0
- package/build/dist/chunks/{GNC6RXLT.js → TDZTC5WR.js} +1 -1
- package/build/dist/chunks/TE6D3OIX.js +1 -0
- package/build/dist/chunks/TID4C2KC.js +1 -0
- package/build/dist/chunks/TK55VASJ.js +2 -0
- package/build/dist/chunks/TM7Z5SA4.js +1 -0
- package/build/dist/chunks/TNJTET4G.js +1 -0
- package/build/dist/chunks/TPEKCXVE.js +1 -0
- package/build/dist/chunks/TVIMP5CK.js +1 -0
- package/build/dist/chunks/U2YCQWZK.js +1 -0
- package/build/dist/chunks/U363GQTF.js +1 -0
- package/build/dist/chunks/{U4JGEMKT.js → UEDGYZOC.js} +1 -1
- package/build/dist/chunks/UOCRYXAB.js +1 -0
- package/build/dist/chunks/UQEEF5W5.js +1 -0
- package/build/dist/chunks/{QQECG3WP.js → UUID2E22.js} +1 -1
- package/build/dist/chunks/UWBKAWX3.js +7 -0
- package/build/dist/chunks/V37L4DU4.js +1 -0
- package/build/dist/chunks/VR344DAZ.js +1 -0
- package/build/dist/chunks/{TX2EOIRS.js → VST6LFUB.js} +1 -1
- package/build/dist/chunks/VTPT5544.js +1 -0
- package/build/dist/chunks/VVWFB53Q.js +1 -0
- package/build/dist/chunks/WHTRPRRD.js +1 -0
- package/build/dist/chunks/WHVZ372B.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/WUT7TZYM.js +1 -0
- package/build/dist/chunks/XCKTE4ON.js +1 -0
- package/build/dist/chunks/XEPCDGN2.js +1 -0
- package/build/dist/chunks/XHYFISVV.js +1 -0
- package/build/dist/chunks/XPEDQBLI.js +1 -0
- package/build/dist/chunks/{QFNT73OF.js → XQ24RSEI.js} +1 -1
- package/build/dist/chunks/XRDXFHIK.js +1 -0
- package/build/dist/chunks/XTFRPI4G.js +1 -0
- package/build/dist/chunks/XVJ7ILKK.js +1 -0
- package/build/dist/chunks/XWKK75TO.js +1 -0
- package/build/dist/chunks/{CBLMQ5UU.js → XYPGLG6A.js} +1 -1
- package/build/dist/chunks/Y77EVVT4.js +1 -0
- package/build/dist/chunks/YEIM6BZQ.js +1 -0
- package/build/dist/chunks/{XSKFKBDR.js → YMV5TL5C.js} +1 -1
- package/build/dist/chunks/YSMWCKIX.js +1 -0
- package/build/dist/chunks/YTLH4M4Y.js +1 -0
- package/build/dist/chunks/YUHNPUNK.js +1 -0
- package/build/dist/chunks/YWZQJJYY.js +1 -0
- package/build/dist/chunks/{EGYVRQUR.js → ZF2VPDRQ.js} +1 -1
- package/build/dist/chunks/ZFU65MB4.js +1 -0
- package/build/dist/chunks/ZKZUS3QU.js +1 -0
- package/build/dist/chunks/ZOMFHTB2.js +1 -0
- package/build/dist/chunks/{OLSP46ZD.js → ZP36DSOD.js} +1 -1
- package/build/dist/chunks/ZQ6AF3VX.js +1 -0
- 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/FEYAY6OZ.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/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/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/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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as pe,c as me}from"./WV3A3OUU.js";import{a as ue}from"./SPJCSEKP.js";import{a as be}from"./43LI5NKJ.js";import{c as le}from"./VEQBHI6O.js";import{a as O}from"./66F5ZH34.js";import{c as Y,d as oe,g as I,i as fe,m as re,n as se}from"./NWNYJ26T.js";import{a as S,i as de,j as ie}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{decodeFunctionData as J,encodeFunctionData as T,erc20Abi as te,getAddress as Ce,keccak256 as he,parseAbi as P}from"viem";var q={chainId:4663,observedAt:"2026-11-04T21:56:26.556Z",block:"106231118",routeBlock:"106231118",sources:["https://rpc.mainnet.chain.robinhood.com","https://raw.githubusercontent.com/beefyfinance/cowcentrated-subgraph/main/abis/beefy/clm/ClmManager.json","https://raw.githubusercontent.com/beefyfinance/beefy-v2/main/src/features/data/apis/beefy/beefy-clm-pool.ts"],markets:{v3:{router:"0xCaf681a66D020601342297493863E78C959E5cb2",quoter:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA"},cl:{router:"0xC062b870E813fcA720f1e002c234369Ab3aB9415",quoter:"0x03983AB2C057a2eac211ff01738a1e49ff325B49",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3"}},vaults:[{id:"up33-cow-robinhood-cashcat-weth-vault",vault:"0x25012D654bF9107B6E0Af0248656fEf0b718dBd3",manager:"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x020bfC650A365f8BB26819deAAbF3E21291018b4","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"],strategy:"0xd7F3bCDAfCFf0018953BB6944Db2683Ff2e42b07",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x4E8649Be40aE67EBbcff99C291B92eE03015917b",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-usdg-net-vault",vault:"0x25B418FcFe8543c25AD9d78246839E5Cf3a3b50D",manager:"0x5A725556514222d0cc81501A9294a3135b7C41C4",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168","0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf"],strategy:"0x89207bED2935C64d6cb105E9C85E0E2ED99DD8f2",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},{id:"up33-cow-robinhood-weth-stonkbroker-vault",vault:"0x544c7Ef9265dc08d93B5394116E68aE7D9e60730",manager:"0x5794bB61E83397049c40D87BbF3d44AF583A27Ce",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0xe934e36A439C94017B64a3FecE66AF12099aBF50"],strategy:"0x54Bd0805f549708144C811c14DdEeC0714CA5e0c",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-weth-up-vault",vault:"0x56EA4b4AFAFbb87CFD8Fd8a0266a2F86561677b8",manager:"0x36759534741E28Eb052238738963D684bFe719E4",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x57C0E45cB534413D1C20A4240955d6bB250BB4F1"],strategy:"0x8337c691C3afA52ccE418178e52ed472F034Cb8b",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x23D641FeCcD207E8794c593e8240444A0674C4Ba",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-weth-frong-vault",vault:"0x75588e48f7b4Ed9365d78C6cD509f3C7B804Ca47",manager:"0x9818f01EDCcc3d8EB86B859931C3B877cf44A108",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x6245e67affA44a23077f0Ea7f981a8DC743a0c47"],strategy:"0xdB739d906CD5101b65E089a284ec13a3ab21F603",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x9334BbCBE77C0883d704f71Db35CCF636639334c",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-usdg-intc-vault",vault:"0x8353c496114CF66D10545fdc2B4e6dFBafd37e3b",manager:"0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168","0xc72b96e0E48ecd4DC75E1e45396e26300BC39681"],strategy:"0xbaEE86C9D7dE9dc192f17dFA62833B601Dc64D23",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:60,bridge:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},{id:"up33-cow-robinhood-weth-tendies-vault",vault:"0x97DCDc29a3B3e2F556564279f7D09eE40eB74E45",manager:"0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x45242320DBB855EeA8Fd36804C6487E10E97FCF9"],strategy:"0x9a02CaA8a2e63659f8A419a29a3B48baD86d3c7a",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0xD53a623c17A5853838FA140cE5706eA008565dA8",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"}],routes:[{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x020bfC650A365f8BB26819deAAbF3E21291018b4",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c8020bfc650a365f8bb26819deaabf3e21291018b4",pools:["0x4E8649Be40aE67EBbcff99C291B92eE03015917b"]},{from:"0x020bfC650A365f8BB26819deAAbF3E21291018b4",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x020bfc650a365f8bb26819deaabf3e21291018b40000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x4E8649Be40aE67EBbcff99C291B92eE03015917b"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf",kind:"cl",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d1680000c8ca9c78dd337a67f6e0077f65f5e9218719d30edf",pools:["0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673"]},{from:"0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"cl",path:"0xca9c78dd337a67f6e0077f65f5e9218719d30edf0000c85fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0xe934e36A439C94017B64a3FecE66AF12099aBF50",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c8e934e36a439c94017b64a3fece66af12099abf50",pools:["0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c"]},{from:"0xe934e36A439C94017B64a3FecE66AF12099aBF50",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0xe934e36a439c94017b64a3fece66af12099abf500000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x57C0E45cB534413D1C20A4240955d6bB250BB4F1",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c857c0e45cb534413d1c20a4240955d6bb250bb4f1",pools:["0x23D641FeCcD207E8794c593e8240444A0674C4Ba"]},{from:"0x57C0E45cB534413D1C20A4240955d6bB250BB4F1",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x57c0e45cb534413d1c20a4240955d6bb250bb4f10000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x23D641FeCcD207E8794c593e8240444A0674C4Ba"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x6245e67affA44a23077f0Ea7f981a8DC743a0c47",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c86245e67affa44a23077f0ea7f981a8dc743a0c47",pools:["0x9334BbCBE77C0883d704f71Db35CCF636639334c"]},{from:"0x6245e67affA44a23077f0Ea7f981a8DC743a0c47",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x6245e67affa44a23077f0ea7f981a8dc743a0c470000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x9334BbCBE77C0883d704f71Db35CCF636639334c"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",kind:"cl",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d16800003cc72b96e0e48ecd4dc75e1e45396e26300bc39681",pools:["0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67"]},{from:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"cl",path:"0xc72b96e0e48ecd4dc75e1e45396e26300bc3968100003c5fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x45242320DBB855EeA8Fd36804C6487E10E97FCF9",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c845242320dbb855eea8fd36804c6487e10e97fcf9",pools:["0xD53a623c17A5853838FA140cE5706eA008565dA8"]},{from:"0x45242320DBB855EeA8Fd36804C6487E10E97FCF9",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x45242320dbb855eea8fd36804c6487e10e97fcf90000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0xD53a623c17A5853838FA140cE5706eA008565dA8"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"v3",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d1680000640bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"v3",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000645fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca"]}],codeHashes:{"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C":"0x6f2a1713cbceba31cc630dddda1ef99cd35086c96005f3c9ea015f9a8e53e613","0xd7F3bCDAfCFf0018953BB6944Db2683Ff2e42b07":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xfD7EE9D17BD6941bF8e612281ec23E857134BB92":"0x9cc155dd143657bba37e6a51fa28e78158e3f47454acdcebedc0512e3803d0fc","0xF5331Dc29A1FDe4b22d7F168661584B057228683":"0x9f1e0f8e488165740c5ab91a3da1bea1a75eeef607ea37b32296ad465971344c","0x4E8649Be40aE67EBbcff99C291B92eE03015917b":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3":"0x4350c8fcdf90361969542249d76c25d6afbd31f10bebf0134bfe21beba1e8f4c","0x5A725556514222d0cc81501A9294a3135b7C41C4":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x89207bED2935C64d6cb105E9C85E0E2ED99DD8f2":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x5794bB61E83397049c40D87BbF3d44AF583A27Ce":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x54Bd0805f549708144C811c14DdEeC0714CA5e0c":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x36759534741E28Eb052238738963D684bFe719E4":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x8337c691C3afA52ccE418178e52ed472F034Cb8b":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x23D641FeCcD207E8794c593e8240444A0674C4Ba":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x9818f01EDCcc3d8EB86B859931C3B877cf44A108":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xdB739d906CD5101b65E089a284ec13a3ab21F603":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x9334BbCBE77C0883d704f71Db35CCF636639334c":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xbaEE86C9D7dE9dc192f17dFA62833B601Dc64D23":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x9a02CaA8a2e63659f8A419a29a3B48baD86d3c7a":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xD53a623c17A5853838FA140cE5706eA008565dA8":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0xCaf681a66D020601342297493863E78C959E5cb2":"0x6f36c378e272c6324c48f045182bcb54bd8ad654cf9ebd42e8893d52c4cb25dc","0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7":"0x3db0868d945e9304c9bc6a8b2181948109ea617647142f3c4083e14393496a28","0x1f7d7550B1b028f7571E69A784071F0205FD2EfA":"0xec72b1abd1f2faee020cfea9c646bd8994f9fb389054f6e574f103a895091739","0xC062b870E813fcA720f1e002c234369Ab3aB9415":"0x11ea7d3599ef56eda32c0ce7ca26e9aae71bec13bfcbd3ad0e83826c1a2defe4","0x03983AB2C057a2eac211ff01738a1e49ff325B49":"0x1ed81396c831d69a6c59384019850c21ac672d24ae83b4b26304a7384e1e4096","0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca":"0x3298b5dd4e6f115074c526a55ad05a36fd73a0034ac22ec6cbaab32cc9c1e8d2","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73":"0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353","0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3":"0xa2cf7f366f3d8d11e611acecf7916a27308ba041bf1e161bddbd4ecbb9402b6a","0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6":"0xd6f09e63327b36d3c498f8de8768bd3e4336894cd00ddb36aa9e0a1e4a4c911e"},delegates:{"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x4E8649Be40aE67EBbcff99C291B92eE03015917b":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x5A725556514222d0cc81501A9294a3135b7C41C4":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x5794bB61E83397049c40D87BbF3d44AF583A27Ce":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x36759534741E28Eb052238738963D684bFe719E4":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x23D641FeCcD207E8794c593e8240444A0674C4Ba":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x9818f01EDCcc3d8EB86B859931C3B877cf44A108":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x9334BbCBE77C0883d704f71Db35CCF636639334c":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0xD53a623c17A5853838FA140cE5706eA008565dA8":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3"},qualificationHistory:[{observedAt:"2026-10-31",block:"102927065",routeBlock:"102928782",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",implementationHash:"0x9f1e0f8e488165740c5ab91a3da1bea1a75eeef607ea37b32296ad465971344c"}],blockHash:"0xcb0e2862c6e22ca5854fb9264995749e497eb26f05a3370202db69909b891c47"};var De=q.vaults,we=["beefy_clm_swap","beefy_clm_deposit","beefy_clm_withdraw"],X=P(["function wants() view returns(address,address)","function strategy() view returns(address)","function want() view returns(address)","function implementation() view returns(address)","function pool() view returns(address)","function vault() view returns(address)","function price() view returns(uint256)","function paused() view returns(bool)","function isCalm() view returns(bool)","function actionableAt() view returns(uint256)","function token0() view returns(address)","function token1() view returns(address)","function factory() view returns(address)","function tickSpacing() view returns(int24)","function balances() view returns(uint256,uint256)","function previewDeposit(uint256,uint256) view returns(uint256 shares,uint256 amount0,uint256 amount1,uint256 fee0,uint256 fee1)","function previewWithdraw(uint256) view returns(uint256,uint256)","function deposit(uint256 amount0,uint256 amount1,uint256 minShares)","function withdraw(uint256 shares,uint256 minAmount0,uint256 minAmount1)"]),ce=P(["function exactInput((bytes path,address recipient,uint256 deadline,uint256 amountIn,uint256 amountOutMinimum)) payable returns(uint256)"]),W=P(["function exactInput((bytes path,address recipient,uint256 amountIn,uint256 amountOutMinimum)) payable returns(uint256)","function multicall(uint256 deadline,bytes[] data) payable returns(bytes[])"]),Fe=P(["function quoteExactInput(bytes path,uint256 amountIn) returns(uint256,uint160[],uint32[],uint256)"]),ge={cl:P(["function getPool(address,address,int24) view returns(address)"]),v3:P(["function getPool(address,address,uint24) view returns(address)"])},ye=P(["function deposit() payable"]),Z={vault:Y,chainId:{const:S},slippageBps:{type:"integer",minimum:0,maximum:500}},Be=10n**36n,z=Ce(de[S].uniswap.WETH.address),ve="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",ke=Object.fromEntries(Object.entries(q.codeHashes).map(([d,s])=>[d.toLowerCase(),s])),Ae=Object.fromEntries(Object.entries(q.delegates).map(([d,s])=>[d.toLowerCase(),s]));function f(d){return fe(d,"Provide a token or vault address.",oe)}function F(d){return re(d,"Invalid Beefy CLM integer.")}function G(d,s=!1){return se(d,"Provide a positive amount that fits uint256.",{notString:"Provide a decimal base-unit integer string.",positive:!s})}function K(d){let s=d??50;if(typeof s!="number"||!Number.isInteger(s)||s<0||s>500)throw new o("Use integer slippageBps from 0 to 500.");return BigInt(s)}function Q(d,s){let m=d*(10000n-s)/10000n;if(m<=0n)throw new o("This CLM amount is too small for a positive output minimum.");return m}function ne(d,s){if(!Array.isArray(d)||d.length!==s)throw new o("Invalid Beefy CLM quote.");return d.map(F)}function Se(d){let s=f(d),m=De.find(b=>I(b.vault,s));if(!m)throw new o("This vault has no qualified Beefy CLM route. Use beefy_withdraw to return existing vault shares to their want; redeem that want through the project app if Oak has no qualified redemption route.");return m}function Me(d,s,m,b,C){if(d<=0n||m<=0n||b<0n||C<0n)throw new o("The CLM price or budget is invalid.");let E=s?d*m/Be:d;if(E===0n)throw new o("The CLM budget is too small at the current pool price.");let e=b*m/Be,t=C>e?C-e:e-C,a=E<t?E:t,r=(E-a)/2n,c=d*(C>e?a+r:r)/E;return[c,d-c]}var Ee=d=>{async function s(e){try{return await e()}catch(t){throw new o(d.plainError(t))}}function m(e,t){if(e.chainId!==void 0&&e.chainId!==S)throw new o("Beefy CLM requires chain 4663.");for(let a of Object.keys(e))if(!["vault","chainId",...t].includes(a))throw new o(`Unsupported Beefy CLM input: ${a}.`);return Se(e.vault)}async function b(e,t){be(t);let a=d.clientFor(S);if(await a.getChainId()!==S)throw new o("The Beefy CLM endpoint must report chain 4663.");let r=F(await a.getBlockNumber()),c=await a.getBlock({blockNumber:r}),n=(B,p,A=[])=>a.readContract({address:f(B),abi:X,functionName:p,args:A,blockNumber:r}),i=new Set;async function l(B){let p=B.toLowerCase();if(i.has(p))return;let A=ke[p];if(!A)throw new o("Unqualified Beefy CLM dependency; no transaction was built.");let D=await a.getCode({address:f(B),blockNumber:r});if(!D||he(D)!==A)throw new o("A Beefy CLM contract or delegated implementation no longer matches its pinned code.");i.add(p),Ae[p]&&await l(Ae[p])}await me(a,f(e.vault),r);for(let B of[e.manager,e.strategy,e.beacon,e.implementation,e.pool,e.factory])await l(B);let[g,u,y,x,h,k,w,M,R,ee]=await Promise.all([n(e.vault,"want"),n(e.manager,"wants"),n(e.manager,"strategy"),n(e.beacon,"implementation"),n(e.strategy,"pool"),n(e.strategy,"vault"),n(e.pool,"token0"),n(e.pool,"token1"),n(e.pool,"factory"),n(e.pool,"tickSpacing")]);if(f(g)!==e.manager||!Array.isArray(u)||u.length!==2||u.some((B,p)=>f(B)!==e.wants[p])||f(y)!==e.strategy||f(x)!==e.implementation||f(h)!==e.pool||f(k)!==e.manager||f(w)!==e.wants[0]||f(M)!==e.wants[1]||f(R)!==e.factory||ee!==e.tickSpacing)throw new o("The Beefy CLM want, tokens, strategy, beacon or pool differs from its qualified deployment.");let V=async B=>F(await a.readContract({address:f(B),abi:te,functionName:"balanceOf",args:[t],blockNumber:r}));async function ae(B){let p=f(B),[A,D]=await Promise.all([a.readContract({address:p,abi:te,functionName:"symbol",blockNumber:r}),a.readContract({address:p,abi:te,functionName:"decimals",blockNumber:r})]);if(typeof A!="string"||!A.trim()||!Number.isInteger(D)||D<0||D>255)throw new o("Invalid CLM token metadata.");return{address:p,symbol:A,decimals:D,chainId:S}}async function U(){let p=(await le(d.http,"https://api.beefy.finance/vaults",{},v=>Array.isArray(v)&&v.every($=>$!==null&&typeof $=="object"))).filter(v=>v.chain==="robinhood"&&typeof v.earnContractAddress=="string"&&I(v.earnContractAddress,e.vault)),A=p[0],D=pe(f(e.vault));if(p.length!==1||!A||A.id!==D.id||A.type!=="standard"||f(A.tokenAddress)!==e.manager||A.tokenDecimals!==18)throw new o("The Beefy API and qualified CLM vault disagree.");if(A.status!=="active")throw new o(`Beefy marks this vault ${String(A.status)}; deposits are unavailable. Exit with beefy_withdraw, redeem the returned CLM shares with beefy_clm_withdraw, then swap the received tokens to USDG with beefy_clm_swap.`);let L=f(await n(e.vault,"strategy")),_=await Promise.all([n(L,"paused"),n(e.strategy,"paused")]);if(_.some(v=>typeof v!="boolean"))throw new o("Invalid Beefy strategy pause flag.");if(_.some(Boolean))throw new o("The Beefy strategy is paused; deposits are unavailable. Exit with beefy_withdraw, redeem CLM shares with beefy_clm_withdraw, then convert the tokens to USDG with beefy_clm_swap.");if(await n(e.manager,"isCalm")!==!0)throw new o("The CLM pool is not calm; wait and request a fresh deposit preview.")}async function N(B,p){let A=new Set([...e.wants,f(ie),z]);if(!A.has(B)||!A.has(p)||B===p)throw new o("Use this CLM pair or the USDG/WETH conversion route, with different input and output tokens.");let D=q.routes.find(H=>H.from===B&&H.to===p&&(H.pools[0]===e.pool||H.kind==="v3"));if(!D)throw new o("No qualified direct CLM route for this token pair. Convert through the CLM bridge token in separately mined steps.");let L=q.markets[D.kind];for(let H of[L.router,L.quoter,L.factory,...D.pools])await l(H);let _=D.path;if(_.length!==88||f(_.slice(0,42))!==B||f(`0x${_.slice(-40)}`)!==p)throw new o("Invalid qualified CLM swap path.");let v=Number.parseInt(_.slice(42,48),16),$=await a.readContract({address:f(L.factory),abi:ge[D.kind],functionName:"getPool",args:[B,p,v],blockNumber:r});if(f($)!==D.pools[0])throw new o("The swap factory no longer selects the qualified CLM pool.");if(f(await n(L.quoter,"factory"))!==L.factory)throw new o("The CLM quoter factory differs from its pin.");return D}async function j(B,p,A){let D=await N(B,p),L=q.markets[D.kind],_=await a.simulateContract({address:f(L.quoter),abi:Fe,functionName:"quoteExactInput",args:[D.path,A],account:t,blockNumber:r}),v=F(_.result[0]);if(v===0n)throw new o("No positive quote for this CLM swap.");return{selected:D,market:L,out:v}}return{client:a,blockNumber:r,deadline:c.timestamp+600n,read:n,balance:V,token:ae,code:l,entryAvailable:U,quote:j}}function C(e,t,a,r="0"){return d.unsignedTx({to:f(e),data:t,description:a,value:r,chainId:S})}async function E(e,t,a){let r=await d.preview(e,t);return{txs:e,preview:r,summary:`${a} Re-read actual balances after every mined step. Calls are separate transactions; earlier steps can remain mined if a later step fails. Confirm the local preview. Gas is additional.`}}return{tools:[{name:"beefy_lp",inputSchema:{type:"object",properties:{...Z,amount:{...O(),description:"Optional entry budget in the CLM bridge token base units (USDG or WETH)."}},required:["vault"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["amount","slippageBps"]),r=K(e.slippageBps),c=await b(a,t),[n,i,l,g,u,y,x,h]=await Promise.all([c.token(a.wants[0]),c.token(a.wants[1]),c.token(a.manager),c.balance(a.wants[0]),c.balance(a.wants[1]),c.balance(a.manager),c.read(a.manager,"balances"),c.read(a.strategy,"price")]),k;if(e.amount!==void 0){await c.entryAvailable();let w=G(e.amount),[M,R]=ne(x,2),ee=Me(w,a.bridge===n.address,F(h),M,R),V=[];for(let[ae,U]of[n,i].entries()){let N=ee[ae],j=N===0n||U.address===a.bridge?N:(await c.quote(f(a.bridge),U.address,N)).out;V.push({token:U,bridgeAmount:N.toString(),expectedAmount:j.toString(),minimumAmount:j===0n?"0":Q(j,r).toString(),swapRequired:N>0n&&U.address!==a.bridge})}k={bridge:await c.token(a.bridge),budget:w.toString(),inputs:V,source:"strategy.price() and CLM balances(); imbalance first, then split remaining value equally. Re-quote after mining swaps."}}return{chainId:S,vault:a.vault,manager:a.manager,bridge:await c.token(a.bridge),constituents:[{token:n,balance:g.toString()},{token:i,balance:u.toString()}],shares:{token:l,amount:y.toString()},entryPlan:k,block:c.blockNumber.toString(),summary:"Convert USDG or ETH to the bridge token with beefy_clm_swap. Use entryPlan to acquire the current deposit ratio, including a one-sided ratio when appropriate. Deposit actual balances with beefy_clm_deposit, then deposit mined CLM shares with beefy_deposit. Exit with beefy_withdraw, beefy_clm_withdraw, then beefy_clm_swap through the bridge token to USDG."}})},{name:"beefy_clm_swap",inputSchema:{type:"object",properties:{...Z,from:Y,to:Y,amount:O()},required:["vault","from","to","amount"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["from","to","amount","slippageBps"]),r=K(e.slippageBps),c=f(e.from),n=f(e.to),i=G(e.amount),l=c.toLowerCase()===ve,g=l?z:c,u=await b(a,t);if((l?await u.client.getBalance({address:t,blockNumber:u.blockNumber}):await u.balance(c))<i)throw new o("Insufficient CLM swap balance; keep ETH for gas.");let y=[];l&&(await u.code(z),y.push(C(z,T({abi:ye,functionName:"deposit"}),"Wrap exactly the requested ETH for the CLM workflow.",i.toString())));let x=i,h=i;if(g!==n){let w=await u.quote(g,n,i);x=w.out,h=Q(x,r),y.push(d.approval(g,f(w.market.router),i.toString(),S));let M={path:w.selected.path,recipient:t,amountIn:i,amountOutMinimum:h},R=w.selected.kind==="cl"?T({abi:ce,functionName:"exactInput",args:[{...M,deadline:u.deadline}]}):T({abi:W,functionName:"multicall",args:[u.deadline,[T({abi:W,functionName:"exactInput",args:[M]})]]});y.push(C(w.market.router,R,`Swap exact input with at least ${h} output base units to the calling wallet.`))}else if(!l)throw new o("The CLM swap requires different input and output tokens.");let k=await u.token(n);return{...await E(y,t,"Swap qualified CLM constituents. Venue fees are included in the quote."),output:{token:k,amount:x.toString()},minimumOutput:{token:k,amount:h.toString()},deadline:u.deadline.toString()}})},{name:"beefy_clm_deposit",inputSchema:{type:"object",properties:{...Z,amount0:O(),amount1:O()},required:["vault","amount0","amount1"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["amount0","amount1","slippageBps"]),r=K(e.slippageBps),c=G(e.amount0,!0),n=G(e.amount1,!0);if(c===0n&&n===0n)throw new o("At least one CLM deposit amount must be positive.");let i=await b(a,t);if(await i.entryAvailable(),await i.balance(a.wants[0])<c||await i.balance(a.wants[1])<n)throw new o("Acquire the CLM constituents first and retry with their mined balances.");let[l,g,u,y,x]=ne(await i.read(a.manager,"previewDeposit",[c,n]),5);if(g>c||u>n||g+u===0n||y>g||x>u)throw new o("The CLM returned invalid deposit amounts or fees.");let h=Q(l,r),k=[];for(let[w,M]of[c,n].entries())M>0n&&k.push(d.approval(f(a.wants[w]),f(a.manager),M.toString(),S));k.push(C(a.manager,T({abi:X,functionName:"deposit",args:[c,n,h]}),`Mint at least ${h} CLM share base units to the calling wallet.`));for(let[w,M]of[c,n].entries())M>0n&&k.push(d.approval(f(a.wants[w]),f(a.manager),"0",S));return{...await E(k,t,"Mint CLM want shares with a positive share minimum and exact input approvals. Final revocations clear any unused allowance. Deposit the actual shares received into beefy_deposit separately."),output:{token:await i.token(a.manager),amount:l.toString()},minimumShares:h.toString(),usedAmounts:[g.toString(),u.toString()],fees:[y.toString(),x.toString()]}})},{name:"beefy_clm_withdraw",inputSchema:{type:"object",properties:{...Z,shares:{anyOf:[O(),{const:"all"}]}},required:["vault","shares"],additionalProperties:!1},execute:(e,t)=>s(async()=>{let a=m(e,["shares","slippageBps"]),r=K(e.slippageBps),c=e.shares==="all"?void 0:G(e.shares),n=await b(a,t),i=await n.balance(a.manager),l=c??i;if(l===0n||l>i)throw new o("Withdraw vault shares first, then provide a positive CLM share amount no greater than your mined balance.");let u=ne(await n.read(a.manager,"previewWithdraw",[l]),2).map(x=>x===0n?0n:Q(x,r));if(u.every(x=>x===0n))throw new o("No positive CLM withdrawal output is available.");let y=[C(a.manager,T({abi:X,functionName:"withdraw",args:[l,u[0],u[1]]}),"Redeem CLM shares and return the pair tokens to the calling wallet.")];return{...await E(y,t,"Redeem CLM shares. Convert actual returned tokens, including leftover deposit dust, through the bridge token to USDG with beefy_clm_swap after mining. Strategy pause or API status does not prevent requesting this preview."),minimumOutputs:await Promise.all(u.map(async(x,h)=>({token:await n.token(a.wants[h]),amount:x.toString()})))}})}]}};async function je(d,s,m,b){if(!we.includes(d))throw new o("Unknown Beefy CLM action.");let C=async()=>{throw new o("Beefy CLM reconstruction uses only qualified on-chain routes.")},E=ue({clientFor:()=>b,http:fetch,quoteSwap:C,buildSwap:C,preview:async t=>({txs:t,changes:[],summary:"Locally reconstructed CLM intent; local preview still required."})});return(await Ee(E).tools.find(t=>t.name===d).execute(s,m)).txs}function Ge(d,s,m){let b=()=>{throw new o("Beefy CLM calldata differs from locally reconstructed intent; nothing was signed.")};function C(E,e,t){if(E===e)return;let a=J({abi:t,data:E}),r=J({abi:t,data:e});(a.functionName!==r.functionName||!a.args||!r.args)&&b();let c=[...a.args],n=[...r.args];if(I(T({abi:t,functionName:a.functionName,args:c}),E)||b(),a.functionName==="deposit"||a.functionName==="withdraw")for(let i of a.functionName==="deposit"?[2]:[1,2])F(c[i])<F(n[i])&&b(),c[i]=n[i];else if(a.functionName==="multicall"){let i=F(c[0]);(i<=m||i>F(n[0]))&&b(),(!Array.isArray(c[1])||!Array.isArray(n[1])||c[1].length!==1||n[1].length!==1)&&b(),C(c[1][0],n[1][0],W),c[0]=n[0],c[1]=n[1]}else if(a.functionName==="exactInput"){let i={...c[0]},l=n[0];F(i.amountOutMinimum)<F(l.amountOutMinimum)&&b(),i.amountOutMinimum=l.amountOutMinimum,"deadline"in i&&((F(i.deadline)<=m||F(i.deadline)>F(l.deadline))&&b(),i.deadline=l.deadline),c[0]=i}else b();I(T({abi:t,functionName:a.functionName,args:c}),e)||b()}(!s.length||d.length!==s.length)&&b();for(let[E,e]of d.entries()){let t=s[E];(e.chainId!==t.chainId||!I(e.to,t.to)||e.value!==t.value)&&b();try{if(I(t.to,q.markets.cl.router))J({abi:ce,data:t.data}).args[0].deadline<=m&&b();else if(I(t.to,q.markets.v3.router)){let a=J({abi:W,data:t.data});(a.functionName!=="multicall"||a.args[0]<=m)&&b()}}catch{b()}if(!I(e.data,t.data))try{let a=De.find(r=>I(r.manager,t.to));C(e.data,t.data,a?X:I(t.to,q.markets.cl.router)?ce:W)}catch{b()}}}var We=d=>({tools:Ee(d).tools.slice(1)});export{De as a,we as b,X as c,ce as d,W as e,Se as f,Me as g,Ee as h,je as i,Ge as j,We as k};
|
|
1
|
+
import{b as pe,c as me}from"./FOKEFXGP.js";import{a as ue}from"./SPJCSEKP.js";import{a as be}from"./43LI5NKJ.js";import{c as le}from"./SCG5HWMN.js";import{a as O}from"./66F5ZH34.js";import{c as Y,d as oe,g as I,i as fe,m as se,n as re}from"./NWNYJ26T.js";import{a as M,i as de,j as ce}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{decodeFunctionData as J,encodeFunctionData as T,erc20Abi as te,getAddress as he,keccak256 as Ce,parseAbi as P}from"viem";var q={chainId:4663,observedAt:"2026-11-04T21:56:26.556Z",block:"106231118",routeBlock:"106231118",sources:["https://rpc.mainnet.chain.robinhood.com","https://raw.githubusercontent.com/beefyfinance/cowcentrated-subgraph/main/abis/beefy/clm/ClmManager.json","https://raw.githubusercontent.com/beefyfinance/beefy-v2/main/src/features/data/apis/beefy/beefy-clm-pool.ts"],markets:{v3:{router:"0xCaf681a66D020601342297493863E78C959E5cb2",quoter:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA"},cl:{router:"0xC062b870E813fcA720f1e002c234369Ab3aB9415",quoter:"0x03983AB2C057a2eac211ff01738a1e49ff325B49",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3"}},vaults:[{id:"up33-cow-robinhood-cashcat-weth-vault",vault:"0x25012D654bF9107B6E0Af0248656fEf0b718dBd3",manager:"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x020bfC650A365f8BB26819deAAbF3E21291018b4","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"],strategy:"0xd7F3bCDAfCFf0018953BB6944Db2683Ff2e42b07",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x4E8649Be40aE67EBbcff99C291B92eE03015917b",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-usdg-net-vault",vault:"0x25B418FcFe8543c25AD9d78246839E5Cf3a3b50D",manager:"0x5A725556514222d0cc81501A9294a3135b7C41C4",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168","0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf"],strategy:"0x89207bED2935C64d6cb105E9C85E0E2ED99DD8f2",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},{id:"up33-cow-robinhood-weth-stonkbroker-vault",vault:"0x544c7Ef9265dc08d93B5394116E68aE7D9e60730",manager:"0x5794bB61E83397049c40D87BbF3d44AF583A27Ce",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0xe934e36A439C94017B64a3FecE66AF12099aBF50"],strategy:"0x54Bd0805f549708144C811c14DdEeC0714CA5e0c",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-weth-up-vault",vault:"0x56EA4b4AFAFbb87CFD8Fd8a0266a2F86561677b8",manager:"0x36759534741E28Eb052238738963D684bFe719E4",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x57C0E45cB534413D1C20A4240955d6bB250BB4F1"],strategy:"0x8337c691C3afA52ccE418178e52ed472F034Cb8b",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x23D641FeCcD207E8794c593e8240444A0674C4Ba",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-weth-frong-vault",vault:"0x75588e48f7b4Ed9365d78C6cD509f3C7B804Ca47",manager:"0x9818f01EDCcc3d8EB86B859931C3B877cf44A108",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x6245e67affA44a23077f0Ea7f981a8DC743a0c47"],strategy:"0xdB739d906CD5101b65E089a284ec13a3ab21F603",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x9334BbCBE77C0883d704f71Db35CCF636639334c",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"},{id:"up33-cow-robinhood-usdg-intc-vault",vault:"0x8353c496114CF66D10545fdc2B4e6dFBafd37e3b",manager:"0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168","0xc72b96e0E48ecd4DC75E1e45396e26300BC39681"],strategy:"0xbaEE86C9D7dE9dc192f17dFA62833B601Dc64D23",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:60,bridge:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},{id:"up33-cow-robinhood-weth-tendies-vault",vault:"0x97DCDc29a3B3e2F556564279f7D09eE40eB74E45",manager:"0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d",managerImpl:"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C",wants:["0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73","0x45242320DBB855EeA8Fd36804C6487E10E97FCF9"],strategy:"0x9a02CaA8a2e63659f8A419a29a3B48baD86d3c7a",beacon:"0xfD7EE9D17BD6941bF8e612281ec23E857134BB92",implementation:"0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6",pool:"0xD53a623c17A5853838FA140cE5706eA008565dA8",factory:"0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3",tickSpacing:200,bridge:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"}],routes:[{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x020bfC650A365f8BB26819deAAbF3E21291018b4",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c8020bfc650a365f8bb26819deaabf3e21291018b4",pools:["0x4E8649Be40aE67EBbcff99C291B92eE03015917b"]},{from:"0x020bfC650A365f8BB26819deAAbF3E21291018b4",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x020bfc650a365f8bb26819deaabf3e21291018b40000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x4E8649Be40aE67EBbcff99C291B92eE03015917b"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf",kind:"cl",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d1680000c8ca9c78dd337a67f6e0077f65f5e9218719d30edf",pools:["0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673"]},{from:"0xCA9c78Dd337A67F6e0077F65F5E9218719d30eDf",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"cl",path:"0xca9c78dd337a67f6e0077f65f5e9218719d30edf0000c85fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0xe934e36A439C94017B64a3FecE66AF12099aBF50",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c8e934e36a439c94017b64a3fece66af12099abf50",pools:["0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c"]},{from:"0xe934e36A439C94017B64a3FecE66AF12099aBF50",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0xe934e36a439c94017b64a3fece66af12099abf500000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x57C0E45cB534413D1C20A4240955d6bB250BB4F1",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c857c0e45cb534413d1c20a4240955d6bb250bb4f1",pools:["0x23D641FeCcD207E8794c593e8240444A0674C4Ba"]},{from:"0x57C0E45cB534413D1C20A4240955d6bB250BB4F1",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x57c0e45cb534413d1c20a4240955d6bb250bb4f10000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x23D641FeCcD207E8794c593e8240444A0674C4Ba"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x6245e67affA44a23077f0Ea7f981a8DC743a0c47",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c86245e67affa44a23077f0ea7f981a8dc743a0c47",pools:["0x9334BbCBE77C0883d704f71Db35CCF636639334c"]},{from:"0x6245e67affA44a23077f0Ea7f981a8DC743a0c47",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x6245e67affa44a23077f0ea7f981a8dc743a0c470000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x9334BbCBE77C0883d704f71Db35CCF636639334c"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",kind:"cl",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d16800003cc72b96e0e48ecd4dc75e1e45396e26300bc39681",pools:["0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67"]},{from:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"cl",path:"0xc72b96e0e48ecd4dc75e1e45396e26300bc3968100003c5fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x45242320DBB855EeA8Fd36804C6487E10E97FCF9",kind:"cl",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000c845242320dbb855eea8fd36804c6487e10e97fcf9",pools:["0xD53a623c17A5853838FA140cE5706eA008565dA8"]},{from:"0x45242320DBB855EeA8Fd36804C6487E10E97FCF9",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"cl",path:"0x45242320dbb855eea8fd36804c6487e10e97fcf90000c80bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0xD53a623c17A5853838FA140cE5706eA008565dA8"]},{from:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",to:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",kind:"v3",path:"0x5fc5360d0400a0fd4f2af552add042d716f1d1680000640bd7d308f8e1639fab988df18a8011f41eacad73",pools:["0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca"]},{from:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",to:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",kind:"v3",path:"0x0bd7d308f8e1639fab988df18a8011f41eacad730000645fc5360d0400a0fd4f2af552add042d716f1d168",pools:["0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca"]}],codeHashes:{"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C":"0x6f2a1713cbceba31cc630dddda1ef99cd35086c96005f3c9ea015f9a8e53e613","0xd7F3bCDAfCFf0018953BB6944Db2683Ff2e42b07":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xfD7EE9D17BD6941bF8e612281ec23E857134BB92":"0x9cc155dd143657bba37e6a51fa28e78158e3f47454acdcebedc0512e3803d0fc","0xF5331Dc29A1FDe4b22d7F168661584B057228683":"0x9f1e0f8e488165740c5ab91a3da1bea1a75eeef607ea37b32296ad465971344c","0x4E8649Be40aE67EBbcff99C291B92eE03015917b":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x1ac9dB4a2608ba45D6127B1737949b51Bb54B7F3":"0x4350c8fcdf90361969542249d76c25d6afbd31f10bebf0134bfe21beba1e8f4c","0x5A725556514222d0cc81501A9294a3135b7C41C4":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x89207bED2935C64d6cb105E9C85E0E2ED99DD8f2":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x5794bB61E83397049c40D87BbF3d44AF583A27Ce":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x54Bd0805f549708144C811c14DdEeC0714CA5e0c":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x36759534741E28Eb052238738963D684bFe719E4":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x8337c691C3afA52ccE418178e52ed472F034Cb8b":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x23D641FeCcD207E8794c593e8240444A0674C4Ba":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x9818f01EDCcc3d8EB86B859931C3B877cf44A108":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xdB739d906CD5101b65E089a284ec13a3ab21F603":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x9334BbCBE77C0883d704f71Db35CCF636639334c":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0xbaEE86C9D7dE9dc192f17dFA62833B601Dc64D23":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d":"0xa5fcbfc6347a83acdfbc561e9c0a59b1bbb321da361c3463b73b5c173a68291b","0x9a02CaA8a2e63659f8A419a29a3B48baD86d3c7a":"0x48fed026ddb394d366df6328a1bb802687a479cd28e30ee41d38b8567fb90202","0xD53a623c17A5853838FA140cE5706eA008565dA8":"0xda57657ec68ddfb0987ba1352a44cefe40433e55585f3e4555b8ced4bbeb540d","0xCaf681a66D020601342297493863E78C959E5cb2":"0x6f36c378e272c6324c48f045182bcb54bd8ad654cf9ebd42e8893d52c4cb25dc","0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7":"0x3db0868d945e9304c9bc6a8b2181948109ea617647142f3c4083e14393496a28","0x1f7d7550B1b028f7571E69A784071F0205FD2EfA":"0xec72b1abd1f2faee020cfea9c646bd8994f9fb389054f6e574f103a895091739","0xC062b870E813fcA720f1e002c234369Ab3aB9415":"0x11ea7d3599ef56eda32c0ce7ca26e9aae71bec13bfcbd3ad0e83826c1a2defe4","0x03983AB2C057a2eac211ff01738a1e49ff325B49":"0x1ed81396c831d69a6c59384019850c21ac672d24ae83b4b26304a7384e1e4096","0x52e65B17fB6E5BA00Ed806f37Afcd2DaA50271Ca":"0x3298b5dd4e6f115074c526a55ad05a36fd73a0034ac22ec6cbaab32cc9c1e8d2","0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73":"0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353","0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3":"0xa2cf7f366f3d8d11e611acecf7916a27308ba041bf1e161bddbd4ecbb9402b6a","0x01b0d3d2d54e0B63a8a97E108bE72C819Dc5a0E6":"0xd6f09e63327b36d3c498f8de8768bd3e4336894cd00ddb36aa9e0a1e4a4c911e"},delegates:{"0x137731B8B2D7Cd24aB4A4A9061f2D7b4Fd1aBFEE":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x4E8649Be40aE67EBbcff99C291B92eE03015917b":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x5A725556514222d0cc81501A9294a3135b7C41C4":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x99e70A5b06215e5D2F3BeC773b4f59c008fc1673":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x5794bB61E83397049c40D87BbF3d44AF583A27Ce":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0xB11ba9a4d345434c25d625C076f23Ad14abC6B3c":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x36759534741E28Eb052238738963D684bFe719E4":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x23D641FeCcD207E8794c593e8240444A0674C4Ba":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x9818f01EDCcc3d8EB86B859931C3B877cf44A108":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x9334BbCBE77C0883d704f71Db35CCF636639334c":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x599ac767099bB6f01712867BfA1Fc1Aa27DEFD37":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0x6290Be6e6913708866E6f17eaf3F4FCC7d3fdF67":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3","0x9619bFB1f2D97E2B23F23310205e4c2089c1A45d":"0xfD4017Ad7c1092aaFEbC82621B4DeE59f178D74C","0xD53a623c17A5853838FA140cE5706eA008565dA8":"0x11725976BF1F38c4aB78d1F480bc5883d70D9dc3"},qualificationHistory:[{observedAt:"2026-10-31",block:"102927065",routeBlock:"102928782",implementation:"0xF5331Dc29A1FDe4b22d7F168661584B057228683",implementationHash:"0x9f1e0f8e488165740c5ab91a3da1bea1a75eeef607ea37b32296ad465971344c"}],blockHash:"0xcb0e2862c6e22ca5854fb9264995749e497eb26f05a3370202db69909b891c47"};var De=q.vaults,we=["beefy_clm_swap","beefy_clm_deposit","beefy_clm_withdraw"],X=P(["function wants() view returns(address,address)","function strategy() view returns(address)","function want() view returns(address)","function implementation() view returns(address)","function pool() view returns(address)","function vault() view returns(address)","function price() view returns(uint256)","function paused() view returns(bool)","function isCalm() view returns(bool)","function actionableAt() view returns(uint256)","function token0() view returns(address)","function token1() view returns(address)","function factory() view returns(address)","function tickSpacing() view returns(int24)","function balances() view returns(uint256,uint256)","function previewDeposit(uint256,uint256) view returns(uint256 shares,uint256 amount0,uint256 amount1,uint256 fee0,uint256 fee1)","function previewWithdraw(uint256) view returns(uint256,uint256)","function deposit(uint256 amount0,uint256 amount1,uint256 minShares)","function withdraw(uint256 shares,uint256 minAmount0,uint256 minAmount1)"]),ie=P(["function exactInput((bytes path,address recipient,uint256 deadline,uint256 amountIn,uint256 amountOutMinimum)) payable returns(uint256)"]),W=P(["function exactInput((bytes path,address recipient,uint256 amountIn,uint256 amountOutMinimum)) payable returns(uint256)","function multicall(uint256 deadline,bytes[] data) payable returns(bytes[])"]),ge=P(["function quoteExactInput(bytes path,uint256 amountIn) returns(uint256,uint160[],uint32[],uint256)"]),Fe={cl:P(["function getPool(address,address,int24) view returns(address)"]),v3:P(["function getPool(address,address,uint24) view returns(address)"])},ye=P(["function deposit() payable"]),Z={vault:{...Y,description:"Address of the Beefy CLM vault contract (from beefy_list)."},chainId:{const:M,description:"Chain id; only 4663 (Robinhood Chain mainnet) is supported. Optional."},slippageBps:{type:"integer",minimum:0,maximum:500,description:"Maximum slippage in basis points (50 = 0.5%), 0 to 500. Default 50."}},Be=10n**36n,z=he(de[M].uniswap.WETH.address),ke="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",ve=Object.fromEntries(Object.entries(q.codeHashes).map(([d,r])=>[d.toLowerCase(),r])),Ae=Object.fromEntries(Object.entries(q.delegates).map(([d,r])=>[d.toLowerCase(),r]));function f(d){return fe(d,"Provide a token or vault address.",oe)}function g(d){return se(d,"Invalid Beefy CLM integer.")}function G(d,r=!1){return re(d,"Provide a positive amount that fits uint256.",{notString:"Provide a decimal base-unit integer string.",positive:!r})}function K(d){let r=d??50;if(typeof r!="number"||!Number.isInteger(r)||r<0||r>500)throw new o("Use integer slippageBps from 0 to 500.");return BigInt(r)}function Q(d,r){let m=d*(10000n-r)/10000n;if(m<=0n)throw new o("This CLM amount is too small for a positive output minimum.");return m}function ne(d,r){if(!Array.isArray(d)||d.length!==r)throw new o("Invalid Beefy CLM quote.");return d.map(g)}function Me(d){let r=f(d),m=De.find(b=>I(b.vault,r));if(!m)throw new o("This vault has no qualified Beefy CLM route. Use beefy_withdraw to return existing vault shares to their want; redeem that want through the project app if Oak has no qualified redemption route.");return m}function Se(d,r,m,b,h){if(d<=0n||m<=0n||b<0n||h<0n)throw new o("The CLM price or budget is invalid.");let E=r?d*m/Be:d;if(E===0n)throw new o("The CLM budget is too small at the current pool price.");let e=b*m/Be,t=h>e?h-e:e-h,a=E<t?E:t,s=(E-a)/2n,i=d*(h>e?a+s:s)/E;return[i,d-i]}var Ee=d=>{async function r(e){try{return await e()}catch(t){throw new o(d.plainError(t))}}function m(e,t){if(e.chainId!==void 0&&e.chainId!==M)throw new o("Beefy CLM requires chain 4663.");for(let a of Object.keys(e))if(!["vault","chainId",...t].includes(a))throw new o(`Unsupported Beefy CLM input: ${a}.`);return Me(e.vault)}async function b(e,t){be(t);let a=d.clientFor(M);if(await a.getChainId()!==M)throw new o("The Beefy CLM endpoint must report chain 4663.");let s=g(await a.getBlockNumber()),i=await a.getBlock({blockNumber:s}),n=(B,p,A=[])=>a.readContract({address:f(B),abi:X,functionName:p,args:A,blockNumber:s}),c=new Set;async function l(B){let p=B.toLowerCase();if(c.has(p))return;let A=ve[p];if(!A)throw new o("Unqualified Beefy CLM dependency; no transaction was built.");let D=await a.getCode({address:f(B),blockNumber:s});if(!D||Ce(D)!==A)throw new o("A Beefy CLM contract or delegated implementation no longer matches its pinned code.");c.add(p),Ae[p]&&await l(Ae[p])}await me(a,f(e.vault),s);for(let B of[e.manager,e.strategy,e.beacon,e.implementation,e.pool,e.factory])await l(B);let[F,u,y,x,C,v,w,S,R,ee]=await Promise.all([n(e.vault,"want"),n(e.manager,"wants"),n(e.manager,"strategy"),n(e.beacon,"implementation"),n(e.strategy,"pool"),n(e.strategy,"vault"),n(e.pool,"token0"),n(e.pool,"token1"),n(e.pool,"factory"),n(e.pool,"tickSpacing")]);if(f(F)!==e.manager||!Array.isArray(u)||u.length!==2||u.some((B,p)=>f(B)!==e.wants[p])||f(y)!==e.strategy||f(x)!==e.implementation||f(C)!==e.pool||f(v)!==e.manager||f(w)!==e.wants[0]||f(S)!==e.wants[1]||f(R)!==e.factory||ee!==e.tickSpacing)throw new o("The Beefy CLM want, tokens, strategy, beacon or pool differs from its qualified deployment.");let V=async B=>g(await a.readContract({address:f(B),abi:te,functionName:"balanceOf",args:[t],blockNumber:s}));async function ae(B){let p=f(B),[A,D]=await Promise.all([a.readContract({address:p,abi:te,functionName:"symbol",blockNumber:s}),a.readContract({address:p,abi:te,functionName:"decimals",blockNumber:s})]);if(typeof A!="string"||!A.trim()||!Number.isInteger(D)||D<0||D>255)throw new o("Invalid CLM token metadata.");return{address:p,symbol:A,decimals:D,chainId:M}}async function H(){let p=(await le(d.http,"https://api.beefy.finance/vaults",{},k=>Array.isArray(k)&&k.every($=>$!==null&&typeof $=="object"))).filter(k=>k.chain==="robinhood"&&typeof k.earnContractAddress=="string"&&I(k.earnContractAddress,e.vault)),A=p[0],D=pe(f(e.vault));if(p.length!==1||!A||A.id!==D.id||A.type!=="standard"||f(A.tokenAddress)!==e.manager||A.tokenDecimals!==18)throw new o("The Beefy API and qualified CLM vault disagree.");if(A.status!=="active")throw new o(`Beefy marks this vault ${String(A.status)}; deposits are unavailable. Exit with beefy_withdraw, redeem the returned CLM shares with beefy_clm_withdraw, then swap the received tokens to USDG with beefy_clm_swap.`);let L=f(await n(e.vault,"strategy")),_=await Promise.all([n(L,"paused"),n(e.strategy,"paused")]);if(_.some(k=>typeof k!="boolean"))throw new o("Invalid Beefy strategy pause flag.");if(_.some(Boolean))throw new o("The Beefy strategy is paused; deposits are unavailable. Exit with beefy_withdraw, redeem CLM shares with beefy_clm_withdraw, then convert the tokens to USDG with beefy_clm_swap.");if(await n(e.manager,"isCalm")!==!0)throw new o("The CLM pool is not calm; wait and request a fresh deposit preview.")}async function N(B,p){let A=new Set([...e.wants,f(ce),z]);if(!A.has(B)||!A.has(p)||B===p)throw new o("Use this CLM pair or the USDG/WETH conversion route, with different input and output tokens.");let D=q.routes.find(U=>U.from===B&&U.to===p&&(U.pools[0]===e.pool||U.kind==="v3"));if(!D)throw new o("No qualified direct CLM route for this token pair. Convert through the CLM bridge token in separately mined steps.");let L=q.markets[D.kind];for(let U of[L.router,L.quoter,L.factory,...D.pools])await l(U);let _=D.path;if(_.length!==88||f(_.slice(0,42))!==B||f(`0x${_.slice(-40)}`)!==p)throw new o("Invalid qualified CLM swap path.");let k=Number.parseInt(_.slice(42,48),16),$=await a.readContract({address:f(L.factory),abi:Fe[D.kind],functionName:"getPool",args:[B,p,k],blockNumber:s});if(f($)!==D.pools[0])throw new o("The swap factory no longer selects the qualified CLM pool.");if(f(await n(L.quoter,"factory"))!==L.factory)throw new o("The CLM quoter factory differs from its pin.");return D}async function j(B,p,A){let D=await N(B,p),L=q.markets[D.kind],_=await a.simulateContract({address:f(L.quoter),abi:ge,functionName:"quoteExactInput",args:[D.path,A],account:t,blockNumber:s}),k=g(_.result[0]);if(k===0n)throw new o("No positive quote for this CLM swap.");return{selected:D,market:L,out:k}}return{client:a,blockNumber:s,deadline:i.timestamp+600n,read:n,balance:V,token:ae,code:l,entryAvailable:H,quote:j}}function h(e,t,a,s="0"){return d.unsignedTx({to:f(e),data:t,description:a,value:s,chainId:M})}async function E(e,t,a){let s=await d.preview(e,t);return{txs:e,preview:s,summary:`${a} Re-read actual balances after every mined step. Calls are separate transactions; earlier steps can remain mined if a later step fails. Confirm the local preview. Gas is additional.`}}return{tools:[{name:"beefy_lp",inputSchema:{type:"object",properties:{...Z,amount:{...O(),description:"Optional entry budget in the CLM bridge token base units (USDG or WETH)."}},required:["vault"],additionalProperties:!1},execute:(e,t)=>r(async()=>{let a=m(e,["amount","slippageBps"]),s=K(e.slippageBps),i=await b(a,t),[n,c,l,F,u,y,x,C]=await Promise.all([i.token(a.wants[0]),i.token(a.wants[1]),i.token(a.manager),i.balance(a.wants[0]),i.balance(a.wants[1]),i.balance(a.manager),i.read(a.manager,"balances"),i.read(a.strategy,"price")]),v;if(e.amount!==void 0){await i.entryAvailable();let w=G(e.amount),[S,R]=ne(x,2),ee=Se(w,a.bridge===n.address,g(C),S,R),V=[];for(let[ae,H]of[n,c].entries()){let N=ee[ae],j=N===0n||H.address===a.bridge?N:(await i.quote(f(a.bridge),H.address,N)).out;V.push({token:H,bridgeAmount:N.toString(),expectedAmount:j.toString(),minimumAmount:j===0n?"0":Q(j,s).toString(),swapRequired:N>0n&&H.address!==a.bridge})}v={bridge:await i.token(a.bridge),budget:w.toString(),inputs:V,source:"strategy.price() and CLM balances(); imbalance first, then split remaining value equally. Re-quote after mining swaps."}}return{chainId:M,vault:a.vault,manager:a.manager,bridge:await i.token(a.bridge),constituents:[{token:n,balance:F.toString()},{token:c,balance:u.toString()}],shares:{token:l,amount:y.toString()},entryPlan:v,block:i.blockNumber.toString(),summary:"Convert USDG or ETH to the bridge token with beefy_clm_swap. Use entryPlan to acquire the current deposit ratio, including a one-sided ratio when appropriate. Deposit actual balances with beefy_clm_deposit, then deposit mined CLM shares with beefy_deposit. Exit with beefy_withdraw, beefy_clm_withdraw, then beefy_clm_swap through the bridge token to USDG."}})},{name:"beefy_clm_swap",inputSchema:{type:"object",properties:{...Z,from:{...Y,description:"Address of the token to sell: native ETH placeholder, or a CLM constituent or bridge token (USDG or WETH)."},to:{...Y,description:"Address of the token to receive, different from the input token: a CLM constituent or the bridge token."},amount:O('Amount of the input token in base units of that token (read its decimals). Example: "1000000" = 1 USDG at 6 decimals; "1000000000000000000" = 1 WETH.')},required:["vault","from","to","amount"],additionalProperties:!1},execute:(e,t)=>r(async()=>{let a=m(e,["from","to","amount","slippageBps"]),s=K(e.slippageBps),i=f(e.from),n=f(e.to),c=G(e.amount),l=i.toLowerCase()===ke,F=l?z:i,u=await b(a,t);if((l?await u.client.getBalance({address:t,blockNumber:u.blockNumber}):await u.balance(i))<c)throw new o("Insufficient CLM swap balance; keep ETH for gas.");let y=[];l&&(await u.code(z),y.push(h(z,T({abi:ye,functionName:"deposit"}),"Wrap exactly the requested ETH for the CLM workflow.",c.toString())));let x=c,C=c;if(F!==n){let w=await u.quote(F,n,c);x=w.out,C=Q(x,s),y.push(d.approval(F,f(w.market.router),c.toString(),M));let S={path:w.selected.path,recipient:t,amountIn:c,amountOutMinimum:C},R=w.selected.kind==="cl"?T({abi:ie,functionName:"exactInput",args:[{...S,deadline:u.deadline}]}):T({abi:W,functionName:"multicall",args:[u.deadline,[T({abi:W,functionName:"exactInput",args:[S]})]]});y.push(h(w.market.router,R,`Swap exact input with at least ${C} output base units to the calling wallet.`))}else if(!l)throw new o("The CLM swap requires different input and output tokens.");let v=await u.token(n);return{...await E(y,t,"Swap qualified CLM constituents. Venue fees are included in the quote."),output:{token:v,amount:x.toString()},minimumOutput:{token:v,amount:C.toString()},deadline:u.deadline.toString()}})},{name:"beefy_clm_deposit",inputSchema:{type:"object",properties:{...Z,amount0:O(`Amount of the CLM vault's first token (token0) to deposit, in base units of that token (read its decimals). May be "0" if amount1 is positive.`),amount1:O(`Amount of the CLM vault's second token (token1) to deposit, in base units of that token (read its decimals). May be "0" if amount0 is positive.`)},required:["vault","amount0","amount1"],additionalProperties:!1},execute:(e,t)=>r(async()=>{let a=m(e,["amount0","amount1","slippageBps"]),s=K(e.slippageBps),i=G(e.amount0,!0),n=G(e.amount1,!0);if(i===0n&&n===0n)throw new o("At least one CLM deposit amount must be positive.");let c=await b(a,t);if(await c.entryAvailable(),await c.balance(a.wants[0])<i||await c.balance(a.wants[1])<n)throw new o("Acquire the CLM constituents first and retry with their mined balances.");let[l,F,u,y,x]=ne(await c.read(a.manager,"previewDeposit",[i,n]),5);if(F>i||u>n||F+u===0n||y>F||x>u)throw new o("The CLM returned invalid deposit amounts or fees.");let C=Q(l,s),v=[];for(let[w,S]of[i,n].entries())S>0n&&v.push(d.approval(f(a.wants[w]),f(a.manager),S.toString(),M));v.push(h(a.manager,T({abi:X,functionName:"deposit",args:[i,n,C]}),`Mint at least ${C} CLM share base units to the calling wallet.`));for(let[w,S]of[i,n].entries())S>0n&&v.push(d.approval(f(a.wants[w]),f(a.manager),"0",M));return{...await E(v,t,"Mint CLM want shares with a positive share minimum and exact input approvals. Final revocations clear any unused allowance. Deposit the actual shares received into beefy_deposit separately."),output:{token:await c.token(a.manager),amount:l.toString()},minimumShares:C.toString(),usedAmounts:[F.toString(),u.toString()],fees:[y.toString(),x.toString()]}})},{name:"beefy_clm_withdraw",inputSchema:{type:"object",properties:{...Z,shares:{description:'CLM shares to redeem for the pair tokens, in base units of the CLM share token (read its decimals). "all" redeems your full CLM share balance.',anyOf:[O(),{const:"all"}]}},required:["vault","shares"],additionalProperties:!1},execute:(e,t)=>r(async()=>{let a=m(e,["shares","slippageBps"]),s=K(e.slippageBps),i=e.shares==="all"?void 0:G(e.shares),n=await b(a,t),c=await n.balance(a.manager),l=i??c;if(l===0n||l>c)throw new o("Withdraw vault shares first, then provide a positive CLM share amount no greater than your mined balance.");let u=ne(await n.read(a.manager,"previewWithdraw",[l]),2).map(x=>x===0n?0n:Q(x,s));if(u.every(x=>x===0n))throw new o("No positive CLM withdrawal output is available.");let y=[h(a.manager,T({abi:X,functionName:"withdraw",args:[l,u[0],u[1]]}),"Redeem CLM shares and return the pair tokens to the calling wallet.")];return{...await E(y,t,"Redeem CLM shares. Convert actual returned tokens, including leftover deposit dust, through the bridge token to USDG with beefy_clm_swap after mining. Strategy pause or API status does not prevent requesting this preview."),minimumOutputs:await Promise.all(u.map(async(x,C)=>({token:await n.token(a.wants[C]),amount:x.toString()})))}})}]}};async function je(d,r,m,b){if(!we.includes(d))throw new o("Unknown Beefy CLM action.");let h=async()=>{throw new o("Beefy CLM reconstruction uses only qualified on-chain routes.")},E=ue({clientFor:()=>b,http:fetch,quoteSwap:h,buildSwap:h,preview:async t=>({txs:t,changes:[],summary:"Locally reconstructed CLM intent; local preview still required."})});return(await Ee(E).tools.find(t=>t.name===d).execute(r,m)).txs}function Ge(d,r,m){let b=()=>{throw new o("Beefy CLM calldata differs from locally reconstructed intent; nothing was signed.")};function h(E,e,t){if(E===e)return;let a=J({abi:t,data:E}),s=J({abi:t,data:e});(a.functionName!==s.functionName||!a.args||!s.args)&&b();let i=[...a.args],n=[...s.args];if(I(T({abi:t,functionName:a.functionName,args:i}),E)||b(),a.functionName==="deposit"||a.functionName==="withdraw")for(let c of a.functionName==="deposit"?[2]:[1,2])g(i[c])<g(n[c])&&b(),i[c]=n[c];else if(a.functionName==="multicall"){let c=g(i[0]);(c<=m||c>g(n[0]))&&b(),(!Array.isArray(i[1])||!Array.isArray(n[1])||i[1].length!==1||n[1].length!==1)&&b(),h(i[1][0],n[1][0],W),i[0]=n[0],i[1]=n[1]}else if(a.functionName==="exactInput"){let c={...i[0]},l=n[0];g(c.amountOutMinimum)<g(l.amountOutMinimum)&&b(),c.amountOutMinimum=l.amountOutMinimum,"deadline"in c&&((g(c.deadline)<=m||g(c.deadline)>g(l.deadline))&&b(),c.deadline=l.deadline),i[0]=c}else b();I(T({abi:t,functionName:a.functionName,args:i}),e)||b()}(!r.length||d.length!==r.length)&&b();for(let[E,e]of d.entries()){let t=r[E];(e.chainId!==t.chainId||!I(e.to,t.to)||e.value!==t.value)&&b();try{if(I(t.to,q.markets.cl.router))J({abi:ie,data:t.data}).args[0].deadline<=m&&b();else if(I(t.to,q.markets.v3.router)){let a=J({abi:W,data:t.data});(a.functionName!=="multicall"||a.args[0]<=m)&&b()}}catch{b()}if(!I(e.data,t.data))try{let a=De.find(s=>I(s.manager,t.to));h(e.data,t.data,a?X:I(t.to,q.markets.cl.router)?ie:W)}catch{b()}}}var We=d=>({tools:Ee(d).tools.slice(1)});export{De as a,we as b,X as c,ie as d,W as e,Me as f,Se as g,Ee as h,je as i,Ge as j,We as k};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b as P,f as B,g as H,j as fe,k as $,l as pe,m as F,n as c,o as S,p as j,q as _e,r as I,s as ge}from"./RPB46QAC.js";import{Q as ae,R as ie,S as de,T as ue,U as w,V as ce,X as le,b as o,c as T,d as y,e as Y,f as Z,g as Q,m as V,n as v,o as J,p as W,q as R,r as D,s as X,t as ee,u as ne,v as te,w as se,x as oe,y as re}from"./7VC53B5X.js";import{a as C}from"./XSD5NL7J.js";var x=6,Ue=/^[A-Za-z0-9._-]{1,12}$/;function Ae(e){return Ue.test(e)?e:"the stock token"}function G(e){return e instanceof C?e.message:"unexpected error"}function O(e,n=x){return $({redeemOutBase:e,amountBase:0n,decimals:n})}function me(e,n,i){let d={amount_usd:c(n),gross_usd:c(e.grossUsd),horizon:i,costs_usd:c(e.costsUsd),net_usd:c(e.netUsd)};return e.suggestUsd===void 0?o(ie,d):o(ae,{...d,suggest_usd:`$${e.suggestUsd}`})}function M(e){return`${Number.isInteger(e)?e.toString():e.toFixed(2)} USDG`}function Ee(e,n,i,d){let u={id:"A",project:"layerbank"},s=O(n);if(!Number.isFinite(e.rateBasePct)||e.rateBasePct<0)return d.push("LayerBank rate was malformed"),{option:{...u,offered:!1,reason:"cant_check"},block:o(R,{})};if(!e.open)return{option:{...u,offered:!1,reason:"closed"},block:o(X,{})};if(e.capRoomBase<n)return{option:{...u,offered:!1,reason:"no_room"},block:o(ee,{cap_room_usd:c(O(e.capRoomBase)),amount_usd:c(s)})};let r=e.bonus,l=r!==void 0&&Number.isFinite(r.ratePct)&&r.ratePct>0&&r.endsAt>i,f=e.rateBasePct+(l?r.ratePct:0),b=l?F(i,r.endsAt):0,p=B(e.gasInUsd),_=B(e.gasOutUsd),g=p.usd+_.usd,h=p.estimatedHigh||_.estimatedHigh,m=fe({amountUsd:s,baseRatePct:e.rateBasePct,bonusRatePct:l?r.ratePct:0,bonusDays:b,days:30}),a=H({gross:m,costs:g,amount:s}),U=o(V,{lb_base_rate:S(e.rateBasePct),bonus_clause:l?o(v,{lb_bonus_rate:S(r.ratePct),bonus_days:I(b),lb_base_rate:S(e.rateBasePct)}):"",lb_cash_usd:c(O(e.cashUsdgBase)),lb_gas_in_usd:c(p.usd),lb_gas_out_usd:c(_.usd)});return h&&(U+=`
|
|
2
|
+
${o(w,{})}`),a.tooSmall&&(U+=`
|
|
3
|
+
${me(a,s,I(30))}`),{option:{...u,offered:!0,amountUsd:s,ratePct:f,grossUsd:m,costsUsd:g,netUsd:a.netUsd,tooSmall:a.tooSmall,...a.suggestUsd===void 0?{}:{suggestUsd:a.suggestUsd},estimatedHigh:h},block:U,gross30d:m,horizonEndsAt:i+30*86400}}function he(e,n,i){return e.filter(s=>s.kind==="stable"&&!s.matured&&s.endsAt>n).filter(s=>s.unitDecimals===x&&Number.isFinite(s.ratePct)?!0:(i.push(`Pendle term ${s.market} skipped: its USDG figures were not in the expected form`),!1)).sort((s,r)=>r.liquidityUsd-s.liquidityUsd||s.endsAt-r.endsAt)[0]}async function Oe(e,n,i,d,u){let s={id:"B",project:"pendle"};if(!n)return{option:{...s,offered:!1,reason:"no_term"},block:o(W,{})};let r={option:{...s,offered:!1,reason:"cant_check"},block:o(D,{})},l=O(i),f;try{f=await e.pendleQuoteCosts(n.market,i)}catch(z){return u.push(`Pendle quote failed: ${G(z)}`),r}if(typeof f.ptOutBase!="bigint"||f.ptOutBase<=0n)return u.push("Pendle quote was malformed"),r;let b=f.ptOutBase,p=$({redeemOutBase:b,amountBase:i,decimals:x}),_=B(n.gasInUsd),g=B(n.gasOutUsd),h=Number.isFinite(f.feeUsd)&&f.feeUsd>0?f.feeUsd:0,m=_.usd+g.usd,a=_.estimatedHigh||g.estimatedHigh,U=F(d,n.endsAt),E=H({gross:p,costs:m,amount:l}),N=j(n.endsAt),A=o(J,{pendle_end_date:N,pendle_rate:S(n.ratePct),pendle_payout_usd:c(O(b)),pendle_unit_usd:c(l),pendle_cost_in_usd:c(h+_.usd),pendle_gas_out_usd:c(g.usd)});return a&&(A+=`
|
|
4
|
+
${o(w,{})}`),E.tooSmall&&(A+=`
|
|
5
|
+
${me(E,l,`the ${I(U)} until ${N}`)}`),{option:{...s,offered:!0,amountUsd:l,ratePct:n.ratePct,market:n.market,endsAt:n.endsAt,grossUsd:p,costsUsd:m,netUsd:E.netUsd,tooSmall:E.tooSmall,...E.suggestUsd===void 0?{}:{suggestUsd:E.suggestUsd},estimatedHigh:a},block:A,gross30d:U>30?p*(30/U):p,horizonEndsAt:n.endsAt}}function ke(e){return e.filter(n=>n.matured&&n.ptBalanceBase>0n).map(n=>{let i=j(n.endsAt);if(n.kind==="stock")return o(le,{stock_symbol:Ae(n.unitSymbol),pendle_end_date:i});let d=ge(n.ptBalanceBase,n.unitDecimals);return o(ce,{pendle_end_date:i,pt_amount:d,usdg_out:d})})}function Pe(e){if(e!==void 0){if(!/^[0-9]+$/.test(e))throw new C("The amount must be a whole number of USDG base units (6 decimals), for example 50000000 for 50 USDG.");return BigInt(e)}}async function ye(e,n,i,d={}){let u=Pe(d.amount),s=n.nowSec(),r=[],[l,f]=await Promise.allSettled([e.layerbank(i),e.pendleTerms(i)]),b=l.status==="fulfilled"?l.value:void 0,p=f.status==="fulfilled"?f.value:void 0;l.status==="rejected"&&r.push(`LayerBank could not be read: ${G(l.reason)}`),f.status==="rejected"&&r.push(`Pendle could not be read: ${G(f.reason)}`),r.push(...b?.checks??[],...p?.flatMap(t=>t.checks)??[]);let _=b?.walletUsdgBase;if(_===void 0)try{_=await n.usdgBalance(i)}catch{r.push("wallet USDG balance could not be read")}let g=u??_,h=p?ke(p):[],m=(t,be)=>({card:[...h,...t].join(`
|
|
6
|
+
|
|
7
|
+
`),options:be,notices:h,checks:[...new Set(r)]}),a=await Be(n,i,r),U=t=>a&&a.paidUntil<=s&&!(a.freeUntil!==void 0&&a.freeUntil>s)?[o(re,{plan_price:M(a.priceUsd),project_site:t.join(" or ")})]:[];if(g===void 0)return m([o(R,{}),o(D,{})],[{id:"A",project:"layerbank",offered:!1,reason:"cant_check"},{id:"B",project:"pendle",offered:!1,reason:"cant_check"}]);if(g===0n){let t=0n;try{t=await n.ethBalance(i)}catch{r.push("wallet ETH balance could not be read")}return t>0n?m([o(se,{}),...U([T,y])],[]):m([o(oe,{})],[])}let E=b?Ee(b,g,s,r):{option:{id:"A",project:"layerbank",offered:!1,reason:"cant_check"},block:o(R,{})},N=p?await Oe(e,he(p,s,r),g,s,r):{option:{id:"B",project:"pendle",offered:!1,reason:"cant_check"},block:o(D,{})},A=[E,N],k=[u===void 0||u===_?o(Y,{amount_usd:c(O(g))}):o(_!==void 0&&u<_?Z:Q,{amount_usd:c(O(g))}),...A.map(t=>t.block)],K=a?A.flatMap(t=>t.option.offered&&t.gross30d!==void 0&&t.horizonEndsAt!==void 0?[pe({gross30d:t.gross30d,planPriceUsd:a.priceUsd,paidUntil:a.paidUntil,...a.freeUntil===void 0?{}:{freeUntil:a.freeUntil},horizonEndsAt:t.horizonEndsAt,nowSec:s})]:[]):[];a&&K.includes("fee")?k.push(o(de,{plan_price:M(a.priceUsd)})):a?.freeUntil!==void 0&&K.includes("free_until")&&k.push(o(ue,{free_until:_e(a.freeUntil),plan_price:M(a.priceUsd)}));let L=A.filter(t=>t.option.offered&&!t.option.tooSmall).map(t=>t.option.id);if(L.length>0){let t=L.length===2?"A, B, or neither":`${L[0]}, or neither`;k.push(o(ne,{choices:t}))}else A.some(t=>t.option.offered)&&k.push(o(te,{}));let q=A.filter(t=>t.option.offered).map(t=>t.option.project==="layerbank"?T:y);return k.push(...U(q.length>0?q:[T,y])),m(k,A.map(t=>t.option))}async function Be(e,n,i){let d;try{d=await e.plan?.(n)}catch{d=void 0}if(!d||!Number.isFinite(d.priceUsd)||d.priceUsd<=0||!Number.isFinite(d.paidUntil)){i.push("plan price unavailable");return}let{freeUntil:u,...s}=d;return typeof u=="number"&&Number.isFinite(u)?{...s,freeUntil:u}:s}export{ye as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g}from"./X5V2Z2NM.js";import{a as m}from"./43LI5NKJ.js";import{a as k}from"./66F5ZH34.js";import{e as A,g as u,i as b}from"./NWNYJ26T.js";import{a as l,i as x,s as y}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{b as w}from"./JXOEJPJ4.js";import{Buffer as v}from"node:buffer";import{decodeEventLog as $}from"viem";var R="Profile contents and oak.registrar are mutable, self-asserted metadata, not registry-validated claims or proof of provenance. Oak registration always writes the public oak.registrar = oak marker on Robinhood Chain. Anyone can see it, and the transaction stays in the public history even if the marker is changed later.",B="oak.registrar",D="0x6f616b",L=k("Agent ID as a decimal uint256 integer string."),j={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},q={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"32-byte hex value."},z={type:"string",pattern:"^0x([0-9a-fA-F]{2})*$"},T="0x0000000000000000000000000000000000000000";function h(t){let e=t.network??"mainnet",{chainId:n,identityRegistry:r}=y[e],s=e==="mainnet"?x[l].identity:void 0;return{network:e,chainId:n,registry:r,registryId:`eip155:${n}:${r}`,reputation:s?.reputationRegistry.address,validation:s?.validationRegistry.address}}function K(t){let{chainId:e,reputation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 reputation registry for this network.");return{chainId:e,address:n}}function V(t){let{chainId:e,validation:n}=h(t);if(!n)throw new o("Oak has no pinned ERC-8004 validation registry for this network.");return{chainId:e,address:n}}function Z(t){return u(t,T)}function G(t){if(typeof t!="string"||!/^[0-9]+$/.test(t)||t.length>78||BigInt(t)>=2n**256n)throw new o("Provide an agent ID as a decimal uint256 integer string.");return BigInt(t)}function J(t,e){return b(t,`Provide a valid ${e} address.`)}function Q(t,e){let n=h(t).chainId;if(e!==void 0&&e!==n)throw new o(`ERC-8004 actions are supported only on chain ${n}.`)}function X(t,e){if(typeof t!="string"||!/^0x[0-9a-fA-F]{64}$/.test(t))throw new o(`Provide ${e} as 32-byte hex.`);return t.toLowerCase()}function I(t,e,n,r=!0){if(t===void 0){if(r)return"";throw new o(`Provide ${e}.`)}if(typeof t!="string"||!r&&!t.trim()||t.length>n||w(t))throw new o(`${e} must be plain text of at most ${n} characters.`);return t}function Y(t,e){if(typeof t!="string"||!t.trim()||t.length>2048)throw new o(`Provide a valid ${e}.`);try{let n=new URL(t);if(!["https:","ipfs:"].includes(n.protocol)||!n.hostname||n.username||n.password||w(t))throw new Error}catch{throw new o(`${e} must be an HTTPS or IPFS URI without credentials.`)}return t}function tt(t){let e=/^data:application\/json;base64,([A-Za-z0-9+/=]+)$/.exec(t);if(e)try{let n=JSON.parse(v.from(e[1],"base64").toString("utf8"));return A(n)?n:void 0}catch{return}}async function C(t,e,n,r,s=!0){let i=await t.preview(e,n),a=i.changes.map(({amount:d,token:f})=>{let c=d.startsWith("-");return`${c?"-":""}${t.formatAmount(c?d.slice(1):d,f.decimals)} ${f.symbol} (${f.address}, chain ${f.chainId})`});return{txs:e,summary:`${i.summary} ${a.join("; ")} ${s?`${R} `:""}${r}`}}async function et(t,e,n,r="update this profile"){let{chainId:s,registry:i}=h(t),a=t.clientFor(s),d=await a.readContract({address:i,abi:g,functionName:"ownerOf",args:[e]});if(m(d),u(d,n))return d;let[f,c]=await Promise.all([a.readContract({address:i,abi:g,functionName:"getApproved",args:[e]}),a.readContract({address:i,abi:g,functionName:"isApprovedForAll",args:[d,n]})]);if(m(f),typeof c!="boolean")throw new o("The registry returned invalid operator approval data.");if(!u(f,n)&&!c)throw new o(`Only the agent owner or an approved operator can ${r}.`);return d}async function nt(t,e,n){let{chainId:r,registry:s}=h(t),i=t.clientFor(r),a=await i.readContract({address:s,abi:g,functionName:"ownerOf",args:[e]});if(m(a),u(a,n))return a;if(await i.readContract({address:s,abi:g,functionName:"isApprovedForAll",args:[a,n]})!==!0)throw new o("Only the agent owner or an operator approved for all of its agents can change the token approval.");return a}async function H(t,e,n,r,s){let{chainId:i,registry:a}=h(t),d=s??a;if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e))throw new o("Provide the mined transaction hash.");let f=t.clientFor(i),c=await f.getTransactionReceipt({hash:e});if(!c)throw new o("The transaction is not mined yet. Try again after confirmation.");if(c.status!=="success"||!c.to||!u(c.to,d)||!u(c.from,n)||!u(c.transactionHash,e))throw new o("The receipt is not a successful matching registry transaction.");let p=await f.getTransaction({hash:e});if(p.chainId!==i||p.value!==0n||!p.to||!u(p.to,d)||!u(p.from,n))throw new o("The transaction does not match this chain, registry and wallet.");if(!(typeof r=="function"?typeof p.input=="string"&&r(p.input):typeof p.input=="string"&&u(p.input,r)))throw new o("The mined transaction calldata does not match the exact operation Oak built.");return c}function rt(t,e,n,r){let s=t.logs.filter(i=>u(i.address,e)&&!i.removed).flatMap(i=>{try{let a=$({abi:n,topics:i.topics,data:i.data,strict:!0});return a.eventName===r?[a.args]:[]}catch{return[]}});if(s.length!==1)throw new o(`The receipt must contain one matching ${r} event.`);return s[0]}function ot(t){let e=I(t,"metadata key",128,!1);if(e==="agentWallet")throw new o("The key agentWallet is reserved: use erc8004_set_wallet / erc8004_unset_wallet, which prove control of the wallet.");return e}function it(t){if(t.value===void 0==(t.text===void 0))throw new o("Provide exactly one of value (0x hex bytes) or text (UTF-8).");let e;if(t.value!==void 0){if(typeof t.value!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(t.value))throw new o("Metadata value must be 0x-prefixed hex bytes.");e=t.value}else{if(typeof t.text!="string")throw new o("Metadata text must be a string.");e=`0x${v.from(t.text,"utf8").toString("hex")}`}if((e.length-2)/2>4096)throw new o("Metadata values are limited to 4096 bytes.");return e}async function at(t,e,n,r){let{chainId:s}=h(t);if(n.transactionHash!==void 0){let a=await H(t,n.transactionHash,e,r.matcher??r.data,r.to);return r.verify(a)}await r.authority();let i=t.unsignedTx({to:r.to,data:r.data,value:"0",chainId:s,description:r.description});return C(t,[i],e,r.summary,!1)}export{R as a,B as b,D as c,L as d,j as e,q as f,z as g,h,K as i,V as j,Z as k,G as l,J as m,Q as n,X as o,I as p,Y as q,tt as r,C as s,et as t,nt as u,H as v,rt as w,ot as x,it as y,at as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b}from"./NUFZUKYS.js";import{a as v}from"./G2LAO23N.js";import{a as k}from"./66F5ZH34.js";import{c as l}from"./NWNYJ26T.js";import{a as p}from"./FWD4L3CJ.js";import{a as s}from"./XSD5NL7J.js";import{encodeFunctionData as S,getAddress as m,parseAbi as f,zeroAddress as y}from"viem";var C=f(["function tokenizations(address token) view returns ((address creator,address forwarder,bytes32 marketFamilyId,uint64 createdAt))"]),I=f(["function tokenizations(address token) view returns ((address creator,uint8 way,address forwarder,address adapter,address door,bytes32 familyId,bytes32 marketFamilyId,uint64 unlockBlock,uint16 legBps))"]),A=f(["function name() view returns (string)","function symbol() view returns (string)","function decimals() view returns (uint8)","function balanceOf(address account) view returns (uint256)","function totalSupply() view returns (uint256)","function assetCount() view returns (uint256)","function claimable(address account,uint256 asset) view returns (uint256)","function streamSeconds() view returns (uint32)","function tipBps() view returns (uint16)","function doorCount() view returns (uint256)","function dropBox() view returns (address)","function bridge() view returns (address)","function claim(uint256 asset,address to) returns (uint256 amount)","function claimAll(address to) returns (uint256[] amounts)","function sync() returns (uint256 tip)","function syncRange(uint256 start,uint256 count) returns (uint256 tip)","function syncSome(uint256[] doorIds) returns (uint256 tip)"]),O=f(["function dropCount() view returns (uint256)","function claimable(uint256 dropId,address holder) view returns (uint256)","function claim(uint256[] dropIds,address to) returns (uint256[] amounts)"]),w=["0x522723A7a09684515881568Ab8247f3846D66F43","0xfb3c1501c727f30883cd7B36Ec380381af7412Ef"].map(m),P={token:A,drops:O};function R(t){let r=e=>{let o=b(e.type,e.name,`argument of ${t.name}`);return e.type==="address"?{...l,description:o}:e.type==="uint256[]"?{type:"array",items:k(),maxItems:128,description:o}:{...k(),description:o}};return{type:"object",properties:Object.fromEntries(t.inputs.map(e=>[e.name,r(e)])),required:t.inputs.map(e=>e.name),additionalProperties:!1}}function g(t){return Object.entries(P).flatMap(([r,e])=>e.filter(o=>o.stateMutability==="view"===t).map(o=>({target:r,fn:o})))}var j={token:"the revenue token itself",drops:"its derived drop box"};function h(t){return{type:"object",oneOf:g(t).map(({target:r,fn:e})=>({type:"object",properties:{token:{...l,description:v.address("registered Hookr revenue token")},target:{const:r,description:`Contract to call: "${r}", ${j[r]}.`},function:{const:e.name,description:`Function to call: ${e.name}.`},params:{...R(e),description:`Arguments of ${r}.${e.name}; integers are decimal strings.`}},required:["token","target","function","params"],additionalProperties:!1}))}}function H(t,r){if(Object.keys(t).length!==4||Object.keys(t).some(n=>!["token","target","function","params"].includes(n)))throw new s("Provide token, target, function and params for the Hookr revenue operation.");let e=g(r).find(n=>n.target===t.target&&n.fn.name===t.function);if(!e||!t.params||typeof t.params!="object"||Array.isArray(t.params))throw new s("Choose a documented Hookr revenue function and parameter object.");let o;try{o=m(String(t.token))}catch{throw new s("Provide a valid Hookr revenue token address.")}let i=t.params,a=e.fn;if(Object.keys(i).length!==a.inputs.length||Object.keys(i).some(n=>!a.inputs.some(u=>u.name===n)))throw new s("Provide exactly the documented Hookr revenue parameters.");let c=n=>{if(typeof n!="string"||!/^(0|[1-9][0-9]*)$/.test(n)||n.length>78||BigInt(n)>=1n<<256n)throw new s("Revenue token indices and amounts must be decimal base-unit strings.");return BigInt(n)},d=a.inputs.map(n=>{let u=i[n.name];if(n.type==="address")try{return m(String(u))}catch{throw new s("Provide a valid Hookr revenue address.")}if(n.type==="uint256[]"){if(!Array.isArray(u)||u.length>128)throw new s("Provide at most 128 Hookr revenue indices.");return u.map(c)}return c(u)});return{token:o,fn:a,values:d,operation:e}}async function x(t,r,e){let o=t.clientFor(p),i;for(let c of w){let d=c===w[0],n=await o.readContract({address:c,abi:d?C:I,functionName:"tokenizations",args:[r]});if(!n||typeof n.creator!="string"||d&&(!("createdAt"in n)||typeof n.createdAt!="bigint"||n.createdAt<0n||n.createdAt>=1n<<64n))throw new s("Hookr token provenance is unavailable.");if(m(n.creator)!==y&&(!d||"createdAt"in n&&n.createdAt>0n)){i=c;break}}if(!i)throw new s("This token has no record on a pinned Hookr tokenizer.");let a=e?m(await o.readContract({address:r,abi:A,functionName:"dropBox"})):r;if(a===y)throw new s("Hookr revenue drop box is unavailable.");return{to:a,tokenizer:i}}async function F(t,r,e){if(t.network==="testnet")throw new s("Hookr revenue actions require mainnet, chain 4663.");let{token:o,fn:i,values:a}=H(r,!1),{to:c}=await x(t,o,r.target==="drops"),d=i.inputs.findIndex(n=>n.name==="to");if(d>=0&&[y,o,c].includes(a[d]))throw new s("Choose a valid revenue claim recipient.");return{txs:[t.unsignedTx({chainId:p,to:c,value:"0",data:S({abi:[i],functionName:i.name,args:a}),description:`Hookr revenue ${r.target}.${i.name}: ${JSON.stringify(r.params)}. No token approval or principal deposit.`})],inputs:[]}}function D(t){return[{name:"hookr_revenue_read",inputSchema:{...h(!0),description:"Read a registered Hookr revenue token or its derived drop box: balance, claimable, terms and indices. Checks tokenizer provenance on chain."},execute:async r=>{let{token:e,fn:o,values:i}=H(r,!0),{to:a,tokenizer:c}=await x(t,e,r.target==="drops"),d=await t.clientFor(p).readContract({address:a,abi:[o],functionName:o.name,args:i});return{chainId:p,token:e,tokenizer:c,contract:a,function:o.name,result:JSON.parse(JSON.stringify(d,(n,u)=>typeof u=="bigint"?u.toString():u))}}},{name:"hookr_revenue_action",inputSchema:{...h(!1),description:"Preview holder income/drop claims or permissionless sync/syncRange/syncSome on a registered Hookr revenue token. No approvals; local human confirmation required. Claims and syncs are separate actions."},execute:async(r,e)=>{let{txs:o}=await F(t,r,e),i=await t.preview(o,e);return{txs:o,preview:i,summary:`Hookr revenue ${r.function}; verify receipt and holder balances after confirmation.`}}}]}export{w as a,F as b,D as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B}from"./
|
|
1
|
+
import{c as B}from"./SCG5HWMN.js";import{b as x,e as d,g as k}from"./NWNYJ26T.js";import{a as l}from"./XSD5NL7J.js";import{getAddress as C,keccak256 as I,toHex as D}from"viem";var R="https://balancesapi.ponsfamily.com/v1",P=/^(0|[1-9][0-9]{0,77})$/,$=/^[0-9A-Za-z_.-]{1,128}$/,y=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,p=e=>typeof e=="string"&&P.test(e),S=e=>typeof e=="string"&&x.test(e);function M(e){return d(e)&&S(e.token)&&y(e.holders)&&p(e.supply)&&p(e.burned)&&p(e.circulating)&&d(e.as_of)&&y(e.as_of.rollup_bucket)&&y(e.as_of.tail_from_block)&&(e.next_cursor===null||e.next_cursor===void 0||typeof e.next_cursor=="string"&&$.test(e.next_cursor))&&Array.isArray(e.page)&&e.page.length<=50&&e.page.every(t=>d(t)&&S(t.wallet)&&p(t.balance)&&(t.label===void 0||t.label===null||typeof t.label=="string"))}var A=new WeakMap,c=()=>new l("The Pons holder index changed or returned an incomplete directory. Retry pons_holders without a cursor.");async function T(e,t){let n=A.get(e);n||(n=new Map,A.set(e,n));let f=n.get(t);if(f&&f.expires>Date.now())return f.directory;let o,g,m=new Set,_=new Set,s=[];for(let b=0;b<2e3;b++){let h=new URL(`${R}/tokens/${t.toLowerCase()}/holders`);h.searchParams.set("limit","50"),g&&h.searchParams.set("cursor",g);let r=await B(e.http,h.toString(),{method:"GET",redirect:"error",headers:{accept:"application/json"}},M);if(!k(r.token,t))throw c();if(r.holders>1e5)throw new l("The Pons holder directory exceeds 100000 indexed holders. No total or rank was computed.");if(o??=r,r.holders!==o.holders||r.supply!==o.supply||r.burned!==o.burned||r.circulating!==o.circulating||r.as_of.rollup_bucket!==o.as_of.rollup_bucket||r.as_of.tail_from_block!==o.as_of.tail_from_block)throw c();for(let u of r.page){let i=C(u.wallet);if(_.has(i)||BigInt(u.balance)===0n)throw c();_.add(i),s.push({...u,wallet:i})}if(s.length>o.holders)throw c();if(!r.next_cursor){if(s.length!==o.holders)throw c();s.sort((a,w)=>BigInt(a.balance)>BigInt(w.balance)?-1:BigInt(a.balance)<BigInt(w.balance)?1:a.wallet.toLowerCase().localeCompare(w.wallet.toLowerCase()));let u=I(D(JSON.stringify([t,o.as_of,s.map(a=>[a.wallet,a.balance])]))).slice(2,18),i={body:o,rows:s,fingerprint:u,fetchedAt:new Date().toISOString()};return n.delete(t),n.size>=4&&n.delete(n.keys().next().value),n.set(t,{directory:i,expires:Date.now()+15e3}),i}if(!r.page.length||m.has(r.next_cursor))throw c();m.add(r.next_cursor),g=r.next_cursor}throw new l("The Pons holder directory exceeds 100000 indexed holders. No total or rank was computed.")}function U(e){if(e===void 0)return{offset:0};if(typeof e!="string")throw new l("Use the nextCursor returned by the previous pons_holders page.");let t=/^holders_([0-9]{1,6})_([0-9a-f]{16})$/.exec(e);if(!t)throw new l("Use the nextCursor returned by the previous pons_holders page.");return{offset:Number(t[1]),fingerprint:t[2]}}function z(e,t){if(BigInt(t)===0n)return null;let n=BigInt(e)*10n**18n/BigInt(t);return`${n/10n**18n}.${(n%10n**18n).toString().padStart(18,"0")}`}export{R as a,T as b,U as c,z as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as w,i as T,l as O,m as x,n as R}from"./NWNYJ26T.js";import{a as f,i as S}from"./FWD4L3CJ.js";import{a as c}from"./XSD5NL7J.js";import{a as P}from"./JXOEJPJ4.js";import{encodeFunctionData as $,erc20Abi as E,parseAbi as z,zeroAddress as j}from"viem";var g=S[f].merkl.distributor.address,H=["function accessControlManager() view returns (address)","function isGovernor(address) view returns (bool)","function isGovernorOrGuardian(address) view returns (bool)","function canUpdateMerkleRoot(address) view returns (uint256)","function mainOperators(address,address) view returns (uint256)","function disputeToken() view returns (address)","function disputeAmount() view returns (uint256)","function disputer() view returns (address)","function endOfDisputePeriod() view returns (uint48)","function getMerkleRoot() view returns (bytes32)","function getEpochDuration() view returns (uint32)","function disputePeriod() view returns (uint48)","function upgradeabilityDeactivated() view returns (uint256)","function disputeTree(string)","function updateTree((bytes32 merkleRoot,bytes32 ipfsHash))","function toggleTrusted(address)","function toggleMainOperatorStatus(address,address)","function revokeUpgradeability()","function setEpochDuration(uint32)","function resolveDispute(bool)","function revokeTree()","function recoverERC20(address,address,uint256)","function setDisputePeriod(uint48)","function setDisputeToken(address)","function setDisputeAmount(uint256)"],y=z(H),F={type:"string",pattern:"^\\d+$"},C={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},G="Provide a valid address.";function m(o,l=!1){let n=T(o,G);return l?n:O(n,G)}function _(o,l=256){return R(o,`Value exceeds uint${l}.`,{bits:l})}function k(o){return x(o,"Merkl returned invalid protocol state.")}function I(o){return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?String(o):k(o).toString()}var D={updateTree:["merkleRoot","ipfsHash"],toggleTrusted:["target","enabled"],toggleMainOperatorStatus:["target","token","enabled"],revokeUpgradeability:[],setEpochDuration:["amount"],resolveDispute:["valid"],revokeTree:[],recoverERC20:["token","recipient","amount"],setDisputePeriod:["amount"],setDisputeToken:["token"],setDisputeAmount:["amount"]},W=o=>{let l=()=>o.clientFor(f),n=(r,i=[],e=g)=>l().readContract({address:e,abi:y,functionName:r,args:i}),b=(r,i,e,p)=>({name:`merkl_${r}`,inputSchema:{type:"object",properties:i,required:e,additionalProperties:!1},execute:async(u,s)=>{try{let a=Object.keys(u).find(d=>!Object.hasOwn(i,d));if(a)throw new c(`Unsupported Merkl input: ${a}.`);return await p(u,m(s))}catch(a){throw new c(o.plainError(a))}}}),U=async(r,i,e,p)=>{let u=[o.unsignedTx({to:g,data:$({abi:y,functionName:r,args:i}),value:"0",chainId:f,description:e})],s=await o.preview(u,p);return{txs:u,preview:s,summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${e} ${s.summary}`}};return{tools:[b("distributor_status",{},[],async(r,i)=>{let[e,p,u,s,a,d,t,h,N]=await Promise.all([n("getMerkleRoot"),n("disputeToken"),n("disputeAmount"),n("disputer"),n("endOfDisputePeriod"),n("getEpochDuration"),n("disputePeriod"),n("upgradeabilityDeactivated"),n("accessControlManager")]);if(typeof e!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e)||typeof d!="number"||!Number.isInteger(d)||d<0||d>4294967295)throw new c("Merkl returned invalid Distributor state.");let v=m(N),[M,A]=await Promise.all([n("isGovernor",[i],v),n("isGovernorOrGuardian",[i],v)]);if(typeof M!="boolean"||typeof A!="boolean")throw new c("Merkl returned invalid governance roles.");return{chainId:f,distributor:g,root:e,disputeToken:m(p,!0),disputeAmount:k(u).toString(),disputer:m(s,!0),endOfDisputePeriod:I(a),epochDuration:String(d),disputePeriod:I(t),upgradeabilityDeactivated:k(h).toString(),accessControlManager:v,governor:M,governorOrGuardian:A,summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Dispute amounts are token base units. Opening a dispute locks collateral until governor resolution; a rejected dispute forfeits it."}}),b("dispute",{reason:{type:"string",minLength:1,maxLength:2e3,description:"Public reason for disputing the Merkl tree, from 1 to 2000 characters."}},["reason"],async(r,i)=>{if(typeof r.reason!="string"||!r.reason.trim()||r.reason.length>2e3)throw new c("Provide a public dispute reason of 1 to 2000 characters.");let e=m(await n("disputeToken")),p=k(await n("disputeAmount")),[u,s]=await Promise.all([l().readContract({address:e,abi:E,functionName:"symbol"}),l().readContract({address:e,abi:E,functionName:"decimals"})]);if(typeof u!="string"||!u.trim()||typeof s!="number"||!Number.isInteger(s)||s<0||s>255)throw new c("Merkl dispute token metadata is invalid.");let a=`Dispute Merkl's tree: ${r.reason}. Lock ${p} ${P(u)} base units (token ${e}, decimals ${s}) until governor resolution; rejection forfeits the deposit. There is no unilateral withdrawal.`,d=[...p?[o.approval(e,g,p.toString(),f)]:[],o.unsignedTx({to:g,data:$({abi:y,functionName:"disputeTree",args:[r.reason]}),value:"0",chainId:f,description:a})],t=await o.preview(d,i);return{txs:d,preview:t,deposit:{token:{address:e,symbol:u,decimals:s,chainId:f},amount:p.toString()},summary:`Powered by Merkl \u2014 https://app.merkl.xyz. ${a} ${t.summary}`}}),b("distributor_admin",{operation:{enum:Object.keys(D),description:"Distributor admin operation: tree updates/revocation, trust/operator changes, epoch/dispute settings, resolution, token recovery or upgradeability revocation."},target:{...w,description:"Address whose trusted or operator status is changed."},token:{...w,description:"Reward or recovery token contract address."},recipient:{...w,description:"Address to receive recovered tokens."},amount:{...F,description:'Admin amount: Unix seconds for durations, otherwise token base units using recovery/dispute token decimals (USDG has 6: "1000000" = 1 USDG).'},enabled:{type:"boolean",description:"true enables the selected role; false disables it."},valid:{type:"boolean",description:"Whether the disputed tree is valid."},merkleRoot:{...C,description:"New reward tree root as a 0x-prefixed 32-byte hex string."},ipfsHash:{...C,description:"New tree IPFS content hash as a 0x-prefixed 32-byte hex string."}},["operation"],async(r,i)=>{let e=String(r.operation);if(!Object.hasOwn(D,e))throw new c("Choose a supported Distributor operation.");let p=D[e];for(let t of Object.keys(r))if(t!=="operation"&&!p.includes(t))throw new c(`Input ${t} does not match this Distributor operation.`);let u=m(await n("accessControlManager")),s=await n("isGovernor",[i],u);if(typeof s!="boolean")throw new c("Merkl returned invalid governor status.");if(!s&&!(e==="updateTree"?await n("canUpdateMerkleRoot",[i])===1n:e==="toggleMainOperatorStatus"&&r.token!==j?await n("isGovernorOrGuardian",[i],u)===!0:!1))throw new c("The connected wallet lacks the required Merkl governance role.");let a=p.map(t=>{if(t==="enabled"||t==="valid"){if(typeof r[t]!="boolean")throw new c(`Provide ${t} as boolean.`);return r[t]}if(t==="amount"){let h=_(r[t],e==="setEpochDuration"?32:e==="setDisputePeriod"?48:256);return e==="setEpochDuration"?Number(h):h}if(t==="merkleRoot"||t==="ipfsHash"){if(typeof r[t]!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r[t]))throw new c("Provide a bytes32 root and IPFS hash.");return r[t]}return m(r[t],t==="token"&&e==="toggleMainOperatorStatus")}),d=a;if(e==="updateTree"&&(d=[{merkleRoot:a[0],ipfsHash:a[1]}]),e==="toggleTrusted"||e==="toggleMainOperatorStatus"){let t=await n(e==="toggleTrusted"?"canUpdateMerkleRoot":"mainOperators",e==="toggleTrusted"?[a[0]]:a.slice(0,2));if(t!==0n&&t!==1n)throw new c("Merkl returned invalid authorization state.");if(t===1n===r.enabled)return{txs:[],summary:"Powered by Merkl \u2014 https://app.merkl.xyz. Authorization already has the requested state."};d=a.slice(0,-1)}return U(e,d,`Merkl Distributor ${e} ${JSON.stringify(r)}. Governance affects every claimant. Upgradeability revocation is permanent; dispute resolution returns or forfeits collateral. Authorization operations toggle the observed state; re-preview if state changes.`,i)})]}};export{W as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as y}from"./3CH2IPQL.js";import{getTypesForEIP712Domain as P,hashTypedData as I,isAddress as T}from"viem";function E(t,s,r,f){let m=/^Sign in to raeto as an agent\n\nWallet: (0x[0-9a-fA-F]{40})\nNonce: ([0-9a-f]{32})\n\nThis gives this wallet an API key for its own raeto account\. It costs nothing and moves no funds\.$/.exec(t),n=Date.parse(r);if(!m||m[0]!==t||m[1].toLowerCase()!==s.toLowerCase()||!Number.isFinite(f)||!Number.isFinite(n)||n<=f)throw new Error("Raeto sign-in message changed or expired. Oak did not sign anything.")}function R(t,s,r){throw new Error("pairing template not pinned")}var k="Raeto pairing request changed. Oak did not sign anything.",p=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);function b(t,s=0){if(s>32)throw new Error;if(!(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"&&Number.isSafeInteger(t))){if(Array.isArray(t)){for(let r of t)b(r,s+1);return}if(!p(t)||![Object.prototype,null].includes(Object.getPrototypeOf(t)))throw new Error;for(let r of Object.values(Object.getOwnPropertyDescriptors(t))){if(!r.enumerable||!Object.hasOwn(r,"value"))throw new Error;b(r.value,s+1)}}}function j(t,{wallet:s,agentId:r},f){let m={rule:"typedData must contain only plain JSON values within 32 levels",observed:t},n=(c,g)=>{throw m={rule:c,observed:g},new Error(k)};try{b(t);let c=JSON.stringify(t),g=Buffer.byteLength(c,"utf8");g>64*1024&&n("typedData UTF-8 size must be at most 65536 bytes",g),/sk-raeto-/.test(c)&&n("typedData must not contain a Raeto API key",t);let e=JSON.parse(c);if(!p(e))return n("typedData must be an object",e);if(e.primaryType!==y.primaryType&&n(`primaryType must equal ${y.primaryType}`,e.primaryType),!p(e.domain))return n("domain must be an object",e.domain);if(e.domain.name!==y.domainName&&n(`domain.name must equal ${y.domainName}`,e.domain.name),e.domain.chainId!==void 0&&e.domain.chainId!==4663&&n("domain.chainId must be absent or equal 4663",e.domain.chainId),!p(e.types))return n("types must be an object",e.types);if(!p(e.message))return n("message must be an object",e.message);T(s,{strict:!1})||n("local wallet must be an address",s),/^[1-9]\d{0,29}$/.test(r)||n("verified agentId must be a positive decimal of at most 30 digits",r);let l=e.types;for(let[i,a]of Object.entries(l)){if(!Array.isArray(a)||!a.length)return n("each types entry must be a nonempty array",{type:i,fields:a});let d=new Set;for(let o of a){if(!p(o)||typeof o.name!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(o.name)||typeof o.type!="string"||!o.type||d.has(o.name))return n("type fields must have unique identifier names and nonempty string types",{type:i,field:o});d.add(o.name)}}m={rule:"domain must support EIP-712 domain field derivation",observed:e.domain};let A=P({domain:e.domain}),u=l.EIP712Domain;u!==void 0&&(!Array.isArray(u)||u.length!==A.length||A.some(i=>!u.some(a=>a.name===i.name&&a.type===i.type)))&&n("types.EIP712Domain must sign every advertised domain field with its derived type",u);let v=!1,w=i=>{if(Array.isArray(i)){i.forEach(w);return}if(p(i))for(let[a,d]of Object.entries(i)){let o=a.replace(/_/g,"").toLowerCase();o==="agentid"&&(String(d)!==r&&n("every message agent ID must equal the verified agentId",{field:a,value:d,expected:r}),v=!0),/^(wallet|address|signer|owner|agentwallet|agentaddress|signerwallet|signeraddress|ownerwallet|owneraddress|walletaddress)$/.test(o)&&(typeof d!="string"||d.toLowerCase()!==s.toLowerCase())&&n("every message signer or wallet field must equal the local wallet",{field:a,value:d,expected:s}),w(d)}};w(e.message);let h=l[y.primaryType];return v||n("message must contain the verified agentId",e.message),(!Array.isArray(h)||!h.some(i=>p(i)&&typeof i.name=="string"&&i.name.replace(/_/g,"").toLowerCase()==="agentid"))&&n("primary type must declare a signed agentId field",h),m={rule:"typedData must be encodable as EIP-712",observed:e},I(e),{untrusted:!0,primaryType:e.primaryType,domain:e.domain,types:l,message:e.message}}catch{throw f?.(m),new Error(k)}}export{E as a,R as b,k as c,j as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as X}from"./YSMWCKIX.js";import{b as Z}from"./NA424YAL.js";import{a as Y}from"./FZ6IJZZM.js";import{b as z}from"./JWR5XVP2.js";import{c as Q}from"./JLRHM2DQ.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"./V37L4DU4.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 ee}from"node:buffer";import{decodeEventLog as ne,encodeFunctionData as H,getAddress as oe,hexToString as se,parseAbiItem as de,toEventSelector as re}from"viem";var je={register:"erc8004_register"},ce="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>.",ge="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.",fe="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",le={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 ue(t){if(typeof t!="string"||!t.trim())return!1;try{let e=new URL(t);return["https:","ipfs:"].includes(e.protocol)&&!!e.hostname&&!e.username&&!e.password}catch{return!1}}var pe=t=>Array.isArray(t)&&t.every(e=>typeof e=="string"&&e.trim()),me=t=>t.replace(/\.$/,"");function he(t,e,a,n){let{registryId:d}=I(t);if(!T(e))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}`);e.type!==F&&r("type",`use "${F}"`),(typeof e.name!="string"||!e.name.trim())&&r("name",'a short name for your agent, such as "Oak Agent 1"'),typeof e.description!="string"&&r("description","a sentence about what your agent does (it may be empty text)"),ue(e.image)||r("image","an HTTPS or IPFS link to a picture, with no username or password in it"),typeof e.active!="boolean"&&r("active","true or false"),typeof e.x402Support!="boolean"&&r("x402Support","true or false"),Array.isArray(e.services)?e.services.forEach((i,c)=>{try{Z(i)}catch(p){if(!(p instanceof g))throw p;r(`services item ${c+1}`,me(p.message))}}):r("services","a list of endpoints, or [] for none");for(let i of["tags","supportedTrust"])e[i]!==void 0&&!pe(e[i])&&r(i,"a list of nonempty text labels, or leave it out");if(Array.isArray(e.registrations)?e.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=e.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((e.tags??[]).filter(i=>i!==k))];a!==!1&&s.push(k);let m={...e,registrations:u,...s.length?{tags:s}:{}};s.length||delete m.tags;let l;try{if(l=JSON.stringify(m),ee.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,${ee.from(l,"utf8").toString("base64")}`}async function M(t,e){try{let{chainId:a,registry:n}=I(t),d=x(e),o=t.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(t.plainError(a))}}async function Le(t,e){let a=await M(t,e);return{...a,uri:A(a.uri)}}async function ye(t,e,a,n,d,o){let{registry:r}=I(t),u=await E(t,e,a,d),s=o===void 0?"Registered":"URIUpdated",m=re(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=ne({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(t,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 we(t,e){let{chainId:a,registry:n}=I(t);return t.unsignedTx({to:n,chainId:a,value:"0",data:H({abi:y,functionName:"setMetadata",args:[e,k,R]}),description:`Set mutable oak.registrar metadata to oak for agent ${e}.`})}async function te(t,e,a,n){let{registry:d}=I(t),o=x(n.agentId),r=await E(t,e,a,H({abi:y,functionName:"setMetadata",args:[o,k,R]})),u=re("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}=ne({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(t,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 be(t,e){let{chainId:a,registry:n}=I(t),d=t.clientFor(a),o=await d.readContract({address:n,abi:y,functionName:"balanceOf",args:[e]});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:de("event Transfer(address indexed from,address indexed to,uint256 indexed tokenId)"),args:{to:e},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(t,i);if(w(c.owner,e))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 ke(t){if(t===void 0)return[];if(!Array.isArray(t)||t.length>15)throw new g("Provide at most 15 user metadata entries as { key, value } with value as 0x hex or text.");let e=new Set;return t.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(e.has(n))throw new g(`Metadata key ${A(n)} is repeated.`);return e.add(n),{metadataKey:n,metadataValue:G(a)}})}function ie(t,e,a){let n=$(e);if(!n)return;let{registryId:d}=I(t);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 Ie(t,e,a){let n=ie(t,e.uri,BigInt(e.agentId));return n===!0?{...e,profileComplete:!0}:{...e,profileComplete:n===void 0?null:!1,nextStep:{tool:"erc8004_update",arguments:{agentId:e.agentId,profile:a??"a registration-v1 profile object"},why:"The minted profile does not list its own registry and agent ID yet (registrations is empty). erc8004_update appends it automatically. It is a normal action: it needs a verified identity link and an active subscription, so link with oak_setup first."}}}async function ae(t,e,a,n){let{chainId:d,registry:o}=I(t);O(n),B(t,a.chainId);let r=e?x(a.agentId):void 0;if(!e&&(a.tag===!1||a.noTag!==void 0||a["--no-tag"]!==void 0))throw new g(ce);if(a.tag!==void 0&&typeof a.tag!="boolean")throw new g("The tag option must be a boolean.");let s=!e&&a.profile===void 0?"":he(t,a.profile,a.tag,r),m=e?[]:ke(a.metadata),l=a.tag!==!1;if(e&&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?Ie(t,f,a.profile):f;if(a.transactionHash!==void 0){let f=await ye(t,a.transactionHash,n,s,i,r);if(!e){if(!w(f.registrarMetadata,R))throw new g(ge);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 te(t,a.metadataTransactionHash,n,f)):c(f)}if(!e){let f=await be(t,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 te(t,a.metadataTransactionHash,n,f),registrationResumed:!0})}if(!v||f.registrarMetadata!=="0x")return c(b);let S=await U(t,[we(t,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(t,r,n);let p=[t.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 e?U(t,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(t,p,n,`${fe} 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 ve(t,e){let a=await M(t,e.agentId),{chainId:n,registry:d}=I(t),o=t.clientFor(n),r=BigInt(a.agentId),u=e.metadataKeys===void 0?[]:(()=>{if(!Array.isArray(e.metadataKeys)||e.metadataKeys.length>16)throw new g("Provide at most 16 metadata keys.");return e.metadataKeys.map(h=>W(h,"metadata key",128,!1))})(),s=e.operator===void 0?void 0:oe(String(e.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=ie(t,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(se(P))}catch{C=void 0}return[A(h),{hex:P??"unavailable",...C?{text:C}:{}}]}))}:{}}}var Re={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."}}},Ae=t=>{let e=(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(t.plainError(s))}}}),a=n=>({type:"object",additionalProperties:!1,required:n?["agentId","profile"]:[],properties:{profile:{...le,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:Re,description:"Up to 15 user entries plus the mandatory oak.registrar marker. The keys agentWallet and oak.registrar are reserved."}}}});return{tools:[e("erc8004_register",a(!1),(n,d)=>ae(t,!1,n,d)),e("erc8004_update",a(!0),(n,d)=>ae(t,!0,n,d)),e("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=>ve(t,n))]}},Ke=t=>K("erc8004",[Ae(t),Q(t),X(t),Y(t),z(t)]);export{je as a,Le as b,ie as c,Ae as d,Ke as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C}from"./43LI5NKJ.js";import{a as _}from"./66F5ZH34.js";import{g as N,m as T,n as k}from"./NWNYJ26T.js";import{a as u,i as $,j as I}from"./FWD4L3CJ.js";import{a as i}from"./XSD5NL7J.js";import{encodeFunctionData as w,erc20Abi as R,getAddress as y,parseAbi as z}from"viem";var d=y($[u].vaults.spark.address),l={address:y(I),symbol:"USDG",decimals:6,chainId:u},E={address:d,symbol:"spUSDG",decimals:6,chainId:u},c=z(["function asset() view returns (address)","function decimals() view returns (uint8)","function maxMint(address) view returns (uint256)","function maxRedeem(address) view returns (uint256)","function maxDeposit(address) view returns (uint256)","function previewMint(uint256) view returns (uint256)","function previewRedeem(uint256) view returns (uint256)","function previewDeposit(uint256) view returns (uint256)","function mint(uint256 shares,address receiver) returns (uint256)","function mint(uint256 shares,address receiver,uint16 referral) returns (uint256)","function deposit(uint256 assets,address receiver,uint16 referral) returns (uint256)","function redeem(uint256 shares,address receiver,address owner) returns (uint256)"]),Q=r=>_(r),J={type:"integer",minimum:0,maximum:65535,description:"Integration referral code, a whole number from 0 to 65535. It is only emitted in an event and has no other effect."},K={shares:'Amount of spUSDG shares in base units (spUSDG has 6 decimals). Example: "1000000" = 1 spUSDG.',maxAssets:'Most USDG you will pay, in base units (USDG has 6 decimals). The call fails if the quote is higher. Example: "1000000" = 1 USDG.',amount:'Amount of USDG in base units (USDG has 6 decimals). Example: "1000000" = 1 USDG.'};function M(r){return k(r,"Amount must be positive and fit uint256.",{notString:"Amount must be a positive base-unit integer string.",positive:!0})}function j(r){return T(r,"Invalid Spark integer read.")}function ee(r){return["mint","redeem","deposit_referral","return_liquidity"].map(n=>{let t=n==="mint",a=n==="redeem",h=n==="deposit_referral",x=t?["shares","maxAssets","referral"]:a?["shares"]:h?["amount","referral"]:["amount"],O=t?["shares","maxAssets"]:a?["shares"]:h?["amount","referral"]:["amount"];return{name:`spark_${n}`,inputSchema:{type:"object",additionalProperties:!1,required:O,properties:Object.fromEntries(x.map(m=>[m,m==="referral"?J:Q(K[m])]))},execute:async(m,o)=>{try{if(C(o),Object.keys(m).some(p=>!x.includes(p)))throw new i("Unexpected Spark action argument.");let e=M(m[t||a?"shares":"amount"]),B=t?M(m.maxAssets):void 0,s=m.referral;if((h||s!==void 0)&&(typeof s!="number"||!Number.isInteger(s)||s<0||s>65535))throw new i("Referral must be a uint16 integer.");let f=r.clientFor(u);if(await f.getChainId()!==u)throw new i("Spark requires chain 4663.");let[U,F,H]=await Promise.all([f.readContract({address:d,abi:c,functionName:"asset"}),f.readContract({address:d,abi:c,functionName:"decimals"}),f.readContract({address:l.address,abi:R,functionName:"decimals"})]);if(typeof U!="string"||y(U)!==l.address||F!==6||H!==6)throw new i("Spark requires the pinned USDG/share metadata.");let v=n==="return_liquidity"?e:j(await f.readContract({address:d,abi:c,functionName:t?"previewMint":a?"previewRedeem":"previewDeposit",args:[e]}));if(v===0n)throw new i("Spark returned a zero action quote.");if(n!=="return_liquidity"){let p=j(await f.readContract({address:d,abi:c,functionName:t?"maxMint":a?"maxRedeem":"maxDeposit",args:[o]}));if(e>p)throw new i("The amount exceeds Spark\u2019s current action capacity.")}if(t&&v>B)throw new i("The mint quote exceeds maxAssets.");let G=t?v:e,P=t?s===void 0?w({abi:c,functionName:"mint",args:[e,o]}):w({abi:c,functionName:"mint",args:[e,o,s]}):a?w({abi:c,functionName:"redeem",args:[e,o,o]}):h?w({abi:c,functionName:"deposit",args:[e,o,s]}):w({abi:R,functionName:"transfer",args:[d,e]}),q=`${n} ${e} ${t||a?"spUSDG share":"USDG asset"} base units; ${n==="return_liquidity"?`USDG goes to ${d}, with no shares minted`:`beneficiary ${o}`}${s===void 0?"":`; event-only referral ${s}`}.`,A=[...t||h?[r.approval(l.address,d,G.toString(),u)]:[],r.unsignedTx({to:n==="return_liquidity"?l.address:d,data:P,value:"0",chainId:u,description:q})],g=await r.preview(A,o),S=p=>g.changes.filter(b=>b.token.chainId===u&&N(b.token.address,p.address)).reduce((b,D)=>{if(D.token.decimals!==p.decimals||!/^-?\d+$/.test(D.amount))throw new i("Invalid Spark preview metadata.");return b+BigInt(D.amount)},0n);if(a?S(E)!==-e||S(l)<=0n:S(l)!==-G||n!=="return_liquidity"&&S(E)<(t?e:1n))throw new i("Spark preview does not match the requested outflow and receipt.");return{txs:A,preview:g,summary:`${q} Quoted ${v} ${a?"USDG asset":t||n==="return_liquidity"?"USDG input":"spUSDG share"} base units. ${g.summary} Standard ERC-4626 encodes no output minimum; the exact mint approval can become insufficient as interest accrues. Re-preview before signing.`}}catch(e){throw new i(r.plainError(e))}}}})}export{ee as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as h}from"./GQ3XZFRL.js";import{a as H}from"./HOEQVPY7.js";import{a as E}from"./SCG5HWMN.js";import{a as m}from"./XSD5NL7J.js";var O="https://heyresearch.xyz/api/v1/scan",T=2500,D=6e4,S=64,L=32768,x=/^0x[0-9a-fA-F]{40}$/,$=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u;function R(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var f=class extends m{};function j(e,t){return e===401||e===403?new f(`HEY Research Lab refused access (HTTP ${e}). Ask the Oak operator to check HEY access and allowance.`):(e===400||e===422)&&(/^\/api\/v1\/(?:scan|builder)\?/.test(t)||t.startsWith("/api/agent/research_project?address="))?new f(`HEY Research Lab rejected this token identity on chain 4663 (HTTP ${e}). Check the token contract address.`):new f(`HEY Research Lab rejected the request (HTTP ${e}). Check the project, token address and selectors.`)}var z=/\.(?:localhost|local|localdomain|internal|intranet|lan|home|corp|private|home\.arpa)$/;function P(e){let t=e.toLowerCase().replace(/\.$/,"");return!t||t.startsWith("[")||/^[\d.]+$/.test(t)||!t.includes(".")||t==="localhost"||z.test(t)?!1:/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/.test(t)&&/[a-z]/.test(t.slice(t.lastIndexOf(".")+1))}function A(e,t=!1){if(typeof e!="string"||e.length>2048||/[\s<>\\]/.test(e)||$.test(e))return!1;try{let r=new URL(e);return r.protocol==="https:"&&!r.username&&!r.password&&(t?r.origin==="https://heyresearch.xyz"&&r.pathname.startsWith("/project/"):P(r.hostname))}catch{return!1}}function I(e){return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(Date.parse(e))&&new Date(e).toISOString().slice(0,10)===e&&e<=new Date(Date.now()+864e5).toISOString().slice(0,10)}function Y(e){if(typeof e!="string"||!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/.test(e))return!1;let t=Date.parse(e);return Number.isFinite(t)&&new Date(t).toISOString().slice(0,19)===e.slice(0,19)&&t<=Date.now()+3e5}function v(e,t,r){if(t!==4663||!x.test(r)||!R(e)||e.chainId!==t||typeof e.contractAddress!="string"||e.contractAddress.toLowerCase()!==r.toLowerCase())return;let a={chainId:4663,contractAddress:e.contractAddress};if(e.found===!1)return Object.freeze({found:!1,...a});if(e.found!==!0||!h(e.status_label,80)||!h(e.status_help,300)||typeof e.verified_builder!="boolean"||typeof e.activity_applies_to_token!="boolean"||typeof e.token_verification!="string"||!/^[A-Z][A-Z_]{0,63}$/.test(e.token_verification)||!A(e.project_link,!0)||!R(e.activity))return;let s=e.activity.last_ship,o=e.activity.last_ship_url;if(s!=null&&!I(s)||o!=null&&!A(o))return;let i=e.as_of;if(!(i!==void 0&&!Y(i))&&s!=null==(o!=null))return Object.freeze({found:!0,...a,status_label:e.status_label,status_help:e.status_help,verified_builder:e.verified_builder,token_verification:e.token_verification,activity_applies_to_token:e.activity_applies_to_token,project_link:e.project_link,...i===void 0?{}:{as_of:i},activity:Object.freeze({last_ship:s??null,last_ship_url:o??null})})}async function N(e,t){if(!e.ok||!e.body)throw new Error("HEY unavailable");let r=e.body.getReader(),a=()=>{r.cancel().catch(()=>{})};t.addEventListener("abort",a,{once:!0}),t.aborted&&a();let s=new TextDecoder("utf-8",{fatal:!0}),o="",i=0;try{for(;;){let{done:c,value:d}=await r.read();if(c)break;if(i+=d.byteLength,i>L)throw new Error("HEY response too large");o+=s.decode(d,{stream:!0})}return JSON.parse(o+s.decode())}finally{t.removeEventListener("abort",a),a()}}function U(e,t=fetch){if(!/^[0-9A-Za-z.+-]{1,64}$/.test(e))throw new Error("Invalid integration version");let r=new Map,a=new Map,s=H();return async(o,i)=>{if(o!==4663||!x.test(i)||/^0x(?:0{40}|e{40})$/i.test(i))return{status:"unavailable"};if(s.blocked())return{status:"unavailable"};let c=`${o}:${i.toLowerCase()}`,d=r.get(c);if(d&&d.expires>Date.now())return d.result;r.delete(c);let _=a.get(c);if(_)return _;if(a.size>=S)return{status:"unavailable"};let b=(async()=>{let p=new AbortController,w;try{let u=new Promise((l,n)=>{w=setTimeout(()=>{s.defer(null),p.abort(),n(new Error("HEY deadline"))},T)}),C=(async()=>{let l=new URL(O);l.searchParams.set("chain",String(o)),l.searchParams.set("token",i);let n;try{n=await t(l,{method:"GET",headers:{"x-hey-integration":`oak-agent-kit/${e}`},signal:p.signal,credentials:"omit",redirect:"error",referrerPolicy:"no-referrer"})}catch(y){if(y instanceof E)n=y.response;else throw s.defer(null),y}if(n.status===429||n.status>=500)throw s.defer(n.headers.get("retry-after")),n.body?.cancel().catch(()=>{}),new Error("HEY unavailable");if(n.status>=400&&n.status<500)throw n.body?.cancel().catch(()=>{}),j(n.status,"/api/v1/scan?");let k=v(await N(n,p.signal),o,i);if(!k)throw new Error("Invalid HEY response");return Object.freeze({status:"ok",card:k})})(),g=await Promise.race([C,u]);for(let[l,n]of r)n.expires<=Date.now()&&r.delete(l);return r.size>=S&&r.delete(r.keys().next().value),r.set(c,{expires:Date.now()+D,result:g}),g}catch(u){if(u instanceof f)throw u;return{status:"unavailable"}}finally{clearTimeout(w)}})();a.set(c,b);try{return await b}finally{a.delete(c)}}}export{j as a,v as b,U as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as F,e as M}from"./
|
|
1
|
+
import{d as F,e as M}from"./ACH4BSME.js";import{g as H,j as R}from"./PZEF5LBL.js";import{a as y,b as x,c,f as $,j as L,l as S,m as O,n as U}from"./CSOO4SW7.js";import{a as r}from"./I6PQW2JI.js";import{a as N}from"./K6D6SDIG.js";import{c as q}from"./43LI5NKJ.js";import{g as _}from"./NWNYJ26T.js";import{a as h}from"./XSD5NL7J.js";import{encodeFunctionData as W}from"viem";var j={chop_wrap:["log","underlying","amount","minLogOut"],chop_unwrap:["log","amount","quotedNet"],chop_farm:["log","amount","pairedAmount","minPaired","minStakedLp","slippageBps","deadline"],chop_unfarm:["log","amount","minLogOut","minPairedOut","deadline"],chop_harvest:["log"]};function z(l,o){if(Object.keys(l).some(n=>!o.includes(n)))throw new h("Unexpected Chop argument.");if(o.some(n=>l[n]===void 0))throw new h("Provide every required Chop input.")}async function V(l,o,n){let d=c(o),p=await l.getBlock({blockNumber:BigInt(n.measuredAtBlock)});if(p.number!==BigInt(n.measuredAtBlock)||d<=x(p.timestamp)||d>p.timestamp+1200n)throw new h("Chop deadline must be in the next 20 minutes.");return d}async function D(l,o,n,d){if(z(n,j[o]),y(d),l.network==="testnet")throw new h("Chop requires chain 4663.");let p=y(n.log),u=l.clientFor(4663),i=await S(u,p,o==="chop_wrap"||o==="chop_farm"?"enter":"exit"),s=BigInt(i.measuredAtBlock),f=[],g=[],C=(e,t,a)=>{f.push(q(e.address,t,a.toString(),4663)),g.push(l.approval(e.address,t,a.toString(),4663))},P=(e,t,a)=>{let m={to:e,data:W({abi:N,functionName:t,args:a}),value:"0",chainId:4663,description:`${o} on verified log ${p}.`,...o==="chop_harvest"?{gasLimit:"1000000"}:{}};f.push(m),g.push({...l.unsignedTx(m),...m.gasLimit===void 0?{}:{gasLimit:m.gasLimit}})},A=[],v=(e,t,a=!0)=>A.push({token:e,min:-t,max:a?-t:-1n}),w=(e,t)=>A.push({token:e,min:t}),T=async(e,t)=>{if(x(await $(u,e.address,"balanceOf",[d],s))<t)throw new h("This wallet does not hold enough tokens for the Chop action.")},k;if(o==="chop_wrap"){let e=c(n.amount),t=c(n.minLogOut);if(!_(y(n.underlying),i.underlying.address))throw new h("The underlying token does not match the verified Chop log.");await T(i.underlying,e),C(i.underlying,p,e),P(p,"bond",[i.underlying.address,e,t]),v(i.underlying,e,!1),w(i.log,t),k=`Wrap at most ${e} underlying base units; on-chain minimum ${t} log base units.`}else if(o==="chop_unwrap"){let e=c(n.amount),t=c(n.quotedNet);await T(i.log,e);let a=await M(u,i,d,e);if(BigInt(a.net.amount)<t)throw new h("Chop unwrap no longer meets the quoted net amount. Request a fresh quote.");let m=F(i,e);f.push(m),g.push(l.unsignedTx(m)),v(i.log,e),w(i.underlying,t),k=`Unwrap ${e} log base units; preview must return at least quoted ${t} underlying base units.`}else if(o==="chop_farm"){await L(u,r.helper,s);let e=c(n.amount),t=c(n.pairedAmount),a=c(n.minPaired),m=c(n.minStakedLp),I=await V(u,n.deadline,i),b=n.slippageBps;if(typeof b!="number"||!Number.isInteger(b)||b<0||b>1e3||b%10!==0||a>t)throw new h("Chop LP slippage must be 0\u20131000 basis points in multiples of 10; the paired minimum cannot exceed its input.");await Promise.all([T(i.log,e),T(i.paired,t)]),C(i.log,r.helper.address,e),C(i.paired,r.helper.address,t),P(r.helper.address,"addLPAndStake",[p,e,i.paired.address,t,a,BigInt(b/10),I]),v(i.log,e,!1),A.push({token:i.paired,min:-t,max:-a}),w(i.staking,m),k=`Farm up to ${e} log + ${t} paired base units; slippage ${b} bps; deadline ${I}. Staked LP minimum ${m} is checked in simulation; two-sided token minimums from slippage are enforced on chain. Paired consumption must also meet ${a} base units in the preview. This tool does not zap; the helper's paired minimum alone has no on-chain effect for a direct pair.`}else if(o==="chop_unfarm"){await L(u,r.helper,s);let e=c(n.amount),t=c(n.minLogOut),a=c(n.minPairedOut),m=await V(u,n.deadline,i);if(x(await $(u,i.staking.address,"withdrawableStake",[d],s))<e)throw new h("Chop stake is still locked or too small. Wait at least 10 minutes after staking.");C(i.staking,r.helper.address,e),P(r.helper.address,"unstakeAndRemoveLP",[p,e,t,a,m]),v(i.staking,e),w(i.log,t),w(i.paired,a),k=`Unfarm ${e} staked LP base units; on-chain minimums ${t} log and ${a} paired base units; deadline ${m}.`}else{if(await L(u,r.whitelist,s),await $(u,r.whitelist.address,"paused",[r.chop],s)!==!1)throw new h("Chop rewards are paused or their pause state is unavailable.");let e=x(await $(u,i.rewards,"getClaimable",[r.chop,d],s));if(e===0n)throw new h("No CHOP is claimable now. Rewards may still be inside the 10-minute maturity lock.");P(i.rewards,"claimReward",[d]),w({address:y(r.chop),symbol:"CHOP",decimals:18,chainId:4663},e),k=`Harvest at least ${e} CHOP base units to ${d} in the preview. ${H} Allow at least 1,000,000 gas for this call.`}return(o==="chop_farm"||o==="chop_unfarm")&&!A.some(e=>_(e.token.address,r.chop))&&w({address:y(r.chop),symbol:"CHOP",decimals:18,chainId:4663},0n),O(g,f),{built:g,expected:f,rules:A,details:k,facts:i,log:p}}async function ie(l,o,n,d){let{built:p,expected:u,rules:B,details:i,facts:s,log:f}=await D(l,o,n,d),g=await l.preview(p,d);return O(g.txs,u,!0),U(g,B),{txs:p,preview:g,log:f,measuredAtBlock:s.measuredAtBlock,summary:`${R(s)}
|
|
2
2
|
${i}
|
|
3
3
|
Underlying ${s.underlying.address} (decimals ${s.underlying.decimals}); log ${f} (decimals ${s.log.decimals}); paired ${s.paired.address} (decimals ${s.paired.decimals}).`}}export{j as a,z as b,D as c,ie as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as f}from"./L646YWDP.js";import{a as p}from"./43LI5NKJ.js";import{a as u}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{encodeFunctionData as A,getAddress as w,parseAbi as T,parseAbiItem as F}from"viem";var R=[["setOwner(address newOwner)","owner"],["setCurator(address newCurator)","owner"],["setIsSentinel(address account,bool enabled)","owner"],["setName(string name)","owner"],["setSymbol(string symbol)","owner"],["setIsAllocator(address account,bool enabled)","timelock"],["setReceiveSharesGate(address gate)","timelock"],["setSendSharesGate(address gate)","timelock"],["setReceiveAssetsGate(address gate)","timelock"],["setSendAssetsGate(address gate)","timelock"],["setAdapterRegistry(address registry)","timelock"],["addAdapter(address adapter)","timelock"],["removeAdapter(address adapter)","timelock"],["increaseTimelock(bytes4 selector,uint256 duration)","timelock"],["decreaseTimelock(bytes4 selector,uint256 duration)","timelock"],["abdicate(bytes4 selector)","timelock"],["setPerformanceFee(uint256 fee)","timelock"],["setManagementFee(uint256 fee)","timelock"],["setPerformanceFeeRecipient(address recipient)","timelock"],["setManagementFeeRecipient(address recipient)","timelock"],["increaseAbsoluteCap(bytes idData,uint256 cap)","timelock"],["increaseRelativeCap(bytes idData,uint256 cap)","timelock"],["decreaseAbsoluteCap(bytes idData,uint256 cap)","curatorOrSentinel"],["decreaseRelativeCap(bytes idData,uint256 cap)","curatorOrSentinel"],["setForceDeallocatePenalty(address adapter,uint256 penalty)","timelock"],["allocate(address adapter,bytes data,uint256 assets)","allocator"],["deallocate(address adapter,bytes data,uint256 assets)","allocatorOrSentinel"],["setLiquidityAdapterAndData(address adapter,bytes data)","allocator"],["setMaxRate(uint256 rate)","allocator"],["accrueInterest()","any"]],S=R.map(([a,t])=>({abi:F(`function ${a}`),authority:t})),x=T(["function asset() view returns (address)","function owner() view returns (address)","function curator() view returns (address)","function isSentinel(address) view returns (bool)","function isAllocator(address) view returns (bool)","function executableAt(bytes) view returns (uint256)","function abdicated(bytes4) view returns (bool)","function submit(bytes data)","function revoke(bytes data)"]);function M(a,t){if(a==="bool"){if(typeof t!="boolean")throw new n("Boolean operation values must be booleans.");return t}if(typeof t!="string")throw new n("All address, byte, text and integer operation values must be strings.");if(a==="address")return p(t),w(t);if(a==="uint256"){if(!/^\d+$/.test(t)||BigInt(t)>=1n<<256n)throw new n("Integer operation values must be uint256 decimal base-unit strings.");return BigInt(t)}if((a==="bytes"||a==="bytes4")&&!(a==="bytes4"?/^0x[0-9a-f]{8}$/i:/^0x(?:[0-9a-f]{2})*$/i).test(t))throw new n("Invalid hexadecimal operation bytes.");return t}function V(a,t,m,O){return{name:t,inputSchema:{type:"object",additionalProperties:!1,required:["operation","values"],properties:{operation:{type:"string",enum:S.map(i=>i.abi.name),description:"Vault management function to call (role-gated curator, owner, allocator or sentinel actions); values supplies its arguments in order."},values:{type:"array",maxItems:3,items:{oneOf:[{type:"string"},{type:"boolean"}]},description:"Ordered ABI values. Integers are decimal base-unit strings; addresses and bytes are explicit strings."},mode:{enum:["call","submit","revoke"],default:"call",description:"Submit/revoke only for timelocked curator operations. Execution is a separate call after the delay."}}},execute:async(i,c)=>{try{if(p(c),Object.keys(i).some(e=>!["operation","values","mode"].includes(e)))throw new n("Unexpected vault management argument.");let r=S.find(e=>e.abi.name===i.operation);if(!r||!Array.isArray(i.values)||i.values.length!==r.abi.inputs.length)throw new n("Provide a supported operation and its exact ordered values.");let o=i.mode??"call";if(!["call","submit","revoke"].includes(String(o))||o!=="call"&&r.authority!=="timelock")throw new n("Submit/revoke is available only for timelocked curator operations.");let I=r.abi.inputs.map((e,d)=>M(e.type,i.values[d])),l=A({abi:[r.abi],functionName:r.abi.name,args:I}),b=a.clientFor(u);if(await b.getChainId()!==u)throw new n("Vault management requires chain 4663.");let s=(e,d=[])=>b.readContract({address:m,abi:x,functionName:e,args:d}),y=await s("asset");if(typeof y!="string"||w(y)!==w(O.address))throw new n("Vault management requires the pinned vault asset.");let g=e=>typeof e=="string"&&e.toLowerCase()===c.toLowerCase(),C=async e=>e==="any"?!0:e==="owner"?g(await s("owner")):e==="allocator"?await s("isAllocator",[c])===!0:e==="allocatorOrSentinel"?await s("isAllocator",[c])===!0||await s("isSentinel",[c])===!0:g(await s("curator"))||e==="curatorOrSentinel"&&await s("isSentinel",[c])===!0;if(r.authority==="timelock"&&o==="call"){let[e,d,D]=await Promise.all([s("executableAt",[l]),s("abdicated",[l.slice(0,10)]),b.getBlock()]);if(f(e)===0n||f(e)>D.timestamp||d!==!1)throw new n("This exact operation has not matured or its selector is abdicated. Submit it with the curator, then wait for its executable time.")}else if(!await C(o==="submit"?"timelock":o==="revoke"?"curatorOrSentinel":r.authority))throw new n("This wallet does not hold the required vault management role. No transaction was built.");let $=o==="call"?l:A({abi:x,functionName:o==="submit"?"submit":"revoke",args:[l]}),k=`${o} ${r.abi.name} on ${m}; ordered values ${JSON.stringify(i.values)}. ${r.abi.name==="abdicate"?"Abdication is irreversible.":""}`,h=[a.unsignedTx({to:m,data:$,value:"0",chainId:u,description:k})],v=await a.preview(h,c);return{txs:h,preview:v,summary:`${k} ${v.summary} ${o==="submit"?"Submission schedules this exact operation; it does not execute the configuration change.":"Role, cap and timing checks can change before execution."}`}}catch(r){throw new n(a.plainError(r))}}}}export{S as a,M as b,V as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as s,j as h,k as p,m as E,n as C,p as T,r as O,v as w,y as L}from"./QJNLLI6N.js";import{b as P,c as I,e as k,g as S}from"./NWNYJ26T.js";import{a as $}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{a as D}from"./JXOEJPJ4.js";import{getAddress as R}from"viem";var u={type:"integer",minimum:1},l={type:"string",minLength:1,maxLength:512},_={type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},g={type:"integer",minimum:1,maximum:100},v={limit:{...g,description:"Maximum number of results."},cursor:{...l,description:"Continuation cursor from a previous page."}},M={relay_chain_health:"Read Relay service health. chainId is required.",relay_requests:"Page this wallet\u2019s requests. Requires server OAK_RELAY_API_KEY; the wallet filter is automatic. Optional id, chain and status filters narrow results.",relay_balance_events:"Page this wallet\u2019s balance events. Requires server OAK_RELAY_API_KEY with access to this resource.",relay_exchange_rates:"Read reference rates without a freshness guarantee. Relay may be unavailable; use relay_token_price for an individual token."};function q(n,r){if(r.type==="string"){if(typeof n!="string"||n.length<Number(r.minLength??0)||n.length>Number(r.maxLength??1024)||typeof r.pattern=="string"&&!new RegExp(r.pattern).test(n))throw new d("Provide a valid Relay search, address or cursor.")}else if(r.type==="integer"){if(typeof n!="number"||!Number.isSafeInteger(n)||n<Number(r.minimum??0)||n>Number(r.maximum??Number.MAX_SAFE_INTEGER))throw new d("Provide an integer within the Relay parameter bounds.")}else{if(r.type==="boolean"&&typeof n!="boolean")throw new d("Provide a boolean Relay filter.");if(r.type==="array"){if(!Array.isArray(n)||n.length>100)throw new d("Provide at most 100 Relay search values.");for(let i of n)q(i,s(r.items))}}if(Array.isArray(r.enum)&&!r.enum.includes(n))throw new d("Choose a supported Relay filter.")}function y(n){return new URLSearchParams(Object.entries(n).map(([r,i])=>[r==="cursor"?"continuation":r,String(i)])).toString()}function x(n){if(n!=null)return q(n,l),n}function m(n){return typeof n=="string"?P.test(n)?R(n.toLowerCase()):/^(?:0x[0-9a-fA-F]{64}|-?\d+(?:\.\d+)?)$/.test(n)?n:D(n):Array.isArray(n)?n.map(m):k(n)?Object.fromEntries(Object.entries(n).filter(([r])=>!/api.?key|signature|authorization|secret/i.test(r)).map(([r,i])=>[r,m(i)])):n}function A(n){return h(n).map(r=>{let i=s(r),e=i.decimals;if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255||typeof i.address!="string")throw new d("Relay returned invalid currency metadata.");let t=i.vmType===void 0||i.vmType==="evm";return{chainId:E(i.chainId),address:t?R(p(i.address)):D(i.address),symbol:w(i.symbol)??"unknown",decimals:e,vmType:w(i.vmType),verified:k(i.metadata)&&i.metadata.verified===!0}})}var B=["relay_vault_status","relay_currencies","relay_token_price","relay_currency_classifications","relay_liquidity","relay_swap_sources","relay_requests","relay_app_fee_balance","relay_app_fee_claims","relay_balance_events","relay_deposit_address","relay_recovery_balances","relay_withdrawal_status","relay_chain_health","relay_token_details","relay_token_chart","relay_trending","relay_exchange_rates","relay_protocol_execution"],X=n=>{let r=L(n);function i(e,t,a,o){return{name:e,inputSchema:{type:"object",...M[e]?{description:M[e]}:{},additionalProperties:!1,properties:t,required:a},execute:async(c,b)=>{for(let f of a)if(c[f]===void 0)throw new d(`Provide ${f} for ${e}.`);for(let[f,j]of Object.entries(c)){if(!Object.hasOwn(t,f))throw new d(`Unsupported ${e} parameter ${f}.`);q(j,t[f])}return o(c,p(b))}}}return{tools:[i("relay_chain_health",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/health?${y(e)}`));if(typeof t.healthy!="boolean")throw new d("Relay returned invalid chain health.");return{healthy:t.healthy,chainId:e.chainId}}),i("relay_token_details",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}`));if(t.chainId!==e.chainId||p(t.address)!==p(e.address))throw new d("Relay returned another token.");return{token:A([t])[0],data:m(t)}}),i("relay_token_chart",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."},timeframe:{type:"string",enum:["5M","1H","4H","24H","7D","30D","MAX"],description:"Chart period: 5M = 5 minutes, 1H = 1 hour, 4H = 4 hours, 24H = 1 day, 7D = 7 days, 30D = 30 days, MAX = all history."}},["chainId","address"],async e=>{let t=s(await r(`/chains/${e.chainId}/currencies/${p(e.address)}/chart?${y(e.timeframe===void 0?{}:{timeframe:e.timeframe})}`));return{chainId:e.chainId,address:R(p(e.address)),data:m(t),summary:"Relay historical market data. Chart prices and volumes are not token base-unit balances."}}),i("relay_trending",{chainId:{...u,description:"Chain ID."},limit:{...g,maximum:20,description:"Maximum number of results, from 1 to 20."},sortBy:{type:"string",enum:["relay24hBuyTxCount","relay24hBuyUsdVolume","coingecko6hTrending"],description:"Sort by 24-hour buy count, 24-hour USD volume, or six-hour CoinGecko trending."}},[],async e=>({currencies:A(await r(`/currencies/trending?${y(e)}`))})),i("relay_exchange_rates",{},[],async()=>({rates:m(s(await r("/prices/rates"))),summary:"Relay reference rates; timestamps are not supplied. These are prices, not token base-unit amounts."})),i("relay_protocol_execution",{id:{..._,description:"Protocol execution idempotency key as a 0x-prefixed 32-byte hex string."}},["id"],async e=>{let t=s(await r(`/protocol/executions/${e.id}`)),a=s(t.execution);if(!S(T(a.idempotencyKey),String(e.id)))throw new d("Relay returned another protocol execution.");return{data:m(t),summary:"Oracle execution status only; this does not prove a destination bridge fill."}}),i("relay_currencies",{chainIds:{type:"array",items:u,description:"Chain IDs to search."},term:{...l,maxLength:256,description:"Token search term."},address:{...l,description:"Token address filter."},currencyId:{...l,description:"Relay currency ID filter."},symbol:{...l,description:"Token symbol filter."},groupID:{...l,description:"Relay currency group ID filter."},tokens:{type:"array",items:l,description:"Token identifiers to filter."},verified:{type:"boolean",description:"Filter by Relay verification status."},defaultList:{type:"boolean",description:"Filter by Relay default-list status."},includeAllChains:{type:"boolean",description:"Include currencies on all chains."},useExternalSearch:{type:"boolean",description:"Include external search results."},depositAddressOnly:{type:"boolean",description:"Include only deposit-address currencies."},limit:{...g,description:"Maximum number of results."}},[],async e=>({currencies:A(await r("/currencies/v2",{chainIds:[$],...e})),summary:"Relay currency search. Provider verification is not an Oak token endorsement; obtain a quote to check route availability."})),i("relay_token_price",{chainId:{...u,description:"Chain ID."},address:{...I,description:"Token address filter."}},["chainId","address"],async e=>{let t=s(await r(`/currencies/token/price/v2?${y(e)}`));if(typeof t.price!="string"||!/^\d+(?:\.\d+)?$/.test(t.price))throw new d("Relay returned an invalid USD price.");return{chainId:e.chainId,address:R(p(e.address)),priceUsd:t.price,summary:"Relay USD price; freshness is not supplied by this endpoint."}}),i("relay_currency_classifications",{},[],async()=>{let e=s(await r("/currencies/classifications"));return{major:h(e.major).map(t=>w(t)??"unknown"),stable:h(e.stable).map(t=>w(t)??"unknown")}}),i("relay_liquidity",{chainId:{...u,description:"Chain ID."}},["chainId"],async e=>{let t=s(await r(`/chains/liquidity?${y(e)}`));return{liquidity:h(t.liquidity).map(a=>{let o=s(a);if(o.chainId!==e.chainId)throw new d("Relay liquidity chain does not match the request.");return{...A([o])[0],amount:C(o.balance)}}),summary:"Relay solver balances are indicative capacity, not a reserved route or user funds."}}),i("relay_swap_sources",{chainId:{...u,description:"Chain ID."}},[],async e=>({sources:h(s(await r(`/swap-sources?${y(e)}`)).sources).map(t=>w(t,"name")??"unknown")})),i("relay_requests",{...v,originChainId:{...u,description:"Origin chain ID filter."},destinationChainId:{...u,description:"Destination chain ID filter."},chainId:{...u,description:"Chain ID."},id:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},orderId:{..._,description:"Relay order ID as a 0x-prefixed 32-byte hex string."},depositTxHash:{..._,description:"Deposit transaction hash as a 0x-prefixed 32-byte hex string."},fillTxHash:{..._,description:"Fill transaction hash as a 0x-prefixed 32-byte hex string."},refundTxHash:{..._,description:"Refund transaction hash as a 0x-prefixed 32-byte hex string."},status:{type:"string",enum:["success","failure","refund","pending","depositing"],description:"Filter by success, failure, refund, pending or depositing status."},includeChildRequests:{type:"boolean",description:"Include child requests."}},[],async(e,t)=>{let a=s(await r(`/requests/v3?${y({...e,user:t,includePendingRequests:!0})}`)),o=h(a.requests).map(s);for(let c of o){let b=k(c.depositAddress)?c.depositAddress.depositor:void 0;if(![c.user,c.sender,b].some(f=>typeof f=="string"&&f.toLowerCase()===t))throw new d("Relay returned a request for another wallet.");T(c.id)}return{requests:m(o),nextCursor:x(a.continuation),summary:"One page of this wallet\u2019s Relay requests, including pending requests. Pass nextCursor as cursor to resume; provider success is not destination receipt verification."}}),i("relay_app_fee_balance",{},[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/balances`));return{balances:h(a.balances).map(o=>{let c=O(o);return{...c,token:{...c.token,address:R(c.token.address),symbol:w(c.token.symbol)??"unknown"}}}),summary:"Off-chain Relay app fee credits for this wallet. Claiming requires separate local signature integration."}}),i("relay_app_fee_claims",v,[],async(e,t)=>{let a=s(await r(`/app-fees/${t}/claims?${y(e)}`)),o=h(a.claims).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a fee claim for another wallet.");return{claims:m(o),nextCursor:x(a.continuation)}}),i("relay_balance_events",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},requestId:{..._,description:"Relay request ID as a 0x-prefixed 32-byte hex string."},chainId:{...u,description:"Chain ID."},currency:{...I,description:"Token address filter."},startTimestamp:{type:"integer",minimum:0,description:"Start time in Unix seconds."},endTimestamp:{type:"integer",minimum:0,description:"End time in Unix seconds."},type:{...l,description:"Balance event type filter."}},[],async(e,t)=>{let a=s(await r(`/balance/${t}/events?${y(e)}`));if(p(a.wallet)!==t)throw new d("Relay returned balance events for another wallet.");let o=h(a.events).map(s);for(let c of o)if(p(c.wallet)!==t)throw new d("Relay returned a balance event for another wallet.");return{events:m(o),nextCursor:x(a.continuation)}}),i("relay_deposit_address",{address:{...l,description:"Deposit address to look up; supply this or depositAddressId."},depositAddressId:{...l,description:"Relay deposit address ID; supply this or address."},pageSize:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},pageToken:{...l,description:"Page token from a previous response."}},[],async e=>{if(e.address===void 0==(e.depositAddressId===void 0))throw new d("Provide exactly one deposit address or depositAddressId.");let t=s(await r(`/deposit-addresses/v2?${y(e)}`)),a=s(t.data),o=s(a.depositAddress);if(e.address!==void 0&&o.address!==e.address||e.depositAddressId!==void 0&&o.id!==e.depositAddressId)throw new d("Relay returned another deposit address.");return{data:m(a),nextPageToken:x(a.nextPageToken),summary:"Deposit address monitoring only. Reading an address does not create, change, fund or recover it."}}),i("relay_recovery_balances",{...v,limit:{...g,maximum:50,description:"Maximum number of results, from 1 to 50."},ownerChainId:{...u,description:"Recovery owner chain ID."}},["ownerChainId"],async(e,t)=>{let a=s(await r(`/withdrawals/balances?${y({...e,recoveryAddress:t})}`)),o=h(a.balances).map(c=>{let b=s(c);return C(b.amount),b});return{balances:m(o),nextCursor:x(a.continuation),summary:"Credited recovery balances only. Empty balances do not prove that an unattested deposit has no recoverable funds. Withdrawal signing remains a separate action."}}),i("relay_withdrawal_status",{id:{...l,description:"Relay withdrawal job ID."}},["id"],async e=>{let t=s(await r(`/withdrawals/status?${y(e)}`));if(typeof t.status!="string")throw new d("Relay returned an invalid withdrawal status.");return{status:w(t.status)??"unknown",data:m(t),summary:"Relay withdrawal job status; verify any reported transaction on its chain before treating funds as received."}})]}};export{B as a,X as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./4TTDAF4B.js";import{a}from"./3CH2IPQL.js";import{isAddress as h}from"viem";function u(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new r;return e}function w(e){if(typeof e!="string"||!e.length)throw new r;return e}function f(e){if(typeof e!="string"||!h(e,{strict:!1}))throw new r;return e}function p(e,o){let n=u(e);if(n.x402Version!==o||!Array.isArray(n.accepts)||n.accepts.length!==1)throw new r;let t=u(n.accepts[0]),i=u(t.extra);if(t.scheme!=="exact"||t.network!==(o===1?"robinhood":"eip155:4663"))throw new r;let c=w(o===1?t.maxAmountRequired:t.amount);if(!/^[1-9][0-9]*$/.test(c)||typeof t.maxTimeoutSeconds!="number"||!Number.isInteger(t.maxTimeoutSeconds))throw new r;return{x402Version:o,terms:{scheme:"exact",network:"eip155:4663",amount:c,asset:f(t.asset),payTo:f(t.payTo),maxTimeoutSeconds:t.maxTimeoutSeconds,resourceUrl:w(o===1?t.resource:u(n.resource).url),extra:{name:w(i.name),version:w(i.version)}}}}function d(e,o){try{if(typeof o!="string"||!o.length||o.length>32768||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(o))throw new r;let n=Buffer.from(o,"base64"),t=n.toString("utf8");if(!Buffer.from(t,"utf8").equals(n))throw new r;let i=p(e,1),c=p(JSON.parse(t),2),s=i.terms,m=c.terms;if(s.scheme!==m.scheme||s.network!==m.network||s.amount!==m.amount||s.asset!==m.asset||s.payTo!==m.payTo||s.maxTimeoutSeconds!==m.maxTimeoutSeconds||s.resourceUrl!==m.resourceUrl||s.extra.name!==m.extra.name||s.extra.version!==m.extra.version)throw new r;return{v1:i,v2:c,terms:s}}catch{throw new r}}function x(e){if(typeof e!="number"||!Number.isInteger(e)||e<1||e>50)throw new Error("Use whole dollars from 1 to 50.");return(BigInt(e)*1000000n).toString()}function l(e,o){try{let n=x(o);if(e.scheme!=="exact"||e.network!=="eip155:4663"||e.amount!==n||f(e.asset).toLowerCase()!==a.usdg.toLowerCase()||f(e.payTo).toLowerCase()!==a.payTo.toLowerCase()||!Number.isInteger(e.maxTimeoutSeconds)||e.maxTimeoutSeconds<60||e.maxTimeoutSeconds>300||e.resourceUrl!==`${a.apiOrigin}${a.topupPath}?usd=${o}`||e.extra.name!==a.usdgDomain.name||e.extra.version!==a.usdgDomain.version)throw new r}catch{throw new r}}export{d as a,x as b,l as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,b as T,f as c,g as v,i as E}from"./PV5FDT6O.js";import{c as a,g as O}from"./NWNYJ26T.js";import{a as m}from"./FWD4L3CJ.js";import{a as s}from"./XSD5NL7J.js";import{encodeFunctionData as $,parseAbi as x}from"viem";var F=["function owner() view returns (address)","function admins(address) view returns (bool)","function allowedDepositors(address) view returns (bool)","function setAdmin(address,bool)","function setDeprecated(bool)","function setTeamFeeRecipient(address)","function claimTeamFees(address)","function setHook(address,bool)","function setLocker(address,address,bool)","function setMevModule(address,bool)","function setExtension(address,bool)","function addDepositor(address)","function storeFees(address,address,uint256)","function claim(address,address)","function withdrawETH(address)","function withdrawERC20(address,address)","function transferOwnership(address)","function renounceOwnership()"],h=x(F),g={setAdmin:{contract:"factory",fields:["target","enabled"],admin:!1},setDeprecated:{contract:"factory",fields:["enabled"],admin:!1},setTeamFeeRecipient:{contract:"factory",fields:["recipient"],admin:!1},claimTeamFees:{contract:"factory",fields:["token"],admin:!0},setHook:{contract:"factory",fields:["target","enabled"],admin:!0},setLocker:{contract:"factory",fields:["target","hook","enabled"],admin:!0},setMevModule:{contract:"factory",fields:["target","enabled"],admin:!0},setExtension:{contract:"factory",fields:["target","enabled"],admin:!0},addDepositor:{contract:"fee_locker",fields:["target"],admin:!1},withdrawETH:{contract:"locker",fields:["recipient"],admin:!1},withdrawERC20:{contract:"locker",fields:["token","recipient"],admin:!1}},N=p=>{let w=()=>p.clientFor(m),k=async(e,t,o)=>({txs:e,preview:await p.preview(e,t),summary:o}),y=(e,t,o,r)=>p.unsignedTx({to:e,chainId:m,data:$({abi:h,functionName:t,args:o}),value:"0",description:r}),_={operation:{enum:[...Object.keys(g),"transferOwnership","renounceOwnership"],description:"Owner or admin call on a pinned Clanker contract: toggle admins, hooks, lockers, MEV modules, extensions or depositors, claim team fees, withdraw assets, or change ownership."},contract:{enum:["factory","locker","fee_locker"],description:"Which pinned Clanker contract to call; required only for transferOwnership and renounceOwnership, otherwise implied by the operation."},target:{...a,description:"Address of the admin, hook, locker, MEV module, extension or depositor being configured."},hook:{...a,description:"Address of the pool hook the locker is enabled for; used by setLocker."},token:{...a,description:"Address of the ERC-20 token to claim team fees on or withdraw."},recipient:{...a,description:"Address that receives funds, the new fee recipient, or the new owner, depending on the operation."},enabled:{type:"boolean",description:"True to enable (or deprecate, for setDeprecated) the target; false to disable."}},b=(e,t,o,r)=>({name:`clanker_${e}`,inputSchema:{type:"object",properties:t,required:o,additionalProperties:!1},execute:async(n,i)=>{try{return E(n,Object.keys(t)),await r(n,c(i))}catch(d){throw new s(p.plainError(d))}}});return{tools:[b("protocol_admin",_,["operation"],async(e,t)=>{let o=String(e.operation),r=o==="transferOwnership"||o==="renounceOwnership";if(!r&&!Object.hasOwn(g,o))throw new s("Choose a supported Clanker protocol operation.");let n=r?void 0:g[o],i=n?.contract??e.contract;if(i!=="factory"&&i!=="locker"&&i!=="fee_locker")throw new s("Select factory, locker or fee_locker for an ownership change.");if(!r&&e.contract!==void 0&&e.contract!==i)throw new s("This operation targets a different pinned contract.");let d=n?.fields??(o==="transferOwnership"?["recipient"]:[]);for(let l of["target","hook","token","recipient","enabled"])if(e[l]!==void 0&&!d.includes(l))throw new s(`Input ${l} does not match this protocol operation.`);let u=f[i].address,D=c(await w().readContract({address:u,abi:h,functionName:"owner"}),!0);if(!O(D,t)&&(n?.admin&&await w().readContract({address:u,abi:h,functionName:"admins",args:[t]}))!==!0)throw new s("The connected wallet lacks the required Clanker protocol owner/admin role.");let A=d.map(l=>{if(l!=="enabled")return c(e[l]);if(typeof e.enabled!="boolean")throw new s("Provide enabled as boolean.");return e.enabled}),C=`Clanker protocol ${i}: ${o} ${JSON.stringify(A)}. Owner/admin operation; renouncing ownership permanently removes owner-only controls. Withdrawals transfer the entire recorded asset balance; team fees go to the configured team recipient.`;return k([y(u,o,A,C)],t,C)}),b("store_fees",{token:{...a,description:"Address of the ERC-20 token whose fees are deposited."},recipient:{...a,description:"Address of the fee owner who can later claim these fees."},amount:{...T,description:'Amount of the token to deposit, in base units of that token (read its decimals). Example: "1000000000000000000" = 1 token at 18 decimals.'}},["token","recipient","amount"],async(e,t)=>{let o=c(e.token),r=c(e.recipient),n=v(e.amount);if(!n)throw new s("Provide a positive fee deposit amount.");if(await w().readContract({address:f.fee_locker.address,abi:h,functionName:"allowedDepositors",args:[t]})!==!0)throw new s("This wallet is not an authorized Clanker fee depositor.");let d=`Deposit exactly ${n} base units of token ${o} into Clanker fees for ${r}. Fee-on-transfer receipts may be smaller; the recorded recipient can later claim them.`,u=[p.approval(o,f.fee_locker.address,n.toString(),m),y(f.fee_locker.address,"storeFees",[r,o,n],d)];return k(u,t,d)}),b("claim_for",{token:{...a,description:"Address of the fee token to claim for the owner."},recipient:{...a,description:"Address of the fee owner whose collected fees are claimed; receipts go to this address."}},["token","recipient"],async(e,t)=>{let o=c(e.token),r=c(e.recipient),n=`Permissionlessly claim already-collected Clanker ${o} fees for ${r}; all receipts go to that fee owner, while ${t} pays gas.`;return k([y(f.fee_locker.address,"claim",[r,o],n)],t,n)})]}};export{N as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as se,t as W,y as G}from"./BAIY32AV.js";import{d as ke}from"./XYPGLG6A.js";import{a as de,b as oe,c as pe,e as ne,f as ye,g as fe,h as K,i as b,j as g,l as _,m as U,o as N,p as B,q,s as V,u as $,v as D}from"./2E4I7CJ7.js";import{b as X,g as O,h as E,i as ue,j as me}from"./MQK6OP7S.js";import{a as j}from"./G2LAO23N.js";import{c as ee}from"./NWNYJ26T.js";import{a as i}from"./XSD5NL7J.js";import{encodeAbiParameters as Oe,getAddress as we,keccak256 as Ke,parseAbi as je,toHex as ce,zeroAddress as ze}from"viem";import{encodeAbiParameters as he,encodePacked as Ce,getAddress as Fe,keccak256 as re,parseAbi as Le,toHex as Re,zeroAddress as be}from"viem";var ve=1n<<256n,Ne=1n<<128n,Te=Le(["function extsload(bytes32[] slots) view returns (bytes32[])"]),Q=(o,n,e)=>({type:"object",additionalProperties:!1,properties:o,required:n,...e===void 0?{}:{description:e}}),Ue={description:"Hookr LP position, chosen by kind: a launcher family member, a position NFT, or an agent-account position.",oneOf:[Q({kind:{const:"family",description:j.enumValues({family:"one member position of a Hookr launcher family"})},launcher:{...ee,description:"Address of the Hookr launcher contract that created the family."},familyId:{...oe,description:"Bytes32 hex id of the launcher family (0x plus 64 hex digits)."},member:{type:"string",enum:["0","1","2","3","4","5","6","7"],description:'Member index within the family, a decimal string from "0" to "7".'}},["kind","launcher","familyId","member"],"Hookr family LP position: one member of a launcher family, identified by launcher, familyId and member."),Q({kind:{const:"nft",description:j.enumValues({nft:"a position held as an NFT"})},tokenId:{...de,description:j.id("position NFT")}},["kind","tokenId"]),Q({kind:{const:"agent-account",description:j.enumValues({"agent-account":"a position held by an agent account"})},account:{...ee,description:j.address("agent account that holds the position")},positionId:{...oe,description:"Bytes32 hex id of the position within the agent account (0x plus 64 hex digits)."}},["kind","account","positionId"])]};function qe(o){let n=U(o);if(n.kind!=="family")throw new i("This step supports Launcher family positions only. NFT and agent-account position reads are reserved for a later integration.");ne(n,["kind","launcher","familyId","member"],["kind","launcher","familyId","member"]);let e=ye(n.member,8);if(e>7n)throw new i("Hookr family member must be a decimal string from 0 to 7.");return{kind:"family",launcher:me(n.launcher),familyId:K(n.familyId),member:e.toString()}}var A=o=>Re(BigInt.asUintN(256,o),{size:32}),te=(o,n)=>re(he([{type:"bytes32"},{type:"bytes32"}],[o,n]));function ie(o,n,e,a,r,H){let h=te(o,A(6n)),P=m=>te(A(BigInt(m)),A(BigInt(h)+4n)),p=re(he([{type:"bytes32"},{type:"uint8"}],[e,a])),c=re(Ce(["address","int24","int24","bytes32"],[n,r,H,p])),u=te(c,A(BigInt(h)+6n));return[h,A(BigInt(h)+1n),A(BigInt(h)+2n),A(BigInt(P(r))+1n),A(BigInt(P(r))+2n),A(BigInt(P(H))+1n),A(BigInt(P(H))+2n),u,A(BigInt(u)+1n),A(BigInt(u)+2n)]}function J(o,n,e,a,r,H){return BigInt.asUintN(256,a<r?n-e:a>=H?e-n:o-n-e)}function Y(o,n,e){if(o<0n||o>=1n<<128n||[n,e].some(a=>a<0n||a>=ve))throw new i("Hookr fee inputs are outside the verified v4 layout.");return o*BigInt.asUintN(256,n-e)/Ne}function ae(o){let n=U(o),e={currency0:b(n.currency0),currency1:b(n.currency1),fee:Number(g(n.fee,24)),tickSpacing:Number(g(n.tickSpacing,24)),hooks:b(n.hooks)};if(BigInt(e.currency0)>=BigInt(e.currency1)||e.fee!==8388608||e.hooks!==q||e.tickSpacing<1||e.tickSpacing>32767)throw new i("Hookr family PoolKey is not a supported Root dynamic-fee pool.");return e}async function Ve(o,n,e,a){let r=await E(o,a),H={},h=new Set,P=(t,k=[])=>B(o,e.launcher,N(e.launcher===Fe(X.launcherV1)?"launcherV1":"launcher"),t,k,r.number),p=async(t,k)=>{try{return await k()}catch(x){return H[t]=x instanceof i?x.message:`Hookr ${t} read failed at block ${r.number}. Retry the named-block read; no zero or empty result is implied.`,null}},c={chainId:4663,blockNumber:r.number.toString(),blockHash:r.hash,position:e,owner:null,ownedByWallet:null,poolId:null,poolKey:null,range:null,liquidity:null,tokens:null,principal:null,uncollectedLpFees:null,collectedLpFees:null,claimableCoreCredits:null,poolPendingRecapture:null,inRange:null,gateStatus:null,locks:null},u=async()=>(await ue(o,r),{...c,readStatus:{status:Object.keys(H).length?"partial":"complete",reasons:H},warnings:["collectedLpFees is null: no complete collection-history reconstruction is available in this step.","LP fees can include donations already released into v4 fee growth. Pending recapture is pool-level, unallocated and excluded from LP fees.","Principal is current withdrawable token inventory before fees, gas or price changes; it is not the original deposit value."]});if(await p("pins",async()=>(await O(o,r.number,[e.launcher,q,V],h),!0))===null)return u();let m=await p("owner",async()=>{let t=b(await P("familyOwner",[e.familyId]));if(t===be)throw new i("Hookr family does not exist at this block. Check its Launcher and family ID.");return t});if(m===null)return u();c.owner=m,c.ownedByWallet=m===n;let R=await p("position",async()=>{let[t,k,x]=await Promise.all([P("memberCount",[e.familyId]),P("position",[e.familyId,Number(e.member)]),P("poolManager")]);if(x!==V||g(t,8)>8n||BigInt(e.member)>=g(t,8))throw new i("Hookr family member or PoolManager is invalid.");let w=U(k),d=ae(w.key);if(typeof w.tickLower!="number"||typeof w.tickUpper!="number")throw new i("Hookr position range is incomplete.");G(w.tickLower,w.tickUpper,d.tickSpacing);let s=g(w.liquidity,128),L=W(d);if(await P("poolFamily",[L])!==e.familyId)throw new i("Hookr pool does not belong to this family.");return{key:d,id:L,tickLower:w.tickLower,tickUpper:w.tickUpper,liquidity:s}});if(R===null)return u();let{key:l,id:y,tickLower:C,tickUpper:I,liquidity:v}=R;c.poolKey=l,c.poolId=y,c.range={tickLower:C,tickUpper:I},c.liquidity=v.toString();let[f,T,F]=await Promise.all([p("tokens",()=>Promise.all([D(o,l.currency0,r.number),D(o,l.currency1,r.number)])),p("feeGrowth",async()=>{let t=ie(y,e.launcher,e.familyId,Number(e.member),C,I),k=await B(o,V,Te,"extsload",[t],r.number),x=_(k,10).map(Ae=>BigInt(K(Ae))),[w,d,s,L,Z,S,z,Ie,xe,He]=x,le=w&(1n<<160n)-1n,M=Number(BigInt.asIntN(24,w>>160n));if(le===0n||M<-887272||M>887272||Ie!==v)throw new i("Hookr PoolManager position is uninitialized or differs from the Launcher liquidity. No principal or fee amount is inferred.");let Se=J(d,L,S,M,C,I),Be=J(s,Z,z,M,C,I);return{sqrtPriceX96:le,tick:M,fee0:Y(v,Se,xe),fee1:Y(v,Be,He)}}),p("poolConfig",async()=>{let t=U(await B(o,q,N("rootV1"),"poolConfig",[y],r.number));if(b(t.liquidityOwner)!==e.launcher||![l.currency0,l.currency1].includes(b(t.subject))||![l.currency0,l.currency1].includes(b(t.quote))||t.subject===t.quote)throw new i("Hookr pool configuration differs from this family position.");let k=b(t.rules),x=$(k);return await O(o,r.number,[k],h),{pc:t,core:k,role:x}})]);if(c.tokens=f,T&&(c.inRange=T.tick>=C&&T.tick<I,f)){let t=se({liquidity:v,tickLower:C,tickUpper:I,sqrtPriceX96:T.sqrtPriceX96});c.principal=[{token:f[0],amount:t.amount0.toString()},{token:f[1],amount:t.amount1.toString()}],c.uncollectedLpFees=[{token:f[0],amount:T.fee0.toString()},{token:f[1],amount:T.fee1.toString()}]}if(F){let t=(s,L=[])=>B(o,F.core,N("rulesV1"),s,L,r.number),[k,x,w,d]=await Promise.all([p("gateStatus",async()=>{let s=b(F.pc.advisory);return s!==be&&await O(o,r.number,[s],h),ke(o,r.number,y,e.launcher,s)}),p("locks",async()=>ge(o,{position:e,block:r,poolId:y,core:F.core,role:F.role})),p("claimableCoreCredits",async()=>{if(!f)throw new i("Read token metadata before displaying core credits.");let s=await t("poolAccruedCurrencies",[y]);if(!Array.isArray(s)||s.length>32||s.some(S=>S!==l.currency0&&S!==l.currency1))throw new i("Core accrual includes unmeasured currencies; read the core directly before collecting.");let[L,Z]=await Promise.all([Promise.all([l.currency0,l.currency1].map(S=>t("poolAccrued",[y,S]))),Promise.all([l.currency0,l.currency1].map(S=>B(o,F.core,N(F.role),"claimable",[S,n],r.number)))]);return{core:F.core,familyOwnerAccrual:L.map((S,z)=>({token:f[z],amount:g(S).toString()})),walletCredits:Z.map((S,z)=>({token:f[z],amount:g(S).toString()})),walletCreditsScope:"Core-wide wallet credits, not attributed to this position. Do not add them to LP fees."}}),p("poolPendingRecapture",async()=>{if(!f)throw new i("Read token metadata before displaying pending recapture.");let s=_(await t("pendingDonation",[y]),5).map(L=>g(L));return{due:[{token:f[0],amount:s[0].toString()},{token:f[1],amount:s[1].toString()}],fresh:[{token:f[0],amount:s[2].toString()},{token:f[1],amount:s[3].toString()}],freshChildBlock:s[4].toString(),scope:"pool",allocatedToPosition:!1}})]);c.gateStatus=k,c.locks=x,c.claimableCoreCredits=w,c.poolPendingRecapture=d}return u()}function Ze(o){return[{name:"hookr_lp_position",inputSchema:Q({position:Ue,...pe},["position"]),execute:async(n,e)=>{ne(n,["position","blockNumber"],["position"]);let a=qe(n.position);if(o.network==="testnet")throw new i("Hookr LP reads are configured only on mainnet, chain 4663.");try{return await Ve(o.clientFor(4663),e,a,fe(n))}catch(r){throw r instanceof i?r:new i("Hookr position block is unavailable. Retry the complete named-block read; no zero position or fee is implied.")}}}]}var Pe=o=>N(o.launcher===we(X.launcherV1)?"launcherV1":"launcher");function Me(o){let n=Ke(Oe([{type:"bytes32"},{type:"bytes32"}],[o,"0x3c0d3d8cba92527b3a48aa783c8734a4e170057eb16401c9df8a7c8a6588b900"]));return ce(BigInt(n)+5n,{size:32})}async function _e(o,n){try{let e="0x0000000000000000000000000000000000000a11",a=await o.request({method:"eth_call",params:[{to:e,data:"0x"},ce(n.number),{[e]:{code:"0x4360005260206000f3"}}]});return BigInt(K(a))}catch{throw new i("Hookr parent-block clock is unavailable. Retry with an RPC supporting named-block eth_call state overrides; child-chain height cannot establish lock expiry.")}}async function co(o,n,e){let a=await E(o);await O(o,a.number,[e.launcher,q,V]);let r=(d,s=[])=>B(o,e.launcher,Pe(e),d,s,a.number),[H,h,P,p]=await Promise.all([r("familyOwner",[e.familyId]),r("memberCount",[e.familyId]),r("position",[e.familyId,Number(e.member)]),r("poolManager")]),c=b(H);if(c===ze||c!==n)throw new i("Only the current Hookr family owner can add, collect or remove this position. Use its signing wallet.");if(p!==V||g(h,8)<1n||g(h,8)>8n||BigInt(e.member)>=g(h,8))throw new i("Hookr family member or PoolManager differs from the reviewed deployment.");let u=U(P),m=ae(u.key),R=g(u.liquidity,128);if(typeof u.tickLower!="number"||typeof u.tickUpper!="number")throw new i("Hookr family range is unavailable.");let l=u.tickLower,y=u.tickUpper;G(l,y,m.tickSpacing);let C=W(m);if(await r("poolFamily",[C])!==e.familyId)throw new i("Hookr pool does not belong to this Launcher family.");let I=U(await B(o,q,N("rootV1"),"poolConfig",[C],a.number)),v=b(I.rules),f=$(v);if(b(I.liquidityOwner)!==e.launcher||![m.currency0,m.currency1].includes(b(I.subject))||![m.currency0,m.currency1].includes(b(I.quote))||I.subject===I.quote)throw new i("Hookr pool configuration differs from this family key.");await O(o,a.number,[v]);let[T,F]=await Promise.all([Promise.all([m.currency0,m.currency1].map(d=>D(o,d,a.number))),B(o,V,je(["function extsload(bytes32[] slots) view returns (bytes32[])"]),"extsload",[ie(C,e.launcher,e.familyId,Number(e.member),l,y)],a.number)]),t=_(F,10).map(d=>BigInt(K(d))),k=t[0]&(1n<<160n)-1n,x=Number(BigInt.asIntN(24,t[0]>>160n));if(!k||x<-887272||x>887272||t[7]!==R)throw new i("Hookr PoolManager state differs from the family position. Retry the full read.");let w=[0,1].map(d=>Y(R,J(t[1+d],t[3+d],t[5+d],x,l,y),t[8+d]));return{position:e,block:a,owner:c,key:m,poolId:C,liquidity:R,tickLower:l,tickUpper:y,sqrtPriceX96:k,fees:w,tokens:T,pc:I,core:v,role:f}}async function ge(o,n){let{position:e,block:a,poolId:r,core:H,role:h}=n,[P,p,c,u]=await Promise.all([B(o,e.launcher,Pe(e),"principalLockedUntil",[e.familyId],a.number),B(o,H,N(h),"removalLockedUntil",[r],a.number),o.getStorageAt({address:q,slot:Me(r),blockNumber:a.number}),_e(o,a)]),m=BigInt(K(c));if(we(ce(m&(1n<<160n)-1n,{size:20}))!==e.launcher)throw new i("Hookr frozen Root lock storage does not match the family owner contract.");let R=m>>160n&(1n<<40n)-1n,l=g(P),y=g(p);return{clock:"parent-block",parentBlock:u.toString(),familyUntilParentBlock:l.toString(),poolRulesUntilParentBlock:y.toString(),rootUntilParentBlock:R.toString(),currentlyLocked:u<l||u<y||u<R,feesCollectableDuringPrincipalLocks:!0}}export{Pe as a,Me as b,_e as c,co as d,ge as e,Ue as f,qe as g,ie as h,J as i,Y as j,ae as k,Ve as l,Ze as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as d}from"./E3RACZUY.js";import{fa as S}from"./EI6GGPDS.js";import{h as c,i as R,l as N,m as x}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{erc20Abi as y,isHex as O,keccak256 as _,parseAbi as z}from"viem";var b=z(["function asset() view returns (address)","function decimals() view returns (uint8)","function symbol() view returns (string)","function owner() view returns (address)","function curator() view returns (address)","function adaptersLength() view returns (uint256)","function adapters(uint256) view returns (address)","function parentVault() view returns (address)","function isVaultV2(address) view returns (bool)","function totalAssets() view returns (uint256)","function totalSupply() view returns (uint256)","function convertToAssets(uint256) view returns (uint256)","function previewDeposit(uint256) view returns (uint256)","function performanceFee() view returns (uint256)","function getThreshold() view returns (uint256)","function getOwners() view returns (address[])"]),i=S("setup-mismatch",{}),m=e=>N(R(e,i),i),k=e=>x(e,i);function v(e){if(typeof e!="string"||!O(e,{strict:!0})||e.length<4||e.length%2!==0)throw new n(i);return _(e)}function V(e){if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255)throw new n(i);return e}function I(e,t){return typeof e=="string"&&/^[A-Za-z0-9.$_-]{1,32}$/.test(e)?e:t}async function P(e,t){if(await e.getChainId()!==d.chainId)throw new n("Borro requires chain 4663.");return k(t??await e.getBlockNumber({cacheTime:0}))}async function B(e,t,f){let a=(r,s,p=[])=>e.readContract({address:r,abi:b,functionName:s,args:p,blockNumber:f}),o={ok:!0,drift:[]};for(let r of["owner","curator"])try{o[r]=m(await a(t,r)),c(o[r],d[r])||o.drift.push(r)}catch{o.drift.push(`${r} unreadable`)}try{let r=k(await a(t,"adaptersLength"));if(r>64n)throw new n(i);let s=await Promise.all(Array.from({length:Number(r)},async(p,u)=>{let h=m(await a(t,"adapters",[BigInt(u)]));if(v(await e.getCode({address:h,blockNumber:f})),!c(await a(h,"parentVault"),t))throw new n(i);return h}));if(new Set(s).size!==s.length)throw new n(i);o.adapters=s}catch{o.drift.push("adapters unreadable or invalid")}return o}function $(e=[]){return async(t,f)=>{let a=c(f,d.assetRule.usdg.address)?{...d.assetRule.usdg,chainId:d.chainId}:e.find(o=>o.chainId===d.chainId&&c(o.address,f));return a?{...a,address:m(a.address)}:void 0}}function L(e={resolveAllowedAsset:$()}){return async(t,f,a,o={})=>{try{let r=m(f),s=await P(t,o.blockNumber),[p,u,h,A,T]=await Promise.all([t.getCode({address:d.factory.address,blockNumber:s}),t.readContract({address:d.factory.address,abi:b,functionName:"isVaultV2",args:[r],blockNumber:s}),t.getCode({address:r,blockNumber:s}),t.readContract({address:r,abi:b,functionName:"asset",blockNumber:s}),t.readContract({address:r,abi:b,functionName:"decimals",blockNumber:s})]);if(!c(v(p),d.factory.codeHash)||u!==!0||V(T)!==18)throw new n(i);let D=v(h),g=m(A),C=V(await t.readContract({address:g,abi:y,functionName:"decimals",blockNumber:s})),w;try{w=await e.resolveAllowedAsset(t,g,s)}catch{}if(w&&(!c(w.address,g)||w.chainId!==4663||w.decimals!==C||I(w.symbol,"")===""))throw new n(i);let l=await B(t,r,s);if(w||l.drift.push("asset identity is outside the available official catalogue"),l.drift.length){if(a!=="withdraw"||!o.wallet)throw new n(i);if(k(await t.readContract({address:r,abi:y,functionName:"balanceOf",args:[m(o.wallet)],blockNumber:s}))===0n)throw new n(i)}let H=I(await t.readContract({address:r,abi:y,functionName:"symbol",blockNumber:s}).catch(()=>{}),"shares");return{vault:r,symbol:w?.symbol??"token",vaultSymbol:H,asset:g,assetDecimals:C,codeHash:D,chainId:4663,shareDecimals:18,...l.owner&&{owner:l.owner},...l.curator&&{curator:l.curator},...l.adapters&&{adapters:l.adapters},setup:l,assetAllowed:!!w,mode:a,source:d.factory.source,measuredAtBlock:s.toString(),provenance:{kind:"factory",factory:d.factory.address,isVaultV2:!0}}}catch(r){throw r instanceof n?r:new n(i)}}}var G=L(),J=async(e,t,f)=>{try{let a=await P(e),[o,r,s,p]=await Promise.all([e.getCode({address:t.vault,blockNumber:a}),e.readContract({address:t.vault,abi:b,functionName:"asset",blockNumber:a}),e.readContract({address:t.vault,abi:y,functionName:"decimals",blockNumber:a}),e.readContract({address:t.asset,abi:y,functionName:"decimals",blockNumber:a})]);if(!c(v(o),t.codeHash)||!c(m(r),t.asset)||V(s)!==18||V(p)!==t.assetDecimals)throw new n(i);let u=await B(e,t.vault,a);if(t.adapters&&u.adapters&&(t.adapters.length!==u.adapters.length||t.adapters.some((h,A)=>!c(h,u.adapters[A])))&&u.drift.push("adapters changed"),f==="deposit"&&u.drift.length)throw new n(i);return u}catch(a){throw a instanceof n?a:new n(i)}};export{b as a,i as b,m as c,k as d,v as e,V as f,I as g,P as h,$ as i,L as j,G as k,J as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as a,j as s,k as r,n as i,o as f}from"./QJNLLI6N.js";import{a as p}from"./XSD5NL7J.js";import{hashStruct as g}from"viem";var w={Order:[{name:"version",type:"string"},{name:"solverChainId",type:"string"},{name:"solver",type:"address"},{name:"salt",type:"uint256"},{name:"inputs",type:"Input[]"},{name:"output",type:"Output"},{name:"fees",type:"Fee[]"}],Input:[{name:"payment",type:"InputPayment"},{name:"refunds",type:"InputRefund[]"}],InputPayment:[{name:"chainId",type:"string"},{name:"currency",type:"bytes"},{name:"amount",type:"uint256"},{name:"weight",type:"uint256"}],InputRefund:[{name:"chainId",type:"string"},{name:"recipient",type:"bytes"},{name:"currency",type:"bytes"},{name:"minimumAmount",type:"uint256"},{name:"deadline",type:"uint32"},{name:"extraData",type:"bytes"}],Output:[{name:"chainId",type:"string"},{name:"payments",type:"OutputPayment[]"},{name:"deadline",type:"uint32"},{name:"calls",type:"bytes[]"},{name:"extraData",type:"bytes"}],OutputPayment:[{name:"recipient",type:"bytes"},{name:"currency",type:"bytes"},{name:"minimumAmount",type:"uint256"},{name:"expectedAmount",type:"uint256"}],Fee:[{name:"recipientChainId",type:"string"},{name:"recipient",type:"bytes"},{name:"currencyChainId",type:"string"},{name:"currency",type:"bytes"},{name:"amount",type:"uint256"}]};function A(I,l){let t=a(I);if(t.version!=="v1")throw new p("Relay order ID cannot be verified for this order version. Request a supported v1 quote.");let u=n=>{if(typeof n!="string"||!l.includes(n))throw new p("Relay order ID cannot be verified for an unknown or non-EVM chain.");return n},c=n=>{if(typeof n!="string"||!/^0x(?:[0-9a-fA-F]{2})*$/.test(n))throw new p("Relay order ID cannot be verified with malformed bytes.");return n},d=n=>{let e=f(n);if(e>4294967295)throw new p("Relay order deadline exceeds uint32. Request a new quote.");return e};if(typeof t.salt!="string"||!/^(?:0x[0-9a-fA-F]{1,64}|0|[1-9][0-9]*)$/.test(t.salt)||BigInt(t.salt)>=1n<<256n)throw new p("Relay order ID cannot be verified with an invalid salt.");let y=a(t.output);return g({types:w,primaryType:"Order",data:{version:t.version,solverChainId:u(t.solverChainId),solver:r(t.solver),salt:BigInt(t.salt),inputs:s(t.inputs).map(n=>{let e=a(n),o=a(e.payment);return{payment:{chainId:u(o.chainId),currency:r(o.currency),amount:BigInt(i(o.amount)),weight:BigInt(i(o.weight))},refunds:s(e.refunds).map(h=>{let m=a(h);return{chainId:u(m.chainId),recipient:r(m.recipient),currency:r(m.currency),minimumAmount:BigInt(i(m.minimumAmount)),deadline:d(m.deadline),extraData:c(m.extraData)}})}}),output:{chainId:u(y.chainId),payments:s(y.payments).map(n=>{let e=a(n);return{recipient:r(e.recipient),currency:r(e.currency),minimumAmount:BigInt(i(e.minimumAmount)),expectedAmount:BigInt(i(e.expectedAmount))}}),deadline:d(y.deadline),calls:s(y.calls).map(c),extraData:c(y.extraData)},fees:s(t.fees).map(n=>{let e=a(n);return{recipientChainId:u(e.recipientChainId),recipient:r(e.recipient),currencyChainId:u(e.currencyChainId),currency:r(e.currency),amount:BigInt(i(e.amount))}})}})}export{A as a};
|