@oracle-agent/oracle 0.22.15 → 0.22.16
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/SETUP.md +30 -4
- package/artifacts/specialist-packs/oracle-full-crypto.json +3 -1
- package/dist/bin/desk-server.mjs +17 -17
- package/dist/bin/oracle-data-mcp.mjs +6 -6
- package/dist/bin/oracle-public-server.mjs +4 -4
- package/dist/bin/oracle-route.mjs +1 -1
- package/dist/bin/oracle.mjs +20 -9
- package/dist/cli/commands/arm.mjs +17 -0
- package/dist/cli/commands/chat.mjs +1 -1
- package/dist/cli/commands/doctor.mjs +6 -6
- package/dist/cli/commands/model.mjs +1 -1
- package/dist/cli/commands/revoke.mjs +40 -0
- package/dist/cli/commands/snipe.mjs +39 -0
- package/dist/cli/commands/swap.mjs +2 -2
- package/dist/cli/commands/vault.mjs +29 -0
- package/dist/data/desk-data.mjs +14 -14
- package/dist/index.mjs +20 -20
- package/dist/local-vault/index.mjs +6 -0
- package/dist/router/index.mjs +1 -1
- package/dist/router/prepare-bridge.mjs +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var c=(e,t,o)=>()=>{if(o)throw o[0];try{return e&&(t=e(e=0)),t}catch(r){throw o=[r],r}};var m=c(()=>{});var N=c(()=>{});var g=c(()=>{});var f=c(()=>{N();g()});var Z=c(()=>{});var Ht,Wt,h=c(()=>{Ht=300*1e3,Wt=(()=>{let e=Number(process.env.ORACLE_PREPARE_HARD_MAX_AGE_MS);return Number.isFinite(e)&&e>0?e:1800*1e3})()});import{Contract as Kt,JsonRpcProvider as zt}from"ethers";var be=c(()=>{});var Qt,$=c(()=>{be();Qt=Object.freeze({swap:5,bridge:5,perps:0,nft:0})});var Ee=c(()=>{m();f();Z();h();$()});var Ae=c(()=>{m();f();h();$()});var ee=c(()=>{});var xe=c(()=>{m();f();ee();h()});var Ir,ye=c(()=>{Ir=Object.freeze({READ:"read",PREPARE:"prepare",EXECUTE:"execute",AUTONOMOUS:"autonomous"})});import{TypedDataEncoder as Or,getAddress as Tr,isAddress as Lr}from"ethers";var Pr,qr,Mr,Vr,ve=c(()=>{m();f();ye();Z();h();Pr=Object.freeze({1:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",100:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",42161:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",8453:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41"}),qr=Object.freeze({1:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",100:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",42161:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",8453:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110"}),Mr=Object.freeze({Order:[{name:"sellToken",type:"address"},{name:"buyToken",type:"address"},{name:"receiver",type:"address"},{name:"sellAmount",type:"uint256"},{name:"buyAmount",type:"uint256"},{name:"validTo",type:"uint32"},{name:"appData",type:"bytes32"},{name:"feeAmount",type:"uint256"},{name:"kind",type:"string"},{name:"partiallyFillable",type:"bool"},{name:"sellTokenBalance",type:"string"},{name:"buyTokenBalance",type:"string"}]}),Vr=Object.freeze({OrderCancellations:[{name:"orderUids",type:"bytes[]"}]})});var U,Wr,P=c(()=>{U={robinhood:{chainId:4663,name:"Robinhood Chain",rpcEnv:["RH_CHAIN_RPC"],evm:!0},ethereum:{chainId:1,name:"Ethereum",rpcEnv:["ETH_RPC_URL","ETHEREUM_RPC_URL","MAINNET_RPC_URL"],evm:!0},polygon:{chainId:137,name:"Polygon",rpcEnv:["POLYGON_RPC_URL","POLYGON_RPC"],evm:!0},arbitrum:{chainId:42161,name:"Arbitrum One",rpcEnv:["ARBITRUM_RPC_URL","ARB_RPC_URL"],evm:!0},base:{chainId:8453,name:"Base",rpcEnv:["BASE_RPC_URL"],evm:!0},hyperevm:{chainId:999,name:"HyperEVM",rpcEnv:["HYPEREVM_RPC_URL","HYPER_EVM_RPC"],evm:!0},bsc:{chainId:56,name:"BNB Smart Chain",rpcEnv:["BSC_RPC_URL","BNB_RPC_URL"],evm:!0},avalanche:{chainId:43114,name:"Avalanche C-Chain",rpcEnv:["AVALANCHE_RPC_URL","AVAX_RPC_URL"],evm:!0},optimism:{chainId:10,name:"OP Mainnet",rpcEnv:["OPTIMISM_RPC_URL","OP_RPC_URL"],evm:!0},abstract:{chainId:2741,name:"Abstract",rpcEnv:["ABSTRACT_RPC_URL","ABS_RPC_URL"],evm:!0},stable:{chainId:988,name:"Stable Mainnet",rpcEnv:["STABLE_RPC_URL","STABLE_RPC"],evm:!0}},Wr=new Map(Object.values(U).map(e=>[e.chainId,e]))});import{Interface as Je,getAddress as Xr}from"ethers";var Yr,I=c(()=>{m();P();Yr=new Je(["function allowance(address owner,address spender) view returns (uint256)","function balanceOf(address account) view returns (uint256)"])});var Zr,q=c(()=>{m();Zr=Object.freeze({1:"ethereum",10:"optimism",56:"bsc",137:"polygon",8453:"base",42161:"arbitrum",43114:"avalanche",999:"hyperevm",4663:"robinhood"})});import{Interface as ke,getAddress as rn,isAddress as nn}from"ethers";var un,ln,te=c(()=>{I();q();f();h();un=new ke(["function quoteExactInputSingle((address tokenIn, address tokenOut, uint256 amountIn, uint24 fee, uint160 sqrtPriceLimitX96) params) returns (uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate)","function quoteExactInput(bytes path, uint256 amountIn) returns (uint256 amountOut, uint160[] sqrtPriceX96AfterList, uint32[] initializedTicksCrossedList, uint256 gasEstimate)"]),ln=new ke(["function exactInputSingle((address tokenIn,address tokenOut,uint24 fee,address recipient,uint256 amountIn,uint256 amountOutMinimum,uint160 sqrtPriceLimitX96) params) payable returns (uint256 amountOut)","function multicall(uint256 deadline,bytes[] data) payable returns (bytes[] results)"])});import{AbiCoder as Ze,Interface as Ne,getAddress as fn,isAddress as mn,keccak256 as hn}from"ethers";var An,xn,yn,_e=c(()=>{I();q();f();h();An=Ze.defaultAbiCoder(),xn=new Ne(["function quoteExactInputSingle(((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountOut, uint256 gasEstimate)"]),yn=new Ne(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"])});import mt from"node:fs";import{createCipheriv as Fe,createDecipheriv as $e,randomBytes as V,scryptSync as De,timingSafeEqual as Et}from"node:crypto";import{chmodSync as Ue,readFileSync as xt,writeFileSync as Pe}from"node:fs";var O="ORACLE-VAULT",H=1,ce=1<<17,ue=8,le=1,qe=256*1024*1024,de=32,Me=32,Ve=12;function pe(e,t,o={}){let r=String(e??"");if(r.length<8)throw new Error("local-vault: passphrase must be at least 8 characters");return De(r,t,de,{N:o.N??ce,r:o.r??ue,p:o.p??le,maxmem:qe})}function ie(e,t,o){let r=V(Ve),n=Fe("aes-256-gcm",e,r);o&&n.setAAD(Buffer.from(o,"utf8"));let i=Buffer.concat([n.update(t),n.final()]);return{iv:r.toString("base64"),ct:i.toString("base64"),tag:n.getAuthTag().toString("base64")}}function se(e,t,o){let r=$e("aes-256-gcm",e,Buffer.from(t.iv,"base64"));return o&&r.setAAD(Buffer.from(o,"utf8")),r.setAuthTag(Buffer.from(t.tag,"base64")),Buffer.concat([r.update(Buffer.from(t.ct,"base64")),r.final()])}function W(e,t,o={}){let r=Buffer.isBuffer(e)?e:Buffer.from(String(e),"utf8");if(r.length===0)throw new Error("local-vault: refusing to encrypt empty key material");let n=V(Me),i=pe(t,n),a=V(de),s={magic:O,version:H,kdf:{name:"scrypt",N:ce,r:ue,p:le,salt:n.toString("base64")},cipher:"aes-256-gcm",meta:{label:o.label?String(o.label):null,kind:o.kind?String(o.kind):null,address:o.address?String(o.address):null,createdAt:new Date().toISOString()}},u=JSON.stringify(s),d=ie(i,a,u),b=ie(a,r,u);return a.fill(0),i.fill(0),r.fill(0),{...s,wrappedDek:d,payload:b}}function T(e,t){if(!e||e.magic!==O)throw new Error("local-vault: not an Oracle vault file");if(Number(e.version)!==H)throw new Error(`local-vault: unsupported vault version ${e.version}`);let o=e.kdf||{};if(o.name!=="scrypt")throw new Error(`local-vault: unsupported kdf ${o.name}`);let{wrappedDek:r,payload:n,...i}=e,a=JSON.stringify(i),s=pe(t,Buffer.from(o.salt,"base64"),o),u;try{u=se(s,r,a)}catch{throw s.fill(0),new Error("local-vault: wrong passphrase or tampered vault")}s.fill(0);try{return se(u,n,a)}catch{throw new Error("local-vault: vault payload failed authentication")}finally{u.fill(0)}}function L(e){try{return(typeof e=="string"?JSON.parse(e):e)?.magic===O}catch{return!1}}function j(e,t,{exclusive:o=!1}={}){return Pe(e,JSON.stringify(t,null,2)+`
|
|
2
|
+
`,{mode:384,flag:o?"wx":"w"}),Ue(e,384),e}import l from"node:fs";import R from"node:fs";import He from"node:os";import w from"node:path";function fe(e=process.env){return e.ORACLE_CONFIG_DIR?w.resolve(e.ORACLE_CONFIG_DIR):e.ORACLE_FAKE_HOME?w.join(w.resolve(e.ORACLE_FAKE_HOME),".config","oracle"):w.join(He.homedir(),".config","oracle")}function B(e=process.env){let t=fe(e);R.mkdirSync(t,{recursive:!0,mode:448});try{R.chmodSync(t,448)}catch{}return t}function y(e=process.env){return w.join(B(e),"keys","default.vault")}function v(e=process.env){return w.join(B(e),"local-session.json")}function G(e=process.env){return w.join(B(e),"local-arm.json")}function me(e=process.env){let t=w.join(B(e),"keys");R.mkdirSync(t,{recursive:!0,mode:448});try{R.chmodSync(t,448)}catch{}return t}var he=1800*1e3;function K(e){return JSON.parse(l.readFileSync(e,"utf8"))}function we(e,t){l.writeFileSync(e,JSON.stringify(t,null,2)+`
|
|
3
|
+
`,{mode:384});try{l.chmodSync(e,384)}catch{}}function C(e=process.env){let t=e.ORACLE_VAULT_PATH||y(e),o=v(e),r=G(e),n=!1,i=null;try{l.existsSync(t)&&(n=!0,i=JSON.parse(l.readFileSync(t,"utf8"))?.meta||null)}catch{n=l.existsSync(t)}let a=!1,s=null,u=null;try{if(l.existsSync(o)){let x=K(o);x?.expiresAt&&Date.parse(x.expiresAt)>Date.now()&&x?.vaultPath&&(a=!0,s=x.expiresAt,u=x.address||null)}}catch{a=!1}let d=!1,b=null;try{l.existsSync(r)&&(b=K(r),d=b?.armed===!0,d&&b.expiresAt&&Date.parse(b.expiresAt)<=Date.now()&&(d=!1))}catch{d=!1}return{vaultPath:t,vaultExists:n,vaultMeta:i,unlocked:a,sessionExpiresAt:s,address:u,armed:d,arm:b,plane:"local-self-custody",note:"Keys never leave this machine. Public HTTP plane stays prepare-only."}}function z({secret:e,passphrase:t,label:o="default",kind:r="evm-private-key",address:n=null,vaultPath:i,env:a=process.env,exclusive:s=!0}={}){if(!e)throw new Error("local-vault: secret required");if(!t)throw new Error("local-vault: passphrase required");me(a);let u=i||a.ORACLE_VAULT_PATH||y(a);l.mkdirSync(je(u),{recursive:!0,mode:448});let d=W(e,t,{label:o,kind:r,address:n?String(n):null});return j(u,d,{exclusive:s}),{ok:!0,vaultPath:u,label:o,kind:r,address:n||d.meta?.address||null}}function je(e){return e.replace(/[/\\][^/\\]+$/,"")||"."}function F({passphrase:e,vaultPath:t,ttlMs:o=he,env:r=process.env,address:n=null}={}){let i=t||r.ORACLE_VAULT_PATH||y(r);if(!l.existsSync(i))throw new Error(`local-vault: no vault at ${i} \u2014 run oracle vault import`);let a=l.readFileSync(i,"utf8");if(!L(a))throw new Error("local-vault: vault file is not an Oracle vault envelope");T(JSON.parse(a),e).fill(0);let u=new Date(Date.now()+Math.max(6e4,Number(o)||he)).toISOString(),d=JSON.parse(a)?.meta||{};return we(v(r),{magic:"ORACLE-LOCAL-SESSION",version:1,vaultPath:i,address:n||d.address||null,unlockedAt:new Date().toISOString(),expiresAt:u}),{ok:!0,expiresAt:u,vaultPath:i,address:n||d.address||null}}function X(e=process.env){let t=v(e);if(l.existsSync(t)){try{we(t,{locked:!0,at:new Date().toISOString()})}catch{}l.unlinkSync(t)}return{ok:!0,locked:!0}}function k(e=process.env,t={}){let o=v(e);if(!l.existsSync(o))throw new Error("local-vault: locked \u2014 run oracle vault unlock");let r=K(o);if(!r?.vaultPath||!r.expiresAt||Date.parse(r.expiresAt)<=Date.now()){try{l.unlinkSync(o)}catch{}throw new Error("local-vault: session expired \u2014 run oracle vault unlock")}let n=t.passphrase??e.ORACLE_LOCAL_VAULT_PASS;if(!n)throw new Error("local-vault: passphrase required to decrypt vault for signing");let i=r.vaultPath||e.ORACLE_VAULT_PATH||y(e),a=l.readFileSync(i,"utf8");if(!L(a))throw new Error("local-vault: vault file is not an Oracle vault envelope");let s=T(JSON.parse(a),n),u=s.toString("utf8").trim();return s.fill(0),{material:u,address:r.address||null,expiresAt:r.expiresAt,vaultPath:i}}import{Wallet as vi,JsonRpcProvider as Si,getAddress as Ii,isAddress as Ci,parseUnits as ki}from"ethers";var Tt=Object.freeze(["blockNumber","nativeBalance","tokenBalance","resolveToken","resolvePools","scanBlocks","scoreRisk","quote","sellSimulation","prepareUnsignedTx"]),Y=Object.freeze({LIVE:"LIVE",CACHED:"CACHED",STALE:"STALE",UNKNOWN:"UNKNOWN",UNAVAILABLE:"UNAVAILABLE"}),J=Object.freeze({PASS:"PASS",CAUTION:"CAUTION",FAIL:"FAIL",UNKNOWN:"UNKNOWN"});var Ge=Object.freeze({FULL:"FULL",NO_GAS:"NO_GAS",FAILED:"FAILED"});Ee();Ae();xe();m();f();ee();h();ve();te();_e();m();var jn=Object.freeze({across:["across"],relay:["relaychain","relay"],lifi:["jumper-(li.fi-powered)","lifi"],stargate:["stargate-v2","stargate-v1","stargate"],hop:["hop-protocol","hop"],debridge:["debridge"],synapse:["synapse"],connext:["connext"],cbridge:["celer-bridge","celer-cbridge","cbridge"],celer:["celer-bridge","celer-cbridge","cbridge"],squid:["squid"],symbiosis:["symbiosis"],wormhole:["wormhole"],mayan:["mayan"],allbridge:["allbridge"],thorchain:["thorchain"]});$();h();var uo=Object.freeze({TRANSACTION:"unsigned-transaction",TYPED_DATA_ORDER:"typed-data-order"});var lo=new Set(["0x0000000000000000000000000000000000000000","0x000000000000000000000000000000000000dead","0x0000000000000000000000000000000000000001","0x00000000000000000000000000000000000a1ce5"].map(e=>e.toLowerCase()));I();q();I();I();var Fo=Object.freeze([{key:"ethereum",chainId:1,name:"Ethereum",rpcEnv:["ETH_RPC_URL","ETHEREUM_RPC_URL","MAINNET_RPC_URL"],nativeCurrency:{symbol:"ETH",decimals:18},explorer:"https://etherscan.io",dexscreenerSlug:"ethereum",venueKind:"uniswap-v3",wrappedNative:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",venues:[{kind:"quoter",address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",label:"Uniswap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle returned a live sane price (WETH->USDC fee 500 quoted 1908.71 USDC). A contract that correctly prices a known pair IS a working V3 quoter",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:1}},{kind:"router",address:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",label:"Uniswap V3 SwapRouter02",verified:{method:"eth_getCode returned real bytecode on this chain and the paired quoter at the same deployment passed a live functional quote",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:1}}]},{key:"optimism",chainId:10,name:"OP Mainnet",rpcEnv:["OPTIMISM_RPC_URL","OP_RPC_URL"],nativeCurrency:{symbol:"ETH",decimals:18},explorer:"https://optimistic.etherscan.io",dexscreenerSlug:"optimism",venueKind:"uniswap-v3",wrappedNative:"0x4200000000000000000000000000000000000006",venues:[{kind:"quoter",address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",label:"Uniswap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle returned a live sane price (WETH->USDC fee 500 quoted 1905.23 USDC). A contract that correctly prices a known pair IS a working V3 quoter",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:10}},{kind:"router",address:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",label:"Uniswap V3 SwapRouter02",verified:{method:"eth_getCode returned real bytecode on this chain and the paired quoter at the same deployment passed a live functional quote",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:10}}]},{key:"bsc",chainId:56,name:"BNB Smart Chain",rpcEnv:["BSC_RPC_URL","BNB_RPC_URL"],nativeCurrency:{symbol:"BNB",decimals:18},explorer:"https://bscscan.com",dexscreenerSlug:"bsc",venueKind:"uniswap-v3",wrappedNative:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",venues:[{kind:"quoter",address:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",label:"Uniswap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle returned a live sane price (WBNB->USDC fee 500 quoted 413.86 USDC). A contract that correctly prices a known pair IS a working V3 quoter",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:56}},{kind:"router",address:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2",label:"Uniswap V3 SwapRouter02",verified:{method:"eth_getCode returned real bytecode on this chain and the paired quoter at the same deployment passed a live functional quote",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:56}}]},{key:"polygon",chainId:137,name:"Polygon",rpcEnv:["POLYGON_RPC_URL","POLYGON_RPC"],nativeCurrency:{symbol:"POL",decimals:18},explorer:"https://polygonscan.com",dexscreenerSlug:"polygon",venueKind:"uniswap-v3",wrappedNative:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",venues:[{kind:"quoter",address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",label:"Uniswap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle returned a live sane price (WMATIC->USDC fee 500 quoted 0.0720 USDC). A contract that correctly prices a known pair IS a working V3 quoter",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:137}},{kind:"router",address:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",label:"Uniswap V3 SwapRouter02",verified:{method:"eth_getCode returned real bytecode on this chain and the paired quoter at the same deployment passed a live functional quote",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:137}}]},{key:"stable",chainId:988,name:"Stable Mainnet",rpcEnv:["STABLE_RPC_URL","STABLE_RPC"],nativeCurrency:{symbol:"USDT0",decimals:18},venueKind:"uniswap-v3",wrappedNative:"0x5d442b349590a6048Eb2dC0eC346cAA5F47A9ab5",venues:[{kind:"quoter",address:"0xb070179E7032CdA868b53e6C1742F80c9e940d1A",label:"Uniswap V3 QuoterV2 (canonical)",verified:{method:"Stable is on the OFFICIAL Uniswap v3 Deployments List (governance-recognised 2026-05-12, UAC process completed 2026-04, deployed by Protofire), so this is a canonical deployment rather than a fork. eth_getCode returned 8273 bytes, the same size as the canonical quoter on the seven already-verified chains. Functional probe on a live pool (TOAST -> USDT0, fee 10000): 100 in -> 0.000003, 1000 -> 0.000031, 10000 -> 0.000319 USDT0. Output scales monotonically with input, which is a working quoter answering, not a revert. Two of three sampled pools carry non-zero liquidity. NOTE: the pools discovered so far are thin, so real routing size is limited -- the venue is proved, deep liquidity is not.",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-08-05",chainId:988}},{kind:"router",address:"0x32eaf9B5d5F2CD7361c5012890C943D7de84C22a",label:"Uniswap SwapRouter02 (canonical)",verified:{method:"eth_getCode returned 24497 bytes. Cross-checked on-chain rather than trusted from docs: router.factory() returns 0x88f0a512ef09175d456bc9547f914f48c013e4aa, the same v3 core factory that created the pools quoted above, and router.WETH9() returns the wrappedNative recorded on this chain entry. Address published in the Stable docs DEX reference and the Uniswap deployments list.",source:"docs.stable.xyz/en/reference/dexes + on-chain factory()/WETH9() round-trip",date:"2026-08-05",chainId:988}}]},{key:"hyperevm",chainId:999,name:"HyperEVM",rpcEnv:["HYPEREVM_RPC_URL","HYPER_EVM_RPC"],nativeCurrency:{symbol:"HYPE",decimals:18},dexscreenerSlug:"hyperevm",venueKind:"uniswap-v3",wrappedNative:"0x5555555555555555555555555555555555555555",venues:[{kind:"quoter",address:"0x03A918028f22D9E1473B7959C927AD7425A45C7C",label:"HyperSwap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle(1 WHYPE -> USDT0) returned live output on all four fee tiers (100: 57.3385, 500: 57.4187, 3000: 57.3237, 10000: 56.1963 USDT0). Decimals read on-chain: WHYPE 18, USDT0 6. Best tier checked against an INDEPENDENT control the same minute -- Hyperliquid allMids put HYPE at 57.3205, so the pool is 0.171% from the perp mid, which is the right shape for fee plus impact rather than a wrong contract or a decimals bug.",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-08-05",chainId:999}},{kind:"router",address:"0x4E2960a8cd19B467b82d26D83fAcb0fAE26b094D",label:"HyperSwap V3 SwapRouter",verified:{method:"eth_getCode returned 12070 bytes, and it is the router paired with the quoter proved above -- the same pair already shipped in UNI_V3_VENUES[999].hyperswap, which is the map the quote/prepare path actually routes through.",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-08-05",chainId:999}}]},{key:"abstract",chainId:2741,name:"Abstract",rpcEnv:["ABSTRACT_RPC_URL","ABS_RPC_URL"],nativeCurrency:{symbol:"ETH",decimals:18},venueKind:"uniswap-v3",wrappedNative:"0x3439153EB7AF838Ad19d56E1571FBD09333C2809",venues:[{kind:"quoter",address:"0x728BD3eC25D5EDBafebB84F3d67367Cd9EBC7693",label:"Uniswap V3 QuoterV2 (Abstract deployment)",verified:{method:"Abstract is a ZK-stack chain, so CREATE2 addresses differ and the canonical Uniswap addresses are NOT valid here -- probing them returns codesize 0, which is what previously made this chain look like it had no V3 at all. Found the real deployment from live traffic instead: scanned recent Swap(...) logs, took the busiest pool, read pool.factory() = 0xa1160e73b63f322ae88cc2d8e700833e71d0b2a1, then enumerated that factory's deployer (0xf3d63166F0Ca56C3c1A3508FcE03Ff0Cf3Fb691e) and probed each of its 56 contracts with a real quoteExactInputSingle call. Exactly one answered: 1 WETH -> 1846.475731 USDC.e at fee 500. Independent sanity check: the pool's own slot0() spot price is 1873.11 USDC.e per WETH, so the quoter sits ~1.4% below spot, the right shape for fee plus price impact on this size.",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-08-05",chainId:2741}},{kind:"router",address:"0x7712FA47387542819d4E35A23f8116C90C18767C",label:"Uniswap SwapRouter02 (Abstract deployment)",verified:{method:"eth_getCode returned 167392 bytes and the runtime contains the exactInputSingle selector. router.factory() matches the factory proved above and router.WETH9() matches the wrappedNative on this entry. Chosen over its byte-identical twin (0xfD6257F4...) because this is the address real users actually route through: it appeared as tx.to on live swaps against the WETH/USDC.e pool.",source:"on-chain factory()/WETH9() round-trip + live swap tx.to sampling",date:"2026-08-05",chainId:2741}}]},{key:"robinhood",chainId:4663,name:"Robinhood Chain",rpcEnv:["RH_CHAIN_RPC","ROBINHOOD_RPC_URL"],nativeCurrency:{symbol:"ETH",decimals:18},dexscreenerSlug:"robinhood",venueKind:"uniswap-v3",wrappedNative:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",venues:[{kind:"quoter",address:"0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7",label:"Uniswap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle returned a live sane price (WETH->USDG fee 100 quoted 1866.58 USDG, and USDG->CASHCAT fee 10000 quoted a live amount). A contract that correctly prices known pairs IS a working V3 quoter",source:"live eth_call against rpc.mainnet.chain.robinhood.com",date:"2026-07-31",chainId:4663}},{kind:"router",address:"0xcaf681a66d020601342297493863e78c959e5cb2",label:"Uniswap V3 SwapRouter02",verified:{method:"eth_getCode returned real bytecode (24497 bytes) on this chain and the paired quoter at the same deployment passed a live functional quote",source:"live eth_getCode against rpc.mainnet.chain.robinhood.com",date:"2026-07-31",chainId:4663}},{kind:"factory",address:"0x1f7d7550b1b028f7571e69a784071f0205fd2efa",label:"Uniswap V3 Factory",verified:{method:"eth_getCode returned real bytecode (24535 bytes) and a PoolCreated log scan over this factory returned 76 pools in ~9000 recent blocks",source:"live eth_getLogs against rpc.mainnet.chain.robinhood.com",date:"2026-07-31",chainId:4663}}]},{key:"base",chainId:8453,name:"Base",rpcEnv:["BASE_RPC_URL"],nativeCurrency:{symbol:"ETH",decimals:18},explorer:"https://basescan.org",dexscreenerSlug:"base",venueKind:"uniswap-v3",wrappedNative:"0x4200000000000000000000000000000000000006",venues:[{kind:"quoter",address:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",label:"Uniswap V3 QuoterV2 (Base)",verified:{method:"functional probe: quoteExactInputSingle returned WETH->USDC at fee 500 = 1908.44 USDC, a live sane price. The canonical mainnet quoter address also has bytecode on Base but does NOT price this pair, which is exactly the false positive a codesize-only check accepts",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:8453}},{kind:"router",address:"0x2626664c2603336E57B271c5C0b26F421741e481",label:"Uniswap V3 SwapRouter02 (Base)",verified:{method:"eth_getCode returned real bytecode and the paired Base quoter passed a live functional quote",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:8453}},{kind:"router-v2",address:"0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24",label:"Uniswap V2 Router02 (Base)",verified:{method:"eth_getCode returned 17891 bytes; live getAmountsOut on WETH->USDC round-tripped to 98.75% (2x0.30% fee + impact)",source:"https://docs.uniswap.org/contracts/v2/reference/smart-contracts/v2-deployments",date:"2026-07-30",chainId:8453}}]},{key:"arbitrum",chainId:42161,name:"Arbitrum One",rpcEnv:["ARBITRUM_RPC_URL","ARB_RPC_URL"],nativeCurrency:{symbol:"ETH",decimals:18},explorer:"https://arbiscan.io",dexscreenerSlug:"arbitrum",venueKind:"uniswap-v3",wrappedNative:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",venues:[{kind:"quoter",address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",label:"Uniswap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle returned a live sane price (WETH->USDC fee 500 quoted 1908.72 USDC). A contract that correctly prices a known pair IS a working V3 quoter",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:42161}},{kind:"router",address:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",label:"Uniswap V3 SwapRouter02",verified:{method:"eth_getCode returned real bytecode on this chain and the paired quoter at the same deployment passed a live functional quote",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:42161}}]},{key:"avalanche",chainId:43114,name:"Avalanche C-Chain",rpcEnv:["AVALANCHE_RPC_URL","AVAX_RPC_URL"],nativeCurrency:{symbol:"AVAX",decimals:18},explorer:"https://snowtrace.io",dexscreenerSlug:"avalanche",venueKind:"uniswap-v3",wrappedNative:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",venues:[{kind:"quoter",address:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",label:"Uniswap V3 QuoterV2",verified:{method:"functional probe, not a codesize check: quoteExactInputSingle returned a live sane price (WAVAX->USDC fee 500 quoted 6.48 USDC). A contract that correctly prices a known pair IS a working V3 quoter",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:43114}},{kind:"router",address:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE",label:"Uniswap V3 SwapRouter02",verified:{method:"eth_getCode returned real bytecode on this chain and the paired quoter at the same deployment passed a live functional quote",source:"scripts/verify-v3-venues.mjs (re-runnable)",date:"2026-07-30",chainId:43114}}]}]);te();P();import{homedir as re}from"node:os";import{join as ne}from"node:path";var Oe=process.env.ORACLE_PUBLIC_DESKTOP==="1",rt=Oe?process.env.ORACLE_CONFIG_DIR||ne(re(),".config","oracle"):ne(re(),".config","oracle"),Xo=Oe?rt:ne(re(),".config","mad-desk");f();import{Interface as st,MaxUint256 as va,isAddress as Sa,keccak256 as Ia,toUtf8Bytes as Ca}from"ethers";import{Interface as at,isAddress as oa}from"ethers";f();N();g();import{isAddress as Qo}from"ethers";N();g();var ca=new at(["function approve(address spender,uint256 amount) returns (bool)"]);import{Interface as it,isAddress as da}from"ethers";N();g();var ha=new it(["function approve(address spender,uint256 amount) returns (bool)"]),wa=Object.freeze({42161:"0x1c3fa76e6e1088bce750f23a5bfcffa1efef6a41",43114:"0x8f550e53dfe96c055d5bdb267c21f268fcaf63b2"});g();var La=new st(["function approve(address spender,uint256 amount) returns (bool)"]);import{Interface as ct,isAddress as Fa}from"ethers";g();var Ua=new ct(["function setApprovalForAll(address operator,bool approved)"]);import{Interface as ut,MaxUint256 as Ma,isAddress as Va}from"ethers";var Ha=new ut(["function transfer(address to,uint256 amount) returns (bool)","function transferFrom(address from,address to,uint256 amount) returns (bool)"]);import{isAddress as wi}from"ethers";import{Wallet as Di,JsonRpcProvider as Ui,getAddress as Pi,isAddress as qi,parseUnits as Mi}from"ethers";P();import{Wallet as Re}from"ethers";var oe=`oracle vault <import|unlock|lock|status>
|
|
4
|
+
|
|
5
|
+
Local self-custody vault on THIS machine (not Oracle cloud).
|
|
6
|
+
|
|
7
|
+
oracle vault import --key-file ./key.txt --pass-env ORACLE_LOCAL_VAULT_PASS
|
|
8
|
+
oracle vault import --key-env ORACLE_LOCAL_PRIVATE_KEY --pass-env ORACLE_LOCAL_VAULT_PASS
|
|
9
|
+
oracle vault unlock --pass-env ORACLE_LOCAL_VAULT_PASS [--ttl-min 30]
|
|
10
|
+
oracle vault lock
|
|
11
|
+
oracle vault status
|
|
12
|
+
`;function p(e,t){let o=e.find(n=>n.startsWith(`--${t}=`));if(o)return o.split("=").slice(1).join("=");let r=e.indexOf(`--${t}`);return r>=0&&e[r+1]&&!e[r+1].startsWith("--")?e[r+1]:null}function ht(e,t){return e.includes(`--${t}`)}function Be(e){let t=p(e,"pass-env");if(t){let r=process.env[t];if(!r)throw new Error(`env ${t} is empty`);return r}if(p(e,"pass")||p(e,"passphrase"))throw new Error("raw passphrase flags are disabled; use --pass-env so secrets stay out of shell history");if(process.env.ORACLE_LOCAL_VAULT_PASS)return process.env.ORACLE_LOCAL_VAULT_PASS;throw new Error("passphrase required: --pass-env or ORACLE_LOCAL_VAULT_PASS")}function wt(e){if(p(e,"key")||p(e,"private-key"))throw new Error("raw private-key flags are disabled; use --key-file or --key-env so secrets stay out of shell history");let o=p(e,"key-env");if(o){let n=process.env[o];if(!n)throw new Error(`env ${o} is empty`);return n.trim()}let r=p(e,"key-file");return r?mt.readFileSync(r,"utf8").trim():null}function ae(e){let t=String(e).trim();return!t.startsWith("0x")&&/^[0-9a-fA-F]{64}$/.test(t)&&(t=`0x${t}`),t}var ls={name:"vault",summary:"local encrypted key vault (self-host sign)",group:"local",usage:oe,async run(e){let t=e.argv||[];if(!t.length||t.includes("--help")||t.includes("-h"))return process.stdout.write(oe+`
|
|
13
|
+
`),0;let o=t.find(n=>!n.startsWith("--")),r=t.filter(n=>n!==o);if(o==="status"){let n=C();return r.includes("--json")?process.stdout.write(JSON.stringify(n,null,2)+`
|
|
14
|
+
`):(process.stdout.write(`vault: ${n.vaultPath}
|
|
15
|
+
`),process.stdout.write(`exists: ${n.vaultExists}
|
|
16
|
+
`),process.stdout.write(`unlocked: ${n.unlocked}${n.sessionExpiresAt?` until ${n.sessionExpiresAt}`:""}
|
|
17
|
+
`),process.stdout.write(`address: ${n.address||"-"}
|
|
18
|
+
`),process.stdout.write(`armed: ${n.armed}
|
|
19
|
+
`),process.stdout.write(`${n.note}
|
|
20
|
+
`)),0}if(o==="import")try{let n=wt(r);if(!n)throw new Error("--key or --key-file required");let i=Be(r),a=p(r,"address");try{a=a||new Re(ae(n)).address}catch{}let s=z({secret:ae(n),passphrase:i,label:p(r,"label")||"default",address:a,exclusive:!ht(r,"force")});return process.stdout.write(`imported ${s.vaultPath}
|
|
21
|
+
`),s.address&&process.stdout.write(`address ${s.address}
|
|
22
|
+
`),process.stdout.write(`next: oracle vault unlock && oracle arm --max 0.05 --chain base
|
|
23
|
+
`),0}catch(n){return process.stderr.write(`error: ${n.message}
|
|
24
|
+
`),1}if(o==="unlock")try{let n=Be(r),i=Number(p(r,"ttl-min")||30);F({passphrase:n,ttlMs:i*6e4,vaultPath:p(r,"vault")||void 0});let a=k(process.env,{passphrase:n}),s=a.address;try{s=new Re(ae(a.material)).address,F({passphrase:n,ttlMs:i*6e4,vaultPath:p(r,"vault")||void 0,address:s})}catch{}return process.stdout.write(`unlocked ${s||""}
|
|
25
|
+
`.trim()+`
|
|
26
|
+
`),0}catch(n){return process.stderr.write(`error: ${n.message}
|
|
27
|
+
`),1}return o==="lock"?(X(),process.stdout.write(`locked
|
|
28
|
+
`),0):(process.stderr.write(oe+`
|
|
29
|
+
`),1)}};export{ls as default};
|