@oakagentkit/core 0.3.4 → 0.3.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/history.js +1 -1
- package/build/dist/api/modules/borro/index.js +1 -1
- package/build/dist/api/modules/borro/positions.js +1 -1
- package/build/dist/api/modules/borro/reader.js +1 -1
- package/build/dist/api/modules/chop/actions.d.ts +13 -1
- package/build/dist/api/modules/chop/actions.js +1 -1
- package/build/dist/api/modules/chop/checks.js +1 -1
- package/build/dist/api/modules/chop/copy.d.ts +1 -0
- package/build/dist/api/modules/chop/copy.js +1 -1
- package/build/dist/api/modules/chop/display.d.ts +36 -0
- package/build/dist/api/modules/chop/display.js +1 -0
- package/build/dist/api/modules/chop/guard.js +1 -1
- package/build/dist/api/modules/chop/index.js +1 -1
- package/build/dist/api/modules/chop/pins.d.ts +1 -0
- package/build/dist/api/modules/chop/pins.js +1 -1
- package/build/dist/api/modules/chop/positions.js +1 -1
- package/build/dist/api/modules/chop/reader.d.ts +6 -1
- package/build/dist/api/modules/chop/reader.js +1 -1
- package/build/dist/api/modules/chop/types.d.ts +7 -0
- package/build/dist/api/modules/chop/unfarm.d.ts +16 -0
- package/build/dist/api/modules/chop/unfarm.js +1 -0
- package/build/dist/api/modules/clanker/index.js +1 -1
- package/build/dist/api/modules/earn/index.js +1 -1
- package/build/dist/api/modules/erc8004/index.js +1 -1
- package/build/dist/api/modules/factor/actions.js +1 -1
- package/build/dist/api/modules/factor/api.js +1 -1
- package/build/dist/api/modules/factor/checks.js +1 -1
- package/build/dist/api/modules/factor/copy.d.ts +11 -11
- package/build/dist/api/modules/factor/copy.js +1 -1
- package/build/dist/api/modules/factor/guard.js +1 -1
- package/build/dist/api/modules/factor/index.js +1 -1
- package/build/dist/api/modules/factor/reader.js +1 -1
- package/build/dist/api/modules/fobo/client.js +1 -1
- package/build/dist/api/modules/fobo/index.js +1 -1
- package/build/dist/api/modules/gloam/index.js +1 -1
- package/build/dist/api/modules/grove/index.js +1 -1
- package/build/dist/api/modules/heyresearch/builder-feed.js +1 -1
- package/build/dist/api/modules/heyresearch/index.js +1 -1
- package/build/dist/api/modules/heyresearch/public-reads.js +1 -1
- package/build/dist/api/modules/heyresearch/scan.js +1 -1
- package/build/dist/api/modules/heyresearch/token-facts.js +1 -1
- package/build/dist/api/modules/hoodlock/airdrop.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/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-receipt.js +1 -1
- package/build/dist/api/modules/hookr/launch.js +1 -1
- package/build/dist/api/modules/hookr/liquidity.js +1 -1
- package/build/dist/api/modules/hookr/lp-positions.js +1 -1
- package/build/dist/api/modules/hookr/lp-reads.js +1 -1
- package/build/dist/api/modules/hookr/lp-receipt.js +1 -1
- package/build/dist/api/modules/hookr/lp-state.js +1 -1
- package/build/dist/api/modules/hookr/public-reads.js +1 -1
- package/build/dist/api/modules/hookr/relay.js +1 -1
- package/build/dist/api/modules/layerbank/actions.js +1 -1
- package/build/dist/api/modules/layerbank/index.js +1 -1
- package/build/dist/api/modules/layerbank/reader.js +1 -1
- package/build/dist/api/modules/longbow/administration.js +1 -1
- package/build/dist/api/modules/longbow/fixed.js +1 -1
- package/build/dist/api/modules/longbow/index.js +1 -1
- package/build/dist/api/modules/meridian/index.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/morpho/bundles.js +1 -1
- package/build/dist/api/modules/morpho/in-kind.js +1 -1
- package/build/dist/api/modules/morpho/index.js +1 -1
- package/build/dist/api/modules/morpho/local-guard.js +1 -1
- package/build/dist/api/modules/morpho/midnight.js +1 -1
- package/build/dist/api/modules/morpho/protocol.js +1 -1
- package/build/dist/api/modules/morpho/vault-tools.js +1 -1
- package/build/dist/api/modules/netnet/card-plan.js +1 -1
- package/build/dist/api/modules/netnet/card-read.js +1 -1
- package/build/dist/api/modules/netnet/card-recovery.js +1 -1
- package/build/dist/api/modules/netnet/desk-action.js +1 -1
- package/build/dist/api/modules/netnet/financial.js +1 -1
- package/build/dist/api/modules/netnet/index.js +1 -1
- package/build/dist/api/modules/pendle/index.js +1 -1
- package/build/dist/api/modules/pendle/reader.js +1 -1
- package/build/dist/api/modules/pendle/trade.js +1 -1
- package/build/dist/api/modules/pons/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/index.js +1 -1
- package/build/dist/api/modules/priors/integration.js +1 -1
- package/build/dist/api/modules/priors/stock-swap.js +1 -1
- package/build/dist/api/modules/raeto/index.js +1 -1
- package/build/dist/api/modules/relay/index.js +1 -1
- package/build/dist/api/modules/relay/outbound-status.js +1 -1
- package/build/dist/api/modules/spark/index.js +1 -1
- package/build/dist/api/modules/steakhouse/index.js +1 -1
- package/build/dist/api/modules/steakhouse/local-guard.js +1 -1
- package/build/dist/api/modules/steakhouse/management.js +1 -1
- package/build/dist/api/modules/steakhouse/v2-exit.js +1 -1
- package/build/dist/api/modules/tickerspring/basket-routes.js +1 -1
- package/build/dist/api/modules/tickerspring/contract-reads.js +1 -1
- package/build/dist/api/modules/tickerspring/exit-preview.js +1 -1
- package/build/dist/api/modules/tickerspring/guards.js +1 -1
- package/build/dist/api/modules/tickerspring/index.js +1 -1
- package/build/dist/api/modules/tickerspring/journeys.js +1 -1
- package/build/dist/api/modules/tickerspring/ladder.js +1 -1
- package/build/dist/api/modules/tickerspring/maker.js +1 -1
- package/build/dist/api/modules/tickerspring/order-accounting.js +1 -1
- package/build/dist/api/modules/tickerspring/research.js +1 -1
- package/build/dist/api/modules/tickerspring/strategies.js +1 -1
- package/build/dist/api/modules/uniswap/auction-create.js +1 -1
- package/build/dist/api/modules/uniswap/auction.js +1 -1
- package/build/dist/api/modules/uniswap/batch.js +1 -1
- package/build/dist/api/modules/uniswap/common.js +1 -1
- package/build/dist/api/modules/uniswap/fees.js +1 -1
- package/build/dist/api/modules/uniswap/index.js +1 -1
- package/build/dist/api/modules/uniswap/local-guard.js +1 -1
- package/build/dist/api/modules/uniswap/oracle.js +1 -1
- package/build/dist/api/modules/uniswap/pool-math.js +1 -1
- package/build/dist/api/modules/uniswap/pools.js +1 -1
- package/build/dist/api/modules/uniswap/position.js +1 -1
- package/build/dist/api/modules/uniswap/protocol.js +1 -1
- package/build/dist/api/modules/uniswap/quote-guard.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.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/upoch/index.js +1 -1
- package/build/dist/api/modules/upoch/reads.js +1 -1
- package/build/dist/api/modules/wormhole/index.js +1 -1
- package/build/dist/api/prices.d.ts +5 -0
- package/build/dist/api/prices.js +1 -1
- package/build/dist/api/send.js +1 -1
- package/build/dist/api/signing-registry.js +1 -1
- package/build/dist/api/tokens.d.ts +1 -0
- package/build/dist/api/tokens.js +1 -1
- package/build/dist/api/usd-estimate.d.ts +2 -0
- package/build/dist/api/usd-estimate.js +1 -1
- package/build/dist/chunks/{UBVE2U6X.js → 2FOI2625.js} +1 -1
- package/build/dist/chunks/{5OTQCE2E.js → 2I7XHRTI.js} +1 -1
- package/build/dist/chunks/{SGHSCK22.js → 2PS4GCOZ.js} +1 -1
- package/build/dist/chunks/3BQ5XHDJ.js +1 -0
- package/build/dist/chunks/{PRBIC3UK.js → 3YH5B5NQ.js} +1 -1
- package/build/dist/chunks/{RUSXMQSJ.js → 4HQEJHCD.js} +1 -1
- package/build/dist/chunks/{ZFRTBBIW.js → 4IOHSX3Z.js} +1 -1
- package/build/dist/chunks/5H7NVE6O.js +1 -0
- package/build/dist/chunks/{JJGZ7W3V.js → 6AS3TGOX.js} +1 -1
- package/build/dist/chunks/{RK3PPFRX.js → 6CKCZJ3F.js} +1 -1
- package/build/dist/chunks/{HU2JXDLH.js → 6LVHN33V.js} +1 -1
- package/build/dist/chunks/7OOCAZBE.js +1 -0
- package/build/dist/chunks/{O3XWE4FO.js → 7TRO6MBQ.js} +1 -1
- package/build/dist/chunks/{WX7OYCNS.js → A4FLWHLP.js} +1 -1
- package/build/dist/chunks/{FP7DHVK2.js → A4K5GXVO.js} +1 -1
- package/build/dist/chunks/{AOX6DKYU.js → AL6UXNGH.js} +1 -1
- package/build/dist/chunks/{FQTO7VJG.js → C57DITTF.js} +1 -1
- package/build/dist/chunks/{ZTX4WT62.js → CFPJDLTZ.js} +1 -1
- package/build/dist/chunks/{SRHVSNPX.js → CNDIAF3P.js} +1 -1
- package/build/dist/chunks/{LEHBRAZX.js → CW37EGPL.js} +1 -1
- package/build/dist/chunks/{PQG3ULRT.js → DBOGRUPS.js} +1 -1
- package/build/dist/chunks/{T3QEN3S6.js → E47UYYK4.js} +1 -1
- package/build/dist/chunks/EPOIAXCV.js +3 -0
- package/build/dist/chunks/{DWQJ7NSX.js → FCVH4FYH.js} +1 -1
- package/build/dist/chunks/{V6EVQWAL.js → FHB7QYJO.js} +1 -1
- package/build/dist/chunks/FRT6AC6M.js +1 -0
- package/build/dist/chunks/{Z5YI6KLN.js → FRVCSDKU.js} +1 -1
- package/build/dist/chunks/{EIE2U4OX.js → G5AMH4IP.js} +1 -1
- package/build/dist/chunks/{EQEMI54U.js → GDUKZYE2.js} +1 -1
- package/build/dist/chunks/{GNOHIL4Q.js → GKUPC4DO.js} +1 -1
- package/build/dist/chunks/{K7HTDKAT.js → GMMTHTCP.js} +1 -1
- package/build/dist/chunks/{XHFAF5PZ.js → HDBZZOHJ.js} +1 -1
- package/build/dist/chunks/{Q4HSQL65.js → HPS4KOU4.js} +1 -1
- package/build/dist/chunks/IZP3EKKS.js +1 -0
- package/build/dist/chunks/{P6MPKIU2.js → J7OZLXSG.js} +1 -1
- package/build/dist/chunks/{PXUML7HJ.js → JDHPMS7X.js} +1 -1
- package/build/dist/chunks/{MOZBDCVV.js → JJSCDDQO.js} +1 -1
- package/build/dist/chunks/{EFESPGA2.js → KCZUJ57H.js} +1 -1
- package/build/dist/chunks/{2ILYVUFA.js → KKTOBXIT.js} +1 -1
- package/build/dist/chunks/{L6CVMDWQ.js → KO7ANIKY.js} +1 -1
- package/build/dist/chunks/{2T6O77QZ.js → LKUZAJPZ.js} +1 -1
- package/build/dist/chunks/{5GQJVKVY.js → LZM3DO5Q.js} +1 -1
- package/build/dist/chunks/M6JNGU4E.js +1 -0
- package/build/dist/chunks/{MEB727X5.js → M7OVMIIE.js} +1 -1
- package/build/dist/chunks/{RKM62HC5.js → MJGEGNDU.js} +1 -1
- package/build/dist/chunks/{SYERFEJ4.js → MQXSCNUL.js} +1 -1
- package/build/dist/chunks/N624NR7Y.js +1 -0
- package/build/dist/chunks/{X3YEDVRN.js → N65J3L2H.js} +1 -1
- package/build/dist/chunks/{2TX7HP6M.js → N742W5KX.js} +1 -1
- package/build/dist/chunks/{365B4YEV.js → NIWAVMDR.js} +1 -1
- package/build/dist/chunks/O2QBSINK.js +1 -0
- package/build/dist/chunks/{FA3GBXQP.js → O4P5IQCP.js} +1 -1
- package/build/dist/chunks/{HUKDISRE.js → OB3YMTDI.js} +1 -1
- package/build/dist/chunks/{WXZ4LAKO.js → PV7FEVBD.js} +1 -1
- package/build/dist/chunks/{4M6XBG6X.js → Q3Q3YHEX.js} +1 -1
- package/build/dist/chunks/QA6Z2CYP.js +2 -0
- package/build/dist/chunks/{BDLV42SD.js → QBNASL3T.js} +1 -1
- package/build/dist/chunks/{AHUCYDBC.js → QKIQ7ZKD.js} +1 -1
- package/build/dist/chunks/{7FYM7FJA.js → QMIH6HXH.js} +1 -1
- package/build/dist/chunks/{2QP6WGKZ.js → QQD4PV64.js} +1 -1
- package/build/dist/chunks/{KNBNKG7P.js → R66NSNNQ.js} +1 -1
- package/build/dist/chunks/{VQJXQLFW.js → RP5VCG54.js} +1 -1
- package/build/dist/chunks/{OKXKDDBX.js → RUHNLNVX.js} +1 -1
- package/build/dist/chunks/{VKNKVUAA.js → S37D7HOK.js} +1 -1
- package/build/dist/chunks/S47M3IPR.js +1 -0
- package/build/dist/chunks/S65KXMZ7.js +3 -0
- package/build/dist/chunks/{NYHKIXJR.js → SX5YNFHG.js} +1 -1
- package/build/dist/chunks/{MHONMLF6.js → TGXEKBLV.js} +1 -1
- package/build/dist/chunks/{VHK5AYC2.js → TJU644I7.js} +1 -1
- package/build/dist/chunks/{O56EZB5Y.js → TOIKOIY6.js} +1 -1
- package/build/dist/chunks/{YR44GQG4.js → TZ7S5KRB.js} +1 -1
- package/build/dist/chunks/UEOS6SHR.js +1 -0
- package/build/dist/chunks/{USZCTSPI.js → USGMGKAG.js} +1 -1
- package/build/dist/chunks/{W5FM2OVB.js → UUF4Z6K6.js} +1 -1
- package/build/dist/chunks/{PMFR47H3.js → VREGY7E6.js} +1 -1
- package/build/dist/chunks/{2YYKQGJZ.js → W7BFM6CK.js} +1 -1
- package/build/dist/chunks/{3D7FXI6G.js → WQ2XTDHO.js} +1 -1
- package/build/dist/chunks/WRA3ZC6W.js +1 -0
- package/build/dist/chunks/{K3TZYPSV.js → XADHV2DT.js} +1 -1
- package/build/dist/chunks/{LVFI74ST.js → XNJ6NDQQ.js} +1 -1
- package/build/dist/chunks/{DD47RZFU.js → XTXXWRN2.js} +1 -1
- package/build/dist/chunks/{CZ66MYKR.js → XWC6IC5E.js} +1 -1
- package/build/dist/chunks/{DMB64UIN.js → YWVPK3DV.js} +1 -1
- package/build/dist/chunks/{WNWRF4HE.js → YZHJ4BAP.js} +1 -1
- package/build/dist/chunks/{4PB6MSGZ.js → ZKBOPZH5.js} +1 -1
- package/build/dist/chunks/{5ZVIAGLX.js → ZQPC54J5.js} +1 -1
- package/build/dist/chunks/{HDBDBKEA.js → ZVY7GGSP.js} +1 -1
- package/build/dist/chunks/{LQSPWRHN.js → ZX43P4BK.js} +1 -1
- package/build/dist/chunks/{PQOWIRKQ.js → ZXFJKW6H.js} +1 -1
- package/build/dist/chunks/{N6PHSHBE.js → ZXRIJG6H.js} +1 -1
- package/package.json +1 -1
- package/build/dist/chunks/3AOTYJPX.js +0 -1
- package/build/dist/chunks/4E7FJQLL.js +0 -1
- package/build/dist/chunks/4J245N3F.js +0 -1
- package/build/dist/chunks/BA66J5YQ.js +0 -1
- package/build/dist/chunks/BIY2F6MO.js +0 -1
- package/build/dist/chunks/DGCJZ3HO.js +0 -1
- package/build/dist/chunks/DHX3Q5RV.js +0 -2
- package/build/dist/chunks/EFUACKDK.js +0 -1
- package/build/dist/chunks/JW7GLNLB.js +0 -3
- package/build/dist/chunks/MIKQWF6Q.js +0 -3
- package/build/dist/chunks/P7C3TYI4.js +0 -1
- package/build/dist/chunks/ZNX3YVF2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as G}from"../chunks/ZFRTBBIW.js";import"../chunks/O3XWE4FO.js";import"../chunks/OB7BFDOV.js";import"../chunks/ANIF3JMV.js";import"../chunks/E76Z2TT4.js";import"../chunks/GBIBRYOV.js";import"../chunks/SUNTJ6IU.js";import"../chunks/ADIPEGNN.js";import"../chunks/3A2IKFTV.js";import{a as U}from"../chunks/X5V2Z2NM.js";import"../chunks/BA66J5YQ.js";import"../chunks/WSILNJS2.js";import"../chunks/KHOUBQJK.js";import"../chunks/JFC2QCMW.js";import"../chunks/Y2QADJOB.js";import"../chunks/4J245N3F.js";import"../chunks/3PHJUFU2.js";import"../chunks/DCGNVMKG.js";import"../chunks/HZSYMGJ2.js";import"../chunks/LQSPWRHN.js";import"../chunks/GYPMUYB5.js";import"../chunks/CQ5WRWV4.js";import"../chunks/IV4K7FMD.js";import"../chunks/GK3D7OKG.js";import"../chunks/OIQTZOBN.js";import"../chunks/Z7FGEWO2.js";import"../chunks/LIUXNOLP.js";import"../chunks/BSX4LFYI.js";import"../chunks/ELHRXA5U.js";import"../chunks/DGDMRATN.js";import"../chunks/4Z3IGMU6.js";import"../chunks/C76D54YG.js";import"../chunks/TXGZ6NWN.js";import"../chunks/ZTX4WT62.js";import"../chunks/VVAM3EAK.js";import"../chunks/P4UQGWCP.js";import"../chunks/SPJCSEKP.js";import"../chunks/Z25UKUJF.js";import{a as z}from"../chunks/43LI5NKJ.js";import"../chunks/IOYRL6AY.js";import"../chunks/SCG5HWMN.js";import"../chunks/5TUXSOMI.js";import"../chunks/HFVXNKA5.js";import"../chunks/TRCP7X5P.js";import"../chunks/66F5ZH34.js";import"../chunks/NWNYJ26T.js";import"../chunks/IX3GZMTM.js";import"../chunks/5HCXZWUH.js";import{t as F}from"../chunks/MQ5F2VOK.js";import"../chunks/5RXALTDT.js";import{b as T,j as J,t as q}from"../chunks/TI727O2H.js";import{a as A,e as K}from"../chunks/XSD5NL7J.js";import"../chunks/JXOEJPJ4.js";import"../chunks/63YRSLDK.js";import{decodeEventLog as ee,erc20Abi as te,getAddress as w,isAddress as v,pad as ne,parseAbi as Y}from"viem";var re=50,ge=10000n;function be(e){let t=Object.values(q).find(i=>i.chainId===e);if(!t)throw new A("History modules are not configured for this chain.");let n=[{module:"erc8004",contracts:[t.identityRegistry],abi:U}];if(e!==T)return n;let s=J[T],g=Y(["event Deposit(address indexed sender,address indexed owner,uint256 assets,uint256 shares)","event Withdraw(address indexed sender,address indexed receiver,address indexed owner,uint256 assets,uint256 shares)"]);for(let[i,y]of Object.entries(s.vaults)){if(i==="morphoV2Factory"||i==="beefyTestedLpVault")continue;let b=i.startsWith("longbow")?"longbow":i==="groveAlm"?"grove":i;n.push({module:b,contracts:[y.address],abi:g})}return n.push({module:"hookr",contracts:[s.hookr.HookrLimitOrders.address],abi:G},{module:"orbio",contracts:[s.orbio.credit.address],abi:Y(["event Activated(uint256 indexed activationId,address indexed by,bytes32 indexed ref,uint256 amount)"])}),n}var Q=new WeakMap;function W(e){if(e==null)return null;if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(typeof e=="bigint")return e.toString();if(Array.isArray(e))return e.map(W);if(typeof e=="object"){let t={};for(let[n,s]of Object.entries(e))t[n]=W(s);return t}return String(e)}function L(e,t="0"){return e===void 0?t:typeof e=="bigint"?e.toString():typeof e=="number"?BigInt(Math.trunc(e)).toString():BigInt(e).toString()}function S(e,t){return typeof e=="string"?v(e,{strict:!1})&&e.toLowerCase()===t:Array.isArray(e)?e.some(n=>S(n,t)):e!==null&&typeof e=="object"?Object.values(e).some(n=>S(n,t)):!1}function M(e){return typeof e=="string"?v(e,{strict:!1}):Array.isArray(e)?e.some(t=>M(t)):e!==null&&typeof e=="object"?Object.values(e).some(t=>M(t)):!1}function X(e,t){if(e.length<=1)return!1;let n=ne(t).toLowerCase(),s=t.slice(2).toLowerCase();return e.slice(1).some(g=>{let i=g.toLowerCase();return i===n||i.length===66&&i.startsWith("0x000000000000000000000000")&&i.endsWith(s)})}function oe(e,t){if(!e||e==="0x")return!1;let n=e.slice(2).toLowerCase(),s=`000000000000000000000000${t.slice(2).toLowerCase()}`;for(let g=0;g+64<=n.length;g+=64)if(n.slice(g,g+64)===s)return!0;return!1}function $(e,t){return e.module||e.name||`module_${t}`}function Z(e,t,n,s,g,i){let y=$(t,n),b=s.toLowerCase();if(t.contracts&&t.contracts.length>0){let m=e.address.toLowerCase();if(!t.contracts.some(k=>k.toLowerCase()===m))return null}if(t.decodeLog){let m=t.decodeLog(e,{wallet:s,chainId:g,timestamp:i});if(!m||t.filterWallet&&!t.filterWallet(m.args,s))return null;if(M(m.args)){if(!S(m.args,b))return null}else if(!X(e.topics,s)&&!oe(e.data,s)&&!m.description.toLowerCase().includes(b))return null;return{...m,timestamp:m.timestamp&&m.timestamp!=="0"?m.timestamp:i,module:m.module||y}}if(!t.abi||!e.topics.length)return null;try{let m=ee({abi:t.abi,data:e.data,topics:e.topics}),h=m.args??{},k={};for(let[R,H]of Object.entries(h))/^\d+$/.test(R)||(k[R]=typeof H=="string"&&v(H,{strict:!1})?w(H):W(H));if(!(t.filterWallet?t.filterWallet(k,s):S(h,b)||X(e.topics,s)))return null;let x=m.eventName??"Event";return{transactionHash:e.transactionHash,blockNumber:L(e.blockNumber),logIndex:e.logIndex,timestamp:i,chainId:g,contract:w(e.address),module:y,event:x,args:k,description:`${y} ${x} on ${w(e.address)}.`}}catch{return null}}function se(e,t,n,s){if(e.topics.length!==3)return null;try{let g=ee({abi:te,data:e.data,topics:e.topics});if(g.eventName!=="Transfer")return null;let i=g.args,y=w(i.from),b=w(i.to),m=t.toLowerCase();if(y.toLowerCase()!==m&&b.toLowerCase()!==m)return null;let h=i.value.toString(),k=w(e.address);return{transactionHash:e.transactionHash,blockNumber:L(e.blockNumber),logIndex:e.logIndex,timestamp:s,chainId:n,contract:k,module:"token",event:"Transfer",args:{from:y,to:b,value:h},description:`Transferred ${h} token base units from ${y} to ${b}.`}}catch{return null}}function ie(e,t){let n=BigInt(e.blockNumber),s=BigInt(t.blockNumber);return n<s?-1:n>s?1:e.logIndex-t.logIndex}function O(e,t,n,s){let g=K(t);return{transactionHash:"0x"+"0".repeat(64),blockNumber:"0",logIndex:0,timestamp:"0",chainId:n,contract:s?w(s):"0x"+"0".repeat(40),module:e,event:"error",args:{error:g},description:`${e}: ${g}`}}async function pe(e,t=re,n={}){if(z(e),!Number.isInteger(t)||t<=0)throw new A("History limit must be a positive integer.");let s=w(e),g=s.toLowerCase(),i=n.chainId??T,y=n.readers??[],b=y.filter(r=>typeof r=="object"&&r!==null),m=y.filter(r=>typeof r=="function"),h=n.client,k=()=>(h||(h=F(n.rpcUrl,i)),h),N=n.logs??[];if(!n.logs){let r=[...new Set([...b.flatMap(o=>o.contracts??[]).map(o=>o.toLowerCase())])].map(o=>w(o));if(r.length>0||b.some(o=>!!(o.contracts?.length||o.abi||o.decodeLog))||y.length===0||n.client!==void 0||n.rpcUrl!==void 0||n.fromBlock!==void 0||n.toBlock!==void 0){let o=k();if(typeof o.getLogs=="function"){let l=[r],f=[];if(n.fromBlock!==void 0&&n.toBlock!==void 0){if(n.fromBlock<0n||n.fromBlock>n.toBlock)throw new A("History block range is invalid.");for(let c=n.fromBlock;c<=n.toBlock;c+=10000n){let d=c+9999n;f.push({fromBlock:c,toBlock:d<n.toBlock?d:n.toBlock})}}else f.push({fromBlock:n.fromBlock,toBlock:n.toBlock});let p=[];for(let c of f)for(let d of l)p.push(...await o.getLogs({...d.length?{address:d}:{},...c}));N=p.map(c=>{let d=c;return{address:d.address,topics:d.topics??[],data:d.data,blockNumber:d.blockNumber??0n,logIndex:Number(d.logIndex??0),transactionHash:d.transactionHash??"0x"+"0".repeat(64),...d.timestamp!==void 0?{timestamp:d.timestamp}:d.blockTimestamp!==void 0?{timestamp:BigInt(d.blockTimestamp)}:{}}})}}}let x=new Map;if(n.blockTimestamps)for(let[r,a]of Object.entries(n.blockTimestamps)){let u=L(r),o=L(a,"0");BigInt(o)>0n&&x.set(u,o)}let R=new Map,H=async r=>{if(r.timestamp!==void 0){let c=L(r.timestamp,"0");if(BigInt(c)>0n)return c}let a=L(r.blockNumber),u=x.get(a);if(u&&BigInt(u)>0n)return u;let o=k(),l=Q.get(o);l||(l=new Map,Q.set(o,l));let f=l.get(a);if(f&&BigInt(f)>0n)return x.set(a,f),f;let p=R.get(a);return p||(p=(async()=>{let c=BigInt(a),d;if(typeof o.getBlock=="function")try{d=(await o.getBlock({blockNumber:c}))?.timestamp}catch(C){if(typeof o.request=="function"){let V=await o.request({method:"eth_getBlockByNumber",params:[`0x${c.toString(16)}`,!1]});if(V?.timestamp!==void 0)d=BigInt(V.timestamp);else throw C}else throw C}else if(typeof o.request=="function"){let C=await o.request({method:"eth_getBlockByNumber",params:[`0x${c.toString(16)}`,!1]});C?.timestamp!==void 0&&(d=BigInt(C.timestamp))}let D=L(d,"0");if(BigInt(D)<=0n)throw new A(`Could not resolve a positive timestamp for block ${a}.`);return x.set(a,D),l.set(a,D),D})(),R.set(a,p)),p},I=[],B=[],_=new Set;for(let r of N){let a=r.address.toLowerCase(),u=!1;for(let l=0;l<b.length;l++){if(_.has(l))continue;let f=b[l];if(!(f.contracts&&f.contracts.length>0&&!f.contracts.some(c=>c.toLowerCase()===a)))try{if(f.decodeLog){let p=await H(r),c=Z(r,f,l,s,i,p);if(c){I.push(c),u=!0;break}}else{let p=Z(r,f,l,s,i,"1");if(p){let c=await H(r);I.push({...p,timestamp:c}),u=!0;break}}}catch(p){_.add(l),B.push(O($(f,l),p,i,f.contracts?.[0]))}}if(u)continue;let o=se(r,s,i,"1");if(o){let l=await H(r);I.push({...o,timestamp:l})}}let j=[...m.map((r,a)=>({name:r.name||`reader_${a}`,run:()=>r(s,t)})),...b.flatMap((r,a)=>{let u=r.readHistory??r.history;if(typeof u!="function")return[];let o=$(r,a);return[{name:o,contract:r.contracts?.[0],run:async()=>{let l=await u.call(r,s,t);if(!Array.isArray(l))throw new A(`Module ${o} did not return a history list.`);return l.map(f=>({...f,module:f.module||o}))}}]})],P=await Promise.allSettled(j.map(r=>r.run()));for(let r=0;r<P.length;r++){let a=P[r],u=j[r];if(a.status==="fulfilled"){if(!Array.isArray(a.value)){B.push(O(u.name,new A(`Module ${u.name} did not return a history list.`),i,u.contract));continue}for(let o of a.value)M(o.args)&&!S(o.args,g)||I.push({...o,module:o.module||u.name})}else B.push(O(u.name,a.reason,i,u.contract))}if(I.sort(ie),B.length===0)return I.slice(-t);let E=Math.max(0,t-B.length);return[...E?I.slice(-E):[],...B].slice(0,t)}export{re as DEFAULT_HISTORY_LIMIT,ge as HISTORY_LOOKBACK_BLOCKS,pe as getHistory,be as moduleHistoryReaders};
|
|
1
|
+
import{z as G}from"../chunks/4IOHSX3Z.js";import"../chunks/7TRO6MBQ.js";import"../chunks/SUNTJ6IU.js";import"../chunks/ADIPEGNN.js";import"../chunks/OB7BFDOV.js";import"../chunks/ANIF3JMV.js";import"../chunks/E76Z2TT4.js";import"../chunks/GBIBRYOV.js";import"../chunks/3A2IKFTV.js";import{a as U}from"../chunks/X5V2Z2NM.js";import"../chunks/7OOCAZBE.js";import"../chunks/WSILNJS2.js";import"../chunks/KHOUBQJK.js";import"../chunks/JFC2QCMW.js";import"../chunks/Y2QADJOB.js";import"../chunks/N624NR7Y.js";import"../chunks/DCGNVMKG.js";import"../chunks/3PHJUFU2.js";import"../chunks/HZSYMGJ2.js";import"../chunks/ZX43P4BK.js";import"../chunks/GYPMUYB5.js";import"../chunks/CQ5WRWV4.js";import"../chunks/IV4K7FMD.js";import"../chunks/GK3D7OKG.js";import"../chunks/OIQTZOBN.js";import"../chunks/Z7FGEWO2.js";import"../chunks/LIUXNOLP.js";import"../chunks/BSX4LFYI.js";import"../chunks/C76D54YG.js";import"../chunks/ELHRXA5U.js";import"../chunks/DGDMRATN.js";import"../chunks/4Z3IGMU6.js";import"../chunks/TXGZ6NWN.js";import"../chunks/S65KXMZ7.js";import"../chunks/CW37EGPL.js";import"../chunks/K6D6SDIG.js";import"../chunks/QA6Z2CYP.js";import"../chunks/CFPJDLTZ.js";import"../chunks/VVAM3EAK.js";import"../chunks/P4UQGWCP.js";import"../chunks/SPJCSEKP.js";import"../chunks/Z25UKUJF.js";import{a as z}from"../chunks/43LI5NKJ.js";import"../chunks/IOYRL6AY.js";import"../chunks/SCG5HWMN.js";import"../chunks/5TUXSOMI.js";import"../chunks/HFVXNKA5.js";import"../chunks/TRCP7X5P.js";import"../chunks/66F5ZH34.js";import"../chunks/NWNYJ26T.js";import"../chunks/IX3GZMTM.js";import"../chunks/5HCXZWUH.js";import{t as F}from"../chunks/MQ5F2VOK.js";import"../chunks/5RXALTDT.js";import{b as T,j as J,t as q}from"../chunks/TI727O2H.js";import{a as A,e as K}from"../chunks/XSD5NL7J.js";import"../chunks/JXOEJPJ4.js";import"../chunks/63YRSLDK.js";import{decodeEventLog as ee,erc20Abi as te,getAddress as w,isAddress as v,pad as ne,parseAbi as Y}from"viem";var re=50,ge=10000n;function be(e){let t=Object.values(q).find(i=>i.chainId===e);if(!t)throw new A("History modules are not configured for this chain.");let n=[{module:"erc8004",contracts:[t.identityRegistry],abi:U}];if(e!==T)return n;let s=J[T],g=Y(["event Deposit(address indexed sender,address indexed owner,uint256 assets,uint256 shares)","event Withdraw(address indexed sender,address indexed receiver,address indexed owner,uint256 assets,uint256 shares)"]);for(let[i,y]of Object.entries(s.vaults)){if(i==="morphoV2Factory"||i==="beefyTestedLpVault")continue;let b=i.startsWith("longbow")?"longbow":i==="groveAlm"?"grove":i;n.push({module:b,contracts:[y.address],abi:g})}return n.push({module:"hookr",contracts:[s.hookr.HookrLimitOrders.address],abi:G},{module:"orbio",contracts:[s.orbio.credit.address],abi:Y(["event Activated(uint256 indexed activationId,address indexed by,bytes32 indexed ref,uint256 amount)"])}),n}var Q=new WeakMap;function W(e){if(e==null)return null;if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(typeof e=="bigint")return e.toString();if(Array.isArray(e))return e.map(W);if(typeof e=="object"){let t={};for(let[n,s]of Object.entries(e))t[n]=W(s);return t}return String(e)}function L(e,t="0"){return e===void 0?t:typeof e=="bigint"?e.toString():typeof e=="number"?BigInt(Math.trunc(e)).toString():BigInt(e).toString()}function S(e,t){return typeof e=="string"?v(e,{strict:!1})&&e.toLowerCase()===t:Array.isArray(e)?e.some(n=>S(n,t)):e!==null&&typeof e=="object"?Object.values(e).some(n=>S(n,t)):!1}function M(e){return typeof e=="string"?v(e,{strict:!1}):Array.isArray(e)?e.some(t=>M(t)):e!==null&&typeof e=="object"?Object.values(e).some(t=>M(t)):!1}function X(e,t){if(e.length<=1)return!1;let n=ne(t).toLowerCase(),s=t.slice(2).toLowerCase();return e.slice(1).some(g=>{let i=g.toLowerCase();return i===n||i.length===66&&i.startsWith("0x000000000000000000000000")&&i.endsWith(s)})}function oe(e,t){if(!e||e==="0x")return!1;let n=e.slice(2).toLowerCase(),s=`000000000000000000000000${t.slice(2).toLowerCase()}`;for(let g=0;g+64<=n.length;g+=64)if(n.slice(g,g+64)===s)return!0;return!1}function $(e,t){return e.module||e.name||`module_${t}`}function Z(e,t,n,s,g,i){let y=$(t,n),b=s.toLowerCase();if(t.contracts&&t.contracts.length>0){let m=e.address.toLowerCase();if(!t.contracts.some(k=>k.toLowerCase()===m))return null}if(t.decodeLog){let m=t.decodeLog(e,{wallet:s,chainId:g,timestamp:i});if(!m||t.filterWallet&&!t.filterWallet(m.args,s))return null;if(M(m.args)){if(!S(m.args,b))return null}else if(!X(e.topics,s)&&!oe(e.data,s)&&!m.description.toLowerCase().includes(b))return null;return{...m,timestamp:m.timestamp&&m.timestamp!=="0"?m.timestamp:i,module:m.module||y}}if(!t.abi||!e.topics.length)return null;try{let m=ee({abi:t.abi,data:e.data,topics:e.topics}),h=m.args??{},k={};for(let[R,H]of Object.entries(h))/^\d+$/.test(R)||(k[R]=typeof H=="string"&&v(H,{strict:!1})?w(H):W(H));if(!(t.filterWallet?t.filterWallet(k,s):S(h,b)||X(e.topics,s)))return null;let x=m.eventName??"Event";return{transactionHash:e.transactionHash,blockNumber:L(e.blockNumber),logIndex:e.logIndex,timestamp:i,chainId:g,contract:w(e.address),module:y,event:x,args:k,description:`${y} ${x} on ${w(e.address)}.`}}catch{return null}}function se(e,t,n,s){if(e.topics.length!==3)return null;try{let g=ee({abi:te,data:e.data,topics:e.topics});if(g.eventName!=="Transfer")return null;let i=g.args,y=w(i.from),b=w(i.to),m=t.toLowerCase();if(y.toLowerCase()!==m&&b.toLowerCase()!==m)return null;let h=i.value.toString(),k=w(e.address);return{transactionHash:e.transactionHash,blockNumber:L(e.blockNumber),logIndex:e.logIndex,timestamp:s,chainId:n,contract:k,module:"token",event:"Transfer",args:{from:y,to:b,value:h},description:`Transferred ${h} token base units from ${y} to ${b}.`}}catch{return null}}function ie(e,t){let n=BigInt(e.blockNumber),s=BigInt(t.blockNumber);return n<s?-1:n>s?1:e.logIndex-t.logIndex}function O(e,t,n,s){let g=K(t);return{transactionHash:"0x"+"0".repeat(64),blockNumber:"0",logIndex:0,timestamp:"0",chainId:n,contract:s?w(s):"0x"+"0".repeat(40),module:e,event:"error",args:{error:g},description:`${e}: ${g}`}}async function pe(e,t=re,n={}){if(z(e),!Number.isInteger(t)||t<=0)throw new A("History limit must be a positive integer.");let s=w(e),g=s.toLowerCase(),i=n.chainId??T,y=n.readers??[],b=y.filter(r=>typeof r=="object"&&r!==null),m=y.filter(r=>typeof r=="function"),h=n.client,k=()=>(h||(h=F(n.rpcUrl,i)),h),N=n.logs??[];if(!n.logs){let r=[...new Set([...b.flatMap(o=>o.contracts??[]).map(o=>o.toLowerCase())])].map(o=>w(o));if(r.length>0||b.some(o=>!!(o.contracts?.length||o.abi||o.decodeLog))||y.length===0||n.client!==void 0||n.rpcUrl!==void 0||n.fromBlock!==void 0||n.toBlock!==void 0){let o=k();if(typeof o.getLogs=="function"){let l=[r],f=[];if(n.fromBlock!==void 0&&n.toBlock!==void 0){if(n.fromBlock<0n||n.fromBlock>n.toBlock)throw new A("History block range is invalid.");for(let c=n.fromBlock;c<=n.toBlock;c+=10000n){let d=c+9999n;f.push({fromBlock:c,toBlock:d<n.toBlock?d:n.toBlock})}}else f.push({fromBlock:n.fromBlock,toBlock:n.toBlock});let p=[];for(let c of f)for(let d of l)p.push(...await o.getLogs({...d.length?{address:d}:{},...c}));N=p.map(c=>{let d=c;return{address:d.address,topics:d.topics??[],data:d.data,blockNumber:d.blockNumber??0n,logIndex:Number(d.logIndex??0),transactionHash:d.transactionHash??"0x"+"0".repeat(64),...d.timestamp!==void 0?{timestamp:d.timestamp}:d.blockTimestamp!==void 0?{timestamp:BigInt(d.blockTimestamp)}:{}}})}}}let x=new Map;if(n.blockTimestamps)for(let[r,a]of Object.entries(n.blockTimestamps)){let u=L(r),o=L(a,"0");BigInt(o)>0n&&x.set(u,o)}let R=new Map,H=async r=>{if(r.timestamp!==void 0){let c=L(r.timestamp,"0");if(BigInt(c)>0n)return c}let a=L(r.blockNumber),u=x.get(a);if(u&&BigInt(u)>0n)return u;let o=k(),l=Q.get(o);l||(l=new Map,Q.set(o,l));let f=l.get(a);if(f&&BigInt(f)>0n)return x.set(a,f),f;let p=R.get(a);return p||(p=(async()=>{let c=BigInt(a),d;if(typeof o.getBlock=="function")try{d=(await o.getBlock({blockNumber:c}))?.timestamp}catch(C){if(typeof o.request=="function"){let V=await o.request({method:"eth_getBlockByNumber",params:[`0x${c.toString(16)}`,!1]});if(V?.timestamp!==void 0)d=BigInt(V.timestamp);else throw C}else throw C}else if(typeof o.request=="function"){let C=await o.request({method:"eth_getBlockByNumber",params:[`0x${c.toString(16)}`,!1]});C?.timestamp!==void 0&&(d=BigInt(C.timestamp))}let D=L(d,"0");if(BigInt(D)<=0n)throw new A(`Could not resolve a positive timestamp for block ${a}.`);return x.set(a,D),l.set(a,D),D})(),R.set(a,p)),p},I=[],B=[],_=new Set;for(let r of N){let a=r.address.toLowerCase(),u=!1;for(let l=0;l<b.length;l++){if(_.has(l))continue;let f=b[l];if(!(f.contracts&&f.contracts.length>0&&!f.contracts.some(c=>c.toLowerCase()===a)))try{if(f.decodeLog){let p=await H(r),c=Z(r,f,l,s,i,p);if(c){I.push(c),u=!0;break}}else{let p=Z(r,f,l,s,i,"1");if(p){let c=await H(r);I.push({...p,timestamp:c}),u=!0;break}}}catch(p){_.add(l),B.push(O($(f,l),p,i,f.contracts?.[0]))}}if(u)continue;let o=se(r,s,i,"1");if(o){let l=await H(r);I.push({...o,timestamp:l})}}let j=[...m.map((r,a)=>({name:r.name||`reader_${a}`,run:()=>r(s,t)})),...b.flatMap((r,a)=>{let u=r.readHistory??r.history;if(typeof u!="function")return[];let o=$(r,a);return[{name:o,contract:r.contracts?.[0],run:async()=>{let l=await u.call(r,s,t);if(!Array.isArray(l))throw new A(`Module ${o} did not return a history list.`);return l.map(f=>({...f,module:f.module||o}))}}]})],P=await Promise.allSettled(j.map(r=>r.run()));for(let r=0;r<P.length;r++){let a=P[r],u=j[r];if(a.status==="fulfilled"){if(!Array.isArray(a.value)){B.push(O(u.name,new A(`Module ${u.name} did not return a history list.`),i,u.contract));continue}for(let o of a.value)M(o.args)&&!S(o.args,g)||I.push({...o,module:o.module||u.name})}else B.push(O(u.name,a.reason,i,u.contract))}if(I.sort(ie),B.length===0)return I.slice(-t);let E=Math.max(0,t-B.length);return[...E?I.slice(-E):[],...B].slice(0,t)}export{re as DEFAULT_HISTORY_LIMIT,ge as HISTORY_LOOKBACK_BLOCKS,pe as getHistory,be as moduleHistoryReaders};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../../../chunks/
|
|
1
|
+
import{a,b,c}from"../../../chunks/RUHNLNVX.js";import"../../../chunks/C57DITTF.js";import"../../../chunks/2GXHYI23.js";import"../../../chunks/FHB7QYJO.js";import"../../../chunks/MSRCJ2BS.js";import"../../../chunks/S4JUFCT4.js";import"../../../chunks/WAKZWSHB.js";import"../../../chunks/V74F6IDY.js";import"../../../chunks/FUP53K6G.js";import"../../../chunks/GBPB7JIB.js";import"../../../chunks/4CEV4FDG.js";import"../../../chunks/G2AA73ZE.js";import"../../../chunks/HHYE42JG.js";import"../../../chunks/V5YSJKRH.js";import"../../../chunks/IBL6TL2Q.js";import"../../../chunks/7OOCAZBE.js";import"../../../chunks/WSILNJS2.js";import"../../../chunks/KHOUBQJK.js";import"../../../chunks/JFC2QCMW.js";import"../../../chunks/Y2QADJOB.js";import"../../../chunks/N624NR7Y.js";import"../../../chunks/DCGNVMKG.js";import"../../../chunks/3PHJUFU2.js";import"../../../chunks/HZSYMGJ2.js";import"../../../chunks/ZX43P4BK.js";import"../../../chunks/GYPMUYB5.js";import"../../../chunks/CQ5WRWV4.js";import"../../../chunks/IV4K7FMD.js";import"../../../chunks/GK3D7OKG.js";import"../../../chunks/OIQTZOBN.js";import"../../../chunks/Z7FGEWO2.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/BSX4LFYI.js";import"../../../chunks/C76D54YG.js";import"../../../chunks/ELHRXA5U.js";import"../../../chunks/DGDMRATN.js";import"../../../chunks/4Z3IGMU6.js";import"../../../chunks/TXGZ6NWN.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/VVAM3EAK.js";import"../../../chunks/P4UQGWCP.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/MQ5F2VOK.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as createBorroDiscovery,c as createModule,b as createModulePart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../../chunks/
|
|
1
|
+
import{a,b}from"../../../chunks/C57DITTF.js";import"../../../chunks/2GXHYI23.js";import"../../../chunks/FHB7QYJO.js";import"../../../chunks/MSRCJ2BS.js";import"../../../chunks/S4JUFCT4.js";import"../../../chunks/WAKZWSHB.js";import"../../../chunks/V74F6IDY.js";import"../../../chunks/GBPB7JIB.js";import"../../../chunks/4CEV4FDG.js";import"../../../chunks/G2AA73ZE.js";import"../../../chunks/HHYE42JG.js";import"../../../chunks/V5YSJKRH.js";import"../../../chunks/IBL6TL2Q.js";import"../../../chunks/7OOCAZBE.js";import"../../../chunks/WSILNJS2.js";import"../../../chunks/KHOUBQJK.js";import"../../../chunks/JFC2QCMW.js";import"../../../chunks/Y2QADJOB.js";import"../../../chunks/N624NR7Y.js";import"../../../chunks/DCGNVMKG.js";import"../../../chunks/3PHJUFU2.js";import"../../../chunks/HZSYMGJ2.js";import"../../../chunks/ZX43P4BK.js";import"../../../chunks/GYPMUYB5.js";import"../../../chunks/CQ5WRWV4.js";import"../../../chunks/IV4K7FMD.js";import"../../../chunks/GK3D7OKG.js";import"../../../chunks/OIQTZOBN.js";import"../../../chunks/Z7FGEWO2.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/BSX4LFYI.js";import"../../../chunks/C76D54YG.js";import"../../../chunks/ELHRXA5U.js";import"../../../chunks/DGDMRATN.js";import"../../../chunks/4Z3IGMU6.js";import"../../../chunks/TXGZ6NWN.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/VVAM3EAK.js";import"../../../chunks/P4UQGWCP.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/MQ5F2VOK.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{b as readPositions,a as shareBalances};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d,e,f}from"../../../chunks/FHB7QYJO.js";import"../../../chunks/MSRCJ2BS.js";import"../../../chunks/S4JUFCT4.js";import"../../../chunks/WAKZWSHB.js";import"../../../chunks/V74F6IDY.js";import"../../../chunks/GBPB7JIB.js";import"../../../chunks/4CEV4FDG.js";import"../../../chunks/G2AA73ZE.js";import"../../../chunks/HHYE42JG.js";import"../../../chunks/V5YSJKRH.js";import"../../../chunks/IBL6TL2Q.js";import"../../../chunks/7OOCAZBE.js";import"../../../chunks/WSILNJS2.js";import"../../../chunks/KHOUBQJK.js";import"../../../chunks/JFC2QCMW.js";import"../../../chunks/Y2QADJOB.js";import"../../../chunks/N624NR7Y.js";import"../../../chunks/DCGNVMKG.js";import"../../../chunks/3PHJUFU2.js";import"../../../chunks/HZSYMGJ2.js";import"../../../chunks/ZX43P4BK.js";import"../../../chunks/GYPMUYB5.js";import"../../../chunks/CQ5WRWV4.js";import"../../../chunks/IV4K7FMD.js";import"../../../chunks/GK3D7OKG.js";import"../../../chunks/OIQTZOBN.js";import"../../../chunks/Z7FGEWO2.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/BSX4LFYI.js";import"../../../chunks/C76D54YG.js";import"../../../chunks/ELHRXA5U.js";import"../../../chunks/DGDMRATN.js";import"../../../chunks/4Z3IGMU6.js";import"../../../chunks/TXGZ6NWN.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/VVAM3EAK.js";import"../../../chunks/P4UQGWCP.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/MQ5F2VOK.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as candidates,c as createDiscovery,f as listVaults,e as readVault,b as sortVaults,d as tokenAmount};
|
|
@@ -8,7 +8,7 @@ export declare const actionFields: {
|
|
|
8
8
|
readonly chop_harvest: readonly ["log"];
|
|
9
9
|
};
|
|
10
10
|
export type ActionName = keyof typeof actionFields;
|
|
11
|
-
export declare function assertArgs(args: ToolArgs, fields: readonly string[]): void;
|
|
11
|
+
export declare function assertArgs(args: ToolArgs, fields: readonly string[], optional?: readonly string[]): void;
|
|
12
12
|
export declare function prepareAction(context: ModuleContext, name: ActionName, args: ToolArgs, wallet: Address): Promise<{
|
|
13
13
|
built: UnsignedTx[];
|
|
14
14
|
expected: UnsignedTx[];
|
|
@@ -20,5 +20,17 @@ export declare function prepareAction(context: ModuleContext, name: ActionName,
|
|
|
20
20
|
details: string;
|
|
21
21
|
facts: VerifiedLog;
|
|
22
22
|
log: `0x${string}`;
|
|
23
|
+
unfarmQuote: {
|
|
24
|
+
measuredAtBlock: string;
|
|
25
|
+
slippageBps: number;
|
|
26
|
+
expectedLogOut: string;
|
|
27
|
+
expectedPairedOut: string;
|
|
28
|
+
minLogOut: string;
|
|
29
|
+
minPairedOut: string;
|
|
30
|
+
suggested: {
|
|
31
|
+
minLogOut: boolean;
|
|
32
|
+
minPairedOut: boolean;
|
|
33
|
+
};
|
|
34
|
+
} | undefined;
|
|
23
35
|
}>;
|
|
24
36
|
export declare function buildAction(context: ModuleContext, name: ActionName, args: ToolArgs, wallet: Address): Promise<ChopActionResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d}from"../../../chunks/EPOIAXCV.js";import"../../../chunks/S47M3IPR.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as actionFields,b as assertArgs,d as buildAction,c as prepareAction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as address,c as amount,j as anchoredCode,k as assertRegistryEntry,m as assertTransactions,g as batch,e as checkSignal,i as createAnchorMemo,d as hash,h as mainnetBlock,f as read,n as receipt,b as uint,l as verifyLog};
|
|
@@ -6,6 +6,7 @@ export declare const farmingRisk = "Farming pairs tokens 50/50 with impermanent
|
|
|
6
6
|
export declare const sharedRiskLines: readonly string[];
|
|
7
7
|
export declare const holderRisk = "Wrapping $OAK moves it out of your wallet. Chop's log contract holds the underlying token; unwrap the log to receive its share, subject to Chop's fees and contract risks.";
|
|
8
8
|
export declare const harvestPayoutRisk = "Oak checks that CHOP actually reached your wallet; a successful transaction alone does not prove a payout.";
|
|
9
|
+
export declare const chopSwapUnavailable: string;
|
|
9
10
|
export declare const roundTripPct: (fees: Pick<VerifiedLog["fees"], "bond" | "debond">) => number;
|
|
10
11
|
export declare function feeLine(facts: VerifiedLog): string;
|
|
11
12
|
export declare function riskLines(facts: VerifiedLog): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/63YRSLDK.js";export{h as chopSwapUnavailable,d as farmingRisk,j as feeLine,g as harvestPayoutRisk,f as holderRisk,m as measurableSummary,n as nothingToUnwrap,l as plainSummary,a as providerBoundary,k as riskLines,i as roundTripPct,e as sharedRiskLines,o as unwrapAboveHolding,c as unwrapRisk,b as upgradeKeyRisk};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Address, ModuleContext } from '../../types.js';
|
|
2
|
+
import { type ChopReadCache } from './reader.js';
|
|
3
|
+
export declare function readPositionDisplay(context: ModuleContext, candidate: Address, wallet: Address, cache?: ChopReadCache): Promise<{
|
|
4
|
+
net: import("../../types.js").TokenAmount & import("../../usd-estimate.js").UsdEstimateFields;
|
|
5
|
+
chopSwapNotice: string;
|
|
6
|
+
stakedBacking: {
|
|
7
|
+
assets: (import("../../types.js").TokenAmount & import("../../usd-estimate.js").UsdEstimateFields)[];
|
|
8
|
+
logTokens?: import("../../types.js").TokenAmount;
|
|
9
|
+
estimateLabel: "estimate, not a quote" | "price unavailable";
|
|
10
|
+
estimateReason?: string;
|
|
11
|
+
measuredAtBlock: string;
|
|
12
|
+
};
|
|
13
|
+
stakedLp: {
|
|
14
|
+
estimateSource: string;
|
|
15
|
+
usdEstimate: string | null;
|
|
16
|
+
estimateLabel: "estimate, not a quote" | "price unavailable";
|
|
17
|
+
token: import("../../types.js").Token;
|
|
18
|
+
amount: import("../../types.js").DecimalString;
|
|
19
|
+
} | {
|
|
20
|
+
estimateReason: string;
|
|
21
|
+
usdEstimate: string | null;
|
|
22
|
+
estimateLabel: "estimate, not a quote" | "price unavailable";
|
|
23
|
+
token: import("../../types.js").Token;
|
|
24
|
+
amount: import("../../types.js").DecimalString;
|
|
25
|
+
};
|
|
26
|
+
pendingChop: import("../../types.js").TokenAmount & import("../../usd-estimate.js").UsdEstimateFields;
|
|
27
|
+
claimableChop: import("../../types.js").TokenAmount & import("../../usd-estimate.js").UsdEstimateFields;
|
|
28
|
+
withdrawableLp: import("../../types.js").TokenAmount;
|
|
29
|
+
rewardsPaused: boolean;
|
|
30
|
+
measuredAtBlock: string;
|
|
31
|
+
warnings: string;
|
|
32
|
+
gross: import("../../types.js").TokenAmount;
|
|
33
|
+
fee: import("../../types.js").TokenAmount;
|
|
34
|
+
log: `0x${string}`;
|
|
35
|
+
logTokens: import("../../types.js").TokenAmount;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunks/IZP3EKKS.js";import"../../../chunks/5H7NVE6O.js";import"../../../chunks/7OOCAZBE.js";import"../../../chunks/WSILNJS2.js";import"../../../chunks/KHOUBQJK.js";import"../../../chunks/JFC2QCMW.js";import"../../../chunks/Y2QADJOB.js";import"../../../chunks/N624NR7Y.js";import"../../../chunks/DCGNVMKG.js";import"../../../chunks/3PHJUFU2.js";import"../../../chunks/HZSYMGJ2.js";import"../../../chunks/ZX43P4BK.js";import"../../../chunks/GYPMUYB5.js";import"../../../chunks/CQ5WRWV4.js";import"../../../chunks/IV4K7FMD.js";import"../../../chunks/GK3D7OKG.js";import"../../../chunks/OIQTZOBN.js";import"../../../chunks/Z7FGEWO2.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/BSX4LFYI.js";import"../../../chunks/C76D54YG.js";import"../../../chunks/ELHRXA5U.js";import"../../../chunks/DGDMRATN.js";import"../../../chunks/4Z3IGMU6.js";import"../../../chunks/TXGZ6NWN.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/VVAM3EAK.js";import"../../../chunks/P4UQGWCP.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/MQ5F2VOK.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as readPositionDisplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../../chunks/
|
|
1
|
+
import{a,b}from"../../../chunks/ZVY7GGSP.js";import"../../../chunks/EPOIAXCV.js";import"../../../chunks/S47M3IPR.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{b as createChopGuard,a as rebuildChopAction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as i}from"../../../chunks/G2LAO23N.js";import{a as q,b as D,c as j,d as $,e as I,f as N}from"../../../chunks/OEZ7FCLF.js";import{a as T}from"../../../chunks/IZP3EKKS.js";import{a as R}from"../../../chunks/5H7NVE6O.js";import{a as E}from"../../../chunks/WRA3ZC6W.js";import{a as F,b as u,d as C}from"../../../chunks/EPOIAXCV.js";import"../../../chunks/S47M3IPR.js";import"../../../chunks/2GXHYI23.js";import"../../../chunks/7OOCAZBE.js";import"../../../chunks/WSILNJS2.js";import"../../../chunks/KHOUBQJK.js";import"../../../chunks/JFC2QCMW.js";import"../../../chunks/Y2QADJOB.js";import"../../../chunks/N624NR7Y.js";import"../../../chunks/DCGNVMKG.js";import"../../../chunks/3PHJUFU2.js";import"../../../chunks/HZSYMGJ2.js";import"../../../chunks/ZX43P4BK.js";import"../../../chunks/GYPMUYB5.js";import"../../../chunks/CQ5WRWV4.js";import"../../../chunks/IV4K7FMD.js";import"../../../chunks/GK3D7OKG.js";import"../../../chunks/OIQTZOBN.js";import"../../../chunks/Z7FGEWO2.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/BSX4LFYI.js";import"../../../chunks/C76D54YG.js";import"../../../chunks/ELHRXA5U.js";import"../../../chunks/DGDMRATN.js";import"../../../chunks/4Z3IGMU6.js";import"../../../chunks/TXGZ6NWN.js";import{c as _,g as b,h as A,i as S,j as L,k as O,p as v}from"../../../chunks/S65KXMZ7.js";import{a as p}from"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import{m as w}from"../../../chunks/QA6Z2CYP.js";import{a as y}from"../../../chunks/CFPJDLTZ.js";import"../../../chunks/VVAM3EAK.js";import"../../../chunks/P4UQGWCP.js";import{b as M}from"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/MQ5F2VOK.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";var U={type:"string"};function c(t,n){let h=n==="chop_wrap"?"underlying token":n==="chop_unfarm"?"staked LP token":"log token",o={log:i.address("verified Chop log on Robinhood Chain"),underlying:i.address("underlying token matching the verified log"),amount:i.amount(h),minLogOut:`Minimum log output. ${i.amount("log token")}`,quotedNet:`Net output from chop_quote_unwrap; checked again before unwrapping. ${i.amount("underlying token")}`,pairedAmount:i.amount("paired token"),minPaired:`Minimum paired input checked in the preview. ${i.amount("paired token")}`,minStakedLp:`Minimum staked LP output checked in the preview. ${i.amount("staked LP token")}`,minPairedOut:`Minimum paired output enforced on chain. ${i.amount("paired token")}`,slippageBps:`${i.bps()} From 0 to 1000 in multiples of 10.`,deadline:`${i.unixSeconds()} Must be in the next 20 minutes.`};return{type:"object",additionalProperties:!1,properties:Object.fromEntries(t.map(e=>[e,{...e==="slippageBps"?{type:"integer",minimum:0,maximum:1e3,multipleOf:10}:U,description:o[e]+(n==="chop_unfarm"&&["minLogOut","minPairedOut"].includes(e)?" Omit for a current-block quote with 1% slippage.":"")}])),required:t.filter(e=>n!=="chop_unfarm"||!["minLogOut","minPairedOut"].includes(e))}}var x=["detail","fields","limit","offset"],B={type:"object",additionalProperties:!1,properties:{detail:q,fields:D,limit:j,offset:$},required:[]};function z(t){let n=_();return{tools:[{name:"chop_logs",inputSchema:B,execute:async o=>{u(o,Object.keys(o).filter(r=>x.includes(r)));let e=I(o),a=await b(t,n),s=await S(t,a.logs),g=await R({clientFor:t.clientFor,oakTokenAddress:p(y.oak)},s.flatMap(r=>[r.rewardPot,...r.reserves]),{budgetMs:3e3,chopShareTokens:s.map(r=>r.log.address),chopShareFacts:a.logs}),f={...a,logs:s.map(({reserves:r,...m},d)=>{let k=g[d*3],l=L(g.slice(d*3+1,d*3+1+r.length)),P=O(l.reserves,m.paired);return{...m,rewardPot:k,poolDepth:l,priceMovePer100Usd:P,plainSummary:w(m,k,l,P)}})};return e.detail==="full"||e.fields.length?N(f,{...e,keep:["warnings"]}).shaped:A(t,f,e)}},{name:"chop_position",inputSchema:c(["log"],"chop_position"),execute:async(o,e)=>(u(o,["log"]),T(t,p(o.log),e,n))},{name:"chop_quote_unwrap",inputSchema:c(["log","amount"],"chop_quote_unwrap"),execute:async(o,e)=>(u(o,["log","amount"]),v(t,p(o.log),e,o.amount))},...Object.entries(F).map(([o,e])=>({name:o,inputSchema:c(e,o),execute:(a,s)=>C(t,o,a,s)}))],positions:(o,e)=>E(t,o,e,n)}}var oe=t=>M("chop",t.network==="testnet"?[]:[z(t)]);export{oe as createModule,z as createModulePart};
|
|
@@ -56,6 +56,7 @@ export declare const CHOP_PINS: {
|
|
|
56
56
|
readonly measuredAtBlock: "106718816";
|
|
57
57
|
readonly source: "https://rpc.mainnet.chain.robinhood.com";
|
|
58
58
|
};
|
|
59
|
+
export declare const CHOP_OAK_STAKING: "0x4d7b4223144e14Ca1FB1324e28753b43277fD9F3";
|
|
59
60
|
export declare const CHOP_REFERENCE_POOL: {
|
|
60
61
|
readonly poolId: "0x8111082d181841cbd123e82bced032b1331140332b6ce3da37f53a6b24ed736c";
|
|
61
62
|
readonly stateView: "0xf3334192d15450cdd385c8b70e03f9a6bd9e673b";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../../chunks/
|
|
1
|
+
import{a,b,c}from"../../../chunks/CFPJDLTZ.js";import"../../../chunks/63YRSLDK.js";export{b as CHOP_OAK_STAKING,a as CHOP_PINS,c as CHOP_REFERENCE_POOL};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunks/
|
|
1
|
+
import{a}from"../../../chunks/WRA3ZC6W.js";import"../../../chunks/2GXHYI23.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as readPositions};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PublicClient } from 'viem';
|
|
2
2
|
import type { ReadShapeArgs } from '../../read-shape.js';
|
|
3
3
|
import type { Address, ModuleContext, TokenAmount, UnsignedTx } from '../../types.js';
|
|
4
|
-
import type { ChopDisplayAmount, ChopPoolDepth, ChopPriceMove, VerifiedLog } from './types.js';
|
|
4
|
+
import type { ChopDisplayAmount, ChopPoolDepth, ChopPriceMove, ChopStakedBacking, VerifiedLog } from './types.js';
|
|
5
5
|
export declare const tokenAmount: (token: TokenAmount["token"], value: bigint) => TokenAmount;
|
|
6
6
|
export declare const DISCOVERY_TTL_MS = 60000;
|
|
7
7
|
type Inventory = Awaited<ReturnType<typeof listLogsUncached>>;
|
|
@@ -26,6 +26,7 @@ export declare function redemption(client: PublicClient, facts: VerifiedLog, wal
|
|
|
26
26
|
fee: TokenAmount;
|
|
27
27
|
net: TokenAmount;
|
|
28
28
|
}>;
|
|
29
|
+
export declare function stakedBacking(client: PublicClient, facts: VerifiedLog, wallet: Address, shares: bigint, readBlock: bigint, signal?: AbortSignal): Promise<ChopStakedBacking>;
|
|
29
30
|
declare function listLogsUncached(context: ModuleContext, signal?: AbortSignal): Promise<{
|
|
30
31
|
logs: {
|
|
31
32
|
plainSummary: string;
|
|
@@ -124,6 +125,7 @@ export declare function poolDepth(reserves: ChopDisplayAmount[]): ChopPoolDepth;
|
|
|
124
125
|
export declare function priceMovePer100Usd(reserves: ChopDisplayAmount[], paired: VerifiedLog['paired']): ChopPriceMove;
|
|
125
126
|
export declare const POSITION_CHUNK_SIZE = 10;
|
|
126
127
|
export declare function positionsAt(client: PublicClient, logs: readonly VerifiedLog[], wallet: Address, readBlock: bigint, signal?: AbortSignal, onPosition?: (position: Awaited<ReturnType<typeof positionFromValues>>, index: number) => void): Promise<{
|
|
128
|
+
stakedBacking: ChopStakedBacking;
|
|
127
129
|
stakedLp: TokenAmount;
|
|
128
130
|
withdrawableLp: TokenAmount;
|
|
129
131
|
pendingChop: TokenAmount;
|
|
@@ -138,6 +140,7 @@ export declare function positionsAt(client: PublicClient, logs: readonly Verifie
|
|
|
138
140
|
logTokens: TokenAmount;
|
|
139
141
|
}[]>;
|
|
140
142
|
export declare function positionAt(client: PublicClient, facts: VerifiedLog, wallet: Address, readBlock?: bigint, signal?: AbortSignal): Promise<{
|
|
143
|
+
stakedBacking: ChopStakedBacking;
|
|
141
144
|
stakedLp: TokenAmount;
|
|
142
145
|
withdrawableLp: TokenAmount;
|
|
143
146
|
pendingChop: TokenAmount;
|
|
@@ -152,6 +155,7 @@ export declare function positionAt(client: PublicClient, facts: VerifiedLog, wal
|
|
|
152
155
|
logTokens: TokenAmount;
|
|
153
156
|
}>;
|
|
154
157
|
declare function positionFromValues(client: PublicClient, facts: VerifiedLog, wallet: Address, readBlock: bigint, signal: AbortSignal | undefined, values: unknown[]): Promise<{
|
|
158
|
+
stakedBacking: ChopStakedBacking;
|
|
155
159
|
stakedLp: TokenAmount;
|
|
156
160
|
withdrawableLp: TokenAmount;
|
|
157
161
|
pendingChop: TokenAmount;
|
|
@@ -166,6 +170,7 @@ declare function positionFromValues(client: PublicClient, facts: VerifiedLog, wa
|
|
|
166
170
|
logTokens: TokenAmount;
|
|
167
171
|
}>;
|
|
168
172
|
export declare function readPosition(context: ModuleContext, candidate: Address, wallet: Address, cache?: ChopReadCache): Promise<{
|
|
173
|
+
stakedBacking: ChopStakedBacking;
|
|
169
174
|
stakedLp: TokenAmount;
|
|
170
175
|
withdrawableLp: TokenAmount;
|
|
171
176
|
pendingChop: TokenAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{b as DISCOVERY_TTL_MS,l as POSITION_CHUNK_SIZE,c as createReadCache,g as listLogs,i as measureLogs,j as poolDepth,n as positionAt,m as positionsAt,k as priceMovePer100Usd,p as quoteUnwrap,o as readPosition,e as redemption,f as stakedBacking,h as summarizeLogs,a as tokenAmount,d as unwrapTx};
|
|
@@ -32,6 +32,13 @@ export interface ChopActionResult {
|
|
|
32
32
|
measuredAtBlock: string;
|
|
33
33
|
}
|
|
34
34
|
export type ChopDisplayAmount = TokenAmount & UsdEstimateFields;
|
|
35
|
+
export interface ChopStakedBacking {
|
|
36
|
+
assets: TokenAmount[];
|
|
37
|
+
logTokens?: TokenAmount;
|
|
38
|
+
estimateLabel: 'estimate, not a quote' | 'price unavailable';
|
|
39
|
+
estimateReason?: string;
|
|
40
|
+
measuredAtBlock: string;
|
|
41
|
+
}
|
|
35
42
|
export interface ChopPriceMove {
|
|
36
43
|
label: 'rough';
|
|
37
44
|
pct: string | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type PublicClient } from 'viem';
|
|
2
|
+
import type { Address, ToolArgs } from '../../types.js';
|
|
3
|
+
import type { VerifiedLog } from './types.js';
|
|
4
|
+
export declare function quoteUnfarm(client: PublicClient, facts: VerifiedLog, wallet: Address, args: ToolArgs): Promise<{
|
|
5
|
+
measuredAtBlock: string;
|
|
6
|
+
slippageBps: number;
|
|
7
|
+
expectedLogOut: string;
|
|
8
|
+
expectedPairedOut: string;
|
|
9
|
+
minLogOut: string;
|
|
10
|
+
minPairedOut: string;
|
|
11
|
+
suggested: {
|
|
12
|
+
minLogOut: boolean;
|
|
13
|
+
minPairedOut: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
export declare function unfarmQuoteSummary(quote: Awaited<ReturnType<typeof quoteUnfarm>>, facts: VerifiedLog): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../../../chunks/S47M3IPR.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as quoteUnfarm,b as unfarmQuoteSummary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../../../chunks/
|
|
1
|
+
import{a,b,c}from"../../../chunks/ZX43P4BK.js";import"../../../chunks/GYPMUYB5.js";import"../../../chunks/CQ5WRWV4.js";import"../../../chunks/IV4K7FMD.js";import"../../../chunks/GK3D7OKG.js";import"../../../chunks/OIQTZOBN.js";import"../../../chunks/Z7FGEWO2.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/BSX4LFYI.js";import"../../../chunks/C76D54YG.js";import"../../../chunks/ELHRXA5U.js";import"../../../chunks/DGDMRATN.js";import"../../../chunks/4Z3IGMU6.js";import"../../../chunks/TXGZ6NWN.js";import"../../../chunks/VVAM3EAK.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/MQ5F2VOK.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{c as createModule,b as createModulePart,a as readClankerTokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d}from"../../../chunks/XL3W7DAQ.js";import{c as l}from"../../../chunks/
|
|
1
|
+
import{a as d}from"../../../chunks/XL3W7DAQ.js";import{c as l}from"../../../chunks/KKTOBXIT.js";import"../../../chunks/QMNUB2GM.js";import"../../../chunks/FAH7FKUT.js";import"../../../chunks/2OVJ2BTJ.js";import"../../../chunks/GQITAJVF.js";import"../../../chunks/OUROA7XR.js";import"../../../chunks/NMJVQX5M.js";import"../../../chunks/SK2VBNAU.js";import{h as s}from"../../../chunks/3YH5B5NQ.js";import"../../../chunks/OVM4QIET.js";import{a as f,b as y}from"../../../chunks/3PU2SD3U.js";import{a as o}from"../../../chunks/YRSAZTTC.js";import"../../../chunks/H3E7UD2X.js";import"../../../chunks/2GXHYI23.js";import"../../../chunks/MSRCJ2BS.js";import"../../../chunks/S4JUFCT4.js";import"../../../chunks/WAKZWSHB.js";import{ta as c}from"../../../chunks/V5YSJKRH.js";import"../../../chunks/7OOCAZBE.js";import"../../../chunks/WSILNJS2.js";import"../../../chunks/KHOUBQJK.js";import"../../../chunks/JFC2QCMW.js";import"../../../chunks/Y2QADJOB.js";import"../../../chunks/N624NR7Y.js";import"../../../chunks/DCGNVMKG.js";import"../../../chunks/3PHJUFU2.js";import"../../../chunks/HZSYMGJ2.js";import"../../../chunks/ZX43P4BK.js";import"../../../chunks/GYPMUYB5.js";import"../../../chunks/CQ5WRWV4.js";import"../../../chunks/IV4K7FMD.js";import"../../../chunks/GK3D7OKG.js";import"../../../chunks/OIQTZOBN.js";import"../../../chunks/Z7FGEWO2.js";import"../../../chunks/LIUXNOLP.js";import"../../../chunks/BSX4LFYI.js";import"../../../chunks/C76D54YG.js";import"../../../chunks/ELHRXA5U.js";import"../../../chunks/DGDMRATN.js";import"../../../chunks/4Z3IGMU6.js";import"../../../chunks/TXGZ6NWN.js";import"../../../chunks/S65KXMZ7.js";import"../../../chunks/CW37EGPL.js";import"../../../chunks/K6D6SDIG.js";import"../../../chunks/QA6Z2CYP.js";import"../../../chunks/CFPJDLTZ.js";import"../../../chunks/VVAM3EAK.js";import"../../../chunks/P4UQGWCP.js";import{b as m}from"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/IOYRL6AY.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import{b as i}from"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5HCXZWUH.js";import"../../../chunks/MQ5F2VOK.js";import"../../../chunks/5RXALTDT.js";import{b as a,k as p}from"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";import{erc20Abi as E}from"viem";function b(e){return{nowSec:()=>Math.floor(Date.now()/1e3),usdgBalance:async t=>e.clientFor(a).readContract({address:p,abi:E,functionName:"balanceOf",args:[t]}),ethBalance:async t=>e.clientFor(a).getBalance({address:t})}}var C='Optional USDG amount in base units (6 decimals): "1000000" = 1 USDG; defaults to the wallet USDG balance.';function x(e,t={layerbank:s(e),pendleTerms:r=>l(e,r),pendleQuoteCosts:(r,n)=>d(e,r,n)},u={}){return m("earn",[{tools:[{name:"earn_options",inputSchema:{type:"object",properties:{amount:i(C)},additionalProperties:!1},execute:async(r,n)=>o(t,{...b(e),...u},n,typeof r.amount=="string"?{amount:r.amount}:{})}]}])}export{x as createModule,c as earnCopy,o as earnOptions,y as lpWarning,f as lpWarningParts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f}from"../../../chunks/
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f}from"../../../chunks/7TRO6MBQ.js";import"../../../chunks/SUNTJ6IU.js";import"../../../chunks/ADIPEGNN.js";import"../../../chunks/OB7BFDOV.js";import"../../../chunks/ANIF3JMV.js";import"../../../chunks/E76Z2TT4.js";import"../../../chunks/GBIBRYOV.js";import"../../../chunks/3A2IKFTV.js";import{a}from"../../../chunks/X5V2Z2NM.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/HFVXNKA5.js";import"../../../chunks/TRCP7X5P.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/TI727O2H.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{b as CLI_ALIASES,f as createModule,e as createModulePart,a as identityAbi,c as readAgentIdentity,d as selfRegistration};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../../../chunks/XNJ6NDQQ.js";import"../../../chunks/QKIQ7ZKD.js";import"../../../chunks/5XAXJEWM.js";import"../../../chunks/6AS3TGOX.js";import"../../../chunks/CZL6T2ZQ.js";import"../../../chunks/ZQ6AF3VX.js";import"../../../chunks/GMMTHTCP.js";import"../../../chunks/UEOS6SHR.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{e as buildDecline,d as buildDeliver,c as buildDraw,b as buildRegister,f as deliveryProof,a as factorActionFields,g as prepareFactorAction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d,e}from"../../../chunks/GMMTHTCP.js";import"../../../chunks/UEOS6SHR.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{b as getJob,c as getJobs,e as getOpenJob,d as getOpenJobs,a as readState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h}from"../../../chunks/
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../../../chunks/QKIQ7ZKD.js";import"../../../chunks/6AS3TGOX.js";import"../../../chunks/CZL6T2ZQ.js";import"../../../chunks/ZQ6AF3VX.js";import"../../../chunks/GMMTHTCP.js";import"../../../chunks/UEOS6SHR.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{c as assertFactorTransaction,a as assertFields,d as checkEnvironment,f as checkJob,g as factorRefusal,e as readAgent,h as simulateFactorTransaction,b as uint256};
|
|
@@ -19,15 +19,15 @@ export declare const FACTOR_COPY: {
|
|
|
19
19
|
readonly apiLabel: "Factor API (can lag the chain)";
|
|
20
20
|
};
|
|
21
21
|
export declare const FACTOR_TOOL_DESCRIPTIONS: {
|
|
22
|
-
readonly factor_sign_up: "Register this wallet as a Factor agent on Robinhood Chain, then sign its public profile with a name and description. Gas for registration; identity
|
|
23
|
-
readonly factor_create_pay_link: "Sign a pay link for a fixed-price ETH job on Robinhood Chain. Price is a wei string; expiry is 1-30 days. No payment now; a customer pays later. Identity
|
|
24
|
-
readonly factor_apply_to_job: "Sign an application for a fixed-price Factor open job. Identity
|
|
25
|
-
readonly factor_draw: "Draw an early or pool advance to this wallet on Robinhood Chain, with amount in integer wei. Identity
|
|
26
|
-
readonly factor_deliver: "Deliver a work fingerprint on Robinhood Chain. Show defaults to false; public posting follows successful delivery only when requested. Identity
|
|
27
|
-
readonly factor_decline: "Decline a Factor job on Robinhood Chain and return its price to the customer. Identity
|
|
28
|
-
readonly factor_job: "Read a Factor job and its public details from the Factor API (can lag the chain). API data does not authorize an action. No identity
|
|
29
|
-
readonly factor_can_draw: "Read the desk's early and pool advance amounts in wei on Robinhood Chain; these amounts share the same half-price cap. No identity
|
|
30
|
-
readonly factor_my_jobs: "Read at most 50 Factor jobs for this wallet as agent or customer from the Factor API (can lag the chain). No identity
|
|
31
|
-
readonly factor_open_jobs: "Read at most 25 Factor open-job listings from the Factor API (can lag the chain). Filter by this wallet or verified owners when requested. No identity
|
|
32
|
-
readonly factor_open_job: "Read a Factor open-job listing and public application details from the Factor API (can lag the chain). No identity
|
|
22
|
+
readonly factor_sign_up: "Register this wallet as a Factor agent on Robinhood Chain, then sign its public profile with a name and description. Gas for registration; identity and human confirmation required. Factor is an official Oak partner. Factor's own team runs its product and contracts; Oak didn't build them and doesn't run them. Factor's desk contract has no owner, and its rules are fixed in its code. Factor's website and API are run by Factor and can lag the chain. Names are first come, and a fixed-price application can't be withdrawn.";
|
|
23
|
+
readonly factor_create_pay_link: "Sign a pay link for a fixed-price ETH job on Robinhood Chain. Price is a wei string; expiry is 1-30 days. No payment now; a customer pays later. Identity and human confirmation required. A signed pay link can't be revoked; anyone holding it can pay it until it expires. At most half of a job's price can be advanced before delivery. An advance costs a 1% fee taken from the advance, paid to Factor's burn pot contract. A settled job pays Factor's 2% job fee from the agent's payout.";
|
|
24
|
+
readonly factor_apply_to_job: "Sign an application for a fixed-price Factor open job. Identity and human confirmation required. This Factor job takes offers, which Oak can't send yet. Nothing was signed. Names are first come, and a fixed-price application can't be withdrawn.";
|
|
25
|
+
readonly factor_draw: "Draw an early or pool advance to this wallet on Robinhood Chain, with amount in integer wei. Identity and human confirmation required. At most half of a job's price can be advanced before delivery. An advance costs a 1% fee taken from the advance, paid to Factor's burn pot contract. A settled job pays Factor's 2% job fee from the agent's payout. If a job you drew on isn't delivered within 12 hours after its due time, anyone can refund it, and this wallet can never draw from Factor's pool again. Oak doesn't send compute advances: that ETH goes to Factor's gateway as off-chain credit Oak can't check. Nothing was sent.";
|
|
26
|
+
readonly factor_deliver: "Deliver a work fingerprint on Robinhood Chain. Show defaults to false; public posting follows successful delivery only when requested. Identity and human confirmation required. Your work text stays on this computer; only its fingerprint (a hash) goes on chain. With show true: Your work text will be public on Factor's job page and can't be edited.";
|
|
27
|
+
readonly factor_decline: "Decline a Factor job on Robinhood Chain and return its price to the customer. Identity and human confirmation required. You can decline a job only before drawing on it. A rejected job settles at half, with no appeal.";
|
|
28
|
+
readonly factor_job: "Read a Factor job and its public details from the Factor API (can lag the chain). API data does not authorize an action. No identity required.";
|
|
29
|
+
readonly factor_can_draw: "Read the desk's early and pool advance amounts in wei on Robinhood Chain; these amounts share the same half-price cap. No identity required. Desk figures only; jobs and limits held through a Factor credit line are not shown.";
|
|
30
|
+
readonly factor_my_jobs: "Read at most 50 Factor jobs for this wallet as agent or customer from the Factor API (can lag the chain). No identity required. Desk figures only; jobs and limits held through a Factor credit line are not shown.";
|
|
31
|
+
readonly factor_open_jobs: "Read at most 25 Factor open-job listings from the Factor API (can lag the chain). Filter by this wallet or verified owners when requested. No identity required.";
|
|
32
|
+
readonly factor_open_job: "Read a Factor open-job listing and public application details from the Factor API (can lag the chain). No identity required.";
|
|
33
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../../chunks/
|
|
1
|
+
import{a,b}from"../../../chunks/UEOS6SHR.js";import"../../../chunks/63YRSLDK.js";export{a as FACTOR_COPY,b as FACTOR_TOOL_DESCRIPTIONS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunks/
|
|
1
|
+
import{a}from"../../../chunks/KCZUJ57H.js";import"../../../chunks/XNJ6NDQQ.js";import"../../../chunks/QKIQ7ZKD.js";import"../../../chunks/5XAXJEWM.js";import"../../../chunks/6AS3TGOX.js";import"../../../chunks/CZL6T2ZQ.js";import"../../../chunks/ZQ6AF3VX.js";import"../../../chunks/GMMTHTCP.js";import"../../../chunks/UEOS6SHR.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as rebuildFactorAction};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as be}from"../../../chunks/
|
|
1
|
+
import{a as be}from"../../../chunks/KCZUJ57H.js";import{b as we,c as ge,d as me,e as ye,f as R,g as D}from"../../../chunks/XNJ6NDQQ.js";import{a as E,b,d as P,e as C,f as Y}from"../../../chunks/QKIQ7ZKD.js";import{b as v,c as K,d as O,e as I,f as Q,g as X,h as Z,i as ee,j as te}from"../../../chunks/5XAXJEWM.js";import{d as V}from"../../../chunks/6AS3TGOX.js";import{c as S}from"../../../chunks/CZL6T2ZQ.js";import"../../../chunks/ZQ6AF3VX.js";import{b as q,c as z,d as G,e as $}from"../../../chunks/GMMTHTCP.js";import{a as c,b as U}from"../../../chunks/UEOS6SHR.js";import"../../../chunks/SPJCSEKP.js";import"../../../chunks/Z25UKUJF.js";import"../../../chunks/43LI5NKJ.js";import{a as W}from"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import{b as m}from"../../../chunks/66F5ZH34.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/5RXALTDT.js";import{a as r}from"../../../chunks/XSD5NL7J.js";import{a as B}from"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";import{randomBytes as _e}from"node:crypto";import{formatEther as L,getAddress as ae,isAddressEqual as oe,recoverMessageAddress as ke}from"viem";var k='Factor job ID, a decimal string. Example: "1".',je="https://factoragents.fun/api/v1",ce={type:"string",pattern:"^0x[0-9a-f]{64}$",description:"Open job listing ID: 0x followed by 64 lowercase hex digits, from factor_open_jobs."},Fe={continuation:{type:"object",description:"The continuation object returned by the previous call of this tool. Pass it back unchanged with the signature; leave it out on the first call."},signature:{type:"string",pattern:"^0x[0-9a-fA-F]{130}$",description:"This wallet's signature of the message returned by the previous call (0x plus 130 hex digits). Needs the continuation. Leave out on the first call."}},ne={factor_sign_up:"profile",factor_create_pay_link:"pay-link",factor_apply_to_job:"application"},ie={factor_sign_up:{name:{type:"string",description:"Public agent name for the Factor profile. Trimmed and lowercased; names are first come."},does:{type:"string",description:"One-line public description of what this agent does (3 to 80 characters)."}},factor_create_pay_link:{price:m("Job price in wei, from 0.001 to 1000 ETH."),title:{type:"string",description:"Short public title of the job (3 to 80 characters, one line)."},brief:{type:"string",maxLength:2e3,description:"Public description of the work the customer gets (up to 2000 characters)."},due_in_hours:{type:"integer",minimum:1,maximum:720,default:24,description:"Hours allowed to deliver after payment, 1 to 720. Defaults to 24."},allow_early:{type:"boolean",default:!1,description:"True lets this agent draw an early advance before delivery. Defaults to false."},expires_in_days:{type:"integer",minimum:1,maximum:30,default:30,description:"Days until the signed pay link expires, 1 to 30. Defaults to 30."}},factor_apply_to_job:{open:ce,pitch:{type:"string",description:"Optional one-line pitch shown with the application (3 to 280 characters). Leave out for none."}}};function j(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function pe(e,o){if(e===void 0)return!1;if(typeof e!="boolean")throw new r(`${o} must be a boolean.`);return e}function re(e,o,n,t){if(e===void 0)return o;if(typeof e!="number"||!Number.isSafeInteger(e)||e<1||e>n)throw new r(`${t} must be a whole number from 1 to ${n}.`);return e}function ue(e){if(typeof e!="string"||!/^0x[0-9a-f]{64}$/.test(e))throw new r("Provide an open job ID of 64 lowercase hexadecimal digits after 0x.");return e}function Ae(e,o){if(e==="factor_sign_up")return O("name",o.name),O("does",o.does),{name:o.name.trim().toLowerCase(),does:v(o.does,3,80)};if(e==="factor_apply_to_job"){if(o.pitch!==void 0&&typeof o.pitch!="string")throw new r("Provide pitch as text.");return O("pitch",o.pitch),{open:ue(o.open),pitch:o.pitch===void 0||o.pitch.trim()===""?"":v(o.pitch,3,280)}}if(typeof o.price!="string")throw new r("Provide price as a decimal wei string.");let n=b(o.price,"price");if(n<S.MIN_JOB||n>1000n*10n**18n)throw new r("Factor job price must be from 1000000000000000 to 1000000000000000000000 wei.");return{price:n.toString(),title:v(o.title,3,80),brief:K(o.brief),due_in_hours:re(o.due_in_hours,24,720,"due_in_hours"),allow_early:pe(o.allow_early,"allow_early"),expires_in_days:re(o.expires_in_days,30,30,"expires_in_days")}}function fe(e,o){if(e.continuation===void 0){if(e.signature!==void 0)throw new r("A Factor signature requires its continuation. Start the tool again.");return}let n=e.continuation;if(!j(n)||n.wallet!==o||n.chainId!==4663||typeof n.stage!="string"||!j(n.args))throw new r("Invalid Factor continuation wallet, chain or stage. Start the tool again.");return E(n,["stage","wallet","chainId","args","at","createdAt","expiresAt","exp","id","message"]),n}function de(e,o){let n=e.args;if(!j(n)||Object.keys(n).length!==Object.keys(o).length||Object.entries(o).some(([t,i])=>n[t]!==i))throw new r("Factor continuation arguments changed. Start the tool again.")}async function x(e,o,n){let t=await e.http(`${je}${o}`,{method:"POST",redirect:"error",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!t.ok)throw new W(t);return t.json()}function M(e){return typeof e=="string"?B(e):Array.isArray(e)?e.map(M):j(e)?Object.fromEntries(Object.entries(e).map(([o,n])=>[o,M(n)])):e}function se(e,o){if(!Array.isArray(e.data.items))throw new r("Factor API returned a list without an items array.");return{...e,data:{...e.data,items:e.data.items.slice(0,o)}}}async function le(e,o,n,t){let i=Ae(o,n),s=fe(n,t);if(s&&de(s,i),o==="factor_sign_up"&&(!s||s.stage==="register")){if(n.signature!==void 0)throw new r("The Factor registration stage takes no signature.");if(s&&!(await C(e.clientFor(4663),t)).registered)throw new r("This wallet is not registered yet. Wait for registration, then retry.");let l=await D(e,o,i,t);if(l.length)return await e.preview(l,t),{steps:l.map(y=>({kind:"tx",tx:y})),continuation:{stage:"register",wallet:t,chainId:4663,args:i},summary:`${c.partner}
|
|
2
2
|
${c.trust}
|
|
3
3
|
Register this wallet, then sign its Factor profile.`}}if(s&&s.stage!=="register"&&s.stage!==ne[o])throw new r("Unknown Factor signature continuation. Start the tool again.");let d=await P(e,t,!0);if(d==="unreachable")throw new r(c.stateUnavailable);let p=Math.floor(Date.now()/1e3);if(I(d.asOf,p),!(await C(e.clientFor(4663),t)).registered)throw new r("This wallet has not registered as a Factor agent. Run factor_sign_up first.");if(o==="factor_apply_to_job"){let l=await $(e.http,i.open),y=l.data.open;if(!j(y))throw new r("Factor API returned no open job listing.");if(y.offers!==!1)throw new r(c.offers);if(typeof y.customer!="string")throw new r("Factor API returned no open job customer.");if(oe(ae(y.customer),t))throw new r("A customer cannot apply for its own Factor job.");if(y.applying!==!0)throw new r("This Factor job is not taking applications now.")}let u=s!==void 0&&s.stage!=="register",a=u?s.at:d.asOf,f=u?s.createdAt:p;if(typeof a!="number"||typeof f!="number"||!Number.isSafeInteger(f)||f>p)throw new r("Invalid Factor message time. Start the tool again.");I(a,f);let h,w,F,g;if(o==="factor_sign_up")h=X({address:t,name:i.name,does:i.does,at:a});else if(o==="factor_apply_to_job")h=ee({open:i.open,address:t,pitch:i.pitch,at:a});else{if(w=Q(a,f,i.expires_in_days),F=u?s.id:_e(8).toString("hex"),u&&s.exp!==w)throw new r("Factor link expiry changed. Start the tool again.");g={v:1,agent:t.toLowerCase(),price:i.price,title:i.title,brief:i.brief,due:i.due_in_hours,early:i.allow_early,exp:w,id:F},h=Z({address:t,priceWei:g.price,title:g.title,brief:g.brief,dueHours:g.due,allowEarly:g.early,exp:w,id:F})}let A=w??Math.min(a+600,f+600);if(A<=p||A>p+2592e3||w===void 0&&Math.abs(d.asOf-a)>600)throw new r("The Factor message expired. Start the tool again.");let he={stage:ne[o],wallet:t,chainId:4663,args:i,at:a,createdAt:f,expiresAt:A,message:h,...w===void 0?{}:{exp:w,id:F}};if(u&&(s.message!==h||s.expiresAt!==A))throw new r("Factor message continuation changed. Start the tool again.");let _=o==="factor_create_pay_link"?`${c.payLink}
|
|
4
4
|
${c.half}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f,f as g}from"../../../chunks/
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f,f as g}from"../../../chunks/6AS3TGOX.js";import"../../../chunks/CZL6T2ZQ.js";import"../../../chunks/ZQ6AF3VX.js";import{a}from"../../../chunks/GMMTHTCP.js";import"../../../chunks/UEOS6SHR.js";import"../../../chunks/SCG5HWMN.js";import"../../../chunks/5TUXSOMI.js";import"../../../chunks/5RXALTDT.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{b as assertDesk,e as canDrawOn,f as lineKeyOf,c as readDesk,d as readJob,a as readState,g as walletHasCode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunks/
|
|
1
|
+
import{a}from"../../../chunks/AL6UXNGH.js";import"../../../chunks/NWNYJ26T.js";import"../../../chunks/IX3GZMTM.js";import"../../../chunks/XSD5NL7J.js";import"../../../chunks/JXOEJPJ4.js";import"../../../chunks/63YRSLDK.js";export{a as createFoboClient};
|