@oakagentkit/core 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/api/addresses.d.ts +112 -0
- package/build/dist/api/addresses.js +1 -1
- 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/cache.js +1 -1
- package/build/dist/api/canonical.js +1 -1
- package/build/dist/api/chain.js +1 -1
- package/build/dist/api/deployments.js +1 -1
- package/build/dist/api/errors.d.ts +1 -0
- package/build/dist/api/errors.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/identity-link.d.ts +1 -0
- package/build/dist/api/identity-link.js +1 -1
- package/build/dist/api/launch.js +1 -1
- package/build/dist/api/merkle.js +1 -1
- package/build/dist/api/metadata.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 +32 -0
- package/build/dist/api/modules/borro/reader.js +1 -0
- package/build/dist/api/modules/borro/types.d.ts +120 -0
- package/build/dist/api/modules/borro/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 +114 -0
- package/build/dist/api/modules/earn/copy.js +1 -0
- package/build/dist/api/modules/earn/cost.d.ts +47 -0
- package/build/dist/api/modules/earn/cost.js +1 -0
- package/build/dist/api/modules/earn/index.d.ts +8 -0
- package/build/dist/api/modules/earn/index.js +1 -0
- package/build/dist/api/modules/earn/lp.d.ts +17 -0
- package/build/dist/api/modules/earn/lp.js +1 -0
- package/build/dist/api/modules/earn/options.d.ts +36 -0
- package/build/dist/api/modules/earn/options.js +1 -0
- package/build/dist/api/modules/earn/types.d.ts +39 -0
- package/build/dist/api/modules/earn/types.js +0 -0
- package/build/dist/api/modules/erc8004/abi.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/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/backoff.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/freshness.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/status-labels.d.ts +1 -1
- package/build/dist/api/modules/heyresearch/status-labels.js +1 -1
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
- package/build/dist/api/modules/hoodag/chain-reads.js +1 -1
- package/build/dist/api/modules/hoodag/index.js +1 -1
- package/build/dist/api/modules/hoodag/management.js +1 -1
- package/build/dist/api/modules/hoodag/public-reads.js +1 -1
- package/build/dist/api/modules/hoodag/reconstruct.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.js +1 -1
- package/build/dist/api/modules/hoodlock/buyback.js +1 -1
- package/build/dist/api/modules/hoodlock/commerce.js +1 -1
- package/build/dist/api/modules/hoodlock/fee.js +1 -1
- package/build/dist/api/modules/hoodlock/guard.js +1 -1
- package/build/dist/api/modules/hoodlock/index.js +1 -1
- package/build/dist/api/modules/hoodlock/lifecycle.js +1 -1
- package/build/dist/api/modules/hoodlock/locks-burn.js +1 -1
- package/build/dist/api/modules/hoodlock/public.js +1 -1
- package/build/dist/api/modules/hookr/actions.js +1 -1
- package/build/dist/api/modules/hookr/addons.js +1 -1
- package/build/dist/api/modules/hookr/agent-gate.js +1 -1
- package/build/dist/api/modules/hookr/contracts.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-profile.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/pins.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/abi.d.ts +165 -0
- package/build/dist/api/modules/layerbank/abi.js +1 -0
- package/build/dist/api/modules/layerbank/actions.d.ts +2 -0
- package/build/dist/api/modules/layerbank/actions.js +1 -0
- package/build/dist/api/modules/layerbank/checks.d.ts +21 -0
- package/build/dist/api/modules/layerbank/checks.js +1 -0
- package/build/dist/api/modules/layerbank/index.d.ts +2 -0
- package/build/dist/api/modules/layerbank/index.js +1 -0
- package/build/dist/api/modules/layerbank/merkl.d.ts +6 -0
- package/build/dist/api/modules/layerbank/merkl.js +1 -0
- package/build/dist/api/modules/layerbank/reader.d.ts +15 -0
- package/build/dist/api/modules/layerbank/reader.js +1 -0
- package/build/dist/api/modules/layerbank/reserve.d.ts +13 -0
- package/build/dist/api/modules/layerbank/reserve.js +1 -0
- 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-abi.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-abi.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/surface.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/blackjack-hashes.js +1 -1
- package/build/dist/api/modules/netnet/card-abi.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-policy.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action-abi.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.js +1 -1
- package/build/dist/api/modules/netnet/desk-read.js +1 -1
- package/build/dist/api/modules/netnet/desk-registry.js +1 -1
- package/build/dist/api/modules/netnet/financial-abi.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/pins.js +1 -1
- package/build/dist/api/modules/orbio/positions.d.ts +2 -0
- package/build/dist/api/modules/orbio/positions.js +1 -0
- package/build/dist/api/modules/pendle/abi.d.ts +205 -0
- package/build/dist/api/modules/pendle/abi.js +1 -0
- package/build/dist/api/modules/pendle/convert.d.ts +24 -0
- package/build/dist/api/modules/pendle/convert.js +1 -0
- package/build/dist/api/modules/pendle/costs.d.ts +3 -0
- package/build/dist/api/modules/pendle/costs.js +1 -0
- package/build/dist/api/modules/pendle/index.d.ts +11 -0
- package/build/dist/api/modules/pendle/index.js +1 -0
- package/build/dist/api/modules/pendle/markets.d.ts +37 -0
- package/build/dist/api/modules/pendle/markets.js +1 -0
- package/build/dist/api/modules/pendle/positions.d.ts +18 -0
- package/build/dist/api/modules/pendle/positions.js +1 -0
- package/build/dist/api/modules/pendle/pricecheck.d.ts +95 -0
- package/build/dist/api/modules/pendle/pricecheck.js +1 -0
- package/build/dist/api/modules/pendle/reader.d.ts +17 -0
- package/build/dist/api/modules/pendle/reader.js +1 -0
- package/build/dist/api/modules/pendle/redeem.d.ts +15 -0
- package/build/dist/api/modules/pendle/redeem.js +1 -0
- package/build/dist/api/modules/pendle/trade.d.ts +2 -0
- package/build/dist/api/modules/pendle/trade.js +1 -0
- package/build/dist/api/modules/pendle/types.d.ts +41 -0
- package/build/dist/api/modules/pendle/types.js +0 -0
- package/build/dist/api/modules/pendle/validate.d.ts +424 -0
- package/build/dist/api/modules/pendle/validate.js +1 -0
- package/build/dist/api/modules/pendle/verify.d.ts +22 -0
- package/build/dist/api/modules/pendle/verify.js +1 -0
- package/build/dist/api/modules/pons/claim.js +1 -1
- package/build/dist/api/modules/pons/holder-directory.js +1 -1
- package/build/dist/api/modules/pons/index.js +1 -1
- package/build/dist/api/modules/pons/launch-status.js +1 -1
- package/build/dist/api/modules/pons/prices.js +1 -1
- package/build/dist/api/modules/pons/reads.d.ts +38 -2
- 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.d.ts +4 -0
- package/build/dist/api/modules/priors/holdings.js +1 -0
- 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/share-symbol.d.ts +3 -0
- package/build/dist/api/modules/steakhouse/share-symbol.js +1 -0
- package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
- package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
- package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
- package/build/dist/api/modules/tickerspring/discovery.js +1 -1
- package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
- package/build/dist/api/modules/tickerspring/guards.js +1 -1
- package/build/dist/api/modules/tickerspring/index.js +1 -1
- package/build/dist/api/modules/tickerspring/journeys.js +1 -1
- package/build/dist/api/modules/tickerspring/ladder.js +1 -1
- package/build/dist/api/modules/tickerspring/maker.js +1 -1
- package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
- package/build/dist/api/modules/tickerspring/research.js +1 -1
- package/build/dist/api/modules/tickerspring/strategies.js +1 -1
- package/build/dist/api/modules/uniswap/auction-create.js +1 -1
- package/build/dist/api/modules/uniswap/auction.js +1 -1
- package/build/dist/api/modules/uniswap/batch.js +1 -1
- package/build/dist/api/modules/uniswap/common.js +1 -1
- package/build/dist/api/modules/uniswap/fees.js +1 -1
- package/build/dist/api/modules/uniswap/index.js +1 -1
- package/build/dist/api/modules/uniswap/local-guard.js +1 -1
- package/build/dist/api/modules/uniswap/oracle.js +1 -1
- package/build/dist/api/modules/uniswap/pool-math.js +1 -1
- package/build/dist/api/modules/uniswap/pools.js +1 -1
- package/build/dist/api/modules/uniswap/position.js +1 -1
- package/build/dist/api/modules/uniswap/protocol.js +1 -1
- package/build/dist/api/modules/uniswap/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 -0
- 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.js +1 -1
- package/build/dist/api/modules/wormhole/license.js +1 -1
- package/build/dist/api/modules/wormhole/quotetext.js +1 -1
- package/build/dist/api/modules/wormhole/scan-text.js +1 -1
- package/build/dist/api/modules/wormhole/token-check.js +1 -1
- package/build/dist/api/owner-signature.js +1 -1
- package/build/dist/api/positions.d.ts +5 -5
- 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/reads.js +1 -1
- package/build/dist/api/routes.js +1 -1
- package/build/dist/api/rpc.js +1 -1
- package/build/dist/api/secret-fields.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/signing.js +1 -1
- package/build/dist/api/simulate.js +1 -1
- package/build/dist/api/swap.js +1 -1
- package/build/dist/api/token-output.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 +7 -2
- package/build/dist/api/untrusted.js +1 -1
- package/build/dist/api/vendor-limits.js +1 -1
- package/build/dist/chunks/{PEA32CWB.js → 2KYAMXTS.js} +1 -1
- package/build/dist/chunks/2MAMJJJC.js +1 -0
- package/build/dist/chunks/2MZXTOZU.js +1 -0
- package/build/dist/chunks/{VC2RCYQE.js → 2TK3ETUO.js} +1 -1
- package/build/dist/chunks/{LKJBMHCE.js → 326QMOTR.js} +1 -1
- package/build/dist/chunks/{OE3CLZHR.js → 3FUVMSCF.js} +1 -1
- package/build/dist/chunks/{3EFV4FQF.js → 3GOHSYHW.js} +1 -1
- package/build/dist/chunks/{CY75R4FK.js → 3MLUCYCB.js} +1 -1
- package/build/dist/chunks/{5O5ZE3ZV.js → 3NJ5KQ3Q.js} +1 -1
- package/build/dist/chunks/{EVANKNJV.js → 3XNZUIRU.js} +1 -1
- package/build/dist/chunks/3XXBLNEX.js +1 -0
- package/build/dist/chunks/{6IM6A5VA.js → 43LI5NKJ.js} +1 -1
- package/build/dist/chunks/{YZSTP2E6.js → 45BRW2ZF.js} +1 -1
- package/build/dist/chunks/46547QT3.js +1 -0
- package/build/dist/chunks/{C3TJLARP.js → 46KWRAYK.js} +1 -1
- package/build/dist/chunks/{SOYQOE5P.js → 4BVP652W.js} +1 -1
- package/build/dist/chunks/4HG6FRVH.js +1 -0
- package/build/dist/chunks/4MXM6Q4W.js +1 -0
- package/build/dist/chunks/{NWSPC3NH.js → 4PY3UFNR.js} +1 -1
- package/build/dist/chunks/52ELWNXJ.js +2 -0
- package/build/dist/chunks/{O5IVZHHP.js → 553UE2ZQ.js} +1 -1
- package/build/dist/chunks/{FUXT7GRK.js → 57MEFFCU.js} +1 -1
- package/build/dist/chunks/{XWEFKXKA.js → 5APS4T2D.js} +1 -1
- package/build/dist/chunks/{3RFSGU2Y.js → 5CAAFU7R.js} +1 -1
- package/build/dist/chunks/{6AWTAE4Q.js → 5SMVQCAP.js} +1 -1
- package/build/dist/chunks/63YRSLDK.js +1 -0
- package/build/dist/chunks/{53N7PNJH.js → 64GOINYS.js} +1 -1
- package/build/dist/chunks/66F5ZH34.js +1 -0
- package/build/dist/chunks/{6ZYLNB2B.js → 6B3VVISQ.js} +1 -1
- package/build/dist/chunks/6D5DJA5B.js +1 -0
- package/build/dist/chunks/{DZGEQBO7.js → 6I4NTKB2.js} +1 -1
- package/build/dist/chunks/{DCTUYDWF.js → 6OGDTEGH.js} +1 -1
- package/build/dist/chunks/6PBGEPUK.js +20 -0
- package/build/dist/chunks/{E7R3J4H7.js → 6WD4HHID.js} +1 -1
- package/build/dist/chunks/{RAKUK5VR.js → 6WZX7C4T.js} +1 -1
- package/build/dist/chunks/{MKQVS3IO.js → 74Y2KDNR.js} +1 -1
- package/build/dist/chunks/{AMICUXS6.js → 7WSHW7KW.js} +1 -1
- package/build/dist/chunks/A3PN3PK3.js +1 -0
- package/build/dist/chunks/{CXLEQCP3.js → ABPL3ZZI.js} +1 -1
- package/build/dist/chunks/{YQUKU2LS.js → AFBEZXNV.js} +1 -1
- package/build/dist/chunks/AKYF5264.js +7 -0
- package/build/dist/chunks/{ASDKY5NX.js → APGLZXIW.js} +1 -1
- package/build/dist/chunks/{UNZRE3YU.js → AVG4W3Y7.js} +1 -1
- package/build/dist/chunks/{VFKNXQXI.js → B3RXD5ET.js} +1 -1
- package/build/dist/chunks/{V5LTA42G.js → BBS3ODWZ.js} +1 -1
- package/build/dist/chunks/{U3F6DDML.js → BJ2VGRF4.js} +1 -1
- package/build/dist/chunks/{VFSRRDLY.js → BTD5SMOW.js} +1 -1
- package/build/dist/chunks/{PTAWEHKB.js → BTPXJAUX.js} +1 -1
- package/build/dist/chunks/{R53P2K3C.js → C36BFZH6.js} +1 -1
- package/build/dist/chunks/{L62M7LOB.js → C5ZZAYXD.js} +1 -1
- package/build/dist/chunks/{VVEUJ36E.js → C7AXJHBT.js} +1 -1
- package/build/dist/chunks/CBG5HARQ.js +2 -0
- package/build/dist/chunks/{ELZNT5Q3.js → CCTXCMH4.js} +1 -1
- package/build/dist/chunks/{AJP5LDM2.js → CHXBOXOD.js} +1 -1
- package/build/dist/chunks/D3YLXQPW.js +1 -0
- package/build/dist/chunks/DFM4T6ZE.js +1 -0
- package/build/dist/chunks/{GGUEKSR4.js → DJN3JAWB.js} +1 -1
- package/build/dist/chunks/{52DHGSG4.js → DW4V5PUY.js} +1 -1
- package/build/dist/chunks/E3RACZUY.js +1 -0
- package/build/dist/chunks/{VCLPOU7T.js → E674J2MD.js} +1 -1
- package/build/dist/chunks/EE64JSLY.js +1 -0
- package/build/dist/chunks/EJ7O75A7.js +1 -0
- package/build/dist/chunks/{ZXQMF56D.js → ELSXLZN5.js} +1 -1
- package/build/dist/chunks/ER47KGRM.js +1 -0
- package/build/dist/chunks/FQ6UZCM6.js +1 -0
- package/build/dist/chunks/FWD4L3CJ.js +1 -0
- package/build/dist/chunks/GEIFITAQ.js +1 -0
- package/build/dist/chunks/{S3HNPTXA.js → GGSAKCND.js} +1 -1
- package/build/dist/chunks/GL4NCUMH.js +1 -0
- package/build/dist/chunks/GNC6RXLT.js +1 -0
- package/build/dist/chunks/{YA5WWDEW.js → GQ5GYUEH.js} +1 -1
- package/build/dist/chunks/{TLJPVYRJ.js → GW5IXLKU.js} +1 -1
- package/build/dist/chunks/{57HAXNQV.js → GW626GG2.js} +1 -1
- package/build/dist/chunks/{CE7D6MUS.js → H2XDMFQQ.js} +1 -1
- package/build/dist/chunks/H43RNCX2.js +1 -0
- package/build/dist/chunks/HAQPIBYR.js +1 -0
- package/build/dist/chunks/HCUHMCBW.js +1 -0
- package/build/dist/chunks/HKEMQBFA.js +1 -0
- package/build/dist/chunks/{WTSMPDT5.js → HM72DH4V.js} +1 -1
- package/build/dist/chunks/HSCQZ66A.js +1 -0
- package/build/dist/chunks/{4KQZTPMS.js → I26DMNJG.js} +1 -1
- package/build/dist/chunks/{YHPOXAKA.js → IMO3GDA5.js} +1 -1
- package/build/dist/chunks/INOZIE55.js +1 -0
- package/build/dist/chunks/IOYRL6AY.js +1 -0
- package/build/dist/chunks/IX3GZMTM.js +1 -0
- package/build/dist/chunks/IY7BXLT4.js +1 -0
- package/build/dist/chunks/J2OT4KAH.js +1 -0
- package/build/dist/chunks/JKD2B6OX.js +1 -0
- package/build/dist/chunks/JUZ5JU6D.js +70 -0
- package/build/dist/chunks/{5OEHZJ6X.js → JVLLVNF2.js} +1 -1
- package/build/dist/chunks/K3RDPI5J.js +1 -0
- package/build/dist/chunks/{WCKMQFGS.js → K4DHHQBI.js} +1 -1
- package/build/dist/chunks/KBKK7UNY.js +1 -0
- package/build/dist/chunks/KIFSRO5K.js +1 -0
- package/build/dist/chunks/KIFZ5ZSK.js +1 -0
- package/build/dist/chunks/{4AKIXLXH.js → KPCY5V35.js} +1 -1
- package/build/dist/chunks/L4N2RSK2.js +1 -0
- package/build/dist/chunks/{2W46IRX6.js → L5BLHY34.js} +1 -1
- package/build/dist/chunks/{ZT47KN7A.js → LSXUAHOE.js} +1 -1
- package/build/dist/chunks/{NATG6YA6.js → M37654RL.js} +1 -1
- package/build/dist/chunks/MJ6WEWMI.js +3 -0
- package/build/dist/chunks/{ACN2BFMA.js → MQK6OP7S.js} +1 -1
- package/build/dist/chunks/{XV2HQKND.js → MR5L7V6Z.js} +1 -1
- package/build/dist/chunks/MRMR4QHA.js +1 -0
- package/build/dist/chunks/{TWSTOFN3.js → N4Q6GN65.js} +1 -1
- package/build/dist/chunks/{H4S2ZCWK.js → NAZPDRIF.js} +1 -1
- package/build/dist/chunks/{FBSUTF3B.js → NDCLTVIU.js} +1 -1
- package/build/dist/chunks/NEEZBJBC.js +1 -0
- package/build/dist/chunks/{MRWCFTMS.js → NKX3FE34.js} +1 -1
- package/build/dist/chunks/{J3GFCBZZ.js → NKZKKCK2.js} +1 -1
- package/build/dist/chunks/{73N3TOJL.js → NWNYJ26T.js} +1 -1
- package/build/dist/chunks/{LBEMCOND.js → O7HCEPQY.js} +1 -1
- package/build/dist/chunks/{F6WBPPBN.js → OJ4WJUPP.js} +1 -1
- package/build/dist/chunks/OJPG45AC.js +1 -0
- package/build/dist/chunks/{SKQGLGES.js → OKUO3BVM.js} +1 -1
- package/build/dist/chunks/OTXSKFUD.js +1 -0
- package/build/dist/chunks/{AAGDMH54.js → P3S4BR5G.js} +1 -1
- package/build/dist/chunks/P56RZC2M.js +1 -0
- package/build/dist/chunks/{EA6IYKIB.js → P5PYFK7L.js} +1 -1
- package/build/dist/chunks/{JST5JGAP.js → P7I62KFR.js} +1 -1
- package/build/dist/chunks/{5IIR3GIN.js → PK66GCDT.js} +1 -1
- package/build/dist/chunks/PSBQWDYI.js +1 -0
- package/build/dist/chunks/{WQ6H62DM.js → PV5FDT6O.js} +1 -1
- package/build/dist/chunks/{TQL7UDFL.js → PXT5YTWU.js} +1 -1
- package/build/dist/chunks/Q42YI3EP.js +1 -0
- package/build/dist/chunks/{SQ5BNSXR.js → QA3UHEO3.js} +1 -1
- package/build/dist/chunks/QC3HH5UD.js +3 -0
- package/build/dist/chunks/{TWCSCRFS.js → QF52OIBS.js} +1 -1
- package/build/dist/chunks/{LQUDJCAR.js → QO3KCJMP.js} +1 -1
- package/build/dist/chunks/QQECG3WP.js +1 -0
- package/build/dist/chunks/QSHCBASA.js +1 -0
- package/build/dist/chunks/QU5XKRGK.js +1 -0
- package/build/dist/chunks/{TPDOUL4N.js → QZZ4O34L.js} +1 -1
- package/build/dist/chunks/RQ4GHJXE.js +1 -0
- package/build/dist/chunks/{ALK6NKFP.js → RUC7KH7A.js} +1 -1
- package/build/dist/chunks/RUX3RY7Y.js +1 -0
- package/build/dist/chunks/{GIV5JMTE.js → RVDUSNWW.js} +1 -1
- package/build/dist/chunks/S47VUTHM.js +1 -0
- package/build/dist/chunks/{2LM7U4S7.js → S7IFAQPG.js} +1 -1
- package/build/dist/chunks/{XQUPZ3GU.js → SIYUNOLI.js} +1 -1
- package/build/dist/chunks/{7XLEYOZH.js → SJJR4ZBZ.js} +1 -1
- package/build/dist/chunks/SK2VBNAU.js +1 -0
- package/build/dist/chunks/SMYWWIE6.js +1 -0
- package/build/dist/chunks/SPJCSEKP.js +1 -0
- package/build/dist/chunks/{L3ZM77SJ.js → SSHCD6RZ.js} +1 -1
- package/build/dist/chunks/{3NDVXEBR.js → T2WHOZXM.js} +1 -1
- package/build/dist/chunks/T3AJSQYT.js +1 -0
- package/build/dist/chunks/TAEZTP4L.js +1 -0
- package/build/dist/chunks/TEJ7W534.js +1 -0
- package/build/dist/chunks/TFDPEAVZ.js +1 -0
- package/build/dist/chunks/TM2XCRU7.js +1 -0
- package/build/dist/chunks/{XQXLFF7Y.js → TMVO2DAK.js} +1 -1
- package/build/dist/chunks/{2UU5TBBB.js → TVWMTMEF.js} +1 -1
- package/build/dist/chunks/{AFHHRDPJ.js → TX2EOIRS.js} +1 -1
- package/build/dist/chunks/{QRDDKA4I.js → U4JGEMKT.js} +1 -1
- package/build/dist/chunks/{PARWLWXW.js → U5PMVP56.js} +1 -1
- package/build/dist/chunks/U67J4BCH.js +1 -0
- package/build/dist/chunks/{SSTROLQM.js → UHTRW2R6.js} +1 -1
- package/build/dist/chunks/{XUYHMOHS.js → UHVSINR5.js} +1 -1
- package/build/dist/chunks/{NRBIXV7V.js → UMIZMJWW.js} +1 -1
- package/build/dist/chunks/{VXLJRRKV.js → UNJJRQIU.js} +1 -1
- package/build/dist/chunks/V74F6IDY.js +1 -0
- package/build/dist/chunks/VEQBHI6O.js +1 -0
- package/build/dist/chunks/VHV6WQ5F.js +1 -0
- package/build/dist/chunks/{DRWWPBOQ.js → VJS4DHQQ.js} +1 -1
- package/build/dist/chunks/{R7FXNZRM.js → VOMGT5SG.js} +1 -1
- package/build/dist/chunks/{QXNPPCOU.js → VY7XRHZQ.js} +1 -1
- package/build/dist/chunks/{TCPPYBGQ.js → VYAJXLND.js} +1 -1
- package/build/dist/chunks/{WWFOYZT2.js → VYN2NRAP.js} +1 -1
- package/build/dist/chunks/{OVK4EEOD.js → VYYSL557.js} +1 -1
- package/build/dist/chunks/W2BYU5JQ.js +2 -0
- package/build/dist/chunks/W6BS3T7S.js +1 -0
- package/build/dist/chunks/WCNHZYQQ.js +1 -0
- package/build/dist/chunks/{BX7XQANB.js → WDK6VOG4.js} +1 -1
- package/build/dist/chunks/{QYYFRAWY.js → WIRBCS4W.js} +1 -1
- package/build/dist/chunks/{3WBDHUV2.js → WLMWWEP7.js} +1 -1
- package/build/dist/chunks/{TNSKEHPC.js → WP6RHXGN.js} +1 -1
- package/build/dist/chunks/WTXC3XKW.js +1 -0
- package/build/dist/chunks/{R7QPJQP6.js → WU7XIAXB.js} +1 -1
- package/build/dist/chunks/{OQVZVR2S.js → WV3A3OUU.js} +1 -1
- package/build/dist/chunks/{GCWA4Z3W.js → X2KFXCVD.js} +1 -1
- package/build/dist/chunks/X3BYCOWS.js +1 -0
- package/build/dist/chunks/{L7YBCMZU.js → X3PQMS4N.js} +1 -1
- package/build/dist/chunks/{WVXW6VL3.js → XBE3B6Y2.js} +1 -1
- package/build/dist/chunks/XLOYBLFI.js +1 -0
- package/build/dist/chunks/XR7VK24E.js +1 -0
- package/build/dist/chunks/XSD5NL7J.js +1 -0
- package/build/dist/chunks/{NU4K3TEZ.js → XSRIJUFU.js} +1 -1
- package/build/dist/chunks/{WQQJ7UPJ.js → Y25EXZCO.js} +1 -1
- package/build/dist/chunks/{2FSX7MMR.js → YCZPSMZ5.js} +1 -1
- package/build/dist/chunks/YDNTY67T.js +1 -0
- package/build/dist/chunks/YN56C7PN.js +1 -0
- package/build/dist/chunks/YWRDZQI6.js +1 -0
- package/build/dist/chunks/{SJPM5ST4.js → YXTSWRV5.js} +1 -1
- package/build/dist/chunks/Z43BTOTE.js +1 -0
- package/build/dist/chunks/{PWBL4WKB.js → Z4FZVJ5Z.js} +1 -1
- package/build/dist/chunks/ZMFRMWHR.js +1 -0
- package/build/dist/chunks/{KSZMMNXK.js → ZQAFFWDK.js} +1 -1
- package/build/dist/chunks/{LMVB3B6T.js → ZSN4IRI5.js} +1 -1
- package/build/dist/chunks/{CQCVFRQ5.js → ZV5HIQXC.js} +1 -1
- package/package.json +2 -2
- package/build/dist/chunks/2MSQ6JII.js +0 -1
- package/build/dist/chunks/3SC5UI35.js +0 -1
- package/build/dist/chunks/4GHVIBL5.js +0 -1
- package/build/dist/chunks/4X2JOQ2L.js +0 -1
- package/build/dist/chunks/5VHH5PW3.js +0 -1
- package/build/dist/chunks/5YS5V2LK.js +0 -1
- package/build/dist/chunks/6UPPUHCL.js +0 -1
- package/build/dist/chunks/7YU6DELJ.js +0 -1
- package/build/dist/chunks/AXYOJBX6.js +0 -1
- package/build/dist/chunks/CEIPDEXZ.js +0 -1
- package/build/dist/chunks/CUNQ5RG5.js +0 -1
- package/build/dist/chunks/EG6M6SSO.js +0 -1
- package/build/dist/chunks/EGUMOD3A.js +0 -1
- package/build/dist/chunks/EXRKBBX2.js +0 -1
- package/build/dist/chunks/G3MHDTGT.js +0 -1
- package/build/dist/chunks/G6HCV67X.js +0 -1
- package/build/dist/chunks/GJY3P6OG.js +0 -1
- package/build/dist/chunks/HIMVOTIU.js +0 -1
- package/build/dist/chunks/IBXYIN7Q.js +0 -1
- package/build/dist/chunks/IUE6RASI.js +0 -1
- package/build/dist/chunks/JPOYTTTW.js +0 -1
- package/build/dist/chunks/JWCOXLYA.js +0 -1
- package/build/dist/chunks/KHJFXJBU.js +0 -1
- package/build/dist/chunks/LLM5WDM3.js +0 -1
- package/build/dist/chunks/LQGPMOD2.js +0 -1
- package/build/dist/chunks/MYBDO5SA.js +0 -1
- package/build/dist/chunks/NAYRD43N.js +0 -1
- package/build/dist/chunks/NMYGNJIJ.js +0 -1
- package/build/dist/chunks/NSOEDRBU.js +0 -3
- package/build/dist/chunks/PZHR4ITH.js +0 -1
- package/build/dist/chunks/R7SXC74O.js +0 -1
- package/build/dist/chunks/RETS2ZEK.js +0 -1
- package/build/dist/chunks/SJPYXNOK.js +0 -1
- package/build/dist/chunks/SQZRVIVF.js +0 -1
- package/build/dist/chunks/SXAIXD56.js +0 -1
- package/build/dist/chunks/SXX3VTBP.js +0 -1
- package/build/dist/chunks/TMGWXDCZ.js +0 -1
- package/build/dist/chunks/TNLHMDWL.js +0 -1
- package/build/dist/chunks/UFS2RVEZ.js +0 -1
- package/build/dist/chunks/USSOVTD5.js +0 -1
- package/build/dist/chunks/UWOFA6GV.js +0 -1
- package/build/dist/chunks/V2OOOV6B.js +0 -1
- package/build/dist/chunks/XVFLT275.js +0 -1
- package/build/dist/chunks/YHB55C5T.js +0 -1
- package/build/dist/chunks/YOENHHKI.js +0 -1
- package/build/dist/chunks/Z7RL4NGX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as at,b as ct,c as K,d as X,e as ot,f as D,g as P}from"../../../chunks/6JCEJ66K.js";import{b as nt,o as it}from"../../../chunks/5O5ZE3ZV.js";import"../../../chunks/EA6IYKIB.js";import"../../../chunks/KSZMMNXK.js";import"../../../chunks/TNSKEHPC.js";import"../../../chunks/CY75R4FK.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/QRDDKA4I.js";import{b as Ot}from"../../../chunks/AXYOJBX6.js";import"../../../chunks/Z25UKUJF.js";import{a as y}from"../../../chunks/6IM6A5VA.js";import"../../../chunks/EG6M6SSO.js";import"../../../chunks/MYBDO5SA.js";import"../../../chunks/HIMVOTIU.js";import"../../../chunks/UWOFA6GV.js";import"../../../chunks/73N3TOJL.js";import{a as Tt}from"../../../chunks/RETS2ZEK.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/CXLEQCP3.js";import{a as f,d as gt,i as bt,j as rt}from"../../../chunks/G6HCV67X.js";import{a as c}from"../../../chunks/5YS5V2LK.js";import{a as Y}from"../../../chunks/JXOEJPJ4.js";import{decodeEventLog as ht,encodeFunctionData as $,erc20Abi as tt,getAddress as N,pad as Mt,toEventSelector as wt,zeroAddress as yt}from"viem";var T=bt[f].orbio.credit.address,B=bt[f].orbio.exchange.address,R=N(at.staking),U=N(at.orbio),F=N(at.agentVault),m={address:T,chainId:f,symbol:"CREDIT",decimals:6},O={address:rt,chainId:f,symbol:"USDG",decimals:gt},$t={address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",chainId:f,symbol:"ETH",decimals:18},It=(1n<<256n)-1n,Pt="https://www.orbio.so",Ft="^0x[0-9a-fA-F]{40}$",ye=[B,T,R,F,U],Ht=wt(ot[0]),qt=wt(ot[1]),Lt=wt("Transfer(address,address,uint256)"),At={status:"unverified",reason:"Off-chain spendable credit requires gateway indexing. Check orbio_tx_status until the activation is applied, then orbio_account (local add-on; use find_tool and run_tool)."};function g(t,e){return{token:{...t},amount:e.toString()}}function k(t,e){if(typeof t!="string")throw new c(`${e} must be an integer string in base units.`);let n=Tt(t);if(n<=0n||n>It)throw new c(`${e} must be positive and fit uint256.`);return n}function h(t){if(typeof t!="bigint"||t<0n||t>It)throw new c("Orbio returned an invalid on-chain amount.");return t}function A(t,e){if(!t||typeof t!="object"||Array.isArray(t)||Object.keys(t).some(n=>!e.includes(n)))throw new c("Unsupported Orbio argument.")}function C(t,e){return t.toLowerCase()===e.toLowerCase()}function V(t,e){if(typeof t!="string")throw new c(`${e} must be an address.`);y(t);let n=N(t);if(n===yt)throw new c(`${e} must not be the zero address.`);return n}function ut(t){return Mt(t.toLowerCase(),{size:32})}function Nt(t){let e=t===void 0?16:t;if(typeof e!="number"||!Number.isInteger(e)||e<1||e>64)throw new c("maxFills must be an integer from 1 to 64.");return e}async function W(t){let e=t.clientFor(f);if(await e.getChainId()!==f)throw new c(`Orbio requires chain ${f}.`);return e}var b=(t,e,n)=>`${t.formatAmount(e.toString(),n.decimals)} ${n.symbol}`;async function E(t,e,n,i){let a=await t.preview(n,e),o=a.changes.map(s=>{let u=s.amount.startsWith("-"),d=u?s.amount.slice(1):s.amount;return`${u?"-":""}${t.formatAmount(d,s.token.decimals)} ${s.token.symbol} (${s.token.address}, chain ${s.token.chainId})`}).join("; ");return{...{txs:n,summary:`${i} ${a.summary}${o?` Preview changes: ${o}.`:""}`},preview:a}}function Et(t,e,n,i){if(!Array.isArray(t)||t.length!==e)throw new c("Orbio returned an invalid quote.");let a=t.map(h),[o,r,s,u,d]=a;if(o===0n||r===0n||r+s>n||u<1n||u>BigInt(i)||d>3n)throw new c("Orbio returned an inconsistent quote.");return a}function _t(t,e,n){let i=Et(t,7,e,n);if(i[5]+i[6]!==i[0])throw new c("Orbio returned an inconsistent activation quote.");return i}function Ut(t,e,n){return Et(t,5,e,n)}function Dt(t,e,n,i,a){let o=n+i,r=ct[Number(a)]??"Unknown",s=o<e?`Partial fill: only ${b(t,o,O)} of the ${b(t,e,O)} budget would be spent (${r}); the rest stays in the wallet.`:`The full ${b(t,e,O)} budget would be spent (${r}).`;return{pull:o,text:s}}async function jt(t,e,n,i){let a=await t.getBlockNumber(),o=async u=>{let d=await t.readContract({address:B,abi:K,functionName:"getActivationQuote",args:[u,BigInt(n)],blockNumber:a}),[l,,,,,p]=_t(d,u,n),_=i??BigInt(it(l.toString(),nt));return p>0n&&_>1n&&_<=l};if(await o(e))return e;let r=e,s=e;for(let u=0;u<16&&!(s>It/2n);u++){if(s*=2n,await o(s)){for(;s-r>1n;){let d=(r+s)/2n;await o(d)?s=d:r=d}return s}r=s}throw new c("Orbio amount is too small. A workable minimum could not be quoted; retry when liquidity is available.")}async function kt(t,e,n,i,a){let o=h(await t.readContract({address:e,abi:tt,functionName:"balanceOf",args:[n]}));if(o<i)throw new c(`This wallet holds ${o} ${a} base units and needs ${i}.`)}async function Gt(t,e,n){A(e,["usdgIn","minCreditOut","maxFills","beneficiary"]),y(n);let i=k(e.usdgIn,"usdgIn"),a=Nt(e.maxFills),o=e.minCreditOut===void 0?void 0:k(e.minCreditOut,"minCreditOut"),r=e.beneficiary===void 0?N(n):V(e.beneficiary,"beneficiary"),s=await W(t),u=await s.readContract({address:B,abi:K,functionName:"getActivationQuote",args:[i,BigInt(a)]}),[d,l,p,_,S,H,q]=_t(u,i,a);if(H===0n||o===void 0&&BigInt(it(d.toString(),nt))<=1n){let w=await jt(s,i,a,o);throw new c(`Orbio amount is too small. Minimum at the quoted block: ${w} USDG base units (${t.formatAmount(w.toString(),gt)} USDG, 6 decimals, chain ${f}).`)}let M=o??BigInt(it(d.toString(),nt));if(M<=1n||M>d)throw new c("minCreditOut must exceed one base unit and be no greater than quoted gross CREDIT.");let{pull:G,text:x}=Dt(t,i,l,p,S),Z=ut(r),Q=[t.approval(rt,B,G.toString(),f),t.unsignedTx({to:B,chainId:f,value:"0",data:$({abi:K,functionName:"buyAndActivate",args:[i,M,Z,BigInt(a)]}),description:"Buy CREDIT and burn it for activation using the beneficiary reference."})],st=C(r,n)?"":` WARNING: the activated balance is credited to ${r}, not this wallet; only that wallet's key can spend it.`;return{...await E(t,n,Q,`Approve exactly ${b(t,G,O)} to Exchange, then buy and burn ${b(t,d,m)} (quoted). ${x} Gross minimum: ${b(t,M,m)}; exchange fee: ${b(t,p,O)}; activation fee: ${b(t,q,m)}; net activation: ${b(t,H,m)}.${st} CREDIT is burned for activation, not transferred into the wallet. Off-chain spendable credit remains unverified until the gateway applies the activation.`),activationRef:Z,beneficiary:r,spendableCredit:{...At},quote:{usdgBudget:g(O,i),usdgSpent:g(O,l),grossCredit:g(m,d),minCreditOut:g(m,M),exchangeFee:g(O,p),activationFee:g(m,q),netActivated:g(m,H),fills:_.toString(),reason:ct[Number(S)]??"Unknown"}}}async function Qt(t,e,n){A(e,["usdgIn","minCreditOut","maxFills","recipient"]),y(n);let i=k(e.usdgIn,"usdgIn"),a=Nt(e.maxFills),o=e.recipient===void 0?N(n):V(e.recipient,"recipient"),s=await(await W(t)).readContract({address:B,abi:K,functionName:"getQuote",args:[i,BigInt(a)]}),[u,d,l,p,_]=Ut(s,i,a),S=e.minCreditOut===void 0?BigInt(it(u.toString(),nt)):k(e.minCreditOut,"minCreditOut");if(S<=0n||S>u)throw new c("minCreditOut must be positive and no greater than quoted CREDIT.");let{pull:H,text:q}=Dt(t,i,d,l,_),M=[t.approval(rt,B,H.toString(),f),t.unsignedTx({to:B,chainId:f,value:"0",data:$({abi:K,functionName:"buy",args:[i,S,o,BigInt(a)]}),description:"Buy CREDIT from the order book and keep it unactivated."})],G=C(o,n)?"":` The CREDIT is delivered to ${o}, not this wallet.`;return{...await E(t,n,M,`Approve exactly ${b(t,H,O)} to Exchange, then buy ${b(t,u,m)} (quoted, minimum ${b(t,S,m)}). ${q} Protocol fee: ${b(t,l,O)}, taken out of the budget.${G} Unactivated CREDIT stays transferable; activate it later with orbio_activate_credit.`),recipient:o,quote:{usdgBudget:g(O,i),usdgSpent:g(O,d),creditOut:g(m,u),minCreditOut:g(m,S),protocolFee:g(O,l),fills:p.toString(),reason:ct[Number(_)]??"Unknown"}}}async function zt(t,e,n){A(e,["amount","beneficiary"]),y(n);let i=k(e.amount,"amount"),a=e.beneficiary===void 0?void 0:V(e.beneficiary,"beneficiary"),o=await W(t);await kt(o,T,n,i,"CREDIT");let r=await o.readContract({address:T,abi:X,functionName:"previewActivation",args:[i]});if(!Array.isArray(r)||r.length!==2)throw new c("Orbio returned an invalid activation preview.");let[s,u]=[h(r[0]),h(r[1])];if(s===0n||s+u!==i)throw new c("Orbio returned an inconsistent activation preview.");let d=a??N(n),l=a===void 0?$({abi:X,functionName:"activate",args:[i]}):$({abi:X,functionName:"activate",args:[i,ut(a)]}),p=[t.unsignedTx({to:T,chainId:f,value:"0",data:l,description:"Burn held CREDIT into Orbio API balance."})],_=C(d,n)?"":` WARNING: the balance is credited to ${d}, not this wallet.`;return{...await E(t,n,p,`Burn ${b(t,i,m)} permanently; ${b(t,s,m)} of inference balance is credited (activation fee ${b(t,u,m)}) to ${d}.${_} Activated balance cannot be transferred, sold or redeemed. No approval is needed.`),beneficiary:d,activationRef:ut(d),spendableCredit:{...At},activation:{burned:g(m,i),credited:g(m,s),fee:g(m,u)}}}async function Jt(t,e,n){A(e,["to","amount"]),y(n);let i=V(e.to,"to");if(C(i,n)||C(i,T)||C(i,B))throw new c("Choose a different recipient: not this wallet, the CREDIT token or the Exchange.");let a=k(e.amount,"amount"),o=await W(t);await kt(o,T,n,a,"CREDIT");let r=[t.unsignedTx({to:T,chainId:f,value:"0",data:$({abi:X,functionName:"transfer",args:[i,a]}),description:"Transfer unactivated CREDIT."})];return{...await E(t,n,r,`Transfer ${b(t,a,m)} of unactivated CREDIT to ${i}. The recipient can hold, sell or activate it; this wallet loses it.`),recipient:i}}async function Vt(t,e,n){if(A(e,["transactionHash","beneficiary"]),y(n),e.transactionHash!==void 0&&(typeof e.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.transactionHash)))throw new c("Provide a valid activation transaction hash.");let i=await W(t),[a,o,r]=await Promise.all([i.readContract({address:T,abi:tt,functionName:"balanceOf",args:[n]}),i.readContract({address:T,abi:tt,functionName:"totalSupply"}),i.readContract({address:T,abi:X,functionName:"activationFeeBps"}).catch(()=>{})]),s=g(m,h(a)),u=g(m,h(o)),d={walletCredit:s,totalSupply:u,spendableCredit:{...At},...r===void 0?{}:{activationFeeBps:String(r)}};if(e.transactionHash===void 0)return{...d,activation:null};let l=await i.getTransactionReceipt({hash:e.transactionHash}),p=!!l.to&&C(l.to,B),_=!!l.to&&C(l.to,T);if(l.status!=="success"||!C(l.from,n)||!p&&!_||l.transactionHash.toLowerCase()!==e.transactionHash.toLowerCase())throw new c("The transaction is not a successful Orbio activation from this wallet.");let S=e.beneficiary===void 0?N(n):V(e.beneficiary,"beneficiary"),H=ut(S),q=l.logs.filter(w=>C(w.address,T)),M=q.filter(w=>w.topics[0]?.toLowerCase()===Ht);if(M.length!==1)throw new c("The receipt must contain one CREDIT activation.");let G=M[0],x=ht({abi:ot,eventName:"Activated",data:G.data,topics:G.topics,strict:!0}).args,Z=p?B:N(n);if(!C(x.from,Z)||x.beneficiary.toLowerCase()!==H||x.amount===0n)throw new c(`The CREDIT activation does not match ${p?"Exchange":"this wallet"} and the beneficiary reference.`);let Q=q.filter(w=>w.topics[0]?.toLowerCase()===qt).map(w=>ht({abi:ot,eventName:"ActivationFeeCharged",data:w.data,topics:w.topics,strict:!0}).args).filter(w=>w.activationId===x.activationId);if(Q.length>1||Q[0]&&Q[0].feeAtoms>x.amount||Q.length===0&&r!==0)throw new c("The activation fee is missing or inconsistent.");let st=Q[0]?.feeAtoms??0n,ft=q.filter(w=>w.topics[0]?.toLowerCase()===Lt).reduce((w,Ct)=>{let mt=ht({abi:tt,eventName:"Transfer",data:Ct.data,topics:Ct.topics,strict:!0}).args;return w+(C(mt.from,Z)&&C(mt.to,yt)?mt.value:0n)},0n);if(ft!==x.amount)throw new c("The CREDIT burn does not match the activation amount.");return{...d,activation:{status:"onchain_success",id:x.activationId.toString(),transactionHash:l.transactionHash,blockNumber:l.blockNumber.toString(),by:Z,ref:H,beneficiary:S,grossCredit:g(m,x.amount),burnedCredit:g(m,ft),activationFee:g(m,st),netActivated:g(m,x.amount-st),note:"Receipt inclusion only. Run orbio_tx_status for the gateway state: the balance is spendable once it is applied. totalSupply is a current read, not a historical supply delta."}}}async function vt(t){let e=await t.readContract({address:U,abi:tt,functionName:"decimals"});if(typeof e!="number"||!Number.isInteger(e)||e<0||e>36)throw new c("Orbio returned invalid ORBIO decimals.");return e}async function Zt(t,e,n){A(e,[]),y(n);let i=await W(t),[a,o,r,s,u]=await Promise.all([vt(i),i.readContract({address:U,abi:tt,functionName:"balanceOf",args:[n]}),i.readContract({address:R,abi:D,functionName:"positionOf",args:[n]}),i.readContract({address:R,abi:D,functionName:"settledOf",args:[n]}),i.readContract({address:R,abi:D,functionName:"MIN_POSITION"})]),d={address:U,chainId:f,symbol:"ORBIO",decimals:a};return{orbioBalance:g(d,h(o)),stakedPosition:g(d,h(r)),settledCredit:g(m,h(s)),minimumPosition:g(d,h(u)),note:"Staking ORBIO is optional: it earns CREDIT hourly and is not needed to buy or use CREDIT."}}async function Yt(t,e,n){A(e,["orbioWei"]),y(n);let i=k(e.orbioWei,"orbioWei"),a=await W(t),o=await vt(a),r={address:U,chainId:f,symbol:"ORBIO",decimals:o};await kt(a,U,n,i,"ORBIO");let[s,u]=await Promise.all([a.readContract({address:R,abi:D,functionName:"positionOf",args:[n]}),a.readContract({address:R,abi:D,functionName:"MIN_POSITION"})]);if(h(s)+i<h(u))throw new c(`A staking position has to reach ${b(t,h(u),r)}; this would leave ${b(t,h(s)+i,r)}.`);let d=[t.approval(U,R,i.toString(),f),t.unsignedTx({to:R,chainId:f,value:"0",data:$({abi:D,functionName:"stake",args:[i]}),description:"Stake ORBIO."})];return E(t,n,d,`Approve exactly ${b(t,i,r)} to the staking contract, then stake it. Staked ORBIO earns CREDIT hourly; take it back with orbio_unstake.`)}async function Kt(t,e,n){A(e,["orbioWei"]),y(n);let i=k(e.orbioWei,"orbioWei"),a=await W(t),o=await vt(a),r={address:U,chainId:f,symbol:"ORBIO",decimals:o},s=h(await a.readContract({address:R,abi:D,functionName:"positionOf",args:[n]}));if(s<i)throw new c(`This wallet has ${b(t,s,r)} staked and cannot unstake ${b(t,i,r)}.`);let u=[t.unsignedTx({to:R,chainId:f,value:"0",data:$({abi:D,functionName:"unstake",args:[i]}),description:"Unstake ORBIO."})];return E(t,n,u,`Unstake ${b(t,i,r)} of ORBIO back to this wallet. What stays staked keeps earning.`)}async function Xt(t,e,n){A(e,[]),y(n);let i=await W(t),a=h(await i.readContract({address:R,abi:D,functionName:"settledOf",args:[n]}));if(a===0n)throw new c("No settled CREDIT is waiting to be claimed for this wallet.");let o=[t.unsignedTx({to:R,chainId:f,value:"0",data:$({abi:D,functionName:"claim"}),description:"Claim settled staking CREDIT."})];return E(t,n,o,`Mint ${b(t,a,m)} of settled staking rewards to this wallet as unactivated CREDIT.`)}function j(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}async function J(t,e){let n=await t.http(`${Pt}${e}`,{method:"GET",headers:{accept:"application/json"}});if(!n.ok)throw new c(`Orbio returned HTTP ${n.status} for a public read.`);let i;try{i=await n.json()}catch{throw new c("Orbio returned malformed JSON.")}if(!j(i))throw new c("Orbio returned an unexpected response.");return i}function lt(t,e=0){return t===null||typeof t=="boolean"?t:typeof t=="number"?Number.isFinite(t)?t:null:typeof t=="string"?/^-?[0-9]{1,40}(\.[0-9]{1,40})?$/.test(t)?t:Y(t.slice(0,200)):e>=4?null:Array.isArray(t)?t.slice(0,1440).map(n=>lt(n,e+1)):j(t)?Object.fromEntries(Object.entries(t).slice(0,50).map(([n,i])=>[n.slice(0,40).replace(/[^A-Za-z0-9_.-]/g,"_"),lt(i,e+1)])):null}var L=(t,e=200)=>typeof t=="string"?Y(t.slice(0,e)):void 0,et=t=>typeof t=="string"&&/^[0-9]{1,78}$/.test(t)?t:typeof t=="number"&&Number.isSafeInteger(t)&&t>=0?String(t):void 0,Bt=t=>typeof t=="string"&&/^0x[0-9a-fA-F]{64}$/.test(t)?t:void 0,pt=t=>typeof t=="string"&&/^0x[0-9a-fA-F]{40}$/.test(t)?N(t):void 0;function St(t){return j(t)?{agentId:et(t.agentId),token:pt(t.token),owner:pt(t.owner),agentWallet:pt(t.agentWallet),feeBps:typeof t.feeBps=="number"?t.feeBps:void 0,stakeWei:et(t.stakeWei),creditOwedAtoms:et(t.creditOwedAtoms),name:L(t.name,80),symbol:L(t.symbol,24)}:null}async function Wt(t){let e=await J(t,"/api/protocol/agents/terms");return{live:e.live===!0,paused:e.paused===!0,launchFeeWei:et(e.launchFeeWei),feeBps:typeof e.feeBps=="number"?e.feeBps:void 0,economics:Bt(e.economics)??null,nextAgentId:et(e.nextAgentId)??null}}async function te(t,e,n){if(A(e,["agentId","owned","view","range"]),y(n),e.view!==void 0){if(e.view==="analytics")return{analytics:lt(await J(t,"/api/protocol/agents/analytics")),note:"Indexer totals; null means unavailable, never zero."};if(e.view==="chart"){let d=e.range===void 0?"1d":e.range;if(!["1h","4h","1d"].includes(String(d)))throw new c("range must be 1h, 4h or 1d.");let l=k(e.agentId,"agentId");return{agentId:l.toString(),range:d,chart:lt(await J(t,`/api/protocol/agents/${l.toString()}/chart?range=${d}`))}}throw new c("view must be analytics or chart.")}let i=await Wt(t);if(e.agentId===void 0){let d=e.owned===!1?void 0:await J(t,`/api/protocol/agents?wallet=${N(n)}`),l=d&&Array.isArray(d.data)?d.data.slice(0,50).map(St).filter(Boolean):[];return{terms:i,ownedAgents:l,note:"Launch and manage agents with orbio_agent_launch / harvest / claim_credit / withdraw_principal / set_wallet."}}let a=k(e.agentId,"agentId"),o=await W(t),[r,s]=await Promise.all([o.readContract({address:F,abi:P,functionName:"stakeOf",args:[a]}),o.readContract({address:F,abi:P,functionName:"unlocksAt",args:[a]})]),u=await J(t,`/api/protocol/agents/${a.toString()}`).then(St,()=>null);return{terms:i,agentId:a.toString(),stakeWei:h(r).toString(),principalUnlocksAt:h(BigInt(s)).toString(),gateway:u,note:"On-chain stake/unlock are authoritative; the gateway record is an indexer view and may lag."}}function ee(t){let e=["twitter","telegram","discord","website","farcaster"];if(t===void 0)return{twitter:"",telegram:"",discord:"",website:"",farcaster:""};if(!j(t)||Object.keys(t).some(i=>!e.includes(i)))throw new c("socials may only contain twitter, telegram, discord, website and farcaster strings.");let n={};for(let i of e){let a=t[i];if(a!==void 0&&(typeof a!="string"||a.length>256))throw new c(`socials.${i} must be a string of at most 256 characters.`);n[i]=a??""}return n}function dt(t,e,n,i=!1){if(t===void 0&&!i)return"";if(typeof t!="string"||i&&!t.trim()||t.length>n)throw new c(`${e} must be ${i?"a non-empty ":"a "}string of at most ${n} characters.`);return t}async function ne(t,e,n){A(e,["name","symbol","logo","description","socials","agentWallet","salt"]),y(n);let i=await Wt(t);if(!i.live||i.paused)throw new c("The Orbio agent launchpad is not live or is paused right now.");if(i.economics===null||i.launchFeeWei===void 0)throw new c("Orbio did not publish launch terms (fee and economics pin); nothing was built.");let a=BigInt(i.launchFeeWei),o=e.agentWallet===void 0?N(n):V(e.agentWallet,"agentWallet"),r=e.salt===void 0?`0x${"00".repeat(32)}`:Bt(e.salt)??(()=>{throw new c("salt must be 32 bytes of hex.")})(),s={name:dt(e.name,"name",64,!0),symbol:dt(e.symbol,"symbol",16,!0),logo:dt(e.logo,"logo",512),description:dt(e.description,"description",1024),socials:ee(e.socials),creatorFeeRecipient:yt,creatorTaxBps:0,buybackEnabled:!1,expectedEconomics:i.economics,salt:r},u=[t.unsignedTx({to:F,chainId:f,value:a.toString(),data:$({abi:P,functionName:"launch",args:[s,o]}),description:"Launch an Orbio agent token through the agent vault."})];return{...await E(t,n,u,`Launch agent token ${JSON.stringify(s.name)} (${JSON.stringify(s.symbol)}) through the Orbio agent vault. Pays the launch fee of ${b(t,a,$t)} plus gas. Agent wallet: ${o}${C(o,n)?" (this wallet: one key controls the agent and can also withdraw its principal)":""}. Orbio takes a share of creator fees and stakes the rest for the agent; the agent id is in the AgentLaunched event, not nextAgentId.`),agentWallet:o,launchFee:g($t,a),economics:i.economics}}async function ie(t,e,n){if(A(e,["agentIds"]),y(n),!Array.isArray(e.agentIds)||e.agentIds.length<1||e.agentIds.length>20)throw new c("agentIds must list 1 to 20 agent ids.");let i=e.agentIds.map((o,r)=>k(o,`agentIds[${r}]`)),a=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"harvest",args:[i]}),description:"Harvest agent creator fees into stake."})];return E(t,n,a,`Harvest creator fees for agent ${i.join(", ")} and stake them. Orbio's keeper does this on a schedule; this is for impatience.`)}async function ae(t,e,n){A(e,["agentId","activate"]),y(n);let i=k(e.agentId,"agentId");if(typeof e.activate!="boolean")throw new c("Set activate to true (burn into inference balance, irreversible) or false (receive CREDIT tokens).");let a=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"claimCredit",args:[i,e.activate]}),description:"Claim agent CREDIT."})];return E(t,n,a,e.activate?`Claim the CREDIT agent ${i} has earned and activate it into inference balance. This burn is irreversible; the balance cannot be transferred or redeemed.`:`Claim the CREDIT agent ${i} has earned as CREDIT tokens (not activated).`)}async function oe(t,e,n){A(e,["agentId","orbioWei"]),y(n);let i=k(e.agentId,"agentId"),a=k(e.orbioWei,"orbioWei"),o=await W(t),[r,s]=await Promise.all([o.readContract({address:F,abi:P,functionName:"unlocksAt",args:[i]}),o.readContract({address:F,abi:P,functionName:"stakeOf",args:[i]})]),u=BigInt(r),d=await o.getBlock?.({blockTag:"latest"});if((d?d.timestamp:BigInt(Math.floor(Date.now()/1e3)))<u)throw new c(`This agent's principal is locked until ${new Date(Number(u)*1e3).toISOString()}.`);if(h(s)<a)throw new c(`Agent ${i} has ${h(s)} ORBIO wei staked and cannot withdraw ${a}.`);let p=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"withdrawPrincipal",args:[i,a]}),description:"Withdraw agent principal (owner only)."})];return E(t,n,p,`Withdraw ${a} ORBIO wei of principal from agent ${i} to the owner (this call reverts unless this wallet is the owner). The agent stops earning on what leaves.`)}async function se(t,e,n){A(e,["agentId","agentWallet"]),y(n);let i=k(e.agentId,"agentId"),a=V(e.agentWallet,"agentWallet"),o=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"setAgentWallet",args:[i,a]}),description:"Change the agent wallet (owner only)."})];return E(t,n,o,`Point agent ${i} at the new agent wallet ${a} (this call reverts unless this wallet is the owner). The new wallet can harvest and claim for the agent.`)}async function re(t,e){if(A(e,["transactionHash","chain"]),typeof e.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.transactionHash))throw new c("Provide a valid transaction hash.");let n=e.chain===void 0?"robinhood":e.chain;if(n!=="robinhood"&&n!=="ethereum")throw new c("chain must be robinhood (activations here) or ethereum. Solana activations need a Solana signature and are not supported.");let i=await J(t,`/api/protocol/tx/${e.transactionHash}${n==="ethereum"?"?chain=1":""}`),a=typeof i.status=="string"?i.status.slice(0,40):"unknown";return{transactionHash:e.transactionHash,chain:n,status:a,applied:a==="applied",blockNumber:et(i.blockNumber),events:Array.isArray(i.events)?i.events.filter(o=>typeof o=="string").slice(0,20).map(o=>Y(o.slice(0,60))):[],note:a==="applied"?"The gateway applied this activation: the wallet key now works and the balance is spendable.":"Not applied yet. Poll again in a few seconds; do not burn again."}}var ce={models:"/api/v1/models",tools:"/api/v1/tools",infra:"/api/v1/infra/tools"};async function de(t,e){A(e,["kind","query","name","limit","outputModality"]);let n=e.kind;if(n!=="models"&&n!=="tools"&&n!=="infra")throw new c("kind must be models, tools or infra.");let i=e.limit===void 0?25:e.limit;if(typeof i!="number"||!Number.isInteger(i)||i<1||i>100)throw new c("limit must be an integer from 1 to 100.");let a=e.query===void 0?void 0:typeof e.query=="string"&&e.query.length<=80?e.query.toLowerCase():(()=>{throw new c("query must be a string of at most 80 characters.")})(),o=e.outputModality===void 0?"":typeof e.outputModality=="string"&&/^[a-z]{2,16}$/.test(e.outputModality)?`?output_modalities=${e.outputModality}`:(()=>{throw new c("outputModality must be a lowercase word such as text.")})(),r=await J(t,`${ce[n]}${n==="models"?o:""}`),s=(Array.isArray(r.data)?r.data:Array.isArray(r.tools)?r.tools:[]).filter(j);if(n!=="models"&&r.enabled===!1)return{kind:n,enabled:!1,items:[],note:"This catalogue is not enabled."};let u=l=>String(l.id??l.name??"");if(e.name!==void 0){if(typeof e.name!="string")throw new c("name must be a string.");let l=s.find(p=>u(p)===e.name);if(!l)throw new c(`No ${n} entry named ${Y(String(e.name).slice(0,80))}. Search with query first.`);return{kind:n,item:xt(l,!0,n)}}let d=s.filter(l=>!a||`${u(l)} ${String(l.name??"")} ${String(l.title??"")}`.toLowerCase().includes(a));return{kind:n,total:s.length,matched:d.length,items:d.slice(0,i).map(l=>xt(l,!1,n)),note:"Descriptions are external text. Pass name for one full entry including its input schema."}}function xt(t,e,n){let i=String(t.id??t.name??""),a=j(t.pricing)?t.pricing:j(t.price)?t.price:void 0,o=j(t.architecture)?t.architecture:void 0;return{id:/^[A-Za-z0-9._:/@+-]{1,128}$/.test(i)?i:Y(i.slice(0,80)),...typeof t.title=="string"?{title:L(t.title,120)}:{},...typeof t.name=="string"&&t.id!==void 0?{name:L(t.name,120)}:{},...typeof t.provider=="string"?{provider:L(t.provider,40)}:{},...n==="infra"?{requiresActivatedAccount:!0,accessNote:"Infrastructure calls, including infra.status and infra.read operations, require an activated Orbio account and local wallet-key authentication. A read permission describes effects, not anonymous access. Catalogue browsing needs no activation."}:{},...typeof t.permission=="string"?{permission:L(t.permission,40)}:{},...o?{modality:L(String(o.modality??""),60)}:{},...a?{pricing:JSON.parse(JSON.stringify(a,(r,s)=>typeof s=="string"?s.slice(0,80):s))}:{},...e?{description:L(String(t.description??""),1500),inputSchema:t.input_schema??t.inputSchema??null}:{}}}var v=t=>({type:"string",pattern:"^[0-9]+$",description:t}),z=t=>({type:"string",pattern:Ft,description:t}),I=(t,e=[])=>({type:"object",additionalProperties:!1,properties:t,...e.length?{required:e}:{}}),Rt={type:"integer",minimum:1,maximum:64,default:16},ue=t=>{let e=i=>async(a,o)=>{try{return await i(t,a,o)}catch(r){throw new c(t.plainError(r))}},n=(i,a,o)=>({name:i,inputSchema:a,execute:e(o)});return{tools:[n("orbio_buy_credit",I({usdgIn:v("USDG budget in base units (6 decimals) on chain 4663. The fee comes out of it; a partial fill spends less."),minCreditOut:v("Gross CREDIT minimum before activation fee; defaults to the quoted gross amount minus shared slippage."),maxFills:Rt,beneficiary:z("Wallet whose Orbio account receives the activated balance. Defaults to this wallet; only that wallet's key can spend it.")},["usdgIn"]),Gt),n("orbio_buy_held_credit",I({usdgIn:v("USDG budget in base units (6 decimals). The fee comes out of it."),minCreditOut:v("CREDIT minimum in base units (6 decimals); defaults to the quote minus shared slippage."),maxFills:Rt,recipient:z("Wallet that receives the unactivated CREDIT. Defaults to this wallet.")},["usdgIn"]),Qt),n("orbio_activate_credit",I({amount:v("CREDIT base units (6 decimals) to burn into API balance. Irreversible."),beneficiary:z("Wallet whose Orbio account is credited (for example a worker). Defaults to this wallet.")},["amount"]),zt),n("orbio_transfer_credit",I({to:z("Recipient of the unactivated CREDIT, for example a worker wallet."),amount:v("CREDIT base units (6 decimals).")},["to","amount"]),Jt),n("orbio_credit_status",I({transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Optional activation receipt to inspect for this wallet: a buyAndActivate or a direct activate."},beneficiary:z("Beneficiary the activation should have named; defaults to this wallet.")}),Vt),n("orbio_tx_status",I({transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},chain:{enum:["robinhood","ethereum"],default:"robinhood",description:"Chain of the activation transaction."}},["transactionHash"]),re),n("orbio_catalog",I({kind:{enum:["models","tools","infra"],description:"models: inference models; tools: metered gateway tools; infra: sandboxes, deployments, servers, databases, inboxes."},query:{type:"string",description:"Case-insensitive substring of the id, name or title."},name:{type:"string",description:"Exact id/name for one full entry including its input schema."},limit:{type:"integer",minimum:1,maximum:100,default:25},outputModality:{type:"string",description:"Models only: filter such as text."}},["kind"]),de),n("orbio_staking_status",I({}),Zt),n("orbio_stake",I({orbioWei:v("ORBIO base units to stake (18 decimals).")},["orbioWei"]),Yt),n("orbio_unstake",I({orbioWei:v("ORBIO base units to take back.")},["orbioWei"]),Kt),n("orbio_claim_staking",I({}),Xt),n("orbio_agent_status",I({agentId:v("Agent id to read on-chain stake and principal unlock time for. Omit to list this wallet's agents and the launch terms."),owned:{type:"boolean",default:!0},view:{enum:["analytics","chart"],description:"analytics: launchpad-wide totals; chart: one agent's minute-sampled price history (needs agentId)."},range:{enum:["1h","4h","1d"],default:"1d"}}),te),n("orbio_agent_launch",I({name:{type:"string",maxLength:64},symbol:{type:"string",maxLength:16},logo:{type:"string",maxLength:512},description:{type:"string",maxLength:1024},socials:{type:"object",additionalProperties:!1,properties:{twitter:{type:"string"},telegram:{type:"string"},discord:{type:"string"},website:{type:"string"},farcaster:{type:"string"}}},agentWallet:z("The agent's hot wallet. Defaults to this wallet (one key controls everything, including principal withdrawal)."),salt:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}},["name","symbol"]),ne),n("orbio_agent_harvest",I({agentIds:{type:"array",items:v("Agent id."),minItems:1,maxItems:20}},["agentIds"]),ie),n("orbio_agent_claim_credit",I({agentId:v("Agent id."),activate:{type:"boolean",description:"true burns the claimed CREDIT into inference balance (irreversible); false delivers CREDIT tokens. Required."}},["agentId","activate"]),ae),n("orbio_agent_withdraw_principal",I({agentId:v("Agent id."),orbioWei:v("ORBIO base units of principal to withdraw (owner only, after the unlock time).")},["agentId","orbioWei"]),oe),n("orbio_agent_set_wallet",I({agentId:v("Agent id."),agentWallet:z("New agent hot wallet (owner only).")},["agentId","agentWallet"]),se)]}};function Ie(t){return Ot("orbio",[ue(t)])}export{ye as ORBIO_DESTINATIONS,at as ORBIO_PINS,Ie as createModule,ue as createModulePart};
|
|
1
|
+
import{a as $t}from"../../../chunks/TAEZTP4L.js";import{a as at,b as ct,c as K,d as X,e as ot,f as D,g as P}from"../../../chunks/6JCEJ66K.js";import{b as nt,o as it}from"../../../chunks/3NJ5KQ3Q.js";import"../../../chunks/P5PYFK7L.js";import"../../../chunks/ZQAFFWDK.js";import"../../../chunks/WP6RHXGN.js";import"../../../chunks/3MLUCYCB.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/U4JGEMKT.js";import{b as Ot}from"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import{a as y}from"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/VEQBHI6O.js";import"../../../chunks/OTXSKFUD.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import{b as Tt}from"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/ABPL3ZZI.js";import{a as f,d as gt,i as bt,j as rt}from"../../../chunks/FWD4L3CJ.js";import{a as c}from"../../../chunks/XSD5NL7J.js";import{a as Y}from"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";import{decodeEventLog as ht,encodeFunctionData as $,erc20Abi as tt,getAddress as N,pad as Pt,toEventSelector as wt,zeroAddress as yt}from"viem";var T=bt[f].orbio.credit.address,B=bt[f].orbio.exchange.address,R=N(at.staking),U=N(at.orbio),F=N(at.agentVault),m={address:T,chainId:f,symbol:"CREDIT",decimals:6},O={address:rt,chainId:f,symbol:"USDG",decimals:gt},St={address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",chainId:f,symbol:"ETH",decimals:18},It=(1n<<256n)-1n,Ft="https://www.orbio.so",Ht="^0x[0-9a-fA-F]{40}$",Ae=[B,T,R,F,U],qt=wt(ot[0]),Lt=wt(ot[1]),Ut=wt("Transfer(address,address,uint256)"),At={status:"unverified",reason:"Off-chain spendable credit requires gateway indexing. Check orbio_tx_status until the activation is applied, then orbio_account (local add-on; use find_tool and run_tool)."};function g(t,e){return{token:{...t},amount:e.toString()}}function k(t,e){if(typeof t!="string")throw new c(`${e} must be an integer string in base units.`);let n=Tt(t);if(n<=0n||n>It)throw new c(`${e} must be positive and fit uint256.`);return n}function h(t){if(typeof t!="bigint"||t<0n||t>It)throw new c("Orbio returned an invalid on-chain amount.");return t}function A(t,e){if(!t||typeof t!="object"||Array.isArray(t)||Object.keys(t).some(n=>!e.includes(n)))throw new c("Unsupported Orbio argument.")}function C(t,e){return t.toLowerCase()===e.toLowerCase()}function V(t,e){if(typeof t!="string")throw new c(`${e} must be an address.`);y(t);let n=N(t);if(n===yt)throw new c(`${e} must not be the zero address.`);return n}function ut(t){return Pt(t.toLowerCase(),{size:32})}function Et(t){let e=t===void 0?16:t;if(typeof e!="number"||!Number.isInteger(e)||e<1||e>64)throw new c("maxFills must be an integer from 1 to 64.");return e}async function W(t){let e=t.clientFor(f);if(await e.getChainId()!==f)throw new c(`Orbio requires chain ${f}.`);return e}var b=(t,e,n)=>`${t.formatAmount(e.toString(),n.decimals)} ${n.symbol}`;async function E(t,e,n,i){let a=await t.preview(n,e),o=a.changes.map(s=>{let u=s.amount.startsWith("-"),d=u?s.amount.slice(1):s.amount;return`${u?"-":""}${t.formatAmount(d,s.token.decimals)} ${s.token.symbol} (${s.token.address}, chain ${s.token.chainId})`}).join("; ");return{...{txs:n,summary:`${i} ${a.summary}${o?` Preview changes: ${o}.`:""}`},preview:a}}function _t(t,e,n,i){if(!Array.isArray(t)||t.length!==e)throw new c("Orbio returned an invalid quote.");let a=t.map(h),[o,r,s,u,d]=a;if(o===0n||r===0n||r+s>n||u<1n||u>BigInt(i)||d>3n)throw new c("Orbio returned an inconsistent quote.");return a}function Dt(t,e,n){let i=_t(t,7,e,n);if(i[5]+i[6]!==i[0])throw new c("Orbio returned an inconsistent activation quote.");return i}function jt(t,e,n){return _t(t,5,e,n)}function Bt(t,e,n,i,a){let o=n+i,r=ct[Number(a)]??"Unknown",s=o<e?`Partial fill: only ${b(t,o,O)} of the ${b(t,e,O)} budget would be spent (${r}); the rest stays in the wallet.`:`The full ${b(t,e,O)} budget would be spent (${r}).`;return{pull:o,text:s}}async function Gt(t,e,n,i){let a=await t.getBlockNumber(),o=async u=>{let d=await t.readContract({address:B,abi:K,functionName:"getActivationQuote",args:[u,BigInt(n)],blockNumber:a}),[l,,,,,p]=Dt(d,u,n),_=i??BigInt(it(l.toString(),nt));return p>0n&&_>1n&&_<=l};if(await o(e))return e;let r=e,s=e;for(let u=0;u<16&&!(s>It/2n);u++){if(s*=2n,await o(s)){for(;s-r>1n;){let d=(r+s)/2n;await o(d)?s=d:r=d}return s}r=s}throw new c("Orbio amount is too small. A workable minimum could not be quoted; retry when liquidity is available.")}async function kt(t,e,n,i,a){let o=h(await t.readContract({address:e,abi:tt,functionName:"balanceOf",args:[n]}));if(o<i)throw new c(`This wallet holds ${o} ${a} base units and needs ${i}.`)}async function Qt(t,e,n){A(e,["usdgIn","minCreditOut","maxFills","beneficiary"]),y(n);let i=k(e.usdgIn,"usdgIn"),a=Et(e.maxFills),o=e.minCreditOut===void 0?void 0:k(e.minCreditOut,"minCreditOut"),r=e.beneficiary===void 0?N(n):V(e.beneficiary,"beneficiary"),s=await W(t),u=await s.readContract({address:B,abi:K,functionName:"getActivationQuote",args:[i,BigInt(a)]}),[d,l,p,_,S,H,q]=Dt(u,i,a);if(H===0n||o===void 0&&BigInt(it(d.toString(),nt))<=1n){let w=await Gt(s,i,a,o);throw new c(`Orbio amount is too small. Minimum at the quoted block: ${w} USDG base units (${t.formatAmount(w.toString(),gt)} USDG, 6 decimals, chain ${f}).`)}let M=o??BigInt(it(d.toString(),nt));if(M<=1n||M>d)throw new c("minCreditOut must exceed one base unit and be no greater than quoted gross CREDIT.");let{pull:G,text:x}=Bt(t,i,l,p,S),Z=ut(r),Q=[t.approval(rt,B,G.toString(),f),t.unsignedTx({to:B,chainId:f,value:"0",data:$({abi:K,functionName:"buyAndActivate",args:[i,M,Z,BigInt(a)]}),description:"Buy CREDIT and burn it for activation using the beneficiary reference."})],st=C(r,n)?"":` WARNING: the activated balance is credited to ${r}, not this wallet; only that wallet's key can spend it.`;return{...await E(t,n,Q,`Approve exactly ${b(t,G,O)} to Exchange, then buy and burn ${b(t,d,m)} (quoted). ${x} Gross minimum: ${b(t,M,m)}; exchange fee: ${b(t,p,O)}; activation fee: ${b(t,q,m)}; net activation: ${b(t,H,m)}.${st} CREDIT is burned for activation, not transferred into the wallet. Off-chain spendable credit remains unverified until the gateway applies the activation.`),activationRef:Z,beneficiary:r,spendableCredit:{...At},quote:{usdgBudget:g(O,i),usdgSpent:g(O,l),grossCredit:g(m,d),minCreditOut:g(m,M),exchangeFee:g(O,p),activationFee:g(m,q),netActivated:g(m,H),fills:_.toString(),reason:ct[Number(S)]??"Unknown"}}}async function zt(t,e,n){A(e,["usdgIn","minCreditOut","maxFills","recipient"]),y(n);let i=k(e.usdgIn,"usdgIn"),a=Et(e.maxFills),o=e.recipient===void 0?N(n):V(e.recipient,"recipient"),s=await(await W(t)).readContract({address:B,abi:K,functionName:"getQuote",args:[i,BigInt(a)]}),[u,d,l,p,_]=jt(s,i,a),S=e.minCreditOut===void 0?BigInt(it(u.toString(),nt)):k(e.minCreditOut,"minCreditOut");if(S<=0n||S>u)throw new c("minCreditOut must be positive and no greater than quoted CREDIT.");let{pull:H,text:q}=Bt(t,i,d,l,_),M=[t.approval(rt,B,H.toString(),f),t.unsignedTx({to:B,chainId:f,value:"0",data:$({abi:K,functionName:"buy",args:[i,S,o,BigInt(a)]}),description:"Buy CREDIT from the order book and keep it unactivated."})],G=C(o,n)?"":` The CREDIT is delivered to ${o}, not this wallet.`;return{...await E(t,n,M,`Approve exactly ${b(t,H,O)} to Exchange, then buy ${b(t,u,m)} (quoted, minimum ${b(t,S,m)}). ${q} Protocol fee: ${b(t,l,O)}, taken out of the budget.${G} Unactivated CREDIT stays transferable; activate it later with orbio_activate_credit.`),recipient:o,quote:{usdgBudget:g(O,i),usdgSpent:g(O,d),creditOut:g(m,u),minCreditOut:g(m,S),protocolFee:g(O,l),fills:p.toString(),reason:ct[Number(_)]??"Unknown"}}}async function Jt(t,e,n){A(e,["amount","beneficiary"]),y(n);let i=k(e.amount,"amount"),a=e.beneficiary===void 0?void 0:V(e.beneficiary,"beneficiary"),o=await W(t);await kt(o,T,n,i,"CREDIT");let r=await o.readContract({address:T,abi:X,functionName:"previewActivation",args:[i]});if(!Array.isArray(r)||r.length!==2)throw new c("Orbio returned an invalid activation preview.");let[s,u]=[h(r[0]),h(r[1])];if(s===0n||s+u!==i)throw new c("Orbio returned an inconsistent activation preview.");let d=a??N(n),l=a===void 0?$({abi:X,functionName:"activate",args:[i]}):$({abi:X,functionName:"activate",args:[i,ut(a)]}),p=[t.unsignedTx({to:T,chainId:f,value:"0",data:l,description:"Burn held CREDIT into Orbio API balance."})],_=C(d,n)?"":` WARNING: the balance is credited to ${d}, not this wallet.`;return{...await E(t,n,p,`Burn ${b(t,i,m)} permanently; ${b(t,s,m)} of inference balance is credited (activation fee ${b(t,u,m)}) to ${d}.${_} Activated balance cannot be transferred, sold or redeemed. No approval is needed.`),beneficiary:d,activationRef:ut(d),spendableCredit:{...At},activation:{burned:g(m,i),credited:g(m,s),fee:g(m,u)}}}async function Vt(t,e,n){A(e,["to","amount"]),y(n);let i=V(e.to,"to");if(C(i,n)||C(i,T)||C(i,B))throw new c("Choose a different recipient: not this wallet, the CREDIT token or the Exchange.");let a=k(e.amount,"amount"),o=await W(t);await kt(o,T,n,a,"CREDIT");let r=[t.unsignedTx({to:T,chainId:f,value:"0",data:$({abi:X,functionName:"transfer",args:[i,a]}),description:"Transfer unactivated CREDIT."})];return{...await E(t,n,r,`Transfer ${b(t,a,m)} of unactivated CREDIT to ${i}. The recipient can hold, sell or activate it; this wallet loses it.`),recipient:i}}async function Zt(t,e,n){if(A(e,["transactionHash","beneficiary"]),y(n),e.transactionHash!==void 0&&(typeof e.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.transactionHash)))throw new c("Provide a valid activation transaction hash.");let i=await W(t),[a,o,r]=await Promise.all([i.readContract({address:T,abi:tt,functionName:"balanceOf",args:[n]}),i.readContract({address:T,abi:tt,functionName:"totalSupply"}),i.readContract({address:T,abi:X,functionName:"activationFeeBps"}).catch(()=>{})]),s=g(m,h(a)),u=g(m,h(o)),d={walletCredit:s,totalSupply:u,spendableCredit:{...At},...r===void 0?{}:{activationFeeBps:String(r)}};if(e.transactionHash===void 0)return{...d,activation:null};let l=await i.getTransactionReceipt({hash:e.transactionHash}),p=!!l.to&&C(l.to,B),_=!!l.to&&C(l.to,T);if(l.status!=="success"||!C(l.from,n)||!p&&!_||l.transactionHash.toLowerCase()!==e.transactionHash.toLowerCase())throw new c("The transaction is not a successful Orbio activation from this wallet.");let S=e.beneficiary===void 0?N(n):V(e.beneficiary,"beneficiary"),H=ut(S),q=l.logs.filter(w=>C(w.address,T)),M=q.filter(w=>w.topics[0]?.toLowerCase()===qt);if(M.length!==1)throw new c("The receipt must contain one CREDIT activation.");let G=M[0],x=ht({abi:ot,eventName:"Activated",data:G.data,topics:G.topics,strict:!0}).args,Z=p?B:N(n);if(!C(x.from,Z)||x.beneficiary.toLowerCase()!==H||x.amount===0n)throw new c(`The CREDIT activation does not match ${p?"Exchange":"this wallet"} and the beneficiary reference.`);let Q=q.filter(w=>w.topics[0]?.toLowerCase()===Lt).map(w=>ht({abi:ot,eventName:"ActivationFeeCharged",data:w.data,topics:w.topics,strict:!0}).args).filter(w=>w.activationId===x.activationId);if(Q.length>1||Q[0]&&Q[0].feeAtoms>x.amount||Q.length===0&&r!==0)throw new c("The activation fee is missing or inconsistent.");let st=Q[0]?.feeAtoms??0n,ft=q.filter(w=>w.topics[0]?.toLowerCase()===Ut).reduce((w,Ct)=>{let mt=ht({abi:tt,eventName:"Transfer",data:Ct.data,topics:Ct.topics,strict:!0}).args;return w+(C(mt.from,Z)&&C(mt.to,yt)?mt.value:0n)},0n);if(ft!==x.amount)throw new c("The CREDIT burn does not match the activation amount.");return{...d,activation:{status:"onchain_success",id:x.activationId.toString(),transactionHash:l.transactionHash,blockNumber:l.blockNumber.toString(),by:Z,ref:H,beneficiary:S,grossCredit:g(m,x.amount),burnedCredit:g(m,ft),activationFee:g(m,st),netActivated:g(m,x.amount-st),note:"Receipt inclusion only. Run orbio_tx_status for the gateway state: the balance is spendable once it is applied. totalSupply is a current read, not a historical supply delta."}}}async function vt(t){let e=await t.readContract({address:U,abi:tt,functionName:"decimals"});if(typeof e!="number"||!Number.isInteger(e)||e<0||e>36)throw new c("Orbio returned invalid ORBIO decimals.");return e}async function Yt(t,e,n){A(e,[]),y(n);let i=await W(t),[a,o,r,s,u]=await Promise.all([vt(i),i.readContract({address:U,abi:tt,functionName:"balanceOf",args:[n]}),i.readContract({address:R,abi:D,functionName:"positionOf",args:[n]}),i.readContract({address:R,abi:D,functionName:"settledOf",args:[n]}),i.readContract({address:R,abi:D,functionName:"MIN_POSITION"})]),d={address:U,chainId:f,symbol:"ORBIO",decimals:a};return{orbioBalance:g(d,h(o)),stakedPosition:g(d,h(r)),settledCredit:g(m,h(s)),minimumPosition:g(d,h(u)),note:"Staking ORBIO is optional: it earns CREDIT hourly and is not needed to buy or use CREDIT."}}async function Kt(t,e,n){A(e,["orbioWei"]),y(n);let i=k(e.orbioWei,"orbioWei"),a=await W(t),o=await vt(a),r={address:U,chainId:f,symbol:"ORBIO",decimals:o};await kt(a,U,n,i,"ORBIO");let[s,u]=await Promise.all([a.readContract({address:R,abi:D,functionName:"positionOf",args:[n]}),a.readContract({address:R,abi:D,functionName:"MIN_POSITION"})]);if(h(s)+i<h(u))throw new c(`A staking position has to reach ${b(t,h(u),r)}; this would leave ${b(t,h(s)+i,r)}.`);let d=[t.approval(U,R,i.toString(),f),t.unsignedTx({to:R,chainId:f,value:"0",data:$({abi:D,functionName:"stake",args:[i]}),description:"Stake ORBIO."})];return E(t,n,d,`Approve exactly ${b(t,i,r)} to the staking contract, then stake it. Staked ORBIO earns CREDIT hourly; take it back with orbio_unstake.`)}async function Xt(t,e,n){A(e,["orbioWei"]),y(n);let i=k(e.orbioWei,"orbioWei"),a=await W(t),o=await vt(a),r={address:U,chainId:f,symbol:"ORBIO",decimals:o},s=h(await a.readContract({address:R,abi:D,functionName:"positionOf",args:[n]}));if(s<i)throw new c(`This wallet has ${b(t,s,r)} staked and cannot unstake ${b(t,i,r)}.`);let u=[t.unsignedTx({to:R,chainId:f,value:"0",data:$({abi:D,functionName:"unstake",args:[i]}),description:"Unstake ORBIO."})];return E(t,n,u,`Unstake ${b(t,i,r)} of ORBIO back to this wallet. What stays staked keeps earning.`)}async function te(t,e,n){A(e,[]),y(n);let i=await W(t),a=h(await i.readContract({address:R,abi:D,functionName:"settledOf",args:[n]}));if(a===0n)throw new c("No settled CREDIT is waiting to be claimed for this wallet.");let o=[t.unsignedTx({to:R,chainId:f,value:"0",data:$({abi:D,functionName:"claim"}),description:"Claim settled staking CREDIT."})];return E(t,n,o,`Mint ${b(t,a,m)} of settled staking rewards to this wallet as unactivated CREDIT.`)}function j(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}async function J(t,e){let n=await t.http(`${Ft}${e}`,{method:"GET",headers:{accept:"application/json"}});if(!n.ok)throw new c(`Orbio returned HTTP ${n.status} for a public read.`);let i;try{i=await n.json()}catch{throw new c("Orbio returned malformed JSON.")}if(!j(i))throw new c("Orbio returned an unexpected response.");return i}function lt(t,e=0){return t===null||typeof t=="boolean"?t:typeof t=="number"?Number.isFinite(t)?t:null:typeof t=="string"?/^-?[0-9]{1,40}(\.[0-9]{1,40})?$/.test(t)?t:Y(t.slice(0,200)):e>=4?null:Array.isArray(t)?t.slice(0,1440).map(n=>lt(n,e+1)):j(t)?Object.fromEntries(Object.entries(t).slice(0,50).map(([n,i])=>[n.slice(0,40).replace(/[^A-Za-z0-9_.-]/g,"_"),lt(i,e+1)])):null}var L=(t,e=200)=>typeof t=="string"?Y(t.slice(0,e)):void 0,et=t=>typeof t=="string"&&/^[0-9]{1,78}$/.test(t)?t:typeof t=="number"&&Number.isSafeInteger(t)&&t>=0?String(t):void 0,Wt=t=>typeof t=="string"&&/^0x[0-9a-fA-F]{64}$/.test(t)?t:void 0,pt=t=>typeof t=="string"&&/^0x[0-9a-fA-F]{40}$/.test(t)?N(t):void 0;function xt(t){return j(t)?{agentId:et(t.agentId),token:pt(t.token),owner:pt(t.owner),agentWallet:pt(t.agentWallet),feeBps:typeof t.feeBps=="number"?t.feeBps:void 0,stakeWei:et(t.stakeWei),creditOwedAtoms:et(t.creditOwedAtoms),name:L(t.name,80),symbol:L(t.symbol,24)}:null}async function Mt(t){let e=await J(t,"/api/protocol/agents/terms");return{live:e.live===!0,paused:e.paused===!0,launchFeeWei:et(e.launchFeeWei),feeBps:typeof e.feeBps=="number"?e.feeBps:void 0,economics:Wt(e.economics)??null,nextAgentId:et(e.nextAgentId)??null}}async function ee(t,e,n){if(A(e,["agentId","owned","view","range"]),y(n),e.view!==void 0){if(e.view==="analytics")return{analytics:lt(await J(t,"/api/protocol/agents/analytics")),note:"Indexer totals; null means unavailable, never zero."};if(e.view==="chart"){let d=e.range===void 0?"1d":e.range;if(!["1h","4h","1d"].includes(String(d)))throw new c("range must be 1h, 4h or 1d.");let l=k(e.agentId,"agentId");return{agentId:l.toString(),range:d,chart:lt(await J(t,`/api/protocol/agents/${l.toString()}/chart?range=${d}`))}}throw new c("view must be analytics or chart.")}let i=await Mt(t);if(e.agentId===void 0){let d=e.owned===!1?void 0:await J(t,`/api/protocol/agents?wallet=${N(n)}`),l=d&&Array.isArray(d.data)?d.data.slice(0,50).map(xt).filter(Boolean):[];return{terms:i,ownedAgents:l,note:"Launch and manage agents with orbio_agent_launch / harvest / claim_credit / withdraw_principal / set_wallet."}}let a=k(e.agentId,"agentId"),o=await W(t),[r,s]=await Promise.all([o.readContract({address:F,abi:P,functionName:"stakeOf",args:[a]}),o.readContract({address:F,abi:P,functionName:"unlocksAt",args:[a]})]),u=await J(t,`/api/protocol/agents/${a.toString()}`).then(xt,()=>null);return{terms:i,agentId:a.toString(),stakeWei:h(r).toString(),principalUnlocksAt:h(BigInt(s)).toString(),gateway:u,note:"On-chain stake/unlock are authoritative; the gateway record is an indexer view and may lag."}}function ne(t){let e=["twitter","telegram","discord","website","farcaster"];if(t===void 0)return{twitter:"",telegram:"",discord:"",website:"",farcaster:""};if(!j(t)||Object.keys(t).some(i=>!e.includes(i)))throw new c("socials may only contain twitter, telegram, discord, website and farcaster strings.");let n={};for(let i of e){let a=t[i];if(a!==void 0&&(typeof a!="string"||a.length>256))throw new c(`socials.${i} must be a string of at most 256 characters.`);n[i]=a??""}return n}function dt(t,e,n,i=!1){if(t===void 0&&!i)return"";if(typeof t!="string"||i&&!t.trim()||t.length>n)throw new c(`${e} must be ${i?"a non-empty ":"a "}string of at most ${n} characters.`);return t}async function ie(t,e,n){A(e,["name","symbol","logo","description","socials","agentWallet","salt"]),y(n);let i=await Mt(t);if(!i.live||i.paused)throw new c("The Orbio agent launchpad is not live or is paused right now.");if(i.economics===null||i.launchFeeWei===void 0)throw new c("Orbio did not publish launch terms (fee and economics pin); nothing was built.");let a=BigInt(i.launchFeeWei),o=e.agentWallet===void 0?N(n):V(e.agentWallet,"agentWallet"),r=e.salt===void 0?`0x${"00".repeat(32)}`:Wt(e.salt)??(()=>{throw new c("salt must be 32 bytes of hex.")})(),s={name:dt(e.name,"name",64,!0),symbol:dt(e.symbol,"symbol",16,!0),logo:dt(e.logo,"logo",512),description:dt(e.description,"description",1024),socials:ne(e.socials),creatorFeeRecipient:yt,creatorTaxBps:0,buybackEnabled:!1,expectedEconomics:i.economics,salt:r},u=[t.unsignedTx({to:F,chainId:f,value:a.toString(),data:$({abi:P,functionName:"launch",args:[s,o]}),description:"Launch an Orbio agent token through the agent vault."})];return{...await E(t,n,u,`Launch agent token ${JSON.stringify(s.name)} (${JSON.stringify(s.symbol)}) through the Orbio agent vault. Pays the launch fee of ${b(t,a,St)} plus gas. Agent wallet: ${o}${C(o,n)?" (this wallet: one key controls the agent and can also withdraw its principal)":""}. Orbio takes a share of creator fees and stakes the rest for the agent; the agent id is in the AgentLaunched event, not nextAgentId.`),agentWallet:o,launchFee:g(St,a),economics:i.economics}}async function ae(t,e,n){if(A(e,["agentIds"]),y(n),!Array.isArray(e.agentIds)||e.agentIds.length<1||e.agentIds.length>20)throw new c("agentIds must list 1 to 20 agent ids.");let i=e.agentIds.map((o,r)=>k(o,`agentIds[${r}]`)),a=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"harvest",args:[i]}),description:"Harvest agent creator fees into stake."})];return E(t,n,a,`Harvest creator fees for agent ${i.join(", ")} and stake them. Orbio's keeper does this on a schedule; this is for impatience.`)}async function oe(t,e,n){A(e,["agentId","activate"]),y(n);let i=k(e.agentId,"agentId");if(typeof e.activate!="boolean")throw new c("Set activate to true (burn into inference balance, irreversible) or false (receive CREDIT tokens).");let a=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"claimCredit",args:[i,e.activate]}),description:"Claim agent CREDIT."})];return E(t,n,a,e.activate?`Claim the CREDIT agent ${i} has earned and activate it into inference balance. This burn is irreversible; the balance cannot be transferred or redeemed.`:`Claim the CREDIT agent ${i} has earned as CREDIT tokens (not activated).`)}async function se(t,e,n){A(e,["agentId","orbioWei"]),y(n);let i=k(e.agentId,"agentId"),a=k(e.orbioWei,"orbioWei"),o=await W(t),[r,s]=await Promise.all([o.readContract({address:F,abi:P,functionName:"unlocksAt",args:[i]}),o.readContract({address:F,abi:P,functionName:"stakeOf",args:[i]})]),u=BigInt(r),d=await o.getBlock?.({blockTag:"latest"});if((d?d.timestamp:BigInt(Math.floor(Date.now()/1e3)))<u)throw new c(`This agent's principal is locked until ${new Date(Number(u)*1e3).toISOString()}.`);if(h(s)<a)throw new c(`Agent ${i} has ${h(s)} ORBIO wei staked and cannot withdraw ${a}.`);let p=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"withdrawPrincipal",args:[i,a]}),description:"Withdraw agent principal (owner only)."})];return E(t,n,p,`Withdraw ${a} ORBIO wei of principal from agent ${i} to the owner (this call reverts unless this wallet is the owner). The agent stops earning on what leaves.`)}async function re(t,e,n){A(e,["agentId","agentWallet"]),y(n);let i=k(e.agentId,"agentId"),a=V(e.agentWallet,"agentWallet"),o=[t.unsignedTx({to:F,chainId:f,value:"0",data:$({abi:P,functionName:"setAgentWallet",args:[i,a]}),description:"Change the agent wallet (owner only)."})];return E(t,n,o,`Point agent ${i} at the new agent wallet ${a} (this call reverts unless this wallet is the owner). The new wallet can harvest and claim for the agent.`)}async function ce(t,e){if(A(e,["transactionHash","chain"]),typeof e.transactionHash!="string"||!/^0x[0-9a-fA-F]{64}$/.test(e.transactionHash))throw new c("Provide a valid transaction hash.");let n=e.chain===void 0?"robinhood":e.chain;if(n!=="robinhood"&&n!=="ethereum")throw new c("chain must be robinhood (activations here) or ethereum. Solana activations need a Solana signature and are not supported.");let i=await J(t,`/api/protocol/tx/${e.transactionHash}${n==="ethereum"?"?chain=1":""}`),a=typeof i.status=="string"?i.status.slice(0,40):"unknown";return{transactionHash:e.transactionHash,chain:n,status:a,applied:a==="applied",blockNumber:et(i.blockNumber),events:Array.isArray(i.events)?i.events.filter(o=>typeof o=="string").slice(0,20).map(o=>Y(o.slice(0,60))):[],note:a==="applied"?"The gateway applied this activation: the wallet key now works and the balance is spendable.":"Not applied yet. Poll again in a few seconds; do not burn again."}}var de={models:"/api/v1/models",tools:"/api/v1/tools",infra:"/api/v1/infra/tools"};async function ue(t,e){A(e,["kind","query","name","limit","outputModality"]);let n=e.kind;if(n!=="models"&&n!=="tools"&&n!=="infra")throw new c("kind must be models, tools or infra.");let i=e.limit===void 0?25:e.limit;if(typeof i!="number"||!Number.isInteger(i)||i<1||i>100)throw new c("limit must be an integer from 1 to 100.");let a=e.query===void 0?void 0:typeof e.query=="string"&&e.query.length<=80?e.query.toLowerCase():(()=>{throw new c("query must be a string of at most 80 characters.")})(),o=e.outputModality===void 0?"":typeof e.outputModality=="string"&&/^[a-z]{2,16}$/.test(e.outputModality)?`?output_modalities=${e.outputModality}`:(()=>{throw new c("outputModality must be a lowercase word such as text.")})(),r=await J(t,`${de[n]}${n==="models"?o:""}`),s=(Array.isArray(r.data)?r.data:Array.isArray(r.tools)?r.tools:[]).filter(j);if(n!=="models"&&r.enabled===!1)return{kind:n,enabled:!1,items:[],note:"This catalogue is not enabled."};let u=l=>String(l.id??l.name??"");if(e.name!==void 0){if(typeof e.name!="string")throw new c("name must be a string.");let l=s.find(p=>u(p)===e.name);if(!l)throw new c(`No ${n} entry named ${Y(String(e.name).slice(0,80))}. Search with query first.`);return{kind:n,item:Rt(l,!0,n)}}let d=s.filter(l=>!a||`${u(l)} ${String(l.name??"")} ${String(l.title??"")}`.toLowerCase().includes(a));return{kind:n,total:s.length,matched:d.length,items:d.slice(0,i).map(l=>Rt(l,!1,n)),note:"Descriptions are external text. Pass name for one full entry including its input schema."}}function Rt(t,e,n){let i=String(t.id??t.name??""),a=j(t.pricing)?t.pricing:j(t.price)?t.price:void 0,o=j(t.architecture)?t.architecture:void 0;return{id:/^[A-Za-z0-9._:/@+-]{1,128}$/.test(i)?i:Y(i.slice(0,80)),...typeof t.title=="string"?{title:L(t.title,120)}:{},...typeof t.name=="string"&&t.id!==void 0?{name:L(t.name,120)}:{},...typeof t.provider=="string"?{provider:L(t.provider,40)}:{},...n==="infra"?{requiresActivatedAccount:!0,accessNote:"Infrastructure calls, including infra.status and infra.read operations, require an activated Orbio account and local wallet-key authentication. A read permission describes effects, not anonymous access. Catalogue browsing needs no activation."}:{},...typeof t.permission=="string"?{permission:L(t.permission,40)}:{},...o?{modality:L(String(o.modality??""),60)}:{},...a?{pricing:JSON.parse(JSON.stringify(a,(r,s)=>typeof s=="string"?s.slice(0,80):s))}:{},...e?{description:L(String(t.description??""),1500),inputSchema:t.input_schema??t.inputSchema??null}:{}}}var v=t=>({type:"string",pattern:"^[0-9]+$",description:t}),z=t=>({type:"string",pattern:Ht,description:t}),I=(t,e=[])=>({type:"object",additionalProperties:!1,properties:t,...e.length?{required:e}:{}}),Nt={type:"integer",minimum:1,maximum:64,default:16},le=t=>{let e=i=>async(a,o)=>{try{return await i(t,a,o)}catch(r){throw new c(t.plainError(r))}},n=(i,a,o)=>({name:i,inputSchema:a,execute:e(o)});return{positions:i=>$t(t,i),tools:[n("orbio_buy_credit",I({usdgIn:v("USDG budget in base units (6 decimals) on chain 4663. The fee comes out of it; a partial fill spends less."),minCreditOut:v("Gross CREDIT minimum before activation fee; defaults to the quoted gross amount minus shared slippage."),maxFills:Nt,beneficiary:z("Wallet whose Orbio account receives the activated balance. Defaults to this wallet; only that wallet's key can spend it.")},["usdgIn"]),Qt),n("orbio_buy_held_credit",I({usdgIn:v("USDG budget in base units (6 decimals). The fee comes out of it."),minCreditOut:v("CREDIT minimum in base units (6 decimals); defaults to the quote minus shared slippage."),maxFills:Nt,recipient:z("Wallet that receives the unactivated CREDIT. Defaults to this wallet.")},["usdgIn"]),zt),n("orbio_activate_credit",I({amount:v("CREDIT base units (6 decimals) to burn into API balance. Irreversible."),beneficiary:z("Wallet whose Orbio account is credited (for example a worker). Defaults to this wallet.")},["amount"]),Jt),n("orbio_transfer_credit",I({to:z("Recipient of the unactivated CREDIT, for example a worker wallet."),amount:v("CREDIT base units (6 decimals).")},["to","amount"]),Vt),n("orbio_credit_status",I({transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$",description:"Optional activation receipt to inspect for this wallet: a buyAndActivate or a direct activate."},beneficiary:z("Beneficiary the activation should have named; defaults to this wallet.")}),Zt),n("orbio_tx_status",I({transactionHash:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"},chain:{enum:["robinhood","ethereum"],default:"robinhood",description:"Chain of the activation transaction."}},["transactionHash"]),ce),n("orbio_catalog",I({kind:{enum:["models","tools","infra"],description:"models: inference models; tools: metered gateway tools; infra: sandboxes, deployments, servers, databases, inboxes."},query:{type:"string",description:"Case-insensitive substring of the id, name or title."},name:{type:"string",description:"Exact id/name for one full entry including its input schema."},limit:{type:"integer",minimum:1,maximum:100,default:25},outputModality:{type:"string",description:"Models only: filter such as text."}},["kind"]),ue),n("orbio_staking_status",I({}),Yt),n("orbio_stake",I({orbioWei:v("ORBIO base units to stake (18 decimals).")},["orbioWei"]),Kt),n("orbio_unstake",I({orbioWei:v("ORBIO base units to take back.")},["orbioWei"]),Xt),n("orbio_claim_staking",I({}),te),n("orbio_agent_status",I({agentId:v("Agent id to read on-chain stake and principal unlock time for. Omit to list this wallet's agents and the launch terms."),owned:{type:"boolean",default:!0},view:{enum:["analytics","chart"],description:"analytics: launchpad-wide totals; chart: one agent's minute-sampled price history (needs agentId)."},range:{enum:["1h","4h","1d"],default:"1d"}}),ee),n("orbio_agent_launch",I({name:{type:"string",maxLength:64},symbol:{type:"string",maxLength:16},logo:{type:"string",maxLength:512},description:{type:"string",maxLength:1024},socials:{type:"object",additionalProperties:!1,properties:{twitter:{type:"string"},telegram:{type:"string"},discord:{type:"string"},website:{type:"string"},farcaster:{type:"string"}}},agentWallet:z("The agent's hot wallet. Defaults to this wallet (one key controls everything, including principal withdrawal)."),salt:{type:"string",pattern:"^0x[0-9a-fA-F]{64}$"}},["name","symbol"]),ie),n("orbio_agent_harvest",I({agentIds:{type:"array",items:v("Agent id."),minItems:1,maxItems:20}},["agentIds"]),ae),n("orbio_agent_claim_credit",I({agentId:v("Agent id."),activate:{type:"boolean",description:"true burns the claimed CREDIT into inference balance (irreversible); false delivers CREDIT tokens. Required."}},["agentId","activate"]),oe),n("orbio_agent_withdraw_principal",I({agentId:v("Agent id."),orbioWei:v("ORBIO base units of principal to withdraw (owner only, after the unlock time).")},["agentId","orbioWei"]),se),n("orbio_agent_set_wallet",I({agentId:v("Agent id."),agentWallet:z("New agent hot wallet (owner only).")},["agentId","agentWallet"]),re)]}};function ke(t){return Ot("orbio",[le(t)])}export{Ae as ORBIO_DESTINATIONS,at as ORBIO_PINS,ke as createModule,le as createModulePart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"../../../chunks/6JCEJ66K.js";export{a as ORBIO_PINS,b as QUOTE_REASONS,e as activationAbi,g as agentVaultAbi,d as creditAbi,c as exchangeAbi,f as stakingAbi};
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../../../chunks/6JCEJ66K.js";import"../../../chunks/63YRSLDK.js";export{a as ORBIO_PINS,b as QUOTE_REASONS,e as activationAbi,g as agentVaultAbi,d as creditAbi,c as exchangeAbi,f as stakingAbi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunks/TAEZTP4L.js";import"../../../chunks/6JCEJ66K.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/FWD4L3CJ.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as readPositions};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient } from 'viem';
|
|
2
|
+
export declare const factoryAbi: readonly [{
|
|
3
|
+
readonly name: "isValidMarket";
|
|
4
|
+
readonly type: "function";
|
|
5
|
+
readonly stateMutability: "view";
|
|
6
|
+
readonly inputs: readonly [{
|
|
7
|
+
readonly type: "address";
|
|
8
|
+
readonly name: "market";
|
|
9
|
+
}];
|
|
10
|
+
readonly outputs: readonly [{
|
|
11
|
+
readonly type: "bool";
|
|
12
|
+
}];
|
|
13
|
+
}];
|
|
14
|
+
export declare const createNewMarketEvent: {
|
|
15
|
+
readonly name: "CreateNewMarket";
|
|
16
|
+
readonly type: "event";
|
|
17
|
+
readonly inputs: readonly [{
|
|
18
|
+
readonly type: "address";
|
|
19
|
+
readonly name: "market";
|
|
20
|
+
readonly indexed: true;
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "address";
|
|
23
|
+
readonly name: "PT";
|
|
24
|
+
readonly indexed: true;
|
|
25
|
+
}, {
|
|
26
|
+
readonly type: "int256";
|
|
27
|
+
readonly name: "scalarRoot";
|
|
28
|
+
}, {
|
|
29
|
+
readonly type: "int256";
|
|
30
|
+
readonly name: "initialAnchor";
|
|
31
|
+
}, {
|
|
32
|
+
readonly type: "uint256";
|
|
33
|
+
readonly name: "lnFeeRateRoot";
|
|
34
|
+
}];
|
|
35
|
+
};
|
|
36
|
+
export declare const marketAbi: readonly [{
|
|
37
|
+
readonly name: "readTokens";
|
|
38
|
+
readonly type: "function";
|
|
39
|
+
readonly stateMutability: "view";
|
|
40
|
+
readonly inputs: readonly [];
|
|
41
|
+
readonly outputs: readonly [{
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
readonly name: "sy";
|
|
44
|
+
}, {
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
readonly name: "pt";
|
|
47
|
+
}, {
|
|
48
|
+
readonly type: "address";
|
|
49
|
+
readonly name: "yt";
|
|
50
|
+
}];
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "expiry";
|
|
53
|
+
readonly type: "function";
|
|
54
|
+
readonly stateMutability: "view";
|
|
55
|
+
readonly inputs: readonly [];
|
|
56
|
+
readonly outputs: readonly [{
|
|
57
|
+
readonly type: "uint256";
|
|
58
|
+
}];
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "isExpired";
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
readonly stateMutability: "view";
|
|
63
|
+
readonly inputs: readonly [];
|
|
64
|
+
readonly outputs: readonly [{
|
|
65
|
+
readonly type: "bool";
|
|
66
|
+
}];
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "readState";
|
|
69
|
+
readonly type: "function";
|
|
70
|
+
readonly stateMutability: "view";
|
|
71
|
+
readonly inputs: readonly [{
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
readonly name: "router";
|
|
74
|
+
}];
|
|
75
|
+
readonly outputs: readonly [{
|
|
76
|
+
readonly type: "tuple";
|
|
77
|
+
readonly components: readonly [{
|
|
78
|
+
readonly type: "uint256";
|
|
79
|
+
readonly name: "totalPt";
|
|
80
|
+
}, {
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
readonly name: "totalSy";
|
|
83
|
+
}, {
|
|
84
|
+
readonly type: "uint256";
|
|
85
|
+
readonly name: "totalLp";
|
|
86
|
+
}, {
|
|
87
|
+
readonly type: "address";
|
|
88
|
+
readonly name: "treasury";
|
|
89
|
+
}, {
|
|
90
|
+
readonly type: "int256";
|
|
91
|
+
readonly name: "scalarRoot";
|
|
92
|
+
}, {
|
|
93
|
+
readonly type: "uint256";
|
|
94
|
+
readonly name: "expiry";
|
|
95
|
+
}, {
|
|
96
|
+
readonly type: "uint256";
|
|
97
|
+
readonly name: "lnFeeRateRoot";
|
|
98
|
+
}, {
|
|
99
|
+
readonly type: "uint256";
|
|
100
|
+
readonly name: "reserveFeeRate";
|
|
101
|
+
}, {
|
|
102
|
+
readonly type: "uint256";
|
|
103
|
+
readonly name: "lastLnImpliedRate";
|
|
104
|
+
}];
|
|
105
|
+
readonly name: "state";
|
|
106
|
+
}];
|
|
107
|
+
}];
|
|
108
|
+
export declare const syAbi: readonly [{
|
|
109
|
+
readonly name: "getTokensIn";
|
|
110
|
+
readonly type: "function";
|
|
111
|
+
readonly stateMutability: "view";
|
|
112
|
+
readonly inputs: readonly [];
|
|
113
|
+
readonly outputs: readonly [{
|
|
114
|
+
readonly type: "address[]";
|
|
115
|
+
}];
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "getTokensOut";
|
|
118
|
+
readonly type: "function";
|
|
119
|
+
readonly stateMutability: "view";
|
|
120
|
+
readonly inputs: readonly [];
|
|
121
|
+
readonly outputs: readonly [{
|
|
122
|
+
readonly type: "address[]";
|
|
123
|
+
}];
|
|
124
|
+
}, {
|
|
125
|
+
readonly name: "decimals";
|
|
126
|
+
readonly type: "function";
|
|
127
|
+
readonly stateMutability: "view";
|
|
128
|
+
readonly inputs: readonly [];
|
|
129
|
+
readonly outputs: readonly [{
|
|
130
|
+
readonly type: "uint8";
|
|
131
|
+
}];
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "exchangeRate";
|
|
134
|
+
readonly type: "function";
|
|
135
|
+
readonly stateMutability: "view";
|
|
136
|
+
readonly inputs: readonly [];
|
|
137
|
+
readonly outputs: readonly [{
|
|
138
|
+
readonly type: "uint256";
|
|
139
|
+
}];
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "previewRedeem";
|
|
142
|
+
readonly type: "function";
|
|
143
|
+
readonly stateMutability: "view";
|
|
144
|
+
readonly inputs: readonly [{
|
|
145
|
+
readonly type: "address";
|
|
146
|
+
readonly name: "tokenOut";
|
|
147
|
+
}, {
|
|
148
|
+
readonly type: "uint256";
|
|
149
|
+
readonly name: "amountSharesToRedeem";
|
|
150
|
+
}];
|
|
151
|
+
readonly outputs: readonly [{
|
|
152
|
+
readonly type: "uint256";
|
|
153
|
+
readonly name: "amountTokenOut";
|
|
154
|
+
}];
|
|
155
|
+
}];
|
|
156
|
+
export declare const ytAbi: readonly [{
|
|
157
|
+
readonly name: "pyIndexStored";
|
|
158
|
+
readonly type: "function";
|
|
159
|
+
readonly stateMutability: "view";
|
|
160
|
+
readonly inputs: readonly [];
|
|
161
|
+
readonly outputs: readonly [{
|
|
162
|
+
readonly type: "uint256";
|
|
163
|
+
}];
|
|
164
|
+
}];
|
|
165
|
+
export declare const tokenAbi: readonly [{
|
|
166
|
+
readonly name: "symbol";
|
|
167
|
+
readonly type: "function";
|
|
168
|
+
readonly stateMutability: "view";
|
|
169
|
+
readonly inputs: readonly [];
|
|
170
|
+
readonly outputs: readonly [{
|
|
171
|
+
readonly type: "string";
|
|
172
|
+
}];
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "decimals";
|
|
175
|
+
readonly type: "function";
|
|
176
|
+
readonly stateMutability: "view";
|
|
177
|
+
readonly inputs: readonly [];
|
|
178
|
+
readonly outputs: readonly [{
|
|
179
|
+
readonly type: "uint8";
|
|
180
|
+
}];
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "balanceOf";
|
|
183
|
+
readonly type: "function";
|
|
184
|
+
readonly stateMutability: "view";
|
|
185
|
+
readonly inputs: readonly [{
|
|
186
|
+
readonly type: "address";
|
|
187
|
+
readonly name: "owner";
|
|
188
|
+
}];
|
|
189
|
+
readonly outputs: readonly [{
|
|
190
|
+
readonly type: "uint256";
|
|
191
|
+
}];
|
|
192
|
+
}];
|
|
193
|
+
export interface Call {
|
|
194
|
+
address: Address;
|
|
195
|
+
abi: Abi;
|
|
196
|
+
functionName: string;
|
|
197
|
+
args?: readonly unknown[];
|
|
198
|
+
}
|
|
199
|
+
export type Read = {
|
|
200
|
+
ok: true;
|
|
201
|
+
value: unknown;
|
|
202
|
+
} | {
|
|
203
|
+
ok: false;
|
|
204
|
+
};
|
|
205
|
+
export declare function batch(client: PublicClient, contracts: readonly Call[]): Promise<Read[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../../../chunks/SK2VBNAU.js";import"../../../chunks/63YRSLDK.js";export{g as batch,b as createNewMarketEvent,a as factoryAbi,c as marketAbi,d as syAbi,f as tokenAbi,e as ytAbi};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OakError } from '../../errors.js';
|
|
2
|
+
import type { Address } from '../../types.js';
|
|
3
|
+
export declare const CONVERT_URL = "https://api-v2.pendle.finance/core/v3/sdk/4663/convert";
|
|
4
|
+
export declare class ConvertError extends OakError {
|
|
5
|
+
readonly kind: 'http' | 'forbidden' | 'dust' | 'malformed' | 'unavailable';
|
|
6
|
+
constructor(kind: 'http' | 'forbidden' | 'dust' | 'malformed' | 'unavailable', message: string);
|
|
7
|
+
}
|
|
8
|
+
export interface ConvertRequest {
|
|
9
|
+
inputToken: Address;
|
|
10
|
+
outputToken: Address;
|
|
11
|
+
amount: bigint;
|
|
12
|
+
wallet: Address;
|
|
13
|
+
slippageBps: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ConvertQuote {
|
|
16
|
+
body: unknown;
|
|
17
|
+
receivedAt: number;
|
|
18
|
+
}
|
|
19
|
+
export type ObjectData = Record<string, unknown>;
|
|
20
|
+
export declare function object(value: unknown): ObjectData;
|
|
21
|
+
export declare function uint(value: unknown): bigint;
|
|
22
|
+
export declare function address(value: unknown): Address;
|
|
23
|
+
export declare function quoteRoute(body: unknown): ObjectData;
|
|
24
|
+
export declare function convert(http: typeof fetch, request: ConvertRequest): Promise<ConvertQuote>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../../../chunks/H43RNCX2.js";import"../../../chunks/VEQBHI6O.js";import"../../../chunks/OTXSKFUD.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as CONVERT_URL,b as ConvertError,e as address,g as convert,c as object,f as quoteRoute,d as uint};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunks/KIFZ5ZSK.js";import"../../../chunks/QU5XKRGK.js";import"../../../chunks/4HG6FRVH.js";import"../../../chunks/H43RNCX2.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/VEQBHI6O.js";import"../../../chunks/OTXSKFUD.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/FWD4L3CJ.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as quoteCosts};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ModuleContext, ProjectModule } from '../../types.js';
|
|
2
|
+
import type { VerifyMarket } from './types.js';
|
|
3
|
+
export declare const API_DOWN_NOTICE: "Pendle's price service isn't answering, so I can't quote or start a new term; I can still cash out ended terms.";
|
|
4
|
+
export declare const PENDLE_RISK: {
|
|
5
|
+
readonly summary: "Pendle is a trading app; thin trading can make leaving early cost you, and its code can fail or be changed by its team.";
|
|
6
|
+
readonly earlyExit: "If you leave early you sell at the market price that day, and that can be less than you put in.";
|
|
7
|
+
readonly fixedRate: "The rate is fixed only if you hold until the end date.";
|
|
8
|
+
readonly contractChange: "Pendle's router can be upgraded by Pendle's team, so its code can change.";
|
|
9
|
+
};
|
|
10
|
+
export declare function createVerify(context: ModuleContext): VerifyMarket;
|
|
11
|
+
export declare function createModule(context: ModuleContext): ProjectModule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k}from"../../../chunks/GNC6RXLT.js";import"../../../chunks/HKEMQBFA.js";import{a as j}from"../../../chunks/S47VUTHM.js";import{a as $,b as U,c as g,e as F}from"../../../chunks/52ELWNXJ.js";import{b as L,c as O}from"../../../chunks/MRMR4QHA.js";import{c as S,h as I,i as v}from"../../../chunks/Q42YI3EP.js";import"../../../chunks/SK2VBNAU.js";import"../../../chunks/QU5XKRGK.js";import"../../../chunks/4HG6FRVH.js";import"../../../chunks/H43RNCX2.js";import{P as R,fa as w,i as T,j as b,k as C,l as N}from"../../../chunks/JUZ5JU6D.js";import"../../../chunks/57MEFFCU.js";import"../../../chunks/VYYSL557.js";import"../../../chunks/WU7XIAXB.js";import"../../../chunks/6WD4HHID.js";import"../../../chunks/P56RZC2M.js";import"../../../chunks/TM2XCRU7.js";import"../../../chunks/MJ6WEWMI.js";import"../../../chunks/3GOHSYHW.js";import"../../../chunks/L4N2RSK2.js";import"../../../chunks/3NJ5KQ3Q.js";import"../../../chunks/P5PYFK7L.js";import"../../../chunks/ZQAFFWDK.js";import"../../../chunks/WP6RHXGN.js";import"../../../chunks/3MLUCYCB.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/RVDUSNWW.js";import"../../../chunks/ZV5HIQXC.js";import"../../../chunks/RUX3RY7Y.js";import"../../../chunks/XBE3B6Y2.js";import"../../../chunks/PV5FDT6O.js";import"../../../chunks/U4JGEMKT.js";import"../../../chunks/P4UQGWCP.js";import{b as M}from"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import{a as _}from"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/VEQBHI6O.js";import"../../../chunks/OTXSKFUD.js";import"../../../chunks/66F5ZH34.js";import{g as A}from"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/ABPL3ZZI.js";import{a as f}from"../../../chunks/FWD4L3CJ.js";import{a as h}from"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";import{getAddress as q}from"viem";var K=w.text,B={summary:T,earlyExit:b,fixedRate:C,contractChange:N},W=86400;function X(e){return async n=>{_(n);let l=e.clientFor(f),s=await S(e.http).then(({rows:a})=>a.find(i=>A(i.market,n)),()=>{});return L(l,s??await I(l,q(n)))}}function G(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(n=>n!=="include_ended"))throw new h("Pendle listing takes only include_ended.");if(e.include_ended!==void 0&&typeof e.include_ended!="boolean")throw new h("include_ended must be true or false.");return e.include_ended===!0}function z(e){return{name:"pendle_list",inputSchema:{type:"object",properties:{include_ended:{type:"boolean",description:"Include inactive and ended terms; default false."}},additionalProperties:!1},execute:async(n,l)=>{try{let s=G(n);_(l);let a=e.clientFor(f),i=Math.floor(Date.now()/1e3),r=await v(e,{allowChain:!0,now:i}),u=r.rows.filter(t=>s||t.active&&t.expiry>i),[{ok:H,dropped:V},E]=await Promise.all([O(a,u,{now:i}),U(a,l,u)]),D=[...r.dropped,...V],P=H.flatMap(({row:t,facts:c})=>{let o=c.verified,d=o.expired;if(d&&!s)return[];let y=o.inputSymbol,x=$(o.expiry),m=d?0:Math.max(0,Math.floor((o.expiry-i)/W)),p=d?{reason:"This term has ended, so it has no fixed rate."}:r.source==="api"?j(t,c.lnImpliedRate):{reason:"Pendle's price service isn't answering, so there is no rate to show."};"reason"in p&&r.source==="api"&&!d&&D.push(`${t.market}: ${p.reason}`);let Y=o.kind==="stock"?`, paid in ${y}`:"";return[{market:o.market,kind:o.kind,label:t.label,listedByPendle:r.source==="api",unit:{symbol:y,decimals:o.inputDecimals,token:o.inputToken},endsAt:x,endsAtUnix:o.expiry,daysLeft:m,ended:d,active:t.active&&!d,fixedRate:"ratePct"in p?{pct:p.ratePct,unit:y,text:`${p.ratePct.toFixed(2)}% a year${Y}, fixed only if you hold until ${x}`}:{unavailable:p.reason},...t.liquidityUsd!==void 0?{liquidityUsd:t.liquidityUsd}:{},walletPt:{base:(E.get(t.pt.toLowerCase())??0n).toString(),decimals:o.ptDecimals,formatted:g(e,E.get(t.pt.toLowerCase())??0n,o.ptDecimals)},risk:B,...o.kind==="stock"?{payoutNote:`Paid in ${y}, not dollars.`}:{},...!d&&m<R?{shortTerm:`ends in ${m===0?"less than a day":m===1?"1 day":`${m} days`}, usually too short to be worth the fees`}:{}}]});return P.sort((t,c)=>Number(t.ended)-Number(c.ended)||(t.kind===c.kind?t.endsAtUnix-c.endsAtUnix:t.kind==="stable"?-1:1)),{source:r.source,...r.source==="chain"?{notice:K}:{},markets:P,checks:D}}catch(s){throw new h(e.plainError(s))}}}}function le(e){let n=X(e),s=k({get client(){return e.clientFor(f)},wallet:"0x0000000000000000000000000000000000000000",verify:n,http:e.http}).map((a,i)=>({...a,execute:(r,u)=>k({client:e.clientFor(f),wallet:u,verify:n,http:e.http})[i].execute(r,u)}));return M("pendle",[{tools:[z(e),...s],positions:(a,i)=>F(e,a,i)}])}export{K as API_DOWN_NOTICE,B as PENDLE_RISK,le as createModule,X as createVerify};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Address, PublicClient } from 'viem';
|
|
2
|
+
import type { ModuleContext } from '../../types.js';
|
|
3
|
+
export declare const MARKETS_URL: string;
|
|
4
|
+
export interface MarketRow {
|
|
5
|
+
market: Address;
|
|
6
|
+
sy: Address;
|
|
7
|
+
pt: Address;
|
|
8
|
+
yt: Address;
|
|
9
|
+
expiry: number;
|
|
10
|
+
active: boolean;
|
|
11
|
+
impliedApy?: number;
|
|
12
|
+
liquidityUsd?: number;
|
|
13
|
+
label: string;
|
|
14
|
+
source: 'api' | 'chain';
|
|
15
|
+
}
|
|
16
|
+
export interface ReadOptions {
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}
|
|
19
|
+
export declare function throwIfCancelled(signal: AbortSignal | undefined): void;
|
|
20
|
+
export declare function fetchMarkets(http: typeof fetch, options?: ReadOptions): Promise<{
|
|
21
|
+
rows: MarketRow[];
|
|
22
|
+
dropped: string[];
|
|
23
|
+
}>;
|
|
24
|
+
export declare const FACTORY_FIRST_BLOCK = 52515580n;
|
|
25
|
+
export declare function createdMarkets(client: PublicClient, options?: ReadOptions): Promise<Address[]>;
|
|
26
|
+
export declare function chainRowsFor(client: PublicClient, markets: readonly Address[], now?: number, options?: ReadOptions): Promise<MarketRow[]>;
|
|
27
|
+
export declare function chainRows(client: PublicClient, now?: number, options?: ReadOptions): Promise<MarketRow[]>;
|
|
28
|
+
export declare function chainRow(client: PublicClient, market: Address, now?: number): Promise<MarketRow>;
|
|
29
|
+
export interface MarketList {
|
|
30
|
+
source: 'api' | 'chain';
|
|
31
|
+
rows: MarketRow[];
|
|
32
|
+
dropped: string[];
|
|
33
|
+
}
|
|
34
|
+
export declare function listMarkets(context: ModuleContext, options: {
|
|
35
|
+
allowChain: boolean;
|
|
36
|
+
now?: number;
|
|
37
|
+
} & ReadOptions): Promise<MarketList>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"../../../chunks/Q42YI3EP.js";import"../../../chunks/SK2VBNAU.js";import"../../../chunks/VEQBHI6O.js";import"../../../chunks/OTXSKFUD.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/FWD4L3CJ.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{d as FACTORY_FIRST_BLOCK,a as MARKETS_URL,h as chainRow,g as chainRows,f as chainRowsFor,e as createdMarkets,c as fetchMarkets,i as listMarkets,b as throwIfCancelled};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Address, PublicClient } from 'viem';
|
|
2
|
+
import type { ModuleContext, Position } from '../../types.js';
|
|
3
|
+
import { type MarketRow, type ReadOptions } from './markets.js';
|
|
4
|
+
export declare const endDate: (expiry: number) => string;
|
|
5
|
+
export declare function ptBalances(client: PublicClient, wallet: Address, rows: readonly MarketRow[]): Promise<Map<string, bigint>>;
|
|
6
|
+
export declare function readable(context: Pick<ModuleContext, 'formatAmount'>, amount: bigint, decimals: number): string;
|
|
7
|
+
export declare function maturityNotice(input: {
|
|
8
|
+
kind: 'stable' | 'stock';
|
|
9
|
+
endDate: string;
|
|
10
|
+
ptAmount: string;
|
|
11
|
+
unitAmount?: string;
|
|
12
|
+
unitSymbol: string;
|
|
13
|
+
unitAddress?: string;
|
|
14
|
+
}): string;
|
|
15
|
+
export interface PositionOptions extends ReadOptions {
|
|
16
|
+
now?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function readPositions(context: ModuleContext, wallet: Address, options?: PositionOptions): Promise<Position[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"../../../chunks/52ELWNXJ.js";import"../../../chunks/MRMR4QHA.js";import"../../../chunks/Q42YI3EP.js";import"../../../chunks/SK2VBNAU.js";import"../../../chunks/VEQBHI6O.js";import"../../../chunks/OTXSKFUD.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/FWD4L3CJ.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as endDate,d as maturityNotice,b as ptBalances,e as readPositions,c as readable};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { PublicClient } from 'viem';
|
|
2
|
+
import type { VerifiedMarket } from './types.js';
|
|
3
|
+
export declare const pricingAbi: readonly [{
|
|
4
|
+
readonly name: "readState";
|
|
5
|
+
readonly type: "function";
|
|
6
|
+
readonly stateMutability: "view";
|
|
7
|
+
readonly inputs: readonly [{
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
readonly name: "router";
|
|
10
|
+
}];
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly type: "tuple";
|
|
13
|
+
readonly components: readonly [{
|
|
14
|
+
readonly type: "int256";
|
|
15
|
+
readonly name: "totalPt";
|
|
16
|
+
}, {
|
|
17
|
+
readonly type: "int256";
|
|
18
|
+
readonly name: "totalSy";
|
|
19
|
+
}, {
|
|
20
|
+
readonly type: "int256";
|
|
21
|
+
readonly name: "totalLp";
|
|
22
|
+
}, {
|
|
23
|
+
readonly type: "address";
|
|
24
|
+
readonly name: "treasury";
|
|
25
|
+
}, {
|
|
26
|
+
readonly type: "int256";
|
|
27
|
+
readonly name: "scalarRoot";
|
|
28
|
+
}, {
|
|
29
|
+
readonly type: "uint256";
|
|
30
|
+
readonly name: "expiry";
|
|
31
|
+
}, {
|
|
32
|
+
readonly type: "uint256";
|
|
33
|
+
readonly name: "lnFeeRateRoot";
|
|
34
|
+
}, {
|
|
35
|
+
readonly type: "uint256";
|
|
36
|
+
readonly name: "reserveFeePercent";
|
|
37
|
+
}, {
|
|
38
|
+
readonly type: "uint256";
|
|
39
|
+
readonly name: "lastLnImpliedRate";
|
|
40
|
+
}];
|
|
41
|
+
readonly name: "market";
|
|
42
|
+
}];
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "pyIndexCurrent";
|
|
45
|
+
readonly type: "function";
|
|
46
|
+
readonly stateMutability: "nonpayable";
|
|
47
|
+
readonly inputs: readonly [];
|
|
48
|
+
readonly outputs: readonly [{
|
|
49
|
+
readonly type: "uint256";
|
|
50
|
+
}];
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "exchangeRate";
|
|
53
|
+
readonly type: "function";
|
|
54
|
+
readonly stateMutability: "view";
|
|
55
|
+
readonly inputs: readonly [];
|
|
56
|
+
readonly outputs: readonly [{
|
|
57
|
+
readonly type: "uint256";
|
|
58
|
+
}];
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "previewDeposit";
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
readonly stateMutability: "view";
|
|
63
|
+
readonly inputs: readonly [{
|
|
64
|
+
readonly type: "address";
|
|
65
|
+
readonly name: "tokenIn";
|
|
66
|
+
}, {
|
|
67
|
+
readonly type: "uint256";
|
|
68
|
+
readonly name: "amount";
|
|
69
|
+
}];
|
|
70
|
+
readonly outputs: readonly [{
|
|
71
|
+
readonly type: "uint256";
|
|
72
|
+
}];
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "previewRedeem";
|
|
75
|
+
readonly type: "function";
|
|
76
|
+
readonly stateMutability: "view";
|
|
77
|
+
readonly inputs: readonly [{
|
|
78
|
+
readonly type: "address";
|
|
79
|
+
readonly name: "tokenOut";
|
|
80
|
+
}, {
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
readonly name: "amount";
|
|
83
|
+
}];
|
|
84
|
+
readonly outputs: readonly [{
|
|
85
|
+
readonly type: "uint256";
|
|
86
|
+
}];
|
|
87
|
+
}];
|
|
88
|
+
export declare function chainUint(value: unknown, positive?: boolean): bigint;
|
|
89
|
+
export interface PriceCheck {
|
|
90
|
+
estimateBase: bigint;
|
|
91
|
+
relativeDifference: number;
|
|
92
|
+
tolerance: number;
|
|
93
|
+
blockNumber: bigint;
|
|
94
|
+
}
|
|
95
|
+
export declare function checkPrice(client: PublicClient, market: VerifiedMarket, side: 'buy' | 'sell', amount: bigint, quotedOut: bigint, priceImpact: number): Promise<PriceCheck>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"../../../chunks/QU5XKRGK.js";import"../../../chunks/4HG6FRVH.js";import"../../../chunks/H43RNCX2.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/VEQBHI6O.js";import"../../../chunks/OTXSKFUD.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/FWD4L3CJ.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{b as chainUint,c as checkPrice,a as pricingAbi};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Address, ModuleContext } from '../../types.js';
|
|
2
|
+
import type { EarnReaders, PendleTerm } from '../earn/types.js';
|
|
3
|
+
import { type MarketRow } from './markets.js';
|
|
4
|
+
export interface TermOptions {
|
|
5
|
+
now?: number;
|
|
6
|
+
ethUsdE18?: bigint;
|
|
7
|
+
}
|
|
8
|
+
export declare function crossCheckRate(row: MarketRow, lnImpliedRate: bigint): {
|
|
9
|
+
ratePct: number;
|
|
10
|
+
} | {
|
|
11
|
+
reason: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function readTerms(context: ModuleContext, wallet: Address, options?: TermOptions): Promise<{
|
|
14
|
+
terms: PendleTerm[];
|
|
15
|
+
dropped: string[];
|
|
16
|
+
}>;
|
|
17
|
+
export declare function pendleTerms(context: ModuleContext, wallet: Address, options?: TermOptions): ReturnType<EarnReaders['pendleTerms']>;
|