@oakagentkit/core 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/api/abort-scope.d.ts +2 -0
- package/build/dist/api/abort-scope.js +1 -0
- package/build/dist/api/addresses.d.ts +9 -0
- package/build/dist/api/addresses.js +1 -1
- package/build/dist/api/chain.d.ts +4 -0
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/http.js +1 -1
- package/build/dist/api/identity-link.js +1 -1
- package/build/dist/api/metadata.js +1 -1
- package/build/dist/api/modules/beefy/boosts.js +1 -1
- package/build/dist/api/modules/beefy/clm.js +1 -1
- package/build/dist/api/modules/beefy/guard.js +1 -1
- package/build/dist/api/modules/beefy/index.js +1 -1
- package/build/dist/api/modules/beefy/liquidity.js +1 -1
- package/build/dist/api/modules/beefy/management.js +1 -1
- package/build/dist/api/modules/beefy/vaults.js +1 -1
- package/build/dist/api/modules/borro/abi.d.ts +54 -0
- package/build/dist/api/modules/borro/abi.js +1 -1
- package/build/dist/api/modules/borro/actions.d.ts +14 -1
- package/build/dist/api/modules/borro/actions.js +1 -1
- package/build/dist/api/modules/borro/checks.js +1 -1
- package/build/dist/api/modules/borro/copy.d.ts +23 -10
- package/build/dist/api/modules/borro/copy.js +1 -1
- package/build/dist/api/modules/borro/index.js +1 -1
- package/build/dist/api/modules/borro/liquidity.js +1 -1
- package/build/dist/api/modules/borro/pins.d.ts +30 -14
- package/build/dist/api/modules/borro/pins.js +1 -1
- package/build/dist/api/modules/borro/positions.js +1 -1
- package/build/dist/api/modules/borro/reader.js +1 -1
- package/build/dist/api/modules/borro/types.d.ts +1 -0
- package/build/dist/api/modules/chop/abi.d.ts +31 -0
- package/build/dist/api/modules/chop/abi.js +1 -1
- package/build/dist/api/modules/chop/actions.js +1 -1
- package/build/dist/api/modules/chop/checks.d.ts +13 -5
- package/build/dist/api/modules/chop/checks.js +1 -1
- package/build/dist/api/modules/chop/copy.d.ts +11 -1
- package/build/dist/api/modules/chop/copy.js +1 -1
- package/build/dist/api/modules/chop/guard.js +1 -1
- package/build/dist/api/modules/chop/index.js +1 -1
- package/build/dist/api/modules/chop/positions.js +1 -1
- package/build/dist/api/modules/chop/reader.d.ts +132 -7
- package/build/dist/api/modules/chop/reader.js +1 -1
- package/build/dist/api/modules/chop/types.d.ts +12 -0
- package/build/dist/api/modules/clanker/extensions.d.ts +9 -0
- package/build/dist/api/modules/clanker/extensions.js +1 -1
- package/build/dist/api/modules/clanker/index.js +1 -1
- package/build/dist/api/modules/clanker/manage.js +1 -1
- package/build/dist/api/modules/clanker/pool-config.d.ts +15 -0
- package/build/dist/api/modules/clanker/pool-config.js +1 -1
- package/build/dist/api/modules/clanker/protocol.js +1 -1
- package/build/dist/api/modules/clanker/state.js +1 -1
- package/build/dist/api/modules/earn/copy.d.ts +36 -14
- package/build/dist/api/modules/earn/copy.js +1 -1
- package/build/dist/api/modules/earn/cost.d.ts +11 -1
- package/build/dist/api/modules/earn/cost.js +1 -1
- package/build/dist/api/modules/earn/index.js +1 -1
- package/build/dist/api/modules/earn/lp.d.ts +14 -1
- package/build/dist/api/modules/earn/lp.js +1 -1
- package/build/dist/api/modules/earn/options.d.ts +6 -4
- package/build/dist/api/modules/earn/options.js +1 -1
- package/build/dist/api/modules/erc8004/common.d.ts +1 -1
- package/build/dist/api/modules/erc8004/common.js +1 -1
- package/build/dist/api/modules/erc8004/domain.js +1 -1
- package/build/dist/api/modules/erc8004/index.js +1 -1
- package/build/dist/api/modules/erc8004/management.js +1 -1
- package/build/dist/api/modules/erc8004/reputation.js +1 -1
- package/build/dist/api/modules/erc8004/services.js +1 -1
- package/build/dist/api/modules/erc8004/thesis.d.ts +61 -0
- package/build/dist/api/modules/erc8004/thesis.js +1 -0
- package/build/dist/api/modules/erc8004/validation.js +1 -1
- package/build/dist/api/modules/factor/abi.d.ts +642 -0
- package/build/dist/api/modules/factor/abi.js +1 -0
- package/build/dist/api/modules/factor/actions.d.ts +15 -0
- package/build/dist/api/modules/factor/actions.js +1 -0
- package/build/dist/api/modules/factor/api.d.ts +7 -0
- package/build/dist/api/modules/factor/api.js +1 -0
- package/build/dist/api/modules/factor/checks.d.ts +11 -0
- package/build/dist/api/modules/factor/checks.js +1 -0
- package/build/dist/api/modules/factor/copy.d.ts +33 -0
- package/build/dist/api/modules/factor/copy.js +1 -0
- package/build/dist/api/modules/factor/guard.d.ts +12 -0
- package/build/dist/api/modules/factor/guard.js +1 -0
- package/build/dist/api/modules/factor/index.d.ts +16 -0
- package/build/dist/api/modules/factor/index.js +8 -0
- package/build/dist/api/modules/factor/messages.d.ts +46 -0
- package/build/dist/api/modules/factor/messages.js +1 -0
- package/build/dist/api/modules/factor/pins.d.ts +64 -0
- package/build/dist/api/modules/factor/pins.js +1 -0
- package/build/dist/api/modules/factor/reader.d.ts +17 -0
- package/build/dist/api/modules/factor/reader.js +1 -0
- package/build/dist/api/modules/factor/types.d.ts +18 -0
- package/build/dist/api/modules/factor/types.js +0 -0
- package/build/dist/api/modules/gloam/copy.d.ts +4 -3
- package/build/dist/api/modules/gloam/copy.js +2 -2
- package/build/dist/api/modules/gloam/index.js +1 -1
- package/build/dist/api/modules/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/public-reads.d.ts +29 -1
- package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/scan.js +1 -1
- package/build/dist/api/modules/heyresearch/status-labels.d.ts +2 -0
- package/build/dist/api/modules/heyresearch/status-labels.js +1 -1
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
- package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
- package/build/dist/api/modules/hoodag/index.d.ts +12 -1
- package/build/dist/api/modules/hoodag/index.js +1 -1
- package/build/dist/api/modules/hoodag/management.js +1 -1
- package/build/dist/api/modules/hoodag/public-reads.js +1 -1
- package/build/dist/api/modules/hoodag/reconstruct.d.ts +14 -0
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/buyback.js +1 -1
- package/build/dist/api/modules/hoodlock/commerce.js +1 -1
- package/build/dist/api/modules/hoodlock/fee.js +1 -1
- package/build/dist/api/modules/hoodlock/guard.js +1 -1
- package/build/dist/api/modules/hoodlock/index.js +1 -1
- package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
- package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
- package/build/dist/api/modules/hoodlock/public.js +1 -1
- package/build/dist/api/modules/hookr/actions.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/contracts.d.ts +2 -1
- package/build/dist/api/modules/hookr/contracts.js +1 -1
- package/build/dist/api/modules/hookr/create-cancel.js +1 -1
- package/build/dist/api/modules/hookr/discovery.js +1 -1
- package/build/dist/api/modules/hookr/fill-bounty.js +1 -1
- package/build/dist/api/modules/hookr/index.js +1 -1
- package/build/dist/api/modules/hookr/launch-options.js +1 -1
- package/build/dist/api/modules/hookr/launch-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.js +1 -1
- package/build/dist/api/modules/hookr/liquidity.js +1 -1
- package/build/dist/api/modules/hookr/lp-positions.js +1 -1
- package/build/dist/api/modules/hookr/lp-reads.d.ts +2 -0
- package/build/dist/api/modules/hookr/lp-reads.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/kyberswap/index.d.ts +2 -1
- package/build/dist/api/modules/kyberswap/index.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/abi.js +1 -1
- package/build/dist/api/modules/layerbank/actions.js +1 -1
- package/build/dist/api/modules/layerbank/checks.js +1 -1
- package/build/dist/api/modules/layerbank/index.js +1 -1
- package/build/dist/api/modules/layerbank/merkl.js +1 -1
- package/build/dist/api/modules/layerbank/reader.js +1 -1
- package/build/dist/api/modules/layerbank/reserve.js +1 -1
- package/build/dist/api/modules/lighter/index.js +1 -1
- package/build/dist/api/modules/longbow/administration.js +1 -1
- package/build/dist/api/modules/longbow/analytics.js +1 -1
- package/build/dist/api/modules/longbow/fixed.js +1 -1
- package/build/dist/api/modules/longbow/index.js +1 -1
- package/build/dist/api/modules/longbow/nft.js +1 -1
- package/build/dist/api/modules/longbow/rebates.js +1 -1
- package/build/dist/api/modules/longbow/staking.js +1 -1
- package/build/dist/api/modules/meridian/index.js +1 -1
- package/build/dist/api/modules/meridian/markets.js +1 -1
- package/build/dist/api/modules/meridian/perps-batch.js +1 -1
- package/build/dist/api/modules/meridian/perps-stream.js +1 -1
- package/build/dist/api/modules/meridian/perps.js +1 -1
- package/build/dist/api/modules/meridian/predict-read.js +1 -1
- package/build/dist/api/modules/meridian/rfq.js +1 -1
- package/build/dist/api/modules/merkl/discovery.js +1 -1
- package/build/dist/api/modules/merkl/index.js +1 -1
- package/build/dist/api/modules/merkl/manage.js +1 -1
- package/build/dist/api/modules/merkl/protocol.js +1 -1
- package/build/dist/api/modules/morpho/allocator.js +1 -1
- package/build/dist/api/modules/morpho/bundles.js +1 -1
- package/build/dist/api/modules/morpho/in-kind.js +1 -1
- package/build/dist/api/modules/morpho/index.js +1 -1
- package/build/dist/api/modules/morpho/local-guard.js +1 -1
- package/build/dist/api/modules/morpho/midnight.js +1 -1
- package/build/dist/api/modules/morpho/protocol.js +1 -1
- package/build/dist/api/modules/morpho/vault-management.js +1 -1
- package/build/dist/api/modules/morpho/vault-tools.js +1 -1
- package/build/dist/api/modules/morpho/vault-v2.d.ts +2 -0
- package/build/dist/api/modules/morpho/vault-v2.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-policy.d.ts +1 -0
- package/build/dist/api/modules/netnet/card-policy.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.js +1 -1
- package/build/dist/api/modules/netnet/desk-read.js +1 -1
- package/build/dist/api/modules/netnet/financial.js +1 -1
- package/build/dist/api/modules/netnet/index.js +1 -1
- package/build/dist/api/modules/netnet/staking.js +1 -1
- package/build/dist/api/modules/orbio/gateway.js +1 -1
- package/build/dist/api/modules/orbio/index.d.ts +6 -0
- package/build/dist/api/modules/orbio/index.js +1 -1
- package/build/dist/api/modules/orbio/positions.js +1 -1
- package/build/dist/api/modules/pendle/convert.js +1 -1
- package/build/dist/api/modules/pendle/costs.js +1 -1
- package/build/dist/api/modules/pendle/index.js +1 -1
- package/build/dist/api/modules/pendle/markets.js +1 -1
- package/build/dist/api/modules/pendle/positions.js +1 -1
- package/build/dist/api/modules/pendle/pricecheck.js +1 -1
- package/build/dist/api/modules/pendle/reader.js +1 -1
- package/build/dist/api/modules/pendle/redeem.js +1 -1
- package/build/dist/api/modules/pendle/trade.js +1 -1
- package/build/dist/api/modules/pendle/validate.js +1 -1
- package/build/dist/api/modules/pendle/verify.js +1 -1
- package/build/dist/api/modules/pons/claim.js +1 -1
- package/build/dist/api/modules/pons/holder-directory.js +1 -1
- package/build/dist/api/modules/pons/index.js +1 -1
- package/build/dist/api/modules/pons/launch-status.js +1 -1
- package/build/dist/api/modules/pons/prices.js +1 -1
- package/build/dist/api/modules/pons/reads.js +1 -1
- package/build/dist/api/modules/pons/swap-terms.js +1 -1
- package/build/dist/api/modules/pons/trade.d.ts +3 -2
- package/build/dist/api/modules/pons/trade.js +1 -1
- package/build/dist/api/modules/poolstrade/index.js +1 -1
- package/build/dist/api/modules/priors/coverage.js +1 -1
- package/build/dist/api/modules/priors/discovery.js +1 -1
- package/build/dist/api/modules/priors/features.js +1 -1
- package/build/dist/api/modules/priors/holdings.js +1 -1
- package/build/dist/api/modules/priors/index.js +1 -1
- package/build/dist/api/modules/priors/integration.d.ts +1 -0
- package/build/dist/api/modules/priors/integration.js +1 -1
- package/build/dist/api/modules/priors/market.js +1 -1
- package/build/dist/api/modules/priors/pt.js +1 -1
- package/build/dist/api/modules/priors/savings-exit.js +1 -1
- package/build/dist/api/modules/priors/starter-line.js +1 -1
- package/build/dist/api/modules/priors/stock-swap.js +1 -1
- package/build/dist/api/modules/raeto/authorization.d.ts +30 -0
- package/build/dist/api/modules/raeto/authorization.js +1 -0
- package/build/dist/api/modules/raeto/copy.d.ts +46 -0
- package/build/dist/api/modules/raeto/copy.js +1 -0
- package/build/dist/api/modules/raeto/errors.d.ts +4 -0
- package/build/dist/api/modules/raeto/errors.js +1 -0
- package/build/dist/api/modules/raeto/estimate.d.ts +2 -0
- package/build/dist/api/modules/raeto/estimate.js +1 -0
- package/build/dist/api/modules/raeto/index.d.ts +16 -0
- package/build/dist/api/modules/raeto/index.js +1 -0
- package/build/dist/api/modules/raeto/pairing.d.ts +40 -0
- package/build/dist/api/modules/raeto/pairing.js +1 -0
- package/build/dist/api/modules/raeto/pins.d.ts +24 -0
- package/build/dist/api/modules/raeto/pins.js +1 -0
- package/build/dist/api/modules/raeto/templates.d.ts +22 -0
- package/build/dist/api/modules/raeto/templates.js +1 -0
- package/build/dist/api/modules/raeto/terms.d.ts +8 -0
- package/build/dist/api/modules/raeto/terms.js +1 -0
- package/build/dist/api/modules/raeto/types.d.ts +64 -0
- package/build/dist/api/modules/raeto/types.js +0 -0
- package/build/dist/api/modules/relay/api.d.ts +16 -0
- package/build/dist/api/modules/relay/api.js +1 -1
- package/build/dist/api/modules/relay/bootstrap.js +1 -1
- package/build/dist/api/modules/relay/discovery.js +1 -1
- package/build/dist/api/modules/relay/inbound.js +1 -1
- package/build/dist/api/modules/relay/index.d.ts +1 -0
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/order.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- package/build/dist/api/modules/relay/readiness.d.ts +1 -0
- package/build/dist/api/modules/relay/readiness.js +1 -1
- package/build/dist/api/modules/relay/reads.js +1 -1
- package/build/dist/api/modules/relay/vaults.js +1 -1
- package/build/dist/api/modules/spark/actions.js +1 -1
- package/build/dist/api/modules/spark/details.js +1 -1
- package/build/dist/api/modules/spark/index.js +1 -1
- package/build/dist/api/modules/spark/management.js +1 -1
- package/build/dist/api/modules/steakhouse/analytics.js +1 -1
- package/build/dist/api/modules/steakhouse/erc4626.js +1 -1
- package/build/dist/api/modules/steakhouse/index.js +1 -1
- package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
- package/build/dist/api/modules/steakhouse/management.js +1 -1
- package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
- package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
- package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
- package/build/dist/api/modules/tickerspring/discovery.js +1 -1
- package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
- package/build/dist/api/modules/tickerspring/guards.js +1 -1
- package/build/dist/api/modules/tickerspring/index.js +1 -1
- package/build/dist/api/modules/tickerspring/journeys.d.ts +1 -0
- package/build/dist/api/modules/tickerspring/journeys.js +1 -1
- package/build/dist/api/modules/tickerspring/ladder.js +1 -1
- package/build/dist/api/modules/tickerspring/maker.js +1 -1
- package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
- package/build/dist/api/modules/tickerspring/research.js +1 -1
- package/build/dist/api/modules/tickerspring/strategies.js +1 -1
- package/build/dist/api/modules/uniswap/auction-create.js +1 -1
- package/build/dist/api/modules/uniswap/auction.js +1 -1
- package/build/dist/api/modules/uniswap/batch.js +1 -1
- package/build/dist/api/modules/uniswap/common.js +1 -1
- package/build/dist/api/modules/uniswap/fee-percent.d.ts +4 -0
- package/build/dist/api/modules/uniswap/fee-percent.js +1 -0
- package/build/dist/api/modules/uniswap/fees.js +1 -1
- package/build/dist/api/modules/uniswap/index.js +1 -1
- package/build/dist/api/modules/uniswap/local-guard.d.ts +2 -0
- package/build/dist/api/modules/uniswap/local-guard.js +1 -1
- package/build/dist/api/modules/uniswap/oracle.js +1 -1
- package/build/dist/api/modules/uniswap/pool-math.js +1 -1
- package/build/dist/api/modules/uniswap/pools.d.ts +2 -0
- package/build/dist/api/modules/uniswap/pools.js +1 -1
- package/build/dist/api/modules/uniswap/position.js +1 -1
- package/build/dist/api/modules/uniswap/protocol.js +1 -1
- package/build/dist/api/modules/uniswap/quote-guard.d.ts +38 -0
- package/build/dist/api/modules/uniswap/quote-guard.js +1 -0
- package/build/dist/api/modules/uniswap/token-jar.js +1 -1
- package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
- package/build/dist/api/modules/uniswap/trade.d.ts +10 -3
- package/build/dist/api/modules/uniswap/trade.js +1 -1
- package/build/dist/api/modules/uniswap/v2.js +1 -1
- package/build/dist/api/modules/uniswap/v3.js +1 -1
- package/build/dist/api/modules/uniswap/v4.d.ts +6 -0
- package/build/dist/api/modules/uniswap/v4.js +1 -1
- package/build/dist/api/modules/uniswap/wrap.js +1 -1
- package/build/dist/api/modules/upoch/copy.d.ts +5 -0
- package/build/dist/api/modules/upoch/copy.js +1 -0
- package/build/dist/api/modules/upoch/index.d.ts +8 -0
- package/build/dist/api/modules/upoch/index.js +1 -0
- package/build/dist/api/modules/upoch/pins.d.ts +8 -0
- package/build/dist/api/modules/upoch/pins.js +1 -0
- package/build/dist/api/modules/upoch/reads.d.ts +509 -0
- package/build/dist/api/modules/upoch/reads.js +1 -0
- package/build/dist/api/modules/velora/claims.js +1 -1
- package/build/dist/api/modules/velora/delta-reads.js +1 -1
- package/build/dist/api/modules/velora/index.js +1 -1
- package/build/dist/api/modules/wormhole/index.js +1 -1
- package/build/dist/api/modules/wormhole/scan-text.js +1 -1
- package/build/dist/api/modules/wormhole/swap-token-verdict.js +1 -1
- package/build/dist/api/modules/wormhole/third-party-text.d.ts +14 -3
- package/build/dist/api/modules/wormhole/third-party-text.js +1 -1
- package/build/dist/api/modules/wormhole/token-check.js +1 -1
- package/build/dist/api/modules/wormhole/x402-client.d.ts +17 -1
- package/build/dist/api/modules/wormhole/x402-client.js +1 -1
- package/build/dist/api/oak-fee.d.ts +12 -0
- package/build/dist/api/oak-fee.js +1 -0
- package/build/dist/api/param-text.d.ts +22 -0
- package/build/dist/api/param-text.js +1 -0
- package/build/dist/api/position-economics.d.ts +70 -0
- package/build/dist/api/position-economics.js +1 -0
- package/build/dist/api/positions.d.ts +8 -5
- package/build/dist/api/positions.js +1 -1
- package/build/dist/api/pricenote.js +1 -1
- package/build/dist/api/prices.d.ts +3 -0
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/pricing.js +1 -1
- package/build/dist/api/progress.d.ts +7 -0
- package/build/dist/api/progress.js +1 -0
- package/build/dist/api/read-budgets.d.ts +4 -0
- package/build/dist/api/read-budgets.js +1 -0
- package/build/dist/api/read-shape.d.ts +45 -0
- package/build/dist/api/read-shape.js +1 -0
- package/build/dist/api/revert.d.ts +23 -0
- package/build/dist/api/revert.js +1 -0
- package/build/dist/api/routes.js +1 -1
- package/build/dist/api/rpc.d.ts +1 -0
- package/build/dist/api/rpc.js +1 -1
- package/build/dist/api/secret-fields.d.ts +2 -0
- package/build/dist/api/secret-fields.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.d.ts +8 -0
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/signing.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.d.ts +4 -0
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.d.ts +1 -0
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.d.ts +1 -0
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/types.d.ts +3 -0
- package/build/dist/api/untrusted-unwrap.d.ts +1 -0
- package/build/dist/api/untrusted-unwrap.js +1 -0
- package/build/dist/api/usd-estimate.d.ts +23 -0
- package/build/dist/api/usd-estimate.js +1 -0
- package/build/dist/api/vendor-limits.js +1 -1
- package/build/dist/chunks/23HNDJ76.js +2 -0
- package/build/dist/chunks/24Q3FNGX.js +1 -0
- package/build/dist/chunks/25C4DTVA.js +1 -0
- package/build/dist/chunks/2GXHYI23.js +1 -0
- package/build/dist/chunks/2HN3U6OG.js +1 -0
- package/build/dist/chunks/{QU5XKRGK.js → 2OVJ2BTJ.js} +1 -1
- package/build/dist/chunks/{FUDAXV5X.js → 2QGLPY2D.js} +1 -1
- package/build/dist/chunks/2WRXH6BL.js +1 -0
- package/build/dist/chunks/2ZBSE2LD.js +2 -0
- package/build/dist/chunks/2ZQ7X223.js +1 -0
- package/build/dist/chunks/2ZWKIBJT.js +1 -0
- package/build/dist/chunks/3A2IKFTV.js +1 -0
- package/build/dist/chunks/3CH2IPQL.js +1 -0
- package/build/dist/chunks/3PU2SD3U.js +2 -0
- package/build/dist/chunks/{ER47KGRM.js → 3ZH5SOC2.js} +1 -1
- package/build/dist/chunks/4NBXBKOX.js +2 -0
- package/build/dist/chunks/{WV3A3OUU.js → 4PLLS6CT.js} +1 -1
- package/build/dist/chunks/4R3G3H42.js +1 -0
- package/build/dist/chunks/4TTDAF4B.js +1 -0
- package/build/dist/chunks/4Z3IGMU6.js +1 -0
- package/build/dist/chunks/5DPJQCKJ.js +68 -0
- package/build/dist/chunks/{SJJR4ZBZ.js → 5GQJVKVY.js} +1 -1
- package/build/dist/chunks/5R576SDB.js +1 -0
- package/build/dist/chunks/5RXALTDT.js +1 -0
- package/build/dist/chunks/5TUXSOMI.js +1 -0
- package/build/dist/chunks/5UAXLWJ2.js +1 -0
- package/build/dist/chunks/{QQECG3WP.js → 5W74Z4WZ.js} +1 -1
- package/build/dist/chunks/5XAXJEWM.js +5 -0
- package/build/dist/chunks/65356YKW.js +1 -0
- package/build/dist/chunks/65OITTDL.js +1 -0
- package/build/dist/chunks/6F527FLN.js +1 -0
- package/build/dist/chunks/6MDYKE2O.js +1 -0
- package/build/dist/chunks/6OCLWSMZ.js +1 -0
- package/build/dist/chunks/75SULXNT.js +1 -0
- package/build/dist/chunks/{WU7XIAXB.js → 7EACRKFV.js} +1 -1
- package/build/dist/chunks/7U62MMUQ.js +1 -0
- package/build/dist/chunks/{DW4V5PUY.js → 7VH6JQ2H.js} +1 -1
- package/build/dist/chunks/A2V4NFVA.js +1 -0
- package/build/dist/chunks/A3BJSQ23.js +1 -0
- package/build/dist/chunks/ACH4BSME.js +3 -0
- package/build/dist/chunks/ADIPEGNN.js +1 -0
- package/build/dist/chunks/AHUCYDBC.js +1 -0
- package/build/dist/chunks/ANIF3JMV.js +4 -0
- package/build/dist/chunks/{ALLLYOUG.js → ATEVAJ5Y.js} +1 -1
- package/build/dist/chunks/B2HSLY5F.js +1 -0
- package/build/dist/chunks/{WTXC3XKW.js → B7BNDW35.js} +1 -1
- package/build/dist/chunks/BE3A7677.js +1 -0
- package/build/dist/chunks/{PAY5PD4H.js → BX46C5ZP.js} +1 -1
- package/build/dist/chunks/C3WBHFLX.js +1 -0
- package/build/dist/chunks/C6VJAL5B.js +1 -0
- package/build/dist/chunks/C76D54YG.js +1 -0
- package/build/dist/chunks/CD2JQ32C.js +1 -0
- package/build/dist/chunks/CI5ENLYA.js +1 -0
- package/build/dist/chunks/CNLL4NCR.js +1 -0
- package/build/dist/chunks/{P5PYFK7L.js → CQ5WRWV4.js} +1 -1
- package/build/dist/chunks/CSOO4SW7.js +1 -0
- package/build/dist/chunks/CZL6T2ZQ.js +1 -0
- package/build/dist/chunks/CZQ2CGYV.js +1 -0
- package/build/dist/chunks/D2IYA4LP.js +1 -0
- package/build/dist/chunks/D7QXZM3S.js +1 -0
- package/build/dist/chunks/{GNC6RXLT.js → DBOGRUPS.js} +1 -1
- package/build/dist/chunks/DGCJZ3HO.js +1 -0
- package/build/dist/chunks/DGDMRATN.js +1 -0
- package/build/dist/chunks/DMB64UIN.js +1 -0
- package/build/dist/chunks/DMDOSHV7.js +1 -0
- package/build/dist/chunks/DRLBTB4E.js +1 -0
- package/build/dist/chunks/E76Z2TT4.js +1 -0
- package/build/dist/chunks/EFESPGA2.js +1 -0
- package/build/dist/chunks/EHK7CDTU.js +1 -0
- package/build/dist/chunks/ELHRXA5U.js +1 -0
- package/build/dist/chunks/F7MGYRPU.js +1 -0
- package/build/dist/chunks/{MRMR4QHA.js → FAH7FKUT.js} +1 -1
- package/build/dist/chunks/{QBIY6FQN.js → FGEGJOAA.js} +1 -1
- package/build/dist/chunks/FHTNMGFR.js +1 -0
- package/build/dist/chunks/FN6GNTPR.js +1 -0
- package/build/dist/chunks/{EGYVRQUR.js → FTMA24EC.js} +1 -1
- package/build/dist/chunks/FXOFR432.js +1 -0
- package/build/dist/chunks/{VHV6WQ5F.js → G2AA73ZE.js} +1 -1
- package/build/dist/chunks/G2LAO23N.js +1 -0
- package/build/dist/chunks/{WIRBCS4W.js → GBIBRYOV.js} +1 -1
- package/build/dist/chunks/GDOHHXNH.js +1 -0
- package/build/dist/chunks/{GSBIERZD.js → GP6YO24Z.js} +1 -1
- package/build/dist/chunks/GQ3XZFRL.js +1 -0
- package/build/dist/chunks/{4HG6FRVH.js → GQITAJVF.js} +1 -1
- package/build/dist/chunks/H3E7UD2X.js +1 -0
- package/build/dist/chunks/HFVXNKA5.js +1 -0
- package/build/dist/chunks/HHYE42JG.js +21 -0
- package/build/dist/chunks/HRAHGYNK.js +1 -0
- package/build/dist/chunks/HS5HWBMU.js +1 -0
- package/build/dist/chunks/{BND2UFVW.js → HVFMIURK.js} +1 -1
- package/build/dist/chunks/IBL6TL2Q.js +1 -0
- package/build/dist/chunks/IT2JLILU.js +1 -0
- package/build/dist/chunks/IV4K7FMD.js +1 -0
- package/build/dist/chunks/{PNA6UIE5.js → JDSSYT6R.js} +1 -1
- package/build/dist/chunks/JFWJBZ7M.js +1 -0
- package/build/dist/chunks/JI5DXDMY.js +1 -0
- package/build/dist/chunks/JJGZ7W3V.js +1 -0
- package/build/dist/chunks/JPPQDELB.js +18 -0
- package/build/dist/chunks/{OLSP46ZD.js → K4P5VYDP.js} +1 -1
- package/build/dist/chunks/{JFYBH3DX.js → K6D6SDIG.js} +1 -1
- package/build/dist/chunks/K7HTDKAT.js +1 -0
- package/build/dist/chunks/KBU3PYP7.js +1 -0
- package/build/dist/chunks/KH4QFN72.js +3 -0
- package/build/dist/chunks/KMSAUFYV.js +1 -0
- package/build/dist/chunks/{RTAHNWHN.js → KOTGFD2V.js} +1 -1
- package/build/dist/chunks/KZA5GYZR.js +1 -0
- package/build/dist/chunks/LCH6F5HT.js +1 -0
- package/build/dist/chunks/LDJI2JAL.js +1 -0
- package/build/dist/chunks/LEV5SNNC.js +3 -0
- package/build/dist/chunks/{SPRVVJXI.js → LFSJDFMY.js} +1 -1
- package/build/dist/chunks/{PIIHOXWF.js → LJJYYUEG.js} +1 -1
- package/build/dist/chunks/LKX5WDOQ.js +1 -0
- package/build/dist/chunks/LVFI74ST.js +1 -0
- package/build/dist/chunks/M7BUKZW2.js +1 -0
- package/build/dist/chunks/{C5ZZAYXD.js → MI5HZDMH.js} +1 -1
- package/build/dist/chunks/MMCM3GSM.js +1 -0
- package/build/dist/chunks/MQ5F2VOK.js +1 -0
- package/build/dist/chunks/MSMHS456.js +1 -0
- package/build/dist/chunks/{JKD2B6OX.js → MSRCJ2BS.js} +1 -1
- package/build/dist/chunks/{XSKFKBDR.js → N64JJN37.js} +1 -1
- package/build/dist/chunks/NAO7VWZF.js +1 -0
- package/build/dist/chunks/ND32LJWI.js +1 -0
- package/build/dist/chunks/{Q42YI3EP.js → NMJVQX5M.js} +1 -1
- package/build/dist/chunks/NMQBOBWJ.js +1 -0
- package/build/dist/chunks/NQ4MTIU3.js +1 -0
- package/build/dist/chunks/NWPAQER2.js +1 -0
- package/build/dist/chunks/O2J5I4VA.js +1 -0
- package/build/dist/chunks/O4S6XAYV.js +1 -0
- package/build/dist/chunks/{TAEZTP4L.js → O5QTITN6.js} +1 -1
- package/build/dist/chunks/{RUC7KH7A.js → OB7BFDOV.js} +1 -1
- package/build/dist/chunks/OEZ7FCLF.js +1 -0
- package/build/dist/chunks/{GW5IXLKU.js → OI3N4EW4.js} +1 -1
- package/build/dist/chunks/{WP6RHXGN.js → OIQTZOBN.js} +1 -1
- package/build/dist/chunks/OODSXDIH.js +1 -0
- package/build/dist/chunks/OOPMZIG7.js +1 -0
- package/build/dist/chunks/OQFNUDMQ.js +1 -0
- package/build/dist/chunks/ORG6LVKJ.js +1 -0
- package/build/dist/chunks/{CBLMQ5UU.js → OSMOBKRQ.js} +1 -1
- package/build/dist/chunks/OTLUQWLF.js +1 -0
- package/build/dist/chunks/{2MT3G7YZ.js → OTYB6BHK.js} +1 -1
- package/build/dist/chunks/{H43RNCX2.js → OUROA7XR.js} +1 -1
- package/build/dist/chunks/{SMYWWIE6.js → OVM4QIET.js} +1 -1
- package/build/dist/chunks/OYDKAIS2.js +1 -0
- package/build/dist/chunks/P6OB2AFW.js +1 -0
- package/build/dist/chunks/PDPTJMTJ.js +1 -0
- package/build/dist/chunks/PEHXHQVA.js +1 -0
- package/build/dist/chunks/PMFR47H3.js +1 -0
- package/build/dist/chunks/PQXYTOV5.js +1 -0
- package/build/dist/chunks/PSGRZWES.js +1 -0
- package/build/dist/chunks/PZEF5LBL.js +2 -0
- package/build/dist/chunks/Q7L3BX6U.js +1 -0
- package/build/dist/chunks/QBYV7NXH.js +1 -0
- package/build/dist/chunks/QIB6OMQV.js +1 -0
- package/build/dist/chunks/QLAOBULN.js +1 -0
- package/build/dist/chunks/QLFPAN6S.js +1 -0
- package/build/dist/chunks/QMEGAKLI.js +1 -0
- package/build/dist/chunks/QMNUB2GM.js +2 -0
- package/build/dist/chunks/QMZEGT5B.js +1 -0
- package/build/dist/chunks/R73R4KN3.js +1 -0
- package/build/dist/chunks/RN3WUJIO.js +1 -0
- package/build/dist/chunks/RNCMXKKS.js +1 -0
- package/build/dist/chunks/ROQQ62LP.js +1 -0
- package/build/dist/chunks/RUTSEGGD.js +1 -0
- package/build/dist/chunks/{TFDPEAVZ.js → S4JUFCT4.js} +1 -1
- package/build/dist/chunks/{2VXLVXIB.js → S4UJDZGN.js} +1 -1
- package/build/dist/chunks/SCG5HWMN.js +1 -0
- package/build/dist/chunks/{XQA5LCL6.js → SENOU5JR.js} +1 -1
- package/build/dist/chunks/SMSXZ3FN.js +1 -0
- package/build/dist/chunks/SUNTJ6IU.js +1 -0
- package/build/dist/chunks/SZ466I5X.js +1 -0
- package/build/dist/chunks/TGFQQCRY.js +1 -0
- package/build/dist/chunks/{K4DHHQBI.js → THL4TMQW.js} +2 -2
- package/build/dist/chunks/TI727O2H.js +1 -0
- package/build/dist/chunks/{UD2XMNIT.js → TMRAF2L2.js} +1 -1
- package/build/dist/chunks/TNJTET4G.js +1 -0
- package/build/dist/chunks/TVIMP5CK.js +1 -0
- package/build/dist/chunks/{PV5FDT6O.js → TXGZ6NWN.js} +1 -1
- package/build/dist/chunks/U243AWCH.js +1 -0
- package/build/dist/chunks/U762746N.js +1 -0
- package/build/dist/chunks/U7UPLF4F.js +1 -0
- package/build/dist/chunks/{7QIO77VE.js → UPKVD7WG.js} +1 -1
- package/build/dist/chunks/{ZQAFFWDK.js → URBEK2VV.js} +1 -1
- package/build/dist/chunks/USEF3QKG.js +1 -0
- package/build/dist/chunks/UVAR6BHU.js +1 -0
- package/build/dist/chunks/V5YSJKRH.js +70 -0
- package/build/dist/chunks/VB36EHIR.js +1 -0
- package/build/dist/chunks/VMZYFO6I.js +1 -0
- package/build/dist/chunks/{TX2EOIRS.js → VST6LFUB.js} +1 -1
- package/build/dist/chunks/{U4JGEMKT.js → VVAM3EAK.js} +1 -1
- package/build/dist/chunks/VVJO6OYK.js +1 -0
- package/build/dist/chunks/VVWFB53Q.js +1 -0
- package/build/dist/chunks/VXCGMALF.js +1 -0
- package/build/dist/chunks/VZVW5J7J.js +1 -0
- package/build/dist/chunks/W32UECOL.js +1 -0
- package/build/dist/chunks/{XD6X3KTC.js → W4RYRLL5.js} +1 -1
- package/build/dist/chunks/{2MZXTOZU.js → WAKZWSHB.js} +1 -1
- package/build/dist/chunks/WBNFRPAT.js +1 -0
- package/build/dist/chunks/{AFBEZXNV.js → WNWRF4HE.js} +1 -1
- package/build/dist/chunks/{4DP2VPXR.js → WOGWLFAL.js} +1 -1
- package/build/dist/chunks/{HM72DH4V.js → WRUTW6CG.js} +1 -1
- package/build/dist/chunks/{VYYSL557.js → WSILNJS2.js} +1 -1
- package/build/dist/chunks/X24YTJST.js +1 -0
- package/build/dist/chunks/{IPN6Z4JM.js → X5AL3DUK.js} +1 -1
- package/build/dist/chunks/XBNZ7GTY.js +1 -0
- package/build/dist/chunks/{XL3LLGIR.js → XEBMS5KU.js} +1 -1
- package/build/dist/chunks/XEPCDGN2.js +1 -0
- package/build/dist/chunks/{KIFZ5ZSK.js → XL3W7DAQ.js} +1 -1
- package/build/dist/chunks/{DL6AEWEM.js → XPWGPZ2C.js} +1 -1
- package/build/dist/chunks/{T7TFUH5K.js → XRDLMTBJ.js} +1 -1
- package/build/dist/chunks/XTFRPI4G.js +1 -0
- package/build/dist/chunks/XV3YJ4P6.js +1 -0
- package/build/dist/chunks/XW3VGWXK.js +1 -0
- package/build/dist/chunks/{6WD4HHID.js → Y2QADJOB.js} +1 -1
- package/build/dist/chunks/Y64GFBTA.js +1 -0
- package/build/dist/chunks/YARZE7SJ.js +1 -0
- package/build/dist/chunks/YBLJ75U5.js +1 -0
- package/build/dist/chunks/YEIM6BZQ.js +1 -0
- package/build/dist/chunks/YRSAZTTC.js +7 -0
- package/build/dist/chunks/YXXK6EPI.js +1 -0
- package/build/dist/chunks/Z3IBPCY4.js +2 -0
- package/build/dist/chunks/{QHBS3PVU.js → Z7FGEWO2.js} +1 -1
- package/build/dist/chunks/ZNPVBNC5.js +1 -0
- package/build/dist/chunks/ZQ6AF3VX.js +1 -0
- package/build/dist/chunks/ZTKT3ZQK.js +1 -0
- package/build/dist/chunks/{4BVP652W.js → ZZ6FZGHF.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/2THSW4QN.js +0 -1
- package/build/dist/chunks/2TK3ETUO.js +0 -1
- package/build/dist/chunks/35KR3VSS.js +0 -1
- package/build/dist/chunks/3GQ7A3VB.js +0 -1
- package/build/dist/chunks/3XNZUIRU.js +0 -1
- package/build/dist/chunks/46547QT3.js +0 -1
- package/build/dist/chunks/4EN6MQEI.js +0 -1
- package/build/dist/chunks/4I3OU56B.js +0 -1
- package/build/dist/chunks/52ELWNXJ.js +0 -2
- package/build/dist/chunks/5AXWBSPG.js +0 -1
- package/build/dist/chunks/5N3O42X6.js +0 -1
- package/build/dist/chunks/5SMVQCAP.js +0 -1
- package/build/dist/chunks/5SZPNZG4.js +0 -1
- package/build/dist/chunks/64GOINYS.js +0 -1
- package/build/dist/chunks/6I4NTKB2.js +0 -1
- package/build/dist/chunks/6JAXZNZ3.js +0 -1
- package/build/dist/chunks/6O3Q5B6M.js +0 -1
- package/build/dist/chunks/6OGDTEGH.js +0 -1
- package/build/dist/chunks/6WZX7C4T.js +0 -2
- package/build/dist/chunks/6YB3VOUL.js +0 -1
- package/build/dist/chunks/7GJ6SLEV.js +0 -1
- package/build/dist/chunks/7KWZ5QJU.js +0 -1
- package/build/dist/chunks/7QZOTRSA.js +0 -2
- package/build/dist/chunks/7WSHW7KW.js +0 -1
- package/build/dist/chunks/A7I4IWUB.js +0 -1
- package/build/dist/chunks/ABPL3ZZI.js +0 -1
- package/build/dist/chunks/ACW63WIL.js +0 -20
- package/build/dist/chunks/AEL62KCG.js +0 -1
- package/build/dist/chunks/AKYF5264.js +0 -7
- package/build/dist/chunks/AW7AXQCZ.js +0 -1
- package/build/dist/chunks/AXRL3REN.js +0 -1
- package/build/dist/chunks/BBTPRZ6T.js +0 -1
- package/build/dist/chunks/BOVMED7R.js +0 -1
- package/build/dist/chunks/BTPXJAUX.js +0 -1
- package/build/dist/chunks/C7AXJHBT.js +0 -1
- package/build/dist/chunks/CBG5HARQ.js +0 -2
- package/build/dist/chunks/CDPSMI3Z.js +0 -1
- package/build/dist/chunks/CHXBOXOD.js +0 -1
- package/build/dist/chunks/CQEJSCFQ.js +0 -1
- package/build/dist/chunks/DBNTZEAJ.js +0 -1
- package/build/dist/chunks/DHUDSOGR.js +0 -18
- package/build/dist/chunks/DJN3JAWB.js +0 -1
- package/build/dist/chunks/E3RACZUY.js +0 -1
- package/build/dist/chunks/FEYAY6OZ.js +0 -1
- package/build/dist/chunks/FJ4S4GHY.js +0 -1
- package/build/dist/chunks/FWD4L3CJ.js +0 -1
- package/build/dist/chunks/GG6Y4OCJ.js +0 -1
- package/build/dist/chunks/GGHBFLRC.js +0 -1
- package/build/dist/chunks/GGSAKCND.js +0 -1
- package/build/dist/chunks/GRQYTVNT.js +0 -1
- package/build/dist/chunks/H6T5FXEX.js +0 -1
- package/build/dist/chunks/HHXBUYHO.js +0 -1
- package/build/dist/chunks/HKEMQBFA.js +0 -1
- package/build/dist/chunks/HQUVB7Z5.js +0 -3
- package/build/dist/chunks/HU7IMNBI.js +0 -1
- package/build/dist/chunks/HWX36XJI.js +0 -1
- package/build/dist/chunks/I26DMNJG.js +0 -1
- package/build/dist/chunks/I55MURSJ.js +0 -1
- package/build/dist/chunks/IMO3GDA5.js +0 -1
- package/build/dist/chunks/IPRVIKYC.js +0 -1
- package/build/dist/chunks/IVX4R5OL.js +0 -1
- package/build/dist/chunks/JQOQMFWD.js +0 -3
- package/build/dist/chunks/JUZ5JU6D.js +0 -70
- package/build/dist/chunks/JZS3E66E.js +0 -1
- package/build/dist/chunks/K3RDPI5J.js +0 -1
- package/build/dist/chunks/KBKK7UNY.js +0 -1
- package/build/dist/chunks/KVFZKPJT.js +0 -1
- package/build/dist/chunks/L5BLHY34.js +0 -1
- package/build/dist/chunks/LKXO2BQS.js +0 -1
- package/build/dist/chunks/LKZX4CAA.js +0 -1
- package/build/dist/chunks/LYMNHO5T.js +0 -1
- package/build/dist/chunks/M2UXYCKH.js +0 -1
- package/build/dist/chunks/M37654RL.js +0 -1
- package/build/dist/chunks/M6LC6DRE.js +0 -1
- package/build/dist/chunks/MOE3EVAL.js +0 -1
- package/build/dist/chunks/N4Q6GN65.js +0 -1
- package/build/dist/chunks/NAZPDRIF.js +0 -1
- package/build/dist/chunks/NKX3FE34.js +0 -1
- package/build/dist/chunks/NKZKKCK2.js +0 -1
- package/build/dist/chunks/NOFUKKP5.js +0 -1
- package/build/dist/chunks/O6ROOKY2.js +0 -1
- package/build/dist/chunks/OJ4WJUPP.js +0 -1
- package/build/dist/chunks/OOZSE2R7.js +0 -1
- package/build/dist/chunks/OTXSKFUD.js +0 -1
- package/build/dist/chunks/P5AJSLZ7.js +0 -1
- package/build/dist/chunks/PACN53TR.js +0 -1
- package/build/dist/chunks/PAHXBLCS.js +0 -1
- package/build/dist/chunks/PK66GCDT.js +0 -1
- package/build/dist/chunks/PSBQWDYI.js +0 -1
- package/build/dist/chunks/PXT5YTWU.js +0 -1
- package/build/dist/chunks/PZGGE5D3.js +0 -1
- package/build/dist/chunks/QA2RRIES.js +0 -1
- package/build/dist/chunks/QA3UHEO3.js +0 -1
- package/build/dist/chunks/QFNT73OF.js +0 -1
- package/build/dist/chunks/QW2OPEYJ.js +0 -1
- package/build/dist/chunks/QYVREJYC.js +0 -1
- package/build/dist/chunks/ROFPXEQ5.js +0 -2
- package/build/dist/chunks/RTGS7RIO.js +0 -1
- package/build/dist/chunks/RUX3RY7Y.js +0 -1
- package/build/dist/chunks/RVDUSNWW.js +0 -1
- package/build/dist/chunks/S5CBVFHY.js +0 -1
- package/build/dist/chunks/SIYUNOLI.js +0 -1
- package/build/dist/chunks/TEJ7W534.js +0 -1
- package/build/dist/chunks/TPBAFS7K.js +0 -1
- package/build/dist/chunks/TVWMTMEF.js +0 -1
- package/build/dist/chunks/U2RMUVVY.js +0 -1
- package/build/dist/chunks/U5PMVP56.js +0 -1
- package/build/dist/chunks/V5JWGWXC.js +0 -1
- package/build/dist/chunks/VCOTCVKN.js +0 -1
- package/build/dist/chunks/VEQBHI6O.js +0 -1
- package/build/dist/chunks/VNV6ZISN.js +0 -1
- package/build/dist/chunks/VYAJXLND.js +0 -1
- package/build/dist/chunks/WCNHZYQQ.js +0 -1
- package/build/dist/chunks/WLMWWEP7.js +0 -2
- package/build/dist/chunks/X2P55AC3.js +0 -1
- package/build/dist/chunks/XBE3B6Y2.js +0 -1
- package/build/dist/chunks/XKSVTN5X.js +0 -1
- package/build/dist/chunks/XSRIJUFU.js +0 -1
- package/build/dist/chunks/YCZPSMZ5.js +0 -1
- package/build/dist/chunks/YDNTY67T.js +0 -1
- package/build/dist/chunks/YN56C7PN.js +0 -1
- package/build/dist/chunks/YRNXGQJC.js +0 -1
- package/build/dist/chunks/YWRLY5EA.js +0 -1
- package/build/dist/chunks/YWSX6IE6.js +0 -1
- package/build/dist/chunks/YXTSWRV5.js +0 -1
- package/build/dist/chunks/Z6LZGCVW.js +0 -1
- package/build/dist/chunks/ZQWZGH7V.js +0 -1
- package/build/dist/chunks/ZSN4IRI5.js +0 -1
- package/build/dist/chunks/ZV5HIQXC.js +0 -1
- package/build/dist/chunks/ZXJ24B4L.js +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import{a as ce}from"./63YRSLDK.js";var Se={};ce(Se,{ACCESS_FEE_LINE:()=>H,ACCESS_FREE_UNTIL_LINE:()=>K,ACCESS_NO_PLAN:()=>T,BANNED_COPY:()=>Ne,BONUS_CLAUSE:()=>h,CARD_FOOTER_ASK:()=>m,CARD_FOOTER_NO_ASK:()=>f,CARD_HEADER:()=>s,CARD_HEADER_AMOUNT:()=>r,CARD_HEADER_AMOUNT_NOT_HELD:()=>i,ETH_HINT:()=>k,FEES_ESTIMATED_HIGH:()=>W,LAYERBANK_RISK_SUMMARY:()=>u,LAYERBANK_SETUP_MISMATCH:()=>_e,LAYERBANK_SITE:()=>we,LB_BONUS_NOTE:()=>S,LB_CASH_NOTE:()=>L,LB_DEPOSIT_SCREEN:()=>x,LB_WITHDRAW_SCREEN:()=>N,LP_ADD_BUTTON:()=>be,LP_BLOCK:()=>X,LP_BLOCK_UNREADABLE:()=>ae,LP_DECLINE_BUTTON:()=>Te,LP_FEE_CLAUSE:()=>Z,LP_FUNDER_LINE:()=>te,LP_GAS_LINE:()=>Q,LP_NOT_A_PROMISE:()=>ee,LP_NOT_WORTH_CLAUSE:()=>oe,LP_RANGE_CLAUSE:()=>V,LP_RATE_LINE:()=>j,LP_SHARE_LINE:()=>J,MATURED_NOTICE:()=>F,MATURED_STOCK_NOTICE:()=>q,MATURED_STOCK_NOTICE_NO_AMOUNT:()=>z,MERKL_AFTER_DEPOSIT:()=>ne,MERKL_EARNING_EMPTY:()=>re,MERKL_LAST_UPDATE_CLAUSE:()=>se,NOTHING_TO_EARN:()=>b,NO_NEW_TERM:()=>$,OPTION_A:()=>l,OPTION_A_CANT_CHECK:()=>y,OPTION_A_CLOSED:()=>E,OPTION_A_NO_ROOM:()=>g,OPTION_B:()=>c,OPTION_B_CANT_CHECK:()=>w,OPTION_B_NONE:()=>p,PAYOUT_APPROX:()=>v,PAYOUT_EXACT:()=>U,PENDLE_BUY_STABLE_SCREEN:()=>A,PENDLE_BUY_STOCK_SCREEN:()=>O,PENDLE_CONTRACT_CHANGE:()=>me,PENDLE_EARLY_EXIT:()=>_,PENDLE_FIXED_RATE:()=>ge,PENDLE_REDEEM_SCREEN:()=>C,PENDLE_REDEEM_STOCK_SCREEN:()=>I,PENDLE_RISK_SUMMARY:()=>d,PENDLE_SELL_DEFAULT_BUTTON:()=>fe,PENDLE_SELL_GAP_LINE:()=>D,PENDLE_SELL_NO_GAP_LINE:()=>R,PENDLE_SELL_SCREEN:()=>P,PENDLE_SERVICE_DOWN:()=>le,PENDLE_SITE:()=>Ee,PRICE_MISMATCH_REFUSAL:()=>de,SLIPPAGE_CAP_REFUSAL:()=>ie,STOCK_PAID_IN:()=>Y,STOCK_SHORT_TERM:()=>B,STOCK_SHORT_TERM_DAYS:()=>ke,TEMPLATES:()=>xe,THIN_MARKET_REFUSAL:()=>ue,TOO_SMALL:()=>M,TOO_SMALL_NO_SIZE:()=>G,fill:()=>ye,placeholdersOf:()=>pe});function e(t){return{text:t}}function pe(t){return[...new Set([...t.text.matchAll(/\{([a-z][a-z0-9_]*)\}/g)].map(o=>o[1]))]}function ye(t,o){let he=o;return t.text.replace(/\{([a-z][a-z0-9_]*)\}/g,(Le,a)=>{let n=he[a];if(typeof n!="string")throw new Error(`Missing value for {${a}}`);return n})}var we="layerbank.finance",Ee="app.pendle.finance",s=e("You have {amount_usd} in USDG that isn't earning anything. Here are two ways to make it earn. Pick one, or neither."),r=e("Looking at {amount_usd} of your USDG. Here are two ways to make it earn. Pick one, or neither."),i=e("Looking at {amount_usd} of USDG. Here are two ways to make it earn. Pick one, or neither."),u="LayerBank is a lending app; if its code fails or almost everything is lent out, you could lose money or have to wait.",d="Pendle is a trading app; thin trading can make leaving early cost you, and its code can fail or be changed by its team.",_="If you leave early you sell at the market price that day, and that can be less than you put in.",ge="The rate is fixed only if you hold until the end date.",me="Pendle's router can be upgraded by Pendle's team, so its code can change.",l=e(`A. LayerBank: lending, take it out any time
|
|
2
|
+
Pays about {lb_base_rate}% a year from borrowers today{bonus_clause}. The rate changes, up or down.
|
|
3
|
+
You can take your money out any time while LayerBank has cash on hand (right now {lb_cash_usd}).
|
|
4
|
+
Risk: ${u}
|
|
5
|
+
Cost: network fees of about {lb_gas_in_usd} to put it in and {lb_gas_out_usd} to take it out.`),h=e(", plus a bonus of {lb_bonus_rate}% a year for the next {bonus_days}. After that I count only the {lb_base_rate}%, because Oak can't see whether the bonus will be renewed"),c=e(`B. Pendle: a fixed rate until {pendle_end_date}
|
|
6
|
+
Pays a fixed {pendle_rate}% a year if you keep it until {pendle_end_date}. You get {pendle_payout_usd} back for every {pendle_unit_usd} you put in.
|
|
7
|
+
${_}
|
|
8
|
+
Risk: ${d}
|
|
9
|
+
Cost: about {pendle_cost_in_usd} in fees to start and about {pendle_gas_out_usd} to cash out.`),p=e("B. Pendle has no fixed-rate USDG term open right now."),y=e("A. LayerBank can't be checked right now, so I won't offer it."),w=e("B. Pendle can't be checked right now, so I won't offer it."),E=e("A. LayerBank isn't taking new deposits right now, so I won't offer it."),g=e("A. LayerBank can only take {cap_room_usd} more right now, which is less than {amount_usd}, so I won't offer it."),m=e("Nobody guarantees either one. Which do you want: {choices}?"),f=e("Nobody guarantees either one."),k=e("You hold ETH but no USDG. I can swap some ETH to USDG first with Oak's swap tool and show you the price before anything happens."),b=e("This wallet holds no USDG and no ETH to put to work, so there is nothing to compare yet."),T=e("Oak is free."),x=e(`Put {amount_usd} into LayerBank?
|
|
10
|
+
|
|
11
|
+
What you get: about {lb_total_rate}% a year at today's rate. The rate changes.
|
|
12
|
+
What happens: {amount_usd} of USDG leaves your wallet and becomes {amount_usd} of "lRobUSDG", your receipt for money lent through LayerBank. Your receipt grows as interest arrives. Oak's preview checks the amount, but the contract doesn't enforce a minimum, so it can differ slightly.
|
|
13
|
+
The risk: LayerBank is a lending app. If its code fails, or almost everything is lent out, you could lose money or have to wait to get it back.
|
|
14
|
+
Taking it out: any time LayerBank has cash on hand. Right now that is {lb_cash_usd}. You can also take it out on layerbank.finance with this wallet.
|
|
15
|
+
Cost: about {gas_usd} in network fees now and about {gas_out_usd} to take it out.
|
|
16
|
+
|
|
17
|
+
Put in {amount_usd}? [Yes] [No]`),N=e(`Take {amount_or_all} out of LayerBank?
|
|
18
|
+
|
|
19
|
+
You get back {usdg_out} USDG (your {amount_deposited_clause} plus interest so far{bonus_note}). Oak's preview checks the amount, but the contract doesn't enforce a minimum, so it can differ slightly.
|
|
20
|
+
{cash_note}
|
|
21
|
+
Cost: about {gas_usd} in network fees.
|
|
22
|
+
|
|
23
|
+
Take it out? [Yes] [No]`),S=e(". Your bonus is paid separately; ask me to claim it"),L=e("LayerBank only has {lb_cash_usd} on hand right now, so I can take out {max_now} today."),A=e(`Lock {amount_usd} in a fixed rate until {pendle_end_date}?
|
|
24
|
+
|
|
25
|
+
What you get: a fixed {pendle_rate}% a year, if you keep it until {pendle_end_date}. You put in {amount_usd} and get {pt_out} tokens. Each token pays out {payout_per_pt_phrase} on {pendle_end_date}. That is about {gain_usd} more than you put in.
|
|
26
|
+
What happens now: {amount_usd} of USDG leaves your wallet and you receive at least {pt_min} "PT-USDG" tokens (the price can move a little before this goes through; Oak refuses anything worse than {slippage_pct}%).
|
|
27
|
+
The risk: if you leave before {pendle_end_date}, you sell at the market price that day, and that can be less than you put in. Pendle is a trading app; its code can fail, and its team can change it.
|
|
28
|
+
Cost: about {fees_usd} in trading and network fees now, and about {gas_out_usd} to cash out at the end.
|
|
29
|
+
|
|
30
|
+
Lock {amount_usd} until {pendle_end_date}? [Yes] [No]`),O=e(`Lock {amount_units} {stock_symbol} in a fixed rate until {pendle_end_date}?
|
|
31
|
+
|
|
32
|
+
What you get: you put in {amount_units} {stock_symbol} and receive at least {pt_min} tokens. On {pendle_end_date} each token pays out {payout_per_pt_phrase}. That is {gain_units} {stock_symbol} more than you put in, a fixed {pendle_rate}% a year in {stock_symbol}, not in dollars.
|
|
33
|
+
The catch: the payout is in {stock_symbol}, not dollars. If the stock token is worth less on {pendle_end_date}, you get less in dollars, even though the {stock_symbol} count is fixed.
|
|
34
|
+
The risk: leaving early sells at the market price that day, which can be less than you put in. This term is short ({days_left} days), so the extra {stock_symbol} is small. Pendle is a trading app; its code can fail, and its team can change it.
|
|
35
|
+
Cost: about {fees_usd} in trading and network fees now and about {gas_out_usd} to cash out.
|
|
36
|
+
|
|
37
|
+
Lock it until {pendle_end_date}? [Yes] [No]`),P=e(`Leave early and sell {pt_amount} tokens now?
|
|
38
|
+
|
|
39
|
+
If you wait until {pendle_end_date}, these tokens pay {payout_at_end} {unit}.
|
|
40
|
+
If you sell now, the market pays about {sell_now} {unit}, and Oak accepts no less than {sell_min}. {gap_line}
|
|
41
|
+
Selling early can lose money. The price today may be lower than what you paid.
|
|
42
|
+
Cost: about {fees_usd} in trading and network fees.
|
|
43
|
+
|
|
44
|
+
Sell now? [Yes, sell now] [No, keep waiting]`),D=e("That is {gap} less than waiting."),R=e("The quoted output before fees is at least the payout at the end of the term. Fees, the minimum output and what you paid still affect whether you lose money."),fe="No, keep waiting",C=e(`Cash out {pt_amount} tokens for {usdg_out} USDG?
|
|
45
|
+
|
|
46
|
+
The term ended on {pendle_end_date}. Each token pays out {payout_per_pt_phrase} now, with no market price involved.
|
|
47
|
+
Cost: about {gas_usd} in network fees.
|
|
48
|
+
|
|
49
|
+
Cash out? [Yes] [No]`),I=e(`Cash out {pt_amount} tokens for about {unit_out} {stock_symbol}?
|
|
50
|
+
|
|
51
|
+
The term ended on {pendle_end_date}. You receive {stock_symbol}, not USDG: about {unit_out} {stock_symbol}, worth about {value_usd} at today's price, which can move. No market price is involved in the payout itself.
|
|
52
|
+
To end up in USDG, I can swap the {stock_symbol} afterwards with Oak's swap tool and show you that price first.
|
|
53
|
+
Cost: about {gas_usd} in network fees.
|
|
54
|
+
|
|
55
|
+
Cash out? [Yes] [No]`),U=e("exactly 1 {unit}"),v=e("about {x} {unit} at today's exchange rate"),Y=e("Paid in {stock_symbol}, not dollars."),B=e("ends in {days_left} days, usually too short to be worth the fees"),ke=7,M=e("At {amount_usd}, this is too small to be worth it. You would earn about {gross_usd} over {horizon}, and fees would take about {costs_usd}, leaving about {net_usd}. Putting in {suggest_usd} or more would be worth it, and I can still do it if you want."),G=e("At {amount_usd}, this is too small to be worth it. You would earn about {gross_usd} over {horizon}, and fees would take about {costs_usd}, leaving about {net_usd}. At today's rate no amount would make up for the fees, and I can still do it if you want."),H=e("Oak is free."),K=e("Oak is free."),W=e("Fees estimated high because the live price was unavailable."),F=e(`Your fixed term on Pendle ended on {pendle_end_date}. Your {pt_amount} tokens are worth {usdg_out} USDG now.
|
|
56
|
+
Want me to cash out to USDG, or start a new term? One "yes" is enough; say "cash out" or "new term".`),q=e('Your fixed term on Pendle ended on {pendle_end_date}. Your {pt_amount} tokens pay out about {unit_out} {stock_symbol} now, worth about {value_usd}. Want me to cash out and swap that to USDG, or start a new term? One "yes" is enough.'),z=e('Your fixed term on Pendle in {stock_symbol} ended on {pendle_end_date}. Your tokens pay out in {stock_symbol}, not USDG; I will show the exact amount before anything is sent. Want me to cash out and swap that to USDG, or start a new term? One "yes" is enough.'),$=e("There is no new fixed-rate USDG term open right now. I cashed out to USDG; want me to show LayerBank instead?"),X=e(`Before you add liquidity: what it is worth, and what can go wrong
|
|
57
|
+
|
|
58
|
+
Worth: {worth_line}
|
|
59
|
+
{funder_line}What can go wrong:
|
|
60
|
+
- Price exposure: you put in two coins. If one moves a lot against the other, you can end up with less than you started with, even if you earn rewards.
|
|
61
|
+
- Going out of range: if the price leaves the range you chose, you stop earning until it comes back, and you hold mostly the weaker coin.
|
|
62
|
+
- The rewards can end: the campaign ends on {end_date}, or sooner, and the rate shown is today's rate, which changes.
|
|
63
|
+
Your call. [Add liquidity] [Don't]`),j=e("Merkl lists this pool's reward rate at about {apr}% a year until {end_date}. That rate is an average over everyone in the pool."),V=e("Rewards count only while the price stays inside your range."),Z=e("They are weighted {w}% by the trading fees your position earns, so your share can be lower."),J=e("For your {amount_usd}, at that average rate: about {per_day_usd} a day, about {gross_usd} until {end_date}."),Q=e("Network fees to join and leave are about {gas_usd}."),ee=e("Rates change; this is not a promise."),te=e("Uniswap pays the trading fees; Merkl runs the bonus, funded by {creator}. Oak can't identify who that is."),oe=e("That is not worth it at this size."),ae=e(`Before you add liquidity: what it is worth, and what can go wrong
|
|
64
|
+
|
|
65
|
+
Worth: the reward rate or end date couldn't be read, so I can't tell you what this is worth.
|
|
66
|
+
What can go wrong:
|
|
67
|
+
- Price exposure: you put in two coins. If one moves a lot against the other, you can end up with less than you started with, even if you earn rewards.
|
|
68
|
+
- Going out of range: if the price leaves the range you chose, you stop earning until it comes back, and you hold mostly the weaker coin.
|
|
69
|
+
- The rewards can end: a campaign can end at any time, and any rate shown is the rate of that day, which changes.
|
|
70
|
+
Your call. If you say nothing, the answer is Don't. [Don't] [Add liquidity]`),be="Add liquidity",Te="Don't",ne=e("Your position is in the pool. Merkl adds new positions to its reward list after a delay, and rewards become claimable only after Merkl's next reward update{last_update_clause}. An empty list right after a deposit is normal; check again later."),se=e(": the last one was at {time} UTC"),re=e("Merkl lists no earning positions for this wallet right now. If you just added liquidity: {after_deposit}"),ie=e("Oak won't accept a price move that big. The most it allows is {cap_pct}%."),ue=e("This is a thin market and your size moves the price too much. Try a smaller amount."),de=e("Pendle's price doesn't match what Oak checked on the chain. Nothing was signed."),_e=e("LayerBank's setup no longer matches what Oak checked. Nothing was signed."),le=e("Pendle's price service isn't answering, so I can't quote or start a new term; I can still cash out ended terms."),xe={CARD_HEADER:s,CARD_HEADER_AMOUNT:r,CARD_HEADER_AMOUNT_NOT_HELD:i,OPTION_A:l,BONUS_CLAUSE:h,OPTION_B:c,OPTION_B_NONE:p,OPTION_A_CANT_CHECK:y,OPTION_B_CANT_CHECK:w,OPTION_A_CLOSED:E,OPTION_A_NO_ROOM:g,CARD_FOOTER_ASK:m,CARD_FOOTER_NO_ASK:f,ETH_HINT:k,NOTHING_TO_EARN:b,ACCESS_NO_PLAN:T,LB_DEPOSIT_SCREEN:x,LB_WITHDRAW_SCREEN:N,LB_BONUS_NOTE:S,LB_CASH_NOTE:L,PENDLE_BUY_STABLE_SCREEN:A,PENDLE_BUY_STOCK_SCREEN:O,PENDLE_SELL_SCREEN:P,PENDLE_SELL_GAP_LINE:D,PENDLE_SELL_NO_GAP_LINE:R,PENDLE_REDEEM_SCREEN:C,PENDLE_REDEEM_STOCK_SCREEN:I,PAYOUT_EXACT:U,PAYOUT_APPROX:v,STOCK_PAID_IN:Y,STOCK_SHORT_TERM:B,TOO_SMALL:M,TOO_SMALL_NO_SIZE:G,ACCESS_FEE_LINE:H,ACCESS_FREE_UNTIL_LINE:K,FEES_ESTIMATED_HIGH:W,MATURED_NOTICE:F,MATURED_STOCK_NOTICE:q,MATURED_STOCK_NOTICE_NO_AMOUNT:z,NO_NEW_TERM:$,LP_BLOCK:X,LP_RATE_LINE:j,LP_RANGE_CLAUSE:V,LP_FEE_CLAUSE:Z,LP_SHARE_LINE:J,LP_GAS_LINE:Q,LP_NOT_A_PROMISE:ee,LP_FUNDER_LINE:te,LP_NOT_WORTH_CLAUSE:oe,LP_BLOCK_UNREADABLE:ae,MERKL_AFTER_DEPOSIT:ne,MERKL_LAST_UPDATE_CLAUSE:se,MERKL_EARNING_EMPTY:re,SLIPPAGE_CAP_REFUSAL:ie,THIN_MARKET_REFUSAL:ue,PRICE_MISMATCH_REFUSAL:de,LAYERBANK_SETUP_MISMATCH:_e,PENDLE_SERVICE_DOWN:le},Ne=[/\bsafe(ly|ty)?\b/i,/\bguaranteed\b/i,/\brisk-free\b/i,/\bpassive\b/i,/\binvest/i,/\bAPY\b(?! a year)/];export{pe as a,ye as b,we as c,Ee as d,s as e,r as f,i as g,u as h,d as i,_ as j,ge as k,me as l,l as m,h as n,c as o,p,y as q,w as r,E as s,g as t,m as u,f as v,k as w,b as x,T as y,x as z,N as A,S as B,L as C,A as D,O as E,P as F,D as G,R as H,fe as I,C as J,I as K,U as L,v as M,Y as N,B as O,ke as P,M as Q,G as R,H as S,K as T,W as U,F as V,q as W,z as X,$ as Y,X as Z,j as _,V as $,Z as aa,J as ba,Q as ca,ee as da,te as ea,oe as fa,ae as ga,be as ha,Te as ia,ne as ja,se as ka,re as la,ie as ma,ue as na,de as oa,_e as pa,le as qa,xe as ra,Ne as sa,Se as ta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./OVM4QIET.js";import{h as w}from"./2GXHYI23.js";import{a as y}from"./MSRCJ2BS.js";import{b as P,c as k,d as l}from"./WAKZWSHB.js";import{k as h}from"./UVAR6BHU.js";import{a as f}from"./43LI5NKJ.js";import{m as b,n as B}from"./NWNYJ26T.js";import{b as d}from"./TI727O2H.js";import{a as s}from"./XSD5NL7J.js";import{erc20Abi as L,formatUnits as R}from"viem";var U=70515n,C=250202n,S=568341n;function N(a,r){return{token:{...a},amount:r.toString()}}function A(a){if(a.network!==void 0&&a.network!=="mainnet")throw new s("LayerBank requires chain 4663.")}async function g(a,r,n,e){try{return b(await a.readContract({address:r.address,abi:L,functionName:"balanceOf",args:[n],blockNumber:e}),"LayerBank returned a malformed wallet balance read.")}catch(t){throw t instanceof s?t:new s("LayerBank wallet balance could not be read. Please try again.")}}async function T(a,r,n){try{let[e,t]=await Promise.all([r.getGasPrice(),h("ETH",{client:r,http:a.http,chainId:d,blockNumber:n})]),i=B(t.usdE18,"LayerBank gas reference is unavailable.",{positive:!0}),c=b(e,"LayerBank gas reference is unavailable.");if(c===0n)throw new s("LayerBank gas reference is unavailable.");let u=m=>Number(R(m*c*i/10n**18n,18)),o=u(U+C),p=u(S);if(![o,p].every(m=>Number.isFinite(m)&&m>0))throw new s("LayerBank gas reference is unavailable.");return{gasInUsd:o,gasOutUsd:p}}catch{throw new s("LayerBank gas costs could not be checked against a fresh ETH/USD reference. Please try again.")}}async function x(a,r){A(a),f(r);let n=a.clientFor(d),e=await y(n),[t,i,c,u]=await Promise.all([g(n,k,r,e.blockNumber),g(n,l,r,e.blockNumber),v(a.http),T(a,n,e.blockNumber)]),o=[...c.checks,"Gas costs use measured USDG calls plus 20% headroom; entry includes approval and supply."];e.active||o.push("LayerBank reserve is inactive."),e.frozen&&o.push("LayerBank reserve is frozen for deposits."),e.paused&&o.push("LayerBank reserve is paused."),e.capRoomBase===0n&&o.push("LayerBank supply cap has no room left.");let p={rateBasePct:e.rateBasePct,...c.bonus==="unavailable"?{}:{bonus:c.bonus},cashUsdgBase:e.cashUsdgBase,capRoomBase:e.capRoomBase,open:e.active&&!e.frozen&&!e.paused&&e.capRoomBase>0n,walletUsdgBase:t,walletReceiptBase:i,...u,checks:o};return{reserve:e,reading:p}}function F(a){return async r=>{try{return(await x(a,r)).reading}catch(n){return{rateBasePct:0,cashUsdgBase:0n,capRoomBase:0n,open:!1,walletUsdgBase:0n,walletReceiptBase:0n,gasInUsd:0,gasOutUsd:0,checks:[n instanceof s?a.plainError(n):"LayerBank could not be checked right now. Please try again."]}}}}async function W(a,r){A(a),f(r);let n=a.clientFor(d),e=await y(n),t=await g(n,l,r,e.blockNumber);if(t===0n)return[];let i=a.formatAmount(t.toString(),6);return[{module:"layerbank",id:`${d}:${P}`,chainId:d,assets:[N(l,t)],economics:{principal:[w("redeemable",{token:{...k},amount:t.toString(),source:"layerbank.receiptBalance",heldAs:l.address,measuredAtBlock:e.blockNumber.toString()})],debt:[],rewards:[],backing:[],coverage:{complete:!0}},description:`${i} lRobUSDG = ${i} USDG; base supply rate ${e.rateBasePct}% a year, read now.`}]}export{U as a,C as b,S as c,N as d,A as e,g as f,x as g,F as h,W as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as me,c as Pe}from"./Z3IBPCY4.js";import{d as xe,e as Se,g as Ee,h as Oe,i as a,w as Ne}from"./Y64GFBTA.js";import{o as pe}from"./LKX5WDOQ.js";import{a as B}from"./Z7FGEWO2.js";import{a as Te}from"./43LI5NKJ.js";import{a as ee}from"./66F5ZH34.js";import{c as Y,j as ve}from"./NWNYJ26T.js";import{b as Ce}from"./IX3GZMTM.js";import{b as $,j as De}from"./TI727O2H.js";import{a as t}from"./XSD5NL7J.js";import{decodeFunctionData as _e,erc20Abi as Fe}from"viem";var Ge="https://api.relay.link",He="Relay requires an authorized API key for this endpoint. Ask the operator to configure a valid OAK_RELAY_API_KEY on the server with access to this resource; never pass keys in tool arguments.",oe=class extends Error{},k="0x0000000000000000000000000000000000000000",Ye=60,Be=30,n=De[$].relay.depository.address.toLowerCase(),te="0x59916da825d2d2ec1bf878d71c88826f6633ecca",ie=new Map([[1,{chainId:"ethereum",depository:n}],[10,{chainId:"optimism",depository:n}],[25,{chainId:"cronos",depository:te}],[56,{chainId:"bnb",depository:n}],[100,{chainId:"gnosis",depository:n}],[130,{chainId:"unichain",depository:n}],[137,{chainId:"polygon",depository:n}],[143,{chainId:"monad",depository:n}],[146,{chainId:"sonic",depository:n}],[169,{chainId:"manta",depository:n}],[196,{chainId:"xlayer",depository:n}],[288,{chainId:"boba",depository:n}],[324,{chainId:"zksync",depository:n}],[360,{chainId:"shape",depository:n}],[480,{chainId:"worldchain",depository:n}],[747,{chainId:"flow",depository:n}],[988,{chainId:"stable",depository:n}],[999,{chainId:"hyperevm",depository:n}],[1088,{chainId:"metis",depository:te}],[1135,{chainId:"lisk",depository:n}],[1868,{chainId:"soneium",depository:n}],[2020,{chainId:"ronin",depository:n}],[2741,{chainId:"abstract",depository:n}],[2818,{chainId:"morph",depository:n}],[4217,{chainId:"tempo",depository:n}],[4326,{chainId:"megaeth",depository:n}],[5e3,{chainId:"mantle",depository:te}],[5031,{chainId:"somnia",depository:n}],[5042,{chainId:"arc",depository:n}],[8453,{chainId:"base",depository:n}],[9745,{chainId:"plasma",depository:n}],[33139,{chainId:"apechain",depository:n}],[34443,{chainId:"mode",depository:n}],[42018,{chainId:"mythos",depository:n}],[42161,{chainId:"arbitrum",depository:n}],[42220,{chainId:"celo",depository:n}],[43114,{chainId:"avalanche",depository:n}],[48900,{chainId:"zircuit",depository:n}],[57073,{chainId:"ink",depository:n}],[59144,{chainId:"linea",depository:te}],[60808,{chainId:"bob",depository:n}],[80094,{chainId:"berachain",depository:n}],[97477,{chainId:"doma",depository:n}],[98866,{chainId:"plume",depository:n}],[534352,{chainId:"scroll",depository:n}],[685689,{chainId:"gensyn",depository:n}],[747474,{chainId:"katana",depository:n}],[5064014,{chainId:"ethereal",depository:n}],[7777777,{chainId:"zora",depository:n}]]),at=Object.freeze(["robinhood",...Array.from(ie.values(),e=>e.chainId)]);function dt(e){return e===$?"robinhood":ie.get(e)?.chainId}function ut(e){return ie.get(e)?.depository}function M(e){return ve(e,"Provide a token or wallet address.")}function g(e){let i=M(e);return i===B?k:i}function w(e,i){return M(e)===M(i)}function f(e){if(typeof e!="string")throw new t("Provide a decimal base-unit amount string.");return Ce(e),e}function ne(e){let i=f(e);if(BigInt(i)<=0n)throw new t("Provide a positive base-unit amount.");return i}function Ke(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new t("Provide a positive integer origin chain ID.");return e}function Me(e,i){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw new t(`${i} is missing or invalid.`);return e}async function K(e,i,c,r,m){let s=a(c);if(s.chainId!==r||g(s.address)!==m||typeof s.symbol!="string"||!/^[A-Za-z0-9._-]{1,32}$/.test(s.symbol))throw new t("Relay quote token metadata does not match the requested chain and address.");if(m===k){if(s.decimals!==18)throw new t("Native token decimals must be 18.");return{address:B,chainId:r,symbol:s.symbol,decimals:18}}let b=`${r}:${m}`,h=i.get(b);if(h===void 0){let d=await e.clientFor(r).readContract({address:m,abi:Fe,functionName:"decimals"}),I=typeof d=="bigint"?Number(d):d;if(typeof I!="number"||!Number.isInteger(I)||I<0||I>255)throw new t("Could not read valid ERC-20 decimals() on-chain.");h=I,i.set(b,h)}return{address:m,chainId:r,symbol:s.symbol,decimals:h}}async function Qe(e,i,c,r,m,s,b){if(c.swap===void 0)return[];let h=a(c.swap),d=a(h.from);if(d.chainId!==m)throw new t("The swap prerequisite token must be on the origin chain.");let I=await K(e,i,d,m,g(d.address)),F=s===k?B:s;if(w(I.address,F))throw new t("The swap prerequisite must use a different input token.");let he=ne(h.amountIn),y=h.slippageBps;if(y!==void 0&&(typeof y!="number"||!Number.isInteger(y)||y<0||y>1e4))throw new t("Provide swap slippage in basis points from 0 to 10000.");let S=await e.quoteSwap({from:I.address,to:F,amountIn:he,...y===void 0?{}:{slippageBps:y}},r);if(BigInt(f(S.expiresAt))<=BigInt(Math.floor(Date.now()/1e3)))throw new t("The swap prerequisite quote expired. Request a fresh quote.");if(BigInt(f(S.minAmountOut))<BigInt(b))throw new t("The swap prerequisite minimum cannot cover the bridge amount.");let q=await e.buildSwap(S.quoteId,r);if(!("txs"in q)||!q.txs.length)throw new t("The swap prerequisite must return unsigned transactions.");if(q.txs.some(p=>p.chainId!==m))throw new t("The injected swap coordinator does not support this origin chain.");return q.txs.map(p=>e.unsignedTx(p))}async function Ve(e,i,c){Te(c);let r=Ke(i.originChainId);if(r===$)throw new t("Inbound bridging requires an origin chain other than 4663.");let m=ie.get(r);if(!m)throw new t("Relay inbound does not support this origin chain.");if(i.destinationChainId!==void 0&&i.destinationChainId!==$)throw new t("Inbound bridge destination must be chain 4663.");let s=g(i.originCurrency??B),b=g(i.destinationCurrency??B),h=M(i.recipient??c),d=ne(i.amount),I=i.minAmountOut===void 0?void 0:f(i.minAmountOut),F=i.slippageBps===void 0?me:i.slippageBps;if(pe("0",F),await e.clientFor(r).getChainId()!==r)throw new t("The RPC chain does not match the inbound origin chain.");let y=new Map,S=await Qe(e,y,i,c,r,s,d),q;try{let o=await e.http(`${Ge}/quote/v2`,{method:"POST",headers:{"content-type":"application/json","user-agent":"oak-core/0.1.0"},body:JSON.stringify(xe({user:c,recipient:h,originChainId:r,destinationChainId:$,originCurrency:s,destinationCurrency:b,amount:d,tradeType:"EXACT_INPUT",includeProtocolData:!0,...s===k?{}:{explicitDeposit:!0}}))});if(o.status===401||o.status===403)throw new oe(He);if(!o.ok)throw new Error("Relay HTTP failure.");q=await o.json()}catch(o){throw o instanceof oe?new t(o.message):o instanceof t&&typeof o.reason=="string"&&o.reason.startsWith("keyed_")?new t(o.message):new t("Relay quote request failed. Please try again.")}let p=a(q);Se(p);let le=Ee(p.fees);if(typeof p.requestId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(p.requestId))throw new t("Relay returned an invalid request ID.");let E=p.requestId,ye=`/intents/status/v3?requestId=${E}`,U=a(p.details);if(!w(U.sender,c)||!w(U.recipient,h))throw new t("Relay quote sender or recipient does not match the request.");let fe=a(U.currencyIn),re=a(U.currencyOut),O=await K(e,y,fe.currency,r,s),N=await K(e,y,re.currency,$,b);if(f(fe.amount)!==d)throw new t("Relay quote input amount does not match the request.");let P=ne(re.amount),D=ne(re.minimumAmount);if(BigInt(D)>BigInt(P))throw new t("Relay quote minimum output exceeds the expected output.");if(I!==void 0){if(D!==I)throw new t("Relay order minimum must exactly match minAmountOut. Request a new quote.")}else{let o=pe(P,F);if(BigInt(D)<BigInt(o))throw Pe(P,D)}let we=a(a(p.fees).relayer),Ie=a(we.currency),Q=await K(e,y,Ie,r,g(Ie.address)),ge={token:Q,amount:f(we.amount)},be=a(U.refundCurrency),Ue=a(be.currency),L=await K(e,y,Ue,r,s),se=f(be.amount),j=a(a(p.protocol).v2);if(typeof j.orderId!="string"||!/^0x[0-9a-fA-F]{64}$/.test(j.orderId))throw new t("Relay returned an invalid order ID.");let V=j.orderId.toLowerCase(),W=a(j.paymentDetails),R=M(W.depository);if(W.chainId!==m.chainId||R!==m.depository||g(W.currency)!==s||f(W.amount)!==d)throw new t("Relay payment details do not match the origin chain depository and input.");let z=a(j.orderData),C=a(z.output);if(C.chainId!=="robinhood"||!Array.isArray(C.calls)||C.calls.length!==0||!Array.isArray(C.payments)||C.payments.length!==1)throw new t("Relay order output does not match destination chain 4663.");let J=a(C.payments[0]);if(!w(J.recipient,h)||g(J.currency)!==b||f(J.minimumAmount)!==D||f(J.expectedAmount)!==P)throw new t("Relay order output payment does not match the quoted recipient and amounts.");let ae=Me(C.deadline,"Relay order output deadline");if(!Array.isArray(z.inputs)||!z.inputs.length)throw new t("Relay order has no inputs.");let X=[],de=[];for(let o of z.inputs){let u=a(o),T=a(u.payment);if(T.chainId!==m.chainId||g(T.currency)!==s||f(T.amount)!==d||!Array.isArray(u.refunds)||!u.refunds.length)throw new t("Relay order input does not match the quoted input.");for(let x of u.refunds){let l=a(x);if(!w(l.recipient,c))throw new t("Relay refund recipient does not match the agent wallet. Request a new quote.");if(X.push(Me(l.deadline,"Relay order refund deadline")),de.push(f(l.minimumAmount)),!(l.chainId===m.chainId?w(l.recipient,c)&&g(l.currency)===s:l.chainId==="robinhood"&&g(l.currency)===b))throw new t("Relay order refund terms do not match the sender or recipient.")}}let Ae=Math.min(ae,...X),G=0,$e=()=>{let o=Math.floor(Date.now()/1e3),u=G||o+Ye;if(Ae-o<=Be)throw new t("Relay order deadline is expired or too soon to sign safely. Request a new quote.");if(G=Math.min(u,Ae-Be),G<=o)throw new t("Relay quote expired before signing. Request a new quote.")};if($e(),!Array.isArray(p.steps)||!p.steps.length)throw new t("Relay returned no origin transactions.");let v=[];for(let o of p.steps){let u=a(o);if(u.kind!=="transaction"||u.requestId!==E||!Array.isArray(u.items)||!u.items.length)throw new t("Relay returned an unsupported origin step.");for(let T of u.items){let x=a(T),l=a(x.data),ce=a(x.check);if(x.status!=="incomplete"||l.chainId!==r||!w(l.from,c))throw new t("Relay transaction does not match the origin chain and sender.");if(ce.method!=="GET"||ce.endpoint!==ye)throw new t("Relay status endpoint does not match the request ID.");v.push(e.unsignedTx({to:M(l.to),data:l.data,value:f(l.value),chainId:r,description:`Relay inbound deposit for request ${E}; destination chain 4663.`}))}}if(!v.length)throw new t("Relay returned no origin transactions.");if(s===k&&v.length!==1)throw new t("Relay native deposit must be a single depositNative transaction.");if(s!==k&&v.length>2)throw new t("Relay ERC-20 deposit allows at most one exact-amount approval before depositErc20.");for(let o of v.slice(0,-1)){if(!o.data.toLowerCase().startsWith("0x095ea7b3"))throw new t("Relay returned an unsupported prerequisite transaction.");let u=_e({abi:Fe,data:o.data});if(u.functionName!=="approve")throw new t("Relay returned an invalid approval.");let[T,x]=u.args;if(s===k||!w(o.to,s)||!w(T,R)||x!==BigInt(d)||o.value!=="0")throw new t("Relay approval must authorize the exact input amount for the origin depository.");o.description=`Approve exactly ${e.formatAmount(d,O.decimals)} ${O.symbol} (${d} base units of ${s}) for ${R} on chain ${r}.`}let _=v[v.length-1],H=s===k,Z=H?"depositNative":"depositErc20",Re=H?"depositNative(address,bytes32)":"depositErc20(address,address,uint256,bytes32)";if(!w(_.to,R)||_.value!==(H?d:"0")||!(H?/^0x[0-9a-fA-F]{136}$/:/^0x[0-9a-fA-F]{264}$/).test(_.data))throw new t(`Relay deposit transaction does not target the origin depository with ${Z} calldata.`);let A;try{A=_e({abi:Oe,data:_.data})}catch{throw new t(`Relay deposit transaction must call ${Re}.`)}if(A.functionName!==Z)throw new t(`Relay deposit transaction must call ${Re}.`);let Le=A.args[0],je=A.functionName==="depositErc20"?A.args[3]:A.args[1];if(A.functionName==="depositErc20"&&(!w(A.args[1],s)||A.args[2]!==BigInt(d)))throw new t("Relay depositErc20 token or amount does not match the quoted input.");if(!w(Le,c)||je.toLowerCase()!==V)throw new t(`Relay ${Z} depositor or orderId does not match the wallet and quoted protocol.v2.orderId.`);_.description=`Relay inbound ${Z} for order ${V} (request ${E}); destination chain 4663.`;let ue=H?[]:await Ne(e,s,R,d,r,c);for(let[o,u]of ue.entries())u.description=ue.length===2&&o===0?`Reset the existing ${O.symbol} allowance for ${R} on chain ${r} to zero.`:`Approve exactly ${e.formatAmount(d,O.decimals)} ${O.symbol} (${d} base units of ${s}) for ${R} on chain ${r}.`;let ke=[...S,...ue,_],qe=await e.preview(ke,c);$e();let ze=qe.changes.map(o=>{let u=o.amount.startsWith("-");return`${u?"-":""}${e.formatAmount(u?o.amount.slice(1):o.amount,o.token.decimals)} ${o.token.symbol} (${o.token.address}, chain ${o.token.chainId})`});return{txs:ke,preview:qe,requestId:E,orderId:V,orderData:z,depository:R,originChainId:r,destinationChainId:$,recipient:h,amountIn:{token:O,amount:d},amountOut:{token:N,amount:P},minAmountOut:D,relayerFee:ge,fees:p.fees,...le,refundCurrency:{token:L,amount:se,minimumAmounts:de},orderDeadline:String(ae),refundDeadlines:X.map(String),expiresAt:String(G),status:"pending",statusEndpoint:ye,summary:`${le.feeDisclosure} ${S.length?"Swap prerequisite first, then ":""}Relay inbound from chain ${r} to chain 4663 for ${h}; expected ${e.formatAmount(P,N.decimals)} ${N.symbol}, minimum ${e.formatAmount(D,N.decimals)} ${N.symbol} (${N.address}). Quoted relay fee ${e.formatAmount(ge.amount,Q.decimals)} ${Q.symbol} (${Q.address}, chain ${r}); output is net of quoted fees. Order ${V} (request ${E}); output deadline ${ae}, refund deadlines ${X.join(", ")}, quote expires ${G}. Refund terms: details.refundCurrency quotes ${e.formatAmount(se,L.decimals)} ${L.symbol} (${se} base units) on chain ${L.chainId} (${L.address}), but protocol.v2 order refund floor is ${de.join(", ")} base units. ${ze.join("; ")}. Unsigned origin transactions only; destination fulfillment remains pending. Track with relay_status; timeout or refund is not fulfillment.`}}var ct=e=>({tools:[{name:"relay_bridge_in",inputSchema:{type:"object",additionalProperties:!1,required:["originChainId","amount"],properties:{originChainId:{type:"integer",minimum:1,description:"Origin chain ID."},destinationChainId:{const:$,description:"Destination chain ID; must be 4663."},originCurrency:{...Y,description:"Origin token address; defaults to the origin chain\u2019s native token."},destinationCurrency:{...Y,description:"Destination token address; defaults to native ETH."},amount:ee('Origin token amount in base units using its decimals (USDG has 6: "1000000" = 1 USDG).'),minAmountOut:ee('Minimum destination token amount in base units using its decimals (USDG has 6: "1000000" = 1 USDG).'),slippageBps:{type:"integer",minimum:0,maximum:9999,default:me,description:"Slippage in basis points (50 = 0.5%)."},recipient:{...Y,description:"Destination recipient address; defaults to your wallet."},swap:{type:"object",additionalProperties:!1,required:["from","amountIn"],properties:{from:{type:"object",additionalProperties:!1,required:["address","chainId","symbol","decimals"],properties:{address:{...Y,description:"Input token address."},chainId:{type:"integer",minimum:1,description:"Input token chain ID."},symbol:{type:"string",description:"Input token symbol."},decimals:{type:"integer",minimum:0,maximum:255,description:"Input token decimal places."}},description:"Token supplied to the origin swap."},amountIn:ee('Swap input token amount in base units using its decimals (USDG has 6: "1000000" = 1 USDG).'),slippageBps:{type:"integer",minimum:0,maximum:1e4,description:"Slippage in basis points (50 = 0.5%)."}},description:"Optional origin swap before bridging."}}},async execute(i,c){try{return await Ve(e,i,c)}catch(r){throw new t(e.plainError(r))}}}]});export{at as a,dt as b,ut as c,ct as d};
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A}from"./5HCXZWUH.js";import{
|
|
1
|
+
import{c as A}from"./5HCXZWUH.js";import{s as y}from"./MQ5F2VOK.js";import{a as b}from"./XSD5NL7J.js";import{erc20Abi as F,getAddress as $}from"viem";var P=new WeakMap,E=3e3,k=new WeakMap;async function q(C,h,u,m,c){u=$(u);let n=A(C),e=P.get(n);e||(e=new Map,P.set(n,e));let i=`${h}:${u.toLowerCase()}:${m}:${c??"latest"}`,t=e.get(i);if(t&&(e.delete(i),e.set(i,t)),!t){for(t=new Promise((s,T)=>{let a=k.get(n);a||(a=new Map,k.set(n,a));let f=`${h}:${c??"latest"}`,l=a.get(f);if(!l){l=[],a.set(f,l);let d=l;queueMicrotask(async()=>{a.delete(f);let w=d.map(r=>({address:r.address,abi:F,functionName:r.field}));try{if(d.length>1&&n.chain?.contracts?.multicall3&&typeof n.multicall=="function"){let r=await y(()=>n.multicall({contracts:w,blockNumber:c,allowFailure:!0}));d.forEach((o,p)=>{let g=r[p];g?.status==="success"?o.resolve(g.result):o.reject(g?.error??new b("Token metadata could not be read."))})}else await Promise.all(d.map(async(r,o)=>{try{r.resolve(await y(()=>n.readContract({...w[o],blockNumber:c})))}catch(p){r.reject(p)}}))}catch(r){d.forEach(o=>o.reject(r))}})}l.push({address:u,field:m,resolve:s,reject:T})}).then(s=>{if(m==="decimals"?!Number.isInteger(s)||Number(s)<0||Number(s)>255:typeof s!="string"||!s.trim())throw new b("The contract returned invalid token metadata.");return s});e.size>=E;)e.delete(e.keys().next().value);e.set(i,t);let M=t;t.catch(()=>{e.get(i)===M&&e.delete(i)})}try{return await t}finally{c!==void 0&&e.get(i)===t&&e.delete(i)}}export{q as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,b as D}from"./IBL6TL2Q.js";import{b as N}from"./G2AA73ZE.js";import{ja as T}from"./HHYE42JG.js";import{h as u,i as C,l as I,m as O}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{erc20Abi as b,isHex as Z,keccak256 as j,parseAbi as G,zeroAddress as J}from"viem";var y=G(["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[])"]),o=T("setup-mismatch",{}),p=e=>I(C(e,o),o),x=e=>O(e,o);function g(e){if(typeof e!="string"||!Z(e,{strict:!0})||e.length<4||e.length%2!==0)throw new n(o);return j(e)}function V(e){if(typeof e!="number"||!Number.isInteger(e)||e<0||e>255)throw new n(o);return e}function H(e,t){return typeof e=="string"&&/^[A-Za-z0-9.$_-]{1,32}$/.test(e)?e:t}async function _(e,t){if(await e.getChainId()!==d.chainId)throw new n("Borro requires chain 4663.");return x(t??await e.getBlockNumber({cacheTime:0}))}async function z(e,t,f){let a=(r,s,l=[])=>e.readContract({address:r,abi:y,functionName:s,args:l,blockNumber:f}),i={ok:!0,drift:[]};for(let r of["owner","curator"])try{i[r]=p(await a(t,r)),u(i[r],d[r])||i.drift.push(r)}catch{i.drift.push(`${r} unreadable`)}try{let r=x(await a(t,"adaptersLength"));if(r>64n)throw new n(o);let s=await Promise.all(Array.from({length:Number(r)},async(l,c)=>{let m=p(await a(t,"adapters",[BigInt(c)]));if(g(await e.getCode({address:m,blockNumber:f})),!u(await a(m,"parentVault"),t))throw new n(o);return m}));if(new Set(s).size!==s.length)throw new n(o);i.adapters=s}catch{i.drift.push("adapters unreadable or invalid")}return i}function M(e=[]){return async(t,f)=>{let a=u(f,d.assetRule.usdg.address)?{...d.assetRule.usdg,chainId:d.chainId}:e.find(i=>i.chainId===d.chainId&&u(i.address,f));return a?{...a,address:p(a.address)}:void 0}}function Q(e={resolveAllowedAsset:M()}){return async(t,f,a,i={})=>{try{let r=p(f),s=await _(t,i.blockNumber),l=a==="deposit"&&!!i.wallet,c=[{address:d.factory.address,abi:y,functionName:"isVaultV2",args:[r]},{address:r,abi:y,functionName:"asset"},{address:r,abi:y,functionName:"decimals"}],[m,k,R,E]=await Promise.all([t.getCode({address:d.factory.address,blockNumber:s}),t.getCode({address:r,blockNumber:s}),l?t.multicall({allowFailure:!1,batchSize:0,blockNumber:s,contracts:[...c,{address:d.builders.address,abi:N,functionName:"vaults",args:[r]},{address:d.builders.address,abi:N,functionName:"builders",args:[D]}]}):Promise.all(c.map(v=>t.readContract({...v,blockNumber:s}))),l?t.getCode({address:d.builders.address,blockNumber:s}):void 0]);if(!Array.isArray(R)||R.length!==(l?5:3))throw new n(o);let[$,F,L,S,q]=R,P=!1;if(l){if(!u(g(E),d.builders.codeHash)||typeof S!="boolean")throw new n(o);let v=C(q,o);P=S&&!u(v,J)}if(!u(g(m),d.factory.codeHash)||$!==!0||V(L)!==18)throw new n(o);let K=g(k),A=p(F),B=V(await t.readContract({address:A,abi:b,functionName:"decimals",blockNumber:s})),w;try{w=await e.resolveAllowedAsset(t,A,s)}catch{}if(w&&(!u(w.address,A)||w.chainId!==4663||w.decimals!==B||H(w.symbol,"")===""))throw new n(o);let h=await z(t,r,s);if(w||h.drift.push("asset identity is outside the available official catalogue"),h.drift.length){if(a!=="withdraw"||!i.wallet)throw new n(o);if(x(await t.readContract({address:r,abi:b,functionName:"balanceOf",args:[p(i.wallet)],blockNumber:s}))===0n)throw new n(o)}let U=H(await t.readContract({address:r,abi:b,functionName:"symbol",blockNumber:s}).catch(()=>{}),"shares");return{vault:r,symbol:w?.symbol??"token",vaultSymbol:U,asset:A,assetDecimals:B,codeHash:K,chainId:4663,shareDecimals:18,...h.owner&&{owner:h.owner},...h.curator&&{curator:h.curator},...h.adapters&&{adapters:h.adapters},setup:h,assetAllowed:!!w,mode:a,...l?{builderEligible:P}:{},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(o)}}}var ae=Q(),se=async(e,t,f)=>{try{let a=await _(e),[i,r,s,l]=await Promise.all([e.getCode({address:t.vault,blockNumber:a}),e.readContract({address:t.vault,abi:y,functionName:"asset",blockNumber:a}),e.readContract({address:t.vault,abi:b,functionName:"decimals",blockNumber:a}),e.readContract({address:t.asset,abi:b,functionName:"decimals",blockNumber:a})]);if(!u(g(i),t.codeHash)||!u(p(r),t.asset)||V(s)!==18||V(l)!==t.assetDecimals)throw new n(o);let c=await z(e,t.vault,a);if(t.adapters&&c.adapters&&(t.adapters.length!==c.adapters.length||t.adapters.some((m,k)=>!u(m,c.adapters[k])))&&c.drift.push("adapters changed"),f==="deposit"&&c.drift.length)throw new n(o);return c}catch(a){throw a instanceof n?a:new n(o)}};export{y as a,o as b,p as c,x as d,g as e,V as f,H as g,_ as h,M as i,Q as j,ae as k,se as l};
|
|
@@ -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{m as J,n as Z}from"./4NBXBKOX.js";import{a as x}from"./G2LAO23N.js";import{a as V}from"./66F5ZH34.js";import{b as K,c as X,g as C}from"./NWNYJ26T.js";import{b as f}from"./TI727O2H.js";import{a as u}from"./XSD5NL7J.js";import{encodeFunctionData as G,getAddress as b,hashTypedData as T,parseAbi as A,recoverTypedDataAddress as ie}from"viem";var oe={pool:b("0x281210097f0de7A8FB6F87310AF0f089c9C8DE21"),registry:b("0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"),usdg:b("0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"),priors:b("0xeDBf91223639800BCd5756815CAf908Df3b890bE"),stock:b("0xbEcd07EC689988e16b870C121756C4c2C8cb02B6"),backing:b("0xC999014C6218EC41f0aE412d49AE8f2aA4c539fD"),treasury:b("0xFe8fdf43c4b0443aCF8E8CD8facD62F1B770e267"),bond:b("0x346d3360B7258a18E8a2a55fe20E0F467113a53A"),autopay:b("0x72B510AF4e66e5960aB9b975e0BdCf80239e83A0"),savings:b("0xBeEff033F34C046626B8D0A041844C5d1A5409dd"),market:b("0x6a4583242B8313313E684d02aB7dc6bFf8749670"),market1:b("0xe5C8b3FacD7802099C1DfB88c0C818Cd0ebA7B19"),bidSpender:b("0x0dbd031a3e8cc91C2b0A3Bf6BD1d14c7AeD92878"),seats3:b("0x59D155C42A9263fA7596867b992bB3e84dF680a9"),seats4:b("0xb1c3a04496238D62E3c93118C297163855e22192")},c=oe,$="(uint256 agentId,uint256 sponsorId,address owner,uint256 maxPremiumBps,uint256 nonce,uint256 deadline)",ne=A(["function ownerOf(uint256) view returns (address)","function getAgentWallet(uint256) view returns (address)"]),z=A(["function nonces(uint256) view returns (uint256)"]),re=A(["function isValidSignature(bytes32,bytes) view returns (bytes4)"]),ae="0x0000000000000000000000000000000000000000",O="Owner stake is collateral, not a return. A default burns 75% of owner stake (50% of other backing); pending and leaving stake remains at risk until released. New backing waits 24 hours. Exit mode 0 holds, 1 returns PRIORS, 2 requests USDG through the guarded exit queue; no immediate payout is promised.",e=(t,i,n,r,a={})=>({name:`priors_${t}`,contract:i,signature:`function ${n}`,fields:r,note:"",...a}),o=["agentId","id"],v=["amount","uint"],Q=["on","bool"],_=["generation","uint32"],D=["day","uint32"],P=["layer","uint8"],s={read:!0},te=[e("set_delegate","pool","setDelegate(uint256,address)",[o,["delegate","address"]],{owner:"agentId",note:"Owner only. Delegate controls borrowing/repayment, not transfer of identity; clear with the zero address."}),e("root_enroll","pool","enrollRoot(uint256,uint256)",[o,v],{owner:"agentId",approval:"usdg",note:"Owner only. Locks USDG pool shares behind this sponsor root; active delegated lines and fees constrain withdrawals."}),e("root_add_stake","pool","addStake(uint256,uint256)",[o,v],{approval:"usdg",note:"Anyone may add USDG; only the root owner can withdraw it. This may give funds to another owner."}),e("root_unlock","pool","unlock(uint256,uint256,address)",[o,["shares","uint"]],{owner:"agentId",args:["agentId","shares","$wallet"],note:"Owner only. Withdraw root pool shares to this wallet, subject to delegated backing and fee locks."}),e("root_retire","pool","retireRoot(uint256)",[o],{owner:"agentId",note:"Owner only; requires no remaining stake or delegated lines."}),e("root_vouch","pool","vouch(uint256,uint256,uint256)",[["sponsorId","id"],o,v],{owner:"sponsorId",note:"Owner of sponsor only. Adds the exact USDG amount of undrawn backing to an existing sponsored line."}),e("root_unvouch","pool","unvouch(uint256,uint256,uint256)",[["sponsorId","id"],o,v],{owner:"sponsorId",note:"Owner of sponsor only. Recalls undrawn backing; outstanding debt remains backed."}),e("root_freeze","pool","freeze(uint256,bool)",[o,["frozen","bool"]],{note:"Current sponsor owner only; freeze/unfreeze the agent line. Contract checks sponsor ownership."}),e("root_set_premium","pool","setPremium(uint256,uint256)",[o,["premiumBps","uint"]],{note:"Current sponsor owner only. Future loan premium cannot exceed the owner-consented cap."}),e("root_claim_fees","pool","claimSponsorFees(uint256,address)",[o],{owner:"agentId",args:["agentId","$wallet"],note:"Owner only; claim sponsor USDG fees to this wallet."}),e("root_set_hook","pool","setHook(uint256,address)",[o,["hook","address"]],{owner:"agentId",note:"Owner only. Changes root lending policy hook; pool enforces the delay while backing is committed."}),e("root_apply_hook","pool","applyHook(uint256)",[o],{note:"Apply a previously scheduled root hook after its on-chain delay."}),e("mark_default","pool","markDefault(uint256)",[["loanId","id"]],{note:"Irreversible: mark a past-grace unpaid loan defaulted, burn sponsor backing and mark the owner. Preview and confirm deliberately."}),e("import_history","pool","importFromV1(uint256)",[o],{note:"Import the v1 record, including defaults; this never imports unbacked capacity."}),e("fund_reserve","pool","fundReserve(uint256)",[v],{approval:"usdg",note:"Donate USDG to the pool reserve; receives no redeemable shares."}),e("root_shares","pool","rootShares(uint256) view returns (uint256)",[o],s),e("root_fee_locked","pool","feeLocked(uint256) view returns (uint256)",[o],s),e("root_fees_owed","pool","sponsorFees(uint256) view returns (uint256)",[o],s),e("root_backing","pool","backing(uint256) view returns (uint256)",[o],s),e("root_free_backing","pool","freeBacking(uint256) view returns (uint256)",[o],s),e("pool_parameters","pool","getParams() view returns ((uint256 minLoan,uint256 maxLoan,uint64 minTerm,uint64 maxTerm,uint64 grace,uint64 minScoreTerm,uint256 feeBps,uint256 sponsorFeeBps,uint256 protocolFeeBps,uint256 minStake,uint256 maxUtilizationBps,uint256 keeperBounty))",[],s),e("bond_deposit","bond","deposit(uint256)",[o],{owner:"agentId",approval:"bond",note:"Owner only. V2 treasury bond remains locked while any line or loan is open; it may replace and refund a former owner bond. Leave and release the legacy bond before Treasury V5 migration."}),e("bond_release","bond","release(uint256)",[o],{note:"Return V2 bond to its original depositor, not necessarily this wallet; contract enforces no line, no loan and age."}),e("bond_slash","bond","slash(uint256)",[o],{note:"Irreversible: send defaulted agent V2 bond to the configured beneficiary."}),e("bond_status","bond","bonds(uint256) view returns ((address depositor,uint64 at,uint256 amount))",[o],s),e("bond_releasable","bond","releasable(uint256) view returns (bool)",[o],s),e("bond_release_at","bond","unusedReleaseAt(uint256) view returns (uint256)",[o],s),e("treasury_move","treasury",`move(uint256,${$},bytes)`,[o],{owner:"agentId",consentRoot:8793n,externalConsent:!0,args:["agentId","$consent","$signature"],note:"Move a former Treasury V4 line to V5, no loan open. Close old line, release legacy bond, deposit V2 bond first. V4 record and current-owner V2 bond are required."}),e("treasury_raise","treasury","raise(uint256)",[o],{note:"Raise an eligible Treasury V5 line using its current rules, score, history, age, weekly room and free backing. No unbacked credit."}),e("treasury_reclaim","treasury","reclaim(uint256)",[o],{note:"Reclaim an idle treasury line under on-chain rules; this ends borrowing access."}),e("treasury_first_line","treasury",`firstLine(uint256,uint64,bytes,${$},bytes)`,[o,["expiry","uint"],["invite","bytes"]],{owner:"agentId",consentRoot:8793n,externalConsent:!0,args:["agentId","expiry","invite","$consent","$signature"],note:"Redeem an already-issued Treasury V5 invite with V5 pool consent. Requires a valid V5 inviter signature; the current owner V2 bond is needed before borrowing. V4 invites cannot be reused."}),e("treasury_raise_room","treasury","raiseRoom() view returns (uint256)",[],s),e("treasury_first_lined","treasury","firstLined(uint256) view returns (bool)",[o],s),e("treasury_eligible_raise","treasury","eligibleForRaise(uint256) view returns (bool)",[o],s),e("treasury_room","treasury","epochRoom() view returns (uint256)",[],s),e("treasury_rules","treasury","rules() view returns (uint256 reserveBps,uint256 firstLine,uint256 secondLine,uint256 epochCap,uint64 epochLength,uint64 minSeasoning,uint256 minQualified,uint256 minScore,uint64 idleAfter)",[],s),e("stock_open","stock",`open(uint256,address,uint256,${$},bytes) returns (uint256)`,[o,["token","address"],v],{owner:"agentId",consentRoot:6424n,externalConsent:!0,approval:"stock",args:["agentId","token","amount","$consent","$signature"],note:"Owner or on-chain controller with a supplied owner consent posts exact collateral. Token must be accepted and usable; live price, LTV, line cap and backing determine the line. Default seizes debt plus buffer; issuer restrictions and burns may reduce returned collateral."}),e("stock_add","stock","addCollateral(uint256,uint256)",[o,v],{approval:"stock",note:"Depositor only. Adds exact position token collateral; contract decides resulting draw room."}),e("stock_close","stock","close(uint256)",[o],{note:"Depositor or controller closes/freezes the line; collateral pays its depositor after the last loan, subject to default and issuer shortfalls."}),e("stock_expire","stock","expire(uint256)",[o],{note:"Expire idle stock line after on-chain idle rules; may close borrowing access."}),e("stock_reconcile","stock","reconcile(uint256,uint256)",[o,["maxLoans","uint"]],{note:"Reconcile the collateral debt walk against pool loans; contract ignores maxLoans in this implementation."}),e("stock_settle","stock","settle(uint256,uint256)",[o,["loanId","id"]],{note:"Reconcile stock collateral after a default or missed hook; may seize collateral according to the loan."}),e("stock_record_feed","stock","record(address,uint256) returns (uint80)",[["feed","address"],["maxRounds","uint"]],{note:"Advance public oracle price tape; may unblock new stock lines and default settlement."}),e("stock_reclaim","stock","reclaim(uint256)",[o],{note:"Reclaim a written-off stock position after it is no longer backed; return remains subject to vault token shortfall."}),e("stock_state","stock","getPosition(uint256) view returns ((address depositor,address owner,address token,uint64 openedAt,bool closing,uint8 status,uint128 line,uint256 amount))",[o],s),e("stock_borrow_room","stock","borrowRoom(uint256) view returns (uint256)",[o],s),e("stock_asset_state","stock","assets(address) view returns (address feed,uint64 maxAge,uint8 tokenDecimals,uint8 feedDecimals,bool enabled,uint16 ltvBps,uint128 lineCap)",[["token","address"]],s),e("stock_lending_status","stock","lendStatus(address) view returns (uint8)",[["token","address"]],s),e("stock_value","stock","valueOf(address,uint256) view returns (bool ok,uint256 value)",[["token","address"],v],s),e("stock_ltv","stock","ltvOf(uint256,address) view returns (uint256)",[o,["token","address"]],s),e("backing_open","backing",`open(uint256,uint256,bool,${$},bytes)`,[o,v,["autoAdd","bool"]],{owner:"agentId",consentRoot:8762n,approval:"priors",args:["agentId","amount","autoAdd","$consent","$signature"],note:O}),e("backing_open_with_usdg","backing",`openWithUsdg(uint256,uint256,uint256,uint256,uint256,bool,${$},bytes)`,[o,["priorsIn","uint"],["usdgIn","uint"],["minOut","uint"],["deadline","uint"],["autoAdd","bool"]],{owner:"agentId",consentRoot:8762n,approval:"mixed",args:["agentId","priorsIn","usdgIn","minOut","deadline","autoAdd","$consent","$signature"],note:O}),e("backing_add","backing","back(uint256,uint256,bool)",[o,v,["autoAdd","bool"]],{approval:"priors",note:O+" Owner-only at launch; other backers require both global and individual permission."}),e("backing_add_with_usdg","backing","backWithUsdg(uint256,uint256,uint256,uint256,uint256,bool)",[o,["priorsIn","uint"],["usdgIn","uint"],["minOut","uint"],["deadline","uint"],["autoAdd","bool"]],{approval:"mixed",note:O}),e("backing_leave","backing","leave(uint256,uint256,uint8)",[o,v,["exitMode","uint8"]],{note:O}),e("backing_close","backing","close(uint256,uint8)",[o,["exitMode","uint8"]],{note:O}),...["refresh","promote","expire","sync","pokeFees","recordRepay","noteDelegate"].map(t=>e(`backing_${t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`)}`,"backing",`${t}(uint256)`,[o],{note:"Reconcile this V5 book against current pool, owner, record, tier and backing rules; no payout is promised."})),...["setAutoAdd","setProtocolBacking","setOthersBacking"].map(t=>e(`backing_${t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`)}`,"backing",`${t}(uint256,bool)`,[o,Q],{note:"Change this V5 book setting under the contract ownership/holder rules. Auto-add can compound rewards into stake at risk."})),e("backing_reconsent","backing",`reconsent(uint256,${$},bytes)`,[o],{owner:"agentId",consentRoot:8762n,args:["agentId","$consent","$signature"],note:"Owner only. Renew the pool consent for V5 backing."}),e("backing_release","backing","release(uint256,uint32,uint32,uint256,uint256)",[o,_,D,["minUsdgOut","uint"],["deadline","uint"]],{note:"Release caller day bucket after its release rule. Zero minUsdgOut returns PRIORS; positive requests a guarded sale. Stake stays burnable until release. Read generation/day from chain events."}),e("backing_release_for","backing","releaseFor(uint256,uint32,address,uint32)",[o,_,["holder","address"],D],{note:"Return eligible PRIORS to its holder under generation/day release rules, never redirect proceeds."}),e("backing_finish_close","backing","finishClose(uint256,uint32)",[o,_],{note:"Finish an eligible generation close; pays the bound owner under its release rules."}),e("backing_claim_settled","backing","claimSettled(uint256,uint32,address)",[o,_,["holder","address"]],{note:"Pay settled generation stake to the named holder, after any default burn."}),e("backing_claim_record","backing","claimSettled(uint256,uint32,address,uint8,uint32)",[o,_,["holder","address"],P,D],{note:"Pay settled day record to its holder after any default burn."}),e("backing_queue_exit","backing","queueExit(uint256,uint32,address,uint8,uint32)",[o,_,["holder","address"],P,D],{note:"Holder/keeper queues ready USDG-mode stake; minimum and queue window apply. A queue entry is not a fill or payout."}),e("backing_settle","backing","settle(uint256,uint32,uint256)",[o,_,["loanId","id"]],{note:"Reconcile V5 generation with a pool loan/default after a missed hook."}),e("backing_record_loan","backing","recordLoan(uint256)",[["loanId","id"]],{note:"Record current pool loan in V5 book."}),e("backing_record_default","backing","recordDefault(uint256)",[["loanId","id"]],{note:"Reconcile a marked pool default and its stake burn."}),e("backing_collect","backing","collect(uint256[],uint32[]) returns (uint256)",[["agentIds","ids"],["generations","gens"]],{note:"Collect caller fees for explicitly selected generations; auto-add settings may retain stake."}),e("backing_fund","backing","fund(uint256)",[v],{approval:"usdg",note:"Donate USDG to V5 root backing; donor receives no withdrawable claim."}),e("backing_book","backing","getGen(uint256,uint32) view returns ((address owner,uint64 openedAt,uint8 status,bool ownerChanged,bool optOut,bool othersOff,bool pointsVoid,bool openRoomCharged,bool closedByOwner,bool movePending,bool splitPending,uint64 movePendingAt,uint8 tier,uint8 countedAtTier,uint8 listLen,uint32 tierStep,uint64 tierSince,uint64 lastLateAt,uint64 closedMark,uint64 lastRaiseAt,uint64 promoEpoch,uint64 stakeEpoch,uint64 placeEpoch,uint160 movePendingSqrt,uint256 roomLine,uint256 openLine,uint256 promoCredit,uint256 stakeRaised,uint256 placed,uint256 index,uint256 divisor,uint256 defaultProof,uint256 cLive,uint256 cUnits,uint256[3] list,uint256[3] counted,uint256[3] pendingTok,uint256[3] leavingLive,uint256[3] tokens,uint64[3] layerEnd,uint160[3] endSqrt,uint8[3] ownerEndMode,uint32[2][3] liveDay,uint32[3] leaveHead,(uint64 epoch,uint192 points)[5] points))",[o,_],s),e("backing_generation","backing","latestGen(uint256) view returns (uint32)",[o],s),e("backing_line","backing","lineOf(uint256) view returns (uint256)",[o],s),e("backing_quote","backing","needed(uint256,uint256,bool) view returns ((uint256 minA,uint256 fullLine,uint256 capA,uint160 sqrtP,uint8 k,uint8 kCached,bool depthGuard,uint256 line,uint256 ownerA,uint256 ownBacking,uint256 roomB,uint256 lineIfAdded,uint256 weekAfter))",[o,["tokens","uint"],["asOwner","bool"]],s),e("backing_position","backing","position(uint256,uint32,uint8,address) view returns ((uint256 counted,uint256 checkpoint,uint256 a0,uint256 a1,uint32 d0,uint32 d1,bool autoAdd))",[o,_,P,["holder","address"]],s),e("backing_record","backing","record(uint256,uint32,uint8,uint32,address) view returns ((uint256 counted,uint256 uncounted,uint256 creditedTo,uint160 sqrtLeave,uint8 mode,uint64 entry))",[o,_,P,D,["holder","address"]],s),e("backing_bucket","backing","leavingBucket(uint256,uint32,uint8,uint32) view returns ((bool exists,bool retired,uint64 latestLeave,uint64 releasableAt,uint256 loanCount,uint256 counted,uint256 uncounted,uint256 retireIndex))",[o,_,P,D],s),e("backing_settings","backing","settings() view returns (bool openBacking,uint256 premiumCap,uint256 maxSwapUsdg,uint256 openRoom,uint256 raiseRoom,uint256 vouchCap,uint8 minDrawK,bool premiumCheck,uint64 pausedUntil)",[],s),e("backing_reopen_at","backing","reopenAt(uint256) view returns (uint64)",[o],s),e("backing_sync_prices","backing","sync()",[],{note:"Update global V5 price/guard observations."}),e("backing_exit_service_open","backing","exitServiceOpen() view returns (bool)",[],s),e("backing_usdg_path","backing","usdgPathOpen(uint256) view returns (bool,uint8)",[["usdgIn","uint"]],s),e("backing_entry_rule","backing","entryRule() view returns (uint8 minEntryLoans,uint32 minEntryDays)",[],s),e("backing_target_premium","backing","targetPremiumBps(uint256) view returns (uint256)",[o],s),e("backing_price_cache","backing","priceCache() view returns (uint160 sqrtMedian,uint64 obsAt,uint160 sqrtWeekLow,uint160 sqrtObservation)",[],s),e("backing_pending_bucket","backing","pendingBucket(uint256,uint32,uint8,uint32) view returns ((uint128 amount,uint64 lastDeposit,bool merged,bool dead,uint256 mergeIndex))",[o,_,P,D],s),e("backing_exit_head","backing","exitHead() view returns (uint256 entryId,address holder,uint256 rest,uint160 sqrtPLeave,uint64 joinedAt)",[],s),e("backing_exit_entry","backing","entry(uint256) view returns ((uint256 id,uint32 gen,uint8 layer,uint32 day,address holder,uint64 joinedAt,uint64 prev,uint64 next))",[["entryId","uint"]],s),e("backing_flush","backing","flush()",[],{note:"Reconcile V5 fees and backing buffers; no payout to caller is promised."}),e("backing_claimable","backing","claimable(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e("autopay_hold","autopay","hold(bool)",[Q],{note:"Hold/resume future autopay attempts for this wallet; allowances remain until explicitly revoked."}),e("autopay_max_cap","autopay","MAX_CAP() view returns (uint256)",[],s),e("autopay_window","autopay","WINDOW() view returns (uint64)",[],s),e("autopay_paused_until","autopay","pausedUntil() view returns (uint64)",[],s),e("autopay_plan","autopay","planOf(address,uint256) view returns (uint32 cap,address owner,bool on,bool useSavings,bool late,uint32 epoch)",[o],{...s,args:["$wallet","agentId"]}),e("autopay_check","autopay","check(uint256) view returns ((uint8 status,uint256 agentId,uint256 due,uint64 opens,uint64 closes,address wallet,uint256 fromWallet,uint256 fromWalletSavings,address owner,uint256 fromOwner,uint256 fromOwnerSavings))",[["loanId","id"]],s),e("autopay_epoch","autopay","epochOf(uint256) view returns (uint32 epoch,bool stale)",[o],s),e("autopay_held","autopay","held(address) view returns (bool)",[],{...s,args:["$wallet"]}),e("savings_deposit","savings","deposit(uint256,address) returns (uint256)",[v],{approval:"usdg",args:["amount","$wallet"],note:"Deposit own USDG into Priors default external Morpho savings vault; vault/allocator risk and withdrawal liquidity apply."}),e("savings_withdraw","savings","withdraw(uint256,address,address) returns (uint256)",[v],{args:["amount","$wallet","$wallet"],note:"Withdraw exact USDG amount from own savings. Insufficient liquidity fails the preview; no immediate exit is promised."}),e("savings_redeem","savings","redeem(uint256,address,address) returns (uint256)",[["shares","uint"]],{args:["shares","$wallet","$wallet"],note:"Redeem exact own savings shares to this wallet; liquidity and rounding apply."}),e("savings_balance","savings","balanceOf(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e("savings_value","savings","previewRedeem(uint256) view returns (uint256)",[["shares","uint"]],s),...["market","market1"].flatMap((t,i)=>[e(`market_v${i===0?2:1}_listing`,t,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[o],s),e(`market_v${i===0?2:1}_record_hash`,t,"recordHash(uint256) view returns (bytes32)",[o],s),e(`market_v${i===0?2:1}_list`,t,"list(uint256,uint256,uint64)",[o,["price","uint"],["expiry","uint"]],{owner:"agentId",approval:"nft",note:"Owner sells this ERC-8004 NFT, its record and any followed treasury line. This does not transfer code, keys or servers. Approves only this NFT; confirm the sale terms and contract-enforced hold/line rules."}),e(`market_v${i===0?2:1}_cancel`,t,"cancel(uint256)",[o],{note:"Cancel the standing listing; NFT approval can remain until explicitly cleared."}),e(`market_v${i===0?2:1}_buy`,t,"buy(uint256,uint256,uint256,bytes32,bytes32)",[o,["maxPrice","uint"],["nonce","uint"],["uriHash","bytes32"],["recordHash","bytes32"]],{approval:"market",note:"Buy an ERC-8004 NFT to this wallet with exact live asking-price approval and pinned listing nonce, tokenURI and current credit record. A followed line still needs the new owner bond before borrowing. No keys/code/servers are included."})]),e("market_bid","market","bid(uint256,uint256,uint64,bytes32,uint256,uint256) returns (uint256)",[o,["price","uint"],["expiry","uint"],["uriHash","bytes32"],["minRepaid","uint"],["minLine","uint"],["reserveBudget","uint"]],{args:["agentId","price","expiry","uriHash","minRepaid","minLine"],approval:"bid",note:"Standing future purchase authority: another owner can fill this bid later without a new click. Exact reserveBudget USDG allowance is shared by all this wallet bids and replaces the old allowance. Cancel bid and clear unused budget deliberately."}),e("market_bid_any","market","bidAny(bytes32,uint256,uint256,uint64,uint256,uint256) returns (uint256)",[["root","bytes32"],["count","uint"],["price","uint"],["expiry","uint"],["minRepaid","uint"],["minLine","uint"],["reserveBudget","uint"]],{args:["root","count","price","expiry","minRepaid","minLine"],approval:"bid",note:"Standing future authority to buy count identities committed by the explicit Merkle root; shared exact reserveBudget USDG allowance. Inspect the committed ID list before authorizing. No code, keys or servers transfer."}),e("market_cancel_bid","market","cancelBid(uint256)",[["bidId","id"]],{note:"Cancel this bid; shared USDG allowance is unchanged so other bids can still fill."}),e("market_accept_bid","market","acceptBid(uint256,uint256,bytes32[],uint256)",[["bidId","id"],o,["proof","proof"],["minNet","uint"]],{owner:"agentId",approval:"nft",note:"Sell only this NFT into a currently valid bid; minNet pins seller USDG proceeds. Merkle proof and current bid rules are checked on chain during preview."}),e("market_bid_state","market","bidOf(uint256) view returns ((address maker,uint64 expiry,uint16 left,bool any,uint96 price,uint96 minLine,uint64 minRepaid,bytes32 target,bytes32 uriHash))",[["bidId","id"]],s),e("market_builder","market","builderOf(uint256) view returns ((address to,uint16 bps))",[o],s),e("market_set_builder","market","setBuilder(uint256,address,uint256)",[o,["to","address"],["bps","uint"]],{owner:"agentId",note:"Owner-only attribution before first sale; assigns future sale revenue share to to. Contract enforces enabled switch, no listing, and maximum 500 bps."}),e("market_change_builder","market","changeBuilder(uint256,address,uint256)",[o,["to","address"],["bps","uint"]],{note:"Current builder only; may lower or redirect own revenue share, never increase it."}),e("market_sale_split","market","saleSplit(uint256) view returns (uint256 fee,uint256 share,uint256 net)",[o],s),...["seats3","seats4"].flatMap((t,i)=>[e(`legacy_v${i+3}_close`,t,"close(uint256)",[o],{note:"Existing seat only. Close/freeze and return stake to original staker after final loan; default burn still applies. No new seats are opened."}),e(`legacy_v${i+3}_withdraw_offer`,t,"withdrawOffer(uint256,address)",[o],{args:["agentId","$wallet"],note:"Withdraw caller unaccepted offer; PRIORS returns to the staker."}),e(`legacy_v${i+3}_expire`,t,"expire(uint256)",[o],{note:"Expire idle seat under current contract rules."}),e(`legacy_v${i+3}_settle`,t,"settle(uint256,uint256)",[o,["loanId","id"]],{note:"Reconcile existing seat against pool loan/default after a missed hook."}),e(`legacy_v${i+3}_claim`,t,"claim(address) returns (uint256)",[],{args:["$wallet"],note:"Claim caller legacy seat USDG fees to this wallet."}),e(`legacy_v${i+3}_seat`,t,"getSeat(uint256) view returns ((address staker,uint64 openedAt,bool closing,uint8 status,uint128 line,uint128 burnBps,uint256 amount,uint256 feeMark,address owner))",[o],s),e(`legacy_v${i+3}_pending_fees`,t,"pendingFees(uint256) view returns (uint256)",[o],s),e(`legacy_v${i+3}_fees`,t,"feesOwed(address) view returns (uint256)",[],{...s,args:["$wallet"]}),e(`legacy_v${i+3}_offer`,t,"offers(uint256,address) view returns (uint256)",[o],{...s,args:["agentId","$wallet"]})])];function Y(t){return JSON.parse(JSON.stringify(t,(i,n)=>typeof n=="bigint"?n.toString():n))}function l(t,i,n=256){if(typeof t!="string"||!/^[0-9]+$/.test(t)||BigInt(t)>=1n<<BigInt(n))throw new u(`${i} must be a decimal base-unit string fitting uint${n}.`);return BigInt(t)}function se(t,[i,n]){let r=t[i];if(n==="address"){if(typeof r!="string"||!K.test(r))throw new u(`${i} must be a token or wallet address.`);return b(r)}if(n==="bool"){if(typeof r!="boolean")throw new u(`${i} must be true or false.`);return r}if(n==="bytes32"){if(typeof r!="string"||!/^0x[0-9a-fA-F]{64}$/.test(r))throw new u(`${i} must be bytes32.`);return r}if(n==="proof"){if(!Array.isArray(r)||r.length>32||!r.every(d=>typeof d=="string"&&/^0x[0-9a-fA-F]{64}$/.test(d)))throw new u("proof needs at most 32 bytes32 hashes.");return r}if(n==="bytes"){if(typeof r!="string"||!/^0x(?:[0-9a-fA-F]{2})*$/.test(r)||r.length>32770)throw new u(`${i} must be bounded hexadecimal bytes.`);return r}if(n==="ids"||n==="gens"){if(!Array.isArray(r)||r.length===0||r.length>100)throw new u(`${i} needs 1 to 100 decimal strings.`);return r.map(d=>l(d,i,n==="gens"?32:256))}let a=l(r,i,n==="uint8"?8:n==="uint32"?32:256);if(n==="id"&&a===0n)throw new u(`${i} must be positive.`);if(i==="exitMode"&&a>2n)throw new u("exitMode must be 0 (hold), 1 (PRIORS), or 2 (USDG queue).");if(i==="layer"&&a>2n)throw new u("layer must be 0, 1, or 2.");return a}var R=x.amount("USDG",6,"1000000"),L=x.amount("PRIORS",18,"1000000000000000000"),H='Amount of the stock token in base units (read its decimals with priors_stock_asset_state). Example: "1000000000000000000" = 1 token at 18 decimals.',ue={priors_root_enroll:R,priors_root_add_stake:R,priors_root_vouch:R,priors_root_unvouch:R,priors_root_offer:R,priors_fund_reserve:R,priors_backing_fund:R,priors_savings_deposit:R,priors_savings_withdraw:R,priors_stock_open:H,priors_stock_add:H,priors_stock_value:H,priors_backing_open:L,priors_backing_add:L,priors_backing_leave:L},B={agentId:'ERC-8004 agent ID, as a decimal string. Example: "437".',sponsorId:'ERC-8004 ID of the sponsor root, as a decimal string. Example: "6228".',loanId:x.id("Priors pool loan"),bidId:x.id("AgentMarket V2 bid"),entryId:x.id("V5 exit-queue entry"),delegate:"Address to appoint as pool delegate (borrow and repay only, never identity transfer); the zero address clears it.",frozen:"true freezes the agent line; false unfreezes it.",premiumBps:"Loan premium in basis points (50 = 0.5%); at most the owner-consented cap.",maxPremiumBps:'Owner-consented maximum sponsor premium in basis points (50 = 0.5%), at most 200. Default "0".',hook:"Address of the root lending-policy hook contract (0x followed by 40 hex digits).",expiry:"Expiry in Unix seconds. Market listings and bids allow at most 30 days ahead; a V5 invite uses its issued expiry.",invite:"Treasury V5 inviter signature bytes as 0x hex, exactly as issued.",token:"Address of the stock token (0x followed by 40 hex digits); it must be an accepted Priors stock collateral.",maxLoans:"Loan count bound passed to reconcile, as a decimal string; this contract version ignores it.",feed:"Address of the public oracle price feed to record (0x followed by 40 hex digits).",maxRounds:"Maximum oracle rounds to record in this call, as a decimal string.",autoAdd:"true compounds rewards into the stake at risk; false leaves them out.",priorsIn:x.amount("PRIORS",18,"1000000000000000000"),usdgIn:x.amount("USDG",6,"1000000"),minOut:"Minimum PRIORS received from the USDG conversion, in base units (PRIORS has 18 decimals); must be positive when usdgIn is.",deadline:"Deadline in Unix seconds, within the next hour. Example: 1800000000.",exitMode:x.enumValues({0:"hold",1:"return PRIORS",2:"request USDG through the guarded exit queue"}),generation:"V5 book generation number, as a decimal string; read it from priors_backing_generation or chain events.",day:"Day bucket number, as a decimal string, read from chain events; never guess it.",layer:'Backing layer "0", "1" or "2", as recorded in chain events.',holder:"Address of the stake holder; any payout goes only to this holder.",minUsdgOut:'"0" returns PRIORS; a positive value requests a guarded USDG sale with this minimum, in USDG base units (6 decimals).',agentIds:"ERC-8004 agent IDs as decimal strings, paired by position with generations (1 to 100).",generations:"Generation numbers as decimal strings, paired by position with agentIds.",tokens:'PRIORS amount in base units (PRIORS has 18 decimals) passed to the contract needed() quote. Example: "0".',asOwner:"true quotes as the agent owner; false as another backer.",price:'Price per identity in USDG base units (6 decimals); minimum "5000000" = 5 USDG.',maxPrice:"Highest asking price you accept, in USDG base units (6 decimals); read the listing first.",nonce:"Listing nonce from the listing read, as a decimal string; it pins the exact listing.",uriHash:"bytes32 hash of the agent tokenURI (0x followed by 64 hex digits), from the listing or priors_market_pins.",recordHash:"bytes32 hash of the agent credit record (0x followed by 64 hex digits), from priors_market_v1/v2_record_hash.",minRepaid:"Minimum repaid-loan count in the agent record for the bid to fill, as a decimal string.",minLine:"Minimum credit line the agent must carry for the bid to fill, in USDG base units (6 decimals).",reserveBudget:"Exact USDG allowance shared by all bids of this wallet, in base units (6 decimals); must cover price times count.",root:"Merkle root (bytes32) committing the agent ID list; rebuild it with priors_market_origin.",count:"Number of identities to buy from the committed list, 1 to 20, as a decimal string.",proof:"Merkle proof for this agent in the bid root: at most 32 bytes32 hashes.",minNet:"Minimum seller USDG proceeds, in base units (USDG has 6 decimals).",to:x.recipient("builder sale share recipient"),bps:"Builder sale share in basis points (50 = 0.5%); at most 500.",on:"true turns this setting on; false turns it off.",cap:'Per-loan repayment cap in USDG base units (USDG has 6 decimals), at most the contract MAX_CAP. Example: "5000000" = 5 USDG.',budget:"Total USDG allowance for AutoRepay in base units (6 decimals); at least cap, and shared by all plans of this wallet.",savingsShares:'Savings vault share allowance in base units (read the vault decimals); "0" disables savings use.',late:"AutoRepay late flag stored in the plan (true or false); read priors_autopay_plan to confirm it.",continuation:"Opaque state from the previous step; pass it back unchanged. Never build it by hand.",signature:"Local signature for the confirmed step, as 0x hex; the bridge supplies it. Never a key."},de={priors_root_unlock:"Root pool shares to withdraw, in pool share base units (read root_shares); not USDG.",priors_savings_redeem:"Savings vault shares to redeem, in base units (read the vault decimals); not USDG.",priors_savings_value:"Savings vault shares to value, in base units (read the vault decimals); not USDG."};function le(t,i){return i==="amount"?ue[t]:i==="shares"?de[t]:t==="priors_autopay_hold"&&i==="on"?"true holds future autopay attempts; false resumes them.":B[i]}function ce(t,i,n){let r=le(t,i);return r===void 0?n:{...n,description:r}}function F(t,i,n={}){return{type:"object",additionalProperties:!1,required:i.map(([r])=>r),properties:Object.fromEntries([...i.map(([r,a])=>[r,ce(t,r,a==="bool"?{type:"boolean"}:a==="address"?X:a==="proof"?{type:"array",maxItems:32,items:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}}:a==="ids"||a==="gens"?{type:"array",maxItems:100,items:V()}:{type:"string",...a==="bytes32"?{pattern:"^0x[0-9a-fA-F]{64}$"}:a!=="bytes"?{pattern:"^[0-9]+$"}:{}})]),...Object.entries(n)])}}async function I(t,i,n,r=[]){let a=[`function ${n}`],d=A(a);return t.clientFor(f).readContract({address:i,abi:d,functionName:d[0].name,args:r})}async function U(t,i){return b(await t.clientFor(f).readContract({address:c.registry,abi:ne,functionName:"ownerOf",args:[i]}))}function E(t){if(t.network==="testnet")throw new u("Priors ecosystem features are configured only on chain 4663.")}function M(t,i,n,r,a,d="0"){return{domain:Z(),types:{Consent:[...J.Consent]},primaryType:"Consent",message:{agentId:t,sponsorId:i,owner:b(n),nonce:r,deadline:a,maxPremiumBps:d}}}async function j(t,i,n){if(!i||!i.request||T(i.request)!==T(n)||typeof i.signature!="string"||!/^0x(?:[a-fA-F0-9]{2}){1,4096}$/.test(i.signature))throw new u("Consent differs from this agent, sponsor, owner, premium cap, nonce or deadline.");let r=n.message.owner,a=await t.clientFor(f).getCode({address:r});if(a&&a!=="0x"){if(await t.clientFor(f).readContract({address:r,abi:re,functionName:"isValidSignature",args:[T(n),i.signature]})!=="0x1626ba7e")throw new u("The owner contract rejected the consent signature.")}else if(!C(await ie({...n,signature:i.signature}),r))throw new u("The consent signature is not from the current agent owner.")}function pe(t,i,n,r,a,d){let g=te.find(k=>k.name===t),p=t==="priors_sign_consent"?l(i.sponsorId,"sponsorId"):g?.consentRoot;if(!p||a.stage!=="priors_consent"||a.tool!==t||a.wallet!==b(n)||a.chainId!==f||a.agentId!==i.agentId||r.length!==1||r[0]?.kind!=="typedData")throw new u("Unexpected Priors consent continuation.");let w=l(a.nonce,"nonce").toString(),h=l(a.deadline,"deadline");if(h<=BigInt(d)||h>BigInt(d+3600))throw new u("Priors consent expired or exceeds its one-hour window.");let y=M(String(i.agentId),p.toString(),n,w,h.toString(),String(i.maxPremiumBps??"0"));if(!r[0].request||T(r[0].request)!==T(y))throw new u("Priors consent differs from the requested agent, root, owner or premium.")}async function ee(t,i,n,r,a){let d=l(n.agentId,"agentId");if(!C(await U(t,d),r))throw new u("This operation requires the current identity owner wallet; a delegate cannot consent. Use the owner wallet.");let g=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[d]}),p=n.continuation,w=p?l(p.deadline,"deadline"):BigInt(Math.floor(Date.now()/1e3)+1800),h=l(n.maxPremiumBps??"0","maxPremiumBps");if(n.signature!==void 0&&!n.continuation)throw new u("A signature needs its locally confirmed Priors consent continuation.");if(h>200n)throw new u("maxPremiumBps exceeds the pool maximum of 200.");let y=M(d.toString(),a.toString(),r,g.toString(),w.toString(),h.toString());if(!p)return{steps:[{kind:"typedData",request:y}],continuation:{stage:"priors_consent",tool:i,wallet:r,chainId:f,agentId:d.toString(),nonce:g.toString(),deadline:w.toString()},summary:`Owner consent to sponsor #${a} for agent #${d}, premium cap ${h} bps; expires ${w}. No funds move from this signature. The local bridge must confirm the exact EIP-712 fields.`};if(pe(i,n,r,[{kind:"typedData",request:y}],p,Math.floor(Date.now()/1e3)),String(p.nonce)!==g.toString())throw new u("Priors consent nonce changed. Start the action again.");let k={request:y,signature:n.signature};return await j(t,k,y),{signedConsent:k}}async function ge(t,i,n,r){let a=c[i.contract],d=(p,w)=>w>0n?[t.approval(p,a,w.toString(),f)]:[];if(i.approval==="nft"){let p=l(n.agentId,"agentId"),w=await Promise.all([c.market,c.market1].map(h=>I(t,h,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[p])));for(let h of w){if(!h||typeof h!="object"||!("seller"in h)||typeof h.seller!="string")throw new u("Could not verify standing listings on both Priors markets; no NFT approval was built.");if(C(h.seller,r))throw new u("A standing listing in Priors market V1 or V2 could reactivate when NFT approval mines. Cancel it with priors_market_v1_cancel or priors_market_v2_cancel, verify both listings are cleared, then retry. No approval was built.")}return[t.approval(c.registry,a,p.toString(),f)]}if(i.approval==="market"){let p=await I(t,a,"listingOf(uint256) view returns ((address seller,uint256 price,uint64 expiry,uint256 nonce,bytes32 uriHash,uint256 loansRepaid))",[l(n.agentId,"agentId")]);if(p.price<=0n||p.price>l(n.maxPrice,"maxPrice")||p.nonce!==l(n.nonce,"nonce")||!C(p.uriHash,String(n.uriHash)))throw new u("Listing price, nonce or URI changed; read the listing again.");return d(c.usdg,p.price)}if(i.approval==="bid"){let p=l(n.reserveBudget,"reserveBudget");if(p>=1n<<128n||p<l(n.price,"price")*l(n.count??"1","count"))throw new u("Provide a finite exact bid reserve covering price times count.");return[t.approval(c.usdg,c.bidSpender,p.toString(),f)]}if(i.approval==="bond")return d(c.usdg,BigInt(await I(t,c.bond,"amount() view returns (uint256)")));if(i.approval==="mixed"){let p=l(n.priorsIn,"priorsIn"),w=l(n.usdgIn,"usdgIn");if(p+w===0n)throw new u("Provide a positive PRIORS or USDG input.");if(w>0n&&l(n.minOut,"minOut")===0n)throw new u("USDG conversion requires a positive minimum PRIORS output.");return[...d(c.priors,p),...d(c.usdg,w)]}if(!i.approval)return[];let g=l(n.amount,"amount");if(g===0n)throw new u("amount must be positive.");if(i.approval==="stock"){let p=i.name==="priors_stock_open"?b(String(n.token)):b((await I(t,c.stock,"getPosition(uint256) view returns ((address depositor,address owner,address token,uint64 openedAt,bool closing,uint8 status,uint128 line,uint256 amount))",[l(n.agentId,"agentId")])).token);if(p===ae)throw new u("No stock collateral position exists.");return d(p,g)}return d(c[i.approval],g)}function _e(t){let i=te.map(n=>({name:n.name,inputSchema:{...F(n.name,n.fields,n.consentRoot?{maxPremiumBps:V(B.maxPremiumBps),continuation:{type:"object",description:B.continuation},signature:{type:"string",pattern:"^0x([a-fA-F0-9]{2})+$",description:B.signature},...n.externalConsent?{signedConsent:{type:"object",description:"Optional public owner signature from priors_sign_consent; controller may supply collateral. Never pass a key."}}:{}}:{}),description:n.note||"Read current Priors contract state. All amounts are token base-unit decimal strings."},async execute(r,a){E(t),a=b(a);let d=Object.fromEntries(n.fields.map(m=>[m[0],se(r,m)]));if(n.owner&&!(n.externalConsent&&r.signedConsent)&&!C(await U(t,d[n.owner]),a))throw new u("Owner-only feature: call from the current identity owner wallet. Nothing was signed.");if(n.contract==="savings"&&b(String(await I(t,c.savings,"asset() view returns (address)")))!==c.usdg)throw new u("The savings vault asset is not USDG. Nothing was signed.");if(n.contract==="autopay"&&await I(t,c.autopay,"VERSION() view returns (uint256)")!==2n)throw new u("AutoRepay VERSION is not 2. Nothing was signed.");if(n.contract==="market"||n.contract==="market1"){if(r.expiry!==void 0){let m=l(r.expiry,"expiry",64),S=BigInt(Math.floor(Date.now()/1e3));if(m<=S||m>S+2592000n)throw new u("Market expiry must be within 30 days.")}if(r.price!==void 0&&l(r.price,"price")<5000000n)throw new u("Market price minimum is 5 USDG.");if(r.count!==void 0&&(l(r.count,"count")<1n||l(r.count,"count")>20n))throw new u("Bid count must be 1 to 20.")}if(n.name==="priors_treasury_first_line"&&l(r.expiry,"expiry",64)<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Treasury V5 invite expired.");if(r.deadline!==void 0){let m=l(r.deadline,"deadline"),S=BigInt(Math.floor(Date.now()/1e3));if(m<=S||m>S+3600n)throw new u("deadline must be in the next hour.")}if(r.agentIds&&r.agentIds.length!==r.generations.length)throw new u("agentIds and generations must have equal length.");let g;if(n.consentRoot)if(n.externalConsent&&r.signedConsent){if(g=r.signedConsent,!g.request?.message)throw new u("Provide the public signedConsent from the current identity owner.");let m=l(r.agentId,"agentId"),S=await U(t,m),q=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[m]}),N=l(g.request.message.deadline,"consent deadline");if(N<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Owner consent expired.");let W=l(r.maxPremiumBps??"0","maxPremiumBps");if(W>200n)throw new u("maxPremiumBps exceeds the pool cap.");await j(t,g,M(m.toString(),n.consentRoot.toString(),S,q.toString(),N.toString(),W.toString()))}else{let m=await ee(t,n.name,r,a,n.consentRoot);if("steps"in m)return m;g=m.signedConsent}let p=(n.args??n.fields.map(([m])=>m)).map(m=>m==="$wallet"?a:m==="$consent"?g.request.message:m==="$signature"?g.signature:d[m]),w=A([n.signature]),h=w[0].name;if(n.read)return{chainId:f,contract:c[n.contract],units:"Base units; USDG 6 decimals, PRIORS 18 decimals; stock/savings scales come from token metadata.",value:Y(await t.clientFor(f).readContract({address:c[n.contract],abi:w,functionName:h,args:p}))};let y=[...await ge(t,n,r,a),t.unsignedTx({to:c[n.contract],data:G({abi:w,functionName:h,args:p}),value:"0",chainId:f,description:`${n.name}: ${n.note}`})],k=await t.preview(y,a);return{txs:y,summary:`${n.note} Inputs (base units): ${JSON.stringify(Y(d))}. ${k.summary}`}}}));return i.push({name:"priors_sign_consent",inputSchema:F("priors_sign_consent",[o,["sponsorId","id"],["maxPremiumBps","uint"]],{continuation:{type:"object",description:B.continuation},signature:{type:"string",pattern:"^0x([a-fA-F0-9]{2})+$",description:B.signature}}),async execute(n,r){return E(t),ee(t,"priors_sign_consent",n,b(r),l(n.sponsorId,"sponsorId"))}}),i.push({name:"priors_root_offer",inputSchema:F("priors_root_offer",[["sponsorId","id"],o,v,["premiumBps","uint"]],{signedConsent:{type:"object",description:"The current agent owner output of priors_sign_consent. This is public signed authorization, never a private key."}}),async execute(n,r){E(t),r=b(r);let a=l(n.sponsorId,"sponsorId"),d=l(n.agentId,"agentId");if(!C(await U(t,a),r))throw new u("Only the sponsor root owner can send this offer.");let g=n.signedConsent;if(!g?.request?.message)throw new u("Ask the current agent owner to run priors_sign_consent from their wallet first.");let p=g.request.message,w=await t.clientFor(f).readContract({address:c.pool,abi:z,functionName:"nonces",args:[d]}),h=l(p.deadline,"consent deadline");if(h<=BigInt(Math.floor(Date.now()/1e3)))throw new u("Owner consent expired; request a fresh consent.");let y=l(n.premiumBps,"premiumBps"),k=l(p.maxPremiumBps,"maxPremiumBps");if(y>k||k>200n)throw new u("premiumBps exceeds the owner consent or pool cap.");let m=M(d.toString(),a.toString(),await U(t,d),w.toString(),h.toString(),k.toString());await j(t,g,m);let S=A([`function vouchWithConsent(uint256,uint256,uint256,uint256,${$},bytes)`]),q=[t.unsignedTx({to:c.pool,data:G({abi:S,functionName:"vouchWithConsent",args:[a,d,l(n.amount,"amount"),y,m.message,g.signature]}),value:"0",chainId:f,description:"Sponsor-owned backing handoff with exact current-owner consent."})],N=await t.preview(q,r);return{txs:q,summary:`Vouch ${n.amount} USDG base units from sponsor #${a} to agent #${d}; ${y} bps premium (cap ${k}). Replaces its old sponsor only with no loan open. ${N.summary}`}}}),i.push(...me(t)),{tools:i}}function me(t){return[{name:"priors_autopay_on",inputSchema:F("priors_autopay_on",[o,["cap","uint"],["budget","uint"],["savingsShares","uint"],["late","bool"]]),async execute(i,n){E(t),n=b(n);let r=l(i.agentId,"agentId"),a=l(i.cap,"cap"),d=l(i.budget,"budget"),g=l(i.savingsShares,"savingsShares");if(typeof i.late!="boolean")throw new u("late must be true or false.");if(await I(t,c.autopay,"VERSION() view returns (uint256)")!==2n)throw new u("AutoRepay VERSION is not 2.");let p=await I(t,c.autopay,"MAX_CAP() view returns (uint256)");if(a===0n||a>p||a>=1n<<32n||d<a||d===(1n<<256n)-1n||g===(1n<<256n)-1n)throw new u("Provide a positive supported per-loan cap and explicit finite budget at least cap; unlimited approvals are refused.");let w=await t.clientFor(f).readContract({address:c.registry,abi:ne,functionName:"getAgentWallet",args:[r]});if(b(w)!==n)throw new u("Autopay enrollment requires the ERC-8004 declared agent wallet, not just its owner or pool delegate.");if(g>0n&&b(String(await I(t,c.savings,"asset() view returns (address)")))!==c.usdg)throw new u("Savings asset is not USDG.");let h=g>0n?await I(t,c.savings,"previewRedeem(uint256) view returns (uint256)",[g]):0n,y=A(["function enroll(uint256,uint256,bool,bool)"]),k=[t.approval(c.usdg,c.autopay,d.toString(),f),t.approval(c.savings,c.autopay,g.toString(),f),t.unsignedTx({to:c.autopay,data:G({abi:y,functionName:"enroll",args:[r,a,g>0n,i.late]}),value:"0",chainId:f,description:"Enroll future autopay with explicit finite USDG and savings share budgets."})],m=await t.preview(k,n);return{txs:k,summary:`Persistent future spending authorization: AutoRepay v2 can repay agent #${r} loans without a confirmation per loan, at most ${a} USDG base units per loan; exact total wallet allowance ${d} USDG base units and ${g} savings shares (currently ${h} USDG base units). These two allowances replace the budgets shared by ALL this wallet autopay plans, including setting savings allowance to zero when disabled. late=${i.late}; savings=${g>0n}. Revoke with priors_autopay_off, which also clears both allowances. ${m.summary}`}}},{name:"priors_autopay_off",inputSchema:F("priors_autopay_off",[o]),async execute(i,n){E(t),n=b(n);let r=A(["function revoke(uint256)"]),a=[t.unsignedTx({to:c.autopay,data:G({abi:r,functionName:"revoke",args:[l(i.agentId,"agentId")]}),value:"0",chainId:f,description:"Revoke own autopay plan."}),t.approval(c.usdg,c.autopay,"0",f),t.approval(c.savings,c.autopay,"0",f)],d=await t.preview(a,n);return{txs:a,summary:`Revoke this wallet autopay plan and zero both shared AutoRepay allowances. This also stops funding other plans using this wallet. ${d.summary}`}}}]}export{oe as a,O as b,te as c,Y as d,l as e,M as f,pe as g,_e as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./CD2JQ32C.js";import{a as k}from"./G2LAO23N.js";import{c as l}from"./NWNYJ26T.js";import{b as p}from"./TI727O2H.js";import{a as s}from"./XSD5NL7J.js";import{getAddress as g}from"viem";var v={type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Hookr v4 pool ID: 32 bytes, 0x followed by 64 hex digits."},b=[["hookr_release",{},[],"Read verified release contracts, block and recapture lane."],["hookr_blocks",{},[],"Read all Hook Blocks and their current availability."],["hookr_kings",{poolId:v},[],"Read King of the Pool rounds, leaders, pots and endings."],["hookr_claims",{poolId:v},[],"Read the signing wallet's prizes, royalties, recapture and PoolManager claims."],["hookr_revenue_tokens",{limit:{type:"integer",minimum:1,maximum:50,description:"Maximum number of revenue tokens to return, 1 to 50."},cursor:{type:"string",pattern:"^(v1|v1:[1-9][0-9]{0,19}|v2:[1-9][0-9]{0,19})$",description:"Paging cursor: the nextCursor string from the previous page (v1, v1:N or v2:N); omit for the first page."}},[],"Read revenue tokens, tokenizer provenance, streams and income, page by page."],["hookr_revenue_token",{token:{...l,description:k.address("revenue token")}},["token"],"Read a revenue token, stream endings, income, drops and the signing wallet's claims."],["hookr_hook",{address:{...l,description:k.address("Hookr hook contract")}},["address"],"Read shared or owned hook provenance, ownership, allowed blocks, opening and pools."]],M=[...b.map(d=>d[0]),"hookr_contracts","hookr_read","hookr_revenue_read","hookr_addon_read","hookr_api_read"];function P(d){return[...b.map(([t,c,a,o])=>({name:t,inputSchema:{type:"object",description:o,properties:c,required:a,additionalProperties:!1},execute:async(r,w)=>{if(Object.keys(r).some(n=>!Object.hasOwn(c,n))||a.some(n=>r[n]===void 0))throw new s(`Provide the documented arguments for ${t}.`);let m={};for(let[n,i]of Object.entries(r)){let u=c[n];if(u.type==="integer"){if(typeof i!="number"||!Number.isInteger(i)||i<Number(u.minimum)||i>Number(u.maximum))throw new s("Hookr revenue page limit must be an integer from 1 to 50.")}else if(typeof i!="string"||!new RegExp(String(u.pattern)).test(i))throw new s(`Provide a valid Hookr ${n}.`);m[n]=n==="token"||n==="address"?g(String(i)):i}return(t==="hookr_claims"||t==="hookr_revenue_token")&&(m.account=w),{...await f(d,t,m),chainId:p,source:"https://hookr.fun/api/mcp"}}})),y(d)]}var h={catalog:"/api/hooks/catalog",stats:"/api/protocol-stats",poolApr:"/api/pool-apr",revenueTokens:"/api/revenue-tokens",revenueIncome:"/api/revenue-tokens/income"};function y(d){return{name:"hookr_api_read",inputSchema:{type:"object",description:"Read Hookr public catalog, protocol stats, pool APR, revenue directory/income, or one token's doors/mark. Marks are project metadata, not investment or security endorsements.",properties:{resource:{type:"string",enum:[...Object.keys(h),"revenueDoors","revenueMark"],description:"Public feed to read: catalog, stats, poolApr, revenueTokens, revenueIncome; revenueDoors and revenueMark also need token (that token's doors, or its mark image URL)."},token:{...l,description:k.address("revenue token, only for revenueDoors and revenueMark")}},required:["resource"],additionalProperties:!1},execute:async e=>{if(Object.keys(e).some(o=>!["resource","token"].includes(o))||typeof e.resource!="string")throw new s("Choose a documented Hookr public resource.");let t=["revenueDoors","revenueMark"].includes(e.resource);if(!t&&e.token!==void 0||t&&typeof e.token!="string")throw new s("Only the revenueDoors and revenueMark resources take a token address.");let c;if(t){let o;try{o=g(String(e.token))}catch{throw new s("Provide a valid revenue token address.")}c=`/api/revenue-tokens/${o}/${e.resource==="revenueDoors"?"doors":"mark"}`}else{if(!Object.hasOwn(h,e.resource))throw new s("Choose a documented Hookr public resource.");c=h[e.resource]}let a=`https://hookr.fun${c}`;try{let o=await d.http(a,{method:"GET",redirect:"error",signal:AbortSignal.timeout(15e3)});if(!o.ok)throw new Error("Unavailable");if(e.resource==="revenueMark"){if(!o.headers.get("content-type")?.includes("image/svg+xml"))throw new Error("Invalid mark");return{chainId:p,source:a,imageUrl:a,pngUrl:`${a}.png`,note:"Official SVG mark URL; SVG code is not executed or returned. The PNG URL has not been fetched."}}let r=await o.json();if(!r||typeof r!="object"||"error"in r||"status"in r&&r.status==="unavailable")throw new Error("Unavailable");return{chainId:p,source:a,data:r}}catch{throw new s("Hookr public resource is unavailable. Retry later; no empty or zero result is implied.")}}}}export{M as a,P as b,y as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as q}from"./LT5P6PZW.js";import{a as R,b as K}from"./G2LAO23N.js";import{a as W}from"./Z7FGEWO2.js";import{c as U,f as z,g as T,i as L}from"./NWNYJ26T.js";import{b as k}from"./TI727O2H.js";import{a as d}from"./XSD5NL7J.js";import{encodeFunctionData as J,erc20Abi as re,erc721Abi as V,getAddress as ie,parseAbi as ae,zeroAddress as B}from"viem";var A=q,G=ae(["function launchFee() view returns (uint256 fee,address treasury,uint256 pendingFee,address pendingTreasury,uint256 readyAt)"]),g=(t,e)=>t.name==="seed"?"marketSeed":t.name||`arg${e}`,X=t=>"components"in t?t.components:[],se=t=>{if(typeof t!="string"||!/^(0|[1-9][0-9]*)$/.test(t)||t.length>78||BigInt(t)>=1n<<256n)throw new d("Provide Hookr amounts as decimal base-unit strings within uint256.");return BigInt(t)},p=t=>z(t,"Provide the documented Hookr parameter object."),b=t=>L(t,"Provide a valid Hookr address."),Y=t=>t.stateMutability==="view"||t.stateMutability==="pure";function _(t){return t.abi}var ce=`Base units of the token it counts; read that token's decimals (18 decimals: "1000000000000000000" = 1 token).`,de={type:"string",pattern:"^(0|[1-9][0-9]*)$"};function ue(t,e,i){let o=`${t} ${e} ${i}.`,r=t.replace(/\[[0-9]*\]$/,"");return/^u?int/.test(r)?/divisor|numerator|denominator/i.test(e)?`${o} Plain integer ${/divisor/i.test(e)?"divisor":"ratio component"}; do not scale by token decimals.`:/liquidity/i.test(e)?`${o} Uniswap v4 liquidity units, not a token amount; do not scale by token decimals.`:/gas/i.test(e)?`${o} Integer gas units; do not scale by token decimals.`:/point/i.test(e)&&!/decimals/i.test(e)?`${o} Integer points; do not scale by token decimals.`:/pips$/i.test(e)?`${o} ${R.pips()}`:K(e,de)||e==="walletFeeCap"?`${o} ${ce}`:/bps$/i.test(e)?`${o} ${R.bps()}`:/(deadline|expir|timestamp|time|At)$/.test(e)?`${o} Unix seconds, as a decimal string.`:`${o} Decimal string${r.startsWith("uint")?"":", may be negative"}.`:r==="address"?`${o} 0x followed by 40 hex digits${/^(to|recipient|receiver|owner|spender|wallet|beneficiary)$/i.test(e)?"; use the intended address, never an example address":""}.`:r==="bool"?`${o} true or false.`:r.startsWith("bytes")?`${o} 0x-prefixed hex bytes.`:r==="tuple"?`${o} Object with the listed fields.`:`${o} Plain text.`}function Z(t,e,i,o){let r=ue(t.type,o,e),c=/^(.*)\[([0-9]*)\]$/.exec(t.type);return c?{type:"array",description:r,items:Z({...t,type:c[1]},e,i,o),minItems:c[2]?Number(c[2]):0,maxItems:c[2]?Number(c[2]):128}:t.type==="tuple"?{...E(X(t),i,o),description:r}:t.type==="bool"?{type:"boolean",description:r}:t.type==="address"?{...U,description:r}:/^u?int/.test(t.type)?{type:"string",pattern:t.type.startsWith("uint")?"^(0|[1-9][0-9]*)$":"^(0|-?[1-9][0-9]*)$",description:r}:t.type.startsWith("bytes")?{type:"string",pattern:"^0x([0-9a-fA-F]{2})*$",maxLength:32770,description:r}:{type:"string",maxLength:4096,description:r}}function E(t,e,i){let o=i===void 0?`argument of ${e}`:`field of ${i} in ${e}`;return{type:"object",properties:Object.fromEntries(t.map((r,c)=>[g(r,c),Z(r,o,e,g(r,c))])),required:t.map(g),additionalProperties:!1}}function N(t,e){let i=/^(.*)\[([0-9]*)\]$/.exec(t.type);if(i){if(!Array.isArray(e)||e.length>128||i[2]&&e.length!==Number(i[2]))throw new d("Hookr parameter array has an invalid length.");return e.map(r=>N({...t,type:i[1]},r))}if(t.type==="tuple"){let r=p(e),c=X(t);return O(r,c.map(g)),Object.fromEntries(c.map((s,u)=>[s.name||`arg${u}`,N(s,r[g(s,u)])]))}if(t.type==="address")return b(e);if(t.type==="bool"){if(typeof e!="boolean")throw new d("Provide a Hookr boolean.");return e}let o=/^(u?)int([0-9]*)$/.exec(t.type);if(o){if(typeof e!="string"||!/^(0|-?[1-9][0-9]*)$/.test(e)||e.length>79)throw new d("Provide Hookr integers as decimal base-unit strings.");let r=BigInt(e),c=BigInt(o[2]||256),s=!o[1];if(r<(s?-(1n<<c-1n):0n)||r>=1n<<(s?c-1n:c))throw new d("Hookr integer exceeds its ABI range.");return c<=32n?Number(r):r}if(t.type.startsWith("bytes")){let r=Number(t.type.slice(5));if(typeof e!="string"||!/^0x([0-9a-fA-F]{2})*$/.test(e)||e.length>32770||r&&e.length!==2+r*2)throw new d("Provide a valid Hookr hex byte string of the ABI length.");return e}if(t.type!=="string"||typeof e!="string"||new TextEncoder().encode(e).length>4096)throw new d("Provide a valid Hookr string.");return e}function O(t,e){if(Object.keys(t).some(i=>!e.includes(i))||e.some(i=>!Object.hasOwn(t,i)))throw new d("Provide exactly the documented Hookr parameters.")}function ye(t,e){O(e,t.inputs.map(g));let i=t.inputs.map((o,r)=>N(o,e[g(o,r)]));return{values:i,params:Object.fromEntries(t.inputs.map((o,r)=>[g(o,r),i[r]]))}}function ee(t,e){if(O(t,["contract","function","params"]),typeof t.contract!="string"||!Object.hasOwn(A,t.contract))throw new d("Choose a contract from hookr_contracts.");let i=A[t.contract];if(!e&&i.address.toLowerCase()===q.launcherV1.address.toLowerCase())throw new d("Use hookr_launch for the reviewed new Launcher; generic actions cannot call it.");let o=_(i).find(u=>u.name===t.function&&(e?Y(u):i.actions.includes(u.name)));if(!o)throw new d("This Hookr function is not exposed in this read/action lane. Read hookr_contracts for coverage.");let r=p(t.params);O(r,o.inputs.map(g));let c=o.inputs.map((u,f)=>N(u,r[g(u,f)])),s=Object.fromEntries(o.inputs.map((u,f)=>[g(u,f),c[f]]));return{pin:i,fn:o,values:c,params:s,target:b(i.address)}}var te={type:"string",enum:Object.keys(A),description:'Pinned Hookr contract role, as listed by hookr_contracts (for example "launcherV1").'},Q={type:"object",properties:{contract:te,function:{type:"string",description:"Function name on that contract, exactly as hookr_contracts lists it."},params:{type:"object",description:"Exact typed parameters from hookr_contracts for this contract and function; validated recursively before any chain read."}},required:["contract","function","params"],additionalProperties:!1};function ne(t){return JSON.parse(JSON.stringify(t,(e,i)=>typeof i=="bigint"?i.toString():i))}async function me(t,e,i){if(t.network==="testnet")throw new d("Hookr actions are configured only on mainnet, chain 4663.");let{pin:o,fn:r,values:c,params:s,target:u}=ee(e,!1),f=e.contract,l=r.name,H=t.clientFor(k),v=[],P=[],w=0n,C=new Map,h=(n,a)=>{let m=b(n),x=typeof a=="bigint"?a:se(a);if(x<0n||x>=(1n<<256n)-1n)throw new d("Hookr funding must be an exact bounded amount.");x&&(m===B?w+=x:C.set(m,(C.get(m)??0n)+x))},$=(n,a,m=[])=>H.readContract({address:b(A[n].address),abi:A[n].abi,functionName:a,args:m});if(f==="router"&&["swap","swapGated"].includes(l)){let n=p(s.params),a=p(n.key),m=n.amountSpecified;if(m===0n||n.amountBound===0n)throw new d("Hookr swaps require a nonzero amount and bound.");h(n.zeroForOne?a.currency0:a.currency1,m<0n?-m:n.amountBound)}else if(f==="vault"&&l==="deposit"){let n=p(s.params),a=p(n.key);if(h(a.currency0,n.amount0Desired),h(a.currency1,n.amount1Desired),n.amount0Min>n.amount0Desired||n.amount1Min>n.amount1Desired)throw new d("Hookr deposit minimum exceeds its desired amount.")}else if(f==="vault"&&l==="transfer")P.push({token:u,id:s.id,amount:s.amount,to:b(s.receiver)});else if(f==="launcher"&&l.startsWith("launch")){let n=l==="launchFamily"?p(s.p):s,a=p(n.token),m=n.members;if(m.length<1||m.length>8)throw new d("Hookr launch needs one to eight members.");if(T(String(a.salt),String(await $("launcher","SKIP_TAKEN"))))throw new d("Hookr skip-taken launches need per-pool funding checks and are not exposed yet.");let x=a.existing===B?b(await $("launcher","predictToken",[i,a])):b(a.existing),M=0n;for(let y of m){let I=BigInt(x)<BigInt(String(y.quote)),D=I?y.amount0Max:y.amount1Max;a.existing===B?M+=D:h(x,D),h(y.quote,I?y.amount1Max:y.amount0Max)}if(M>a.supply)throw new d("Hookr launch seeds more new tokens than its supply.");let oe=l==="launchFamily"?n.buys:l==="launchWithBuy"?[p(s.buy)]:[];for(let y of oe){let I=m[Number(y.member)];if(!I)throw new d("Hookr dev buy references an unavailable member.");h(I.quote,y.quoteIn)}let F=await H.readContract({address:u,abi:G,functionName:"launchFee"});if(!Array.isArray(F)||typeof F[0]!="bigint"||F[0]<0n)throw new d("Hookr launch fee is unavailable.");w+=F[0]}else if(f==="launcher"&&l==="addLiquidity"){let n=p(await $("launcher","position",[s.familyId,s.member])),a=p(n.key);h(a.currency0,s.max0),h(a.currency1,s.max1)}else if(f==="ownedFactory"&&l==="deploy"){let n=await $("ownedFactory","deployFee");if(typeof n!="bigint"||n<0n)throw new d("Hookr own-hook deployment fee is unavailable.");w=n}else if(f==="programs"&&l==="createProgram"){let n=p(s.t);if(h(n.rewardToken,n.cashBudget),w)throw new d("Hookr program cash rewards require an ERC-20 token.")}else if(f==="commissions"&&l==="createCampaign"){let n=p(s.t),a=n.end-n.start;if(a<=0n||a%86400n!==0n||a/86400n>366n)throw new d("Hookr referral campaigns must cover one to 366 whole days.");h(n.currency,n.dailyBudget*(a/86400n))}else if(f==="reserve"&&l==="fundReserve")h(s.token,s.amount);else if(f==="tokenizer"){let n=p(s.arg1);if(n.launchParams!=="0x"||["feebs","positionIds","positionPermits","v3PositionIds","v3Permits"].some(a=>n[a].length>0))throw new d("Composite revenue launches and NFT streams need their exact child-spender and funding routes; this route accepts families, Rules, revenue-token shares and bound outside sources.");for(let a of n.revenueTokens)h(a.token,a.amount);if(l==="tokenize"&&p(s.arg2).open){let a=await H.readContract({address:b(A.launcher.address),abi:G,functionName:"launchFee"});if(!Array.isArray(a)||typeof a[0]!="bigint"||a[0]<0n)throw new d("Hookr revenue market launch fee is unavailable.");w+=a[0]}}else if(f==="boost"&&["fund","notify"].includes(l)){let n=p(await $("boost","gauge",[s.id]));if(h(p(n.terms).rewardToken,s.amount),w)throw new d("Hookr boost rewards require an ERC-20 token.")}else if(f==="boost"&&l==="stake"){let n=b(await $("boost","positionManager"));if(n!==ie("0x58daec3116aae6D93017bAAea7749052E8a04fA7"))throw new d("Hookr boost position manager disagrees with the published deployment.");let a=await H.readContract({address:n,abi:V,functionName:"ownerOf",args:[s.tokenId]});if(!T(a,i))throw new d("The signing wallet must own the position NFT it stakes.");v.push(t.unsignedTx({to:n,data:J({abi:V,functionName:"approve",args:[u,s.tokenId]}),value:"0",chainId:k,description:`Approve only Hookr position NFT #${s.tokenId} to ${u}.`})),P.push({token:n,id:s.tokenId,amount:1n,to:u})}let j=await H.getBlock();if(typeof j.timestamp!="bigint"||j.timestamp<=0n)throw new d("Hookr chain time is unavailable.");let S=n=>{if(Array.isArray(n)){n.forEach(S);return}if(!(!n||typeof n!="object"))for(let[a,m]of Object.entries(n)){if(a==="deadline"&&typeof m=="bigint"&&m<j.timestamp)throw new d("Hookr deadline expired. Refresh the action terms.");S(m)}};S(s);for(let[n,a]of C){if(a>=(1n<<256n)-1n)throw new d("Hookr aggregate funding exceeds its exact approval bound.");let m=await H.readContract({address:n,abi:re,functionName:"allowance",args:[i,u]});m>0n&&m!==a&&v.push(t.approval(n,u,"0",k)),v.push(t.approval(n,u,a.toString(),k)),P.push({token:n,amount:a})}return w&&P.push({token:W,amount:w,to:u}),v.push(t.unsignedTx({to:u,data:J({abi:[r],functionName:r.name,args:c}),value:w.toString(),chainId:k,description:`Hookr ${f}.${l}: ${JSON.stringify(ne(s))}. Review recipients, bounds, ownership and any delayed effects.`})),{txs:v,inputs:P}}function ke(t,e){if(t.length!==e.length||t.some((i,o)=>i.chainId!==e[o].chainId||!T(i.to,e[o].to)||i.value!==e[o].value||!T(i.data,e[o].data)))throw new d("Hookr transactions differ from the locally reconstructed parameters and exact funding.")}function xe(t){return[{name:"hookr_contracts",inputSchema:{type:"object",description:"Read Hookr contract coverage and typed function schemas: swaps, launches and dev buys, liquidity, saved hooks, own hooks, LP boost, programs, referrals, claims, registry and treasury administration. Filter contract/function to fetch only the needed schema. No network request.",properties:{contract:{...te,description:"Only this pinned contract role; omit for every contract."},function:{type:"string",description:"Only this function name; omit for every function of the selected contracts."}},additionalProperties:!1},execute:async e=>{if(Object.keys(e).some(o=>!["contract","function"].includes(o))||e.contract!==void 0&&(typeof e.contract!="string"||!Object.hasOwn(A,e.contract))||e.function!==void 0&&typeof e.function!="string")throw new d("Choose a documented Hookr contract and function filter.");let i=o=>e.function===void 0||o.name===e.function;return{chainId:k,contracts:Object.entries(A).filter(([o])=>e.contract===void 0||o===e.contract).map(([o,r])=>({role:o,address:b(r.address),source:r.source,match:r.match,reads:_(r).filter(c=>Y(c)&&i(c)).map(c=>({function:c.name,params:E(c.inputs,c.name)})),actions:r.actions.filter(c=>e.function===void 0||c===e.function).map(c=>({function:c,params:E(_(r).find(s=>s.name===c).inputs,c)}))})),note:"Contract parameters use decimal base-unit strings for every integer. Actions always require preview and local human confirmation. Unlisted/internal functions are unavailable."}}},{name:"hookr_read",inputSchema:{...Q,description:"Read a pinned Hookr contract function. Fetch its exact parameter schema with hookr_contracts {contract,function}; no signing, subscription or identity required."},execute:async e=>{let{pin:i,fn:o,values:r,target:c}=ee(e,!0),s=await t.clientFor(k).readContract({address:c,abi:[o],functionName:o.name,args:r});return{chainId:k,contract:c,function:o.name,result:ne(s),source:i.source}}},{name:"hookr_action",inputSchema:{...Q,description:"Build a pinned Hookr action with exact funding: swap, launch/dev buy, liquidity deposit/exit, boost stake/exit, profile/own-hook management, programs/referrals and owner/keeper administration. Fetch its exact parameter schema with hookr_contracts {contract,function}. Preview and human confirmation required."},execute:async(e,i)=>{let o=await me(t,e,i),r=await t.preview(o.txs,i);return{txs:o.txs,preview:r,summary:`Hookr ${e.contract}.${e.function}; review the preview and human confirmation.`}}}]}export{ue as a,E as b,ye as c,me as d,ke as e,xe as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,c as s}from"./
|
|
1
|
+
import{a as p,c as s}from"./WOGWLFAL.js";import{a}from"./SPJCSEKP.js";import{b as i}from"./TI727O2H.js";import{a as o}from"./XSD5NL7J.js";async function u(e,n,t){if(!Object.prototype.hasOwnProperty.call(p,e.name))throw new o("Local Chop guard cannot rebuild this action; nothing was signed.");if(e.chainId!==void 0&&e.chainId!==i)throw new o("Local Chop guard requires chain 4663; nothing was signed.");let r=async()=>{throw new o("Local Chop guard does not use HTTP, swaps or a preview service.")},d=a({clientFor:c=>{if(c!==i)throw new o("Local Chop guard requires chain 4663; nothing was signed.");return t.client},http:r,quoteSwap:r,buildSwap:r,preview:r});return(await s(d,e.name,e.args,n)).built}function g(e){return(n,t)=>u(n,t,e)}export{u as a,g as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as e,e as t,j as r}from"./TI727O2H.js";import{getAddress as s,parseAbi as a}from"viem";var n=r[e],u=s(n.layerbank.pool.address),o=s(n.layerbank.aToken.address),c={address:s(n.tokens.USDG.address),symbol:"USDG",decimals:t,chainId:e},l={address:o,symbol:"lRobUSDG",decimals:t,chainId:e},p=(1n<<256n)-1n,f=10n**27n,m=a(["function getReserveData(address asset) view returns (((uint256 data) configuration,uint128 liquidityIndex,uint128 currentLiquidityRate,uint128 variableBorrowIndex,uint128 currentVariableBorrowRate,uint128 currentStableBorrowRate,uint40 lastUpdateTimestamp,uint16 id,address aTokenAddress,address stableDebtTokenAddress,address variableDebtTokenAddress,address interestRateStrategyAddress,uint128 accruedToTreasury,uint128 unbacked,uint128 isolationModeTotalDebt) reserve)","function getConfiguration(address asset) view returns ((uint256 data) configuration)","function getReserveNormalizedIncome(address asset) view returns (uint256)","function supply(address asset,uint256 amount,address onBehalfOf,uint16 referralCode)","function withdraw(address asset,uint256 amount,address to) returns (uint256)"]),b=a(["function POOL() view returns (address)","function UNDERLYING_ASSET_ADDRESS() view returns (address)","function decimals() view returns (uint8)","function scaledTotalSupply() view returns (uint256)"]);export{u as a,o as b,c,l as d,p as e,f,m as g,b as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $e,b as Ee}from"./YEIM6BZQ.js";import{c as en,d as nn,e as _e,f as he,i as Ue,j as tn}from"./ATEVAJ5Y.js";import{i as de}from"./UVAR6BHU.js";import{b as Te,o as Me}from"./LKX5WDOQ.js";import{a as ce}from"./Z7FGEWO2.js";import{a as T,b as Je}from"./43LI5NKJ.js";import{a as L}from"./66F5ZH34.js";import{b as K}from"./IX3GZMTM.js";import{b as y,e as Ze,j as Q,k as Ye,n as Qe}from"./TI727O2H.js";import{a as o,b as Ge,e as oe}from"./XSD5NL7J.js";import{encodeAbiParameters as S,encodeFunctionData as re,erc20Abi as on,getAddress as w,isAddress as Nn,keccak256 as Kn,pad as Hn,parseAbi as Ae,parseAbiParameters as z,toEventSelector as Fn,toHex as rn}from"viem";var Vn=w(Q[4663].uniswap.v4_pool_manager.address),M=w(Q[4663].uniswap.v4_position_manager.address),le=w(Q[4663].uniswap.v4_state_view.address),He=w(Q[4663].uniswap.permit2.address),At=w(Q[4663].ponsTrade.universal_router.address),se=w(Q[4663].uniswap.WETH.address),D=w(Ye),k="0x0000000000000000000000000000000000000000",Xe=8388608,Fe=-887272,ve=887272,An=(1n<<48n)-1n,J=(1n<<128n)-1n,Bn=(1n<<160n)-1n,pe=1n<<96n,sn="V4 deposits use limits, not minimums: set amount0Max and amount1Max, and for more room for price movement set slippageBps (at most 500 = 5%).",an=1800n,me=50n,cn=(e,n=me)=>e*(10000n-n)/10000n,dn=(e,n,i=me)=>{let r=(e*(10000n+i)+9999n)/10000n;return r<n?r:n},Xn="0xbac3aa3b91584a53a579b3c999a56756e954e59247e497bad1d25a4334bde551",Ve=class extends o{name="PonsHookRefusal";token;constructor(n){let i=n===void 0?void 0:w(n),r=i?`To buy, use pons_buy {"token":"${i}","amountIn":"<ETH in wei>"}. To sell, use pons_sell {"token":"${i}","amountIn":"<token base units>"}.`:"For this custom pair, check the launch token and pairToken with pons_status, then use pons_buy or pons_sell with those addresses and amounts in the input token's base units.";super(`Oak's Uniswap tools don't quote this pool. Its hook is Pons's own trading hook, so Oak trades it only through Pons. ${r} Pons shows the exact fees before you approve.`),this.token=i}},Oe=[{poolId:"0xbac3aa3b91584a53a579b3c999a56756e954e59247e497bad1d25a4334bde551",key:{currency0:k,currency1:D,fee:8388608,tickSpacing:10,hooks:w("0x06a889870c8f83640d6816319f72e2aa579b6080")},liquidity:"5532026605872066941",sqrtPriceX96:"3839897026469220985301794",tick:-198703,protocolFee:0,lpFee:0},{poolId:"0x387bf619da4d3fb62bb276482693dba1b9b3520f573cabdfe033384a24125982",key:{currency0:k,currency1:D,fee:500,tickSpacing:10,hooks:k},liquidity:"225820987949255613",sqrtPriceX96:"3840577772610961024680304",tick:-198700,protocolFee:512125,lpFee:500},{poolId:"0x54f7883914619af9105355bf83ed678bcf9f63560218ac61c9963b9503d0ba32",key:{currency0:k,currency1:D,fee:460,tickSpacing:9,hooks:k},liquidity:"85654324417347171",sqrtPriceX96:"3840419018843648722761192",tick:-198701,protocolFee:479349,lpFee:460},{poolId:"0xc7b615a3721594f73664eb3f62d8290d0fcc8d9d1156aed1ddecbd7f32efd9f5",key:{currency0:k,currency1:D,fee:8388608,tickSpacing:10,hooks:w("0xcb787a5cdea8b3715d984d82f1203fd7bfebe0c4")},liquidity:"50517446454827887",sqrtPriceX96:"3840495145865430860317598",tick:-198700,protocolFee:0,lpFee:0},{poolId:"0x24107d152f14a76d292123265ae3f3c71f863fc2f4ef7ba49d64e78d28ea379e",key:{currency0:k,currency1:D,fee:100,tickSpacing:1,hooks:k},liquidity:"36478878201789434",sqrtPriceX96:"3840363370720475418748563",tick:-198701,protocolFee:102425,lpFee:100},{poolId:"0x84bd4e2d8be11aeb0afc1195b38f587b61e90068548f1063fdbe448fb8cad0b6",key:{currency0:se,currency1:D,fee:200,tickSpacing:4,hooks:k},liquidity:"5980655057479791",sqrtPriceX96:"3839891926195366283625355",tick:-198703,protocolFee:213044,lpFee:200},{poolId:"0x3b0cbf0603ecc67b5fc9bb4fbb6ac9e08d3b2f406b63d1662a36063a7fe5e866",key:{currency0:k,currency1:D,fee:87,tickSpacing:1,hooks:k},liquidity:"5486760264498148",sqrtPriceX96:"3840563617639470134132117",tick:-198700,protocolFee:90134,lpFee:87}],Re=w("0x987e330f00b79864a07fe81dfac344d0078abcc0"),Sn="0xa791e5169faf703c0b63fd9552c33ec1128a773a00f5dc33a640da62a022cd35",On={currency0:k,currency1:D,fee:Xe,tickSpacing:1,hooks:Re},Rn=new Set([...Oe.map(e=>e.key.hooks.toLowerCase()),Re.toLowerCase()]),zn=z("address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks"),jn=z("(address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) poolKey, int24 tickLower, int24 tickUpper, uint256 liquidity, uint128 amount0Max, uint128 amount1Max, address owner, bytes hookData"),Wn=z("address currency0, address currency1"),Gn=z("address currency, address recipient"),ge=z("uint256 tokenId, uint256 liquidity, uint128 amount0Min, uint128 amount1Min, bytes hookData"),Zn=z("uint256 tokenId, uint128 amount0Min, uint128 amount1Min, bytes hookData"),De=z("address currency0, address currency1, address recipient"),ue=z("bytes actions, bytes[] params"),X=Ae(["function modifyLiquidities(bytes unlockData, uint256 deadline) payable","function poolKeys(bytes25 poolId) view returns (address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks)","function getPositionLiquidity(uint256 tokenId) view returns (uint128 liquidity)","function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) poolKey, uint256 info)","function positionInfo(uint256 tokenId) view returns (uint256 info)","function ownerOf(uint256 tokenId) view returns (address owner)","function nextTokenId() view returns (uint256 tokenId)"]),Yn=Ae(["function initialize((address currency0, address currency1, uint24 fee, int24 tickSpacing, address hooks) key, uint160 sqrtPriceX96) returns (int24 tick)"]),un=z("address currency"),pn=1e6,fe=Ae(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Qn=Ae(["function approve(address token, address spender, uint160 amount, uint48 expiration)"]),Jn=Fn("Transfer(address,address,uint256)");function xe(e){if(typeof e!="string"||!Nn(e,{strict:!1}))throw new o("Provide a valid v4 currency address.");let n=e.toLowerCase();return n===k||n===ce.toLowerCase()?k:w(e)}function H(e){let n=e.toLowerCase();return n===k||n===ce.toLowerCase()}function ye(e){let n=xe(e.currency0),i=xe(e.currency1);T(e.hooks);let r=w(e.hooks);return Kn(S(zn,[n,i,e.fee,e.tickSpacing,r]))}function In(e){return((typeof e=="number"?e:e.fee)&Xe)!==0}function ln(e,n){return In(e)?{dynamicFee:!0,storedLpFee:n,swapsAreFree:!1,feeNote:Ee(e,n)}:{dynamicFee:!1,storedLpFee:n,swapsAreFree:n===0,feeNote:Ee(e,n)}}function ke(e,n){if(!e||typeof e!="object")throw new o("Provide a valid v4 PoolKey.");let i=xe(e.currency0),r=xe(e.currency1);if(BigInt(i)>=BigInt(r))throw new o("PoolKey currencies must be strictly sorted (currency0 < currency1).");if(!Number.isInteger(e.tickSpacing)||e.tickSpacing<=0||e.tickSpacing>32767)throw new o("PoolKey tickSpacing must be a positive integer.");if(!Number.isInteger(e.fee)||e.fee<0||e.fee>16777215)throw new o("PoolKey fee must be a valid uint24.");T(e.hooks);let c=w(e.hooks),s=In(e.fee);if(!s&&e.fee>pn)throw new o(`PoolKey static fee ${$e(e.fee)} exceeds the v4 maximum of ${$e(pn)}.`);if(s&&e.fee!==Xe)throw new o("Dynamic-fee PoolKey must use exact fee flag 0x800000 (8388608).");if(s&&c.toLowerCase()===k)throw new o("Dynamic-fee PoolKey requires a non-zero hook address.");if(!Rn.has(c.toLowerCase()))throw c.toLowerCase()===Qe.toLowerCase()?new Ve(i===k?r:void 0):new o(`Unsupported v4 hook ${c}: Oak does not assure arbitrary v4 hooks outside measured PoolKeys.`);let t={currency0:i,currency1:r,fee:e.fee,tickSpacing:e.tickSpacing,hooks:c},d=ye(t);if(c===Re&&d.toLowerCase()!==Sn)throw new o("Only the documented VolatilePair ETH/USDG PoolKey is supported. Pool creation requires the Uniswap Labs role.");if(n!==void 0){if(typeof n!="string"||!/^0x[0-9a-fA-F]{64}$/.test(n))throw new o("Provide a 32-byte hex poolId.");if(d.toLowerCase()!==n.toLowerCase())throw new o(`PoolKey hash (${d}) does not match expected poolId (${n}).`)}return t}function et(e){if(!Number.isInteger(e)||e<=0||e>ve)throw new o("tickSpacing must be a positive integer.");let n=Math.trunc(Fe/e)*e,i=Math.trunc(ve/e)*e;return{tickLower:n===0?0:n,tickUpper:i===0?0:i}}function nt(e,n,i){if(!Number.isInteger(i)||i<=0)throw new o("tickSpacing must be a positive integer.");if(!Number.isInteger(e)||!Number.isInteger(n))throw new o("tickLower and tickUpper must be integers.");if(e<Fe||n>ve)throw new o(`Ticks [${e}, ${n}] are outside Uniswap bounds [${Fe}, ${ve}].`);if(e>=n)throw new o("tickLower must be strictly less than tickUpper.");if(e%i!==0||n%i!==0)throw new o(`Ticks [${e}, ${n}] must be divisible by tickSpacing ${i}.`)}function mn(e,n,i,r,c=y){if(T(e),T(n),H(e))throw new o("Native ETH does not use Permit2 approval.");let s=K(i);if(s<=0n||s>Bn)throw new o("Permit2 approval amount must be a positive integer within uint160.");let t=K(String(r));if(t<=0n||t>An)throw new o("Permit2 expiration must be a positive timestamp within uint48.");let d=re({abi:Qn,functionName:"approve",args:[e,n,s,Number(t)]});return Je({to:He,data:d,value:"0",chainId:c,description:`Approve Permit2 allowance of ${s} base units of ${e} for ${n} until ${t}.`})}function fn(e){let n=Number(e&0xffffffn);return(n&8388608)!==0?n-16777216:n}function tt(e){let n=(e&0xffn)!==0n,i=fn(e>>8n&0xffffffn),r=fn(e>>32n&0xffffffn);return{poolIdBytes25:`0x${(e>>56n&(1n<<200n)-1n).toString(16).padStart(50,"0")}`,tickLower:i,tickUpper:r,hasSubscriber:n}}function yn(e,n,i,r=!1){let[c,s]=e<=n?[e,n]:[n,e];if(c<=0n||s<=0n)return 0n;let t=(i<<96n)*(s-c),d=s*c;return r?(t+d-1n)/d:t/d}function wn(e,n,i,r=!1){let[c,s]=e<=n?[e,n]:[n,e],t=i*(s-c);return r?(t+pe-1n)/pe:t/pe}function Cn(e){if(e.liquidity<=0n)return{amount0:0n,amount1:0n};let n=de(e.tickLower),i=de(e.tickUpper);return e.sqrtPriceX96<=n?{amount0:yn(n,i,e.liquidity,e.roundUp),amount1:0n}:e.sqrtPriceX96<i?{amount0:yn(e.sqrtPriceX96,i,e.liquidity,e.roundUp),amount1:wn(n,e.sqrtPriceX96,e.liquidity,e.roundUp)}:{amount0:0n,amount1:wn(n,i,e.liquidity,e.roundUp)}}function it(e){let n=de(e.tickLower),i=de(e.tickUpper),r=(s,t,d)=>t<=s||d<=0n?0n:d*s*t/pe/(t-s),c=(s,t,d)=>t<=s||d<=0n?0n:d*pe/(t-s);if(e.sqrtPriceX96<=n)return r(n,i,e.amount0);if(e.sqrtPriceX96<i){let s=r(e.sqrtPriceX96,i,e.amount0),t=c(n,e.sqrtPriceX96,e.amount1);return s<t?s:t}return c(n,i,e.amount1)}function Ne(e,n){return e.map(i=>{let r=i.amount.trim(),c=r.startsWith("-"),s=c||r.startsWith("+")?r.slice(1):r,t=n(s,i.token.decimals);return`${c?"-":""}${t} ${i.token.symbol}`})}function bn(e,n=y){if(H(e))return{address:ce,symbol:"ETH",decimals:18,chainId:n};let i=w(e);return i.toLowerCase()===D.toLowerCase()?{address:D,symbol:"USDG",decimals:Ze,chainId:n}:i.toLowerCase()===se.toLowerCase()?{address:se,symbol:"WETH",decimals:18,chainId:n}:{address:i,symbol:i.slice(0,10),decimals:18,chainId:n}}async function B(e,n,i=y){if(H(n))return bn(n,i);let r=w(n);if(r.toLowerCase()===D.toLowerCase()||r.toLowerCase()===se.toLowerCase())return bn(r,i);let[c,s]=await Promise.all([e.readContract({address:r,abi:on,functionName:"symbol"}),e.readContract({address:r,abi:on,functionName:"decimals"})]);if(!Number.isInteger(Number(s))||Number(s)<0||Number(s)>77)throw new o(`Token ${r} reports invalid decimals.`);return{address:r,symbol:tn(c,r),decimals:Number(s),chainId:i}}function Z(e,n){if(typeof e!="string"||!/^\d+$/.test(e))throw new o(`${n} must be a non-negative integer string in base units.`);return K(e)}function hn(e,n,i,r){let c=e===void 0?K(Me(n.toString(),i)):Z(e,r);if(c<=1n||c>J)throw new o(`${r} must exceed 1 base unit and fit in uint128; the simulated amount may be too small.`);return c}async function qn(e,n){if(typeof n=="number"&&Number.isFinite(n)&&n>0)return BigInt(Math.floor(n>1e11?n/1e3:n));if(typeof n=="string"&&/^\d+$/.test(n.trim()))return BigInt(n.trim());try{let i=await e.request({method:"eth_getBlockByNumber",params:["latest",!1]});if(i&&typeof i.timestamp=="string")return BigInt(i.timestamp)}catch{}return BigInt(Math.floor(Date.now()/1e3))}async function Ke(e,n,i){let r=await qn(e,i);if(n==null)return r+1800n;let c=K(String(n));if(c<=r)throw new o(`Transaction deadline ${c} has expired (current timestamp ${r}).`);return c}async function Be(e,n){let i=typeof n.poolId=="string"?n.poolId.trim():void 0,r=n.poolKey&&typeof n.poolKey=="object"&&!Array.isArray(n.poolKey)?n.poolKey:void 0,c=r?{currency0:String(r.currency0??k),currency1:String(r.currency1??D),fee:Number(r.fee),tickSpacing:Number(r.tickSpacing),hooks:String(r.hooks??k)}:n.currency0!==void 0&&n.currency1!==void 0&&n.fee!==void 0&&n.tickSpacing!==void 0?{currency0:String(n.currency0),currency1:String(n.currency1),fee:Number(n.fee),tickSpacing:Number(n.tickSpacing),hooks:String(n.hooks??k)}:void 0;if(c){if(H(c.currency0)&&typeof n.token0=="string"&&n.token0.toLowerCase()===se.toLowerCase())throw new o("Native ETH currency0 differs from WETH; do not supply WETH for a native-ETH v4 pool.");let u=ke(c,i);return{poolId:ye(u),poolKey:u}}let s=(i??Xn).toLowerCase();if(s===Sn)return{poolId:s,poolKey:ke(On,s)};let t=Oe.find(u=>u.poolId.toLowerCase()===s);if(t){if(H(t.key.currency0)&&typeof n.token0=="string"&&n.token0.toLowerCase()===se.toLowerCase())throw new o("Native ETH currency0 differs from WETH; do not supply WETH for a native-ETH v4 pool.");return{poolId:t.poolId,poolKey:t.key}}let d=s.slice(0,52),a=await e.readContract({address:M,abi:X,functionName:"poolKeys",args:[d]}),[p,l,m,f,P]=a;if(p.toLowerCase()===k&&l.toLowerCase()===k&&Number(f)===0)throw new o(`Unknown or uninitialized v4 poolId ${s}.`);let b=ke({currency0:p,currency1:l,fee:Number(m),tickSpacing:Number(f),hooks:P},s);return{poolId:s,poolKey:b}}async function Pe(e,n,i){try{let[r,c]=await e.readContract({address:M,abi:X,functionName:"getPoolAndPositionInfo",args:[n]}),s=ke({currency0:r.currency0,currency1:r.currency1,fee:Number(r.fee),tickSpacing:Number(r.tickSpacing),hooks:r.hooks});if((i.poolKey||i.poolId)&&(await Be(e,i)).poolId.toLowerCase()!==ye(s).toLowerCase())throw new o("The supplied PoolKey does not match this v4 position.");let t=tt(BigInt(c));return{poolKey:s,poolId:ye(s),tickLower:t.tickLower,tickUpper:t.tickUpper}}catch(r){throw new o(`Could not read v4 position #${n}. ${oe(r)}`)}}function ot(e){if(typeof e!="string")throw new o("wallet must be a valid 20-byte hex address.");return T(e),w(e)}async function gn(e,n,i={}){T(n);let r=w(n),c=e.clientFor(y),s=new Set;if(i.tokenIds)for(let d of i.tokenIds)s.add(K(String(d)).toString());if(!i.tokenIds?.length)try{let d=await c.getBlockNumber(),a=10000000n;for(let p=0n;p<=d;p+=a){let l=p+a-1n<d?p+a-1n:d,m=await c.request({method:"eth_getLogs",params:[{address:M.toLowerCase(),topics:[Jn,null,Hn(r)],fromBlock:rn(p),toBlock:rn(l)}]});if(!Array.isArray(m))throw new o("Invalid v4 position log response.");for(let f of m){if(!Array.isArray(f.topics)||f.topics.length!==4||!/^0x[0-9a-fA-F]{64}$/.test(f.topics[3]??""))throw new o("Invalid v4 position transfer log.");s.add(BigInt(f.topics[3]).toString())}}}catch(d){if(!i.tokenIds)throw new o(`Could not discover v4 positions. ${oe(d)}`)}let t=[];for(let d of s){let a=BigInt(d);try{let p;try{p=await c.readContract({address:M,abi:X,functionName:"ownerOf",args:[a]})}catch(F){if(Ge(F,3))continue;throw F}if(p.toLowerCase()!==r.toLowerCase())continue;let l=await c.readContract({address:M,abi:X,functionName:"getPositionLiquidity",args:[a]}),m=BigInt(l);if(m===0n&&!i.includeZero)continue;let{poolKey:f,poolId:P,tickLower:b,tickUpper:u}=await Pe(c,a,{}),v=await c.readContract({address:le,abi:fe,functionName:"getSlot0",args:[P]}),x=BigInt(v[0]),{amount0:h,amount1:g}=Cn({liquidity:m,tickLower:b,tickUpper:u,sqrtPriceX96:x}),[A,I]=await Promise.all([B(c,f.currency0,y),B(c,f.currency1,y)]);t.push({module:"uniswap",id:`uniswap:v4:${a.toString()}`,chainId:y,assets:[{token:A,amount:h.toString()},{token:I,amount:g.toString()}],description:`Uniswap v4 LP position #${a.toString()} (${A.symbol}/${I.symbol}, liquidity=${m.toString()}, ticks=[${b},${u}], poolId=${P})`})}catch(p){throw new o(`Could not read v4 position #${a}. ${oe(p)}`)}}return t}var rt={type:"object",properties:{version:{description:"Uniswap v4 PoolManager version.",type:"string",enum:["v4"]},poolId:{type:"string",description:"32-byte Uniswap v4 poolId hex string."},poolKey:{description:"V4 pool key: sorted currencies, fee in pips, tick spacing and hook address.",type:"object",properties:{currency0:{description:"Lower sorted currency address; the zero address means native ETH.",type:"string"},currency1:{description:"Higher sorted currency address.",type:"string"},fee:{description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%).",type:"number"},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"number"},hooks:{description:"Hook contract address; the zero address means no hook.",type:"string"}}},currency0:{description:"Lower sorted currency address; the zero address means native ETH.",type:"string"},currency1:{description:"Higher sorted currency address.",type:"string"},fee:{description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%).",type:"number"},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"number"},hooks:{description:"Hook contract address; the zero address means no hook.",type:"string"},tickLower:{description:"Lower tick boundary, divisible by the pool tick spacing.",type:"number"},tickUpper:{description:"Upper tick boundary, divisible by the pool tick spacing.",type:"number"},fullRange:{description:"Use the widest tick range aligned to the pool tick spacing; omit explicit ticks.",type:"boolean"},liquidity:L('Position liquidity in protocol base units. Example: "1000" = 1000 liquidity units.'),amount0Max:L('Maximum amount of currency0 in base units; use currency0 decimals. Example: "1000000" = 1 currency0 at 6 decimals.'),amount1Max:L('Maximum amount of currency1 in base units; use currency1 decimals. Example: "1000000" = 1 currency1 at 6 decimals.'),recipient:{description:"Recipient address; must be the signing wallet.",type:"string"},deadline:L("Transaction deadline in Unix seconds, after the current block timestamp. Example: 1800000000."),permit2Expiration:{description:'Permit2 allowance expiry in Unix seconds, as a decimal string. Example: "1800000000".',type:"string"},exactCaps:{description:"Use both caller caps exactly for a new v4 mint; omit tokenId, initialPrice and sqrtPriceX96.",type:"boolean"},slippageBps:{description:"Mint cap headroom in basis points (50 = 0.5%), up to 500 (5%); unavailable when increasing an existing NFT.",type:"integer",minimum:0,maximum:500,default:Number(me)},hookData:{description:"Hex-encoded hook call data; only data supported by the measured hook is accepted.",type:"string"},tokenId:L('Existing v4 position NFT identifier to increase, as a decimal string; keeps its tick range. Omit to mint a new position. Example: "1".'),initialPrice:{type:"string",description:"Starting price as token1 per one token0 in human units; used only for a new pool. Pool creation and the first liquidity add require separate confirmations."},sqrtPriceX96:{type:"string",description:"Alternative starting price: square root of the token1/token0 base-unit price ratio, multiplied by 2^96, as a decimal string."},acceptPriceDeviation:{type:"boolean",description:"Allow a starting price more than 500 basis points (5%) from other live pools of the pair."}}},st={type:"object",description:"Create and initialize an empty Uniswap v4 pool (permissionless PoolManager.initialize). Add liquidity afterwards with uniswap_add.",properties:{version:{description:"Uniswap v4 PoolManager version.",type:"string",enum:["v4"]},poolKey:{description:"V4 pool key: sorted currencies, fee in pips, tick spacing and hook address.",type:"object",properties:{currency0:{description:"Lower sorted currency address; the zero address means native ETH.",type:"string"},currency1:{description:"Higher sorted currency address.",type:"string"},fee:{description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%).",type:"number"},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"number"},hooks:{description:"Hook contract address; the zero address means no hook.",type:"string"}}},currency0:{type:"string",description:"Lower sorted currency; the zero address is native ETH."},currency1:{description:"Higher sorted currency address.",type:"string"},fee:{type:"number",description:"Pool fee in pips, hundredths of a basis point (3000 = 0.3%; 950000 = 95%)."},tickSpacing:{description:"Spacing between usable pool ticks, as an integer.",type:"number"},hooks:{type:"string",description:"Hook address; only hooks Oak has measured are accepted. Defaults to none."},initialPrice:{type:"string",description:"Starting pool price as token1 per one token0 in human units. Add liquidity separately after initialization."},sqrtPriceX96:{type:"string",description:"Alternative starting price: square root of the token1/token0 base-unit price ratio, multiplied by 2^96, as a decimal string."},acceptPriceDeviation:{type:"boolean",description:"Allow a starting price more than 500 basis points (5%) from other live pools of the pair."}}},at={type:"object",properties:{version:{description:"Uniswap v4 PoolManager version.",type:"string",enum:["v4"]},tokenId:L('Identifier of the position NFT, as a decimal string. Example: "1".'),poolId:{description:"Identifier of the v4 pool, as a 32-byte hex string.",type:"string"},poolKey:{description:"V4 pool key: sorted currencies, fee in pips, tick spacing and hook address.",type:"object"},amount0Min:L('Minimum amount of currency0 in base units; use currency0 decimals. Example: "1000000" = 1 currency0 at 6 decimals.'),amount1Min:L('Minimum amount of currency1 in base units; use currency1 decimals. Example: "1000000" = 1 currency1 at 6 decimals.'),recipient:{description:"Recipient address; must be the signing wallet.",type:"string"},deadline:L("Transaction deadline in Unix seconds, after the current block timestamp. Example: 1800000000."),hookData:{description:"Hex-encoded hook call data; only data supported by the measured hook is accepted.",type:"string"}},required:["tokenId"]},ct={type:"object",properties:{version:{description:"Uniswap v4 PoolManager version.",type:"string",enum:["v4"]},tokenId:L('Identifier of the position NFT, as a decimal string. Example: "1".'),liquidity:{type:"string",pattern:"^(?:[0-9]+|all)$",description:'Liquidity in protocol base units, or "all" for a full exit where supported; not a token amount. Example: "1000" = 1000 liquidity units.'},slippageBps:{description:"Slippage tolerance in basis points (50 = 0.5%).",type:"integer",minimum:0,maximum:9999,default:Te},fullExit:{description:"Remove all position liquidity and collect the proceeds.",type:"boolean"},burn:{description:"Burn the position NFT after all liquidity and owed tokens have been removed.",type:"boolean"},amount0Min:L('Minimum amount of currency0 in base units; use currency0 decimals. Example: "1000000" = 1 currency0 at 6 decimals.'),amount1Min:L('Minimum amount of currency1 in base units; use currency1 decimals. Example: "1000000" = 1 currency1 at 6 decimals.'),poolId:{description:"Identifier of the v4 pool, as a 32-byte hex string.",type:"string"},poolKey:{description:"V4 pool key: sorted currencies, fee in pips, tick spacing and hook address.",type:"object"},recipient:{description:"Recipient address; must be the signing wallet.",type:"string"},deadline:L("Transaction deadline in Unix seconds, after the current block timestamp. Example: 1800000000."),hookData:{description:"Hex-encoded hook call data; only data supported by the measured hook is accepted.",type:"string"}},required:["tokenId"]},dt={type:"object",properties:{version:{description:"Uniswap v4 PoolManager version.",type:"string",enum:["v4"]},tokenIds:{description:'Position NFT identifiers as decimal strings. Example: ["1", "2"].',type:"array",items:L()},includeZero:{description:"Include positions whose current liquidity is zero.",type:"boolean"}}};function kn(e){let n=e.poolKey&&typeof e.poolKey=="object"&&!Array.isArray(e.poolKey)?e.poolKey:e;for(let i of["currency0","currency1","fee","tickSpacing"])if(n[i]===void 0)throw new o(`Creating a pool needs the full poolKey (currency0, currency1, fee, tickSpacing, hooks); ${i} is missing. A poolId alone cannot describe a pool that does not exist yet.`)}function Pn(e,n,i){if(e.initialPrice!==void 0&&e.sqrtPriceX96!==void 0)throw new o("Provide initialPrice or sqrtPriceX96, not both.");if(e.sqrtPriceX96!==void 0){if(typeof e.sqrtPriceX96!="string"||!/^\d+$/.test(e.sqrtPriceX96))throw new o("sqrtPriceX96 must be a non-negative integer string.");return nn(BigInt(e.sqrtPriceX96))}return en(e.initialPrice,n,i)}async function ut(e,n,i){let r;try{r=await e.readContract({address:M,abi:X,functionName:"ownerOf",args:[n]})}catch(c){throw new o(`Could not verify owner of Uniswap v4 position #${n}. ${oe(c)}`)}if(w(r)!==w(i))throw new o(`Wallet ${w(i)} is not the owner of Uniswap v4 position #${n} (owned by ${w(r)}).`)}async function vn(e,n){let i=ye(n).toLowerCase(),r=new Map;for(let s of Oe)s.key.currency0.toLowerCase()===n.currency0.toLowerCase()&&s.key.currency1.toLowerCase()===n.currency1.toLowerCase()&&r.set(s.poolId.toLowerCase(),s.key);let c=[];for(let[s,t]of r){if(s===i||BigInt(await e.readContract({address:le,abi:fe,functionName:"getLiquidity",args:[s]}))===0n)continue;let a=await e.readContract({address:le,abi:fe,functionName:"getSlot0",args:[s]});BigInt(a[0])>0n&&c.push({label:`v4 fee ${t.fee} spacing ${t.tickSpacing} pool ${s}`,sqrtPriceX96:BigInt(a[0])})}return c}function xn(e,n,i,r,c,s){return e.unsignedTx({to:Vn.toLowerCase(),data:re({abi:Yn,functionName:"initialize",args:[{currency0:n.currency0.toLowerCase(),currency1:n.currency1.toLowerCase(),fee:n.fee,tickSpacing:n.tickSpacing,hooks:n.hooks.toLowerCase()},r]}),value:"0",chainId:y,description:`Create and initialize Uniswap v4 pool ${i} (${c.symbol}/${s.symbol}, fee ${n.fee}, tickSpacing ${n.tickSpacing}) at ${he(r,c.decimals,s.decimals)} ${s.symbol} per ${c.symbol}.`})}var pt=e=>({tools:[{name:"uniswap_add",inputSchema:rt,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=t.tokenId===void 0?void 0:K(String(t.tokenId));if(a!==void 0&&a<=0n)throw new o("Provide a positive v4 position tokenId.");let p=t.initialPrice!==void 0||t.sqrtPriceX96!==void 0;if(t.exactCaps!==void 0&&typeof t.exactCaps!="boolean")throw new o("exactCaps must be a boolean.");let l=t.exactCaps===!0;if(l&&(a!==void 0||p||t.amount0Max===void 0||t.amount1Max===void 0))throw new o("exactCaps is for v4 mints only: provide both amount0Max and amount1Max, without tokenId, initialPrice or sqrtPriceX96.");if(a!==void 0&&p)throw new o("initialPrice cannot be combined with tokenId.");if(a!==void 0&&(t.amount0Min!==void 0||t.amount1Min!==void 0||t.slippageBps!==void 0))throw new o("V4 mint encodes fixed liquidity and amount0Max/amount1Max; amount minima and slippageBps are not supported for minting.");if(t.amount0Min!==void 0||t.amount1Min!==void 0)throw new o(sn);let m=t.slippageBps===void 0?Number(me):t.slippageBps;if(typeof m!="number"||!Number.isInteger(m)||m<0||m>500)throw new o(sn);let f=BigInt(m),P=e.clientFor(y);p&&kn(t);let b,u,v,x;if(a!==void 0){if(t.tickLower!==void 0||t.tickUpper!==void 0||t.fullRange!==void 0)throw new o("An existing v4 position keeps its tick range; omit tickLower, tickUpper and fullRange when increasing.");await ut(P,a,d),{poolId:b,poolKey:u,tickLower:v,tickUpper:x}=await Pe(P,a,t)}else{({poolId:b,poolKey:u}=await Be(P,t));let q=et(u.tickSpacing);v=t.fullRange===!0&&t.tickLower===void 0?q.tickLower:Number(t.tickLower),x=t.fullRange===!0&&t.tickUpper===void 0?q.tickUpper:Number(t.tickUpper),nt(v,x,u.tickSpacing)}let[h,g]=await Promise.all([B(P,u.currency0,y),B(P,u.currency1,y)]),A=Z(t.amount0Max??t.amount0Desired,"amount0Max"),I=Z(t.amount1Max??t.amount1Desired,"amount1Max");if(A<=0n&&I<=0n||A>J||I>J)throw new o("Provide positive amount0Max/amount1Max within uint128.");let F=await P.readContract({address:le,abi:fe,functionName:"getSlot0",args:[b]}),_=BigInt(F[0]),j=Number(F[3]),C;if(p){if(_>0n)throw new o(`Pool ${b} already exists; remove initialPrice/sqrtPriceX96 to add liquidity at its current price.`);let q=Pn(t,h.decimals,g.decimals),V=Ue(q,await vn(P,u),t.acceptPriceDeviation===!0,h.decimals,g.decimals);C={sqrtPriceX96:q,note:V},_=q}else if(_<=0n)throw new o(`Pool ${b} is not initialized on StateView. To create it and add the first liquidity in one tool call with separately confirmed transactions, pass the full poolKey plus initialPrice (token1 per 1 token0, human units); to create it without liquidity use uniswap_create_pool.`);let E=t.liquidity!==void 0&&!l?Z(t.liquidity,"liquidity"):it({amount0:cn(A,f),amount1:cn(I,f),tickLower:v,tickUpper:x,sqrtPriceX96:_});if(E<=0n||E>J)throw new o("Position liquidity must be a positive integer within uint128.");let{amount0:ee,amount1:ne}=Cn({liquidity:E,tickLower:v,tickUpper:x,sqrtPriceX96:_,roundUp:!0});if(ee>A||ne>I)throw new o("Liquidity requires more tokens than amount0Max or amount1Max.");let W=l?A:dn(ee,A,f),Y=l?I:dn(ne,I,f),$=t.recipient!==void 0?String(t.recipient):d;if(T($),w($)!==w(d))throw new o("Uniswap recipient must be the signing wallet.");let U=await qn(P),O=await Ke(P,t.deadline,U.toString()),te=O<U+an?O:U+an,N=t.permit2Expiration===void 0?te:K(String(t.permit2Expiration));if(N<=U||N>te||N>An)throw new o("Permit2 expiration must be in the next 30 minutes and no later than the transaction deadline.");let ie=typeof t.hookData=="string"?t.hookData:"0x",Se=((q,V)=>{let G=C?[xn(e,u,b,C.sqrtPriceX96,h,g)]:[];if(!H(u.currency0)&&q>0n){let ae=u.currency0.toLowerCase();G.push(e.approval(ae,He.toLowerCase(),q.toString(),y)),G.push(mn(ae,M.toLowerCase(),q.toString(),N.toString(),y))}if(!H(u.currency1)&&V>0n){let ae=u.currency1.toLowerCase();G.push(e.approval(ae,He.toLowerCase(),V.toString(),y)),G.push(mn(ae,M.toLowerCase(),V.toString(),N.toString(),y))}let R={currency0:u.currency0.toLowerCase(),currency1:u.currency1.toLowerCase(),fee:u.fee,tickSpacing:u.tickSpacing,hooks:u.hooks.toLowerCase()},Le=S(jn,[R,v,x,E,q,V,$.toLowerCase(),ie]),$n=S(Wn,[R.currency0,R.currency1]),We=S(Gn,[k,$.toLowerCase()]),En=S(ge,[a??0n,E,q,V,ie]),_n=a===void 0?S(ue,["0x020d14",[Le,$n,We]]):S(ue,["0x00121214",[En,S(un,[R.currency0]),S(un,[R.currency1]),We]]),Un=re({abi:X,functionName:"modifyLiquidities",args:[_n,O]}),Dn=H(u.currency0)?q.toString():"0";return G.push(e.unsignedTx({to:M.toLowerCase(),data:Un,value:Dn,chainId:y,description:a!==void 0?`Increase Uniswap v4 position #${a} on pool ${b} (liquidity +${E}).`:`Mint Uniswap v4 position on pool ${b} (ticks [${v}, ${x}], liquidity ${E}).`})),G})(W,Y),we=await e.preview(Se,d),ze=(q,V)=>{let G=H(V)?ce:V.toLowerCase();return-q.changes.filter(R=>R.token.address.toLowerCase()===G).reduce((R,Le)=>R+BigInt(Le.amount),0n)},Ie=ze(we,u.currency0),Ce=ze(we,u.currency1);if(Ie<0n||Ce<0n||Ie>W||Ce>Y||Ie===0n&&Ce===0n&&a===void 0)throw new o("Invalid simulated v4 mint spend. Refresh the liquidity preview.");let Ln=Ne(we.changes,e.formatAmount),qe=ln(u,j),je=[...!H(u.currency0)&&W>0n?[h.symbol]:[],...!H(u.currency1)&&Y>0n?[g.symbol]:[]],Tn=Se.length,Mn=a===void 0?`This deposit takes ${Tn} approvals in a row: ${je.length?`let Permit2 use your ${je.join(" and ")}, let the Uniswap position manager use it through Permit2, then the deposit`:"the deposit"}. `:"",be=m>Number(me)?`You chose ${m/100}% room for price movement. Oak will approve up to ${e.formatAmount(W.toString(),h.decimals)} ${h.symbol} and ${e.formatAmount(Y.toString(),g.decimals)} ${g.symbol}, more than the expected ${e.formatAmount(ee.toString(),h.decimals)} and ${e.formatAmount(ne.toString(),g.decimals)}. Anything not used stays in your wallet, and any leftover permission is cancelled after the deposit.`:void 0;return{txs:Se,preview:we,poolId:b,poolKey:u,tickLower:v,tickUpper:x,liquidity:E.toString(),amount0Max:{token:h,amount:A.toString()},amount1Max:{token:g,amount:I.toString()},dynamicFee:qe.dynamicFee,swapsAreFree:qe.swapsAreFree,...a===void 0?{mintTerms:{amount0Max:W.toString(),amount1Max:Y.toString(),deadline:O.toString(),permit2Expiration:N.toString(),slippageBps:m.toString(),liquidity:E.toString()}}:{},...be?{warnings:[be]}:{},action:a!==void 0?"increase":C?"createAndMint":"mint",...a!==void 0?{tokenId:a.toString()}:{},...C?{poolCreated:!0,sqrtPriceX96:C.sqrtPriceX96.toString(),initialPrice:he(C.sqrtPriceX96,h.decimals,g.decimals),initialTick:_e(C.sqrtPriceX96),priceCheck:C.note}:{},summary:`${Mn}${a!==void 0?`Increase Uniswap v4 position #${a}`:C?"Create Uniswap v4 pool and add first liquidity":"Add Uniswap v4 liquidity"} (${E} L, ticks [${v}, ${x}]) on pool ${b}. Preview deltas: ${Ln.join(", ")||"none"}. A partial spend can leave ERC-20 and Permit2 allowances equal to grant minus spent, bounded by your caps. Use oak_cleanup_allowances to revoke remaining allowances. ${qe.feeNote}${be?` ${be}`:""}${C?` ${C.note}`:""}`}}},{name:"uniswap_collect",inputSchema:at,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=K(String(t.tokenId??""));if(a<=0n)throw new o("Provide a positive v4 position tokenId.");let p=e.clientFor(y),l=t.recipient!==void 0?String(t.recipient):d;if(T(l),w(l)!==w(d))throw new o("Uniswap recipient must be the signing wallet.");let m=await Ke(p,t.deadline,t.now),f=t.amount0Min!==void 0?Z(t.amount0Min,"amount0Min"):0n,P=t.amount1Min!==void 0?Z(t.amount1Min,"amount1Min"):0n;if(f>J||P>J)throw new o("amount0Min and amount1Min must fit in uint128.");let b=typeof t.hookData=="string"?t.hookData:"0x",{poolKey:u,poolId:v}=await Pe(p,a,t),[x,h]=await Promise.all([B(p,u.currency0,y),B(p,u.currency1,y)]),g=S(ge,[a,0n,f,P,b]),A=S(De,[u.currency0.toLowerCase(),u.currency1.toLowerCase(),l.toLowerCase()]),I=S(ue,["0x0111",[g,A]]),F=re({abi:X,functionName:"modifyLiquidities",args:[I,m]}),_=[e.unsignedTx({to:M.toLowerCase(),data:F,value:"0",chainId:y,description:`Collect Uniswap v4 fees from position #${a} to ${l}.`})],j=await e.preview(_,d),C=Ne(j.changes,e.formatAmount);return{txs:_,preview:j,tokenId:a.toString(),poolId:v,recipient:l,currencies:[x,h],summary:`Collect Uniswap v4 fees for position #${a} (actions 0x0111). Preview deltas: ${C.join(", ")||"0"}.`}}},{name:"uniswap_remove",inputSchema:ct,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=K(String(t.tokenId??""));if(a<=0n)throw new o("Provide a positive v4 position tokenId.");let p=e.clientFor(y),l=t.recipient!==void 0?String(t.recipient):d;if(T(l),w(l)!==w(d))throw new o("Uniswap recipient must be the signing wallet.");let m=await Ke(p,t.deadline,t.now),{poolKey:f,poolId:P}=await Pe(p,a,t),[b,u]=await Promise.all([B(p,f.currency0,y),B(p,f.currency1,y)]),v=t.slippageBps??Te;if(typeof v!="number")throw new o("Slippage must be an integer from 0 to 9999 bps.");Me("0",v);let x=typeof t.hookData=="string"?t.hookData:"0x",h=t.fullExit===!0||t.burn===!0||t.liquidity==="all";if(!h&&t.liquidity===void 0)throw new o('Provide a liquidity amount or explicitly choose liquidity "all" for a full exit.');let g=t.liquidity===void 0||t.liquidity==="all"?void 0:Z(t.liquidity,"liquidity");if(g!==void 0&&(g<0n||g===0n&&!h||g>J))throw new o("Provide positive liquidity within uint128 for v4 removal.");let A;try{A=BigInt(await p.readContract({address:M,abi:X,functionName:"getPositionLiquidity",args:[a]}))}catch($){throw new o(`Could not read v4 position liquidity. ${oe($)}`)}if(A<0n||A===0n&&!h||g!==void 0&&g>A)throw new o("Removal requires a nonempty position and cannot exceed its liquidity.");if(h&&g!==void 0&&g!==A)throw new o("A full burn must match the position liquidity; omit the amount when explicitly choosing all.");let I=h?"0x0311":"0x0111",F=($,U,O)=>{let te=h?S(Zn,[a,$,U,x]):S(ge,[a,g,$,U,x]),N=S(De,[f.currency0,f.currency1,O]);return e.unsignedTx({to:M.toLowerCase(),data:re({abi:X,functionName:"modifyLiquidities",args:[S(ue,[I,[te,N]]),m]}),value:"0",chainId:y,description:`${h?"Burn and exit":"Decrease"} Uniswap v4 position #${a} (${I}).`})},_=0n,j=0n;if(A>0n&&(t.amount0Min===void 0||t.amount1Min===void 0)){let $=e.unsignedTx({to:M.toLowerCase(),data:re({abi:X,functionName:"modifyLiquidities",args:[S(ue,["0x0111",[S(ge,[a,0n,0n,0n,x]),S(De,[f.currency0,f.currency1,M])]]),m]}),value:"0",chainId:y,description:"Simulation only: separate fees from removal principal."}),U=await e.preview([$,F(2n,2n,d)],d),O=te=>U.changes.reduce((N,ie)=>ie.token.chainId===y&&ie.token.address.toLowerCase()===te.address.toLowerCase()?N+BigInt(ie.amount):N,0n);if(_=O(b),j=O(u),_<0n||j<0n)throw new o("Removal simulation did not return the expected currencies.")}let C=($,U)=>{if($!==void 0&&Z($,U)!==0n)throw new o(`${U} must be zero for an empty position burn.`);return 0n},E=A===0n?C(t.amount0Min,"amount0Min"):hn(t.amount0Min,_,v,"amount0Min"),ee=A===0n?C(t.amount1Min,"amount1Min"):hn(t.amount1Min,j,v,"amount1Min"),ne=[F(E,ee,l)],W=await e.preview(ne,d),Y=Ne(W.changes,e.formatAmount);return{txs:ne,preview:W,action:I,tokenId:a.toString(),poolId:P,amount0Min:{token:b,amount:E.toString()},amount1Min:{token:u,amount:ee.toString()},summary:`${h?"Full exit":"Partial remove"} Uniswap v4 position #${a} (${I})${h?`; burns position #${a} at ${M}`:""}. Preview deltas: ${Y.join(", ")||"none"}.`}}},{name:"uniswap_list_positions",inputSchema:dt,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');let a=Array.isArray(t.tokenIds)?t.tokenIds:void 0,p=t.includeZero===!0,l=t.wallet===void 0?w(d):ot(t.wallet),m=await gn(e,l,{tokenIds:a,includeZero:p});return{version:"v4",positions:m,summary:`Found ${m.length} active Uniswap v4 position(s) for ${l}.`}}},{name:"uniswap_create_pool",inputSchema:st,async execute(t,d){if(T(d),t.version!==void 0&&t.version!=="v4")throw new o('Uniswap v4 part only handles version "v4".');kn(t);let a=e.clientFor(y),{poolId:p,poolKey:l}=await Be(a,t),[m,f]=await Promise.all([B(a,l.currency0,y),B(a,l.currency1,y)]),P=await a.readContract({address:le,abi:fe,functionName:"getSlot0",args:[p]});if(BigInt(P[0])>0n)throw new o(`Uniswap v4 pool ${p} already exists. Use uniswap_add to provide liquidity.`);let b=Pn(t,m.decimals,f.decimals),u=Ue(b,await vn(a,l),t.acceptPriceDeviation===!0,m.decimals,f.decimals),v=he(b,m.decimals,f.decimals),x=[xn(e,l,p,b,m,f)],h=await e.preview(x,d),g=ln(l,l.fee);return{txs:x,preview:h,poolId:p,poolKey:l,sqrtPriceX96:b.toString(),initialPrice:v,initialTick:_e(b),priceCheck:u,action:"createPool",summary:`${x[0].description} The pool starts empty: nothing trades until liquidity is added with uniswap_add. ${g.feeNote} ${u}`}}}],positions:t=>gn(e,t)}),St=pt;export{Vn as a,M as b,le as c,He as d,At as e,se as f,D as g,k as h,Xe as i,Fe as j,ve as k,Xn as l,Ve as m,Oe as n,Re as o,Sn as p,On as q,Rn as r,H as s,ye as t,In as u,ln as v,ke as w,et as x,nt as y,mn as z,tt as A,Cn as B,it as C,Ne as D,bn as E,B as F,Pe as G,gn as H,rt as I,st as J,at as K,ct as L,dt as M,vn as N,pt as O,St as P};
|
|
@@ -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};
|