@oakagentkit/core 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/api/amounts.d.ts +2 -0
- package/build/dist/api/amounts.js +1 -1
- package/build/dist/api/args.js +1 -1
- package/build/dist/api/gas.js +1 -1
- package/build/dist/api/grandfather.js +1 -1
- package/build/dist/api/guards.js +1 -1
- package/build/dist/api/history.js +1 -1
- package/build/dist/api/http.js +1 -1
- package/build/dist/api/merkle.js +1 -1
- package/build/dist/api/module.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 +149 -0
- package/build/dist/api/modules/borro/abi.js +1 -0
- package/build/dist/api/modules/borro/actions.d.ts +2 -0
- package/build/dist/api/modules/borro/actions.js +1 -0
- package/build/dist/api/modules/borro/checks.d.ts +151 -0
- package/build/dist/api/modules/borro/checks.js +1 -0
- package/build/dist/api/modules/borro/copy.d.ts +174 -0
- package/build/dist/api/modules/borro/copy.js +1 -0
- package/build/dist/api/modules/borro/index.d.ts +13 -0
- package/build/dist/api/modules/borro/index.js +1 -0
- package/build/dist/api/modules/borro/liquidity.d.ts +4 -0
- package/build/dist/api/modules/borro/liquidity.js +1 -0
- package/build/dist/api/modules/borro/pins.d.ts +264 -0
- package/build/dist/api/modules/borro/pins.js +1 -0
- package/build/dist/api/modules/borro/positions.d.ts +8 -0
- package/build/dist/api/modules/borro/positions.js +1 -0
- package/build/dist/api/modules/borro/rates.d.ts +20 -0
- package/build/dist/api/modules/borro/rates.js +1 -0
- package/build/dist/api/modules/borro/reader.d.ts +36 -0
- package/build/dist/api/modules/borro/reader.js +1 -0
- package/build/dist/api/modules/borro/types.d.ts +126 -0
- package/build/dist/api/modules/borro/types.js +0 -0
- package/build/dist/api/modules/chop/abi.d.ts +527 -0
- package/build/dist/api/modules/chop/abi.js +1 -0
- package/build/dist/api/modules/chop/actions.d.ts +24 -0
- package/build/dist/api/modules/chop/actions.js +1 -0
- package/build/dist/api/modules/chop/checks.d.ts +26 -0
- package/build/dist/api/modules/chop/checks.js +1 -0
- package/build/dist/api/modules/chop/copy.d.ts +5 -0
- package/build/dist/api/modules/chop/copy.js +1 -0
- package/build/dist/api/modules/chop/guard.d.ts +13 -0
- package/build/dist/api/modules/chop/guard.js +1 -0
- package/build/dist/api/modules/chop/index.d.ts +3 -0
- package/build/dist/api/modules/chop/index.js +1 -0
- package/build/dist/api/modules/chop/pins.d.ts +53 -0
- package/build/dist/api/modules/chop/pins.js +1 -0
- package/build/dist/api/modules/chop/positions.d.ts +3 -0
- package/build/dist/api/modules/chop/positions.js +1 -0
- package/build/dist/api/modules/chop/reader.d.ts +70 -0
- package/build/dist/api/modules/chop/reader.js +1 -0
- package/build/dist/api/modules/chop/types.d.ts +32 -0
- package/build/dist/api/modules/chop/types.js +0 -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.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 +2 -2
- package/build/dist/api/modules/earn/copy.js +1 -1
- package/build/dist/api/modules/earn/index.js +1 -1
- package/build/dist/api/modules/earn/lp.js +1 -1
- package/build/dist/api/modules/earn/options.js +1 -1
- package/build/dist/api/modules/erc8004/common.js +1 -1
- package/build/dist/api/modules/erc8004/domain.js +1 -1
- package/build/dist/api/modules/erc8004/index.js +1 -1
- package/build/dist/api/modules/erc8004/management.js +1 -1
- package/build/dist/api/modules/erc8004/reputation.js +1 -1
- package/build/dist/api/modules/erc8004/services.js +1 -1
- package/build/dist/api/modules/erc8004/validation.js +1 -1
- package/build/dist/api/modules/gloam/abi.d.ts +89 -0
- package/build/dist/api/modules/gloam/abi.js +1 -0
- package/build/dist/api/modules/gloam/actions.d.ts +5 -0
- package/build/dist/api/modules/gloam/actions.js +1 -0
- package/build/dist/api/modules/gloam/checks.d.ts +17 -0
- package/build/dist/api/modules/gloam/checks.js +1 -0
- package/build/dist/api/modules/gloam/copy.d.ts +22 -0
- package/build/dist/api/modules/gloam/copy.js +2 -0
- package/build/dist/api/modules/gloam/index.d.ts +6 -0
- package/build/dist/api/modules/gloam/index.js +1 -0
- package/build/dist/api/modules/gloam/pins.d.ts +41 -0
- package/build/dist/api/modules/gloam/pins.js +1 -0
- package/build/dist/api/modules/gloam/types.d.ts +308 -0
- package/build/dist/api/modules/gloam/types.js +1 -0
- 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/proof-reads.js +1 -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/token-facts.js +1 -1
- package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
- package/build/dist/api/modules/hoodag/index.js +1 -1
- package/build/dist/api/modules/hoodag/management.js +1 -1
- package/build/dist/api/modules/hoodag/public-reads.js +1 -1
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/commerce.js +1 -1
- package/build/dist/api/modules/hoodlock/fee.js +1 -1
- package/build/dist/api/modules/hoodlock/guard.js +1 -1
- package/build/dist/api/modules/hoodlock/index.js +1 -1
- package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
- package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
- package/build/dist/api/modules/hoodlock/public.js +1 -1
- package/build/dist/api/modules/hookr/actions.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/contracts.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.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/read-utils.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/hookr/revenue.js +1 -1
- package/build/dist/api/modules/kyberswap/index.js +1 -1
- package/build/dist/api/modules/kyberswap/source-pools.js +1 -1
- package/build/dist/api/modules/layerbank/actions.js +1 -1
- package/build/dist/api/modules/layerbank/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-common.js +1 -1
- package/build/dist/api/modules/meridian/perps-guards.js +1 -1
- package/build/dist/api/modules/meridian/perps-intents.js +1 -1
- package/build/dist/api/modules/meridian/perps-stream.js +1 -1
- package/build/dist/api/modules/meridian/perps.d.ts +1 -0
- 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.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.js +1 -1
- package/build/dist/api/modules/netnet/financial.js +1 -1
- package/build/dist/api/modules/netnet/index.js +1 -1
- package/build/dist/api/modules/netnet/staking.js +1 -1
- package/build/dist/api/modules/orbio/gateway.js +1 -1
- package/build/dist/api/modules/orbio/index.js +1 -1
- package/build/dist/api/modules/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/types.d.ts +16 -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.d.ts +1 -0
- package/build/dist/api/modules/pons/launch-status.js +1 -1
- package/build/dist/api/modules/pons/prices.js +1 -1
- package/build/dist/api/modules/pons/reads.js +1 -1
- package/build/dist/api/modules/pons/swap-terms.js +1 -1
- package/build/dist/api/modules/pons/trade.js +1 -1
- package/build/dist/api/modules/poolstrade/index.js +1 -1
- package/build/dist/api/modules/priors/coverage.js +1 -1
- package/build/dist/api/modules/priors/discovery.js +1 -1
- package/build/dist/api/modules/priors/features.js +1 -1
- package/build/dist/api/modules/priors/holdings.js +1 -1
- package/build/dist/api/modules/priors/index.js +1 -1
- package/build/dist/api/modules/priors/integration.js +1 -1
- package/build/dist/api/modules/priors/market.js +1 -1
- package/build/dist/api/modules/priors/pt.js +1 -1
- package/build/dist/api/modules/priors/savings-exit.js +1 -1
- package/build/dist/api/modules/priors/starter-line.js +1 -1
- package/build/dist/api/modules/priors/stock-swap.js +1 -1
- package/build/dist/api/modules/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.d.ts +2 -0
- package/build/dist/api/modules/relay/inbound.js +1 -1
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/order.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- 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/exit-preview.js +1 -1
- package/build/dist/api/modules/tickerspring/guards.js +1 -1
- package/build/dist/api/modules/tickerspring/index.js +1 -1
- package/build/dist/api/modules/tickerspring/journeys.js +1 -1
- package/build/dist/api/modules/tickerspring/ladder.js +1 -1
- package/build/dist/api/modules/tickerspring/maker.js +1 -1
- package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
- package/build/dist/api/modules/tickerspring/research.js +1 -1
- package/build/dist/api/modules/tickerspring/strategies.js +1 -1
- package/build/dist/api/modules/uniswap/auction-create.js +1 -1
- package/build/dist/api/modules/uniswap/auction.js +1 -1
- package/build/dist/api/modules/uniswap/batch.js +1 -1
- package/build/dist/api/modules/uniswap/common.js +1 -1
- package/build/dist/api/modules/uniswap/fees.js +1 -1
- package/build/dist/api/modules/uniswap/index.js +1 -1
- package/build/dist/api/modules/uniswap/local-guard.js +1 -1
- package/build/dist/api/modules/uniswap/oracle.js +1 -1
- package/build/dist/api/modules/uniswap/pool-math.js +1 -1
- package/build/dist/api/modules/uniswap/pools.js +1 -1
- package/build/dist/api/modules/uniswap/position.js +1 -1
- package/build/dist/api/modules/uniswap/protocol.js +1 -1
- package/build/dist/api/modules/uniswap/token-jar.js +1 -1
- package/build/dist/api/modules/uniswap/trade-batch.js +1 -1
- package/build/dist/api/modules/uniswap/trade.js +1 -1
- package/build/dist/api/modules/uniswap/v2.js +1 -1
- package/build/dist/api/modules/uniswap/v3.d.ts +11 -1
- package/build/dist/api/modules/uniswap/v3.js +1 -1
- package/build/dist/api/modules/uniswap/v4.js +1 -1
- package/build/dist/api/modules/uniswap/wrap.js +1 -1
- package/build/dist/api/modules/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.d.ts +3 -0
- 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.d.ts +11 -0
- package/build/dist/api/modules/wormhole/swap-token-verdict.js +1 -0
- package/build/dist/api/modules/wormhole/third-party-text.d.ts +13 -0
- package/build/dist/api/modules/wormhole/third-party-text.js +1 -0
- package/build/dist/api/modules/wormhole/token-check.d.ts +2 -0
- package/build/dist/api/modules/wormhole/token-check.js +1 -1
- package/build/dist/api/modules/wormhole/x402-client.d.ts +36 -0
- package/build/dist/api/modules/wormhole/x402-client.js +1 -0
- package/build/dist/api/positions.js +1 -1
- package/build/dist/api/pricenote.js +1 -1
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/pricing.js +1 -1
- package/build/dist/api/routes.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/tokens.d.ts +1 -0
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/tool-policy.js +1 -1
- package/build/dist/api/tx.js +1 -1
- package/build/dist/api/types.d.ts +6 -1
- package/build/dist/api/vendor-limits.js +1 -1
- package/build/dist/chunks/{ALRRW7SF.js → 2MT3G7YZ.js} +1 -1
- package/build/dist/chunks/{WPAF55SP.js → 2THSW4QN.js} +1 -1
- package/build/dist/chunks/{MKAPRRKF.js → 2TK3ETUO.js} +1 -1
- package/build/dist/chunks/{VVA72C6O.js → 2VXLVXIB.js} +1 -1
- package/build/dist/chunks/{ZE7EU2CS.js → 35KR3VSS.js} +1 -1
- package/build/dist/chunks/{ZYH4B2GR.js → 3GQ7A3VB.js} +1 -1
- package/build/dist/chunks/3VWVW7PX.js +1 -0
- package/build/dist/chunks/{WPFAEBE7.js → 3XNZUIRU.js} +1 -1
- package/build/dist/chunks/{PBQSJSZO.js → 43LI5NKJ.js} +1 -1
- package/build/dist/chunks/{QVYCJ6WV.js → 46KWRAYK.js} +1 -1
- package/build/dist/chunks/4DP2VPXR.js +3 -0
- package/build/dist/chunks/{47YN4OUI.js → 4EN6MQEI.js} +1 -1
- package/build/dist/chunks/{UHRCM7AG.js → 4HG6FRVH.js} +1 -1
- package/build/dist/chunks/{E6UU7DL2.js → 4I3OU56B.js} +1 -1
- package/build/dist/chunks/{WIVYKLQM.js → 52ELWNXJ.js} +1 -1
- package/build/dist/chunks/{5WUKOQIJ.js → 5AXWBSPG.js} +1 -1
- package/build/dist/chunks/{D6ZJPNK7.js → 5N3O42X6.js} +1 -1
- package/build/dist/chunks/{UA4O226F.js → 5SMVQCAP.js} +1 -1
- package/build/dist/chunks/{6L5KTE6Y.js → 5SZPNZG4.js} +1 -1
- package/build/dist/chunks/{6PY3IRDS.js → 64GOINYS.js} +1 -1
- package/build/dist/chunks/{5ZLOCQA4.js → 66F5ZH34.js} +1 -1
- package/build/dist/chunks/{XDZRO5JQ.js → 6I4NTKB2.js} +1 -1
- package/build/dist/chunks/{LVLVP5KQ.js → 6JAXZNZ3.js} +1 -1
- package/build/dist/chunks/{BXHNYCH2.js → 6O3Q5B6M.js} +1 -1
- package/build/dist/chunks/{MFCPL6LF.js → 6OGDTEGH.js} +1 -1
- package/build/dist/chunks/{43CSMYDO.js → 6WD4HHID.js} +1 -1
- package/build/dist/chunks/{XJEOEMDS.js → 6WZX7C4T.js} +1 -1
- package/build/dist/chunks/6YB3VOUL.js +1 -0
- package/build/dist/chunks/77CLMPM7.js +1 -0
- package/build/dist/chunks/{EKNSLLJK.js → 7GJ6SLEV.js} +1 -1
- package/build/dist/chunks/{S2TAJHHK.js → 7KWZ5QJU.js} +1 -1
- package/build/dist/chunks/{CTMA4BTM.js → 7QIO77VE.js} +1 -1
- package/build/dist/chunks/7QZOTRSA.js +2 -0
- package/build/dist/chunks/{IKEJCBYU.js → 7WSHW7KW.js} +1 -1
- package/build/dist/chunks/{PQC5635W.js → A7I4IWUB.js} +1 -1
- package/build/dist/chunks/ACW63WIL.js +20 -0
- package/build/dist/chunks/AEL62KCG.js +1 -0
- package/build/dist/chunks/{UPMGGK34.js → AFBEZXNV.js} +1 -1
- package/build/dist/chunks/{AUOXDNUO.js → AKYF5264.js} +1 -1
- package/build/dist/chunks/{HVM2EEXB.js → ALLLYOUG.js} +1 -1
- package/build/dist/chunks/APQYLJGS.js +1 -0
- package/build/dist/chunks/AW7AXQCZ.js +1 -0
- package/build/dist/chunks/{WOEKXQAH.js → AXRL3REN.js} +1 -1
- package/build/dist/chunks/{ECWGKLBW.js → BBTPRZ6T.js} +1 -1
- package/build/dist/chunks/{ALPYEM7B.js → BND2UFVW.js} +1 -1
- package/build/dist/chunks/{GHPREYQK.js → BOVMED7R.js} +1 -1
- package/build/dist/chunks/{57JFKIMK.js → BTPXJAUX.js} +1 -1
- package/build/dist/chunks/{ZGKVXFM5.js → C7AXJHBT.js} +1 -1
- package/build/dist/chunks/{5U7TCKX2.js → CBG5HARQ.js} +1 -1
- package/build/dist/chunks/{NA7R6J5N.js → CBLMQ5UU.js} +1 -1
- package/build/dist/chunks/CDPSMI3Z.js +1 -0
- package/build/dist/chunks/{5N4A5XAW.js → CHXBOXOD.js} +1 -1
- package/build/dist/chunks/{2ZUP7ZEV.js → CQEJSCFQ.js} +1 -1
- package/build/dist/chunks/{6AAARNZ3.js → DBNTZEAJ.js} +1 -1
- package/build/dist/chunks/{IQIWASRD.js → DHUDSOGR.js} +1 -1
- package/build/dist/chunks/{L7OQUHM5.js → DJN3JAWB.js} +1 -1
- package/build/dist/chunks/{YPM2UITD.js → DL6AEWEM.js} +1 -1
- package/build/dist/chunks/{CERNEJ2F.js → DW4V5PUY.js} +1 -1
- package/build/dist/chunks/E3RACZUY.js +1 -0
- package/build/dist/chunks/{MOPETB64.js → EGYVRQUR.js} +1 -1
- package/build/dist/chunks/{IQGY5FW7.js → ER47KGRM.js} +1 -1
- package/build/dist/chunks/{ZSQOMSOC.js → FEYAY6OZ.js} +1 -1
- package/build/dist/chunks/FIO6VC2J.js +1 -0
- package/build/dist/chunks/FJ4S4GHY.js +1 -0
- package/build/dist/chunks/{RPNAFUM5.js → FUDAXV5X.js} +1 -1
- package/build/dist/chunks/{I6KUORFT.js → GG6Y4OCJ.js} +1 -1
- package/build/dist/chunks/{3AXVB23N.js → GGHBFLRC.js} +1 -1
- package/build/dist/chunks/{4ALMYJJV.js → GGSAKCND.js} +1 -1
- package/build/dist/chunks/GNC6RXLT.js +1 -0
- package/build/dist/chunks/{3ESNHZT5.js → GRQYTVNT.js} +1 -1
- package/build/dist/chunks/{WVONJOWN.js → GSBIERZD.js} +1 -1
- package/build/dist/chunks/H43RNCX2.js +1 -0
- package/build/dist/chunks/{NYNJITCM.js → H6T5FXEX.js} +1 -1
- package/build/dist/chunks/HHXBUYHO.js +1 -0
- package/build/dist/chunks/{64WKYWZV.js → HKEMQBFA.js} +1 -1
- package/build/dist/chunks/{4YFVAYKR.js → HM72DH4V.js} +1 -1
- package/build/dist/chunks/{XFKVU46U.js → HQUVB7Z5.js} +1 -1
- package/build/dist/chunks/HS4DZPYT.js +1 -0
- package/build/dist/chunks/{OTIXQZ3X.js → HU7IMNBI.js} +1 -1
- package/build/dist/chunks/{ENX72ARB.js → HWX36XJI.js} +1 -1
- package/build/dist/chunks/{QRC4ZPDA.js → I26DMNJG.js} +1 -1
- package/build/dist/chunks/I55MURSJ.js +1 -0
- package/build/dist/chunks/I6PQW2JI.js +1 -0
- package/build/dist/chunks/{S3FPF537.js → IMO3GDA5.js} +1 -1
- package/build/dist/chunks/{BQICZFLR.js → IOYRL6AY.js} +1 -1
- package/build/dist/chunks/IPN6Z4JM.js +1 -0
- package/build/dist/chunks/{MKBNLGDD.js → IPRVIKYC.js} +1 -1
- package/build/dist/chunks/{EOQYLFXA.js → IVX4R5OL.js} +1 -1
- package/build/dist/chunks/IX3GZMTM.js +1 -0
- package/build/dist/chunks/JFYBH3DX.js +1 -0
- package/build/dist/chunks/{Y7RPSDD2.js → JKD2B6OX.js} +1 -1
- package/build/dist/chunks/JQOQMFWD.js +3 -0
- package/build/dist/chunks/{PSVOVZH7.js → JUZ5JU6D.js} +5 -5
- package/build/dist/chunks/{I4TGMF2C.js → JZS3E66E.js} +1 -1
- package/build/dist/chunks/{SSIENQVU.js → K3RDPI5J.js} +1 -1
- package/build/dist/chunks/{PADWZX7J.js → K4DHHQBI.js} +1 -1
- package/build/dist/chunks/{NB3LYS3G.js → KIFZ5ZSK.js} +1 -1
- package/build/dist/chunks/KVFZKPJT.js +1 -0
- package/build/dist/chunks/{EYFBVQ46.js → L5BLHY34.js} +1 -1
- package/build/dist/chunks/{GVPX5XCL.js → LKXO2BQS.js} +1 -1
- package/build/dist/chunks/{JPNYUEQP.js → LKZX4CAA.js} +1 -1
- package/build/dist/chunks/{LROVANUR.js → LYMNHO5T.js} +1 -1
- package/build/dist/chunks/{QSN6Y2K6.js → M2UXYCKH.js} +1 -1
- package/build/dist/chunks/{BNG2IWZL.js → M37654RL.js} +1 -1
- package/build/dist/chunks/{YAJYDD6C.js → M6LC6DRE.js} +1 -1
- package/build/dist/chunks/{AG67Z3SC.js → MOE3EVAL.js} +1 -1
- package/build/dist/chunks/{DVVFT42J.js → MRMR4QHA.js} +1 -1
- package/build/dist/chunks/{WWHCEMNB.js → N4Q6GN65.js} +1 -1
- package/build/dist/chunks/{S5WICHIS.js → NAZPDRIF.js} +1 -1
- package/build/dist/chunks/{HSFOWJ3Z.js → NKZKKCK2.js} +1 -1
- package/build/dist/chunks/{BAAXGB4K.js → NOFUKKP5.js} +1 -1
- package/build/dist/chunks/{5KUWLUPM.js → NWNYJ26T.js} +1 -1
- package/build/dist/chunks/{7UOOIDR3.js → O6ROOKY2.js} +1 -1
- package/build/dist/chunks/{KBXU7U6Q.js → O7HCEPQY.js} +1 -1
- package/build/dist/chunks/{LDT3QTSY.js → OJ4WJUPP.js} +1 -1
- package/build/dist/chunks/{WD37MEMZ.js → OLSP46ZD.js} +1 -1
- package/build/dist/chunks/{TPL4U3AQ.js → OOZSE2R7.js} +1 -1
- package/build/dist/chunks/OTXSKFUD.js +1 -0
- package/build/dist/chunks/{4TQQH7N6.js → P5AJSLZ7.js} +1 -1
- package/build/dist/chunks/{BK23XJXE.js → P5PYFK7L.js} +1 -1
- package/build/dist/chunks/{A6YQ5H24.js → PACN53TR.js} +1 -1
- package/build/dist/chunks/{K72EYD6R.js → PAHXBLCS.js} +1 -1
- package/build/dist/chunks/PAY5PD4H.js +1 -0
- package/build/dist/chunks/{SGEZIYJW.js → PIIHOXWF.js} +1 -1
- package/build/dist/chunks/{SQL6HD5E.js → PK66GCDT.js} +1 -1
- package/build/dist/chunks/PNA6UIE5.js +1 -0
- package/build/dist/chunks/{6FTYNYGF.js → PSBQWDYI.js} +1 -1
- package/build/dist/chunks/{W76QC2AW.js → PV5FDT6O.js} +1 -1
- package/build/dist/chunks/{42DQTKEO.js → PXT5YTWU.js} +1 -1
- package/build/dist/chunks/{4ISR2U72.js → PZGGE5D3.js} +1 -1
- package/build/dist/chunks/{IMRXZ7JB.js → Q42YI3EP.js} +1 -1
- package/build/dist/chunks/{F3BSEE52.js → QA2RRIES.js} +1 -1
- package/build/dist/chunks/{ZBFKKUNP.js → QA3UHEO3.js} +1 -1
- package/build/dist/chunks/{PWH464CJ.js → QBIY6FQN.js} +1 -1
- package/build/dist/chunks/QFNT73OF.js +1 -0
- package/build/dist/chunks/QHBS3PVU.js +1 -0
- package/build/dist/chunks/QQECG3WP.js +1 -0
- package/build/dist/chunks/{RVO3QK2B.js → QU5XKRGK.js} +1 -1
- package/build/dist/chunks/QW2OPEYJ.js +1 -0
- package/build/dist/chunks/{G7XSFUDL.js → QYVREJYC.js} +1 -1
- package/build/dist/chunks/{KA7BPBCV.js → ROFPXEQ5.js} +1 -1
- package/build/dist/chunks/{5MQ5KSSV.js → RTAHNWHN.js} +1 -1
- package/build/dist/chunks/{MDDHG34Y.js → RTGS7RIO.js} +1 -1
- package/build/dist/chunks/{3WXK2FUA.js → RUC7KH7A.js} +1 -1
- package/build/dist/chunks/{MBTARLZQ.js → RUX3RY7Y.js} +1 -1
- package/build/dist/chunks/{3VAJW6TQ.js → RVDUSNWW.js} +1 -1
- package/build/dist/chunks/{ET23SES4.js → S5CBVFHY.js} +1 -1
- package/build/dist/chunks/{WMNRP3YH.js → SIYUNOLI.js} +1 -1
- package/build/dist/chunks/{TNKVRVTH.js → SJJR4ZBZ.js} +1 -1
- package/build/dist/chunks/{UFVPMWPJ.js → SMYWWIE6.js} +1 -1
- package/build/dist/chunks/{Z4SRGAVL.js → SPJCSEKP.js} +1 -1
- package/build/dist/chunks/{YEXUSRIZ.js → T7TFUH5K.js} +1 -1
- package/build/dist/chunks/{SKMPKAZI.js → TAEZTP4L.js} +1 -1
- package/build/dist/chunks/{E3UBHTJO.js → TEJ7W534.js} +1 -1
- package/build/dist/chunks/{AWXJV2YH.js → TFDPEAVZ.js} +1 -1
- package/build/dist/chunks/{UOGHQLQX.js → TMVO2DAK.js} +1 -1
- package/build/dist/chunks/{QJFXLYZG.js → TPBAFS7K.js} +1 -1
- package/build/dist/chunks/{MXW2TP5P.js → TVWMTMEF.js} +1 -1
- package/build/dist/chunks/{GRIGSPD4.js → TX2EOIRS.js} +1 -1
- package/build/dist/chunks/{Y7PRJOIK.js → U2RMUVVY.js} +1 -1
- package/build/dist/chunks/{VV2HEIFI.js → U5PMVP56.js} +1 -1
- package/build/dist/chunks/{TBCSZDAF.js → UD2XMNIT.js} +1 -1
- package/build/dist/chunks/{F26FK47J.js → UNJJRQIU.js} +1 -1
- package/build/dist/chunks/V5JWGWXC.js +1 -0
- package/build/dist/chunks/V74F6IDY.js +1 -0
- package/build/dist/chunks/VCOTCVKN.js +1 -0
- package/build/dist/chunks/{MYFAKCQI.js → VEQBHI6O.js} +1 -1
- package/build/dist/chunks/VHV6WQ5F.js +1 -0
- package/build/dist/chunks/{7WQEPZJY.js → VNV6ZISN.js} +1 -1
- package/build/dist/chunks/{W2OJ57ZO.js → VYAJXLND.js} +1 -1
- package/build/dist/chunks/{MDV7GECM.js → VYYSL557.js} +1 -1
- package/build/dist/chunks/WCNHZYQQ.js +1 -0
- package/build/dist/chunks/{K22EXPWN.js → WIRBCS4W.js} +1 -1
- package/build/dist/chunks/{YRXT3HTW.js → WLMWWEP7.js} +1 -1
- package/build/dist/chunks/{NDW5DAFL.js → WP6RHXGN.js} +1 -1
- package/build/dist/chunks/{PLZKXQ76.js → WTXC3XKW.js} +1 -1
- package/build/dist/chunks/{WGL46F3S.js → WU7XIAXB.js} +1 -1
- package/build/dist/chunks/{5OKJEGBH.js → WV3A3OUU.js} +1 -1
- package/build/dist/chunks/{MGPHD4VV.js → X2P55AC3.js} +1 -1
- package/build/dist/chunks/{RNC463IM.js → XBE3B6Y2.js} +1 -1
- package/build/dist/chunks/XD6X3KTC.js +1 -0
- package/build/dist/chunks/{BIRMUW7Z.js → XKSVTN5X.js} +1 -1
- package/build/dist/chunks/XL3LLGIR.js +1 -0
- package/build/dist/chunks/XQA5LCL6.js +1 -0
- package/build/dist/chunks/{SDHPFXRM.js → XSKFKBDR.js} +1 -1
- package/build/dist/chunks/{TJWVY4VO.js → YCZPSMZ5.js} +1 -1
- package/build/dist/chunks/{JZXYLHI7.js → YDNTY67T.js} +1 -1
- package/build/dist/chunks/{2DUCTO5C.js → YN56C7PN.js} +1 -1
- package/build/dist/chunks/{E6RRXNV2.js → YRNXGQJC.js} +1 -1
- package/build/dist/chunks/YWRLY5EA.js +1 -0
- package/build/dist/chunks/YWSX6IE6.js +1 -0
- package/build/dist/chunks/{DP2NIYBP.js → YXTSWRV5.js} +1 -1
- package/build/dist/chunks/{MQYOG66Q.js → Z6LZGCVW.js} +1 -1
- package/build/dist/chunks/{OFI3Y55L.js → ZQAFFWDK.js} +1 -1
- package/build/dist/chunks/{NZXQWDGF.js → ZQWZGH7V.js} +1 -1
- package/build/dist/chunks/{TBIVTEP5.js → ZSN4IRI5.js} +1 -1
- package/build/dist/chunks/{ZET37EIG.js → ZV5HIQXC.js} +1 -1
- package/build/dist/chunks/{VHLINDDS.js → ZXJ24B4L.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/24CQ2SPB.js +0 -1
- package/build/dist/chunks/2OJAOVMG.js +0 -1
- package/build/dist/chunks/65EQECL3.js +0 -1
- package/build/dist/chunks/6YYCGUCU.js +0 -1
- package/build/dist/chunks/EU3OAJU2.js +0 -1
- package/build/dist/chunks/H4NYYJ3Z.js +0 -1
- package/build/dist/chunks/HTXKERNS.js +0 -1
- package/build/dist/chunks/JG27HM4P.js +0 -1
- package/build/dist/chunks/L6D26AMO.js +0 -1
- package/build/dist/chunks/O6L4BJP4.js +0 -1
- package/build/dist/chunks/SUFA2GKR.js +0 -1
- package/build/dist/chunks/UP7FBDMJ.js +0 -1
- package/build/dist/chunks/YHRUAQQK.js +0 -1
- package/build/dist/chunks/ZCOFMGPS.js +0 -1
- package/build/dist/chunks/ZCUXM52B.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,d as N,e as h}from"./
|
|
1
|
+
import{c as v,d as N,e as h}from"./5AXWBSPG.js";import{a as m}from"./66F5ZH34.js";import{c as d,f as B,g as p,i as E}from"./NWNYJ26T.js";import{a as H}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{decodeEventLog as W,encodeFunctionData as G,getAddress as V,hashStruct as Y,isHex as J,parseAbi as Q,zeroAddress as k}from"viem";var Z="struct HookrSwapIntent { PoolKey key; bool zeroForOne; int128 amountSpecified; uint128 amountBound; uint160 sqrtPriceLimitX96; address recipient; address relayer; uint256 relayerFee; address engagement; uint256[] campaigns; uint256 nonce; uint256 deadline; }",I=Q(["struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }",Z,"function execute(HookrSwapIntent intent, address owner, bytes signature) returns (uint256 amountIn, uint256 amountOut)","function hashIntent(HookrSwapIntent intent) pure returns (bytes32)","function pullOf(HookrSwapIntent intent) view returns (address token, uint256 amount, bool feeFromInput)","function isNonceUsed(address owner, uint256 intentNonce) view returns (bool)","function router() view returns (address)","function registry() view returns (address)","function permit2() view returns (address)","event IntentExecuted(bytes32 indexed intentHash,address indexed owner,address indexed relayer,bytes32 poolId,uint256 amountIn,uint256 amountOut,uint256 relayerFee,bool feeFromInput)"]),ee={PoolKey:[{name:"currency0",type:"address"},{name:"currency1",type:"address"},{name:"fee",type:"uint24"},{name:"tickSpacing",type:"int24"},{name:"hooks",type:"address"}],HookrSwapIntent:[{name:"key",type:"PoolKey"},{name:"zeroForOne",type:"bool"},{name:"amountSpecified",type:"int128"},{name:"amountBound",type:"uint128"},{name:"sqrtPriceLimitX96",type:"uint160"},{name:"recipient",type:"address"},{name:"relayer",type:"address"},{name:"relayerFee",type:"uint256"},{name:"engagement",type:"address"},{name:"campaigns",type:"uint256[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},ne=V("0x000000000022D473030F116dDEE9F6B43aC78BA3"),F={key:{type:"object",properties:{currency0:d,currency1:d,fee:{type:"integer"},tickSpacing:{type:"integer"},hooks:d},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},zeroForOne:{type:"boolean"},amountSpecified:{type:"string",pattern:"^-?[0-9]+$"},amountBound:m(),sqrtPriceLimitX96:m(),recipient:d,relayer:d,relayerFee:m(),engagement:d,campaigns:{type:"array",items:m(),maxItems:8},nonce:m(),deadline:m()},x={owner:d,signature:{type:"string",pattern:"^0x[0-9a-fA-F]+$"},intent:{type:"object",properties:F,required:Object.keys(F),additionalProperties:!1}};function D(t){return B(t,"Provide a complete trader-signed Hookr intent.")}function y(t,i=256,e=!1){if(typeof t!="string"||!/^-?\d+$/.test(t)||t.length>79)throw new o("Hookr intent amounts, nonce and deadline must be decimal base-unit strings.");let n=BigInt(t);if(e?n<=-(1n<<BigInt(i-1))||n>=1n<<BigInt(i-1):n<0n||n>=1n<<BigInt(i))throw new o("Hookr intent integer is outside its ABI range.");return n}function l(t){return E(t,"Provide valid Hookr intent addresses.")}function j(t,i){if(Object.keys(t).some(s=>!Object.hasOwn(x,s)))throw new o("Provide only owner, intent and the trader signature for Hookr relay.");let e=D(t.intent);if(Object.keys(e).some(s=>!Object.hasOwn(F,s)))throw new o("Hookr intent contains an undocumented field.");let n=D(e.key);if(Object.keys(n).some(s=>!["currency0","currency1","fee","tickSpacing","hooks"].includes(s))||typeof n.fee!="number"||!Number.isInteger(n.fee)||n.fee<0||n.fee>16777215||typeof n.tickSpacing!="number"||!Number.isInteger(n.tickSpacing)||n.tickSpacing<=0||n.tickSpacing>8388607||typeof e.zeroForOne!="boolean")throw new o("Provide a valid canonical v4 pool key and direction.");let a={currency0:l(n.currency0),currency1:l(n.currency1),fee:n.fee,tickSpacing:n.tickSpacing,hooks:l(n.hooks)};if(BigInt(a.currency0)>=BigInt(a.currency1))throw new o("Hookr pool currencies must sort strictly by address.");let r=l(t.owner);if(r===k||p(r,i))throw new o("Hookr relay requires another trader as owner; the relayer funds gas only.");if(!Array.isArray(e.campaigns)||e.campaigns.length>8)throw new o("Provide at most eight Hookr campaign IDs.");let c={key:a,zeroForOne:e.zeroForOne,amountSpecified:y(e.amountSpecified,128,!0),amountBound:y(e.amountBound,128),sqrtPriceLimitX96:y(e.sqrtPriceLimitX96,160),recipient:l(e.recipient),relayer:l(e.relayer),relayerFee:y(e.relayerFee),engagement:l(e.engagement),campaigns:e.campaigns.map(s=>y(s)),nonce:y(e.nonce),deadline:y(e.deadline)};if(c.amountSpecified===0n||c.amountBound===0n)throw new o("Hookr intent input/output amounts and bound must be nonzero.");if([k,h,v].some(s=>p(s,c.recipient)))throw new o("Hookr intent recipient is reserved.");if(c.relayer!==k&&!p(c.relayer,i)||c.relayer===k&&c.relayerFee!==0n)throw new o("Hookr intent names a different relayer or an open relay with a fee.");if(c.engagement===k!=(c.campaigns.length===0))throw new o("Hookr engagement and campaigns must be supplied together.");let f=c.zeroForOne?a.currency0:a.currency1;if(f===k)throw new o("Hookr Permit2 relay cannot pull native ETH input.");if(typeof t.signature!="string"||!J(t.signature,{strict:!0})||t.signature.length<4||t.signature.length%2!==0||t.signature.length>16386)throw new o("Provide the trader-signed Permit2 witness signature, never a private key.");let S=t.signature,w=Y({data:c,primaryType:"HookrSwapIntent",types:ee});return{owner:r,intent:c,signature:S,input:f,intentHash:w}}function q(t,i){let{owner:e,intent:n,signature:a}=j(t,i);return{chainId:H,to:h,value:"0",data:G({abi:I,functionName:"execute",args:[n,e,a]}),description:`Relay Hookr trader ${e} to recipient ${n.recipient}; relayer fee ${n.relayerFee} in pool quote currency. Relayer pays gas; owner supplies Permit2 funds.`}}function ce(t,i,e){let n=q(i,e);if(t.length!==1||t[0].chainId!==n.chainId||!p(t[0].to,n.to)||t[0].value!=="0"||!p(t[0].data,n.data))throw new o("Hookr relay calldata differs from the locally requested signed intent.")}function ue(t){return[{name:"hookr_relay",inputSchema:{type:"object",description:"Preview a trader-signed Permit2 swap for local human-confirmed submission. Relayer pays gas; the trader supplies input. No signature is created by this tool.",properties:x,required:Object.keys(x),additionalProperties:!1},execute:async(i,e)=>{let n=j(i,e),{owner:a,intent:r,signature:c,input:f,intentHash:S}=n,w=t.clientFor(H),s=await w.getBlock();if(typeof s.number!="bigint"||typeof s.timestamp!="bigint"||s.timestamp<=0n||s.timestamp>r.deadline)throw new o("Hookr signed intent expired or the chain timestamp is unavailable.");let g=(X,M=[])=>w.readContract({address:h,abi:I,functionName:X,args:M,blockNumber:s.number}),[_,u,z,K,$,U]=await Promise.all([g("hashIntent",[r]),g("pullOf",[r]),g("isNonceUsed",[a,r.nonce]),g("router"),g("registry"),g("permit2")]);if(_!==S||z!==!1||K!==v||$!==N||U!==ne)throw new o("Hookr intent hash, nonce or forwarder deployment is invalid. Ask the trader for a fresh signed intent.");if(!Array.isArray(u)||u.length!==3||typeof u[0]!="string"||!p(u[0],f)||typeof u[1]!="bigint"||typeof u[2]!="boolean")throw new o("Hookr Permit2 pull could not be verified.");let b=u[2],P=r.amountSpecified<0n?-r.amountSpecified:r.amountBound;if(u[1]!==P+(b?r.relayerFee:0n)||r.amountSpecified>0n&&!b&&r.relayerFee>r.amountSpecified)throw new o("Hookr Permit2 pull or output-side fee differs from the signed terms.");let C=await w.simulateContract({address:h,abi:I,functionName:"execute",args:[r,a,c],account:e,blockNumber:s.number}),[A,R]=C.result,T=r.amountSpecified<0n?r.amountBound:r.amountSpecified-(b?0n:r.relayerFee);if(A>P||R<T)throw new o("Hookr relay simulation did not satisfy the signed input/output bounds.");let O=[t.unsignedTx(q(i,e))],L=await t.preview(O,e);return{txs:O,preview:L,summary:O[0].description,intentHash:S,owner:a,recipient:r.recipient,relayer:e,inputToken:f,maximumPull:u[1].toString(),feeToken:b?f:r.zeroForOne?r.key.currency1:r.key.currency0,relayerFee:r.relayerFee.toString(),feeFromInput:b,minimumOutput:T.toString(),simulatedAmountIn:A.toString(),simulatedAmountOut:R.toString(),note:"Verify IntentExecuted in the receipt and your fee balance after submission."}}},{name:"hookr_relay_receipt",inputSchema:{type:"object",description:"Read the executed intent and fee from a mined Hookr relay receipt.",properties:{transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}},required:["transactionHash"],additionalProperties:!1},execute:async i=>{if(Object.keys(i).some(a=>a!=="transactionHash")||typeof i.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(i.transactionHash))throw new o("Provide a Hookr relay transactionHash.");let e=await t.clientFor(H).getTransactionReceipt({hash:i.transactionHash});if(e.status!=="success")throw new o("Hookr relay reverted. No fee is proven paid.");let n=e.logs.filter(a=>p(a.address,h)).flatMap(a=>{try{let r=W({abi:I,eventName:"IntentExecuted",topics:a.topics,data:a.data});return[{...r.args,amountIn:r.args.amountIn.toString(),amountOut:r.args.amountOut.toString(),relayerFee:r.args.relayerFee.toString()}]}catch{return[]}});if(!n.length)throw new o("Receipt contains no verified Hookr IntentExecuted event.");return{chainId:H,transactionHash:e.transactionHash,blockNumber:e.blockNumber.toString(),intents:n,note:"Event evidence at this mined block; check balances and finality."}}}]}export{I as a,j as b,q as c,ce as d,ue as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./XSD5NL7J.js";function f(){return new e('Amount must be a non-negative integer string in base units. For example, "10000000" = 10 USDG (6 decimals).')}function s(t){if(typeof t!="string"||!/^\d+$/.test(t))throw f();return BigInt(t)}function g(t){if(!Number.isInteger(t)||t<0||t>255)throw new e("Token decimals must be an integer from 0 to 255.");return 10n**BigInt(t)}function l(t,i,n){if(i<=0n)throw new e("The denominator must be positive.");if(n!=="floor"&&n!=="ceil")throw new e("Choose floor or ceil rounding.");return t/i+(n==="ceil"&&t%i!==0n?1n:0n)}function a(t,i,n){let r=g(i);if(typeof t!="string"||!/^\d+(\.\d+)?$/.test(t))throw new e("Amount must be a non-negative decimal string.");let[o="0",c=""]=t.split("."),u=c.slice(i);if(n===void 0&&/[1-9]/.test(u))throw new e("Amount exceeds the token precision. Choose floor or ceil rounding.");if(n!==void 0&&n!=="floor"&&n!=="ceil")throw new e("Choose floor or ceil rounding.");return(BigInt(o)*r+BigInt(c.slice(0,i).padEnd(i,"0")||"0")+(n==="ceil"&&/[1-9]/.test(u)?1n:0n)).toString()}function b(t,i){let n=s(t),r=g(i),o=(n%r).toString().padStart(i,"0").replace(/0+$/,"");return`${n/r}${o?`.${o}`:""}`}function w(t,i,n,r){return l(s(t)*s(i),s(n),r).toString()}export{f as a,s as b,a as c,b as d,w as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{erc20Abi as n,parseAbi as e}from"viem";var s=[...n,...e(["function convertToAssets(uint256 shares) view returns (uint256 assets)","function implementation() view returns (address)","function allIndexes() view returns ((address index,address creator,bool verified,bool selfLending,bool makePublic)[])","function getIndex(address _index) view returns ((address index,address creator,bool verified,bool selfLending,bool makePublic))","function isRegistered(address _index) view returns (bool)","function validateIndex(address index) view","function addLPAndStake(address _indexFund,uint256 _amountIdxTokens,address _pairedLpTokenProvided,uint256 _amtPairedLpTokenProvided,uint256 _amountPairedLpTokenMin,uint256 _slippage,uint256 _deadline) payable returns (uint256 _amountOut)","function unstakeAndRemoveLP(address _indexFund,uint256 _amountStakedTokens,uint256 _minLPTokens,uint256 _minPairedLpToken,uint256 _deadline)","function PAIRED_LP_TOKEN() view returns (address)","function bond(address _token,uint256 _amount,uint256 _amountMintMin)","function config() view returns ((address partner,uint256 debondCooldown,bool hasTransferTax,bool blacklistTKNpTKNPoolV2))","function debond(uint256 _amount,address[],uint8[])","function fees() view returns ((uint16 burn,uint16 bond,uint16 debond,uint16 buy,uint16 sell,uint16 partner))","function getAllAssets() view returns ((address token,uint256 weighting,uint256 basePriceUSDX96,address c1,uint256 q1)[])","function lpRewardsToken() view returns (address)","function lpStakingPool() view returns (address)","function totalAssets(address _asset) view returns (uint256 _totalManagedAssets)","function v2Pool() view returns (address)","function INDEX_FUND() view returns (address)","function POOL_REWARDS() view returns (address)","function stakingToken() view returns (address)","function withdrawableStake(address wallet) view returns (uint256)","function claimReward(address _wallet)","function getClaimable(address token,address wallet) view returns (uint256)","function getUnpaid(address _token,address _wallet) view returns (uint256)","function indexFund() view returns (address)","function rewardsToken() view returns (address)","function trackingToken() view returns (address)","function paused(address) view returns (bool)"])];export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as B}from"./
|
|
1
|
+
import{b as B}from"./TFDPEAVZ.js";import{a as u,b,c,e as k,f as m,g as l,h as w}from"./2MZXTOZU.js";import{e as y,m as o}from"./NWNYJ26T.js";import{a as n}from"./XSD5NL7J.js";import{erc20Abi as L,formatUnits as x}from"viem";var a="LayerBank returned a malformed reserve read. Please try again.";function N(r){let s=o(r,a);if(s>=1n<<128n)throw new n(a);return s}async function I(r,s){try{let e=s??await r.getBlockNumber({cacheTime:0}),p=await B(r,e),[f,h,R,v]=await Promise.all([r.readContract({address:u,abi:l,functionName:"getConfiguration",args:[c.address],blockNumber:e}),r.readContract({address:c.address,abi:L,functionName:"balanceOf",args:[b],blockNumber:e}),r.readContract({address:b,abi:w,functionName:"scaledTotalSupply",blockNumber:e}),r.readContract({address:u,abi:l,functionName:"getReserveNormalizedIncome",args:[c.address],blockNumber:e})]);if(!y(f))throw new n(a);let t=o(f.data,a);if((t>>48n&255n)!==6n)throw new n(a);let C=N(p.currentLiquidityRate),P=N(p.accruedToTreasury),T=o(R,a),g=o(v,a);if(g===0n)throw new n(a);let d=((T+P)*g+m/2n)/m,i=(t>>116n&(1n<<36n)-1n)*10n**6n;return{blockNumber:e,active:(t&1n<<56n)!==0n,frozen:(t&1n<<57n)!==0n,paused:(t&1n<<60n)!==0n,supplyCapBase:i,suppliedBase:d,capRoomBase:i===0n?k:d>=i?0n:i-d,cashUsdgBase:o(h,a),rateBasePct:Number(x(C,25))}}catch(e){throw e instanceof n?e:new n("LayerBank reserve could not be read. Please try again.")}}export{I as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as v}from"./VHV6WQ5F.js";import{$ as M,_ as R,ca as x}from"./ACW63WIL.js";import{g as A,i as k,m as _,n as P}from"./NWNYJ26T.js";import{a as p}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{encodeFunctionData as D}from"viem";var F={asset:{type:"string",pattern:"^[A-Za-z0-9.$_-]{1,32}$",description:"Official asset symbol; use vault if discovery is unavailable or ambiguous."},vault:{type:"string",pattern:"^0x[0-9a-fA-F]{40}$",description:"Vault address verified on chain on every call; required for a rebuild without HTTP."}};function O(c){return{type:"object",additionalProperties:!1,properties:{...F,amount:{type:"string",pattern:c==="withdraw"?"^(?:[0-9]+|max)$":"^[0-9]+$"}},required:["amount"],anyOf:[{required:["asset"]},{required:["vault"]}]}}function U(c){return P(c,"Borro amount must be positive and fit uint256.",{positive:!0,notString:"Borro amount must be an integer string in asset base units."})}function g(c){return _(c,"Borro returned an invalid uint256 read.")}var W=c=>c*9950n/10000n;function z(c,l,h,d,N){let S=0n,m=0n;for(let y of c.changes){let b=y.token;if(typeof y.amount!="string"||!/^-?\d+$/.test(y.amount))throw new n("Borro preview returned invalid token changes. Nothing was signed.");let e=BigInt(y.amount);g(e<0n?-e:e);let o=A(b.address,l.address)?l:A(b.address,d.address)?d:void 0;if(!o||b.chainId!==p||b.decimals!==o.decimals)throw new n("Borro preview showed an unexpected token movement. Nothing was signed.");if(o===l){if(e>0n)throw new n("Borro preview showed a reversed input movement. Nothing was signed.");S-=e}else{if(e<0n)throw new n("Borro preview showed a reversed output movement. Nothing was signed.");m+=e}}if(g(S),g(m),S!==h||m<N||m===0n)throw new n("Borro preview did not match the requested receipt. Nothing was signed.")}var K=c=>{let{client:l,context:h,wallet:d}=c;async function N(e,o,a){if(k(a,"Provide a valid wallet address."),!A(a,d))throw new n("Borro action wallet differs from the signing wallet. Nothing was signed.");if(h.network==="testnet"||await l.getChainId()!==p)throw new n("Borro requires chain 4663. Nothing was signed.");if(Object.keys(e).some(i=>!["asset","vault","amount"].includes(i)))throw new n("Unsupported Borro argument.");if(e.asset!==void 0&&(typeof e.asset!="string"||!/^[A-Za-z0-9.$_-]{1,32}$/.test(e.asset)||/^0x/i.test(e.asset)))throw new n("Provide an asset symbol, or put the vault address in vault.");let w=e.vault===void 0?void 0:k(e.vault,"Provide a valid Borro vault address.");if(!w&&e.asset===void 0)throw new n("Provide an asset symbol or a vault address.");let t=w?await c.verifyVault(l,w,o,{wallet:d}):await c.resolveVault(l,{asset:e.asset},o,d);if(w&&!A(w,t.vault)||e.asset!==void 0&&e.asset.toUpperCase()!==t.symbol.toUpperCase())throw new n("Borro vault and asset selectors do not match. Nothing was signed.");if(k(t.vault,"Borro returned an invalid vault address."),k(t.asset,"Borro returned an invalid asset address."),t.chainId!==p||t.shareDecimals!==18||A(t.asset,t.vault)||!Number.isInteger(t.assetDecimals)||t.assetDecimals<0||t.assetDecimals>255||t.mode!==o)throw new n(x("setup-mismatch",{}));let s=await c.verifySetup(l,t,o);if(!s.ok||o==="deposit"&&(!t.assetAllowed||s.drift.length>0))throw new n(x("setup-mismatch",{}));return{...t,setup:s}}function S(e){let o=e.mode==="withdraw"&&!/^[A-Za-z0-9.$_-]{1,16}$/.test(e.symbol)?"token":e.symbol;return{asset:{address:k(e.asset,"Borro returned an invalid asset."),symbol:o,decimals:e.assetDecimals,chainId:p},share:{address:k(e.vault,"Borro returned an invalid vault."),symbol:e.vaultSymbol,decimals:18,chainId:p}}}let m=(e,o)=>h.formatAmount(e.toString(),o),y="The minimum is checked in the preview; standard ERC-4626 calldata does not enforce it on chain. Re-preview before signing; execution output can change.",b=[{name:"borro_deposit",inputSchema:O("deposit"),execute:async(e,o)=>{let a=U(e.amount),w=await N(e,"deposit",o),{asset:t,share:s}=S(w),i=g(await l.readContract({address:t.address,abi:v,functionName:"balanceOf",args:[d]}));if(a>i)throw new n("This wallet does not hold enough of that asset for the Borro deposit.");let f=g(await l.readContract({address:s.address,abi:v,functionName:"previewDeposit",args:[a]}));if(f===0n)throw new n(x("deposit-would-revert",{}));let r=W(f),u=[h.approval(t.address,s.address,a.toString(),p),h.unsignedTx({to:s.address,data:D({abi:v,functionName:"deposit",args:[a,d]}),value:"0",chainId:p,description:`Deposit ${a} asset base units into Borro vault ${s.address}.`})],$;try{$=await h.preview(u,d),z($,t,a,s,r)}catch{throw new n(x("deposit-would-revert",{}))}let T=w.deployedAt===void 0?void 0:Date.parse(w.deployedAt)/1e3,B=R({amount:m(a,t.decimals),symbol:t.symbol,kind:t.symbol==="USDG"?"usdg":"stock",shares:m(f,18),sharesMin:m(r,18),vaultSymbol:s.symbol,deployedAtSeconds:T,nowSeconds:Math.floor(Date.now()/1e3)});return{txs:u,preview:$,vault:s.address,asset:t,shareToken:s,amount:a.toString(),shares:f.toString(),shares_min:r.toString(),summary:`${B}
|
|
2
|
+
Base units: amount ${a} (${t.address}, decimals ${t.decimals}); shares ${f} (${s.address}, decimals 18); shares_min ${r}. ${y}`}}},{name:"borro_withdraw",inputSchema:O("withdraw"),execute:async(e,o)=>{let a=e.amount==="max",w=a?void 0:U(e.amount),t=await N(e,"withdraw",o),{asset:s,share:i}=S(t),f=g(await l.readContract({address:i.address,abi:v,functionName:"balanceOf",args:[d]}));if(f===0n)throw new n(x("no-shares",{symbol:s.symbol}));let r=a?f:g(await l.readContract({address:i.address,abi:v,functionName:"previewWithdraw",args:[w]}));if(r===0n||r>f)throw new n("This wallet does not hold enough Borro shares for that withdrawal.");let u=w??g(await l.readContract({address:i.address,abi:v,functionName:"previewRedeem",args:[r]}));if(u===0n)throw new n("Borro preview returned no assets for these shares. Nothing was signed.");let $=await c.readLiquidity(l,t).catch(()=>({kind:"unknown"})),T=$.kind!=="unknown"&&"readyBase"in $?$.readyBase:void 0,B=typeof T=="bigint"&&T>=0n&&T<1n<<256n?T:void 0;if(B!==void 0&&B<u)return{txs:[],vault:i.address,asset:s,shareToken:i,amount:u.toString(),shares:r.toString(),max_now:B.toString(),summary:x("too-little-ready",{ready:m(B,s.decimals),requested:m(u,s.decimals),maxNow:m(B,s.decimals),symbol:s.symbol})};let I=a?W(u):u,V=[h.unsignedTx({to:i.address,data:a?D({abi:v,functionName:"redeem",args:[r,d,d]}):D({abi:v,functionName:"withdraw",args:[u,d,d]}),value:"0",chainId:p,description:`Withdraw ${u} asset base units from Borro vault ${i.address}${a?` for ${r} share base units`:""}.`})],C=a?await h.preview(V,d):await h.preview(V,d,{reads:[{to:i.address,data:D({abi:v,functionName:"previewWithdraw",args:[u]}),chainId:p}]});if(!a){let q=C.readResults?.[0];if(C.readResults?.length!==1||typeof q!="string"||!/^0x[0-9a-fA-F]{64}$/.test(q))throw new n("Borro preview returned an invalid share quote. Nothing was signed.");if(r=g(BigInt(q)),r===0n||r>f)throw new n("This wallet does not hold enough Borro shares for that withdrawal.")}z(C,i,r,s,I);let E=M({amount:m(u,s.decimals),isAll:a,symbol:s.symbol,out:m(u,s.decimals),shares:m(r,18),vaultSymbol:i.symbol,drift:t.setup.drift.length>0});return{txs:V,preview:C,vault:i.address,asset:s,shareToken:i,amount:u.toString(),shares:r.toString(),assets_min:I.toString(),isMax:a,setup:t.setup,summary:`${E}
|
|
3
|
+
Base units: amount ${u} (${s.address}, decimals ${s.decimals}); shares ${r} (${i.address}, decimals 18); assets_min ${I}. ${y}`}}}];for(let e of b){let o=e.execute;e.execute=async(a,w)=>{try{return await o(a,w)}catch(t){throw new n(h.plainError(t))}}}return b};export{K as a};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as ot}from"./63YRSLDK.js";var yt={};ot(yt,{ACCESS_FEE_LINE:()=>M,ACCESS_NO_PLAN:()=>T,BANNED_COPY:()=>pt,BONUS_CLAUSE:()=>
|
|
1
|
+
import{a as ot}from"./63YRSLDK.js";var yt={};ot(yt,{ACCESS_FEE_LINE:()=>M,ACCESS_NO_PLAN:()=>T,BANNED_COPY:()=>pt,BONUS_CLAUSE:()=>l,CARD_FOOTER_ASK:()=>E,CARD_FOOTER_NO_ASK:()=>k,CARD_HEADER:()=>s,CARD_HEADER_AMOUNT:()=>r,CARD_HEADER_AMOUNT_NOT_HELD:()=>i,ETH_HINT:()=>f,FEES_ESTIMATED_HIGH:()=>K,LAYERBANK_RISK_SUMMARY:()=>u,LAYERBANK_SETUP_MISMATCH:()=>Q,LAYERBANK_SITE:()=>st,LB_BONUS_NOTE:()=>N,LB_CASH_NOTE:()=>O,LB_DEPOSIT_SCREEN:()=>x,LB_WITHDRAW_SCREEN:()=>S,LP_ADD_BUTTON:()=>ht,LP_BLOCK:()=>$,LP_BLOCK_UNREADABLE:()=>j,LP_DECLINE_BUTTON:()=>lt,LP_NOT_WORTH_CLAUSE:()=>X,MATURED_NOTICE:()=>W,MATURED_STOCK_NOTICE:()=>F,MATURED_STOCK_NOTICE_NO_AMOUNT:()=>z,NOTHING_TO_EARN:()=>b,NO_NEW_TERM:()=>q,OPTION_A:()=>h,OPTION_A_CANT_CHECK:()=>y,OPTION_A_CLOSED:()=>g,OPTION_A_NO_ROOM:()=>m,OPTION_B:()=>c,OPTION_B_CANT_CHECK:()=>w,OPTION_B_NONE:()=>p,PAYOUT_APPROX:()=>U,PAYOUT_EXACT:()=>v,PENDLE_BUY_STABLE_SCREEN:()=>A,PENDLE_BUY_STOCK_SCREEN:()=>L,PENDLE_CONTRACT_CHANGE:()=>ut,PENDLE_EARLY_EXIT:()=>_,PENDLE_FIXED_RATE:()=>it,PENDLE_REDEEM_SCREEN:()=>I,PENDLE_REDEEM_STOCK_SCREEN:()=>R,PENDLE_RISK_SUMMARY:()=>d,PENDLE_SELL_DEFAULT_BUTTON:()=>dt,PENDLE_SELL_GAP_LINE:()=>D,PENDLE_SELL_NO_GAP_LINE:()=>C,PENDLE_SELL_SCREEN:()=>P,PENDLE_SERVICE_DOWN:()=>tt,PENDLE_SITE:()=>rt,PRICE_MISMATCH_REFUSAL:()=>J,SLIPPAGE_CAP_REFUSAL:()=>V,STOCK_PAID_IN:()=>B,STOCK_SHORT_TERM:()=>Y,STOCK_SHORT_TERM_DAYS:()=>_t,TEMPLATES:()=>ct,THIN_MARKET_REFUSAL:()=>Z,TOO_SMALL:()=>G,TOO_SMALL_NO_SIZE:()=>H,fill:()=>nt,placeholdersOf:()=>at});function t(e){return{text:e}}function at(e){return[...new Set([...e.text.matchAll(/\{([a-z][a-z0-9_]*)\}/g)].map(o=>o[1]))]}function nt(e,o){let et=o;return e.text.replace(/\{([a-z][a-z0-9_]*)\}/g,(wt,a)=>{let n=et[a];if(typeof n!="string")throw new Error(`Missing value for {${a}}`);return n})}var st="layerbank.finance",rt="app.pendle.finance",s=t("You have {amount_usd} in USDG that isn't earning anything. Here are two ways to make it earn. Pick one, or neither."),r=t("Looking at {amount_usd} of your USDG. Here are two ways to make it earn. Pick one, or neither."),i=t("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.",it="The rate is fixed only if you hold until the end date.",ut="Pendle's router can be upgraded by Pendle's team, so its code can change.",h=t(`A. LayerBank: lending, take it out any time
|
|
2
2
|
Pays about {lb_total_rate}% a year today ({lb_base_rate}% from borrowers{bonus_clause}). The rate changes, up or down.
|
|
3
3
|
You can take your money out any time while LayerBank has cash on hand (right now {lb_cash_usd}).
|
|
4
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.`),
|
|
5
|
+
Cost: network fees of about {lb_gas_in_usd} to put it in and {lb_gas_out_usd} to take it out.`),l=t(", plus a bonus of {lb_bonus_rate}% that ends {bonus_end}"),c=t(`B. Pendle: a fixed rate until {pendle_end_date}
|
|
6
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
7
|
${_}
|
|
8
8
|
Risk: ${d}
|
|
@@ -41,7 +41,7 @@ If you sell now, the market pays about {sell_now} {unit}, and Oak accepts no les
|
|
|
41
41
|
Selling early can lose money. The price today may be lower than what you paid.
|
|
42
42
|
Cost: about {fees_usd} in trading and network fees.
|
|
43
43
|
|
|
44
|
-
Sell now? [Yes, sell now] [No, keep waiting]`),D=t("That is {gap} less than waiting."),C=t("The
|
|
44
|
+
Sell now? [Yes, sell now] [No, keep waiting]`),D=t("That is {gap} less than waiting."),C=t("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."),dt="No, keep waiting",I=t(`Cash out {pt_amount} tokens for {usdg_out} USDG?
|
|
45
45
|
|
|
46
46
|
The term ended on {pendle_end_date}. Each token pays out {payout_per_pt_phrase} now, with no market price involved.
|
|
47
47
|
Cost: about {gas_usd} in network fees.
|
|
@@ -53,7 +53,7 @@ To end up in USDG, I can swap the {stock_symbol} afterwards with Oak's swap tool
|
|
|
53
53
|
Cost: about {gas_usd} in network fees.
|
|
54
54
|
|
|
55
55
|
Cash out? [Yes] [No]`),v=t("exactly 1 {unit}"),U=t("about {x} {unit} at today's exchange rate"),B=t("Paid in {stock_symbol}, not dollars."),Y=t("ends in {days_left} days, usually too short to be worth the fees"),_t=7,G=t("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."),H=t("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."),M=t("Also: Oak access costs {plan_price} per 30 days, which you pay whether or not you earn. At this size that is more than you would earn in a month."),K=t("Fees estimated high because the live price was unavailable."),W=t(`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".`),F=t('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=t('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.')
|
|
56
|
+
Want me to cash out to USDG, or start a new term? One "yes" is enough; say "cash out" or "new term".`),F=t('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=t('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.'),q=t("There is no new fixed-rate USDG term open right now. I cashed out to USDG; want me to show LayerBank instead?"),$=t(`Before you add liquidity: what it is worth, and what can go wrong
|
|
57
57
|
|
|
58
58
|
Worth: at today's reward rate of about {apr}% a year, {amount_usd} would earn about {gross_usd} until the campaign ends on {end_date}, and about {gas_usd} of that goes to network fees, leaving about {net_usd}. {worth_clause}
|
|
59
59
|
What can go wrong:
|
|
@@ -67,4 +67,4 @@ What can go wrong:
|
|
|
67
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
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
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]`),
|
|
70
|
+
Your call. If you say nothing, the answer is Don't. [Don't] [Add liquidity]`),ht="Add liquidity",lt="Don't",V=t("Oak won't accept a price move that big. The most it allows is {cap_pct}%."),Z=t("This is a thin market and your size moves the price too much. Try a smaller amount."),J=t("Pendle's price doesn't match what Oak checked on the chain. Nothing was signed."),Q=t("LayerBank's setup no longer matches what Oak checked. Nothing was signed."),tt=t("Pendle's price service isn't answering, so I can't quote or start a new term; I can still cash out ended terms."),ct={CARD_HEADER:s,CARD_HEADER_AMOUNT:r,CARD_HEADER_AMOUNT_NOT_HELD:i,OPTION_A:h,BONUS_CLAUSE:l,OPTION_B:c,OPTION_B_NONE:p,OPTION_A_CANT_CHECK:y,OPTION_B_CANT_CHECK:w,OPTION_A_CLOSED:g,OPTION_A_NO_ROOM:m,CARD_FOOTER_ASK:E,CARD_FOOTER_NO_ASK:k,ETH_HINT:f,NOTHING_TO_EARN:b,ACCESS_NO_PLAN:T,LB_DEPOSIT_SCREEN:x,LB_WITHDRAW_SCREEN:S,LB_BONUS_NOTE:N,LB_CASH_NOTE:O,PENDLE_BUY_STABLE_SCREEN:A,PENDLE_BUY_STOCK_SCREEN:L,PENDLE_SELL_SCREEN:P,PENDLE_SELL_GAP_LINE:D,PENDLE_SELL_NO_GAP_LINE:C,PENDLE_REDEEM_SCREEN:I,PENDLE_REDEEM_STOCK_SCREEN:R,PAYOUT_EXACT:v,PAYOUT_APPROX:U,STOCK_PAID_IN:B,STOCK_SHORT_TERM:Y,TOO_SMALL:G,TOO_SMALL_NO_SIZE:H,ACCESS_FEE_LINE:M,FEES_ESTIMATED_HIGH:K,MATURED_NOTICE:W,MATURED_STOCK_NOTICE:F,MATURED_STOCK_NOTICE_NO_AMOUNT:z,NO_NEW_TERM:q,LP_BLOCK:$,LP_NOT_WORTH_CLAUSE:X,LP_BLOCK_UNREADABLE:j,SLIPPAGE_CAP_REFUSAL:V,THIN_MARKET_REFUSAL:Z,PRICE_MISMATCH_REFUSAL:J,LAYERBANK_SETUP_MISMATCH:Q,PENDLE_SERVICE_DOWN:tt},pt=[/\bsafe(ly|ty)?\b/i,/\bguaranteed\b/i,/\brisk-free\b/i,/\bpassive\b/i,/\binvest/i,/\bAPY\b(?! a year)/];export{at as a,nt as b,st as c,rt as d,s as e,r as f,i as g,u as h,d as i,_ as j,it as k,ut as l,h as m,l as n,c as o,p,y as q,w as r,g as s,m as t,E as u,k as v,f as w,b as x,T as y,x as z,S as A,N as B,O as C,A as D,L as E,P as F,D as G,C as H,dt as I,I as J,R as K,v as L,U as M,B as N,Y as O,_t as P,G as Q,H as R,M as S,K as T,W as U,F as V,z as W,q as X,$ as Y,X as Z,j as _,ht as $,lt as aa,V as ba,Z as ca,J as da,Q as ea,tt as fa,ct as ga,pt as ha,yt as ia};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Q}from"./
|
|
1
|
+
import{a as X}from"./CEQNXF6A.js";import{b as Q}from"./AXRL3REN.js";import{a as O,b as J,d as V}from"./6OGDTEGH.js";import{a as E}from"./QYKXWBZC.js";import{K as y}from"./DHUDSOGR.js";import{c as S}from"./AEL62KCG.js";import{a as H}from"./43LI5NKJ.js";import{a as N}from"./66F5ZH34.js";import{d as G,g as U,i as K}from"./NWNYJ26T.js";import{a as b}from"./FWD4L3CJ.js";import{a as e}from"./XSD5NL7J.js";import{encodeFunctionData as Z,erc20Abi as Y,getAddress as W,parseAbi as ee,zeroAddress as te}from"viem";var v={address:W("0xCeF73866b088766DeD46Ba71d9Bd7591B5e931d2"),symbol:"tNET",decimals:9,chainId:b},_={pair_oracle:["checkpoint"],futures:["open","close","marginCall","accrueCarry","sweepCarrySkim"],underwriting:["subscribe","redeem"],prize:["enter","enterWithNet","exit","exitToUsdg","lockTranche","earlyUnlock","pokeRebase"]},fe=x=>({tools:[{name:"netnet_desk_action",inputSchema:{type:"object",additionalProperties:!1,required:["program","operation"],properties:{program:{type:"string",enum:Object.keys(_)},operation:{type:"string",enum:[...new Set(Object.values(_).flat())]},amount:N(),minAmountOut:N(),maxPayment:N(),sizeUsdWad:N(),isLong:{type:"boolean"},account:{type:"string"},referrer:{type:"string"},trancheIndex:N(),lockDraws:{enum:["7","30"]},maxPenaltyAssets:N()}},execute:async(t,l)=>{try{if(H(l),typeof t.program!="string"||!Object.hasOwn(_,t.program)||typeof t.operation!="string"||!_[t.program].includes(t.operation))throw new e("Choose a supported finite NetNet desk operation.");let p=t.program,r=t.operation,P=E[p],q=X[p],T=x.clientFor(b);if(await T.getChainId()!==b)throw new e("NetNet desk actions require chain 4663.");let C=await T.getBlock(),z=new Set(["program","operation"]),m=(n,s=[])=>T.readContract({address:P.address,abi:q,functionName:n,args:s,blockNumber:C.number}),h=(...n)=>n.forEach(s=>z.add(s)),A=()=>(h("amount"),y(t.amount)),D=()=>(h("minAmountOut"),y(t.minAmountOut)),c=n=>K(n,"Provide an explicit checksummed account.",G),u=[],o,d=0n,w="",g;if(p==="pair_oracle"){if(c(await m("pairContract"))!==Q)throw new e("The oracle does not use the pinned canonical pair.");w="Permissionless oracle checkpoint; it sends no reward to this wallet and may not yet produce a valid TWAP."}else if(p==="futures"||p==="underwriting"){if(c(await m("token"))!==v.address||await T.readContract({address:v.address,abi:Y,functionName:"decimals",blockNumber:C.number})!==9)throw new e("This desk does not use the pinned valueless 9-decimal tNET test collateral.");let n=E.futures.address,s=E.underwriting.address;if(p==="futures"?c(await m("vault"))!==s:c(await m("clearinghouse"))!==n)throw new e("Futures and underwriting counterparties do not match the published pins.");if(w="Experimental tNET test program; tNET has no monetary value. Futures margin and underwriting capital can be lost. Utilization/ADL can prevent redemption. Prices and fees are read from the contract oracle; these calls encode no price floor.",r==="open"){if(h("isLong","sizeUsdWad","maxPayment"),typeof t.isLong!="boolean")throw new e("Provide isLong as a boolean.");let a=A(),f=y(t.sizeUsdWad);if(a>=1n<<128n||f>=1n<<128n)throw new e("Position margin and notional must fit uint128.");let k=c(await m("oracle"));if(k!==W("0xc8a11E8793F8714a159061369173dc86A0A5E23F"))throw new e("The futures oracle is not the published deployment.");let $=await T.readContract({address:k,abi:ee(["function marginPriceWad() view returns (uint256)"]),functionName:"marginPriceWad",blockNumber:C.number});if($<=0n)throw new e("Futures margin price is unavailable.");let i=f*5n/10000n*1000000000n/$;if(d=a+i,o=v,d>y(t.maxPayment))throw new e("Margin plus taker fee exceeds maxPayment.");u=[t.isLong,f,a],w+=` Entry fee ${i} tNET base units; exact approval caps price drift and may require a fresh preview.`}else if(r==="marginCall"){h("account");let a=c(t.account);if(await m("liquidatable",[a])!==!0)throw new e("The selected futures trader is not liquidatable.");u=[a]}else if(r==="subscribe"){d=A(),o=v,u=[d];let[a,f]=await Promise.all([m("totalShares"),m("equityTokens")]);if(typeof a!="bigint"||typeof f!="bigint"||a>0n&&f===0n)throw new e("Underwriting share price is invalid.");let k=a===0n?d:d*a/f;if(k===0n||k<D())throw new e("Underwriting subscription rounds to zero or misses the local share minimum.");w+=` Current quote ${k} underwriting share units; the share minimum is a local check, not encoded calldata.`}else if(r==="redeem"){let a=A();if(a>await m("sharesOf",[l]))throw new e("The wallet has insufficient underwriting shares.");u=[a],g={token:v,amount:D()}}}else{let[n,s,a,f,k,$]=await Promise.all(["net","usdg","staking","sNet","controller","book"].map(i=>m(i)));if(c(n)!==O.address||c(s)!==S.address||c(a)!==V||c(f)!==J.address||c(k)!==E.draw.address||c($)!==E.bonus.address)throw new e("WinNET token, staking, book or controller does not match its published pins.");if(w="WinNET principal is a fixed NET claim, exposed to NET price changes. Entry commits through three staking epochs; locks commit for 7 or 30 draws. Early unlock forfeits 1% of principal and cancels streak credits. Pair buys and sells each incur the NET trading tax; no prize or return is guaranteed.",r==="enter"||r==="enterWithNet"){h("referrer");let i=t.referrer===void 0?te:c(t.referrer);if(i===W(l))throw new e("WinNET does not permit self-referral.");d=A(),o=r==="enter"?S:O,u=r==="enter"?[d,D(),i]:[d,i],w+=` Referrer ${i} is recorded at the first deposit and cannot later be changed.`}else if(r==="exit"||r==="exitToUsdg"){let i=A();if(i>await m("principalOf",[l]))throw new e("WinNET exit exceeds this wallet\u2019s fixed principal.");u=r==="exit"?[i,l]:[i,D(),l],g={token:r==="exit"?O:S,amount:r==="exit"?i:y(t.minAmountOut)}}else if(r==="lockTranche"||r==="earlyUnlock"){h("trancheIndex");let i=y(t.trancheIndex,!0),I=await m("trancheAt",[l,i]);if(!Array.isArray(I)||typeof I[0]!="bigint"||I[0]===0n)throw new e("Choose a nonempty WinNET tranche.");if(r==="lockTranche"){if(h("lockDraws"),t.lockDraws!=="7"&&t.lockDraws!=="30")throw new e("Choose a 7- or 30-draw lock.");u=[i,BigInt(t.lockDraws)]}else{h("maxPenaltyAssets");let M=(I[0]+99n)/100n;if(M>y(t.maxPenaltyAssets,!0))throw new e("Early unlock exceeds maxPenaltyAssets in NET base units.");u=[i],w+=` Current irreversible forfeiture ${M} NET base units.`}}}if(Object.keys(t).some(n=>!z.has(n)))throw new e("Unexpected fields for this desk operation.");if(o&&await T.readContract({address:o.address,abi:Y,functionName:"balanceOf",args:[l],blockNumber:C.number})<d)throw new e(`Top up ${o.symbol}; this action needs ${d} base units.`);let F=`NetNet ${p}.${r}, contract ${P.address}, chain ${b}, ordered values ${JSON.stringify(u,(n,s)=>typeof s=="bigint"?String(s):s)}. ${o?`Approve exactly ${d} ${o.symbol} base units (token ${o.address}, decimals ${o.decimals}). `:""}${w}`,L=[...o?[x.approval(o.address,P.address,d.toString(),b)]:[],x.unsignedTx({to:P.address,data:Z({abi:q,functionName:r,args:u}),value:"0",chainId:b,description:F})],R=await x.preview(L,l),B=0n,j=0n;for(let n of R.changes){if(n.token.chainId!==b||!/^-?\d+$/.test(n.amount))throw new e("Invalid desk preview metadata.");let s=BigInt(n.amount);if(s<0n){if(!o||!U(n.token.address,o.address)||n.token.decimals!==o.decimals)throw new e("Desk preview spends an unexpected wallet asset.");B-=s}if(g&&U(n.token.address,g.token.address)){if(n.token.decimals!==g.token.decimals)throw new e("Desk receipt decimals mismatch.");j+=s}}if(B>d||g&&j<g.amount)throw new e("Desk preview exceeds its input budget or misses the requested receipt minimum.");return{txs:L,preview:R,summary:F}}catch(p){throw new e(x.plainError(p))}}}]});export{v as a,fe as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./A3PN3PK3.js";import{a as M}from"./
|
|
1
|
+
import{a as S}from"./A3PN3PK3.js";import{a as M}from"./43LI5NKJ.js";import{a as s,j as I}from"./FWD4L3CJ.js";import{a as n}from"./XSD5NL7J.js";import{getAddress as c}from"viem";var j=["one_hour","six_hours","one_day","seven_days","thirty_days","ninety_days","one_year","inception"],v=["one_day","seven_days","thirty_days","ninety_days","one_year","inception"],A={apy:["v1","apy-averages"],allocations:["v0","allocations"],history:["v0","state/history"],pending_governance:["v0","pending-governance-actions"]};function f(o){if(!o||typeof o!="object"||Array.isArray(o))throw new n("Morpho analytics returned an invalid object.");return o}function b(o){if(typeof o!="string"||!/^\d+$/.test(o)||BigInt(o)>=1n<<256n)throw new n("Morpho analytics returned an invalid decimal base-unit amount.");return o}function N(o,d){let r=f(o);if(![s,String(s)].includes(r.chain_id)||typeof r.vault_address!="string"||c(r.vault_address)!==c(d))throw new n("Morpho analytics returned another chain or vault.")}function k(o,d=0){if(d>12)throw new n("Morpho analytics response is too deeply nested.");if(Array.isArray(o))return o.map(r=>k(r,d+1));if(o&&typeof o=="object")return Object.fromEntries(Object.entries(o).map(([r,e])=>{if(e!==null&&/(?:_assets|_shares|_supply|_cap|_wad|_ray)$/.test(r)&&typeof e!="object")return[r,b(e)];if(e!==null&&/_address$/.test(r)){if(typeof e!="string")throw new n("Morpho analytics returned an invalid address.");return[r,c(e)]}return[r,k(e,d+1)]}));if(typeof o=="number"&&!Number.isFinite(o))throw new n("Morpho analytics returned a non-finite value.");return o}function U(o,d,r){return{name:d,inputSchema:{type:"object",additionalProperties:!1,required:["view"],properties:{view:{type:"string",enum:Object.keys(A)},lookback:{type:"string",enum:j,description:"APY window: one_hour through inception. History: one_day, seven_days, thirty_days, ninety_days, one_year or inception. Defaults to six_hours for APY or seven_days for history."},cursor:{type:"string",maxLength:4096,description:"Opaque cursor from pending_governance only."},limit:{type:"integer",minimum:1,maximum:100}},allOf:[{if:{properties:{view:{const:"history"}},required:["view"]},then:{properties:{lookback:{enum:v}}}}]},execute:async(e,O)=>{try{if(M(O),Object.keys(e).some(t=>!["view","lookback","cursor","limit"].includes(t))||typeof e.view!="string"||!Object.hasOwn(A,e.view))throw new n("Choose a documented Morpho analytics view.");let a=e.view,u=a==="history",w=a==="apy",_=a==="pending_governance";if(e.lookback!==void 0&&(!u&&!w||typeof e.lookback!="string"||!j.includes(e.lookback)))throw new n("lookback is available only for APY/history with a documented window.");if(u&&e.lookback!==void 0&&!v.includes(e.lookback))throw new n(`Choose a history lookback from ${v.join(", ")}; sub-day history is unavailable.`);if(!_&&(e.cursor!==void 0||e.limit!==void 0))throw new n("Pagination applies only to pending_governance.");if(e.cursor!==void 0&&(typeof e.cursor!="string"||e.cursor.length>4096))throw new n("Provide the opaque pending-governance cursor string.");let y=e.limit??100;if(typeof y!="number"||!Number.isInteger(y)||y<1||y>100)throw new n("Pagination limit must be an integer from 1 to 100.");let[Y,$]=A[a],p=new URL(`https://api.morpho.org/${Y}/vaults-v2/${s}:${c(r)}/${$}`);(u||w)&&p.searchParams.set("lookback",String(e.lookback??(u?"seven_days":"six_hours"))),_&&(p.searchParams.set("limit",String(y)),e.cursor!==void 0&&p.searchParams.set("cursor",e.cursor));let g=await o.http(p.toString(),{headers:{accept:"application/json"},signal:AbortSignal.timeout(15e3)});if(!g.ok)throw new n(`Morpho analytics HTTP ${g.status}. Retry when the service is reachable; no zero APY or empty book was inferred.`);let i=f(await g.json());N(w||a==="allocations"?i.data:i.params,r);let m,h=i.last_indexed_block,P=null;if(w){let t=f(i.data);if(t.lookback!==(e.lookback??"six_hours")||t.apy!==null&&(typeof t.apy!="number"||!Number.isFinite(t.apy)||t.apy<-1))throw new n("Morpho analytics returned an invalid APY or lookback.");m={annualYieldFraction:t.apy===null?null:String(t.apy),...t.apy===null?{status:"unavailable",reason:"Not enough history for the requested APY window."}:{},lookback:t.lookback,basis:"Realized post-fee share-price APY, excluding rewards; historical observation, not a promised return."},h=t.last_indexed_block}else if(a==="allocations"){let t=f(i.data);if(!Array.isArray(t.allocations))throw new n("Morpho analytics omitted adapter allocations.");m=k(t.allocations),h=t.last_indexed_block}else{if(!Array.isArray(i.data))throw new n("Morpho analytics omitted its record array.");if(u)for(let t of i.data){let l=f(t);if(typeof l.timestamp!="number"||!Number.isSafeInteger(l.timestamp)||l.timestamp<0)throw new n("Morpho history returned an invalid timestamp.");for(let C of["total_assets","total_supply","withdrawable_assets","allocated_assets","idle_assets"])b(l[C]);l.share_price_ray!==null&&b(l.share_price_ray)}if(_){if(i.cursor!==null&&typeof i.cursor!="string")throw new n("Morpho analytics returned an invalid pagination cursor.");P=i.cursor}m=k(i.data)}h!==void 0&&b(h);let x=o.clientFor(s);if(await x.getChainId()!==s)throw new n("Vault share metadata requires chain 4663.");let D=await S(x,c(r));return{vault:c(r),chainId:s,sourceUrl:p.toString(),view:a,lastIndexedBlock:h??null,cursor:P,data:m,asset:{address:c(I),symbol:"USDG",decimals:6,chainId:s},shareToken:{address:c(r),symbol:D,decimals:18,chainId:s},scales:{sharePriceRay:"1000000000000000000000000000",capWad:"1000000000000000000"},caveat:"Indexer data may lag the chain. APY excludes rewards; empty records describe only this API window/page. Re-read onchain state and preview before any action. API book data is never executed as calldata automatically."}}catch(a){throw new n(o.plainError(a))}}}}export{U as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as I}from"./NKX3FE34.js";import{f as t,g as c,i as y}from"./
|
|
1
|
+
import{a as I}from"./NKX3FE34.js";import{f as t,g as c,i as y}from"./46KWRAYK.js";import{a as m}from"./XSD5NL7J.js";var s={GetAccountBalance:{query:`query GetAccountBalance($address: Address!, $interval: TimeInterval!, $from: Int, $to: Int) {
|
|
2
2
|
account(address: $address) {
|
|
3
3
|
statsHistory(interval: $interval, filter: { timestamp: { gte: $from, lte: $to } }) {
|
|
4
4
|
nodes {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as I,c as M}from"./
|
|
1
|
+
import{b as I,c as M}from"./QU5XKRGK.js";import{a as b,c as s,d as k,f as E}from"./4HG6FRVH.js";import{g}from"./H43RNCX2.js";import{a as N}from"./43LI5NKJ.js";import{a as C,i as D,j as i}from"./FWD4L3CJ.js";import{a as y}from"./XSD5NL7J.js";import{erc20Abi as U,parseAbi as P}from"viem";var o=P(["function isValidMarket(address market) view returns(bool)","function readTokens() view returns(address sy,address pt,address yt)","function expiry() view returns(uint256)","function isExpired() view returns(bool)","function getTokensIn() view returns(address[])","function getTokensOut() view returns(address[])"]);async function H(u,r,d){if(N(r),I(d,!0),u.network==="testnet")throw new y("Pendle is available on chain 4663 only.");let e=u.clientFor(C),w=await e.getBlock(),t=w.number;s(await e.readContract({address:D[4663].pendle.marketFactory.address,abi:o,functionName:"isValidMarket",args:[r],blockNumber:t})===!0,"market is not verified by Pendle\u2019s factory");let[[c,m,O],p,h]=await Promise.all([e.readContract({address:r,abi:o,functionName:"readTokens",blockNumber:t}),e.readContract({address:r,abi:o,functionName:"expiry",blockNumber:t}),e.readContract({address:r,abi:o,functionName:"isExpired",blockNumber:t})]),[v,T]=await Promise.all([e.readContract({address:c,abi:o,functionName:"getTokensIn",blockNumber:t}),e.readContract({address:c,abi:o,functionName:"getTokensOut",blockNumber:t})]);s(v.some(n=>k(n,i)),"the earn cost comparison requires a USDG term"),s(T.some(n=>k(n,i)),"this term cannot cash out to USDG"),s(!h&&p>w.timestamp&&p<=BigInt(Number.MAX_SAFE_INTEGER),"this term has ended or its end date is unreadable");let l=n=>e.readContract({address:n,abi:U,functionName:"decimals",blockNumber:t}),[S,x,R]=await Promise.all([l(i),l(m),l(c)]),A={market:r,sy:c,pt:m,yt:O,expiry:Number(p),expired:h,kind:"stable",inputToken:i,inputSymbol:"USDG",inputDecimals:S,ptDecimals:x,syDecimals:R,tokensIn:[...v],tokensOut:[...T]},f=await g(u.http,{inputToken:i,outputToken:m,amount:d,wallet:b,slippageBps:50}),a=E(f.body,{market:A,wallet:b,amount:d,slippageBps:50});if(Math.abs(a.priceImpact)>.03)throw new y("This is a thin market and your size moves the price too much. Try a smaller amount.");return await M(e,A,"buy",d,a.amountOut,a.priceImpact),s(Date.now()-f.receivedAt>=0&&Date.now()-f.receivedAt<=3e4,"display quote is too old; try again"),{feeUsd:a.feeUsd,impactPct:Math.abs(a.priceImpact)*100,ptOutBase:a.amountOut}}export{H as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as q}from"./2MT3G7YZ.js";import{b as S}from"./AEL62KCG.js";import{b as le}from"./SPJCSEKP.js";import{a as _}from"./43LI5NKJ.js";import{g as B,i as ue}from"./NWNYJ26T.js";import{b as H}from"./IX3GZMTM.js";import{a as c,i as N}from"./FWD4L3CJ.js";import{a as u}from"./XSD5NL7J.js";import{a as ce}from"./JXOEJPJ4.js";import{encodeFunctionData as z,erc20Abi as me,getAddress as m,isAddress as he,parseAbi as U,zeroAddress as ke}from"viem";var T=m(N[c].hoodlock.locker.address),C=m(N[c].hoodlock.burner.address),v=m(N[c].hoodlock.liquidityLocker.address),j=m(N[c].uniswap.v3_position_manager.address),K=m(N[c].uniswap.v4_position_manager.address),qe="0x000000000000000000000000000000000000dEaD",Ae=3153600000n,Te=1000000000000n,fe=65535,D=U(["function fee() view returns (uint256)","function lock(address token, uint256 amount, uint256 unlockTime) payable returns (uint256 lockId)","function getLock(uint256 lockId) view returns (address owner, address token, uint256 amount, uint256 unlockTime, bool withdrawn)","function locksByOwner(address owner) view returns (uint256[])","function locksByToken(address token) view returns (uint256[])"]),ee=U(["function fee() view returns (uint256)","function burn(address token, uint256 amount) payable returns (uint256 burnId)","function DEAD() view returns (address)","function getBurn(uint256 burnId) view returns (address burner, address token, uint256 amount, uint256 timestamp)","function totalBurnedOf(address token) view returns (uint256)"]),O=U(["function fixedFee() view returns (uint256)","function collectFeeBps() view returns (uint16)","function paused() view returns (bool)","function lock(address manager, uint256 tokenId, uint256 unlockTime, address feeRecipient, bool acceptUnverifiedHook, uint16 maxCollectFeeBps) payable returns (uint256 lockId)","function lockIdOf(address manager, uint256 tokenId) view returns (uint256)","function getLock(uint256 lockId) view returns (address owner, uint40 unlockTime, uint16 collectFeeBps, bool isV4, bool hookVerified, bool withdrawn, address feeRecipient, address token0, address token1, uint256 tokenId)","function locksOf(address owner) view returns (uint256[])"]),ye=U(["function approve(address to, uint256 tokenId)"]);function $e(e,o,t){let a=o.trim();if(a.startsWith("-")){let k=a.slice(1),i=e(k,t);return i==="0"?"0":`-${i}`}return e(a,t)}function pe(e,o){return o.length===0?"no ERC-20 transfer deltas":o.map(t=>`${$e(e.formatAmount,t.amount,t.token.decimals)} ${t.token.symbol}`).join(", ")}function E(e,o="token"){if(typeof e!="string"||!e.trim())throw new u(`Provide a valid ${o} contract address.`);if(!he(e,{strict:!1}))throw new u(`Identify ${o} by chain and contract address, not by symbol.`);return m(e)}async function W(e,o){try{return await o()}catch(t){throw new u(e.plainError(t))}}function we(e){let o=H(e);if(o<=0n)throw new u("Amount must be greater than zero.");return o}async function ge(e){let o=await e.getBlock();if(!o||typeof o.timestamp!="bigint")throw new u("Could not read the current chain timestamp. Please try again.");return o.timestamp}function ve(e,o){if(typeof e!="string"||!/^\d+$/.test(e.trim()))throw new u("unlockTime must be a non-negative integer string in Unix seconds.");let t=BigInt(e.trim());if(t>=Te)throw new u("unlockTime appears to be in milliseconds; provide Unix seconds at most 100 years (3153600000 seconds) in the future.");if(t<=o)throw new u(`unlockTime (${t}) must be in the future (greater than current timestamp ${o}).`);let a=o+Ae;if(t>a)throw new u(`unlockTime (${t}) exceeds the 100-year maximum lock duration (3153600000 seconds; max ${a}).`);return t}async function oe(e,o,t=c){let a=m(o),[k,i]=await Promise.all([e.readContract({address:a,abi:me,functionName:"symbol"}),e.readContract({address:a,abi:me,functionName:"decimals"})]);return{address:a,symbol:ce(String(k)),decimals:Number(i),chainId:t}}function Se(e,o){if(e==null)return o;let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number(e.trim()):NaN;if(!Number.isInteger(t)||t<0||t>fe)throw new u("maxCollectFeeBps must be an integer between 0 and 65535.");if(t<o)throw new u(`Live collectFeeBps (${o}) exceeds maxCollectFeeBps (${t}): collect fee changed.`);return Math.min(t,o)}function Le(e){return e.tokenId!==void 0||e.manager!==void 0||e.feeRecipient!==void 0||e.maxCollectFeeBps!==void 0||e.acceptUnverifiedHook!==void 0||e.kind==="v3"||e.kind==="lp"||e.kind==="v4"||e.version==="v3"||e.version==="v4"}async function xe(e,o,t){_(t);let a=m(t),k=o.kind==="v4"||o.version==="v4",i=o.manager!==void 0?E(o.manager,"manager"):k?K:j,g=i===K;if(i!==j&&!g)throw new u(`Unsupported position manager ${i}; use the configured Uniswap v3 or v4 manager.`);if(k&&!g||g&&(o.kind==="v3"||o.version==="v3"))throw new u("The requested version disagrees with the position manager.");if(o.acceptUnverifiedHook!==void 0&&typeof o.acceptUnverifiedHook!="boolean")throw new u("acceptUnverifiedHook must be a boolean.");let b=o.acceptUnverifiedHook===!0;if(!g&&b)throw new u("Uniswap v3 has no hooks; omit acceptUnverifiedHook.");let s=g?"v4":"v3";if(typeof o.tokenId!="string")throw new u("Provide an NFT tokenId as a decimal string.");let f=String(o.tokenId).trim(),d=H(f),l=ue(o.feeRecipient,"Provide an explicit feeRecipient address for LP position locks."),p=e.clientFor(c),[x,I,h]=await Promise.all([ge(p),p.readContract({address:v,abi:O,functionName:"fixedFee"}),p.readContract({address:v,abi:O,functionName:"collectFeeBps"})]),y,$=!0;if(g){let P=U(["function getPoolAndPositionInfo(uint256 tokenId) view returns ((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey, uint256 info)","function getPositionLiquidity(uint256 tokenId) view returns (uint128)","function ownerOf(uint256 tokenId) view returns (address)"]),[Y,J,M]=await Promise.all([p.readContract({address:i,abi:P,functionName:"getPoolAndPositionInfo",args:[d]}),p.readContract({address:i,abi:P,functionName:"getPositionLiquidity",args:[d]}),p.readContract({address:i,abi:P,functionName:"ownerOf",args:[d]})]);if(m(M)!==a)throw new u("This wallet does not own that v4 position NFT.");if(J<=0n)throw new u("The v4 position has no liquidity to lock.");if(y=m(Y[0].hooks),$=y===ke||await p.readContract({address:v,abi:U(["function hookAllowed(address) view returns (bool)"]),functionName:"hookAllowed",args:[y]}),!$&&!b)throw new u(`Unverified v4 hook ${y}; review its risks and explicitly set acceptUnverifiedHook: true to proceed.`)}let A=ve(o.unlockTime,x),n=BigInt(I),r=Number(h);if(!Number.isInteger(r)||r<0||r>fe)throw new u(`Invalid on-chain collectFeeBps (${String(h)}).`);if(o.maxFee!==void 0){let P=H(String(o.maxFee));if(n>P)throw new u(`Live fixedFee (${n}) exceeds maxFee (${P}).`)}let w=Se(o.maxCollectFeeBps,r),L=(r/100).toString(),R=e.unsignedTx({to:i,data:z({abi:ye,functionName:"approve",args:[v,d]}),value:"0",chainId:c,description:`Approve Uniswap ${s} position NFT #${d} on ${i} for HoodLock LiquidityLocker ${v}.`}),F=e.unsignedTx({to:v,data:z({abi:O,functionName:"lock",args:[i,d,A,l,b,w]}),value:n.toString(),chainId:c,description:`Lock Uniswap ${s} NFT #${d} in HoodLock LiquidityLocker (${v}) until ${A} with feeRecipient ${l}, upfront fixedFee ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei), and ongoing collect fee ${r} bps (${L}% of collected LP fees, frozen per lock).`}),X=[R,F],V=await e.preview(X,a),Q=`Approve and lock Uniswap ${s} NFT #${d} (manager ${i}) in HoodLock LiquidityLocker ${v} until Unix ${A}. Upfront fixedFee: ${e.formatAmount(n.toString(),S.decimals)} ETH (${n} wei). Ongoing LP fee share: ${r} bps (${L}% of collected LP fees, frozen per lock; maxCollectFeeBps=${w}) with feeRecipient ${l}. V4 hook: ${y??"none"}, reviewed: ${$}; acceptUnverifiedHook=${b}.`;return q(e,{txs:V.txs,summary:Q,preview:V,kind:s,contract:v,manager:i,tokenId:d.toString(),unlockTime:A.toString(),feeRecipient:l,acceptUnverifiedHook:b,collectFeeBps:r,maxCollectFeeBps:w,fixedFee:{token:S,amount:n.toString()}},v,n)}async function Ie(e,o,t){_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(c),[g,b,s]=await Promise.all([ge(i),i.readContract({address:T,abi:D,functionName:"fee"}),oe(i,k,c)]),f=we(o.amount),d=ve(o.unlockTime,g),l=BigInt(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(l>A)throw new u(`Live lock fee (${l}) exceeds maxFee (${A}).`)}let p=e.approval(s.address,T,f.toString(),c),x=e.unsignedTx({to:T,data:z({abi:D,functionName:"lock",args:[s.address,f,d]}),value:l.toString(),chainId:c,description:`Lock ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) in HoodLock Locker ${T} until ${d} with exact fee ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei).`}),I=[p,x],h=await e.preview(I,a),y=pe(e,h.changes),$=`Approve and lock ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) in HoodLock Locker ${T} until Unix ${d}. Exact fee: ${e.formatAmount(l.toString(),S.decimals)} ETH (${l} wei). Preview changes: ${y}.`;return q(e,{txs:h.txs,summary:$,preview:h,kind:"token",contract:T,token:s,amount:f.toString(),unlockTime:d.toString(),fee:{token:S,amount:l.toString()}},T,l)}function Pe(e){return{name:"hoodlock_lock",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["token","v2","v3","v4"],description:"Lock mode: token/v2 LP via Locker, or Uniswap v3/v4 NFT via LiquidityLocker."},token:{type:"string",description:"ERC-20 token or v2 LP token contract address on chain 4663 (for token/v2 locks)."},amount:{type:"string",description:"Token amount as an integer string in base units (for token/v2 locks)."},manager:{type:"string",description:"Configured Uniswap v3 or v4 position manager; inferred from kind when omitted."},tokenId:{type:"string",description:"Uniswap NFT position tokenId as a decimal string."},feeRecipient:{type:"string",description:"Explicit recipient address for collected LP fees during a position lock."},acceptUnverifiedHook:{type:"boolean",description:"Explicit v4 unreviewed-hook consent; default false. A reviewed hook is not a safety guarantee."},maxFee:{type:"string",description:"Maximum upfront ETH fee in wei; the exact live fee is sent."},maxCollectFeeBps:{type:"number",description:"Maximum acceptable ongoing LP collect fee in bps (uint16, must be >= live collectFeeBps)."},unlockTime:{type:"string",description:"Unlock timestamp in Unix seconds (must be > now and <= now + 100 years)."}},required:["unlockTime"],additionalProperties:!1},async execute(o,t){return W(e,async()=>Le(o)?xe(e,o,t):Ie(e,o,t))}}}function Ce(e){return{name:"hoodlock_burn",inputSchema:{type:"object",properties:{token:{type:"string",description:"ERC-20 token contract address on chain 4663 to send to the dead address via HoodLock Burner."},amount:{type:"string",description:"Amount to burn as an integer string in base units."}},required:["token","amount"],additionalProperties:!1},async execute(o,t){return W(e,async()=>{_(t);let a=m(t),k=E(o.token,"token"),i=e.clientFor(c),[g,b,s]=await Promise.all([i.readContract({address:C,abi:ee,functionName:"fee"}),i.readContract({address:C,abi:ee,functionName:"DEAD"}),oe(i,k,c)]),f=we(o.amount),d=BigInt(g),l=m(b);if(o.maxFee!==void 0){let A=H(String(o.maxFee));if(d>A)throw new u(`Live burn fee (${d}) exceeds maxFee (${A}).`)}let p=e.approval(s.address,C,f.toString(),c),x=e.unsignedTx({to:C,data:z({abi:ee,functionName:"burn",args:[s.address,f]}),value:d.toString(),chainId:c,description:`Send ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${C} (totalSupply is unchanged) with exact fee ${e.formatAmount(d.toString(),S.decimals)} ETH (${d} wei).`}),I=[p,x],h=await e.preview(I,a),y=pe(e,h.changes),$=`Approve and send ${e.formatAmount(f.toString(),s.decimals)} ${s.symbol} (${f} base units of ${s.address}) to the dead address (${l}) via HoodLock Burner ${C}. Note: tokens are transferred to ${l} and totalSupply is unchanged. Exact fee: ${e.formatAmount(d.toString(),S.decimals)} ETH (${d} wei). Preview changes: ${y}.`;return q(e,{txs:h.txs,summary:$,preview:h,contract:C,deadAddress:l,token:s,amount:f.toString(),fee:{token:S,amount:d.toString()},totalSupplyReduced:!1},C,d)})}}}async function be(e,o,t){_(o);let a=m(o),k=t?E(t,"token"):void 0,i=e.clientFor(c),g=[],b=new Set,s=n=>{for(let r of n){let w=r.toString();b.has(w)||(b.add(w),g.push(r))}};if(k){let[n,r]=await Promise.all([i.readContract({address:T,abi:D,functionName:"locksByToken",args:[k]}),i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]})]);s(n),s(r)}else{let n=await i.readContract({address:T,abi:D,functionName:"locksByOwner",args:[a]});s(n)}let d=(await Promise.all(g.map(async n=>{let r=await i.readContract({address:T,abi:D,functionName:"getLock",args:[n]});return{id:n,owner:m(r[0]),token:m(r[1]),amount:BigInt(r[2]),unlockTime:BigInt(r[3]),withdrawn:!!r[4]}}))).filter(n=>!n.withdrawn&&n.amount>0n&&B(n.owner,a)&&(!k||B(n.token,k))),l=new Map,p=async n=>{let r=n.toLowerCase(),w=l.get(r);if(w)return w;let L=n===ke?S:await oe(i,n,c);return l.set(r,L),L},x=[],I=[];for(let n of d){let r=await p(n.token),w=n.amount.toString(),L=n.unlockTime.toString(),R={token:r,amount:w};x.push({lockId:n.id.toString(),kind:"token",contract:T,chainId:c,owner:n.owner,token:r,amount:w,asset:R,unlockTime:L,withdrawn:!1}),I.push({module:"hoodlock",id:`lock:${n.id.toString()}`,chainId:c,assets:[R],description:`HoodLock token lock #${n.id} of ${e.formatAmount(w,r.decimals)} ${r.symbol} (${r.address}) until Unix ${L}.`})}let h=await i.readContract({address:v,abi:O,functionName:"locksOf",args:[a]}),y=[...new Set(h.map(n=>n.toString()))].map(n=>BigInt(n)),$=[];for(let n of y){let r=await i.readContract({address:v,abi:O,functionName:"getLock",args:[n]}),[w,L,R,F,X,V,Q,P,Y,J]=r,M=m(w);if(V||!B(M,a))continue;let ne=m(P),te=m(Y);if(k&&!B(ne,k)&&!B(te,k))continue;let[ie,re]=await Promise.all([p(ne),p(te)]),se=m(Q),ae=Number(R),de=BigInt(L).toString(),Z=BigInt(J).toString();$.push({lockId:n.toString(),kind:F?"v4":"v3",contract:v,manager:F?K:j,chainId:c,owner:M,tokenId:Z,unlockTime:de,collectFeeBps:ae,feeRecipient:se,hookVerified:!!X,token0:ie,token1:re,withdrawn:!1}),I.push({module:"hoodlock",id:`lp-lock:${n.toString()}`,chainId:c,assets:[{token:{address:F?K:j,symbol:`UNI-${F?"V4":"V3"} #${Z}`,decimals:0,chainId:c},amount:"1"}],description:`HoodLock Uniswap ${F?"v4":"v3"} LP lock #${n} (NFT #${Z}, ${ie.symbol}/${re.symbol}, feeRecipient ${se}, collectFeeBps ${ae}) until Unix ${de}. One NFT held in LiquidityLocker custody for ${M}. Underlying token amounts are not valued.`})}let A=`Found ${x.length} active token lock(s) and ${$.length} active Uniswap v3/v4 LP lock(s) for ${a}.`;return{locks:x,lpLocks:$,positions:I,summary:A}}function Fe(e){return{name:"hoodlock_list_locks",inputSchema:{type:"object",properties:{owner:{type:"string",description:"Optional owner wallet address to query (defaults to the authenticated wallet)."},token:{type:"string",description:"Optional ERC-20 or LP token address to filter active locks owned by the wallet."}},additionalProperties:!1},async execute(o,t){let a=o.owner!==void 0?E(o.owner,"owner"):m(t),k=o.token!==void 0?E(o.token,"token"):void 0;return W(e,()=>be(e,a,k))}}}function Re(e){return async o=>(await W(e,()=>be(e,o))).positions}var G=e=>({tools:[Pe(e),Ce(e),Fe(e)],positions:Re(e)}),ze=G,je=G,Ke=e=>le("hoodlock",[G(e)]),We=G;export{T as a,C as b,v as c,j as d,K as e,qe as f,Ae as g,$e as h,Pe as i,Ce as j,Fe as k,Re as l,G as m,ze as n,je as o,Ke as p,We as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,d as T,e as p}from"./
|
|
1
|
+
import{a as d,d as T,e as p}from"./DJN3JAWB.js";import{a as S}from"./66F5ZH34.js";import{a as r}from"./FWD4L3CJ.js";import{a as u}from"./XSD5NL7J.js";import{encodeFunctionData as k,erc20Abi as E,getAddress as m,parseAbi as I}from"viem";var e={router:m("0x888888888889758F76e7103c6CbF23ABbF58F946"),oracle:m("0x5542be50420E88dd7D5B4a3D488FA6ED82F6DAc2"),market:m("0xc2b89e6eca583e2c232201ac557e9be58af55f4c"),pt:m("0x6982e39521A070a3C40782548bfBED6Dc8F566ef"),yt:m("0xF35Ee6bd9A93fE42BC7e628BFC4DDbdc6DE1f615"),expiry:1805932800n},$="(uint8 swapType,address extRouter,bytes extCalldata,bool needScale)",C="(uint256 salt,uint256 expiry,uint256 nonce,uint8 orderType,address token,address YT,address maker,address receiver,uint256 makingAmount,uint256 lnImpliedRate,uint256 failSafeRate,bytes permit)",w=`(${C} order,bytes signature,uint256 makingAmount)`,O=`(address limitRouter,uint256 epsSkipMarket,${w}[] normalFills,${w}[] flashFills,bytes optData)`,M=`(address tokenIn,uint256 netTokenIn,address tokenMintSy,address pendleSwap,${$} swapData)`,F=`(address tokenOut,uint256 minTokenOut,address tokenRedeemSy,address pendleSwap,${$} swapData)`,_="(uint256 guessMin,uint256 guessMax,uint256 guessOffchain,uint256 maxIteration,uint256 eps)",b=I([`function swapExactTokenForPt(address receiver,address market,uint256 minPtOut,${_} guessPtOut,${M} input,${O} limit) payable returns (uint256 netPtOut,uint256 netSyFee,uint256 netSyInterm)`,`function swapExactPtForToken(address receiver,address market,uint256 exactPtIn,${F} output,${O} limit) returns (uint256 netTokenOut,uint256 netSyFee,uint256 netSyInterm)`,`function redeemPyToToken(address receiver,address YT,uint256 netPyIn,${F} output) returns (uint256 netTokenOut,uint256 netSyInterm)`]),N=I(["function getPtToAssetRate(address market,uint32 duration) view returns (uint256)"]),h={address:e.pt,symbol:"PT-USDG",decimals:6,chainId:r},l="0x0000000000000000000000000000000000000000",D={swapType:0,extRouter:l,extCalldata:"0x",needScale:!1},A={limitRouter:l,epsSkipMarket:0n,normalFills:[],flashFills:[],optData:"0x"},B={guessMin:0n,guessMax:(1n<<256n)-1n,guessOffchain:0n,maxIteration:256n,eps:10n**14n},f=S("Exact USDG or PT base units (both 6 decimals).");function Y(i){let y=async()=>{if(i.network==="testnet")throw new u("Priors PT is configured only on chain 4663.");return i.clientFor(r).getBlock()};return{tools:[{name:"priors_pt_quote",inputSchema:{type:"object",properties:{side:{type:"string",enum:["buy","sell"]},amount:f},required:["side","amount"],additionalProperties:!1},async execute(n){let s=await y();if(s.timestamp>=e.expiry)throw new u("This PT market matured; use redemption.");let t=p(n.amount,"amount");if(t===0n||!["buy","sell"].includes(String(n.side)))throw new u("Provide buy or sell and a positive base-unit amount.");let a=await i.clientFor(r).readContract({address:e.oracle,abi:N,functionName:"getPtToAssetRate",args:[e.market,0]});if(a===0n)throw new u("PT oracle returned a zero rate.");return{chainId:r,token:h,market:e.market,blockNumber:s.number?.toString(),amountIn:t.toString(),estimatedOutput:(n.side==="buy"?t*10n**18n/a:t*a/10n**18n).toString(),rateE18:a.toString(),caveat:"Oracle spot estimate excludes own price impact and execution fees. Specify minOut explicitly and inspect the actual swap preview."}}},{name:"priors_pt_position",inputSchema:{type:"object",properties:{},additionalProperties:!1},async execute(n,s){let t=await y(),a=await i.clientFor(r).readContract({address:e.pt,abi:E,functionName:"balanceOf",args:[m(s)]});return{token:h,balance:a.toString(),market:e.market,expiry:e.expiry.toString(),matured:t.timestamp>=e.expiry}}},...["buy","sell","redeem"].map(n=>({name:`priors_pt_${n}`,inputSchema:{type:"object",properties:{amount:f,minOut:f},required:["amount","minOut"],additionalProperties:!1},async execute(s,t){t=m(t);let a=await y(),x=a.timestamp>=e.expiry;if(n==="redeem"!==x)throw new u(x?"Market matured; redeem PT instead.":"PT redemption opens at maturity.");let o=p(s.amount,"amount"),c=p(s.minOut,"minOut");if(o===0n||c===0n)throw new u("amount and minOut must be positive base units.");let P={tokenOut:d.usdg,minTokenOut:c,tokenRedeemSy:d.usdg,pendleSwap:l,swapData:D},R=n==="buy"?k({abi:b,functionName:"swapExactTokenForPt",args:[t,e.market,c,B,{tokenIn:d.usdg,netTokenIn:o,tokenMintSy:d.usdg,pendleSwap:l,swapData:D},A]}):n==="sell"?k({abi:b,functionName:"swapExactPtForToken",args:[t,e.market,o,P,A]}):k({abi:b,functionName:"redeemPyToToken",args:[t,e.yt,o,P]}),g=[i.approval(n==="buy"?d.usdg:e.pt,e.router,o.toString(),r),i.unsignedTx({to:e.router,data:R,value:"0",chainId:r,description:`${n} PT-USDG, exact input ${o}, minimum output ${c} (6 decimals).`})],v=await i.preview(g,t);return{txs:g,summary:`Pendle PT ${n}: ${o} base units, minimum ${c}, receiver ${t}. No external aggregator. ${v.summary}`,terms:T({expiry:e.expiry,market:e.market})}}}))]}}export{e as a,b,Y as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Y,e as Z}from"./
|
|
1
|
+
import{b as Y,e as Z}from"./FEYAY6OZ.js";import{a as U,b as L,c as D,d as G,e as _,f as W,g as J}from"./PIIHOXWF.js";import{d as C,e as $,v as H}from"./2THSW4QN.js";import{a as K}from"./IOYRL6AY.js";import{a as S}from"./66F5ZH34.js";import{c as h,g as Q}from"./NWNYJ26T.js";import{a as I,i as T}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeAbiParameters as b,encodeFunctionData as ee,encodePacked as de,erc20Abi as me,getAddress as ue,parseAbi as N,parseAbiParameters as A,zeroAddress as v}from"viem";var te=ue("0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7"),ne=ue(T[4663].ponsTrade.quoter.address),fe=N(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),le=N(["function approve(address token,address spender,uint160 amount,uint48 expiration)"]),oe=N(["function factory() view returns (address)","function quoteExactInput(bytes path,uint256 amountIn) returns (uint256,uint160[],uint32[],uint256)","function quoteExactOutput(bytes path,uint256 amountOut) returns (uint256,uint160[],uint32[],uint256)"]),F="(address intermediateCurrency,uint24 fee,int24 tickSpacing,address hooks,bytes hookData)",M="(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks)",re=N([`function quoteExactInput((address exactCurrency,${F}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactOutput((address exactCurrency,${F}[] path,uint128 exactAmount) params) returns (uint256,uint256)`,`function quoteExactInputSingle((${M} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`,`function quoteExactOutputSingle((${M} poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256,uint256)`]),ye=A(`(address exactCurrency,${F}[] path,uint256[] minHopPriceX36,uint128 amount,uint128 limit)`);function he(u,t,r,d){let a=[],e=d?r:t,i=new Set([e]);for(let n of d?[...u].reverse():u){let s=n.currency0===e?n.currency1:n.currency1===e?n.currency0:void 0;if(!s||i.has(s))throw new o("V4 poolKeys must form a continuous route without repeated currencies.");a.push({intermediateCurrency:s,fee:n.fee,tickSpacing:n.tickSpacing,hooks:n.hooks,hookData:"0x"}),e=s,i.add(e)}if(e!==(d?t:r))throw new o("V4 route does not end at the requested currency.");return a}var xe=A(`(${M} poolKey,bool zeroForOne,uint128 amount,uint128 limit,uint256 minHopPriceX36,bytes hookData)`),be=A("address recipient,uint256 amount,uint256 limit,bytes path,bool payerIsUser,uint256[] minHopPriceX36"),we=A("address recipient,uint256 amount,uint256 limit,address[] path,bool payerIsUser,uint256[] minHopPriceX36"),ie=A("address,uint256"),ve=A("bytes,bytes[]");function Ae(u,t,r){let d=r?[...u].reverse():u,a=r?[...t].reverse():t,e=d[0];return a.forEach((i,n)=>{e=`${e}${de(["uint24","address"],[i,d[n+1]]).slice(2)}`}),e}var ae={version:{type:"string",enum:["v2","v3","v4"]},tokenIn:h,tokenOut:h,path:{type:"array",minItems:2,maxItems:6,items:h},fees:{type:"array",items:{type:"integer",minimum:0,maximum:1e6}},poolKeys:{type:"array",minItems:1,maxItems:5,items:{type:"object",required:["currency0","currency1","fee","tickSpacing","hooks"],properties:{currency0:h,currency1:h,fee:{type:"integer"},tickSpacing:{type:"integer"},hooks:h},additionalProperties:!1}},poolKey:{type:"object",properties:{currency0:h,currency1:h,fee:{type:"integer"},tickSpacing:{type:"integer"},hooks:h},required:["currency0","currency1","fee","tickSpacing","hooks"],additionalProperties:!1},amountIn:S(),amountOut:S(),minAmountOut:S(),maxAmountIn:S(),slippageBps:{type:"integer",minimum:0,maximum:9999}};async function ke(u,t,r,d=!1){J(t,Object.keys(ae));let a=t.version;if(!["v2","v3","v4"].includes(String(a)))throw new o("Provide version v2, v3 or v4.");let e=t.amountOut!==void 0;if(t.amountIn!==void 0===e)throw new o("Provide exactly one of amountIn or amountOut.");if(e&&t.minAmountOut!==void 0||!e&&t.maxAmountIn!==void 0)throw new o("Use maxAmountIn for exact output, minAmountOut for exact input.");let i=U(e?t.amountOut:t.amountIn,e?"amountOut":"amountIn",a==="v4"?128:160),n=D(t.tokenIn),s=D(t.tokenOut);if(n===s)throw new o("Swap requires different input and output currencies.");let w=u.clientFor(I),m=await w.getBlock(),z=G(t.slippageBps),g,f,q,k,x,p,R;if(a==="v4"){if(t.path!==void 0||t.fees!==void 0)throw new o("V4 uses poolKey or poolKeys; omit path and fees.");if(t.poolKey===void 0==(t.poolKeys===void 0))throw new o("Provide poolKey or poolKeys, not both.");if(t.poolKeys!==void 0){if(!Array.isArray(t.poolKeys)||t.poolKeys.length<1||t.poolKeys.length>5)throw new o("Provide 1 to 5 v4 poolKeys.");let c=t.poolKeys.map(P=>H(P));g=he(c,n,s,e),f=(await w.simulateContract({address:ne,abi:re,functionName:e?"quoteExactOutput":"quoteExactInput",args:[{exactCurrency:e?s:n,path:g,exactAmount:i}],account:r,gas:K,blockNumber:m.number})).result[0]}else{if(x=H(t.poolKey),![x.currency0,x.currency1].includes(n)||![x.currency0,x.currency1].includes(s))throw new o("PoolKey currencies differ from the requested swap.");f=(await w.simulateContract({address:ne,abi:re,functionName:e?"quoteExactOutputSingle":"quoteExactInputSingle",args:[{poolKey:x,zeroForOne:n===x.currency0,exactAmount:i,hookData:"0x"}],account:r,gas:K,blockNumber:m.number})).result[0]}k="0x10"}else{if(t.poolKey!==void 0||t.poolKeys!==void 0||n===v||s===v)throw new o("V2/v3 routes use ERC-20 tokens; wrap ETH to WETH first.");if(p=Array.isArray(t.path)?t.path.map(L):[n,s],p.length<2||p.length>6||p[0]!==n||p.at(-1)!==s||new Set(p).size!==p.length||p.includes(v))throw new o("Path must contain 2 to 6 distinct ERC-20 tokens in input-to-output order.");if(a==="v2"){if(t.fees!==void 0)throw new o("V2 fees are fixed by the pair; omit fees.");let c=await w.readContract({address:Y,abi:Z,functionName:e?"getAmountsIn":"getAmountsOut",args:[i,p],blockNumber:m.number});f=e?c[0]:c.at(-1),k=e?"0x09":"0x08"}else{let c=t.fees;if(!Array.isArray(c)||c.length!==p.length-1||c.some(P=>typeof P!="number"||!Number.isInteger(P)||P<0||P>1e6))throw new o("Provide one integer v3 fee in pips per path hop.");if(!Q(await w.readContract({address:te,abi:oe,functionName:"factory",blockNumber:m.number}),T[4663].uniswap.v3_factory.address))throw new o("V3 quoter is not configured for the pinned factory.");R=Ae(p,c,e),f=(await w.simulateContract({address:te,abi:oe,functionName:e?"quoteExactOutput":"quoteExactInput",args:[R,i],account:r,gas:K,blockNumber:m.number})).result[0],k=e?"0x01":"0x00"}}if(f<=0n)throw new o("No positive Uniswap quote is available.");let V=e?t.maxAmountIn:t.minAmountOut;if(!d&&V===void 0)throw new o(`Provide ${e?"maxAmountIn":"minAmountOut"} from uniswap_quote to confirm the trade bound.`);let l=V===void 0?e?(f*BigInt(1e4+z)+9999n)/10000n:f*BigInt(1e4-z)/10000n:U(V,e?"maxAmountIn":"minAmountOut",a==="v4"?128:160);if(l<=0n||(e?l<f:l>f))throw new o("The fresh quote does not satisfy the confirmed swap bound.");let y=e?l:i;if(y>=1n<<160n||a==="v4"&&(y>=1n<<128n||l>=1n<<128n))throw new o("Swap bounds exceed the router amount range.");let[se,ce]=await Promise.all([_(u,n,m.number),_(u,s,m.number)]),j={version:a,input:{token:se,amount:(e?f:i).toString()},output:{token:ce,amount:(e?i:f).toString()},[e?"maxAmountIn":"minAmountOut"]:l.toString(),blockNumber:m.number.toString(),expiresAt:(m.timestamp+60n).toString()};if(d)return{quote:j,summary:"Read-only on-chain quote. Repeat the same route with the returned bound in uniswap_swap; execution gets a fresh quote and preview."};let O=m.timestamp+300n,E=[],X="Native ETH input; no token approvals.";if(n!==v){let c=await w.readContract({address:n,abi:me,functionName:"allowance",args:[r,C],blockNumber:m.number});c!==y&&E.push(u.approval(n,C,y.toString(),I)),X=`${c===y?"Reuse existing exact ERC-20 allowance of":"Set ERC-20 allowance to exactly"} ${y} input base units to Permit2; exact router permit.`,E.push(u.unsignedTx({to:C,data:ee({abi:le,functionName:"approve",args:[n,$,y,Number(O)]}),value:"0",chainId:I,description:`Permit exactly ${y} input base units to Universal Router until ${O}.`}))}if(a==="v4"){let c=g?b(ye,[{exactCurrency:e?s:n,path:g,minHopPriceX36:[],amount:i,limit:l}]):b(xe,[{poolKey:x,zeroForOne:n===x.currency0,amount:i,limit:l,minHopPriceX36:0n,hookData:"0x"}]);q=b(ve,[g?e?"0x090c0f":"0x070c0f":e?"0x080c0f":"0x060c0f",[c,b(ie,[n,y]),b(ie,[s,e?i:l])]])}else a==="v2"?q=b(we,[r,i,l,p,!0,[]]):q=b(be,[r,i,l,R,!0,[]]);let B=[q];return n===v&&e&&(k=`${k}04`,B.push(b(A("address,address,uint256"),[v,r,0n]))),E.push(u.unsignedTx({to:$,data:ee({abi:fe,functionName:"execute",args:[k,B,O]}),value:n===v?y.toString():"0",chainId:I,description:`Uniswap ${a} ${e?"exact output":"exact input"} swap; recipient ${r}; deadline ${O}.`})),{...await W(u,E,r,`Swap through Universal Router 2.1.2. ${X} Fixed output/input bound and five-minute on-chain deadline. Venue fees included; gas excluded.`),quote:j}}function Ne(u){return{tools:[!0,!1].map(t=>({name:t?"uniswap_quote":"uniswap_swap",inputSchema:{type:"object",additionalProperties:!1,required:["version","tokenIn","tokenOut"],properties:ae},execute:(r,d)=>ke(u,r,d,t)}))}}export{te as a,ne as b,fe as c,le as d,oe as e,re as f,ye as g,he as h,xe as i,be as j,we as k,Ae as l,ke as m,Ne as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s}from"./
|
|
1
|
+
import{b as s}from"./ZXJ24B4L.js";import{a as o,c as t}from"./DJN3JAWB.js";import{getAddress as i}from"viem";var u=new Set(["priors_status",...s,...t.filter(r=>r.read).map(r=>r.name),"priors_ethos_status","priors_request_borrow","priors_request_repay","priors_request_stock","priors_request_backing","priors_pt_quote","priors_pt_position","priors_stock_quote","priors_savings_liquidity","priors_market_origin","priors_market_pins","priors_capabilities"]),p=new Set(["priors_sign_consent",...t.filter(r=>r.consentRoot).map(r=>r.name)]),d=new Set([...p,"priors_starter_line"]),R=new Set([...t.filter(r=>!r.read).map(r=>r.name),"priors_root_offer","priors_autopay_on","priors_autopay_off","priors_pt_buy","priors_pt_sell","priors_pt_redeem","priors_savings_force_withdraw","priors_stock_swap","priors_market_clear_bid_budget","priors_market_revoke_nft","priors_x_link"]);function S(r){let _=t.find(e=>e.name===r);return _?[o[_.contract],..._.approval==="bid"?[o.bidSpender]:[]]:r==="priors_root_offer"?[o.pool]:r==="priors_autopay_on"||r==="priors_autopay_off"?[o.autopay]:r==="priors_savings_force_withdraw"?[o.savings]:r==="priors_stock_swap"?[i("0xCaf681a66D020601342297493863E78C959E5cb2"),i("0x7Cd4E04E433E69e588728c86A3832753B5F846d4")]:r==="priors_pt_buy"||r==="priors_pt_sell"||r==="priors_pt_redeem"?[i("0x888888888889758F76e7103c6CbF23ABbF58F946")]:r==="priors_market_clear_bid_budget"?[o.bidSpender]:r==="priors_market_revoke_nft"?[o.registry,"0x0000000000000000000000000000000000000000"]:r==="priors_x_link"?[o.registry]:[]}export{u as a,p as b,d as c,R as d,S as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,d as H,m as M}from"./
|
|
1
|
+
import{c as g,d as H,m as M}from"./LKXO2BQS.js";import{f as k,g as C}from"./PIIHOXWF.js";import{d,e as s,y as _}from"./2THSW4QN.js";import{g as h}from"./NWNYJ26T.js";import{a as w}from"./FWD4L3CJ.js";import{a as t}from"./XSD5NL7J.js";import{decodeFunctionData as b,encodeFunctionData as B,erc20Abi as $,getAddress as O}from"viem";function K(u){return{tools:[{name:"uniswap_swap_batch",inputSchema:{type:"object",additionalProperties:!1,required:["routes"],properties:{routes:{type:"array",minItems:1,maxItems:20,items:{type:"object",description:"Complete uniswap_swap arguments, including an absolute minAmountOut or maxAmountIn."}}}},async execute(n,v){if(C(n,["routes"]),!Array.isArray(n.routes)||n.routes.length<1||n.routes.length>20)throw new t("Provide 1 to 20 explicit bounded Uniswap routes.");let c=new Map,i="0x",A=0n,a,m=[],y=new Set;for(let e of n.routes){if(!e||typeof e!="object"||Array.isArray(e))throw new t("Each route must contain uniswap_swap arguments.");let I=await M(u,e,v,!1);if(!("txs"in I))throw new t("Route did not build swap transactions.");let E=I.txs;for(let r of E.slice(0,-1))if(h(r.to,d)){let[o,D,N,S]=b({abi:H,data:r.data}).args;if(D!==s)throw new t("Unexpected route approval spender.");let T=o.toLowerCase(),p=c.get(T),U=(p?.amount??0n)+N;if(U>=1n<<160n)throw new t("Combined input approvals exceed uint160.");c.set(T,{token:o,amount:U,expiration:p&&p.expiration<BigInt(S)?p.expiration:BigInt(S)})}else{let o=b({abi:$,data:r.data});if(o.functionName!=="approve"||!h(o.args[0],d))throw new t("Unexpected route prerequisite.")}let f=E.at(-1);if(f.to!==s)throw new t("Route does not use the pinned Universal Router.");A+=BigInt(f.value);let[j,x,P]=b({abi:g,data:f.data}).args,R=j.slice(2).match(/../g)??[];if(R.length!==x.length)throw new t("Unexpected route command/parameter count.");R.forEach((r,o)=>{r==="04"?y.add(x[o]):(i=`${i}${r}`,m.push(x[o]))}),a=a===void 0||P<a?P:a}for(let e of y)i=`${i}04`,m.push(e);let l=[];for(let e of c.values())l.push(u.approval(O(e.token),d,e.amount.toString(),w),_(e.token,s,e.amount.toString(),e.expiration.toString()));return l.push(u.unsignedTx({to:s,data:B({abi:g,functionName:"execute",args:[i,m,a]}),value:A.toString(),chainId:w,description:`Atomically execute ${n.routes.length} caller-selected v2/v3/v4 routes, preserving each route's trade bound.`})),k(u,l,v,"Explicit mixed-version/split routes; every route must meet its own bound. No automatic best-route search or allow-revert branch. The wallet must fund each independently previewed route.")}}]}}export{K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as k}from"./
|
|
1
|
+
import{n as k}from"./BOVMED7R.js";import{a as y}from"./U4JGEMKT.js";import{b as T}from"./43LI5NKJ.js";import{b as R}from"./66F5ZH34.js";import{c as _,d as I,g as v,i as $,n as V}from"./NWNYJ26T.js";import{a as u}from"./FWD4L3CJ.js";import{a as o}from"./XSD5NL7J.js";import{encodeFunctionData as D,erc20Abi as O,getAddress as C,parseAbi as S}from"viem";var N=C("0x0000000000bbf5c5fd284e657f01bd000933c96d"),b=C("0x0a0d53b6684c7b32b4cbef5fe8483bfcc8406742"),U=C("0x00700052c0608F670705380a4900e0a8080010CC"),x=S(["function getCollectedFees(address partner,address token) view returns (uint256)","function withdrawAllFees(address token,address recipient) returns (uint256 amount)","function getBalance(address token,address partner) view returns (uint256)","function withdrawAllERC20(address token,address recipient) returns (bool)","function withdrawNative(uint256 amount,address owner,address receiver)"]),H=(1n<<256n)-1n,P={type:"string",enum:["market","delta"]};function p(t){return $(t,"Provide a token or wallet address.",I)}function A(t){if(t!=="market"&&t!=="delta")throw new o("Choose market or delta fees.");return t}function B(t){return V(t,"Amount must be positive and within uint256.",{notString:"Amount must be a decimal base-unit string.",positive:!0}).toString()}function E(t,m,d){if(d=p(d),t==="velora_unwrap_deth"){for(let e of Object.keys(m))if(e!=="amount")throw new o(`Unsupported ${t} argument: ${e}.`);let a=B(m.amount);return{tx:T({to:b,chainId:u,value:"0",data:D({abi:x,functionName:"withdrawNative",args:[BigInt(a),d,d]}),description:`Unwrap ${a} dETH base units into the same amount of native ETH for ${d} on chain ${u}.`}),inputs:[{token:b,amount:a}]}}if(t!=="velora_claim_fees")throw new o("Unknown Velora claim action.");for(let a of Object.keys(m))if(!["token","kind"].includes(a))throw new o(`Unsupported ${t} argument: ${a}.`);let f=p(m.token);if(k(f))throw new o("Velora fee claims require an ERC-20 token address.");let c=A(m.kind);return{tx:T({to:c==="delta"?N:U,chainId:u,value:"0",data:D({abi:x,functionName:c==="delta"?"withdrawAllFees":"withdrawAllERC20",args:[f,d]}),description:`Claim the full accrued ${c} fee balance of ${f} to ${d} on chain ${u}. Receipt amount can change before mining; no minimum is encoded.`}),inputs:[]}}function Q(t,m,d,f){let{tx:c}=E(m,d,f),a=t[0];if(t.length!==1||!a||a.chainId!==c.chainId||!v(a.to,c.to)||!v(a.data,c.data)||a.value!==c.value)throw new o("Velora claim calldata, recipient, amount or destination differs from the request.")}function X(t){let m=async()=>{let e=t.clientFor(u);if(await e.getChainId()!==u)throw new o("Velora requires an RPC on chain 4663.");return e};async function d(e){if(e===b)return{address:e,symbol:"dETH",decimals:18,chainId:u};let n=await m(),[s,i]=await Promise.all([y(n,u,e,"symbol"),y(n,u,e,"decimals")]);if(typeof s!="string"||!s.trim()||!Number.isInteger(i)||i<0||i>255)throw new o("Velora fee token metadata is unavailable.");return{address:e,symbol:s,decimals:i,chainId:u}}async function f(e,n){let s=A(e.kind),i=p(e.token);if(k(i))throw new o("Velora fee claims require an ERC-20 token address.");let r=await(await m()).readContract({address:s==="delta"?N:U,abi:x,functionName:s==="delta"?"getCollectedFees":"getBalance",args:s==="delta"?[n,i]:[i,n]});if(typeof r!="bigint"||r<0n||r>H)throw new o("Velora fee balance is unavailable.");return r}function c(e,n,s,i){return{name:e,inputSchema:{type:"object",additionalProperties:!1,properties:n,required:s},execute:async(w,r)=>{try{r=p(r);for(let l of Object.keys(w))if(!Object.hasOwn(n,l))throw new o(`Unsupported ${e} argument: ${l}.`);return await i(w,r)}catch(l){throw new o(t.plainError(l))}}}}let a={token:_,kind:P};return[c("velora_fee_balance",a,["token","kind"],async(e,n)=>({kind:A(e.kind),token:await d(p(e.token)),amount:(await f(e,n)).toString()})),c("velora_claim_fees",a,["token","kind"],async(e,n)=>{let{tx:s}=E("velora_claim_fees",e,n),i=await f(e,n);if(i===0n)throw new o("No accrued Velora fees for this wallet and token.");let w=await d(p(e.token)),r=[s],l=await t.preview(r,n);return{txs:r,preview:l,estimatedReceipt:{token:w,amount:i.toString()},summary:`${s.description} ${l.summary}`}}),c("velora_unwrap_deth",{amount:R("Positive amount of wallet-held dETH in base units (18 decimals).")},["amount"],async(e,n)=>{let{tx:s,inputs:i}=E("velora_unwrap_deth",e,n),r=await(await m()).readContract({address:b,abi:O,functionName:"balanceOf",args:[n]});if(typeof r!="bigint"||r<0n||r>H)throw new o("Wallet dETH balance is unavailable.");if(r<BigInt(i[0].amount))throw new o("Insufficient wallet-held dETH. An active native Delta order must first settle, expire or cancel.");let l=[s],g=await t.preview(l,n);if(g.changes.filter(h=>h.token.chainId===u&&k(h.token.address)).reduce((h,F)=>h+BigInt(F.amount),0n)<BigInt(i[0].amount))throw new o("Velora dETH preview does not return the requested native ETH amount.");return{txs:l,preview:g,summary:`${s.description} ${g.summary}`}})]}export{N as a,b,U as c,x as d,E as e,Q as f,X as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as J,h as K}from"./6YYCGUCU.js";import{a as F}from"./PBQSJSZO.js";import{a as E}from"./5ZLOCQA4.js";import{c as D,d as Y,g as _,i as V,m as Q,n as z}from"./5KUWLUPM.js";import{a as p,i as G,j}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{decodeFunctionData as X,encodeFunctionData as U,erc20Abi as O,getAddress as N,parseAbi as Z}from"viem";var e={router:N("0xf5198743240fac98db71868f34c70139b1eb0474"),factory:N("0xfa5429aeba338bea2bfcc1b9a889862ee395bc28"),pair:N("0x8697bb63743678640710b1270e98772a29642b3c"),weth:N("0x0bd7d308f8e1639fab988df18a8011f41eacad73"),up:N("0x57c0e45cb534413d1c20a4240955d6bb250bb4f1"),eth:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"},L=Z(["function token0() view returns (address)","function token1() view returns (address)","function factory() view returns (address)","function defaultFactory() view returns (address)","function stable() view returns (bool)","function getReserves() view returns (uint112,uint112,uint32)","function poolFor(address,address,bool,address) view returns (address)","function getPool(address,address,bool) view returns (address)","function getAmountsOut(uint256,(address from,address to,bool stable,address factory)[]) view returns (uint256[])","function quoteAddLiquidity(address,address,bool,address,uint256,uint256) view returns (uint256,uint256,uint256)","function addLiquidity(address,address,bool,uint256,uint256,uint256,uint256,address,uint256) returns (uint256,uint256,uint256)","function removeLiquidity(address,address,bool,uint256,uint256,uint256,address,uint256) returns (uint256,uint256)","function swapExactTokensForTokens(uint256,uint256,(address from,address to,bool stable,address factory)[],address,uint256) returns (uint256[])","function deposit() payable"]),ee=Z(["function want() view returns (address)"]),W={vault:D,chainId:{const:p},slippageBps:{type:"integer",minimum:0,maximum:500}},ue=["beefy_swap","beefy_add_liquidity","beefy_remove_liquidity"];function de(s,w){let l=()=>{throw new d("Beefy calldata differs from locally reconstructed inputs, recipient, route or minimums; nothing was signed.")};s.length!==w.length&&l();for(let S=0;S<s.length;S++){let q=s[S],v=w[S];if((q.chainId!==v.chainId||!_(q.to,v.to)||q.value!==v.value)&&l(),!_(q.data,v.data))try{let B=X({abi:L,data:q.data}),n=X({abi:L,data:v.data});(B.functionName!==n.functionName||!B.args||!n.args)&&l();let t=[...B.args],a=n.args,r=B.functionName==="swapExactTokensForTokens"?[1]:B.functionName==="addLiquidity"?[5,6]:B.functionName==="removeLiquidity"?[4,5]:l(),i=U({abi:L,functionName:B.functionName,args:t});_(i,q.data)||l();let u=t.length-1;(f(t[u])<=f(a[u])-600n||f(t[u])>f(a[u]))&&l(),t[u]=a[u];for(let o of r)f(t[o])<f(a[o])&&l(),t[o]=a[o];_(U({abi:L,functionName:B.functionName,args:t}),v.data)||l()}catch{l()}}}function y(s){return V(s,"Provide a token or vault address.",Y)}function R(s){return z(s,"Amount must be positive and fit in uint256.",{notString:"Provide a positive base-unit integer string.",positive:!0})}function f(s){return Q(s,"Invalid Beefy liquidity integer.")}function M(s){let w=s??50;if(typeof w!="number"||!Number.isInteger(w)||w<0||w>500)throw new d("Use integer slippageBps from 0 to 500.");return BigInt(w)}function H(s,w){let l=s*(10000n-w)/10000n;if(l===0n)throw new d("The liquidity amount is too small for a positive minimum output.");return l}var ce=s=>{async function w(n){try{return await n()}catch(t){throw new d(s.plainError(t))}}function l(n,t){if(n.chainId!==void 0&&n.chainId!==p)throw new d("Beefy requires chain 4663.");for(let a of Object.keys(n))if(!["vault","chainId",...t].includes(a))throw new d(`Unsupported Beefy input: ${a}.`);if(y(n.vault)!==N(G[p].vaults.beefyTestedLpVault.address))throw new d("Beefy LP routes are qualified only for up33-weth-up.")}async function S(){let n=s.clientFor(p);if(await n.getChainId()!==p)throw new d("The Beefy endpoint must report chain 4663.");let t=f(await n.getBlockNumber()),a=await n.getBlock({blockNumber:t}),r=f(a.timestamp)+600n,i=(P,g,A=[])=>n.readContract({address:P,abi:L,functionName:g,args:A,blockNumber:t}),[u,o,m,c,h,b]=await Promise.all([i(e.pair,"token0"),i(e.pair,"token1"),i(e.pair,"factory"),i(e.router,"defaultFactory"),i(e.pair,"stable"),n.readContract({address:G[p].vaults.beefyTestedLpVault.address,abi:ee,functionName:"want",blockNumber:t})]);if(y(u)!==e.weth||y(o)!==e.up||y(m)!==e.factory||y(c)!==e.factory||h!==!1||y(b)!==e.pair)throw new d("The Beefy LP, vault or router no longer matches the qualified route.");if(y(await i(e.router,"poolFor",[e.weth,e.up,!1,e.factory]))!==e.pair)throw new d("The router selects a different Beefy LP.");let k=async(P,g)=>f(await n.readContract({address:P,abi:O,functionName:"balanceOf",args:[g],blockNumber:t}));async function T(P){let[g,A]=await Promise.all([n.readContract({address:P,abi:O,functionName:"symbol",blockNumber:t}),n.readContract({address:P,abi:O,functionName:"decimals",blockNumber:t})]);if(typeof g!="string"||!g.trim()||typeof A!="number"||!Number.isInteger(A)||A<0||A>255)throw new d("Invalid Beefy constituent metadata.");return{address:P,symbol:g,decimals:A,chainId:p}}return{client:n,blockNumber:t,deadline:r,read:i,balance:k,token:T}}async function q(n,t,a){let r=await s.preview(n,t);return{txs:n,preview:r,summary:`${a} ${r.summary} Re-read balances after mining each step; these transactions are separate and earlier steps can remain mined if a later step fails. Gas is additional.`}}function v(n,t,a,r="0"){return s.unsignedTx({to:n,data:t,value:r,description:a,chainId:p})}return{tools:[{name:"beefy_lp",inputSchema:{type:"object",properties:{vault:D,chainId:{const:p},amount:{...E(),description:"Optional CLM entry budget in the bridge token base units."},slippageBps:W.slippageBps},required:["vault"],additionalProperties:!1},execute:(n,t)=>w(async()=>{if(J.some(b=>_(b.vault,y(n.vault))))return K(s).tools[0].execute(n,t);l(n,[]),F(t);let a=await S(),[r,i,u,o,m,c,h]=await Promise.all([a.token(e.weth),a.token(e.up),a.token(e.pair),a.read(e.pair,"getReserves"),a.balance(e.weth,t),a.balance(e.up,t),a.balance(e.pair,t)]);if(!Array.isArray(o)||o.length!==3)throw new d("Invalid Beefy LP reserves.");return{chainId:p,vault:y(n.vault),router:e.router,factory:e.factory,stable:!1,constituents:[{token:r,balance:m.toString(),reserve:f(o[0]).toString()},{token:i,balance:c.toString(),reserve:f(o[1]).toString()}],lp:{token:u,balance:h.toString()},block:a.blockNumber.toString(),summary:"Acquire WETH and UP with beefy_swap; add with beefy_add_liquidity, then deposit the mined LP balance with beefy_deposit. Withdraw moo shares, remove LP with beefy_remove_liquidity, then swap constituents to USDG. Every action requires its own preview and local confirmation."}})},{name:"beefy_swap",inputSchema:{type:"object",properties:{...W,from:D,to:D,amount:E()},required:["vault","from","to","amount"],additionalProperties:!1},execute:(n,t)=>w(async()=>{l(n,["from","to","amount","slippageBps"]),F(t);let a=y(n.from),r=y(n.to),i=R(n.amount),u=M(n.slippageBps),o=[e.weth,e.up,N(j)],m=a.toLowerCase()===e.eth;if(!m&&!o.includes(a)||!o.includes(r)||a===r)throw new d("Use ETH, WETH, UP or USDG as input and a different WETH, UP or USDG output.");let c=await S();if((m?await c.client.getBalance({address:t,blockNumber:c.blockNumber}):await c.balance(a,t))<i)throw new d("Insufficient Beefy swap input balance; keep ETH for gas.");let h=[];m&&h.push(v(e.weth,U({abi:L,functionName:"deposit"}),`Wrap ${i} ETH base units for the Beefy LP workflow.`,i.toString()));let b=m?e.weth:a,k=i,T=i;if(b!==r){let g=b===e.weth||r===e.weth?[b,r]:[b,e.weth,r],A=[];for(let I=0;I<g.length-1;I++){let C={from:g[I],to:g[I+1],stable:!1,factory:e.factory},$=y(await c.read(e.factory,"getPool",[C.from,C.to,!1]));if($==="0x0000000000000000000000000000000000000000"||$!==y(await c.read(e.router,"poolFor",[C.from,C.to,!1,e.factory])))throw new d("No verified Up33 route for these Beefy constituents.");A.push(C)}let x=await c.read(e.router,"getAmountsOut",[i,A]);if(!Array.isArray(x)||x.length!==g.length||f(x[0])!==i)throw new d("Invalid Beefy constituent quote.");for(let I of x)if(f(I)===0n)throw new d("No liquidity for this Beefy constituent swap.");k=f(x.at(-1)),T=H(k,u),h.push(s.approval(b,e.router,i.toString(),p)),h.push(v(e.router,U({abi:L,functionName:"swapExactTokensForTokens",args:[i,T,A,t,c.deadline]}),`Swap ${i} constituent base units; receive at least ${T} output base units.`))}let P=await c.token(r);return{...await q(h,t,"Prepare or convert Beefy LP constituents using the verified Up33 router."),output:{token:P,amount:k.toString()},minimumOutput:{token:P,amount:T.toString()},deadline:c.deadline.toString()}})},{name:"beefy_add_liquidity",inputSchema:{type:"object",properties:{...W,amount0:E(),amount1:E()},required:["vault","amount0","amount1"],additionalProperties:!1},execute:(n,t)=>w(async()=>{l(n,["amount0","amount1","slippageBps"]),F(t);let a=R(n.amount0),r=R(n.amount1),i=M(n.slippageBps),u=await S();if(await u.balance(e.weth,t)<a||await u.balance(e.up,t)<r)throw new d("Acquire the WETH and UP constituents with beefy_swap, then retry with their mined balances.");let o=await u.read(e.router,"quoteAddLiquidity",[e.weth,e.up,!1,e.factory,a,r]);if(!Array.isArray(o)||o.length!==3)throw new d("Invalid Beefy add-liquidity quote.");let m=f(o[0]),c=f(o[1]),h=f(o[2]);if(m>a||c>r||h===0n)throw new d("Invalid Beefy add-liquidity amounts.");let b=H(m,i),k=H(c,i),T=[s.approval(e.weth,e.router,a.toString(),p),s.approval(e.up,e.router,r.toString(),p),v(e.router,U({abi:L,functionName:"addLiquidity",args:[e.weth,e.up,!1,a,r,b,k,t,u.deadline]}),"Mint the supported Beefy want LP directly to the calling wallet."),s.approval(e.weth,e.router,"0",p),s.approval(e.up,e.router,"0",p)];return{...await q(T,t,"Mint UP\u2013WETH LP. The router may use less than the approved desired amounts; final revocations clear unused allowances. Deposit the actual LP received in a separate beefy_deposit call."),output:{token:await u.token(e.pair),amount:h.toString()},minimumInputs:[{token:await u.token(e.weth),amount:b.toString()},{token:await u.token(e.up),amount:k.toString()}],deadline:u.deadline.toString()}})},{name:"beefy_remove_liquidity",inputSchema:{type:"object",properties:{...W,amount:{anyOf:[E(),{const:"all"}]}},required:["vault","amount"],additionalProperties:!1},execute:(n,t)=>w(async()=>{l(n,["amount","slippageBps"]),F(t);let a=M(n.slippageBps),r=n.amount==="all"?void 0:R(n.amount),i=await S(),u=await i.balance(e.pair,t),o=r??u;if(o===0n||o>u)throw new d("Withdraw your moo shares first, then provide a positive LP amount no greater than the fresh LP balance.");let[m,c,h]=await Promise.all([i.client.readContract({address:e.pair,abi:O,functionName:"totalSupply",blockNumber:i.blockNumber}),i.balance(e.weth,e.pair),i.balance(e.up,e.pair)]);if(f(m)===0n||o>m)throw new d("Invalid Beefy LP total supply.");let b=H(c*o/m,a),k=H(h*o/m,a),T=[s.approval(e.pair,e.router,o.toString(),p),v(e.router,U({abi:L,functionName:"removeLiquidity",args:[e.weth,e.up,!1,o,b,k,t,i.deadline]}),"Burn Beefy want LP and return WETH and UP to the calling wallet.")];return{...await q(T,t,"Remove UP\u2013WETH liquidity. Convert actual received constituents to USDG with beefy_swap after mining."),minimumOutputs:[{token:await i.token(e.weth),amount:b.toString()},{token:await i.token(e.up),amount:k.toString()}],deadline:i.deadline.toString()}})}]}};export{e as a,L as b,ue as c,de as d,ce as e};
|
|
1
|
+
import{a as J,h as K}from"./QQECG3WP.js";import{a as F}from"./43LI5NKJ.js";import{a as E}from"./66F5ZH34.js";import{c as D,d as Y,g as _,i as V,m as Q,n as z}from"./NWNYJ26T.js";import{a as p,i as G,j}from"./FWD4L3CJ.js";import{a as d}from"./XSD5NL7J.js";import{decodeFunctionData as X,encodeFunctionData as U,erc20Abi as O,getAddress as N,parseAbi as Z}from"viem";var e={router:N("0xf5198743240fac98db71868f34c70139b1eb0474"),factory:N("0xfa5429aeba338bea2bfcc1b9a889862ee395bc28"),pair:N("0x8697bb63743678640710b1270e98772a29642b3c"),weth:N("0x0bd7d308f8e1639fab988df18a8011f41eacad73"),up:N("0x57c0e45cb534413d1c20a4240955d6bb250bb4f1"),eth:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"},L=Z(["function token0() view returns (address)","function token1() view returns (address)","function factory() view returns (address)","function defaultFactory() view returns (address)","function stable() view returns (bool)","function getReserves() view returns (uint112,uint112,uint32)","function poolFor(address,address,bool,address) view returns (address)","function getPool(address,address,bool) view returns (address)","function getAmountsOut(uint256,(address from,address to,bool stable,address factory)[]) view returns (uint256[])","function quoteAddLiquidity(address,address,bool,address,uint256,uint256) view returns (uint256,uint256,uint256)","function addLiquidity(address,address,bool,uint256,uint256,uint256,uint256,address,uint256) returns (uint256,uint256,uint256)","function removeLiquidity(address,address,bool,uint256,uint256,uint256,address,uint256) returns (uint256,uint256)","function swapExactTokensForTokens(uint256,uint256,(address from,address to,bool stable,address factory)[],address,uint256) returns (uint256[])","function deposit() payable"]),ee=Z(["function want() view returns (address)"]),W={vault:D,chainId:{const:p},slippageBps:{type:"integer",minimum:0,maximum:500}},ue=["beefy_swap","beefy_add_liquidity","beefy_remove_liquidity"];function de(s,w){let l=()=>{throw new d("Beefy calldata differs from locally reconstructed inputs, recipient, route or minimums; nothing was signed.")};s.length!==w.length&&l();for(let S=0;S<s.length;S++){let q=s[S],v=w[S];if((q.chainId!==v.chainId||!_(q.to,v.to)||q.value!==v.value)&&l(),!_(q.data,v.data))try{let B=X({abi:L,data:q.data}),n=X({abi:L,data:v.data});(B.functionName!==n.functionName||!B.args||!n.args)&&l();let t=[...B.args],a=n.args,r=B.functionName==="swapExactTokensForTokens"?[1]:B.functionName==="addLiquidity"?[5,6]:B.functionName==="removeLiquidity"?[4,5]:l(),i=U({abi:L,functionName:B.functionName,args:t});_(i,q.data)||l();let u=t.length-1;(f(t[u])<=f(a[u])-600n||f(t[u])>f(a[u]))&&l(),t[u]=a[u];for(let o of r)f(t[o])<f(a[o])&&l(),t[o]=a[o];_(U({abi:L,functionName:B.functionName,args:t}),v.data)||l()}catch{l()}}}function y(s){return V(s,"Provide a token or vault address.",Y)}function R(s){return z(s,"Amount must be positive and fit in uint256.",{notString:"Provide a positive base-unit integer string.",positive:!0})}function f(s){return Q(s,"Invalid Beefy liquidity integer.")}function M(s){let w=s??50;if(typeof w!="number"||!Number.isInteger(w)||w<0||w>500)throw new d("Use integer slippageBps from 0 to 500.");return BigInt(w)}function H(s,w){let l=s*(10000n-w)/10000n;if(l===0n)throw new d("The liquidity amount is too small for a positive minimum output.");return l}var ce=s=>{async function w(n){try{return await n()}catch(t){throw new d(s.plainError(t))}}function l(n,t){if(n.chainId!==void 0&&n.chainId!==p)throw new d("Beefy requires chain 4663.");for(let a of Object.keys(n))if(!["vault","chainId",...t].includes(a))throw new d(`Unsupported Beefy input: ${a}.`);if(y(n.vault)!==N(G[p].vaults.beefyTestedLpVault.address))throw new d("Beefy LP routes are qualified only for up33-weth-up.")}async function S(){let n=s.clientFor(p);if(await n.getChainId()!==p)throw new d("The Beefy endpoint must report chain 4663.");let t=f(await n.getBlockNumber()),a=await n.getBlock({blockNumber:t}),r=f(a.timestamp)+600n,i=(P,g,A=[])=>n.readContract({address:P,abi:L,functionName:g,args:A,blockNumber:t}),[u,o,m,c,h,b]=await Promise.all([i(e.pair,"token0"),i(e.pair,"token1"),i(e.pair,"factory"),i(e.router,"defaultFactory"),i(e.pair,"stable"),n.readContract({address:G[p].vaults.beefyTestedLpVault.address,abi:ee,functionName:"want",blockNumber:t})]);if(y(u)!==e.weth||y(o)!==e.up||y(m)!==e.factory||y(c)!==e.factory||h!==!1||y(b)!==e.pair)throw new d("The Beefy LP, vault or router no longer matches the qualified route.");if(y(await i(e.router,"poolFor",[e.weth,e.up,!1,e.factory]))!==e.pair)throw new d("The router selects a different Beefy LP.");let k=async(P,g)=>f(await n.readContract({address:P,abi:O,functionName:"balanceOf",args:[g],blockNumber:t}));async function T(P){let[g,A]=await Promise.all([n.readContract({address:P,abi:O,functionName:"symbol",blockNumber:t}),n.readContract({address:P,abi:O,functionName:"decimals",blockNumber:t})]);if(typeof g!="string"||!g.trim()||typeof A!="number"||!Number.isInteger(A)||A<0||A>255)throw new d("Invalid Beefy constituent metadata.");return{address:P,symbol:g,decimals:A,chainId:p}}return{client:n,blockNumber:t,deadline:r,read:i,balance:k,token:T}}async function q(n,t,a){let r=await s.preview(n,t);return{txs:n,preview:r,summary:`${a} ${r.summary} Re-read balances after mining each step; these transactions are separate and earlier steps can remain mined if a later step fails. Gas is additional.`}}function v(n,t,a,r="0"){return s.unsignedTx({to:n,data:t,value:r,description:a,chainId:p})}return{tools:[{name:"beefy_lp",inputSchema:{type:"object",properties:{vault:D,chainId:{const:p},amount:{...E(),description:"Optional CLM entry budget in the bridge token base units."},slippageBps:W.slippageBps},required:["vault"],additionalProperties:!1},execute:(n,t)=>w(async()=>{if(J.some(b=>_(b.vault,y(n.vault))))return K(s).tools[0].execute(n,t);l(n,[]),F(t);let a=await S(),[r,i,u,o,m,c,h]=await Promise.all([a.token(e.weth),a.token(e.up),a.token(e.pair),a.read(e.pair,"getReserves"),a.balance(e.weth,t),a.balance(e.up,t),a.balance(e.pair,t)]);if(!Array.isArray(o)||o.length!==3)throw new d("Invalid Beefy LP reserves.");return{chainId:p,vault:y(n.vault),router:e.router,factory:e.factory,stable:!1,constituents:[{token:r,balance:m.toString(),reserve:f(o[0]).toString()},{token:i,balance:c.toString(),reserve:f(o[1]).toString()}],lp:{token:u,balance:h.toString()},block:a.blockNumber.toString(),summary:"Acquire WETH and UP with beefy_swap; add with beefy_add_liquidity, then deposit the mined LP balance with beefy_deposit. Withdraw moo shares, remove LP with beefy_remove_liquidity, then swap constituents to USDG. Every action requires its own preview and local confirmation."}})},{name:"beefy_swap",inputSchema:{type:"object",properties:{...W,from:D,to:D,amount:E()},required:["vault","from","to","amount"],additionalProperties:!1},execute:(n,t)=>w(async()=>{l(n,["from","to","amount","slippageBps"]),F(t);let a=y(n.from),r=y(n.to),i=R(n.amount),u=M(n.slippageBps),o=[e.weth,e.up,N(j)],m=a.toLowerCase()===e.eth;if(!m&&!o.includes(a)||!o.includes(r)||a===r)throw new d("Use ETH, WETH, UP or USDG as input and a different WETH, UP or USDG output.");let c=await S();if((m?await c.client.getBalance({address:t,blockNumber:c.blockNumber}):await c.balance(a,t))<i)throw new d("Insufficient Beefy swap input balance; keep ETH for gas.");let h=[];m&&h.push(v(e.weth,U({abi:L,functionName:"deposit"}),`Wrap ${i} ETH base units for the Beefy LP workflow.`,i.toString()));let b=m?e.weth:a,k=i,T=i;if(b!==r){let g=b===e.weth||r===e.weth?[b,r]:[b,e.weth,r],A=[];for(let I=0;I<g.length-1;I++){let C={from:g[I],to:g[I+1],stable:!1,factory:e.factory},$=y(await c.read(e.factory,"getPool",[C.from,C.to,!1]));if($==="0x0000000000000000000000000000000000000000"||$!==y(await c.read(e.router,"poolFor",[C.from,C.to,!1,e.factory])))throw new d("No verified Up33 route for these Beefy constituents.");A.push(C)}let x=await c.read(e.router,"getAmountsOut",[i,A]);if(!Array.isArray(x)||x.length!==g.length||f(x[0])!==i)throw new d("Invalid Beefy constituent quote.");for(let I of x)if(f(I)===0n)throw new d("No liquidity for this Beefy constituent swap.");k=f(x.at(-1)),T=H(k,u),h.push(s.approval(b,e.router,i.toString(),p)),h.push(v(e.router,U({abi:L,functionName:"swapExactTokensForTokens",args:[i,T,A,t,c.deadline]}),`Swap ${i} constituent base units; receive at least ${T} output base units.`))}let P=await c.token(r);return{...await q(h,t,"Prepare or convert Beefy LP constituents using the verified Up33 router."),output:{token:P,amount:k.toString()},minimumOutput:{token:P,amount:T.toString()},deadline:c.deadline.toString()}})},{name:"beefy_add_liquidity",inputSchema:{type:"object",properties:{...W,amount0:E(),amount1:E()},required:["vault","amount0","amount1"],additionalProperties:!1},execute:(n,t)=>w(async()=>{l(n,["amount0","amount1","slippageBps"]),F(t);let a=R(n.amount0),r=R(n.amount1),i=M(n.slippageBps),u=await S();if(await u.balance(e.weth,t)<a||await u.balance(e.up,t)<r)throw new d("Acquire the WETH and UP constituents with beefy_swap, then retry with their mined balances.");let o=await u.read(e.router,"quoteAddLiquidity",[e.weth,e.up,!1,e.factory,a,r]);if(!Array.isArray(o)||o.length!==3)throw new d("Invalid Beefy add-liquidity quote.");let m=f(o[0]),c=f(o[1]),h=f(o[2]);if(m>a||c>r||h===0n)throw new d("Invalid Beefy add-liquidity amounts.");let b=H(m,i),k=H(c,i),T=[s.approval(e.weth,e.router,a.toString(),p),s.approval(e.up,e.router,r.toString(),p),v(e.router,U({abi:L,functionName:"addLiquidity",args:[e.weth,e.up,!1,a,r,b,k,t,u.deadline]}),"Mint the supported Beefy want LP directly to the calling wallet."),s.approval(e.weth,e.router,"0",p),s.approval(e.up,e.router,"0",p)];return{...await q(T,t,"Mint UP\u2013WETH LP. The router may use less than the approved desired amounts; final revocations clear unused allowances. Deposit the actual LP received in a separate beefy_deposit call."),output:{token:await u.token(e.pair),amount:h.toString()},minimumInputs:[{token:await u.token(e.weth),amount:b.toString()},{token:await u.token(e.up),amount:k.toString()}],deadline:u.deadline.toString()}})},{name:"beefy_remove_liquidity",inputSchema:{type:"object",properties:{...W,amount:{anyOf:[E(),{const:"all"}]}},required:["vault","amount"],additionalProperties:!1},execute:(n,t)=>w(async()=>{l(n,["amount","slippageBps"]),F(t);let a=M(n.slippageBps),r=n.amount==="all"?void 0:R(n.amount),i=await S(),u=await i.balance(e.pair,t),o=r??u;if(o===0n||o>u)throw new d("Withdraw your moo shares first, then provide a positive LP amount no greater than the fresh LP balance.");let[m,c,h]=await Promise.all([i.client.readContract({address:e.pair,abi:O,functionName:"totalSupply",blockNumber:i.blockNumber}),i.balance(e.weth,e.pair),i.balance(e.up,e.pair)]);if(f(m)===0n||o>m)throw new d("Invalid Beefy LP total supply.");let b=H(c*o/m,a),k=H(h*o/m,a),T=[s.approval(e.pair,e.router,o.toString(),p),v(e.router,U({abi:L,functionName:"removeLiquidity",args:[e.weth,e.up,!1,o,b,k,t,i.deadline]}),"Burn Beefy want LP and return WETH and UP to the calling wallet.")];return{...await q(T,t,"Remove UP\u2013WETH liquidity. Convert actual received constituents to USDG with beefy_swap after mining."),minimumOutputs:[{token:await i.token(e.weth),amount:b.toString()},{token:await i.token(e.up),amount:k.toString()}],deadline:i.deadline.toString()}})}]}};export{e as a,L as b,ue as c,de as d,ce as e};
|