@oracle-agent/oracle 0.35.44 → 0.35.45

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.
Files changed (64) hide show
  1. package/dist/agent-sessions.mjs +24 -24
  2. package/dist/assets/skills/oracle-desk-product/SKILL.md +1 -1
  3. package/dist/bin/desk-server.mjs +26 -26
  4. package/dist/bin/oracle-data-mcp.mjs +14 -14
  5. package/dist/bin/oracle-gateway.mjs +47 -47
  6. package/dist/bin/oracle-investigate.mjs +4 -4
  7. package/dist/bin/oracle-launch-radar-shadow.mjs +5 -5
  8. package/dist/bin/oracle-mev-arb-shadow.mjs +5 -5
  9. package/dist/bin/oracle-mev-shadow.mjs +5 -5
  10. package/dist/bin/oracle-public-server.mjs +5 -5
  11. package/dist/bin/oracle-route.mjs +23 -23
  12. package/dist/bin/oracle-scan.mjs +6 -6
  13. package/dist/bin/oracle.mjs +1 -0
  14. package/dist/cli/commands/account.mjs +39 -0
  15. package/dist/cli/commands/agent-session.mjs +23 -23
  16. package/dist/cli/commands/airdrop.mjs +7 -7
  17. package/dist/cli/commands/chat.mjs +198 -198
  18. package/dist/cli/commands/data.mjs +29 -29
  19. package/dist/cli/commands/doctor.mjs +7 -7
  20. package/dist/cli/commands/eval.mjs +123 -123
  21. package/dist/cli/commands/farm.mjs +16 -16
  22. package/dist/cli/commands/follow.mjs +36 -36
  23. package/dist/cli/commands/mint.mjs +10 -10
  24. package/dist/cli/commands/model.mjs +205 -205
  25. package/dist/cli/commands/quickstart.mjs +6 -6
  26. package/dist/cli/commands/receipt.mjs +11 -11
  27. package/dist/cli/commands/resolve.mjs +9 -9
  28. package/dist/cli/commands/session-vault.mjs +5 -5
  29. package/dist/cli/commands/sign.mjs +12 -12
  30. package/dist/cli/commands/signer.mjs +25 -25
  31. package/dist/cli/commands/snipe.mjs +7 -7
  32. package/dist/cli/commands/strategy.mjs +5 -5
  33. package/dist/cli/commands/swap.mjs +14 -14
  34. package/dist/cli/commands/venues.mjs +2 -2
  35. package/dist/data/desk-data.mjs +24 -24
  36. package/dist/data/names.mjs +3 -3
  37. package/dist/data/providers/farming.mjs +2 -2
  38. package/dist/data/providers/lp-destination-discovery.mjs +4 -4
  39. package/dist/index.mjs +44 -44
  40. package/dist/investigator/index.mjs +2 -2
  41. package/dist/launch-radar/index.mjs +5 -5
  42. package/dist/local-signer/anvil-attestation-worker.mjs +1 -1
  43. package/dist/local-signer/index.mjs +7 -3
  44. package/dist/local-signer/runtime.mjs +22 -22
  45. package/dist/nft/universal-mint-router.mjs +4 -4
  46. package/dist/notifications/index.mjs +7 -7
  47. package/dist/router/index.mjs +3 -3
  48. package/dist/router/prepare-bridge.mjs +2 -2
  49. package/dist/router/prepare-route.mjs +3 -3
  50. package/dist/scanner/index.mjs +4 -4
  51. package/dist/strategy/index.mjs +3 -3
  52. package/dist/tui/standalone-client.mjs +85 -85
  53. package/package.json +1 -1
  54. package/public/oracle-splash/docs/browser-and-web/index.html +2 -2
  55. package/public/oracle-splash/docs/connectors/index.html +2 -2
  56. package/public/oracle-splash/docs/getting-started/index.html +2 -2
  57. package/public/oracle-splash/docs/index.html +3 -3
  58. package/public/oracle-splash/docs/reference/index.html +2 -2
  59. package/public/oracle-splash/docs/security/index.html +2 -2
  60. package/public/oracle-splash/docs/using-oracle/index.html +2 -2
  61. package/public/oracle-splash/download/index.html +3 -3
  62. package/public/oracle-splash/downloads/index.html +1 -1
  63. package/public/oracle-splash/index.html +6 -6
  64. package/server.json +2 -2
@@ -1,11 +1,11 @@
1
- var Ei=Object.defineProperty;var l=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var Je=(e,t)=>{for(var r in t)Ei(e,r,{get:t[r],enumerable:!0})};import Ye from"node:fs";import Si from"node:os";import ge from"node:path";import{fileURLToPath as xi}from"node:url";function vt(){return process.env.ORACLE_FAKE_HOME||Si.homedir()}function Ai(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function ye(){return Ai()?process.env.ORACLE_CONFIG_DIR||ge.join(vt(),".config","oracle"):ge.join(vt(),".config","oracle")}function Ii(){return ge.join(ye(),"desk.json")}function ki(){return ge.join(ye(),"env")}function we({force:e=!1}={}){if(we._done&&!e)return we._result||null;we._done=!0;let t={},r=(o,i)=>{if(i==null)return;let s=String(i).trim();s&&(process.env[o]!=null&&String(process.env[o]).trim()!==""||(process.env[o]=s,t[o]=s))};try{let o=ki();if(Ye.existsSync(o))for(let i of Ye.readFileSync(o,"utf8").split(/\r?\n/)){let s=i.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!s||s[2].startsWith("#"))continue;let p=s[2];(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))&&(p=p.slice(1,-1)),r(s[1],p)}}catch{}try{let o=Ii();if(Ye.existsSync(o)){let i=JSON.parse(Ye.readFileSync(o,"utf8"));i&&typeof i=="object"&&(r("ORACLE_DESK_URL",i.deskUrl||i.dataUrl||i.url),r("ORACLE_DATA_URL",i.dataUrl||i.deskUrl||i.url),r("ORACLE_API_URL",i.apiUrl||i.dataUrl||i.deskUrl),r("ORACLE_PUBLIC_URL",i.publicUrl||i.deskUrl||i.dataUrl),r("ORACLE_EXEC_URL",i.execUrl),r("MAD_DESK_URL",i.deskUrl||i.dataUrl))}}catch{}let n=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return n&&(r("ORACLE_DESK_URL",n),r("ORACLE_DATA_URL",n),r("ORACLE_API_URL",n),r("ORACLE_PUBLIC_URL",n),r("MAD_DESK_URL",n)),we._result=Object.keys(t).length?t:null,we._result}var vi,L,Xe=l(()=>{vi=ge.dirname(xi(import.meta.url)),L=ge.resolve(vi,"../..");try{we()}catch{}});import{AsyncLocalStorage as Vi}from"node:async_hooks";function Qe(e){let t=Ki.getStore();if(!t||t.closed||!Gi.includes(e))return null;if(t.spans.length>=Ji)return t.droppedSpans++,null;let r={stage:e,startMs:t.now()-t.start,durationMs:null,outcome:"pending",status:null};return t.spans.push(r),(n,o=null)=>{t.closed||r.durationMs!==null||(r.durationMs=Math.max(0,t.now()-t.start-r.startMs),r.outcome=n==="succeeded"?"succeeded":"failed",r.status=Number.isInteger(o)&&o>=100&&o<=599?o:null)}}var Ki,Gi,Ji,cn=l(()=>{Ki=new Vi,Gi=["http","retry","shared"],Ji=512});import ue from"node:net";import Yi from"node:dns";function Ze(e){let t=String(e).toLowerCase().split("%")[0];if((t.match(/::/g)||[]).length>1)return null;let r=u=>{if(!u)return[];let d=u.split(":"),h=d.at(-1);if(h?.includes(".")){let m=h.split(".").map(Number);if(m.length!==4||m.some(w=>!Number.isInteger(w)||w<0||w>255))return null;d.splice(d.length-1,1,(m[0]<<8|m[1]).toString(16),(m[2]<<8|m[3]).toString(16))}return d.some(m=>!/^[0-9a-f]{1,4}$/.test(m))?null:d.map(m=>Number.parseInt(m,16))},[n,o]=t.split("::"),i=r(n),s=r(o);if(!i||!s)return null;let p=t.includes("::"),c=8-i.length-s.length;if(!p&&c!==0||p&&c<1)return null;let f=[...i,...Array(Math.max(0,c)).fill(0),...s];return f.length!==8?null:Uint8Array.from(f.flatMap(u=>[u>>8,u&255]))}function Tt(e,t,r){let n=Math.floor(r/8),o=r%8;for(let s=0;s<n;s+=1)if(e[s]!==t[s])return!1;if(!o)return!0;let i=255<<8-o;return(e[n]&i)===(t[n]&i)}function Ct(e){if(ue.isIPv4(e)){let t=e.split(".").map(Number);return!(t[0]===0||t[0]===10||t[0]===127||t[0]>=224||t[0]===100&&t[1]>=64&&t[1]<=127||t[0]===169&&t[1]===254||t[0]===172&&t[1]>=16&&t[1]<=31||t[0]===192&&(t[1]===0||t[1]===2||t[1]===168)||t[0]===192&&t[1]===88&&t[2]===99||t[0]===198&&(t[1]===18||t[1]===19||t[1]===51)||t[0]===203&&t[1]===0&&t[2]===113)}if(ue.isIPv6(e)){let t=Ze(e);if(!t)return!1;let r=Ze("::ffff:0:0");return Tt(t,r,96)?Ct([...t.slice(12)].join(".")):Tt(t,Ze("2000::"),3)?![["2001::",23],["2001:db8::",32],["2001:10::",28],["2001:2::",48],["2002::",16],["3fff::",20]].some(([o,i])=>Tt(t,Ze(o),i)):!1}return!1}function Qi(e){let t;try{t=new URL(String(e))}catch{return{ok:!1,error:`not a valid URL: ${String(e).slice(0,120)}`}}if(t.protocol!=="http:"&&t.protocol!=="https:")return{ok:!1,error:`refused protocol ${t.protocol} (only http/https)`};let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.+$/,"");if(Xi.has(r)||r.endsWith(".localhost")||r.endsWith(".internal"))return{ok:!1,error:`refused internal host ${r}`};let n=ue.isIP(r);return n!==0&&!Ct(r)?{ok:!1,error:`refused private address ${r}`}:{ok:!0,url:t,host:r,isLiteralIp:n!==0}}async function Nt(e,{lookupFn:t=Yi.promises.lookup}={}){let r=Qi(e);if(!r.ok)return r;if(r.isLiteralIp)return{ok:!0,url:r.url,addresses:[{address:r.host,family:ue.isIPv6(r.host)?6:4}]};let n;try{n=await t(r.host,{all:!0,verbatim:!0})}catch{return{ok:!1,error:`refused: ${r.host} did not resolve`}}return!Array.isArray(n)||n.length===0||n.some(o=>!Ct(o.address))?{ok:!1,error:`refused: ${r.host} resolves to a non-public address`}:{ok:!0,url:r.url,addresses:n}}async function Rt({requireUndici:e=!1,importUndici:t=()=>import("undici")}={}){let r,n;try{let d=await t();r=d.Agent,n=d.fetch}catch(d){if(e)throw new Error(`egress-guard: untrustedUrl pinning requires the undici package, which failed to load: ${d?.message||d}`);return null}if(typeof r!="function"||typeof n!="function"){if(e)throw new Error("egress-guard: untrustedUrl pinning requires undici's Agent and fetch exports, which were not found on the imported module");return null}let o=d=>String(d).toLowerCase().replace(/^\[|\]$/g,"").replace(/\.+$/,""),i=new Map,s=d=>(Array.isArray(d)?d:[d]).map(h=>typeof h=="string"?{address:h}:h).filter(h=>h&&h.address).map(h=>({address:h.address,family:h.family||(ue.isIPv6(h.address)?6:4)})),p=(d,h,m)=>{i.set(o(d),s(typeof h=="string"?[{address:h,family:m}]:h))},c=d=>{let h=o(d);if(ue.isIP(h))return[{address:h,family:ue.isIPv6(h)?6:4}];let m=i.get(h);if(!m||!m.length)throw new Error(`refused: unpinned host ${d} during pinned fetch`);return m},f=new r({connect:{lookup(d,h,m){let w;try{w=c(d)}catch(g){return m(g)}return h?.all?m(null,w):m(null,w[0].address,w[0].family)}}}),u=Zi((d,h={})=>n(d,{...h,dispatcher:f}),p);return{dispatcher:f,fetch:u,pin:p,resolve:c,async close(){try{await f.destroy()}catch{}}}}function Zi(e,t){if(typeof e!="function")throw new Error("markPinCapableFetch: fetchImpl must be a function");if(typeof t!="function")throw new Error("markPinCapableFetch: pin must be a function");return e[Lt]=Object.freeze({pin:t}),e}function Pt(e){return typeof e=="function"&&typeof e[Lt]?.pin=="function"}function un(e,t,r){if(!Pt(e))throw new Error("pinFetchToAddresses: fetchImpl is not pin-capable");e[Lt].pin(t,r)}var Xi,Lt,ln=l(()=>{Xi=new Set(["localhost","metadata.google.internal","metadata.goog"]);Lt=Symbol.for("oracle.egressGuard.pinCapableFetch")});import{createHash as ea}from"node:crypto";import{types as te}from"node:util";function C(e){return ie(`HTTP JSON body refused: ${e}`)}function ua(e){return["isArgumentsObject","isArrayBuffer","isAnyArrayBuffer","isArrayBufferView","isBoxedPrimitive","isDataView","isDate","isExternal","isGeneratorObject","isKeyObject","isCryptoKey","isMap","isMapIterator","isModuleNamespaceObject","isNativeError","isPromise","isRegExp","isSet","isSetIterator","isTypedArray","isWeakMap","isWeakSet"].some(t=>typeof te[t]=="function"&&te[t](e))}function la(e){let t=[],r=0,n=0,o=0,i=0,s=new WeakSet,p=u=>{if(r+=Buffer.byteLength(u,"utf8"),r>ee.bytes)throw C("serialized byte limit exceeded");t.push(u)},c=u=>{if(Buffer.byteLength(u,"utf8")>ee.bytes)throw C("serialized byte limit exceeded");return JSON.stringify(u)},f=(u,d)=>{if(n+=1,n>ee.nodes)throw C("node limit exceeded");if(d>ee.depth)throw C("depth limit exceeded");if(u===null){p("null");return}if(typeof u=="string"){p(c(u));return}if(typeof u=="boolean"){p(u?"true":"false");return}if(typeof u=="number"){if(!Number.isFinite(u))throw C("non-finite number");p(Object.is(u,-0)?"0":String(u));return}if(typeof u!="object")throw C("unsupported non-JSON value");if(te.isProxy(u))throw C("proxy value");if(ua(u))throw C("unsupported exotic object");if(s.has(u))throw C("cyclic value");s.add(u);try{if(Object.getOwnPropertySymbols(u).length>0)throw C("symbol-keyed fields are unsupported");if(Array.isArray(u)){let w=Object.getPrototypeOf(u),g=0;for(;w!==null;){if(te.isProxy(w))throw C("proxy array prototype");if(g+=1,g>ee.depth)throw C("array prototype depth limit exceeded");w=Object.getPrototypeOf(w)}if(u.length>ee.arrayLength)throw C("array length limit exceeded");for(let S=0;S<u.length;S+=1){let P=Object.getOwnPropertyDescriptor(u,String(S));if(!P||!Object.hasOwn(P,"value")||P.enumerable!==!0)throw C("array entries must be dense enumerable own data")}let y=0;for(let S in u){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(Object.hasOwn(u,S)&&(y+=1,y>u.length))throw C("named array fields are unsupported")}if(y!==u.length)throw C("array entries must be dense enumerable own data");p("[");for(let S=0;S<u.length;S+=1)S&&p(","),f(Object.getOwnPropertyDescriptor(u,String(S)).value,d+1);p("]");return}let h=Object.getPrototypeOf(u);if(h!==Object.prototype&&h!==null)throw C("non-plain object");let m=[];for(let w in u){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(!Object.hasOwn(u,w))continue;if(o+=1,o>ee.fields)throw C("field limit exceeded");let g=Object.getOwnPropertyDescriptor(u,w);if(!g||!Object.hasOwn(g,"value")||g.enumerable!==!0)throw C("object fields must be enumerable own data");m.push([w,g.value])}p("{");for(let w=0;w<m.length;w+=1)w&&p(","),p(c(m[w][0])),p(":"),f(m[w][1],d+1);p("}")}finally{s.delete(u)}};return f(e,0),t.join("")}function da(e){let t=Object.create(null);if(e==null)return t;if(typeof e!="object"&&typeof e!="function")throw new TypeError("HTTP headers must be an object");if(te.isProxy(e))throw new TypeError("HTTP headers must not be a proxy");if(Object.getOwnPropertySymbols(e).length>0)throw new TypeError("HTTP headers must not contain symbol fields");let r=new Set;for(let n of Object.keys(e)){if(!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u.test(n))throw new TypeError("HTTP header names must be valid tokens");let o=n.toLowerCase();if(r.has(o))throw new TypeError("HTTP headers contain a duplicate canonical name");r.add(o);let i=Object.getOwnPropertyDescriptor(e,n);if(!i||!Object.hasOwn(i,"value"))throw new TypeError("HTTP headers must contain own data properties");let s=i.value;if(s==null||["object","function","symbol"].includes(typeof s))throw new TypeError("HTTP header values must be scalar");t[n]=String(s)}return t}function fa(){return Object.assign(Object.create(null),{Accept:"application/json"})}function pa(e,t){if(!e)throw new Error(`HTTP redirect from ${t} missing Location`);let r=new URL(String(e),String(t));if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`HTTP redirect from ${t} used unsupported protocol ${r.protocol}`);return r.toString()}function ma(e,t){return new URL(String(e)).origin===new URL(String(t)).origin}function et(e){if((typeof e!="object"||e===null)&&typeof e!="function")return`${typeof e}:${String(e)}`;let t=hn.get(e);return t||(t=wn,wn+=1,hn.set(e,t)),`reference:${t}`}function gn(e){if(!e||typeof e!="object"||Array.isArray(e)||!Object.hasOwn(e,"jsonrpc")||!Object.hasOwn(e,"method")||e.jsonrpc!=="2.0")return!1;let t=typeof e.method=="string"?e.method:"";return t?ha.has(t)||/^get[A-Z0-9_]/u.test(t)||/^is[A-Z0-9_]/u.test(t)||/^eth_get[A-Z0-9_]/u.test(t):!1}function yn(e,t){if(e==="GET"&&t==null)return!0;if(e!=="POST"||t==null)return!1;let r=t;if(typeof t=="string")try{r=JSON.parse(t)}catch{return!1}if(Array.isArray(r))return r.length>0&&r.every(gn);if(!r||typeof r!="object")return!1;if(Object.hasOwn(r,"jsonrpc")||Object.hasOwn(r,"method"))return gn(r);let n=Object.hasOwn(r,"type")?r.type:null;return typeof n=="string"&&wa.has(n)&&(!Object.hasOwn(r,"action")||r.action==null)&&(!Object.hasOwn(r,"signature")||r.signature==null)&&(!Object.hasOwn(r,"nonce")||r.nonce==null)}function ga(e,t,r,n={},o=null){let i=ea("sha256"),s=(c,f)=>{let u=String(f);i.update(String(Buffer.byteLength(c,"utf8"))).update(":").update(c),i.update("=").update(String(Buffer.byteLength(u,"utf8"))).update(":").update(u).update(`
2
- `)};s("method",e),s("url",t),Object.keys(r||{}).map((c,f)=>({name:c.toLowerCase(),order:f,value:String(r[c])})).sort((c,f)=>c.name.localeCompare(f.name)||c.order-f.order).forEach((c,f)=>{s(`header-name-${f}`,c.name),s(`header-value-${f}`,c.value)}),s("body",o??"-");for(let c of["untrustedUrl","maxResponseBytes","sameOriginRedirectsOnly","redirectPolicy","maxRedirects","timeoutMs","retries","fetchImpl","realFetch","lookupFn","importUndici","validateResponse"])s(`context-${c}`,n[c]??"-");return i.digest("hex")}function ya(e,t){let r=Number(t);return Number.isFinite(r)&&r>0?Math.min(r*1e3,fn):Math.min(250*2**e,fn)+Math.floor(Math.random()*100)}function ie(e,t={}){let r=new Error(e);return r.retryable=!1,Object.assign(r,t),r}function Bt(e,t,r){return ie(`HTTP response from ${e} exceeded maxResponseBytes ${r} (${t})`,{oversize:!0})}function le(e){try{let t=e?.body?.cancel?.();t&&typeof t.then=="function"&&t.catch(()=>{})}catch{}}function Ea(e){return e?e.byteLength??e.length??0:0}async function Sa(e,t,{url:r,truncate:n=!1,onOversize:o}={}){if(t==null)return await e.text();let i=Number(e.headers?.get?.("content-length"));if(Number.isFinite(i)&&i>t&&(le(e),!n))throw Bt(r,`content-length ${i}`,t);let s=e.body?.getReader?.();if(!s){let d=await e.text(),h=Buffer.byteLength(d,"utf8");if(h>t){if(!n)throw Bt(r,`body ${h} bytes`,t);return Buffer.from(d,"utf8").subarray(0,t).toString("utf8")}return d}let p=[],c=0,f=!1;try{for(;;){let{value:d,done:h}=await s.read();if(h)break;if(d&&(p.push(Buffer.from(d)),c+=Ea(d),c>t)){f=!0;break}}}finally{if(f)try{await s.cancel()}catch{}try{s.releaseLock?.()}catch{}}if(f&&(typeof o=="function"&&o(),!n))throw Bt(r,`streamed ${c} bytes`,t);let u=Buffer.concat(p);return(f?u.subarray(0,t):u).toString("utf8")}function xa(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function va(e,{fetchImpl:t,method:r,headers:n,body:o,timeoutMs:i,lookupFn:s,realFetch:p,untrustedUrl:c=!1,maxResponseBytes:f=null,sameOriginRedirectsOnly:u=!1,importUndici:d,validateResponse:h,signal:m,redirectPolicy:w="follow",maxRedirects:g=tt}){let y=null,S=t,P=s?{lookupFn:s}:{};if(c&&!p&&!Pt(S))throw ie(`HTTP refused ${e}: untrustedUrl requires a pin-capable fetchImpl (see markPinCapableFetch in egress-guard.mjs) or no fetchImpl override so Oracle can pin the connection itself`);let E=new AbortController,A=setTimeout(()=>E.abort(),i),N=m?mn?mn([m,E.signal]):m:E.signal,q=async(v,{status:x=null}={})=>{let _=await Nt(v,P);if(!_.ok)throw ie(x==null?`HTTP refused ${v}: ${_.error}`:`HTTP redirect to ${v} ${_.error}`,x==null?{}:{status:x});let U=new URL(v).hostname;if(p){if(y&&(await y.close(),y=null),!y)try{y=await Rt({requireUndici:!0,...d?{importUndici:d}:{}})}catch(b){throw ie(x==null?`HTTP refused ${v}: ${b?.message||b}`:`HTTP redirect to ${v} refused: ${b?.message||b}`,x==null?{}:{status:x})}y.pin(U,_.addresses),S=y.fetch}else un(S,U,_.addresses);return _};try{let v=String(e),x=Object.assign(Object.create(null),n||{});c&&await q(v);for(let _=0;_<=g;_+=1){let U=Object.assign(Object.create(null),{method:r,headers:x,body:o,signal:N,redirect:"manual",dispatcher:void 0}),b=await S(v,U);if((w==="error"||g===0)&&b.status>=300&&b.status<400)throw le(b),ie(`HTTP ${b.status} ${r} redirect refused`,{status:b.status,redirectRefused:!0});if(ca.has(b.status)){let M=u===!0&&r==="POST"&&[307,308].includes(b.status)&&yn(r,o);if(r!=="GET"&&r!=="HEAD"&&!M){le(b);let R=new Error(`HTTP ${b.status} ${r} ${v} redirected non-idempotent request`);throw R.status=b.status,R}if(_===g)throw le(b),ie(`HTTP ${b.status} ${r} redirect budget exhausted`,{status:b.status,redirectRefused:!0});let Vr=b.headers?.get?.("location"),K;try{K=pa(Vr,v)}catch(R){throw le(b),R}let se=!ma(K,v);if(le(b),se&&r==="POST"){let R=new Error(`HTTP ${b.status} ${r} cross-origin redirect refused`);throw R.status=b.status,R}if(se&&u){let R=new Error(`HTTP ${b.status} ${r} cross-origin redirect refused`);throw R.status=b.status,R.retryable=!1,R}if(se&&(x=fa(x)),c)await q(K,{status:b.status});else if(se){let R=await Nt(K,P);if(!R.ok){let k=new Error(`HTTP redirect from ${v} ${R.error}`);throw k.status=b.status,k.retryable=!1,k}p&&R.addresses?.length&&(y||(y=await Rt(d?{importUndici:d}:{})),y&&(y.pin(new URL(K).hostname,R.addresses),S=y.fetch))}v=K;continue}if(typeof h=="function")try{await h(b,{url:v})}catch(M){throw le(b),ie(M?.message||String(M))}let T=await Sa(b,f,{url:v,onOversize:()=>E.abort()}),Oe=xa(T);if(!b.ok){let M=new Error(`HTTP ${b.status} ${r} ${v}`);throw M.status=b.status,M.retryAfter=b.headers?.get?.("retry-after")??null,M.body=Oe??T.slice(0,300),M}return Oe??T}throw new Error(`HTTP redirect loop for ${e}`)}catch(v){if(E.signal.aborted&&!Ce(m)){let x=v&&(typeof v=="object"||typeof v=="function")&&!te.isProxy(v)?v:null,_=x?Object.getOwnPropertyDescriptor(x,"oversize"):null;if(!(_&&Object.hasOwn(_,"value")&&_.value===!0))try{if(!x)throw new TypeError("unsafe rejection");Object.defineProperties(x,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}})}catch{let b=new Error("HTTP request timed out");throw Object.defineProperties(b,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}}),b}}throw v}finally{clearTimeout(A),y&&await y.close()}}async function V(e,t={}){if(t!=null&&typeof t!="object"&&typeof t!="function")throw new TypeError("HTTP options must be an object");if(t!=null&&te.isProxy(t))throw new TypeError("HTTP options must not be a proxy");let r=new Set(["body","dedupe","fetchImpl","headers","importUndici","lookupFn","maxRedirects","maxResponseBytes","method","redirectPolicy","retries","sameOriginRedirectsOnly","signal","timeoutMs","untrustedUrl","validateResponse"]);if(t!=null){if(Object.getOwnPropertySymbols(t).length>0)throw new TypeError("HTTP options contain unknown fields");for(let k of Object.getOwnPropertyNames(t)){let I=Object.getOwnPropertyDescriptor(t,k);if(!(k==="toJSON"&&I&&Object.hasOwn(I,"value")&&I.value===void 0)){if(!r.has(k))throw new TypeError("HTTP options contain unknown fields");if(!I||!I.enumerable||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain enumerable own data properties")}}}let n=k=>{if(t==null||!Object.hasOwn(t,k))return;let I=Object.getOwnPropertyDescriptor(t,k);if(!I||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain own data properties");return I.value};if(typeof e!="string"||e.length===0||e.length>8192)throw new TypeError("HTTP URL must be a bounded string");let o=n("method");if(o!==void 0&&(typeof o!="string"||!/^[A-Za-z]+$/u.test(o)))throw new TypeError("HTTP method must be a string token");let i=n("timeoutMs");if(i!==void 0&&(!Number.isInteger(i)||i<1||i>12e4))throw new TypeError("HTTP timeoutMs must be a bounded integer");let s=n("retries");if(s!==void 0&&(!Number.isInteger(s)||s<0||s>10))throw new TypeError("HTTP retries must be a bounded integer");let p=n("redirectPolicy");if(p!==void 0&&p!=="follow"&&p!=="error")throw new TypeError('HTTP redirectPolicy must be "follow" or "error"');let c=n("maxRedirects");if(c!==void 0&&(!Number.isInteger(c)||c<0||c>tt))throw new TypeError(`HTTP maxRedirects must be an integer from 0 through ${tt}`);if(p==="error"&&c!==void 0&&c!==0)throw new TypeError('HTTP redirectPolicy "error" requires maxRedirects 0 when supplied');let f=p??"follow",u=f==="error"?0:c??tt;for(let k of["dedupe","untrustedUrl","sameOriginRedirectsOnly"]){let I=n(k);if(I!==void 0&&typeof I!="boolean")throw new TypeError(`HTTP ${k} must be boolean`)}let d=n("maxResponseBytes");if(d!==void 0&&(!Number.isInteger(d)||d<1||d>64*1024*1024))throw new TypeError("HTTP maxResponseBytes must be a bounded integer");let h=n("signal");if(h!==void 0){if(te.isProxy(h)||!(h instanceof AbortSignal))throw new TypeError("HTTP signal must be a native AbortSignal");try{Ce(h)}catch{throw new TypeError("HTTP signal must be a native AbortSignal")}}for(let k of["importUndici","lookupFn","validateResponse"]){let I=n(k);if(I!==void 0&&typeof I!="function")throw new TypeError(`HTTP ${k} must be a function`)}let m=n("fetchImpl"),w=m||globalThis.fetch;if(typeof w!="function")throw new Error("fetch unavailable \u2014 pass opts.fetchImpl");let g=i??12e3,y=(o||"GET").toUpperCase(),S=n("headers"),P=da(S),E=Object.assign(Object.create(null),P);Object.keys(E).some(k=>k.toLowerCase()==="accept")||(E.Accept="application/json");let A=n("body");A!=null&&typeof A!="string"&&(Object.keys(E).find(I=>I.toLowerCase()==="content-type")||(E["Content-Type"]="application/json"),A=la(A));let N=s??ra,q=n("lookupFn"),v=!m,x=n("untrustedUrl")===!0,_=n("sameOriginRedirectsOnly")===!0,U=n("importUndici"),b=n("validateResponse"),T=h,Oe=d??null,M=async()=>{let k;for(let I=0;I<=N;I++){T&&ia.call(T);let Kr=Qe("http");try{let Z=await va(e,{fetchImpl:w,method:y,headers:E,body:A,timeoutMs:g,lookupFn:q,realFetch:v,untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,importUndici:U,validateResponse:b,signal:T,redirectPolicy:f,maxRedirects:u});return Kr?.("succeeded"),Z}catch(Z){k=Z;let he=xt=>{if(!Z||typeof Z!="object"&&typeof Z!="function"||te.isProxy(Z))return;let _e=Object.getOwnPropertyDescriptor(Z,xt);return _e&&Object.hasOwn(_e,"value")?_e.value:void 0},Ge=he("status");Kr?.("failed",Ge);let wi=he("oracleTimeout")===!0||he("name")==="AbortError"||he("name")==="TimeoutError"||Ce(T),gi=new Set([408,425,429]),yi=he("retryable")===!1?!1:Ge!=null?gi.has(Ge)||ta.has(Ge)&&dn.has(y):!wi&&dn.has(y);if(I===N||!yi)throw Z;let Gr=ya(I,he("retryAfter")),bi=Qe("retry"),Jr=!1;try{T?await new Promise((xt,_e)=>{let Yr,Te=()=>{clearTimeout(Yr),pn.call(T,"abort",Te),_e(sa(T)||new DOMException("Aborted","AbortError"))};if(Ce(T)){Te();return}Yr=setTimeout(()=>{pn.call(T,"abort",Te),xt()},Gr),aa.call(T,"abort",Te,{once:!0}),Ce(T)&&Te()}):await ba(Gr),Jr=!0}finally{bi?.(Jr?"succeeded":"failed")}}}throw k};if(!(n("dedupe")!==!1&&!T&&yn(y,A)))return M();let K=ga(y,e,E,{untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,redirectPolicy:f,maxRedirects:u,timeoutMs:g,retries:N,fetchImpl:et(w),realFetch:v,lookupFn:et(q),importUndici:et(U),validateResponse:et(b)},A),se=$t.get(K);if(se){let k=Qe("shared");try{let I=await se;return k?.("succeeded"),I}catch(I){throw k?.("failed"),I}}let R=M().finally(()=>$t.delete(K));return $t.set(K,R),R}var ta,dn,ra,fn,na,oa,ia,aa,pn,mn,Ce,sa,ca,tt,Ju,ee,$t,hn,wn,ha,wa,ba,j=l(()=>{cn();ln();ta=new Set([408,425,429,500,502,503,504]),dn=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]),ra=2,fn=4e3,na=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted")?.get,oa=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"reason")?.get,ia=AbortSignal.prototype.throwIfAborted,aa=EventTarget.prototype.addEventListener,pn=EventTarget.prototype.removeEventListener,mn=typeof AbortSignal.any=="function"?AbortSignal.any.bind(AbortSignal):null,Ce=e=>e?na.call(e):!1,sa=e=>e?oa.call(e):void 0,ca=new Set([301,302,303,307,308]),tt=3,Ju=64*1024,ee=Object.freeze({depth:32,nodes:1e4,fields:1e4,arrayLength:1e4,bytes:1024*1024});$t=new Map,hn=new WeakMap,wn=1;ha=new Set(["eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","getHealth","minimumLedgerSlot","net_version","simulateTransaction","web3_clientVersion"]),wa=new Set(["allMids","l2Book","outcomeMeta","spotClearinghouseState","userFills","meta","metaAndAssetCtxs","perpDexs","candleSnapshot","fundingHistory","openOrders","frontendOpenOrders","clearinghouseState","spotMeta","validatorSummaries","delegatorSummary","delegations","delegatorRewards","delegatorHistory","maxBuilderFee"]);ba=e=>new Promise(t=>setTimeout(t,e))});function bn(e){return Aa.get(Number(e))||null}function En(e,t=process.env){let r=bn(e);if(!r)return null;for(let n of r.rpcEnv){let o=(t[n]||"").trim();if(o)return o}return null}var rt,Aa,Dt=l(()=>{rt={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}},Aa=new Map(Object.values(rt).map(e=>[e.chainId,e]))});import{Interface as Ia,getAddress as ka}from"ethers";function Ft(e,t){try{return ka(e).toLowerCase()}catch{throw new Error(`${t} must be a valid EVM address`)}}function Oa(e){let t=String(e||"").trim();if(!/^0x[0-9a-fA-F]{64}$/.test(t))throw new Error("txHash must be a 32-byte hex transaction hash");return t.toLowerCase()}function qt(e){return e==null?null:Number.parseInt(String(e),16)}function Ta(e,{rpcUrl:t,env:r=process.env}={}){if(t)return t;let n=En(e,r);return n||_a[Number(e)]||null}function Na(e){let t=String(e||""),r=t.toLowerCase();if(t!==t.trim()||!/^[a-zA-Z0-9_]+$/.test(t)||!Ca.test(r))throw new Error(`evm-rpc: ${t} refused \u2014 @oracle-agent/oracle is prepare-only (read RPC only; no broadcast/sign)`);return r}function Ra(e){let t=new Error(e?.message||JSON.stringify(e));return t.code=e?.code,t}function La(e){if(e?.error)throw Ra(e.error);return e?.result}function Pa(e,t,r){return`${e}
1
+ var Ii=Object.defineProperty;var l=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var Je=(e,t)=>{for(var r in t)Ii(e,r,{get:t[r],enumerable:!0})};import Xe from"node:fs";import ki from"node:os";import ge from"node:path";import{fileURLToPath as Oi}from"node:url";function kt(){return process.env.ORACLE_FAKE_HOME||ki.homedir()}function Ti(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function ye(){return Ti()?process.env.ORACLE_CONFIG_DIR||ge.join(kt(),".config","oracle"):ge.join(kt(),".config","oracle")}function Ci(){return ge.join(ye(),"desk.json")}function Ni(){return ge.join(ye(),"env")}function we({force:e=!1}={}){if(we._done&&!e)return we._result||null;we._done=!0;let t={},r=(o,i)=>{if(i==null)return;let s=String(i).trim();s&&(process.env[o]!=null&&String(process.env[o]).trim()!==""||(process.env[o]=s,t[o]=s))};try{let o=Ni();if(Xe.existsSync(o))for(let i of Xe.readFileSync(o,"utf8").split(/\r?\n/)){let s=i.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!s||s[2].startsWith("#"))continue;let d=s[2];(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))&&(d=d.slice(1,-1)),r(s[1],d)}}catch{}try{let o=Ci();if(Xe.existsSync(o)){let i=JSON.parse(Xe.readFileSync(o,"utf8"));i&&typeof i=="object"&&(r("ORACLE_DESK_URL",i.deskUrl||i.dataUrl||i.url),r("ORACLE_DATA_URL",i.dataUrl||i.deskUrl||i.url),r("ORACLE_API_URL",i.apiUrl||i.dataUrl||i.deskUrl),r("ORACLE_PUBLIC_URL",i.publicUrl||i.deskUrl||i.dataUrl),r("ORACLE_EXEC_URL",i.execUrl),r("MAD_DESK_URL",i.deskUrl||i.dataUrl))}}catch{}let n=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return n&&(r("ORACLE_DESK_URL",n),r("ORACLE_DATA_URL",n),r("ORACLE_API_URL",n),r("ORACLE_PUBLIC_URL",n),r("MAD_DESK_URL",n)),we._result=Object.keys(t).length?t:null,we._result}var _i,L,Qe=l(()=>{_i=ge.dirname(Oi(import.meta.url)),L=ge.resolve(_i,"../..");try{we()}catch{}});import{AsyncLocalStorage as Xi}from"node:async_hooks";function Ze(e){let t=Qi.getStore();if(!t||t.closed||!Zi.includes(e))return null;if(t.spans.length>=ea)return t.droppedSpans++,null;let r={stage:e,startMs:t.now()-t.start,durationMs:null,outcome:"pending",status:null};return t.spans.push(r),(n,o=null)=>{t.closed||r.durationMs!==null||(r.durationMs=Math.max(0,t.now()-t.start-r.startMs),r.outcome=n==="succeeded"?"succeeded":"failed",r.status=Number.isInteger(o)&&o>=100&&o<=599?o:null)}}var Qi,Zi,ea,un=l(()=>{Qi=new Xi,Zi=["http","retry","shared"],ea=512});import ue from"node:net";import ta from"node:dns";function et(e){let t=String(e).toLowerCase().split("%")[0];if((t.match(/::/g)||[]).length>1)return null;let r=u=>{if(!u)return[];let m=u.split(":"),b=m.at(-1);if(b?.includes(".")){let p=b.split(".").map(Number);if(p.length!==4||p.some(h=>!Number.isInteger(h)||h<0||h>255))return null;m.splice(m.length-1,1,(p[0]<<8|p[1]).toString(16),(p[2]<<8|p[3]).toString(16))}return m.some(p=>!/^[0-9a-f]{1,4}$/.test(p))?null:m.map(p=>Number.parseInt(p,16))},[n,o]=t.split("::"),i=r(n),s=r(o);if(!i||!s)return null;let d=t.includes("::"),c=8-i.length-s.length;if(!d&&c!==0||d&&c<1)return null;let f=[...i,...Array(Math.max(0,c)).fill(0),...s];return f.length!==8?null:Uint8Array.from(f.flatMap(u=>[u>>8,u&255]))}function Rt(e,t,r){let n=Math.floor(r/8),o=r%8;for(let s=0;s<n;s+=1)if(e[s]!==t[s])return!1;if(!o)return!0;let i=255<<8-o;return(e[n]&i)===(t[n]&i)}function Lt(e){if(ue.isIPv4(e)){let t=e.split(".").map(Number);return!(t[0]===0||t[0]===10||t[0]===127||t[0]>=224||t[0]===100&&t[1]>=64&&t[1]<=127||t[0]===169&&t[1]===254||t[0]===172&&t[1]>=16&&t[1]<=31||t[0]===192&&(t[1]===0||t[1]===2||t[1]===168)||t[0]===192&&t[1]===88&&t[2]===99||t[0]===198&&(t[1]===18||t[1]===19||t[1]===51)||t[0]===203&&t[1]===0&&t[2]===113)}if(ue.isIPv6(e)){let t=et(e);if(!t)return!1;let r=et("::ffff:0:0");return Rt(t,r,96)?Lt([...t.slice(12)].join(".")):Rt(t,et("2000::"),3)?![["2001::",23],["2001:db8::",32],["2001:10::",28],["2001:2::",48],["2002::",16],["3fff::",20]].some(([o,i])=>Rt(t,et(o),i)):!1}return!1}function na(e){let t;try{t=new URL(String(e))}catch{return{ok:!1,error:`not a valid URL: ${String(e).slice(0,120)}`}}if(t.protocol!=="http:"&&t.protocol!=="https:")return{ok:!1,error:`refused protocol ${t.protocol} (only http/https)`};let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.+$/,"");if(ra.has(r)||r.endsWith(".localhost")||r.endsWith(".internal"))return{ok:!1,error:`refused internal host ${r}`};let n=ue.isIP(r);return n!==0&&!Lt(r)?{ok:!1,error:`refused private address ${r}`}:{ok:!0,url:t,host:r,isLiteralIp:n!==0}}async function Pt(e,{lookupFn:t=ta.promises.lookup}={}){let r=na(e);if(!r.ok)return r;if(r.isLiteralIp)return{ok:!0,url:r.url,addresses:[{address:r.host,family:ue.isIPv6(r.host)?6:4}]};let n;if(process.env.ORACLE_HOSTED_EGRESS_PROXY)return{ok:!0,url:r.url,addresses:[]};try{n=await t(r.host,{all:!0,verbatim:!0})}catch{return{ok:!1,error:`refused: ${r.host} did not resolve`}}return!Array.isArray(n)||n.length===0||n.some(o=>!Lt(o.address))?{ok:!1,error:`refused: ${r.host} resolves to a non-public address`}:{ok:!0,url:r.url,addresses:n}}function oa(e=process.env){let t=e.ORACLE_HOSTED_EGRESS_PROXY||"";if(!t)return null;let r;try{r=new URL(t)}catch{throw new Error("egress-guard: ORACLE_HOSTED_EGRESS_PROXY is not a URL")}if(r.protocol!=="http:"||!["127.0.0.1","::1","localhost","[::1]"].includes(r.hostname)||!r.port||r.username||r.password)throw new Error("egress-guard: egress proxy must be an exact loopback http origin");let n=e.ORACLE_HOSTED_EGRESS_TOKEN||"";if(!/^[A-Za-z0-9_-]{43}$/.test(n))throw new Error("egress-guard: egress proxy token is missing");return{uri:r.origin,token:n}}async function $t({requireUndici:e=!1,importUndici:t=()=>import("undici")}={}){let r,n,o;try{o=await t(),r=o.Agent,n=o.fetch}catch(p){if(e)throw new Error(`egress-guard: untrustedUrl pinning requires the undici package, which failed to load: ${p?.message||p}`);return null}if(typeof r!="function"||typeof n!="function"){if(e)throw new Error("egress-guard: untrustedUrl pinning requires undici's Agent and fetch exports, which were not found on the imported module");return null}let i=p=>String(p).toLowerCase().replace(/^\[|\]$/g,"").replace(/\.+$/,""),s=new Map,d=p=>(Array.isArray(p)?p:[p]).map(h=>typeof h=="string"?{address:h}:h).filter(h=>h&&h.address).map(h=>({address:h.address,family:h.family||(ue.isIPv6(h.address)?6:4)})),c=(p,h,w)=>{s.set(i(p),d(typeof h=="string"?[{address:h,family:w}]:h))},f=p=>{let h=i(p);if(ue.isIP(h))return[{address:h,family:ue.isIPv6(h)?6:4}];let w=s.get(h);if(!w||!w.length)throw new Error(`refused: unpinned host ${p} during pinned fetch`);return w},u=oa(),m=u&&typeof o.ProxyAgent=="function"?new o.ProxyAgent({uri:u.uri,token:`Bearer ${u.token}`,connectTimeout:1e4}):new r({connect:{lookup(p,h,w){let g;try{g=f(p)}catch(S){return w(S)}return h?.all?w(null,g):w(null,g[0].address,g[0].family)}}}),b=ia((p,h={})=>n(p,{...h,dispatcher:m}),c);return{dispatcher:m,fetch:b,pin:c,resolve:f,async close(){try{await m.destroy()}catch{}}}}function ia(e,t){if(typeof e!="function")throw new Error("markPinCapableFetch: fetchImpl must be a function");if(typeof t!="function")throw new Error("markPinCapableFetch: pin must be a function");return e[Bt]=Object.freeze({pin:t}),e}function Dt(e){return typeof e=="function"&&typeof e[Bt]?.pin=="function"}function ln(e,t,r){if(!Dt(e))throw new Error("pinFetchToAddresses: fetchImpl is not pin-capable");e[Bt].pin(t,r)}var ra,Bt,dn=l(()=>{ra=new Set(["localhost","metadata.google.internal","metadata.goog"]);Bt=Symbol.for("oracle.egressGuard.pinCapableFetch")});import{createHash as aa}from"node:crypto";import{types as te}from"node:util";function C(e){return ie(`HTTP JSON body refused: ${e}`)}function ha(e){return["isArgumentsObject","isArrayBuffer","isAnyArrayBuffer","isArrayBufferView","isBoxedPrimitive","isDataView","isDate","isExternal","isGeneratorObject","isKeyObject","isCryptoKey","isMap","isMapIterator","isModuleNamespaceObject","isNativeError","isPromise","isRegExp","isSet","isSetIterator","isTypedArray","isWeakMap","isWeakSet"].some(t=>typeof te[t]=="function"&&te[t](e))}function wa(e){let t=[],r=0,n=0,o=0,i=0,s=new WeakSet,d=u=>{if(r+=Buffer.byteLength(u,"utf8"),r>ee.bytes)throw C("serialized byte limit exceeded");t.push(u)},c=u=>{if(Buffer.byteLength(u,"utf8")>ee.bytes)throw C("serialized byte limit exceeded");return JSON.stringify(u)},f=(u,m)=>{if(n+=1,n>ee.nodes)throw C("node limit exceeded");if(m>ee.depth)throw C("depth limit exceeded");if(u===null){d("null");return}if(typeof u=="string"){d(c(u));return}if(typeof u=="boolean"){d(u?"true":"false");return}if(typeof u=="number"){if(!Number.isFinite(u))throw C("non-finite number");d(Object.is(u,-0)?"0":String(u));return}if(typeof u!="object")throw C("unsupported non-JSON value");if(te.isProxy(u))throw C("proxy value");if(ha(u))throw C("unsupported exotic object");if(s.has(u))throw C("cyclic value");s.add(u);try{if(Object.getOwnPropertySymbols(u).length>0)throw C("symbol-keyed fields are unsupported");if(Array.isArray(u)){let h=Object.getPrototypeOf(u),w=0;for(;h!==null;){if(te.isProxy(h))throw C("proxy array prototype");if(w+=1,w>ee.depth)throw C("array prototype depth limit exceeded");h=Object.getPrototypeOf(h)}if(u.length>ee.arrayLength)throw C("array length limit exceeded");for(let S=0;S<u.length;S+=1){let P=Object.getOwnPropertyDescriptor(u,String(S));if(!P||!Object.hasOwn(P,"value")||P.enumerable!==!0)throw C("array entries must be dense enumerable own data")}let g=0;for(let S in u){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(Object.hasOwn(u,S)&&(g+=1,g>u.length))throw C("named array fields are unsupported")}if(g!==u.length)throw C("array entries must be dense enumerable own data");d("[");for(let S=0;S<u.length;S+=1)S&&d(","),f(Object.getOwnPropertyDescriptor(u,String(S)).value,m+1);d("]");return}let b=Object.getPrototypeOf(u);if(b!==Object.prototype&&b!==null)throw C("non-plain object");let p=[];for(let h in u){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(!Object.hasOwn(u,h))continue;if(o+=1,o>ee.fields)throw C("field limit exceeded");let w=Object.getOwnPropertyDescriptor(u,h);if(!w||!Object.hasOwn(w,"value")||w.enumerable!==!0)throw C("object fields must be enumerable own data");p.push([h,w.value])}d("{");for(let h=0;h<p.length;h+=1)h&&d(","),d(c(p[h][0])),d(":"),f(p[h][1],m+1);d("}")}finally{s.delete(u)}};return f(e,0),t.join("")}function ga(e){let t=Object.create(null);if(e==null)return t;if(typeof e!="object"&&typeof e!="function")throw new TypeError("HTTP headers must be an object");if(te.isProxy(e))throw new TypeError("HTTP headers must not be a proxy");if(Object.getOwnPropertySymbols(e).length>0)throw new TypeError("HTTP headers must not contain symbol fields");let r=new Set;for(let n of Object.keys(e)){if(!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u.test(n))throw new TypeError("HTTP header names must be valid tokens");let o=n.toLowerCase();if(r.has(o))throw new TypeError("HTTP headers contain a duplicate canonical name");r.add(o);let i=Object.getOwnPropertyDescriptor(e,n);if(!i||!Object.hasOwn(i,"value"))throw new TypeError("HTTP headers must contain own data properties");let s=i.value;if(s==null||["object","function","symbol"].includes(typeof s))throw new TypeError("HTTP header values must be scalar");t[n]=String(s)}return t}function ya(){return Object.assign(Object.create(null),{Accept:"application/json"})}function ba(e,t){if(!e)throw new Error(`HTTP redirect from ${t} missing Location`);let r=new URL(String(e),String(t));if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`HTTP redirect from ${t} used unsupported protocol ${r.protocol}`);return r.toString()}function Ea(e,t){return new URL(String(e)).origin===new URL(String(t)).origin}function tt(e){if((typeof e!="object"||e===null)&&typeof e!="function")return`${typeof e}:${String(e)}`;let t=wn.get(e);return t||(t=gn,gn+=1,wn.set(e,t)),`reference:${t}`}function yn(e){if(!e||typeof e!="object"||Array.isArray(e)||!Object.hasOwn(e,"jsonrpc")||!Object.hasOwn(e,"method")||e.jsonrpc!=="2.0")return!1;let t=typeof e.method=="string"?e.method:"";return t?Sa.has(t)||/^get[A-Z0-9_]/u.test(t)||/^is[A-Z0-9_]/u.test(t)||/^eth_get[A-Z0-9_]/u.test(t):!1}function bn(e,t){if(e==="GET"&&t==null)return!0;if(e!=="POST"||t==null)return!1;let r=t;if(typeof t=="string")try{r=JSON.parse(t)}catch{return!1}if(Array.isArray(r))return r.length>0&&r.every(yn);if(!r||typeof r!="object")return!1;if(Object.hasOwn(r,"jsonrpc")||Object.hasOwn(r,"method"))return yn(r);let n=Object.hasOwn(r,"type")?r.type:null;return typeof n=="string"&&xa.has(n)&&(!Object.hasOwn(r,"action")||r.action==null)&&(!Object.hasOwn(r,"signature")||r.signature==null)&&(!Object.hasOwn(r,"nonce")||r.nonce==null)}function va(e,t,r,n={},o=null){let i=aa("sha256"),s=(c,f)=>{let u=String(f);i.update(String(Buffer.byteLength(c,"utf8"))).update(":").update(c),i.update("=").update(String(Buffer.byteLength(u,"utf8"))).update(":").update(u).update(`
2
+ `)};s("method",e),s("url",t),Object.keys(r||{}).map((c,f)=>({name:c.toLowerCase(),order:f,value:String(r[c])})).sort((c,f)=>c.name.localeCompare(f.name)||c.order-f.order).forEach((c,f)=>{s(`header-name-${f}`,c.name),s(`header-value-${f}`,c.value)}),s("body",o??"-");for(let c of["untrustedUrl","maxResponseBytes","sameOriginRedirectsOnly","redirectPolicy","maxRedirects","timeoutMs","retries","fetchImpl","realFetch","lookupFn","importUndici","validateResponse"])s(`context-${c}`,n[c]??"-");return i.digest("hex")}function Aa(e,t){let r=Number(t);return Number.isFinite(r)&&r>0?Math.min(r*1e3,pn):Math.min(250*2**e,pn)+Math.floor(Math.random()*100)}function ie(e,t={}){let r=new Error(e);return r.retryable=!1,Object.assign(r,t),r}function qt(e,t,r){return ie(`HTTP response from ${e} exceeded maxResponseBytes ${r} (${t})`,{oversize:!0})}function le(e){try{let t=e?.body?.cancel?.();t&&typeof t.then=="function"&&t.catch(()=>{})}catch{}}function ka(e){return e?e.byteLength??e.length??0:0}async function Oa(e,t,{url:r,truncate:n=!1,onOversize:o}={}){if(t==null)return await e.text();let i=Number(e.headers?.get?.("content-length"));if(Number.isFinite(i)&&i>t&&(le(e),!n))throw qt(r,`content-length ${i}`,t);let s=e.body?.getReader?.();if(!s){let m=await e.text(),b=Buffer.byteLength(m,"utf8");if(b>t){if(!n)throw qt(r,`body ${b} bytes`,t);return Buffer.from(m,"utf8").subarray(0,t).toString("utf8")}return m}let d=[],c=0,f=!1;try{for(;;){let{value:m,done:b}=await s.read();if(b)break;if(m&&(d.push(Buffer.from(m)),c+=ka(m),c>t)){f=!0;break}}}finally{if(f)try{await s.cancel()}catch{}try{s.releaseLock?.()}catch{}}if(f&&(typeof o=="function"&&o(),!n))throw qt(r,`streamed ${c} bytes`,t);let u=Buffer.concat(d);return(f?u.subarray(0,t):u).toString("utf8")}function _a(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function Ta(e,{fetchImpl:t,method:r,headers:n,body:o,timeoutMs:i,lookupFn:s,realFetch:d,untrustedUrl:c=!1,maxResponseBytes:f=null,sameOriginRedirectsOnly:u=!1,importUndici:m,validateResponse:b,signal:p,redirectPolicy:h="follow",maxRedirects:w=rt}){let g=null,S=t,P=s?{lookupFn:s}:{};if(c&&!d&&!Dt(S))throw ie(`HTTP refused ${e}: untrustedUrl requires a pin-capable fetchImpl (see markPinCapableFetch in egress-guard.mjs) or no fetchImpl override so Oracle can pin the connection itself`);let E=new AbortController,A=setTimeout(()=>E.abort(),i),N=p?hn?hn([p,E.signal]):p:E.signal,q=async(v,{status:x=null}={})=>{let _=await Pt(v,P);if(!_.ok)throw ie(x==null?`HTTP refused ${v}: ${_.error}`:`HTTP redirect to ${v} ${_.error}`,x==null?{}:{status:x});let U=new URL(v).hostname;if(d){if(g&&(await g.close(),g=null),!g)try{g=await $t({requireUndici:!0,...m?{importUndici:m}:{}})}catch(y){throw ie(x==null?`HTTP refused ${v}: ${y?.message||y}`:`HTTP redirect to ${v} refused: ${y?.message||y}`,x==null?{}:{status:x})}g.pin(U,_.addresses),S=g.fetch}else ln(S,U,_.addresses);return _};try{let v=String(e),x=Object.assign(Object.create(null),n||{});c&&await q(v);for(let _=0;_<=w;_+=1){let U=Object.assign(Object.create(null),{method:r,headers:x,body:o,signal:N,redirect:"manual",dispatcher:void 0}),y=await S(v,U);if((h==="error"||w===0)&&y.status>=300&&y.status<400)throw le(y),ie(`HTTP ${y.status} ${r} redirect refused`,{status:y.status,redirectRefused:!0});if(ma.has(y.status)){let M=u===!0&&r==="POST"&&[307,308].includes(y.status)&&bn(r,o);if(r!=="GET"&&r!=="HEAD"&&!M){le(y);let R=new Error(`HTTP ${y.status} ${r} ${v} redirected non-idempotent request`);throw R.status=y.status,R}if(_===w)throw le(y),ie(`HTTP ${y.status} ${r} redirect budget exhausted`,{status:y.status,redirectRefused:!0});let Kr=y.headers?.get?.("location"),K;try{K=ba(Kr,v)}catch(R){throw le(y),R}let se=!Ea(K,v);if(le(y),se&&r==="POST"){let R=new Error(`HTTP ${y.status} ${r} cross-origin redirect refused`);throw R.status=y.status,R}if(se&&u){let R=new Error(`HTTP ${y.status} ${r} cross-origin redirect refused`);throw R.status=y.status,R.retryable=!1,R}if(se&&(x=ya(x)),c)await q(K,{status:y.status});else if(se){let R=await Pt(K,P);if(!R.ok){let k=new Error(`HTTP redirect from ${v} ${R.error}`);throw k.status=y.status,k.retryable=!1,k}d&&R.addresses?.length&&(g||(g=await $t(m?{importUndici:m}:{})),g&&(g.pin(new URL(K).hostname,R.addresses),S=g.fetch))}v=K;continue}if(typeof b=="function")try{await b(y,{url:v})}catch(M){throw le(y),ie(M?.message||String(M))}let T=await Oa(y,f,{url:v,onOversize:()=>E.abort()}),Oe=_a(T);if(!y.ok){let M=new Error(`HTTP ${y.status} ${r} ${v}`);throw M.status=y.status,M.retryAfter=y.headers?.get?.("retry-after")??null,M.body=Oe??T.slice(0,300),M}return Oe??T}throw new Error(`HTTP redirect loop for ${e}`)}catch(v){if(E.signal.aborted&&!Ce(p)){let x=v&&(typeof v=="object"||typeof v=="function")&&!te.isProxy(v)?v:null,_=x?Object.getOwnPropertyDescriptor(x,"oversize"):null;if(!(_&&Object.hasOwn(_,"value")&&_.value===!0))try{if(!x)throw new TypeError("unsafe rejection");Object.defineProperties(x,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}})}catch{let y=new Error("HTTP request timed out");throw Object.defineProperties(y,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}}),y}}throw v}finally{clearTimeout(A),g&&await g.close()}}async function V(e,t={}){if(t!=null&&typeof t!="object"&&typeof t!="function")throw new TypeError("HTTP options must be an object");if(t!=null&&te.isProxy(t))throw new TypeError("HTTP options must not be a proxy");let r=new Set(["body","dedupe","fetchImpl","headers","importUndici","lookupFn","maxRedirects","maxResponseBytes","method","redirectPolicy","retries","sameOriginRedirectsOnly","signal","timeoutMs","untrustedUrl","validateResponse"]);if(t!=null){if(Object.getOwnPropertySymbols(t).length>0)throw new TypeError("HTTP options contain unknown fields");for(let k of Object.getOwnPropertyNames(t)){let I=Object.getOwnPropertyDescriptor(t,k);if(!(k==="toJSON"&&I&&Object.hasOwn(I,"value")&&I.value===void 0)){if(!r.has(k))throw new TypeError("HTTP options contain unknown fields");if(!I||!I.enumerable||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain enumerable own data properties")}}}let n=k=>{if(t==null||!Object.hasOwn(t,k))return;let I=Object.getOwnPropertyDescriptor(t,k);if(!I||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain own data properties");return I.value};if(typeof e!="string"||e.length===0||e.length>8192)throw new TypeError("HTTP URL must be a bounded string");let o=n("method");if(o!==void 0&&(typeof o!="string"||!/^[A-Za-z]+$/u.test(o)))throw new TypeError("HTTP method must be a string token");let i=n("timeoutMs");if(i!==void 0&&(!Number.isInteger(i)||i<1||i>12e4))throw new TypeError("HTTP timeoutMs must be a bounded integer");let s=n("retries");if(s!==void 0&&(!Number.isInteger(s)||s<0||s>10))throw new TypeError("HTTP retries must be a bounded integer");let d=n("redirectPolicy");if(d!==void 0&&d!=="follow"&&d!=="error")throw new TypeError('HTTP redirectPolicy must be "follow" or "error"');let c=n("maxRedirects");if(c!==void 0&&(!Number.isInteger(c)||c<0||c>rt))throw new TypeError(`HTTP maxRedirects must be an integer from 0 through ${rt}`);if(d==="error"&&c!==void 0&&c!==0)throw new TypeError('HTTP redirectPolicy "error" requires maxRedirects 0 when supplied');let f=d??"follow",u=f==="error"?0:c??rt;for(let k of["dedupe","untrustedUrl","sameOriginRedirectsOnly"]){let I=n(k);if(I!==void 0&&typeof I!="boolean")throw new TypeError(`HTTP ${k} must be boolean`)}let m=n("maxResponseBytes");if(m!==void 0&&(!Number.isInteger(m)||m<1||m>64*1024*1024))throw new TypeError("HTTP maxResponseBytes must be a bounded integer");let b=n("signal");if(b!==void 0){if(te.isProxy(b)||!(b instanceof AbortSignal))throw new TypeError("HTTP signal must be a native AbortSignal");try{Ce(b)}catch{throw new TypeError("HTTP signal must be a native AbortSignal")}}for(let k of["importUndici","lookupFn","validateResponse"]){let I=n(k);if(I!==void 0&&typeof I!="function")throw new TypeError(`HTTP ${k} must be a function`)}let p=n("fetchImpl"),h=p||globalThis.fetch;if(typeof h!="function")throw new Error("fetch unavailable \u2014 pass opts.fetchImpl");let w=i??12e3,g=(o||"GET").toUpperCase(),S=n("headers"),P=ga(S),E=Object.assign(Object.create(null),P);Object.keys(E).some(k=>k.toLowerCase()==="accept")||(E.Accept="application/json");let A=n("body");A!=null&&typeof A!="string"&&(Object.keys(E).find(I=>I.toLowerCase()==="content-type")||(E["Content-Type"]="application/json"),A=wa(A));let N=s??ca,q=n("lookupFn"),v=!p,x=n("untrustedUrl")===!0,_=n("sameOriginRedirectsOnly")===!0,U=n("importUndici"),y=n("validateResponse"),T=b,Oe=m??null,M=async()=>{let k;for(let I=0;I<=N;I++){T&&da.call(T);let Gr=Ze("http");try{let Z=await Ta(e,{fetchImpl:h,method:g,headers:E,body:A,timeoutMs:w,lookupFn:q,realFetch:v,untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,importUndici:U,validateResponse:y,signal:T,redirectPolicy:f,maxRedirects:u});return Gr?.("succeeded"),Z}catch(Z){k=Z;let he=It=>{if(!Z||typeof Z!="object"&&typeof Z!="function"||te.isProxy(Z))return;let _e=Object.getOwnPropertyDescriptor(Z,It);return _e&&Object.hasOwn(_e,"value")?_e.value:void 0},Ye=he("status");Gr?.("failed",Ye);let Si=he("oracleTimeout")===!0||he("name")==="AbortError"||he("name")==="TimeoutError"||Ce(T),xi=new Set([408,425,429]),vi=he("retryable")===!1?!1:Ye!=null?xi.has(Ye)||sa.has(Ye)&&fn.has(g):!Si&&fn.has(g);if(I===N||!vi)throw Z;let Yr=Aa(I,he("retryAfter")),Ai=Ze("retry"),Jr=!1;try{T?await new Promise((It,_e)=>{let Xr,Te=()=>{clearTimeout(Xr),mn.call(T,"abort",Te),_e(pa(T)||new DOMException("Aborted","AbortError"))};if(Ce(T)){Te();return}Xr=setTimeout(()=>{mn.call(T,"abort",Te),It()},Yr),fa.call(T,"abort",Te,{once:!0}),Ce(T)&&Te()}):await Ia(Yr),Jr=!0}finally{Ai?.(Jr?"succeeded":"failed")}}}throw k};if(!(n("dedupe")!==!1&&!T&&bn(g,A)))return M();let K=va(g,e,E,{untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,redirectPolicy:f,maxRedirects:u,timeoutMs:w,retries:N,fetchImpl:tt(h),realFetch:v,lookupFn:tt(q),importUndici:tt(U),validateResponse:tt(y)},A),se=Ft.get(K);if(se){let k=Ze("shared");try{let I=await se;return k?.("succeeded"),I}catch(I){throw k?.("failed"),I}}let R=M().finally(()=>Ft.delete(K));return Ft.set(K,R),R}var sa,fn,ca,pn,ua,la,da,fa,mn,hn,Ce,pa,ma,rt,Qu,ee,Ft,wn,gn,Sa,xa,Ia,j=l(()=>{un();dn();sa=new Set([408,425,429,500,502,503,504]),fn=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]),ca=2,pn=4e3,ua=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted")?.get,la=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"reason")?.get,da=AbortSignal.prototype.throwIfAborted,fa=EventTarget.prototype.addEventListener,mn=EventTarget.prototype.removeEventListener,hn=typeof AbortSignal.any=="function"?AbortSignal.any.bind(AbortSignal):null,Ce=e=>e?ua.call(e):!1,pa=e=>e?la.call(e):void 0,ma=new Set([301,302,303,307,308]),rt=3,Qu=64*1024,ee=Object.freeze({depth:32,nodes:1e4,fields:1e4,arrayLength:1e4,bytes:1024*1024});Ft=new Map,wn=new WeakMap,gn=1;Sa=new Set(["eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","getHealth","minimumLedgerSlot","net_version","simulateTransaction","web3_clientVersion"]),xa=new Set(["allMids","l2Book","outcomeMeta","spotClearinghouseState","userFills","meta","metaAndAssetCtxs","perpDexs","candleSnapshot","fundingHistory","openOrders","frontendOpenOrders","clearinghouseState","spotMeta","validatorSummaries","delegatorSummary","delegations","delegatorRewards","delegatorHistory","maxBuilderFee"]);Ia=e=>new Promise(t=>setTimeout(t,e))});function En(e){return Ca.get(Number(e))||null}function Sn(e,t=process.env){let r=En(e);if(!r)return null;for(let n of r.rpcEnv){let o=(t[n]||"").trim();if(o)return o}return null}var nt,Ca,Ut=l(()=>{nt={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}},Ca=new Map(Object.values(nt).map(e=>[e.chainId,e]))});import{Interface as Na,getAddress as Ra}from"ethers";function Mt(e,t){try{return Ra(e).toLowerCase()}catch{throw new Error(`${t} must be a valid EVM address`)}}function La(e){let t=String(e||"").trim();if(!/^0x[0-9a-fA-F]{64}$/.test(t))throw new Error("txHash must be a 32-byte hex transaction hash");return t.toLowerCase()}function jt(e){return e==null?null:Number.parseInt(String(e),16)}function $a(e,{rpcUrl:t,env:r=process.env}={}){if(t)return t;let n=Sn(e,r);return n||Pa[Number(e)]||null}function Da(e){let t=String(e||""),r=t.toLowerCase();if(t!==t.trim()||!/^[a-zA-Z0-9_]+$/.test(t)||!Ba.test(r))throw new Error(`evm-rpc: ${t} refused \u2014 @oracle-agent/oracle is prepare-only (read RPC only; no broadcast/sign)`);return r}function Fa(e){let t=new Error(e?.message||JSON.stringify(e));return t.code=e?.code,t}function qa(e){if(e?.error)throw Fa(e.error);return e?.result}function Ua(e,t,r){return`${e}
3
3
  ${t}
4
- ${JSON.stringify(r??[])}`}async function $a(e,t,r){return V(e,{method:"POST",body:t,fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs??12e3,signal:r.signal})}async function J(e,t,r=[],n={}){let o=String(t||""),i=Na(o),s=Ta(e,n);if(!s)throw new Error(`No RPC URL for chainId ${e} (set env from chain registry rpcEnv or pass rpcUrl)`);if(i==="eth_chainid"&&n.cacheChainId!==!1){let u=Sn.get(s);if(u!=null)return u}let c=n.dedupe!==!1&&!n.signal?Pa(s,o,r):null;if(c&&Ne.has(c))return Ne.get(c);let f=(async()=>{let u=await $a(s,{jsonrpc:"2.0",id:1,method:t,params:r},n),d=La(u);return i==="eth_chainid"&&typeof d=="string"&&Sn.set(s,d),d})();return c&&(Ne.set(c,f),f.finally(()=>{Ne.get(c)===f&&Ne.delete(c)}).catch(()=>{})),f}async function xn(e={},t={}){let r=Number(e.chainId??t.chainId??1),n=Oa(e.txHash||e.hash||e.transactionHash),o=await J(r,"eth_getTransactionReceipt",[n],t);if(!o)return{ok:!1,chainId:r,txHash:n,status:"pending",receipt:null,reason:"receipt pending"};let i=qt(o.status),s=i===1,p=i===1?"success":i===0?"reverted":"unknown",c=s?null:p==="reverted"?"transaction reverted":"unknown receipt status",f=e.expectedTo?Ft(e.expectedTo,"expectedTo"):null,u=o.to?Ft(o.to,"receipt.to"):null;return f&&u!==f&&(s=!1,c=`to mismatch: expected ${f}, got ${u||"null"}`),{ok:s,chainId:r,txHash:n,status:p,reason:c,statusCode:i,to:u,from:o.from?Ft(o.from,"receipt.from"):null,blockNumber:qt(o.blockNumber),transactionIndex:qt(o.transactionIndex),logs:Array.isArray(o.logs)?o.logs:[],receipt:o}}var rl,_a,Ca,Ne,Sn,Y=l(()=>{j();Dt();rl=new Ia(["function allowance(address owner,address spender) view returns (uint256)","function balanceOf(address account) view returns (uint256)"]);_a={1:"https://ethereum.publicnode.com",137:"https://polygon-bor-rpc.publicnode.com",42161:"https://arbitrum-one-rpc.publicnode.com",8453:"https://base-rpc.publicnode.com",10:"https://optimism-rpc.publicnode.com",988:"https://rpc.stable.xyz",56:"https://bsc-rpc.publicnode.com",43114:"https://avalanche-c-chain-rpc.publicnode.com",999:"https://rpc.hyperliquid.xyz/evm",2741:"https://api.mainnet.abs.xyz",4663:"https://rpc.mainnet.chain.robinhood.com"};Ca=/^(?:eth_(?:call|blocknumber|chainid|get[a-z0-9]+|feehistory|gasprice|maxpriorityfeepergas|syncing|protocolversion|estimategas|createaccesslist)|net_(?:version|listening|peercount)|web3_(?:clientversion|sha3))$/;Ne=new Map,Sn=new Map});var Ut=l(()=>{});var sl,nt=l(()=>{j();Ut();sl=Object.freeze({1:"ethereum",10:"optimism",56:"bsc",137:"polygon",8453:"base",42161:"arbitrum",43114:"avalanche",999:"hyperevm",4663:"robinhood"})});var Re=l(()=>{});var Ee=l(()=>{});var X=l(()=>{Re();Ee()});var Da,ml,F=l(()=>{Da=300*1e3,ml=(()=>{let e=Number(process.env.ORACLE_PREPARE_HARD_MAX_AGE_MS);return Number.isFinite(e)&&e>0?e:1800*1e3})()});import{Interface as vn,getAddress as gl,isAddress as yl}from"ethers";var jt,vl,Al,Ht=l(()=>{Y();nt();X();F();jt={1:{name:"ethereum",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",usdc:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},8453:{name:"base",quoter:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",router:"0x2626664c2603336E57B271c5C0b26F421741e481",weth:"0x4200000000000000000000000000000000000006",usdc:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},42161:{name:"arbitrum",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",usdc:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"},4663:{name:"robinhood",quoter:"0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7",router:"0xcaf681a66d020601342297493863e78c959e5cb2",weth:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",usdc:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},999:{name:"hyperevm",weth:"0x5555555555555555555555555555555555555555",usdc:"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"},10:{name:"optimism",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0x4200000000000000000000000000000000000006",usdc:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"},56:{name:"bsc",quoter:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",router:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2",weth:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",usdc:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"},137:{name:"polygon",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",usdc:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"},43114:{name:"avalanche",quoter:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",router:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE",weth:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",usdc:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"}},vl=new vn(["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)"]),Al=new vn(["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 qa,Interface as zt,getAddress as _l,isAddress as Tl,keccak256 as Cl}from"ethers";var $l,Wt,Bl,Dl,Fl,ql,Ul,Vt=l(()=>{Y();nt();X();F();$l=qa.defaultAbiCoder(),Wt={1:{name:"ethereum",poolManager:"0x000000000004444c5dc75cB358380D2e3dE08A90",quoter:"0x52f0e24d1c21c8a0cb1e5a5dd6198556bd9e1203",stateView:"0x7ffe42c4a5deea5b0fec41c94c136cf115597227",universalRouter:"0x66a9893cc07d91d95644aedd05d03f95e1dba8af",weth:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",usdc:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},10:{name:"optimism",poolManager:"0x9a13f98cb987694c9f086b1f5eb990eea8264ec3",quoter:"0x1f3131a13296fb91c90870043742c3cdbff1a8d7",stateView:"0xc18a3169788f4f75a170290584eca6395c75ecdb",universalRouter:"0x851116d9223fabed8e56c0e6b8ad0c31d98b3507",weth:"0x4200000000000000000000000000000000000006",usdc:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"},56:{name:"bsc",poolManager:"0x28e2ea090877bf75740558f6bfb36a5ffee9e9df",quoter:"0x9f75dd27d6664c475b90e105573e550ff69437b0",stateView:"0xd13dd3d6e93f276fafc9db9e6bb47c1180aee0c4",universalRouter:"0x1906c1d672b88cd1b9ac7593301ca990f94eae07",weth:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",usdc:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"},137:{name:"polygon",poolManager:"0x67366782805870060151383f4bbff9dab53e5cd6",quoter:"0xb3d5c3dfc3a7aebff71895a7191796bffc2c81b9",stateView:"0x5ea1bd7974c8a611cbab0bdcafcb1d9cc9b3ba5a",universalRouter:"0x1095692a6237d83c6a72f3f5efedb9a670c49223",weth:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",usdc:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"},8453:{name:"base",poolManager:"0x498581fF718922c3f8e6A244956aF099B2652b2b",quoter:"0x0d5e0f971ed27fbff6c2837bf31316121532048d",stateView:"0xa3c0c9b65bad0b08107aa264b0f3db444b867a71",universalRouter:"0x6ff5693b99212da76ad316178a184ab56d299b43",weth:"0x4200000000000000000000000000000000000006",usdc:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},42161:{name:"arbitrum",poolManager:"0x360e68faccca8ca495c1b759fd9eee466db9fb32",quoter:"0x3972c00f7ed4885e145823eb7c655375d275a1c5",stateView:"0x76fd297e2d437cd7f76d50f01afe6160f86e9990",universalRouter:"0xa51afafe0263b40edaef0df8781ea9aa03e381a3",weth:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",usdc:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"},43114:{name:"avalanche",poolManager:"0x06380c0e0912312b5150364b9dc4542ba0dbbc85",quoter:"0xbe40675bb704506a3c2ccfb762dcfd1e979845c2",stateView:"0xc3c9e198c735a4b97e3e683f391ccbdd60b69286",universalRouter:"0x94b75331ae8d42c1b61065089b7d48fe14aa73b7",weth:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",usdc:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"},4663:{name:"robinhood",poolManager:"0x8366a39cc670b4001a1121b8f6a443a643e40951",quoter:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",universalRouter:"0x8876789976dEcBfCbBbe364623C63652db8C0904",weth:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",usdc:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"}},Bl=new zt(["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)","function quoteExactOutputSingle(((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountIn, uint256 gasEstimate)"]),Dl=new zt(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),Fl=new zt(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96,int24 tick,uint24 protocolFee,uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),ql=Object.freeze([[13,"beforeInitialize"],[12,"afterInitialize"],[11,"beforeAddLiquidity"],[10,"afterAddLiquidity"],[9,"beforeRemoveLiquidity"],[8,"afterRemoveLiquidity"],[7,"beforeSwap"],[6,"afterSwap"],[5,"beforeDonate"],[4,"afterDonate"],[3,"beforeSwapReturnsDelta"],[2,"afterSwapReturnsDelta"],[1,"afterAddLiquidityReturnsDelta"],[0,"afterRemoveLiquidityReturnsDelta"]]),Ul=(1n<<14n)-1n});var Jt=l(()=>{});import{Contract as Ql,JsonRpcProvider as Zl}from"ethers";var An=l(()=>{});var nd,at=l(()=>{An();nd=Object.freeze({swap:5,bridge:5,perps:0,nft:0})});var kn=l(()=>{j();X();Jt();F();at()});var On=l(()=>{j();X();F();at()});var st=l(()=>{});var Cn=l(()=>{j();X();st();F()});var Td,Nn=l(()=>{Td=Object.freeze({READ:"read",PREPARE:"prepare",EXECUTE:"execute",AUTONOMOUS:"autonomous"})});import{TypedDataEncoder as Pd,getAddress as $d,isAddress as Bd}from"ethers";var Ha,Hd,za,zd,Yt=l(()=>{j();X();Nn();Jt();F();Ha=Object.freeze({1:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",100:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",42161:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",8453:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41"}),Hd=Object.freeze({1:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",100:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",42161:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",8453:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110"}),za=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"}]}),zd=Object.freeze({OrderCancellations:[{name:"orderUids",type:"bytes[]"}]})});function Pe(e){let t=e?.transactionHash||e?.hash||e?.txid||null;return t?{happened:!0,hash:String(t),note:null}:{happened:!1,hash:null,note:"no transaction hash \u2014 the action did not succeed"}}var nr=l(()=>{});var Mn=l(()=>{});var jn=l(()=>{});import{isAddress as lm}from"ethers";var or=l(()=>{X();Re();Ee()});import{Interface as ps,isAddress as wm}from"ethers";var Em,Hn=l(()=>{or();Re();Ee();Em=new ps(["function approve(address spender,uint256 amount) returns (bool)"])});import{Interface as ms,isAddress as vm}from"ethers";var Om,_m,zn=l(()=>{or();Re();Ee();Om=new ms(["function approve(address spender,uint256 amount) returns (bool)"]),_m=Object.freeze({42161:"0x1c3fa76e6e1088bce750f23a5bfcffa1efef6a41",43114:"0x8f550e53dfe96c055d5bdb267c21f268fcaf63b2"})});var de=l(()=>{});import{Interface as hs,MaxUint256 as $m,isAddress as Bm,keccak256 as Dm,toUtf8Bytes as Fm}from"ethers";var zm,fe=l(()=>{jn();Hn();zn();de();Ee();zm=new hs(["function approve(address spender,uint256 amount) returns (bool)"])});var dt=l(()=>{fe()});import{Address as Jm,NETWORK as Ym,OutScript as Xm,RawTx as Qm,SigHash as Zm,TEST_NETWORK as eh,Transaction as th}from"@scure/btc-signer";var sr=l(()=>{});import{createHash as ws}from"node:crypto";import{base58 as ih}from"@scure/base";import{getCompiledTransactionMessageDecoder as sh}from"@solana/transaction-messages";var Wn,ch,cr=l(()=>{Wn=e=>ws("sha256").update(`global:${e}`).digest().subarray(0,8).toString("hex"),ch=new Map([[Wn("route"),{name:"route",prefixBytes:0}],[Wn("shared_accounts_route"),{name:"shared_accounts_route",prefixBytes:1}]])});var Vn=l(()=>{});var Kn=l(()=>{j();Vn()});var yh,Gn=l(()=>{Kn();yh=Object.freeze({tradexyz:"xyz",ventuals:"vntl",hypernova:"hyna",paradex:"para",entropy:"io",entropyio:"io"})});var vh,Ah,lr=l(()=>{de();Gn();vh=Object.freeze({"perp-order":"order","hip3-order":"order","hip4-order":"order","perp-bracket":"order","perp-cancel":"cancel","perp-leverage":"leverage","perp-isolated-margin":"margin","builder-fee-approval":"approveBuilder","hype-stake-deposit":"stake","hype-stake-withdraw":"unstake","hype-delegate":"delegate","hype-undelegate":"delegate"}),Ah=Object.freeze({"perp-order":"order","hip3-order":"order","hip4-order":"order","perp-bracket":"order","perp-cancel":"cancel","perp-leverage":"updateLeverage","perp-isolated-margin":"updateIsolatedMargin","builder-fee-approval":"approveBuilderFee","hype-stake-deposit":"cDeposit","hype-stake-withdraw":"cWithdraw","hype-delegate":"tokenDelegate","hype-undelegate":"tokenDelegate"})});var Oh,dr=l(()=>{de();Oh="0x"+"00".repeat(32)});var gs,Rh,fr=l(()=>{dr();de();gs=Object.freeze([["salt","uint256"],["maker","address"],["signer","address"],["tokenId","uint256"],["makerAmount","uint256"],["takerAmount","uint256"],["side","uint8"],["signatureType","uint8"],["timestamp","uint256"],["metadata","bytes32"],["builder","bytes32"]]),Rh=Object.freeze(gs.map(e=>e[0]))});var ft=l(()=>{de()});import{TypedDataEncoder as Dh,getAddress as Fh,isAddress as qh}from"ethers";var ys,bs,Qn=l(()=>{F();ys=Object.freeze({1:"0x111111125421cA6dc452d289314280a0f8842A65",8453:"0x111111125421cA6dc452d289314280a0f8842A65",42161:"0x111111125421cA6dc452d289314280a0f8842A65",10:"0x111111125421cA6dc452d289314280a0f8842A65",137:"0x111111125421cA6dc452d289314280a0f8842A65",56:"0x111111125421cA6dc452d289314280a0f8842A65"}),bs=Object.freeze({Order:[{name:"salt",type:"uint256"},{name:"maker",type:"address"},{name:"receiver",type:"address"},{name:"makerAsset",type:"address"},{name:"takerAsset",type:"address"},{name:"makingAmount",type:"uint256"},{name:"takingAmount",type:"uint256"},{name:"makerTraits",type:"uint256"}]})});import{TypedDataEncoder as Hh,getAddress as zh}from"ethers";var Kh,pr=l(()=>{Qn();Yt();Kh=Object.freeze(["https://limit-orders.1inch.io","https://api.1inch.dev/orderbook"])});import{Interface as eo}from"ethers";var Is,uw,ks,lw,dw,fw,pw,Os,mw,pt=l(()=>{fe();X();F();dt();sr();cr();lr();fr();ft();pr();Is=new Set(["evm","evm-swap","evm-bridge","evm-nft","evm-order","btc","sol","hl","poly","lighter"]),uw=Object.freeze({swap:5,bridge:5,perps:0,nft:0,mint:0,transfer:0,approve:0,delegate:0,identity:0,order:0,cancel:0,leverage:0,margin:0,approveBuilder:0,stake:0,unstake:0}),ks=Object.freeze({"0x04e45aaf":{provider:"uniswap-v3",action:"swap",layout:"router02-exact-input-single"},"0x414bf389":{provider:"uniswap-v3",action:"swap",layout:"swap-router-exact-input-single"},"0xc04b8d59":{provider:"uniswap-v3",action:"swap",layout:"exact-input-deadline"},"0xb858183f":{provider:"uniswap-v3",action:"swap",layout:"exact-input"},"0x5ae401dc":{provider:"uniswap-v3",action:"swap",layout:"multicall-deadline"},"0xa026383e":{provider:"aerodrome",action:"swap",layout:"aerodrome-exact-input-single"},"0x7b939232":{provider:"across-v3",action:"bridge",layout:"across-deposit-v3"}}),lw=Object.freeze({"0x161ac21f":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-public"},"0xc2f6663a":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-allowlist"}}),dw=new eo(["function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),fw=new eo(["function mintAllowList(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity,(uint80 mintPrice,uint48 maxTotalMintableByWallet,uint48 startTime,uint48 endTime,uint48 dropStageIndex,uint32 maxTokenSupplyForStage,uint16 feeBps,bool restrictFeeRecipients) mintParams,bytes32[] proof) payable"]),pw=Object.freeze({"0xa0712d68":{provider:"nft-mint",action:"mint",layout:"mint-quantity"},"0x1249c58b":{provider:"nft-mint",action:"mint",layout:"mint-no-args"},"0x2db11544":{provider:"nft-mint",action:"mint",layout:"mint-quantity"},"0xefef39a1":{provider:"nft-mint",action:"mint",layout:"mint-quantity"},"0xa6f2ae3a":{provider:"nft-mint",action:"mint",layout:"mint-no-args"}}),Os=Object.freeze([...Is]),mw=Object.freeze({...ks})});import{encode as gw}from"@msgpack/msgpack";import{keccak256 as bw,verifyTypedData as Ew}from"ethers";var Sw,xw,mr=l(()=>{Sw=Object.freeze({name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"}),xw=Object.freeze({Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]})});var hr=l(()=>{ft()});import{ed25519 as Cw}from"@noble/curves/ed25519.js";import{base58 as Rw}from"@scure/base";import{RawTx as Pw,SigHash as $w,Transaction as Bw}from"@scure/btc-signer";import{Transaction as Fw,keccak256 as qw,verifyTypedData as Uw}from"ethers";var wr=l(()=>{mr();hr()});import{base58 as Kw}from"@scure/base";var Be=l(()=>{pt();dt();fe();wr()});var to=l(()=>{Be();pt()});import{wordlists as Cs}from"ethers";function Ps(e){let t=String(e).trim().toLowerCase().split(/\s+/).filter(Boolean);return Ls.has(t.length)&&t.every(r=>Cs.en.getWordIndex(r)>=0)}function Fs(e){let t=ro(e);return Ds.has(t)||Bs.test(t)}function ro(e){return String(e).replace(/[^a-z0-9]/gi,"").toLowerCase()}function qs(e){let t=ro(e);return[...Ns].some(r=>t.includes(r))}function Us(e,t,r){if(typeof t=="string"){if(Rs.some(n=>n.test(t))||Ps(t))throw new De(r);if($s.test(t)&&!Fs(e))throw new De(r)}}function yr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string")return Us(r,e,t),e;if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError(`action receipt: non-finite number at ${t}`);return e}if(typeof e=="bigint")return e.toString();if(Array.isArray(e))return e.map((o,i)=>yr(o,`${t}[${i}]`,r));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError(`action receipt: JSON-like value required at ${t}`);let n={};for(let o of Object.keys(e).sort()){let i=`${t}.${o}`;if(qs(o))throw new De(i);e[o]!==void 0&&(n[o]=yr(e[o],i,o))}return n}function mt(e){return yr(e)}var Ns,Rs,Ls,$s,Bs,Ds,De,Fe=l(()=>{Ns=new Set(["privatekey","privkey","secretkey","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","wif","xprv","xpriv","bearer","authorization","signature","apikey","credential"]),Rs=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/],Ls=new Set([12,15,18,21,24]);$s=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/,Bs=/(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i,Ds=new Set(["calldata","data","publickey","pubkey","message","payload","input","extradata"]);De=class extends Error{constructor(t){super(`action receipt refused: secret-bearing field at ${t}`),this.name="ActionReceiptSecretError",this.code="ACTION_RECEIPT_SECRET"}}});import{closeSync as cg,constants as Ms,fchmodSync as ug,fsyncSync as lg,lstatSync as dg,mkdirSync as fg,openSync as pg,readFileSync as mg,renameSync as hg,rmSync as wg,writeFileSync as gg}from"node:fs";var Eg,no=l(()=>{Fe();Be();Eg=Ms.O_NOFOLLOW??0});import{wordlists as vg}from"ethers";var oo,Ig,xe=l(()=>{Fe();oo=64*1024,Ig=32*1024});var zs,_g,Tg,wt=l(()=>{xe();zs=["schemaVersion","buildVersion","recordType","execution","custody"],_g=[...zs,"recordHash"],Tg=Object.freeze({signed:new Set(["workflow.signed","legacy.signed"]),submitted:new Set(["workflow.submitted","legacy.broadcast"]),finalized:new Set(["workflow.finalized"]),reorged:new Set(["workflow.reorged"]),orphaned:new Set(["workflow.orphaned"]),compensating:new Set(["workflow.compensating"]),compensated:new Set(["workflow.compensated"])})});var Ws,mo,Pg,vr=l(()=>{xe();wt();Ws=Object.freeze(["draft","checked","approval","signed","submitted","finalized","reorged","orphaned","compensating","compensated","failed","cancelled"]),mo=Object.freeze(["workflow.drafted","workflow.checked","workflow.approval_requested","workflow.approval_granted","workflow.signed","workflow.submitted","workflow.finalized","workflow.reorged","workflow.orphaned","workflow.compensating","workflow.compensated","workflow.failed","workflow.cancelled","workflow.annotated"]),Pg=new Set(mo)});var Xs,ho=l(()=>{xe();vr();Xs=64*1024*1024});var Mg,jg,Hg,wo=l(()=>{Mg=Object.freeze(["chainId","agentAddress","accountAddress","actions","targets","maxValueWei","maxGasWei","maxSlippageBps","expiresAt","nonce","revocationKey"]),jg=Object.freeze(["read","simulate"]),Hg=1440*60});function Ar(e){let t=String(e),r=t.toLowerCase().replace(/[\s._-]+/g,"");return Qs.test(t)||Zs.includes(r)}function ec(e){return e.replace(/"([A-Za-z0-9_-]+)"\s*:\s*"(?:0x)?([0-9a-fA-F]{64})"/g,(t,r)=>yo.includes(String(r).toLowerCase().replace(/[_-]/g,""))?`"${r}":"<hex64>"`:t)}function bo(e){let t;try{t=JSON.stringify(e)}catch(o){throw new re("$",`unserializable-payload: ${String(o?.message||o)}`)}if(t===void 0)return"null";let r=ec(t);for(let{rule:o,re:i}of go)if(i.test(r))throw new re("$<serialized>",o);if(/(?:^|[^0-9a-fA-Fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/.test(r))throw new re("$<serialized>","raw-32-byte-hex-embedded");return JSON.parse(t,(o,i)=>{if(o&&Ar(o))throw new re(`$<serialized>.${o}`,"forbidden-key-name");return i}),t}function ae(e,t="$",r=new Set,n=""){if(e==null)return e;if(typeof e=="string"){let o=yo.includes(String(n).toLowerCase().replace(/[_-]/g,""));for(let{rule:i,re:s}of go)if(!(o&&i.startsWith("raw-32-byte-hex"))&&s.test(e))throw new re(t,i);return e}if(typeof e!="object"||r.has(e)||(r.add(e),ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e;if(e instanceof Map){for(let[o,i]of e.entries()){if(typeof o=="string"&&Ar(o))throw new re(`${t}[${JSON.stringify(o)}]`,"forbidden-key-name");ae(o,`${t}[key]`,r),ae(i,`${t}[${String(o)}]`,r)}return e}if(e instanceof Set){let o=0;for(let i of e.values())ae(i,`${t}[${o++}]`,r);return e}if(Array.isArray(e))return e.forEach((o,i)=>ae(o,`${t}[${i}]`,r)),e;for(let[o,i]of Object.entries(e)){if(Ar(o))throw new re(`${t}.${o}`,"forbidden-key-name");ae(i,`${t}.${o}`,r,o)}return e}var re,Qs,Zs,go,yo,Ir=l(()=>{wo();re=class extends Error{constructor(t,r){super(`secret material must never appear in a public API object (at ${t}, rule: ${r})`),this.name="SecretLeakError",this.path=t,this.rule=r}},Qs=/(private[_-]?key|secret|bearer|keystore|mnemonic|seed[_-]?phrase|passphrase|password|api[_-]?key|access[_-]?token|auth[_-]?token|session[_-]?token|signer[_-]?url|signature)/i,Zs=Object.freeze(["privkey","wif","xprv","seed"]);go=Object.freeze([{rule:"raw-32-byte-hex-key",re:/^0x[0-9a-fA-F]{64}$/},{rule:"raw-32-byte-hex-bare",re:/^[0-9a-fA-F]{64}$/},{rule:"extended-private-key",re:/\b(?:xprv|tprv|yprv|zprv)[1-9A-HJ-NP-Za-km-z]{107}\b/},{rule:"bitcoin-wif",re:/\b[59KLc][1-9A-HJ-NP-Za-km-z]{50,51}\b/},{rule:"bip39-mnemonic",re:/\b(?:[a-z]{3,8}\s+){11,23}[a-z]{3,8}\b/},{rule:"bearer-token",re:/bearer\s+[A-Za-z0-9._~+/=-]+/i},{rule:"pem-private-key",re:/-----BEGIN[A-Z ]*PRIVATE KEY-----/},{rule:"keystore-path",re:/keystore/i},{rule:"signer-url",re:/https?:\/\/\S*sign/i},{rule:"authorization-header",re:/authorization\s*:/i}]),yo=Object.freeze(["grantid","id","hash","sha256","sha256hex","checksum","txhash","transactionhash","blockhash","digest","userophash","commithash","prevhash","intenthash","canonicalhash","payloadhash","requestid"])});var kr,ey,Eo=l(()=>{Ir();kr=Object.freeze(["intent","quote_comparison","simulation","prepared","approval","signed","broadcast","settlement","balance_delta","position"]),ey=Object.freeze(Object.fromEntries(kr.map((e,t)=>[e,Object.freeze(t+1<kr.length?[kr[t+1]]:[])])))});var tc,So=l(()=>{Eo();xe();wt();tc=Object.freeze({intent:"draft",quote_comparison:"draft",simulation:"draft",prepared:"checked",approval:"approval",signed:"signed",broadcast:"submitted",settlement:"finalized",balance_delta:"compensated",position:"compensated"})});var xo=l(()=>{xe();wt();vr();ho();So()});var nc,oc,ic,Fy,qy,Uy,My,jy,ac,Hy,vo=l(()=>{nc=Object.freeze(["owner","operator","agent","viewer"]),oc=Object.freeze(["tenant","config","policy","grant","workflow","trade","receipt","audit","telemetry","context","lifecycle"]),ic=Object.freeze({read:"read",create:"create",update:"update",delete:"delete",manage:"manage",prepare:"prepare",cancel:"cancel",export:"export",approve:"approve"}),Fy=Object.freeze(["owner"]),qy=Object.freeze({ALLOW_ROLE_PERMISSION:"allow.role_permission",DENY_MISSING_CONTEXT:"deny.missing_context",DENY_INVALID_CONTEXT:"deny.invalid_context",DENY_INVALID_REQUEST:"deny.invalid_request",DENY_UNKNOWN_RESOURCE:"deny.unknown_resource",DENY_UNKNOWN_ACTION:"deny.unknown_action",DENY_UNBOUND_OBJECT:"deny.unbound_object",DENY_TENANT_MISMATCH:"deny.tenant_mismatch",DENY_RESOURCE_MISMATCH:"deny.resource_mismatch",DENY_ROLE_PERMISSION:"deny.role_permission",DENY_POLICY_NOT_APPROVER:"deny.policy_not_approver"}),Uy=new Set(nc),My=new Set(oc),jy=new Set(Object.values(ic)),ac=Object.freeze({owner:Object.freeze(["tenant:read","tenant:manage","config:read","config:manage","policy:read","policy:manage","grant:read","grant:create","grant:update","grant:delete","grant:manage","workflow:read","workflow:create","workflow:update","workflow:delete","workflow:cancel","workflow:approve","trade:read","trade:prepare","receipt:read","receipt:export","audit:read","audit:export","telemetry:read","telemetry:create","telemetry:export","context:read","context:create","context:update","context:delete","context:manage","context:export","lifecycle:read","lifecycle:create","lifecycle:update","lifecycle:delete","lifecycle:manage","lifecycle:approve","lifecycle:export"]),operator:Object.freeze(["tenant:read","config:read","policy:read","grant:read","workflow:read","workflow:create","workflow:update","workflow:cancel","trade:read","trade:prepare","receipt:read","audit:read","telemetry:read","telemetry:create","context:read","context:create","context:update","context:delete","lifecycle:read","lifecycle:create","lifecycle:update","lifecycle:manage"]),agent:Object.freeze(["tenant:read","config:read","policy:read","grant:read","workflow:read","workflow:create","workflow:update","trade:read","trade:prepare","receipt:read","telemetry:create","context:read","context:create","context:update","lifecycle:read"]),viewer:Object.freeze(["tenant:read","config:read","grant:read","workflow:read","trade:read","receipt:read","audit:read","telemetry:read","context:read","lifecycle:read"])}),Hy=Object.freeze(Object.fromEntries(Object.entries(ac).map(([e,t])=>[e,Object.freeze([...t])])))});var sc,cc,uc,Ky,Gy,Jy,Yy,Xy,Qy,Or=l(()=>{vo();sc=Object.freeze(["succeeded","denied","invalid","failed","cancelled","timed_out","unavailable","skipped"]),cc=Object.freeze(["workflow","task","intent","plan","run","event","eval"]),uc=Object.freeze(["taskId","intentId","planId","runId","eventId"]),Ky=Object.freeze({maxAttributes:24,maxKeyLength:48,maxStringLength:256,maxArrayLength:8}),Gy=new Set(sc),Jy=new Set(cc),Yy=new Set(uc),Xy=Object.freeze(["authorization","bearer","cookie","credential","password","passphrase","secret","token","privatekey","privkey","seed","mnemonic","keystore","signature","prompt","systemmessage","usermessage","assistantmessage","rawtransaction","signedtransaction","serializedtransaction","transactionbytes","calldata","callbytes","inputdata"]),Qy=Object.freeze({taskId:"x-oracle-task-id",intentId:"x-oracle-intent-id",planId:"x-oracle-plan-id",runId:"x-oracle-run-id",eventId:"x-oracle-event-id"})});var o0,Ao=l(()=>{xo();Or();o0=Object.freeze({"workflow.cancelled":"cancelled","workflow.failed":"failed"})});var l0,Io=l(()=>{Or();l0=32*1024*1024});var f0,p0,m0,ve=l(()=>{f0=Object.freeze({N:1<<17,r:8,p:1}),p0=256*1024*1024,m0=16*1024});var w0,ko=l(()=>{w0=Object.freeze({1:{name:"ethereum",mode:"mempool-private",endpoints:["https://rpc.flashbots.net/fast","https://rpc.mevblocker.io"]},8453:{name:"base",mode:"sequencer",endpoints:["https://mainnet-sequencer.base.org"]},10:{name:"optimism",mode:"sequencer",endpoints:["https://mainnet-sequencer.optimism.io"]},42161:{name:"arbitrum",mode:"sequencer",endpoints:["https://arb1-sequencer.arbitrum.io/rpc"]},56:{name:"bsc",mode:"mempool-private",endpoints:["https://rpc.48.club","https://bsc.rpc.blxrbdn.com"]},137:{name:"polygon",mode:"mempool-private",endpoints:["https://polygon-bor-rpc.publicnode.com"]},43114:{name:"avalanche",mode:"public-only",endpoints:[]},999:{name:"hyperevm",mode:"public-only",endpoints:[]}})});import{homedir as _r}from"node:os";import{join as Tr}from"node:path";var Oo,lc,E0,_o=l(()=>{Oo=process.env.ORACLE_PUBLIC_DESKTOP==="1",lc=Oo?process.env.ORACLE_CONFIG_DIR||Tr(_r(),".config","oracle"):Tr(_r(),".config","oracle"),E0=Oo?lc:Tr(_r(),".config","mad-desk")});var I0,k0,O0,To=l(()=>{_o();I0="0".repeat(64),k0=Object.freeze({PREPARE:"exec.prepare",SIGN:"exec.sign",BROADCAST:"exec.broadcast",POLICY_REJECT:"policy.reject",AUTH_GRANT:"auth.grant",AUTH_OK:"auth.verify.ok",AUTH_FAIL:"auth.verify.fail"}),O0=Promise.resolve()});var Cr=l(()=>{To();de();ve();Be()});var No=l(()=>{});var Po={};Je(Po,{SIGN_TIME_REVIEW_VERSION:()=>dc,SignTimeReviewSecretError:()=>qe,createSignTimeReview:()=>Lo});function Nr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string"){let o=e.trim().split(/\s+/);if(wc.test(e)||gc.has(o.length)&&o.every(i=>/^[a-z]+$/i.test(i)))throw new qe(t);return e}if(typeof e=="bigint")return e.toString();if(typeof e=="number"){if(!Number.isSafeInteger(e))throw new TypeError(`sign-time review: safe integer required at ${t}`);return e}if(Array.isArray(e))return e.map((o,i)=>Nr(o,`${t}[${i}]`,r));pe(e,t);let n={};for(let o of Object.keys(e).sort()){let i=o.replace(/[^a-z0-9]/gi,"");if(hc.test(i))throw new qe(`${t}.${o}`);e[o]!==void 0&&(n[o]=Nr(e[o],`${t}.${o}`,o))}return n}function pe(e,t){if(e==null||typeof e!="object"||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError(`sign-time review: ${t} must be a plain object`);return e}function Ue(e,t){if(e==null||e==="")throw new TypeError(`sign-time review: ${t} required`);return e}function Ae(e,t){let r=String(Ue(e,t)).toLowerCase();if(!fc.test(r))throw new TypeError(`sign-time review: ${t} must be an EVM address`);return r}function ne(e,t,{positive:r=!1}={}){try{let n=BigInt(Ue(e,t));if(n<0n||r&&n===0n)throw new Error;return n.toString()}catch{throw new TypeError(`sign-time review: ${t} must be an unsigned integer`)}}function Rr(e,t){if(typeof e!="string"||e.length===0||e.length>500||e!==e.trim())throw new TypeError(`sign-time review: ${t} must be non-empty text`);return e}function Ro(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))Ro(t);Object.freeze(e)}return e}function yc(e,t){if(typeof e=="boolean")return{passed:e,reason:e?"passed":"failed"};pe(e,t);let r=e.passed??e.ok??e.allowed;if(typeof r!="boolean")throw new TypeError(`sign-time review: ${t} needs a boolean result`);let n=e.reason??e.message??e.name??(r?"passed":"failed");return{...e,passed:r,reason:Rr(String(n),`${t}.reason`)}}function bc(e){if(!Array.isArray(e))throw new TypeError("sign-time review: policyChecks must be an array");let t=e.map((n,o)=>yc(n,`policyChecks[${o}]`)),r=t.filter(n=>!n.passed);return{checks:t,passed:t.length-r.length,failed:r.length,reasons:r.map(n=>n.reason)}}function Ec(e){if(e==null)return null;if(pe(e,"simulation"),typeof e.status!="string"||!["ok","success","failed","error","unavailable","unknown"].includes(e.status))throw new TypeError("sign-time review: simulation.status is invalid");if(e.willRevert!==!0&&e.willRevert!==!1&&e.willRevert!==null)throw new TypeError("sign-time review: simulation.willRevert must be boolean or null");let t={status:e.status,willRevert:e.willRevert??null,summary:Rr(String(e.summary??"simulation result recorded"),"simulation.summary")};return e.gasEstimate!=null&&(t.gasEstimate=ne(e.gasEstimate,"simulation.gasEstimate")),e.gasLimit!=null&&(t.gasLimit=ne(e.gasLimit,"simulation.gasLimit")),t}function Sc(e){if(e==null)return null;if(!Array.isArray(e)||e.length===0)throw new TypeError("sign-time review: assetDeltas must be a non-empty array");return e.map((t,r)=>{pe(t,`assetDeltas[${r}]`);let n=ne(t.before,`assetDeltas[${r}].before`),o=ne(t.after,`assetDeltas[${r}].after`),i=(BigInt(o)-BigInt(n)).toString(),s;try{s=t.delta==null?i:BigInt(t.delta).toString()}catch{throw new TypeError(`sign-time review: assetDeltas[${r}].delta must be an integer`)}if(s!==i)throw new TypeError(`sign-time review: assetDeltas[${r}].delta does not match before/after`);return{...t,asset:Rr(String(Ue(t.asset??t.token,`assetDeltas[${r}].asset`)),`assetDeltas[${r}].asset`),before:n,after:o,delta:s}})}function xc(e){if(e==null)return[];if(!Array.isArray(e))throw new TypeError("sign-time review: approvalDeltas must be an array");return e.map((t,r)=>{pe(t,`approvalDeltas[${r}]`);let n=ne(t.amount??t.after,`approvalDeltas[${r}].amount`);if(t.revokeLike!=null&&typeof t.revokeLike!="boolean")throw new TypeError(`sign-time review: approvalDeltas[${r}].revokeLike must be boolean`);return{token:Ae(t.token,`approvalDeltas[${r}].token`),spender:Ae(t.spender,`approvalDeltas[${r}].spender`),owner:Ae(t.owner,`approvalDeltas[${r}].owner`),amount:n,revokeLike:t.revokeLike??BigInt(n)===0n}})}function Lo(e={}){pe(e,"input");let t=Nr(e),r=t.tx==null?t:pe(t.tx,"tx"),n=ne(t.chainId??r.chainId,"chainId",{positive:!0}),o=Ae(t.account??t.from??r.from,"account/from"),i=Ae(t.destination??t.to??r.to,"destination/to"),s=String(Ue(t.prepareHash,"prepareHash")).toLowerCase();if(!mc.test(s))throw new TypeError("sign-time review: prepareHash must be a 32-byte hash");let p=t.route??t.venue;if(p==null)throw new TypeError("sign-time review: route/venue required");let c=t.decodedCalldata??t.decodedAction;if(c==null)throw new TypeError("sign-time review: decodedCalldata or decodedAction required");let f=String(Ue(t.calldata??t.data??r.data,"calldata/data")).toLowerCase();if(!pc.test(f))throw new TypeError("sign-time review: calldata/data must be even-length hex");let u=t.policyChecks!==void 0&&t.policyChecks!==null,d=bc(u?t.policyChecks:[]),h=Ec(t.simulation),m=Sc(t.assetDeltas),w=xc(t.approvalDeltas),g=t.allowlistHits??[];if(!Array.isArray(g))throw new TypeError("sign-time review: allowlistHits must be an array");let y=h?.willRevert===!0||["failed","error"].includes(h?.status),S=h!=null&&h.willRevert===!1&&["ok","success"].includes(h.status),P=y||d.failed>0?"BLOCKED":S&&u&&d.checks.length>0&&m!=null?"READY":"UNKNOWN",E=typeof c=="string"?c:c.method??c.action??c.type??"transaction",A=`${P}: review ${E} on chain ${n}; policy ${d.passed} passed, ${d.failed} failed; ${m?.length??0} asset delta${m?.length===1?"":"s"}; local signature required`,N={reviewVersion:1,status:P,requiresLocalSignature:!0,signingLocal:!0,custody:"none",execution:"review-only",chainId:n,account:o,from:o,route:p,venue:t.venue??(typeof p=="string"?p:p.venue??p.provider??null),destination:i,to:i,...t.spender==null?{}:{spender:Ae(t.spender,"spender")},prepareHash:s,...t.decodedCalldata!==void 0?{decodedCalldata:t.decodedCalldata}:{decodedAction:t.decodedAction},calldata:f,data:f,selector:f.length>=10?f.slice(0,10):null,value:ne(t.value??r.value??0,"value"),...(t.gasEstimate??r.gasEstimate)==null?{}:{gasEstimate:ne(t.gasEstimate??r.gasEstimate,"gasEstimate")},...(t.gasLimit??r.gasLimit)==null?{}:{gasLimit:ne(t.gasLimit??r.gasLimit,"gasLimit")},simulation:h,policyChecks:d,allowlistHits:g,assetDeltas:m,approvalDeltas:w,summary:A};return Ro(N)}var dc,fc,pc,mc,hc,wc,gc,qe,Lr=l(()=>{dc=1,fc=/^0x[0-9a-f]{40}$/,pc=/^0x(?:[0-9a-f]{2})*$/,mc=/^(?:0x)?[0-9a-f]{64}$/,hc=/(privatekey|privkey|secretkey|seedphrase|mnemonic|passphrase|password|keystore|keymaterial|wif|xprv|xpriv|bearer|authorization|signature|apikey|credential)/i,wc=/\b(?:[5KL][1-9A-HJ-NP-Za-km-z]{50,51}|xprv[0-9A-Za-z]{50,})\b/,gc=new Set([12,15,18,21,24]),qe=class extends Error{constructor(t){super(`sign-time review refused: secret-bearing field at ${t}`),this.name="SignTimeReviewSecretError",this.code="SIGN_TIME_REVIEW_SECRET"}}});import{readFileSync as D0,readdirSync as F0,existsSync as vc}from"node:fs";import{dirname as Ac,join as Me}from"node:path";import{fileURLToPath as Ic}from"node:url";function kc(){let e=[Me(je,"descriptors"),Me(je,"clear-sign","descriptors"),Me(je,"..","clear-sign","descriptors"),Me(je,"..","..","clear-sign","descriptors"),Me(je,"..","..","..","clear-sign","descriptors")];for(let t of e)if(vc(t))return t;return e[0]}var je,j0,H0,$o=l(()=>{fe();je=Ac(Ic(import.meta.url));j0=kc(),H0=(1n<<256n)-1n});var Bo=l(()=>{Lr();fe();$o()});import{Wallet as X0}from"ethers";import{base58 as Z0}from"@scure/base";import{ed25519 as tb}from"@noble/curves/ed25519.js";import{NETWORK as nb,TEST_NETWORK as ob,WIF as ib,p2wpkh as ab}from"@scure/btc-signer";import{pubECDSA as cb}from"@scure/btc-signer/utils.js";var Do=l(()=>{});var db,fb,pb,mb,hb,wb,gb,yb,bb,Eb,Sb,Fo=l(()=>{Cr();db=Object.freeze(["spot-limit-create","spot-limit-cancel","spot-order-status"]),fb=Object.freeze(["binance","bybit","okx","coinbase"]),pb=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"}),mb=Object.freeze({binance:"/api/v3",bybit:"/v5/order",okx:"/api/v5/trade",coinbase:"/orders"}),hb=Object.freeze(["version","surface","kind","venue","credentialRef","symbol","base","quote","side","baseSize","limitPrice","maxQuoteNotional","timeInForce","clientOrderId","expiresAtMs","venueOrderId","nonce","grantId","artifactHash"]),wb=Object.freeze(["market-create","withdraw","transfer","subaccount","leverage","futures","margin","convert","api-key"]),gb=Object.freeze(["url","host","path","method","headers","signature","apiKey","apiSecret","passphrase","privateKey","redirect","proxy"]),yb=Object.freeze(["ccxt","binance-api-node","node-binance-api","coinbase-advanced-node","@okx-dex/okx-dex-sdk","bybit-api"]),bb=Object.freeze({perOrderQuote:"sealed-owner-policy",dailyGrossQuote:"sealed-owner-policy",scope:Object.freeze(["per-order","UTC-day","account","venue","quote"]),envelopeFieldIsNotCeiling:!0}),Eb=Object.freeze({binanceRecvWindowMs:5e3,bybitWindowMs:5e3,maxLocalSkewMs:2e3}),Sb=Object.freeze({perSecond:1,perMinute:30,bind:"tighter"})});var qo=l(()=>{ve()});var Tc,Uo,yt=l(()=>{Tc=Object.freeze({binance:Object.freeze({create:["POST","/api/v3/order"],cancel:["DELETE","/api/v3/order"],status:["GET","/api/v3/order"]}),bybit:Object.freeze({create:["POST","/v5/order/create"],cancel:["POST","/v5/order/cancel"],status:["GET","/v5/order/realtime"]}),okx:Object.freeze({create:["POST","/api/v5/trade/order"],cancel:["POST","/api/v5/trade/cancel-order"],status:["GET","/api/v5/trade/order"]}),coinbase:Object.freeze({create:["POST","/orders"],cancel:["DELETE","/orders/{order_id}"],status:["GET","/orders/{order_id}"]})}),Uo=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"})});var Mo=l(()=>{yt()});var Nb,jo=l(()=>{yt();Mo();Nb=256*1024});var Ho=l(()=>{yt();jo()});var zo=l(()=>{ve()});import B from"node:path";import Cc from"node:os";import{createHash as Nc,randomBytes as IE}from"node:crypto";import{Interface as Pr,keccak256 as OE}from"ethers";import{Transaction as TE}from"@scure/btc-signer";import{ed25519 as NE}from"@noble/curves/ed25519.js";function Wo(e){let t=process.env.ORACLE_SIGNER_STATE_DIR||B.join(process.env.XDG_STATE_HOME||B.join(Cc.homedir(),".local","state"),"oracle"),r=Nc("sha256").update(B.resolve(e)).digest("hex").slice(0,16);return{vault:B.join(e,"vault.json"),policy:B.join(e,"signer-policy.json"),policyKey:B.join(e,"policy-integrity-key"),policyAnchor:B.join(t,`signer-policy-${r}.high-water`),ledger:B.join(e,"signer-ledger.json"),ledgerAnchor:B.join(t,`signer-ledger-${r}.high-water`),executionOutbox:B.join(e,"signer-execution-outbox.json"),cexOrders:B.join(e,"cex-orders.json"),cexOrdersAnchor:B.join(t,`cex-orders-${r}.high-water`),token:B.join(e,"signer-token"),lock:B.join(t,`signer-${r}.lock`),workflowLedger:B.join(e,"workflow-events.jsonl")}}var cS,uS,lS,Vo=l(()=>{to();no();Ao();Io();Be();ve();ko();Cr();No();fe();Bo();pt();dt();wr();lr();fr();ft();hr();dr();mr();sr();cr();pr();Do();Fo();qo();Ho();zo();cS=new Pr(["function collection() view returns (address)","function token() view returns (address)","function robinhoodSwapFeeWei() view returns (uint256)","function quoteSpecificBuy(uint256 tokenId) view returns (uint256 totalCost,uint256 baseCost,uint256 fee,uint256 protocolFee,bool available)","function quoteSellNFT() view returns (uint256 netPayout,uint256 grossPayout,uint256 fee,uint256 protocolFee)","function inventory(uint256 tokenId) view returns (bool)","function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),uS=new Pr(["function decimals() view returns (uint8)","function allowance(address owner,address spender) view returns (uint256)"]),lS=new Pr(["function ownerOf(uint256 tokenId) view returns (address)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner,address operator) view returns (bool)"])});import $r from"node:fs";import Ko from"node:path";import{homedir as Rc}from"node:os";function Lc(){return process.env.ORACLE_CONFIG_DIR||Ko.join(Rc(),".config","oracle")}function He(){let e=Wo(Ko.join(Lc(),"signer")),t=$r.existsSync(e.vault),r=$r.existsSync(e.lock),n=t?r?"disarmed":"armed-owner-confirmed":"inert-no-key";return{vaultExists:t,policyConfigured:$r.existsSync(e.policy),armed:t&&!r,disarmed:r,capabilities:{swap:n,bridge:n},autonomous:!1,note:"Keys stay on this machine. Exact confirmation is required before any broadcast."}}var SS,Br=l(()=>{nr();Mn();Vo();ve();SS=Object.freeze([{type:"function",function:{name:"vault_status",description:"Read local Oracle vault/signer readiness. Never returns key material.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"signer_status",description:"Ping the loopback signer. Fails closed if it is not running.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"signer_pending",description:"List pending local-signer artifacts. Read-only. Does not approve, sign, or broadcast.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"signer_queue",description:"Queue a prepared unsigned artifact on the loopback signer. Does not broadcast.",parameters:{type:"object",properties:{artifact:{type:"object"}},required:["artifact"],additionalProperties:!1}}},{type:"function",function:{name:"signer_deny",description:"Drop one pending local-signer artifact. Nothing signed.",parameters:{type:"object",properties:{id:{type:"string"},digest:{type:"string"}},additionalProperties:!1}}},{type:"function",function:{name:"signer_execute",description:"Broadcast one already-confirmed local artifact. Requires a one-use confirmationNonce from the local signer TTY confirm. Cannot mint confirmation itself.",parameters:{type:"object",properties:{artifact:{type:"object"},confirmationNonce:{type:"string",minLength:32,maxLength:128}},required:["artifact","confirmationNonce"],additionalProperties:!1}}},{type:"function",function:{name:"signer_disarm",description:"Global kill switch. Stops the local signer from broadcasting.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"receipt_report",description:"Receipt or it did not happen. Requires transactionHash/hash/txid.",parameters:{type:"object",properties:{receipt:{type:"object"},transactionHash:{type:"string"},hash:{type:"string"},txid:{type:"string"}},additionalProperties:!1}}},{type:"function",function:{name:"watch_create",description:"Create an alert-only watch. Never execute.",parameters:{type:"object",properties:{chain:{type:"string"},token:{type:"string"},condition:{type:"string"},note:{type:"string"}},required:["chain","token","condition"],additionalProperties:!1}}},{type:"function",function:{name:"watch_list",description:"List local alert-only watches.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"portfolio_snapshot",description:"How to read the one portfolio snapshot. knownUsd is incomplete if a provider is missing.",parameters:{type:"object",properties:{},additionalProperties:!1}}}])});function bt(e){return String(e||"").trim()||void 0}function $c(e,{required:t=!1}={}){let r=bt(e)?.toLowerCase();if(!r){if(t)throw new Error("model provider is required");return}if(!Pc.has(r))throw new Error(`unsupported provider: ${r}`);return r}function Bc(e,{required:t=!1}={}){let r=bt(e);if(!r){if(t)throw new Error("model is required");return}if(r.includes("..")||r.startsWith("/")||!/^[a-zA-Z0-9._:/-]{1,200}$/.test(r))throw new Error("invalid model id");return r}function Dc(e){let t=bt(e);if(!t||t.length>2048)throw new Error("invalid custom base URL");let r;try{r=new URL(t)}catch{throw new Error("invalid custom base URL")}let n=r.hostname.toLowerCase().replace(/^\[|\]$/g,""),o=n==="localhost"||n==="127.0.0.1"||n==="::1";if(r.protocol!=="https:"&&!(r.protocol==="http:"&&o)||r.username||r.password||r.search||r.hash)throw new Error("custom base URL must use HTTPS or loopback HTTP without credentials, query, or fragment");return r.toString().replace(/\/+$/,"")}function Go({provider:e,model:t,baseUrl:r}={},{requireModel:n=!1}={}){let o=$c(e),i=Bc(t,{required:n});if(o==="custom")return{provider:o,...i?{model:i}:{},baseUrl:Dc(r)};if(bt(r))throw new Error("baseUrl is only supported for the custom provider");return{...o?{provider:o}:{},...i?{model:i}:{}}}var Pc,Jo=l(()=>{Pc=new Set(["openrouter","openai","anthropic","xai","deepseek","gemini","kimi","mistral","nous","qwen","glm","local","ollama","custom","anthropic-oauth","openai-codex","xai-oauth"])});import Yo from"node:fs";import Fc from"node:path";function Uc(){return Fc.join(ye(),"model.json")}function Ie(e){return String(e||"").trim()||void 0}function Mc(e={}){let t=Ie(e.backend)?.toLowerCase()||"auto",r=Go({provider:e.provider,model:e.model,baseUrl:e.baseUrl},{requireModel:t==="standalone"}),n=Ie(e.apiKeyEnv),o=Number.parseInt(String(e.contextLength||""),10),i=Object.fromEntries(Object.entries(e.contextByModel||{}).filter(([,u])=>Number.isSafeInteger(u)&&u>0)),s=Ie(e.reasoningEffort),p=Ie(e.computeHost||e.remoteHost),c=Ie(e.computeUser||e.remoteUser),f=Ie(e.computePath||e.remotePath);if(!qc.has(t))throw new Error(`unsupported backend: ${t}`);if(process.env.ORACLE_PUBLIC_DESKTOP==="1"&&["remote","arch"].includes(t))throw new Error("remote compute backends are disabled in the public desktop");if(n&&!/^[A-Z][A-Z0-9_]*$/.test(n))throw new Error("api key env must be an uppercase environment variable name");if(t==="remote"&&!p)throw new Error("remote backend requires computeHost");return{backend:t,...r,...n?{apiKeyEnv:n}:{},...Number.isFinite(o)&&o>0?{contextLength:o}:{},...Object.keys(i).length?{contextByModel:i}:{},...s?{reasoningEffort:s}:{},...p?{computeHost:p}:{},...c?{computeUser:c}:{},...f?{computePath:f}:{}}}function Xo(){let e=Uc();if(!Yo.existsSync(e))return null;try{return Mc(JSON.parse(Yo.readFileSync(e,"utf8")))}catch{return null}}var qc,Qo=l(()=>{Xe();Jo();qc=new Set(["auto","standalone","hermes","remote","arch"])});function Dr(e,t){if(!e||typeof e!="object"||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError(`${t} must be a plain object`);return e}function Fr(e,t="control input"){try{ae(e,t),bo(e)}catch(r){throw new TypeError(`${t} contains secret or custody material: ${r.message}`)}return e}function ze(e,{required:t=[],optional:r=[]}={},n="object"){Dr(e,n);let o=new Set([...t,...r]),i=Object.keys(e).filter(s=>!o.has(s));if(i.length)throw new TypeError(`${n} has unknown field ${i[0]}`);for(let s of t)if(!Object.hasOwn(e,s))throw new TypeError(`${n}.${s} is required`);return e}function qr(e,t,r=200,{lower:n=!1}={}){if(typeof e!="string"||!e.trim()||e.length>r||jc.test(e))throw new TypeError(`${t} must be non-empty control-free text up to ${r} characters`);let o=e.trim();return n?o.toLowerCase():o}function We(e,t,r=80){let n=qr(e,t,r,{lower:!0});if(!/^[a-z0-9][a-z0-9._:-]*$/.test(n))throw new TypeError(`${t} must be a lowercase identifier`);return n}function Et(e,t,{positive:r=!1}={}){if(!Number.isSafeInteger(e)||e<0||r&&e===0)throw new TypeError(`${t} must be a ${r?"positive":"non-negative"} safe integer`);return e}function H(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))H(t);Object.freeze(e)}return e}var jc,Ur=l(()=>{Fe();Ir();jc=/[\u0000-\u001f\u007f]/});function Zo({family:e,chainId:t},r="chain"){let n=We(e,`${r}.family`,40),o;if(n==="evm"){if(typeof t=="number")o=String(Et(t,`${r}.chainId`,{positive:!0}));else if(o=qr(t,`${r}.chainId`,40),!/^[1-9][0-9]*$/.test(o))throw new TypeError(`${r}.chainId must be a positive decimal EVM chain id`)}else o=We(t,`${r}.chainId`,80);return{family:n,chainId:o}}function Wc(e,t="chain"){return ze(e,{required:["family","chainId"]},t),H(Zo(e,t))}function ei(e,t="finality rule"){Fr(e,t),Dr(e,t);let r=e.rule;if(!Hc.includes(r))throw new TypeError(`${t}.rule must be confirmations, finalizedTag, or checkpoint`);let n=r==="confirmations"?"confirmations":r;ze(e,{required:["family","chainId","rule",n]},t);let o=Zo(e,t);return r==="confirmations"?{...o,rule:r,confirmations:Et(e.confirmations,`${t}.confirmations`,{positive:!0})}:{...o,rule:r,[n]:We(e[n],`${t}.${n}`,80)}}function Mr(e){if(!Array.isArray(e))throw new TypeError("finality policy rules must be an array");let t=e.map((n,o)=>ei(n,`finality policy rule ${o}`)),r=new Set;for(let n of t){let o=`${n.family}\0${n.chainId}`;if(r.has(o))throw new TypeError(`duplicate finality rule for ${n.family}:${n.chainId}`);r.add(o)}return H({policyVersion:1,rules:t})}function Vc(e){if(ze(e,{required:["policyVersion","rules"]},"finality policy"),e.policyVersion!==1||!Array.isArray(e.rules))throw new TypeError("unsupported finality policy");return Mr(e.rules)}function ti(e,t){let r=Wc(t,"finality query"),o=Vc(e).rules.find(i=>i.family===r.family&&i.chainId===r.chainId);return o?H({status:"KNOWN",...r,rule:o}):H({status:me.UNKNOWN,reason:"MISSING_FINALITY_RULE",...r,rule:null})}function Kc(e,t){if(e==null)return null;Fr(e,"finality evidence");let r=t.rule==="confirmations"?"confirmations":t.rule;if(ze(e,{required:["status"],optional:[r]},"finality evidence"),!zc.includes(e.status))throw new TypeError("finality evidence.status is unknown");let n={status:e.status};return e[r]!=null&&(n[r]=t.rule==="confirmations"?Et(e.confirmations,"finality evidence.confirmations",{positive:!0}):We(e[r],`finality evidence.${r}`,80)),n}function ri(e,t){if(!e||e.status===me.UNKNOWN||e.rule==null)return H({status:me.UNKNOWN,final:!1,reason:"MISSING_FINALITY_RULE"});let r=ei(e.rule??e,"resolved finality rule"),n=Kc(t,r);if(n==null)return H({status:me.UNKNOWN,final:!1,reason:"MISSING_FINALITY_EVIDENCE"});if(n.status!=="LIVE")return H({status:me.UNKNOWN,final:!1,reason:`${n.status}_EVIDENCE`});let o=!1;return r.rule==="confirmations"?o=n.confirmations!=null&&n.confirmations>=r.confirmations:r.rule==="finalizedTag"?o=n.finalizedTag===r.finalizedTag:o=n.checkpoint===r.checkpoint,H({status:o?me.FINAL:me.INCLUDED,final:o,reason:o?"PINNED_RULE_SATISFIED":"PINNED_RULE_NOT_SATISFIED",rule:r})}var Hc,me,zc,ni=l(()=>{Ur();Hc=Object.freeze(["confirmations","finalizedTag","checkpoint"]),me=Object.freeze({UNKNOWN:"UNKNOWN",INCLUDED:"INCLUDED",FINAL:"FINAL"}),zc=Object.freeze(["LIVE","STALE","UNKNOWN","UNAVAILABLE"])});function Jc(e){if(e===!0||e===1||e==="1")return"SUCCESS";if(e===!1||e===0||e==="0")return"FAIL";if(typeof e!="string")return"UNKNOWN";let t=e.trim().toUpperCase();return["SUCCESS","SUCCEEDED","OK","EXECUTED"].includes(t)?"SUCCESS":["FAIL","FAILED","FAILURE","REVERTED","REJECTED"].includes(t)?"FAIL":"UNKNOWN"}function oi(e){return typeof e=="string"&&["FAIL","FAILED","FAILURE","ORPHAN","ORPHANED","REVERTED"].includes(e.trim().toUpperCase())}function Hr(e){return e==null?e:Array.isArray(e)?e.map(Hr):Ve(e)?Object.fromEntries(Object.keys(e).sort().map(t=>[t,Hr(e[t])])):String(e)}function Yc(e,t,r,n){let o=O(e.finalityEvidence,n?.finality,e.evidence),i=O(e.finalityPolicy,e.policy);try{return i==null&&Ve(e.finalityRule)&&(i=Mr([{family:t,chainId:r,...e.finalityRule}])),i==null||t==null||r==null?{status:"UNKNOWN",final:!1,reason:"MISSING_FINALITY_RULE"}:ri(ti(i,{family:t,chainId:r}),o)}catch{return{status:"UNKNOWN",final:!1,reason:"MALFORMED_FINALITY_EVIDENCE"}}}function D(e,t,r){r!=null&&(e[t]=r)}function Xc(e){return e==null?null:String(e).trim().toLowerCase()}function jr(...e){let t=e.map(Xc).filter(Boolean);return t.length<=1||t.every(r=>r===t[0])}function ii(e={}){if(!Ve(e))throw new TypeError("verified receipt: input object required");let t=mt(e),r=O(t.actionReceipt,t.receipt),n=Ve(r)?r:t,o=O(t.observation,t.chainObservation,t.observedReceipt),i=Ve(o),s=O(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash),p=O(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family),c=O(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),f=!jr(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash)||!jr(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family)||!jr(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),u=Yc(t,p,c,i&&!f?o:null),d=Jc(O(o?.receiptStatus,o?.executionStatus,o?.status)),h=O(t.reconciliationStatus,t.reconciliation?.status,o?.reconciliationStatus),m=O(t.finalityState,t.finalityEvidence?.status,t.evidence?.status,o?.finalityState),w="UNKNOWN";oi(h)||!f&&(i&&d==="FAIL"||oi(m))?w="FAIL":!f&&s&&i&&d==="SUCCESS"&&["INCLUDED","FINAL"].includes(u.status)&&(w="SUCCESS");let g={verifiedReceiptVersion:Gc,status:w};f&&(g.reason="REFERENCE_MISMATCH"),D(g,"txHash",s),D(g,"chain",O(t.chain,n.chain,o?.chain)),D(g,"family",p),D(g,"chainId",c),D(g,"block",O(o?.block,t.block)),D(g,"blockState",O(o?.blockState,o?.inclusionState)),g.finalityState=u.status,D(g,"confirmations",O(o?.confirmations,o?.finality?.confirmations,t.finalityEvidence?.confirmations,t.evidence?.confirmations)),D(g,"observedAt",O(o?.observedAt,t.observedAt)),D(g,"route",O(t.route,n.route)),D(g,"prepareHash",O(t.prepareHash,n.prepareHash)),D(g,"policyOutcome",O(t.policyOutcome,n.policyOutcome,n.policyChecks));let y=O(t.balanceChanges,o?.balanceChanges,o?.balances,n.balanceChanges,n.balances);return y!=null&&(g.balanceChanges=Hr(y)),D(g,"createdAt",O(t.createdAt,n.createdAt)),D(g,"submittedAt",O(t.submittedAt,n.submittedAt)),D(g,"finalizedAt",O(t.finalizedAt,o?.finalizedAt)),D(g,"timestamps",O(t.timestamps,n.timestamps,o?.timestamps)),H(g)}var Gc,FS,O,Ve,ai=l(()=>{Fe();ni();Ur();Gc=1,FS=Object.freeze(["SUCCESS","FAIL","UNKNOWN"]),O=(...e)=>e.find(t=>t!=null),Ve=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype});var ci={};Je(ci,{observeEvmReceipt:()=>si,verifyEvmReceipt:()=>eu});function Zc(e){if(e==null)return null;let t=typeof e=="number"?e:Number.parseInt(String(e),16);return Number.isSafeInteger(t)?t:null}async function si({txHash:e,chainId:t,rpcUrl:r},n={}){let o=String(e||"").trim().toLowerCase();if(!Qc.test(o))throw new TypeError("observe receipt: txHash must be a 32-byte hash");let i=Number(t);if(!Number.isSafeInteger(i)||i<=0)throw new TypeError("observe receipt: chainId required");let s=n.transactionReceipt||xn,p=n.rpcCall||J,c={...n.rpcOptions||{},...r?{rpcUrl:r}:{}},f;try{f=await s({txHash:o,chainId:i},c)}catch(m){return{observation:null,reason:`RPC_UNAVAILABLE: ${m.message}`}}if(!f||f.receipt==null)return{observation:null,reason:f?.reason||"receipt pending"};let u=null,d=f.blockNumber;if(Number.isSafeInteger(d))try{let m=Zc(await p(i,"eth_blockNumber",[],c));m!=null&&m>=d&&(u=m-d+1)}catch{}let h={txHash:o,family:"evm",chainId:String(i),receiptStatus:f.status==="success"?"SUCCESS":f.status==="reverted"?"FAIL":"UNKNOWN",block:d==null?void 0:String(d),observedAt:new Date().toISOString(),finality:{status:"LIVE",...u==null?{}:{confirmations:u}}};return u!=null&&(h.confirmations=u),{observation:h,reason:null}}async function eu({txHash:e,chainId:t,confirmations:r=1,rpcUrl:n},o={}){let{observation:i,reason:s}=await si({txHash:e,chainId:t,rpcUrl:n},o),p=ii({txHash:String(e).trim().toLowerCase(),family:"evm",chainId:String(Number(t)),finalityRule:{rule:"confirmations",confirmations:r},...i?{observation:i}:{}});return{receipt:p,observed:!!i,final:p.finalityState==="FINAL",requiredConfirmations:r,reason:s}}var Qc,ui=l(()=>{Y();ai();Qc=/^0x[0-9a-f]{64}$/});var li={};Je(li,{classifyReceipt:()=>Pe,configDir:()=>ou,firstHourReport:()=>zr,probeReceiptModule:()=>au,probeReviewModule:()=>iu,venueMap:()=>St});import tu from"node:path";import{homedir as ru}from"node:os";function ou(e=process.env){return e.ORACLE_CONFIG_DIR||tu.join(ru(),".config","oracle")}function St({env:e=process.env,vault:t=null}={}){let r=t||He(),n=[];for(let[o,i]of Object.entries(rt)){let s=(i.rpcEnv||[]).some(c=>String(e[c]||"").trim()),p="prepare";i.evm?s&&(p="live"):p="unavailable",n.push({key:o,chainId:i.chainId,name:i.name,family:"evm",status:p,execute:!!(r.vaultExists&&r.armed&&!r.disarmed),note:s?"rpc configured":"public read/prepare; set RPC for live reads"})}return n.push({key:"solana",chainId:null,name:"Solana",family:"sol",status:"prepare",execute:!1,note:"Jupiter quote/prepare; local sol signer"},{key:"bitcoin",chainId:null,name:"Bitcoin",family:"btc",status:"prepare",execute:!1,note:"Esplora read; local btc signer"},{key:"hyperliquid-l1",chainId:null,name:"Hyperliquid L1",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not an EVM signer family"},{key:"polymarket",chainId:null,name:"Polymarket",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not a signer family"}),n}function zr({env:e=process.env,model:t=Xo(),vault:r=He(),signerReachable:n=!1,quote:o=null,reviewAvailable:i=!1,receiptAvailable:s=!1}={}){let p=[],c=(m,w,g,y=null)=>p.push({id:m,status:w,detail:g,fix:y}),f=(()=>{let[m,w]=process.versions.node.split(".").map(Number);return m>20||m===20&&w>=19})();c("node",f?"ok":"fail",`node ${process.versions.node}`,f?null:"install node >= 20.19"),t?t.backend==="hermes"?c("model","warn","backend=hermes (opt-in attach)","oracle model --backend standalone"):c("model","ok",`${t.backend||"auto"} ${t.provider||""} ${t.model||""}`.trim()):c("model","fail","no model.json","oracle setup model"),r.vaultExists?r.disarmed?c("vault","warn","vault present, DISARMED","oracle signer (re-arm after confirm)"):c("vault",r.armed?"ok":"warn",r.armed?"present, armed":"present, not armed"):c("vault","fail","no local vault","oracle sign init");let u=e.ORACLE_SIGNER_HOST||"127.0.0.1";if(nu.has(u)?c("signer",n?"ok":"warn",n?`loopback ${u}:${e.ORACLE_SIGNER_PORT||9462}`:"loopback signer not reachable",n?null:"oracle signer"):c("signer","fail",`signer host ${u} is not loopback`,"unset ORACLE_SIGNER_HOST"),!o)c("quote","warn","quote not probed",null);else if(o.ok){let m=String(o.detail||"net quote returned");c("quote","ok",m.length>140?`${m.slice(0,140)}\u2026`:m)}else c("quote","warn",o.detail||"quote unavailable","check network / oracle data serve");c("review",i?"ok":"fail",i?"sign-time review renders decoded action, policy hits, approval deltas":"sign-time review module missing from this build",i?null:"reinstall @oracle-agent/oracle (src/control/sign-time-review.mjs)"),c("receipt",s?"ok":"fail",s?"oracle receipt verifies on-chain state (SUCCESS/FAIL/UNKNOWN, finality-pinned)":"verified-receipt observer missing from this build",s?null:"reinstall @oracle-agent/oracle (src/desk/observe-receipt.mjs)");let d=p.some(m=>m.status==="fail"),h=p.filter(m=>m.status==="ok").length;return{ok:!d,checks:p,firstRunScore:{ok:h,total:p.length,label:`${h}/${p.length} first-run hops green`},venues:St({env:e,vault:r})}}async function iu(){try{return typeof(await Promise.resolve().then(()=>(Lr(),Po))).createSignTimeReview=="function"}catch{return!1}}async function au(){try{let e=await Promise.resolve().then(()=>(ui(),ci));return typeof e.observeReceipt=="function"||typeof e.default=="function"||Object.values(e).some(t=>typeof t=="function")}catch{return!1}}var nu,Wr=l(()=>{Dt();Br();Qo();nr();nu=new Set(["127.0.0.1","::1","localhost"])});var fi={};Je(fi,{classifyReceipt:()=>Pe,default:()=>uu,detailText:()=>di,firstHourReport:()=>zr,probeQuote:()=>cu,probeSigner:()=>su,symbol:()=>Ke,vaultStatus:()=>He});async function su(e=process.env){let t=e.ORACLE_SIGNER_HOST||"127.0.0.1",r=e.ORACLE_SIGNER_PORT||9462;try{return(await fetch(`http://${t}:${r}/status`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}function Ke(e){let t=String(e??"?").replace(/[^\w.$-]/g,"");return t.length>12?`${t.slice(0,12)}...`:t||"?"}function di(e,t=120){let r=String(e??"").replace(/[\u0000-\u001f\u007f-\u009f]/g," ").replace(/\s+/g," ").trim();return r?r.length>t?`${r.slice(0,t)}...`:r:"quote failed"}async function cu(){try{let e=await fetch("https://api.dexscreener.com/latest/dex/search?q=WETH%20USDC",{signal:AbortSignal.timeout(4e3)});if(!e.ok)return{ok:!1,detail:`dexscreener ${e.status}`};let r=(await e.json())?.pairs?.[0];return!r?.chainId||!r?.priceUsd?{ok:!1,detail:"no pair"}:{ok:!0,detail:`${Ke(r.chainId)} ${Ke(r.baseToken?.symbol)}/${Ke(r.quoteToken?.symbol)} $${Ke(r.priceUsd)}`}}catch(e){return{ok:!1,detail:di(e instanceof Error?e.message:"quote failed")}}}var uu,pi=l(()=>{Wr();Br();uu={name:"venues",summary:"label every shipped venue live / prepare / unavailable",group:"read",usage:"oracle venues [--json]",async run(e){let t=e.argv.includes("--json"),r=St();if(t)return process.stdout.write(`${JSON.stringify({venues:r},null,2)}
4
+ ${JSON.stringify(r??[])}`}async function Ma(e,t,r){return V(e,{method:"POST",body:t,fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs??12e3,signal:r.signal})}async function Y(e,t,r=[],n={}){let o=String(t||""),i=Da(o),s=$a(e,n);if(!s)throw new Error(`No RPC URL for chainId ${e} (set env from chain registry rpcEnv or pass rpcUrl)`);if(i==="eth_chainid"&&n.cacheChainId!==!1){let u=xn.get(s);if(u!=null)return u}let c=n.dedupe!==!1&&!n.signal?Ua(s,o,r):null;if(c&&Ne.has(c))return Ne.get(c);let f=(async()=>{let u=await Ma(s,{jsonrpc:"2.0",id:1,method:t,params:r},n),m=qa(u);return i==="eth_chainid"&&typeof m=="string"&&xn.set(s,m),m})();return c&&(Ne.set(c,f),f.finally(()=>{Ne.get(c)===f&&Ne.delete(c)}).catch(()=>{})),f}async function vn(e={},t={}){let r=Number(e.chainId??t.chainId??1),n=La(e.txHash||e.hash||e.transactionHash),o=await Y(r,"eth_getTransactionReceipt",[n],t);if(!o)return{ok:!1,chainId:r,txHash:n,status:"pending",receipt:null,reason:"receipt pending"};let i=jt(o.status),s=i===1,d=i===1?"success":i===0?"reverted":"unknown",c=s?null:d==="reverted"?"transaction reverted":"unknown receipt status",f=e.expectedTo?Mt(e.expectedTo,"expectedTo"):null,u=o.to?Mt(o.to,"receipt.to"):null;return f&&u!==f&&(s=!1,c=`to mismatch: expected ${f}, got ${u||"null"}`),{ok:s,chainId:r,txHash:n,status:d,reason:c,statusCode:i,to:u,from:o.from?Mt(o.from,"receipt.from"):null,blockNumber:jt(o.blockNumber),transactionIndex:jt(o.transactionIndex),logs:Array.isArray(o.logs)?o.logs:[],receipt:o}}var il,Pa,Ba,Ne,xn,J=l(()=>{j();Ut();il=new Na(["function allowance(address owner,address spender) view returns (uint256)","function balanceOf(address account) view returns (uint256)"]);Pa={1:"https://ethereum.publicnode.com",137:"https://polygon-bor-rpc.publicnode.com",42161:"https://arbitrum-one-rpc.publicnode.com",8453:"https://base-rpc.publicnode.com",10:"https://optimism-rpc.publicnode.com",988:"https://rpc.stable.xyz",56:"https://bsc-rpc.publicnode.com",43114:"https://avalanche-c-chain-rpc.publicnode.com",999:"https://rpc.hyperliquid.xyz/evm",2741:"https://api.mainnet.abs.xyz",4663:"https://rpc.mainnet.chain.robinhood.com"};Ba=/^(?:eth_(?:call|blocknumber|chainid|get[a-z0-9]+|feehistory|gasprice|maxpriorityfeepergas|syncing|protocolversion|estimategas|createaccesslist)|net_(?:version|listening|peercount)|web3_(?:clientversion|sha3))$/;Ne=new Map,xn=new Map});var Ht=l(()=>{});var ll,ot=l(()=>{j();Ht();ll=Object.freeze({1:"ethereum",10:"optimism",56:"bsc",137:"polygon",8453:"base",42161:"arbitrum",43114:"avalanche",999:"hyperevm",4663:"robinhood"})});var Re=l(()=>{});var Ee=l(()=>{});var X=l(()=>{Re();Ee()});var Ha,gl,F=l(()=>{Ha=300*1e3,gl=(()=>{let e=Number(process.env.ORACLE_PREPARE_HARD_MAX_AGE_MS);return Number.isFinite(e)&&e>0?e:1800*1e3})()});import{Interface as An,getAddress as El,isAddress as Sl}from"ethers";var Wt,kl,Ol,Vt=l(()=>{J();ot();X();F();Wt={1:{name:"ethereum",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",usdc:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},8453:{name:"base",quoter:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",router:"0x2626664c2603336E57B271c5C0b26F421741e481",weth:"0x4200000000000000000000000000000000000006",usdc:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},42161:{name:"arbitrum",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",usdc:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"},4663:{name:"robinhood",quoter:"0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7",router:"0xcaf681a66d020601342297493863e78c959e5cb2",weth:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",usdc:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"},999:{name:"hyperevm",weth:"0x5555555555555555555555555555555555555555",usdc:"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"},10:{name:"optimism",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0x4200000000000000000000000000000000000006",usdc:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"},56:{name:"bsc",quoter:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",router:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2",weth:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",usdc:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"},137:{name:"polygon",quoter:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",router:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",weth:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",usdc:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"},43114:{name:"avalanche",quoter:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",router:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE",weth:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",usdc:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"}},kl=new An(["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)"]),Ol=new An(["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 Wa,Interface as Kt,getAddress as Nl,isAddress as Rl,keccak256 as Ll}from"ethers";var Fl,Gt,ql,Ul,Ml,jl,Hl,Yt=l(()=>{J();ot();X();F();Fl=Wa.defaultAbiCoder(),Gt={1:{name:"ethereum",poolManager:"0x000000000004444c5dc75cB358380D2e3dE08A90",quoter:"0x52f0e24d1c21c8a0cb1e5a5dd6198556bd9e1203",stateView:"0x7ffe42c4a5deea5b0fec41c94c136cf115597227",universalRouter:"0x66a9893cc07d91d95644aedd05d03f95e1dba8af",weth:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",usdc:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},10:{name:"optimism",poolManager:"0x9a13f98cb987694c9f086b1f5eb990eea8264ec3",quoter:"0x1f3131a13296fb91c90870043742c3cdbff1a8d7",stateView:"0xc18a3169788f4f75a170290584eca6395c75ecdb",universalRouter:"0x851116d9223fabed8e56c0e6b8ad0c31d98b3507",weth:"0x4200000000000000000000000000000000000006",usdc:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"},56:{name:"bsc",poolManager:"0x28e2ea090877bf75740558f6bfb36a5ffee9e9df",quoter:"0x9f75dd27d6664c475b90e105573e550ff69437b0",stateView:"0xd13dd3d6e93f276fafc9db9e6bb47c1180aee0c4",universalRouter:"0x1906c1d672b88cd1b9ac7593301ca990f94eae07",weth:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",usdc:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"},137:{name:"polygon",poolManager:"0x67366782805870060151383f4bbff9dab53e5cd6",quoter:"0xb3d5c3dfc3a7aebff71895a7191796bffc2c81b9",stateView:"0x5ea1bd7974c8a611cbab0bdcafcb1d9cc9b3ba5a",universalRouter:"0x1095692a6237d83c6a72f3f5efedb9a670c49223",weth:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",usdc:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"},8453:{name:"base",poolManager:"0x498581fF718922c3f8e6A244956aF099B2652b2b",quoter:"0x0d5e0f971ed27fbff6c2837bf31316121532048d",stateView:"0xa3c0c9b65bad0b08107aa264b0f3db444b867a71",universalRouter:"0x6ff5693b99212da76ad316178a184ab56d299b43",weth:"0x4200000000000000000000000000000000000006",usdc:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},42161:{name:"arbitrum",poolManager:"0x360e68faccca8ca495c1b759fd9eee466db9fb32",quoter:"0x3972c00f7ed4885e145823eb7c655375d275a1c5",stateView:"0x76fd297e2d437cd7f76d50f01afe6160f86e9990",universalRouter:"0xa51afafe0263b40edaef0df8781ea9aa03e381a3",weth:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",usdc:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"},43114:{name:"avalanche",poolManager:"0x06380c0e0912312b5150364b9dc4542ba0dbbc85",quoter:"0xbe40675bb704506a3c2ccfb762dcfd1e979845c2",stateView:"0xc3c9e198c735a4b97e3e683f391ccbdd60b69286",universalRouter:"0x94b75331ae8d42c1b61065089b7d48fe14aa73b7",weth:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",usdc:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"},4663:{name:"robinhood",poolManager:"0x8366a39cc670b4001a1121b8f6a443a643e40951",quoter:"0x8dc178efb8111bb0973dd9d722ebeff267c98f94",stateView:"0xf3334192d15450cdd385c8b70e03f9a6bd9e673b",universalRouter:"0x8876789976dEcBfCbBbe364623C63652db8C0904",weth:"0x0bd7d308f8e1639fab988df18a8011f41eacad73",usdc:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"}},ql=new Kt(["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)","function quoteExactOutputSingle(((address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks) poolKey,bool zeroForOne,uint128 exactAmount,bytes hookData) params) returns (uint256 amountIn, uint256 gasEstimate)"]),Ul=new Kt(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),Ml=new Kt(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96,int24 tick,uint24 protocolFee,uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),jl=Object.freeze([[13,"beforeInitialize"],[12,"afterInitialize"],[11,"beforeAddLiquidity"],[10,"afterAddLiquidity"],[9,"beforeRemoveLiquidity"],[8,"afterRemoveLiquidity"],[7,"beforeSwap"],[6,"afterSwap"],[5,"beforeDonate"],[4,"afterDonate"],[3,"beforeSwapReturnsDelta"],[2,"afterSwapReturnsDelta"],[1,"afterAddLiquidityReturnsDelta"],[0,"afterRemoveLiquidityReturnsDelta"]]),Hl=(1n<<14n)-1n});var Qt=l(()=>{});import{Contract as td,JsonRpcProvider as rd}from"ethers";var In=l(()=>{});var ad,st=l(()=>{In();ad=Object.freeze({swap:5,bridge:5,perps:0,nft:0})});var On=l(()=>{j();X();Qt();F();st()});var _n=l(()=>{j();X();F();st()});var ct=l(()=>{});var Nn=l(()=>{j();X();ct();F()});var Rd,Rn=l(()=>{Rd=Object.freeze({READ:"read",PREPARE:"prepare",EXECUTE:"execute",AUTONOMOUS:"autonomous"})});import{TypedDataEncoder as Dd,getAddress as Fd,isAddress as qd}from"ethers";var Ya,Vd,Ja,Kd,Zt=l(()=>{j();X();Rn();Qt();F();Ya=Object.freeze({1:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",100:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",42161:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",8453:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41"}),Vd=Object.freeze({1:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",100:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",42161:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",8453:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110"}),Ja=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"}]}),Kd=Object.freeze({OrderCancellations:[{name:"orderUids",type:"bytes[]"}]})});function Pe(e){let t=e?.transactionHash||e?.hash||e?.txid||null;return t?{happened:!0,hash:String(t),note:null}:{happened:!1,hash:null,note:"no transaction hash \u2014 the action did not succeed"}}var ar=l(()=>{});var jn=l(()=>{});var Hn=l(()=>{});import{isAddress as pm}from"ethers";var sr=l(()=>{X();Re();Ee()});import{Interface as bs,isAddress as bm}from"ethers";var vm,zn=l(()=>{sr();Re();Ee();vm=new bs(["function approve(address spender,uint256 amount) returns (bool)"])});import{Interface as Es,isAddress as km}from"ethers";var Cm,Nm,Wn=l(()=>{sr();Re();Ee();Cm=new Es(["function approve(address spender,uint256 amount) returns (bool)"]),Nm=Object.freeze({42161:"0x1c3fa76e6e1088bce750f23a5bfcffa1efef6a41",43114:"0x8f550e53dfe96c055d5bdb267c21f268fcaf63b2"})});var de=l(()=>{});import{Interface as Ss,MaxUint256 as Fm,isAddress as qm,keccak256 as Um,toUtf8Bytes as Mm}from"ethers";var Km,fe=l(()=>{Hn();zn();Wn();de();Ee();Km=new Ss(["function approve(address spender,uint256 amount) returns (bool)"])});var Gn={};Je(Gn,{SIGN_TIME_REVIEW_VERSION:()=>xs,SignTimeReviewSecretError:()=>$e,createSignTimeReview:()=>Kn});function ur(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string"){let o=e.trim().split(/\s+/);if(Os.test(e)||_s.has(o.length)&&o.every(i=>/^[a-z]+$/i.test(i)))throw new $e(t);return e}if(typeof e=="bigint")return e.toString();if(typeof e=="number"){if(!Number.isSafeInteger(e))throw new TypeError(`sign-time review: safe integer required at ${t}`);return e}if(Array.isArray(e))return e.map((o,i)=>ur(o,`${t}[${i}]`,r));pe(e,t);let n={};for(let o of Object.keys(e).sort()){let i=o.replace(/[^a-z0-9]/gi,"");if(ks.test(i))throw new $e(`${t}.${o}`);e[o]!==void 0&&(n[o]=ur(e[o],`${t}.${o}`,o))}return n}function pe(e,t){if(e==null||typeof e!="object"||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError(`sign-time review: ${t} must be a plain object`);return e}function Be(e,t){if(e==null||e==="")throw new TypeError(`sign-time review: ${t} required`);return e}function xe(e,t){let r=String(Be(e,t)).toLowerCase();if(!vs.test(r))throw new TypeError(`sign-time review: ${t} must be an EVM address`);return r}function re(e,t,{positive:r=!1}={}){try{let n=BigInt(Be(e,t));if(n<0n||r&&n===0n)throw new Error;return n.toString()}catch{throw new TypeError(`sign-time review: ${t} must be an unsigned integer`)}}function lr(e,t){if(typeof e!="string"||e.length===0||e.length>500||e!==e.trim())throw new TypeError(`sign-time review: ${t} must be non-empty text`);return e}function Vn(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))Vn(t);Object.freeze(e)}return e}function Ts(e,t){if(typeof e=="boolean")return{passed:e,reason:e?"passed":"failed"};pe(e,t);let r=e.passed??e.ok??e.allowed;if(typeof r!="boolean")throw new TypeError(`sign-time review: ${t} needs a boolean result`);let n=e.reason??e.message??e.name??(r?"passed":"failed");return{...e,passed:r,reason:lr(String(n),`${t}.reason`)}}function Cs(e){if(!Array.isArray(e))throw new TypeError("sign-time review: policyChecks must be an array");let t=e.map((n,o)=>Ts(n,`policyChecks[${o}]`)),r=t.filter(n=>!n.passed);return{checks:t,passed:t.length-r.length,failed:r.length,reasons:r.map(n=>n.reason)}}function Ns(e){if(e==null)return null;if(pe(e,"simulation"),typeof e.status!="string"||!["ok","success","failed","error","unavailable","unknown"].includes(e.status))throw new TypeError("sign-time review: simulation.status is invalid");if(e.willRevert!==!0&&e.willRevert!==!1&&e.willRevert!==null)throw new TypeError("sign-time review: simulation.willRevert must be boolean or null");let t={status:e.status,willRevert:e.willRevert??null,summary:lr(String(e.summary??"simulation result recorded"),"simulation.summary")};return e.gasEstimate!=null&&(t.gasEstimate=re(e.gasEstimate,"simulation.gasEstimate")),e.gasLimit!=null&&(t.gasLimit=re(e.gasLimit,"simulation.gasLimit")),t}function Rs(e){if(e==null)return null;if(!Array.isArray(e)||e.length===0)throw new TypeError("sign-time review: assetDeltas must be a non-empty array");return e.map((t,r)=>{pe(t,`assetDeltas[${r}]`);let n=re(t.before,`assetDeltas[${r}].before`),o=re(t.after,`assetDeltas[${r}].after`),i=(BigInt(o)-BigInt(n)).toString(),s;try{s=t.delta==null?i:BigInt(t.delta).toString()}catch{throw new TypeError(`sign-time review: assetDeltas[${r}].delta must be an integer`)}if(s!==i)throw new TypeError(`sign-time review: assetDeltas[${r}].delta does not match before/after`);return{...t,asset:lr(String(Be(t.asset??t.token,`assetDeltas[${r}].asset`)),`assetDeltas[${r}].asset`),before:n,after:o,delta:s}})}function Ls(e){if(e==null)return[];if(!Array.isArray(e))throw new TypeError("sign-time review: approvalDeltas must be an array");return e.map((t,r)=>{pe(t,`approvalDeltas[${r}]`);let n=re(t.amount??t.after,`approvalDeltas[${r}].amount`);if(t.revokeLike!=null&&typeof t.revokeLike!="boolean")throw new TypeError(`sign-time review: approvalDeltas[${r}].revokeLike must be boolean`);return{token:xe(t.token,`approvalDeltas[${r}].token`),spender:xe(t.spender,`approvalDeltas[${r}].spender`),owner:xe(t.owner,`approvalDeltas[${r}].owner`),amount:n,revokeLike:t.revokeLike??BigInt(n)===0n}})}function Kn(e={}){pe(e,"input");let t=ur(e),r=t.tx==null?t:pe(t.tx,"tx"),n=re(t.chainId??r.chainId,"chainId",{positive:!0}),o=xe(t.account??t.from??r.from,"account/from"),i=xe(t.destination??t.to??r.to,"destination/to"),s=String(Be(t.prepareHash,"prepareHash")).toLowerCase();if(!Is.test(s))throw new TypeError("sign-time review: prepareHash must be a 32-byte hash");let d=t.route??t.venue;if(d==null)throw new TypeError("sign-time review: route/venue required");let c=t.decodedCalldata??t.decodedAction;if(c==null)throw new TypeError("sign-time review: decodedCalldata or decodedAction required");let f=String(Be(t.calldata??t.data??r.data,"calldata/data")).toLowerCase();if(!As.test(f))throw new TypeError("sign-time review: calldata/data must be even-length hex");let u=t.policyChecks!==void 0&&t.policyChecks!==null,m=Cs(u?t.policyChecks:[]),b=Ns(t.simulation),p=Rs(t.assetDeltas),h=Ls(t.approvalDeltas),w=t.allowlistHits??[];if(!Array.isArray(w))throw new TypeError("sign-time review: allowlistHits must be an array");let g=b?.willRevert===!0||["failed","error"].includes(b?.status),S=b!=null&&b.willRevert===!1&&["ok","success"].includes(b.status),P=g||m.failed>0?"BLOCKED":S&&u&&m.checks.length>0&&p!=null?"READY":"UNKNOWN",E=typeof c=="string"?c:c.method??c.action??c.type??"transaction",A=`${P}: review ${E} on chain ${n}; policy ${m.passed} passed, ${m.failed} failed; ${p?.length??0} asset delta${p?.length===1?"":"s"}; local signature required`,N={reviewVersion:1,status:P,requiresLocalSignature:!0,signingLocal:!0,custody:"none",execution:"review-only",chainId:n,account:o,from:o,route:d,venue:t.venue??(typeof d=="string"?d:d.venue??d.provider??null),destination:i,to:i,...t.spender==null?{}:{spender:xe(t.spender,"spender")},prepareHash:s,...t.decodedCalldata!==void 0?{decodedCalldata:t.decodedCalldata}:{decodedAction:t.decodedAction},calldata:f,data:f,selector:f.length>=10?f.slice(0,10):null,value:re(t.value??r.value??0,"value"),...(t.gasEstimate??r.gasEstimate)==null?{}:{gasEstimate:re(t.gasEstimate??r.gasEstimate,"gasEstimate")},...(t.gasLimit??r.gasLimit)==null?{}:{gasLimit:re(t.gasLimit??r.gasLimit,"gasLimit")},simulation:b,policyChecks:m,allowlistHits:w,assetDeltas:p,approvalDeltas:h,summary:A};return Vn(N)}var xs,vs,As,Is,ks,Os,_s,$e,dr=l(()=>{xs=1,vs=/^0x[0-9a-f]{40}$/,As=/^0x(?:[0-9a-f]{2})*$/,Is=/^(?:0x)?[0-9a-f]{64}$/,ks=/(privatekey|privkey|secretkey|seedphrase|mnemonic|passphrase|password|keystore|keymaterial|wif|xprv|xpriv|bearer|authorization|signature|apikey|credential)/i,Os=/\b(?:[5KL][1-9A-HJ-NP-Za-km-z]{50,51}|xprv[0-9A-Za-z]{50,})\b/,_s=new Set([12,15,18,21,24]),$e=class extends Error{constructor(t){super(`sign-time review refused: secret-bearing field at ${t}`),this.name="SignTimeReviewSecretError",this.code="SIGN_TIME_REVIEW_SECRET"}}});import{readFileSync as Jm,readdirSync as Xm,existsSync as Ps}from"node:fs";import{dirname as $s,join as De}from"node:path";import{fileURLToPath as Bs}from"node:url";function Ds(){let e=[De(Fe,"descriptors"),De(Fe,"clear-sign","descriptors"),De(Fe,"..","clear-sign","descriptors"),De(Fe,"..","..","clear-sign","descriptors"),De(Fe,"..","..","..","clear-sign","descriptors")];for(let t of e)if(Ps(t))return t;return e[0]}var Fe,th,rh,Yn=l(()=>{fe();Fe=$s(Bs(import.meta.url));th=Ds(),rh=(1n<<256n)-1n});var Jn=l(()=>{dr();fe();Yn()});import{Address as lh,NETWORK as dh,OutScript as fh,RawTx as ph,SigHash as mh,TEST_NETWORK as hh,Transaction as wh}from"@scure/btc-signer";var pr=l(()=>{});import{createHash as Fs}from"node:crypto";import{base58 as Eh}from"@scure/base";import{getCompiledTransactionMessageDecoder as xh}from"@solana/transaction-messages";var Xn,vh,mr=l(()=>{Xn=e=>Fs("sha256").update(`global:${e}`).digest().subarray(0,8).toString("hex"),vh=new Map([[Xn("route"),{name:"route",prefixBytes:0}],[Xn("shared_accounts_route"),{name:"shared_accounts_route",prefixBytes:1}]])});var Qn=l(()=>{});var Zn=l(()=>{j();Qn()});var Lh,eo=l(()=>{Zn();Lh=Object.freeze({tradexyz:"xyz",ventuals:"vntl",hypernova:"hyna",paradex:"para",entropy:"io",entropyio:"io"})});var Fh,qh,ft=l(()=>{de();eo();Fh=Object.freeze({"perp-order":"order","hip3-order":"order","hip4-order":"order","perp-bracket":"order","perp-cancel":"cancel","perp-leverage":"leverage","perp-isolated-margin":"margin","builder-fee-approval":"approveBuilder","hype-stake-deposit":"stake","hype-stake-withdraw":"unstake","hype-delegate":"delegate","hype-undelegate":"delegate"}),qh=Object.freeze({"perp-order":"order","hip3-order":"order","hip4-order":"order","perp-bracket":"order","perp-cancel":"cancel","perp-leverage":"updateLeverage","perp-isolated-margin":"updateIsolatedMargin","builder-fee-approval":"approveBuilderFee","hype-stake-deposit":"cDeposit","hype-stake-withdraw":"cWithdraw","hype-delegate":"tokenDelegate","hype-undelegate":"tokenDelegate"})});var jh,wr=l(()=>{de();jh="0x"+"00".repeat(32)});var qs,Kh,pt=l(()=>{wr();de();qs=Object.freeze([["salt","uint256"],["maker","address"],["signer","address"],["tokenId","uint256"],["makerAmount","uint256"],["takerAmount","uint256"],["side","uint8"],["signatureType","uint8"],["timestamp","uint256"],["metadata","bytes32"],["builder","bytes32"]]),Kh=Object.freeze(qs.map(e=>e[0]))});var Ue=l(()=>{de()});var mt=l(()=>{fe();Jn();pr();mr();ft();pt();Ue()});var ht=l(()=>{fe()});import{TypedDataEncoder as dw,getAddress as fw,isAddress as pw}from"ethers";var Us,Ms,so=l(()=>{F();Us=Object.freeze({1:"0x111111125421cA6dc452d289314280a0f8842A65",8453:"0x111111125421cA6dc452d289314280a0f8842A65",42161:"0x111111125421cA6dc452d289314280a0f8842A65",10:"0x111111125421cA6dc452d289314280a0f8842A65",137:"0x111111125421cA6dc452d289314280a0f8842A65",56:"0x111111125421cA6dc452d289314280a0f8842A65"}),Ms=Object.freeze({Order:[{name:"salt",type:"uint256"},{name:"maker",type:"address"},{name:"receiver",type:"address"},{name:"makerAsset",type:"address"},{name:"takerAsset",type:"address"},{name:"makingAmount",type:"uint256"},{name:"takingAmount",type:"uint256"},{name:"makerTraits",type:"uint256"}]})});import{TypedDataEncoder as gw,getAddress as yw}from"ethers";var Sw,gr=l(()=>{so();Zt();Sw=Object.freeze(["https://limit-orders.1inch.io","https://api.1inch.dev/orderbook"])});import{Interface as uo}from"ethers";var zs,Dw,Ws,Fw,qw,Uw,Mw,Vs,jw,wt=l(()=>{fe();X();F();ht();pr();mr();ft();pt();Ue();gr();zs=new Set(["evm","evm-swap","evm-bridge","evm-nft","evm-order","btc","sol","hl","poly","lighter"]),Dw=Object.freeze({swap:5,bridge:5,perps:0,nft:0,mint:0,transfer:0,approve:0,delegate:0,identity:0,order:0,cancel:0,leverage:0,margin:0,approveBuilder:0,stake:0,unstake:0}),Ws=Object.freeze({"0x04e45aaf":{provider:"uniswap-v3",action:"swap",layout:"router02-exact-input-single"},"0x414bf389":{provider:"uniswap-v3",action:"swap",layout:"swap-router-exact-input-single"},"0xc04b8d59":{provider:"uniswap-v3",action:"swap",layout:"exact-input-deadline"},"0xb858183f":{provider:"uniswap-v3",action:"swap",layout:"exact-input"},"0x5ae401dc":{provider:"uniswap-v3",action:"swap",layout:"multicall-deadline"},"0xa026383e":{provider:"aerodrome",action:"swap",layout:"aerodrome-exact-input-single"},"0x7b939232":{provider:"across-v3",action:"bridge",layout:"across-deposit-v3"}}),Fw=Object.freeze({"0x161ac21f":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-public"},"0xc2f6663a":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-allowlist"}}),qw=new uo(["function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),Uw=new uo(["function mintAllowList(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity,(uint80 mintPrice,uint48 maxTotalMintableByWallet,uint48 startTime,uint48 endTime,uint48 dropStageIndex,uint32 maxTokenSupplyForStage,uint16 feeBps,bool restrictFeeRecipients) mintParams,bytes32[] proof) payable"]),Mw=Object.freeze({"0xa0712d68":{provider:"nft-mint",action:"mint",layout:"mint-quantity"},"0x1249c58b":{provider:"nft-mint",action:"mint",layout:"mint-no-args"},"0x2db11544":{provider:"nft-mint",action:"mint",layout:"mint-quantity"},"0xefef39a1":{provider:"nft-mint",action:"mint",layout:"mint-quantity"},"0xa6f2ae3a":{provider:"nft-mint",action:"mint",layout:"mint-no-args"}}),Vs=Object.freeze([...zs]),jw=Object.freeze({...Ws})});import{encode as Ww}from"@msgpack/msgpack";import{keccak256 as Kw,verifyTypedData as Gw}from"ethers";var Yw,Jw,yr=l(()=>{Yw=Object.freeze({name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"}),Jw=Object.freeze({Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]})});var br=l(()=>{Ue()});import{ed25519 as og}from"@noble/curves/ed25519.js";import{base58 as ag}from"@scure/base";import{RawTx as cg,SigHash as ug,Transaction as lg}from"@scure/btc-signer";import{Transaction as fg,keccak256 as pg,verifyTypedData as mg}from"ethers";var Er=l(()=>{yr();br()});import{base58 as xg}from"@scure/base";var Me=l(()=>{mt();wt();ht();fe();Er()});var fo=l(()=>{Me();wt()});import{wordlists as Ys}from"ethers";function Zs(e){let t=String(e).trim().toLowerCase().split(/\s+/).filter(Boolean);return Qs.has(t.length)&&t.every(r=>Ys.en.getWordIndex(r)>=0)}function nc(e){let t=po(e);return rc.has(t)||tc.test(t)}function po(e){return String(e).replace(/[^a-z0-9]/gi,"").toLowerCase()}function oc(e){let t=po(e);return[...Js].some(r=>t.includes(r))}function ic(e,t,r){if(typeof t=="string"){if(Xs.some(n=>n.test(t))||Zs(t))throw new je(r);if(ec.test(t)&&!nc(e))throw new je(r)}}function xr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string")return ic(r,e,t),e;if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError(`action receipt: non-finite number at ${t}`);return e}if(typeof e=="bigint")return e.toString();if(Array.isArray(e))return e.map((o,i)=>xr(o,`${t}[${i}]`,r));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError(`action receipt: JSON-like value required at ${t}`);let n={};for(let o of Object.keys(e).sort()){let i=`${t}.${o}`;if(oc(o))throw new je(i);e[o]!==void 0&&(n[o]=xr(e[o],i,o))}return n}function gt(e){return xr(e)}var Js,Xs,Qs,ec,tc,rc,je,He=l(()=>{Js=new Set(["privatekey","privkey","secretkey","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","wif","xprv","xpriv","bearer","authorization","signature","apikey","credential"]),Xs=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/],Qs=new Set([12,15,18,21,24]);ec=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/,tc=/(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i,rc=new Set(["calldata","data","publickey","pubkey","message","payload","input","extradata"]);je=class extends Error{constructor(t){super(`action receipt refused: secret-bearing field at ${t}`),this.name="ActionReceiptSecretError",this.code="ACTION_RECEIPT_SECRET"}}});import{closeSync as Dg,constants as ac,fchmodSync as Fg,fsyncSync as qg,lstatSync as Ug,mkdirSync as Mg,openSync as jg,readFileSync as Hg,renameSync as zg,rmSync as Wg,writeFileSync as Vg}from"node:fs";var Yg,mo=l(()=>{He();Me();Yg=ac.O_NOFOLLOW??0});import{wordlists as Qg}from"ethers";var ho,ey,ve=l(()=>{He();ho=64*1024,ey=32*1024});var uc,ny,oy,bt=l(()=>{ve();uc=["schemaVersion","buildVersion","recordType","execution","custody"],ny=[...uc,"recordHash"],oy=Object.freeze({signed:new Set(["workflow.signed","legacy.signed"]),submitted:new Set(["workflow.submitted","legacy.broadcast"]),finalized:new Set(["workflow.finalized"]),reorged:new Set(["workflow.reorged"]),orphaned:new Set(["workflow.orphaned"]),compensating:new Set(["workflow.compensating"]),compensated:new Set(["workflow.compensated"])})});var lc,Ao,uy,Or=l(()=>{ve();bt();lc=Object.freeze(["draft","checked","approval","signed","submitted","finalized","reorged","orphaned","compensating","compensated","failed","cancelled"]),Ao=Object.freeze(["workflow.drafted","workflow.checked","workflow.approval_requested","workflow.approval_granted","workflow.signed","workflow.submitted","workflow.finalized","workflow.reorged","workflow.orphaned","workflow.compensating","workflow.compensated","workflow.failed","workflow.cancelled","workflow.annotated"]),uy=new Set(Ao)});var wc,Io=l(()=>{ve();Or();wc=64*1024*1024});var wy,gy,yy,ko=l(()=>{wy=Object.freeze(["chainId","agentAddress","accountAddress","actions","targets","maxValueWei","maxGasWei","maxSlippageBps","expiresAt","nonce","revocationKey"]),gy=Object.freeze(["read","simulate"]),yy=1440*60});function _r(e){let t=String(e),r=t.toLowerCase().replace(/[\s._-]+/g,"");return gc.test(t)||yc.includes(r)}function bc(e){return e.replace(/"([A-Za-z0-9_-]+)"\s*:\s*"(?:0x)?([0-9a-fA-F]{64})"/g,(t,r)=>_o.includes(String(r).toLowerCase().replace(/[_-]/g,""))?`"${r}":"<hex64>"`:t)}function To(e){let t;try{t=JSON.stringify(e)}catch(o){throw new ne("$",`unserializable-payload: ${String(o?.message||o)}`)}if(t===void 0)return"null";let r=bc(t);for(let{rule:o,re:i}of Oo)if(i.test(r))throw new ne("$<serialized>",o);if(/(?:^|[^0-9a-fA-Fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/.test(r))throw new ne("$<serialized>","raw-32-byte-hex-embedded");return JSON.parse(t,(o,i)=>{if(o&&_r(o))throw new ne(`$<serialized>.${o}`,"forbidden-key-name");return i}),t}function ae(e,t="$",r=new Set,n=""){if(e==null)return e;if(typeof e=="string"){let o=_o.includes(String(n).toLowerCase().replace(/[_-]/g,""));for(let{rule:i,re:s}of Oo)if(!(o&&i.startsWith("raw-32-byte-hex"))&&s.test(e))throw new ne(t,i);return e}if(typeof e!="object"||r.has(e)||(r.add(e),ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e;if(e instanceof Map){for(let[o,i]of e.entries()){if(typeof o=="string"&&_r(o))throw new ne(`${t}[${JSON.stringify(o)}]`,"forbidden-key-name");ae(o,`${t}[key]`,r),ae(i,`${t}[${String(o)}]`,r)}return e}if(e instanceof Set){let o=0;for(let i of e.values())ae(i,`${t}[${o++}]`,r);return e}if(Array.isArray(e))return e.forEach((o,i)=>ae(o,`${t}[${i}]`,r)),e;for(let[o,i]of Object.entries(e)){if(_r(o))throw new ne(`${t}.${o}`,"forbidden-key-name");ae(i,`${t}.${o}`,r,o)}return e}var ne,gc,yc,Oo,_o,Tr=l(()=>{ko();ne=class extends Error{constructor(t,r){super(`secret material must never appear in a public API object (at ${t}, rule: ${r})`),this.name="SecretLeakError",this.path=t,this.rule=r}},gc=/(private[_-]?key|secret|bearer|keystore|mnemonic|seed[_-]?phrase|passphrase|password|api[_-]?key|access[_-]?token|auth[_-]?token|session[_-]?token|signer[_-]?url|signature)/i,yc=Object.freeze(["privkey","wif","xprv","seed"]);Oo=Object.freeze([{rule:"raw-32-byte-hex-key",re:/^0x[0-9a-fA-F]{64}$/},{rule:"raw-32-byte-hex-bare",re:/^[0-9a-fA-F]{64}$/},{rule:"extended-private-key",re:/\b(?:xprv|tprv|yprv|zprv)[1-9A-HJ-NP-Za-km-z]{107}\b/},{rule:"bitcoin-wif",re:/\b[59KLc][1-9A-HJ-NP-Za-km-z]{50,51}\b/},{rule:"bip39-mnemonic",re:/\b(?:[a-z]{3,8}\s+){11,23}[a-z]{3,8}\b/},{rule:"bearer-token",re:/bearer\s+[A-Za-z0-9._~+/=-]+/i},{rule:"pem-private-key",re:/-----BEGIN[A-Z ]*PRIVATE KEY-----/},{rule:"keystore-path",re:/keystore/i},{rule:"signer-url",re:/https?:\/\/\S*sign/i},{rule:"authorization-header",re:/authorization\s*:/i}]),_o=Object.freeze(["grantid","id","hash","sha256","sha256hex","checksum","txhash","transactionhash","blockhash","digest","userophash","commithash","prevhash","intenthash","canonicalhash","payloadhash","requestid"])});var Cr,Ty,Co=l(()=>{Tr();Cr=Object.freeze(["intent","quote_comparison","simulation","prepared","approval","signed","broadcast","settlement","balance_delta","position"]),Ty=Object.freeze(Object.fromEntries(Cr.map((e,t)=>[e,Object.freeze(t+1<Cr.length?[Cr[t+1]]:[])])))});var Ec,No=l(()=>{Co();ve();bt();Ec=Object.freeze({intent:"draft",quote_comparison:"draft",simulation:"draft",prepared:"checked",approval:"approval",signed:"signed",broadcast:"submitted",settlement:"finalized",balance_delta:"compensated",position:"compensated"})});var Ro=l(()=>{ve();bt();Or();Io();No()});var xc,vc,Ac,p0,m0,h0,w0,g0,Ic,y0,Lo=l(()=>{xc=Object.freeze(["owner","operator","agent","viewer"]),vc=Object.freeze(["tenant","config","policy","grant","workflow","trade","receipt","audit","telemetry","context","lifecycle"]),Ac=Object.freeze({read:"read",create:"create",update:"update",delete:"delete",manage:"manage",prepare:"prepare",cancel:"cancel",export:"export",approve:"approve"}),p0=Object.freeze(["owner"]),m0=Object.freeze({ALLOW_ROLE_PERMISSION:"allow.role_permission",DENY_MISSING_CONTEXT:"deny.missing_context",DENY_INVALID_CONTEXT:"deny.invalid_context",DENY_INVALID_REQUEST:"deny.invalid_request",DENY_UNKNOWN_RESOURCE:"deny.unknown_resource",DENY_UNKNOWN_ACTION:"deny.unknown_action",DENY_UNBOUND_OBJECT:"deny.unbound_object",DENY_TENANT_MISMATCH:"deny.tenant_mismatch",DENY_RESOURCE_MISMATCH:"deny.resource_mismatch",DENY_ROLE_PERMISSION:"deny.role_permission",DENY_POLICY_NOT_APPROVER:"deny.policy_not_approver"}),h0=new Set(xc),w0=new Set(vc),g0=new Set(Object.values(Ac)),Ic=Object.freeze({owner:Object.freeze(["tenant:read","tenant:manage","config:read","config:manage","policy:read","policy:manage","grant:read","grant:create","grant:update","grant:delete","grant:manage","workflow:read","workflow:create","workflow:update","workflow:delete","workflow:cancel","workflow:approve","trade:read","trade:prepare","receipt:read","receipt:export","audit:read","audit:export","telemetry:read","telemetry:create","telemetry:export","context:read","context:create","context:update","context:delete","context:manage","context:export","lifecycle:read","lifecycle:create","lifecycle:update","lifecycle:delete","lifecycle:manage","lifecycle:approve","lifecycle:export"]),operator:Object.freeze(["tenant:read","config:read","policy:read","grant:read","workflow:read","workflow:create","workflow:update","workflow:cancel","trade:read","trade:prepare","receipt:read","audit:read","telemetry:read","telemetry:create","context:read","context:create","context:update","context:delete","lifecycle:read","lifecycle:create","lifecycle:update","lifecycle:manage"]),agent:Object.freeze(["tenant:read","config:read","policy:read","grant:read","workflow:read","workflow:create","workflow:update","trade:read","trade:prepare","receipt:read","telemetry:create","context:read","context:create","context:update","lifecycle:read"]),viewer:Object.freeze(["tenant:read","config:read","grant:read","workflow:read","trade:read","receipt:read","audit:read","telemetry:read","context:read","lifecycle:read"])}),y0=Object.freeze(Object.fromEntries(Object.entries(Ic).map(([e,t])=>[e,Object.freeze([...t])])))});var kc,Oc,_c,x0,v0,A0,I0,k0,O0,Nr=l(()=>{Lo();kc=Object.freeze(["succeeded","denied","invalid","failed","cancelled","timed_out","unavailable","skipped"]),Oc=Object.freeze(["workflow","task","intent","plan","run","event","eval"]),_c=Object.freeze(["taskId","intentId","planId","runId","eventId"]),x0=Object.freeze({maxAttributes:24,maxKeyLength:48,maxStringLength:256,maxArrayLength:8}),v0=new Set(kc),A0=new Set(Oc),I0=new Set(_c),k0=Object.freeze(["authorization","bearer","cookie","credential","password","passphrase","secret","token","privatekey","privkey","seed","mnemonic","keystore","signature","prompt","systemmessage","usermessage","assistantmessage","rawtransaction","signedtransaction","serializedtransaction","transactionbytes","calldata","callbytes","inputdata"]),O0=Object.freeze({taskId:"x-oracle-task-id",intentId:"x-oracle-intent-id",planId:"x-oracle-plan-id",runId:"x-oracle-run-id",eventId:"x-oracle-event-id"})});var L0,Po=l(()=>{Ro();Nr();L0=Object.freeze({"workflow.cancelled":"cancelled","workflow.failed":"failed"})});var q0,$o=l(()=>{Nr();q0=32*1024*1024});var M0,j0,H0,Ae=l(()=>{M0=Object.freeze({N:1<<17,r:8,p:1}),j0=256*1024*1024,H0=16*1024});var W0,Bo=l(()=>{W0=Object.freeze({1:{name:"ethereum",mode:"mempool-private",endpoints:["https://rpc.flashbots.net/fast","https://rpc.mevblocker.io"]},8453:{name:"base",mode:"sequencer",endpoints:["https://mainnet-sequencer.base.org"]},10:{name:"optimism",mode:"sequencer",endpoints:["https://mainnet-sequencer.optimism.io"]},42161:{name:"arbitrum",mode:"sequencer",endpoints:["https://arb1-sequencer.arbitrum.io/rpc"]},56:{name:"bsc",mode:"mempool-private",endpoints:["https://rpc.48.club","https://bsc.rpc.blxrbdn.com"]},137:{name:"polygon",mode:"mempool-private",endpoints:["https://polygon-bor-rpc.publicnode.com"]},43114:{name:"avalanche",mode:"public-only",endpoints:[]},999:{name:"hyperevm",mode:"public-only",endpoints:[]}})});import{homedir as Rr}from"node:os";import{join as Lr}from"node:path";var Do,Tc,Y0,Fo=l(()=>{Do=process.env.ORACLE_PUBLIC_DESKTOP==="1",Tc=Do?process.env.ORACLE_CONFIG_DIR||Lr(Rr(),".config","oracle"):Lr(Rr(),".config","oracle"),Y0=Do?Tc:Lr(Rr(),".config","mad-desk")});var eb,tb,rb,qo=l(()=>{Fo();eb="0".repeat(64),tb=Object.freeze({PREPARE:"exec.prepare",SIGN:"exec.sign",BROADCAST:"exec.broadcast",POLICY_REJECT:"policy.reject",AUTH_GRANT:"auth.grant",AUTH_OK:"auth.verify.ok",AUTH_FAIL:"auth.verify.fail"}),rb=Promise.resolve()});var Pr=l(()=>{qo();de();Ae();Me()});var Mo=l(()=>{});import{Wallet as fb}from"ethers";import{base58 as mb}from"@scure/base";import{ed25519 as wb}from"@noble/curves/ed25519.js";import{NETWORK as yb,TEST_NETWORK as bb,WIF as Eb,p2wpkh as Sb}from"@scure/btc-signer";import{pubECDSA as vb}from"@scure/btc-signer/utils.js";var jo=l(()=>{});var kb,Ob,_b,Tb,Cb,Nb,Rb,Lb,Pb,$b,Bb,Ho=l(()=>{Pr();kb=Object.freeze(["spot-limit-create","spot-limit-cancel","spot-order-status"]),Ob=Object.freeze(["binance","bybit","okx","coinbase"]),_b=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"}),Tb=Object.freeze({binance:"/api/v3",bybit:"/v5/order",okx:"/api/v5/trade",coinbase:"/orders"}),Cb=Object.freeze(["version","surface","kind","venue","credentialRef","symbol","base","quote","side","baseSize","limitPrice","maxQuoteNotional","timeInForce","clientOrderId","expiresAtMs","venueOrderId","nonce","grantId","artifactHash"]),Nb=Object.freeze(["market-create","withdraw","transfer","subaccount","leverage","futures","margin","convert","api-key"]),Rb=Object.freeze(["url","host","path","method","headers","signature","apiKey","apiSecret","passphrase","privateKey","redirect","proxy"]),Lb=Object.freeze(["ccxt","binance-api-node","node-binance-api","coinbase-advanced-node","@okx-dex/okx-dex-sdk","bybit-api"]),Pb=Object.freeze({perOrderQuote:"sealed-owner-policy",dailyGrossQuote:"sealed-owner-policy",scope:Object.freeze(["per-order","UTC-day","account","venue","quote"]),envelopeFieldIsNotCeiling:!0}),$b=Object.freeze({binanceRecvWindowMs:5e3,bybitWindowMs:5e3,maxLocalSkewMs:2e3}),Bb=Object.freeze({perSecond:1,perMinute:30,bind:"tighter"})});var zo=l(()=>{Ae()});var Rc,Wo,St=l(()=>{Rc=Object.freeze({binance:Object.freeze({create:["POST","/api/v3/order"],cancel:["DELETE","/api/v3/order"],status:["GET","/api/v3/order"]}),bybit:Object.freeze({create:["POST","/v5/order/create"],cancel:["POST","/v5/order/cancel"],status:["GET","/v5/order/realtime"]}),okx:Object.freeze({create:["POST","/api/v5/trade/order"],cancel:["POST","/api/v5/trade/cancel-order"],status:["GET","/api/v5/trade/order"]}),coinbase:Object.freeze({create:["POST","/orders"],cancel:["DELETE","/orders/{order_id}"],status:["GET","/orders/{order_id}"]})}),Wo=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"})});var Vo=l(()=>{St()});var Vb,Ko=l(()=>{St();Vo();Vb=256*1024});var Go=l(()=>{St();Ko()});var Yo=l(()=>{Ae()});import B from"node:path";import Lc from"node:os";import{createHash as Pc,randomBytes as DE}from"node:crypto";import{Interface as $r,keccak256 as qE}from"ethers";import{Transaction as ME}from"@scure/btc-signer";import{ed25519 as HE}from"@noble/curves/ed25519.js";function Jo(e){let t=process.env.ORACLE_SIGNER_STATE_DIR||B.join(process.env.XDG_STATE_HOME||B.join(Lc.homedir(),".local","state"),"oracle"),r=Pc("sha256").update(B.resolve(e)).digest("hex").slice(0,16);return{vault:B.join(e,"vault.json"),policy:B.join(e,"signer-policy.json"),policyKey:B.join(e,"policy-integrity-key"),policyAnchor:B.join(t,`signer-policy-${r}.high-water`),ledger:B.join(e,"signer-ledger.json"),ledgerAnchor:B.join(t,`signer-ledger-${r}.high-water`),executionOutbox:B.join(e,"signer-execution-outbox.json"),cexOrders:B.join(e,"cex-orders.json"),cexOrdersAnchor:B.join(t,`cex-orders-${r}.high-water`),token:B.join(e,"signer-token"),lock:B.join(t,`signer-${r}.lock`),workflowLedger:B.join(e,"workflow-events.jsonl")}}var gS,yS,bS,Xo=l(()=>{fo();mo();Po();$o();Me();mt();mt();Ae();Bo();Pr();Mo();wt();ht();Er();ft();pt();Ue();br();wr();yr();gr();jo();Ho();zo();Go();Yo();gS=new $r(["function collection() view returns (address)","function token() view returns (address)","function robinhoodSwapFeeWei() view returns (uint256)","function quoteSpecificBuy(uint256 tokenId) view returns (uint256 totalCost,uint256 baseCost,uint256 fee,uint256 protocolFee,bool available)","function quoteSellNFT() view returns (uint256 netPayout,uint256 grossPayout,uint256 fee,uint256 protocolFee)","function inventory(uint256 tokenId) view returns (bool)","function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),yS=new $r(["function decimals() view returns (uint8)","function allowance(address owner,address spender) view returns (uint256)"]),bS=new $r(["function ownerOf(uint256 tokenId) view returns (address)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner,address operator) view returns (bool)"])});import Br from"node:fs";import Qo from"node:path";import{homedir as $c}from"node:os";function Bc(){return process.env.ORACLE_CONFIG_DIR||Qo.join($c(),".config","oracle")}function ze(){let e=Jo(Qo.join(Bc(),"signer")),t=Br.existsSync(e.vault),r=Br.existsSync(e.lock),n=t?r?"disarmed":"armed-owner-confirmed":"inert-no-key";return{vaultExists:t,policyConfigured:Br.existsSync(e.policy),armed:t&&!r,disarmed:r,capabilities:{swap:n,bridge:n},autonomous:!1,note:"Keys stay on this machine. Exact confirmation is required before any broadcast."}}var NS,Dr=l(()=>{ar();jn();Xo();Ae();NS=Object.freeze([{type:"function",function:{name:"vault_status",description:"Read local Oracle vault/signer readiness. Never returns key material.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"signer_status",description:"Ping the loopback signer. Fails closed if it is not running.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"signer_pending",description:"List pending local-signer artifacts. Read-only. Does not approve, sign, or broadcast.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"signer_queue",description:"Queue a prepared unsigned artifact on the loopback signer. Does not broadcast.",parameters:{type:"object",properties:{artifact:{type:"object"}},required:["artifact"],additionalProperties:!1}}},{type:"function",function:{name:"signer_deny",description:"Drop one pending local-signer artifact. Nothing signed.",parameters:{type:"object",properties:{id:{type:"string"},digest:{type:"string"}},additionalProperties:!1}}},{type:"function",function:{name:"signer_execute",description:"Broadcast one already-confirmed local artifact. Requires a one-use confirmationNonce from the local signer TTY confirm. Cannot mint confirmation itself.",parameters:{type:"object",properties:{artifact:{type:"object"},confirmationNonce:{type:"string",minLength:32,maxLength:128}},required:["artifact","confirmationNonce"],additionalProperties:!1}}},{type:"function",function:{name:"signer_disarm",description:"Global kill switch. Stops the local signer from broadcasting.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"receipt_report",description:"Receipt or it did not happen. Requires transactionHash/hash/txid.",parameters:{type:"object",properties:{receipt:{type:"object"},transactionHash:{type:"string"},hash:{type:"string"},txid:{type:"string"}},additionalProperties:!1}}},{type:"function",function:{name:"watch_create",description:"Create an alert-only watch. Never execute.",parameters:{type:"object",properties:{chain:{type:"string"},token:{type:"string"},condition:{type:"string"},note:{type:"string"}},required:["chain","token","condition"],additionalProperties:!1}}},{type:"function",function:{name:"watch_list",description:"List local alert-only watches.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"portfolio_snapshot",description:"How to read the one portfolio snapshot. knownUsd is incomplete if a provider is missing.",parameters:{type:"object",properties:{},additionalProperties:!1}}}])});function xt(e){return String(e||"").trim()||void 0}function Fc(e,{required:t=!1}={}){let r=xt(e)?.toLowerCase();if(!r){if(t)throw new Error("model provider is required");return}if(!Dc.has(r))throw new Error(`unsupported provider: ${r}`);return r}function qc(e,{required:t=!1}={}){let r=xt(e);if(!r){if(t)throw new Error("model is required");return}if(r.includes("..")||r.startsWith("/")||!/^[a-zA-Z0-9._:/-]{1,200}$/.test(r))throw new Error("invalid model id");return r}function Uc(e){let t=xt(e);if(!t||t.length>2048)throw new Error("invalid custom base URL");let r;try{r=new URL(t)}catch{throw new Error("invalid custom base URL")}let n=r.hostname.toLowerCase().replace(/^\[|\]$/g,""),o=n==="localhost"||n==="127.0.0.1"||n==="::1";if(r.protocol!=="https:"&&!(r.protocol==="http:"&&o)||r.username||r.password||r.search||r.hash)throw new Error("custom base URL must use HTTPS or loopback HTTP without credentials, query, or fragment");return r.toString().replace(/\/+$/,"")}function Zo({provider:e,model:t,baseUrl:r}={},{requireModel:n=!1}={}){let o=Fc(e),i=qc(t,{required:n});if(o==="custom")return{provider:o,...i?{model:i}:{},baseUrl:Uc(r)};if(xt(r))throw new Error("baseUrl is only supported for the custom provider");return{...o?{provider:o}:{},...i?{model:i}:{}}}var Dc,ei=l(()=>{Dc=new Set(["openrouter","openai","anthropic","xai","deepseek","gemini","kimi","mistral","nous","qwen","glm","local","ollama","custom","anthropic-oauth","openai-codex","xai-oauth"])});import ti from"node:fs";import Mc from"node:path";function Hc(){return Mc.join(ye(),"model.json")}function Ie(e){return String(e||"").trim()||void 0}function zc(e={}){let t=Ie(e.backend)?.toLowerCase()||"auto",r=Zo({provider:e.provider,model:e.model,baseUrl:e.baseUrl},{requireModel:t==="standalone"}),n=Ie(e.apiKeyEnv),o=Number.parseInt(String(e.contextLength||""),10),i=Object.fromEntries(Object.entries(e.contextByModel||{}).filter(([,u])=>Number.isSafeInteger(u)&&u>0)),s=Ie(e.reasoningEffort),d=Ie(e.computeHost||e.remoteHost),c=Ie(e.computeUser||e.remoteUser),f=Ie(e.computePath||e.remotePath);if(!jc.has(t))throw new Error(`unsupported backend: ${t}`);if(process.env.ORACLE_PUBLIC_DESKTOP==="1"&&["remote","arch"].includes(t))throw new Error("remote compute backends are disabled in the public desktop");if(n&&!/^[A-Z][A-Z0-9_]*$/.test(n))throw new Error("api key env must be an uppercase environment variable name");if(t==="remote"&&!d)throw new Error("remote backend requires computeHost");return{backend:t,...r,...n?{apiKeyEnv:n}:{},...Number.isFinite(o)&&o>0?{contextLength:o}:{},...Object.keys(i).length?{contextByModel:i}:{},...s?{reasoningEffort:s}:{},...d?{computeHost:d}:{},...c?{computeUser:c}:{},...f?{computePath:f}:{}}}function ri(){let e=Hc();if(!ti.existsSync(e))return null;try{return zc(JSON.parse(ti.readFileSync(e,"utf8")))}catch{return null}}var jc,ni=l(()=>{Qe();ei();jc=new Set(["auto","standalone","hermes","remote","arch"])});function Fr(e,t){if(!e||typeof e!="object"||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError(`${t} must be a plain object`);return e}function qr(e,t="control input"){try{ae(e,t),To(e)}catch(r){throw new TypeError(`${t} contains secret or custody material: ${r.message}`)}return e}function We(e,{required:t=[],optional:r=[]}={},n="object"){Fr(e,n);let o=new Set([...t,...r]),i=Object.keys(e).filter(s=>!o.has(s));if(i.length)throw new TypeError(`${n} has unknown field ${i[0]}`);for(let s of t)if(!Object.hasOwn(e,s))throw new TypeError(`${n}.${s} is required`);return e}function Ur(e,t,r=200,{lower:n=!1}={}){if(typeof e!="string"||!e.trim()||e.length>r||Wc.test(e))throw new TypeError(`${t} must be non-empty control-free text up to ${r} characters`);let o=e.trim();return n?o.toLowerCase():o}function Ve(e,t,r=80){let n=Ur(e,t,r,{lower:!0});if(!/^[a-z0-9][a-z0-9._:-]*$/.test(n))throw new TypeError(`${t} must be a lowercase identifier`);return n}function vt(e,t,{positive:r=!1}={}){if(!Number.isSafeInteger(e)||e<0||r&&e===0)throw new TypeError(`${t} must be a ${r?"positive":"non-negative"} safe integer`);return e}function H(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))H(t);Object.freeze(e)}return e}var Wc,Mr=l(()=>{He();Tr();Wc=/[\u0000-\u001f\u007f]/});function oi({family:e,chainId:t},r="chain"){let n=Ve(e,`${r}.family`,40),o;if(n==="evm"){if(typeof t=="number")o=String(vt(t,`${r}.chainId`,{positive:!0}));else if(o=Ur(t,`${r}.chainId`,40),!/^[1-9][0-9]*$/.test(o))throw new TypeError(`${r}.chainId must be a positive decimal EVM chain id`)}else o=Ve(t,`${r}.chainId`,80);return{family:n,chainId:o}}function Gc(e,t="chain"){return We(e,{required:["family","chainId"]},t),H(oi(e,t))}function ii(e,t="finality rule"){qr(e,t),Fr(e,t);let r=e.rule;if(!Vc.includes(r))throw new TypeError(`${t}.rule must be confirmations, finalizedTag, or checkpoint`);let n=r==="confirmations"?"confirmations":r;We(e,{required:["family","chainId","rule",n]},t);let o=oi(e,t);return r==="confirmations"?{...o,rule:r,confirmations:vt(e.confirmations,`${t}.confirmations`,{positive:!0})}:{...o,rule:r,[n]:Ve(e[n],`${t}.${n}`,80)}}function jr(e){if(!Array.isArray(e))throw new TypeError("finality policy rules must be an array");let t=e.map((n,o)=>ii(n,`finality policy rule ${o}`)),r=new Set;for(let n of t){let o=`${n.family}\0${n.chainId}`;if(r.has(o))throw new TypeError(`duplicate finality rule for ${n.family}:${n.chainId}`);r.add(o)}return H({policyVersion:1,rules:t})}function Yc(e){if(We(e,{required:["policyVersion","rules"]},"finality policy"),e.policyVersion!==1||!Array.isArray(e.rules))throw new TypeError("unsupported finality policy");return jr(e.rules)}function ai(e,t){let r=Gc(t,"finality query"),o=Yc(e).rules.find(i=>i.family===r.family&&i.chainId===r.chainId);return o?H({status:"KNOWN",...r,rule:o}):H({status:me.UNKNOWN,reason:"MISSING_FINALITY_RULE",...r,rule:null})}function Jc(e,t){if(e==null)return null;qr(e,"finality evidence");let r=t.rule==="confirmations"?"confirmations":t.rule;if(We(e,{required:["status"],optional:[r]},"finality evidence"),!Kc.includes(e.status))throw new TypeError("finality evidence.status is unknown");let n={status:e.status};return e[r]!=null&&(n[r]=t.rule==="confirmations"?vt(e.confirmations,"finality evidence.confirmations",{positive:!0}):Ve(e[r],`finality evidence.${r}`,80)),n}function si(e,t){if(!e||e.status===me.UNKNOWN||e.rule==null)return H({status:me.UNKNOWN,final:!1,reason:"MISSING_FINALITY_RULE"});let r=ii(e.rule??e,"resolved finality rule"),n=Jc(t,r);if(n==null)return H({status:me.UNKNOWN,final:!1,reason:"MISSING_FINALITY_EVIDENCE"});if(n.status!=="LIVE")return H({status:me.UNKNOWN,final:!1,reason:`${n.status}_EVIDENCE`});let o=!1;return r.rule==="confirmations"?o=n.confirmations!=null&&n.confirmations>=r.confirmations:r.rule==="finalizedTag"?o=n.finalizedTag===r.finalizedTag:o=n.checkpoint===r.checkpoint,H({status:o?me.FINAL:me.INCLUDED,final:o,reason:o?"PINNED_RULE_SATISFIED":"PINNED_RULE_NOT_SATISFIED",rule:r})}var Vc,me,Kc,ci=l(()=>{Mr();Vc=Object.freeze(["confirmations","finalizedTag","checkpoint"]),me=Object.freeze({UNKNOWN:"UNKNOWN",INCLUDED:"INCLUDED",FINAL:"FINAL"}),Kc=Object.freeze(["LIVE","STALE","UNKNOWN","UNAVAILABLE"])});function Qc(e){if(e===!0||e===1||e==="1")return"SUCCESS";if(e===!1||e===0||e==="0")return"FAIL";if(typeof e!="string")return"UNKNOWN";let t=e.trim().toUpperCase();return["SUCCESS","SUCCEEDED","OK","EXECUTED"].includes(t)?"SUCCESS":["FAIL","FAILED","FAILURE","REVERTED","REJECTED"].includes(t)?"FAIL":"UNKNOWN"}function ui(e){return typeof e=="string"&&["FAIL","FAILED","FAILURE","ORPHAN","ORPHANED","REVERTED"].includes(e.trim().toUpperCase())}function zr(e){return e==null?e:Array.isArray(e)?e.map(zr):Ke(e)?Object.fromEntries(Object.keys(e).sort().map(t=>[t,zr(e[t])])):String(e)}function Zc(e,t,r,n){let o=O(e.finalityEvidence,n?.finality,e.evidence),i=O(e.finalityPolicy,e.policy);try{return i==null&&Ke(e.finalityRule)&&(i=jr([{family:t,chainId:r,...e.finalityRule}])),i==null||t==null||r==null?{status:"UNKNOWN",final:!1,reason:"MISSING_FINALITY_RULE"}:si(ai(i,{family:t,chainId:r}),o)}catch{return{status:"UNKNOWN",final:!1,reason:"MALFORMED_FINALITY_EVIDENCE"}}}function D(e,t,r){r!=null&&(e[t]=r)}function eu(e){return e==null?null:String(e).trim().toLowerCase()}function Hr(...e){let t=e.map(eu).filter(Boolean);return t.length<=1||t.every(r=>r===t[0])}function li(e={}){if(!Ke(e))throw new TypeError("verified receipt: input object required");let t=gt(e),r=O(t.actionReceipt,t.receipt),n=Ke(r)?r:t,o=O(t.observation,t.chainObservation,t.observedReceipt),i=Ke(o),s=O(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash),d=O(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family),c=O(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),f=!Hr(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash)||!Hr(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family)||!Hr(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),u=Zc(t,d,c,i&&!f?o:null),m=Qc(O(o?.receiptStatus,o?.executionStatus,o?.status)),b=O(t.reconciliationStatus,t.reconciliation?.status,o?.reconciliationStatus),p=O(t.finalityState,t.finalityEvidence?.status,t.evidence?.status,o?.finalityState),h="UNKNOWN";ui(b)||!f&&(i&&m==="FAIL"||ui(p))?h="FAIL":!f&&s&&i&&m==="SUCCESS"&&["INCLUDED","FINAL"].includes(u.status)&&(h="SUCCESS");let w={verifiedReceiptVersion:Xc,status:h};f&&(w.reason="REFERENCE_MISMATCH"),D(w,"txHash",s),D(w,"chain",O(t.chain,n.chain,o?.chain)),D(w,"family",d),D(w,"chainId",c),D(w,"block",O(o?.block,t.block)),D(w,"blockState",O(o?.blockState,o?.inclusionState)),w.finalityState=u.status,D(w,"confirmations",O(o?.confirmations,o?.finality?.confirmations,t.finalityEvidence?.confirmations,t.evidence?.confirmations)),D(w,"observedAt",O(o?.observedAt,t.observedAt)),D(w,"route",O(t.route,n.route)),D(w,"prepareHash",O(t.prepareHash,n.prepareHash)),D(w,"policyOutcome",O(t.policyOutcome,n.policyOutcome,n.policyChecks));let g=O(t.balanceChanges,o?.balanceChanges,o?.balances,n.balanceChanges,n.balances);return g!=null&&(w.balanceChanges=zr(g)),D(w,"createdAt",O(t.createdAt,n.createdAt)),D(w,"submittedAt",O(t.submittedAt,n.submittedAt)),D(w,"finalizedAt",O(t.finalizedAt,o?.finalizedAt)),D(w,"timestamps",O(t.timestamps,n.timestamps,o?.timestamps)),H(w)}var Xc,GS,O,Ke,di=l(()=>{He();ci();Mr();Xc=1,GS=Object.freeze(["SUCCESS","FAIL","UNKNOWN"]),O=(...e)=>e.find(t=>t!=null),Ke=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype});var pi={};Je(pi,{observeEvmReceipt:()=>fi,verifyEvmReceipt:()=>nu});function ru(e){if(e==null)return null;let t=typeof e=="number"?e:Number.parseInt(String(e),16);return Number.isSafeInteger(t)?t:null}async function fi({txHash:e,chainId:t,rpcUrl:r},n={}){let o=String(e||"").trim().toLowerCase();if(!tu.test(o))throw new TypeError("observe receipt: txHash must be a 32-byte hash");let i=Number(t);if(!Number.isSafeInteger(i)||i<=0)throw new TypeError("observe receipt: chainId required");let s=n.transactionReceipt||vn,d=n.rpcCall||Y,c={...n.rpcOptions||{},...r?{rpcUrl:r}:{}},f;try{f=await s({txHash:o,chainId:i},c)}catch(p){return{observation:null,reason:`RPC_UNAVAILABLE: ${p.message}`}}if(!f||f.receipt==null)return{observation:null,reason:f?.reason||"receipt pending"};let u=null,m=f.blockNumber;if(Number.isSafeInteger(m))try{let p=ru(await d(i,"eth_blockNumber",[],c));p!=null&&p>=m&&(u=p-m+1)}catch{}let b={txHash:o,family:"evm",chainId:String(i),receiptStatus:f.status==="success"?"SUCCESS":f.status==="reverted"?"FAIL":"UNKNOWN",block:m==null?void 0:String(m),observedAt:new Date().toISOString(),finality:{status:"LIVE",...u==null?{}:{confirmations:u}}};return u!=null&&(b.confirmations=u),{observation:b,reason:null}}async function nu({txHash:e,chainId:t,confirmations:r=1,rpcUrl:n},o={}){let{observation:i,reason:s}=await fi({txHash:e,chainId:t,rpcUrl:n},o),d=li({txHash:String(e).trim().toLowerCase(),family:"evm",chainId:String(Number(t)),finalityRule:{rule:"confirmations",confirmations:r},...i?{observation:i}:{}});return{receipt:d,observed:!!i,final:d.finalityState==="FINAL",requiredConfirmations:r,reason:s}}var tu,mi=l(()=>{J();di();tu=/^0x[0-9a-f]{64}$/});var hi={};Je(hi,{classifyReceipt:()=>Pe,configDir:()=>su,firstHourReport:()=>Wr,probeReceiptModule:()=>uu,probeReviewModule:()=>cu,venueMap:()=>At});import ou from"node:path";import{homedir as iu}from"node:os";function su(e=process.env){return e.ORACLE_CONFIG_DIR||ou.join(iu(),".config","oracle")}function At({env:e=process.env,vault:t=null}={}){let r=t||ze(),n=[];for(let[o,i]of Object.entries(nt)){let s=(i.rpcEnv||[]).some(c=>String(e[c]||"").trim()),d="prepare";i.evm?s&&(d="live"):d="unavailable",n.push({key:o,chainId:i.chainId,name:i.name,family:"evm",status:d,execute:!!(r.vaultExists&&r.armed&&!r.disarmed),note:s?"rpc configured":"public read/prepare; set RPC for live reads"})}return n.push({key:"solana",chainId:null,name:"Solana",family:"sol",status:"prepare",execute:!1,note:"Jupiter quote/prepare; local sol signer"},{key:"bitcoin",chainId:null,name:"Bitcoin",family:"btc",status:"prepare",execute:!1,note:"Esplora read; local btc signer"},{key:"hyperliquid-l1",chainId:null,name:"Hyperliquid L1",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not an EVM signer family"},{key:"polymarket",chainId:null,name:"Polymarket",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not a signer family"}),n}function Wr({env:e=process.env,model:t=ri(),vault:r=ze(),signerReachable:n=!1,quote:o=null,reviewAvailable:i=!1,receiptAvailable:s=!1}={}){let d=[],c=(p,h,w,g=null)=>d.push({id:p,status:h,detail:w,fix:g}),f=(()=>{let[p,h]=process.versions.node.split(".").map(Number);return p>20||p===20&&h>=19})();c("node",f?"ok":"fail",`node ${process.versions.node}`,f?null:"install node >= 20.19"),t?t.backend==="hermes"?c("model","warn","backend=hermes (opt-in attach)","oracle model --backend standalone"):c("model","ok",`${t.backend||"auto"} ${t.provider||""} ${t.model||""}`.trim()):c("model","fail","no model.json","oracle setup model"),r.vaultExists?r.disarmed?c("vault","warn","vault present, DISARMED","oracle signer (re-arm after confirm)"):c("vault",r.armed?"ok":"warn",r.armed?"present, armed":"present, not armed"):c("vault","fail","no local vault","oracle sign init");let u=e.ORACLE_SIGNER_HOST||"127.0.0.1";if(au.has(u)?c("signer",n?"ok":"warn",n?`loopback ${u}:${e.ORACLE_SIGNER_PORT||9462}`:"loopback signer not reachable",n?null:"oracle signer"):c("signer","fail",`signer host ${u} is not loopback`,"unset ORACLE_SIGNER_HOST"),!o)c("quote","warn","quote not probed",null);else if(o.ok){let p=String(o.detail||"net quote returned");c("quote","ok",p.length>140?`${p.slice(0,140)}\u2026`:p)}else c("quote","warn",o.detail||"quote unavailable","check network / oracle data serve");c("review",i?"ok":"fail",i?"sign-time review renders decoded action, policy hits, approval deltas":"sign-time review module missing from this build",i?null:"reinstall @oracle-agent/oracle (src/control/sign-time-review.mjs)"),c("receipt",s?"ok":"fail",s?"oracle receipt verifies on-chain state (SUCCESS/FAIL/UNKNOWN, finality-pinned)":"verified-receipt observer missing from this build",s?null:"reinstall @oracle-agent/oracle (src/desk/observe-receipt.mjs)");let m=d.some(p=>p.status==="fail"),b=d.filter(p=>p.status==="ok").length;return{ok:!m,checks:d,firstRunScore:{ok:b,total:d.length,label:`${b}/${d.length} first-run hops green`},venues:At({env:e,vault:r})}}async function cu(){try{return typeof(await Promise.resolve().then(()=>(dr(),Gn))).createSignTimeReview=="function"}catch{return!1}}async function uu(){try{let e=await Promise.resolve().then(()=>(mi(),pi));return typeof e.observeReceipt=="function"||typeof e.default=="function"||Object.values(e).some(t=>typeof t=="function")}catch{return!1}}var au,Vr=l(()=>{Ut();Dr();ni();ar();au=new Set(["127.0.0.1","::1","localhost"])});var gi={};Je(gi,{classifyReceipt:()=>Pe,default:()=>fu,detailText:()=>wi,firstHourReport:()=>Wr,probeQuote:()=>du,probeSigner:()=>lu,symbol:()=>Ge,vaultStatus:()=>ze});async function lu(e=process.env){let t=e.ORACLE_SIGNER_HOST||"127.0.0.1",r=e.ORACLE_SIGNER_PORT||9462;try{return(await fetch(`http://${t}:${r}/status`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}function Ge(e){let t=String(e??"?").replace(/[^\w.$-]/g,"");return t.length>12?`${t.slice(0,12)}...`:t||"?"}function wi(e,t=120){let r=String(e??"").replace(/[\u0000-\u001f\u007f-\u009f]/g," ").replace(/\s+/g," ").trim();return r?r.length>t?`${r.slice(0,t)}...`:r:"quote failed"}async function du(){try{let e=await fetch("https://api.dexscreener.com/latest/dex/search?q=WETH%20USDC",{signal:AbortSignal.timeout(4e3)});if(!e.ok)return{ok:!1,detail:`dexscreener ${e.status}`};let r=(await e.json())?.pairs?.[0];return!r?.chainId||!r?.priceUsd?{ok:!1,detail:"no pair"}:{ok:!0,detail:`${Ge(r.chainId)} ${Ge(r.baseToken?.symbol)}/${Ge(r.quoteToken?.symbol)} $${Ge(r.priceUsd)}`}}catch(e){return{ok:!1,detail:wi(e instanceof Error?e.message:"quote failed")}}}var fu,yi=l(()=>{Vr();Dr();fu={name:"venues",summary:"label every shipped venue live / prepare / unavailable",group:"read",usage:"oracle venues [--json]",async run(e){let t=e.argv.includes("--json"),r=At();if(t)return process.stdout.write(`${JSON.stringify({venues:r},null,2)}
5
5
  `),0;for(let n of r)process.stdout.write(`${n.status.padEnd(12)} ${n.key.padEnd(16)} ${n.name} exec=${n.execute?"local":"no"}
6
- `);return 0}}});import ke from"node:fs";import mi from"node:path";import Qr from"node:fs";import be from"node:path";Xe();var _i="0.19.0",Su=`hermes-agent==${_i}`;var Xr="0.12.1",xu=Object.freeze({posix:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${Xr}/uv-installer.sh`,sha256:"d3f5412d38c99f9d024901843bf98206f0d2c6dbe64df40d0b740e2751ca62c1"}),windows:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${Xr}/uv-installer.ps1`,sha256:"b9ec035151bfbb11d616dbd69886498d885551489eddf095ea3c0ad59f640eb0"})});function Ti(){return be.join(ye(),"runtime")}function Ci(){return be.join(Ti(),"venv")}function Ni(e){let t=process.platform==="win32"?"Scripts":"bin",r=process.platform==="win32"?`${e}.exe`:e;return be.join(Ci(),t,r)}function Ri(){return Ni("hermes")}function Li(e){let t=process.platform==="win32"&&!be.extname(e)?["",".exe",".cmd",".bat"]:[""];for(let r of(process.env.PATH||"").split(be.delimiter))if(r)for(let n of t){let o=be.join(r,`${e}${n}`);try{if(Qr.existsSync(o))return o}catch{}}return null}function Zr(){if(process.env.ORACLE_HERMES_BIN)return{ok:!0,bin:process.env.ORACLE_HERMES_BIN,source:"env"};let e=Ri();if(Qr.existsSync(e))return{ok:!0,bin:e,source:"managed"};let t=Li("hermes");return t?{ok:!0,bin:t,source:"path"}:{ok:!1,bin:null,source:null}}import Le from"node:fs";import $ from"node:path";Xe();import{existsSync as tn,readFileSync as Pi}from"node:fs";import{dirname as en,join as At}from"node:path";import{fileURLToPath as $i}from"node:url";function Bi(e){let t=en($i(e));for(let r=0;r<8;r+=1){let n=At(t,"package.json");if(tn(n))try{let i=JSON.parse(Pi(n,"utf8"));if(i&&typeof i.version=="string")return t}catch{}let o=en(t);if(o===t)break;t=o}throw new Error(`oracle: could not resolve package root from ${e}`)}function rn(e,t){let r=Bi(t),n=At(r,e);return tn(n)?n:At(r,"dist","assets",e)}var Di=Object.freeze([{id:"oracle",label:"Oracle Native",kind:"oracle",bins:["oracle"],website:!0,detect:!0},{id:"hermes",label:"Hermes Agent",kind:"mcp",bins:["hermes"],mcpTarget:"generic",configKey:"hermes",website:!0,detect:!0},{id:"claude",label:"Claude Code",kind:"mcp",bins:["claude"],mcpTarget:"claude-code",configKey:"claudeCode",website:!0,detect:!0},{id:"claude-desktop",label:"Claude Desktop",kind:"mcp",bins:[],mcpTarget:"claude-desktop",configKey:"claudeDesktop",website:!0,detect:!1},{id:"chatgpt",label:"ChatGPT",kind:"mcp",bins:[],mcpTarget:"chatgpt",configKey:"chatgpt",website:!0,detect:!1},{id:"codex",label:"OpenAI Codex",kind:"mcp",bins:["codex"],mcpTarget:"codex",configKey:"codex",website:!0,detect:!0},{id:"cursor",label:"Cursor",kind:"mcp",bins:["cursor","cursor-agent"],mcpTarget:"cursor",configKey:"cursor",website:!0,detect:!0},{id:"windsurf",label:"Windsurf",kind:"mcp",bins:["windsurf"],mcpTarget:"vscode",configKey:"windsurf",website:!0,detect:!0},{id:"vscode",label:"VS Code / Copilot",kind:"mcp",bins:["code","code-insiders"],mcpTarget:"vscode",configKey:"vscode",website:!0,detect:!0},{id:"openclaw",label:"OpenClaw",kind:"mcp",bins:["openclaw","claw"],mcpTarget:"generic",configKey:"openclaw",website:!0,detect:!0},{id:"perplexity",label:"Perplexity",kind:"mcp",bins:["perplexity","pplx"],mcpTarget:"generic",configKey:"perplexity",website:!0,detect:!0},{id:"manus",label:"Manus",kind:"mcp",bins:["manus"],mcpTarget:"generic",configKey:"manus",website:!0,detect:!0},{id:"prime",label:"Prime Intellect Agent",kind:"mcp",bins:["prime-agent","prime"],mcpTarget:"generic",configKey:"prime",website:!1,detect:!0},{id:"opencode",label:"OpenCode",kind:"mcp",bins:["opencode"],mcpTarget:"generic",configKey:"opencode",website:!1,detect:!0},{id:"aider",label:"Aider",kind:"mcp",bins:["aider"],mcpTarget:"generic",configKey:"aider",website:!1,detect:!0},{id:"continue",label:"Continue",kind:"mcp",bins:["continue"],mcpTarget:"vscode",configKey:"continue",website:!1,detect:!0},{id:"goose",label:"Goose",kind:"mcp",bins:["goose"],mcpTarget:"generic",configKey:"goose",website:!1,detect:!0},{id:"amp",label:"Amp",kind:"mcp",bins:["amp"],mcpTarget:"generic",configKey:"amp",website:!1,detect:!0},{id:"generic",label:"Generic MCP",kind:"mcp",bins:[],mcpTarget:"generic",configKey:"genericMcp",website:!0,detect:!1}]);function nn(){return Di.filter(e=>e.website)}var It=Object.freeze(["long_horizon","recursive_fanout","continual_learn","evidence_first","prepare_only"]);function kt(e=process.env){let t=String(e?.ORACLE_RESEARCH_MODE??e?.ORACLE_RLM_MODE??"").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"||t==="on"||t==="research"}var oe=Object.freeze(["oracle_cli","memory_add","memory_remove","memory_search","skill_load","skill_create","skill_list","cron_add","cron_list","cron_remove","meta_analyze","web_fetch","web_search","file_read","file_write","mcp_list","mcp_call","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","learn_skill","approval_preview","workspace_artifact","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","vault_status","signer_status","signer_execute","signer_disarm","receipt_report","watch_create","watch_list","portfolio_snapshot","vision_analyze","browser_exec","xurl","knowledge_search","x402_prepare"]),Fi="deny",Cu=256*1024;var Nu=Object.freeze({version:1,source:"default",defaultDecision:Fi,allow:oe,deny:Object.freeze([])});var qi=Object.freeze(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","approval_preview","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","vault_status","signer_status","receipt_report","watch_list","portfolio_snapshot","vision_analyze","knowledge_search"]),Ru=new Set(qi);var ce=Object.freeze({PUBLIC_APP:"public-app",RESEARCH_X_TELEGRAM:"research-x-telegram",OWNER_DESK:"owner-desk"}),Lu=Object.freeze(Object.values(ce));function on(e){let t=e.filter(r=>!oe.includes(r));if(t.length)throw new Error(`tool surface allowlist names unknown shipped tools: ${t.join(", ")}`);return Object.freeze([...e])}var Ot=on(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","approval_preview","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","receipt_report","watch_list","portfolio_snapshot","vision_analyze","knowledge_search","x402_prepare"]),an=on([...Ot,"file_read","meta_analyze","cron_list","mcp_list","xurl"]),sn=Object.freeze([...oe]),Pu=Object.freeze({[ce.PUBLIC_APP]:Ot,[ce.RESEARCH_X_TELEGRAM]:an,[ce.OWNER_DESK]:sn}),$u=Object.freeze({[ce.PUBLIC_APP]:new Set(Ot),[ce.RESEARCH_X_TELEGRAM]:new Set(an),[ce.OWNER_DESK]:new Set(sn)});var _t=Object.freeze(["wallet","pool","nft_floor","hl_flow","prediction_market"]),Du=Object.freeze({wallets:"wallet",smart_wallet:"wallet",pools:"pool",new_pool:"pool",nft:"nft_floor",nft_floors:"nft_floor",hyperliquid:"hl_flow",prediction:"prediction_market",prediction_markets:"prediction_market"}),G=(e,t=0,r=1)=>Math.min(r,Math.max(t,e)),z=e=>Number.isFinite(Number(e))?Number(e):null,Ui=e=>Math.round(e*1e4)/1e4;function W(e,t,r,n=!0){!n||r===null||!Number.isFinite(r)||e.push({feature:t,value:Ui(r)})}function Mi(e,t){let r=z(e.repeatBuys??e.repeat_buys??e.buyCount),n=z(e.walletWinRate??e.winRate);W(t,"repeat_buys",r===null?null:G((r-1)/4)*.38),W(t,"wallet_win_rate",n===null?null:(G(n)-.5)*.5)}function ji(e,t){let r=z(e.ageHours??e.poolAgeHours),n=z(e.liquidityUsd??e.liquidity),o=e.liquidityLocked??e.locked;W(t,"pool_age",r===null?null:r<24?-.42:G(r/720)*.12),W(t,"liquidity",n===null?null:(G(Math.log10(Math.max(1,n))/7)-.5)*.28),W(t,"liquidity_lock",o==null?null:o?.12:-.28)}function Hi(e,t){let r=z(e.floorChange??e.floorChangePct),n=z(e.sales??e.saleCount);W(t,"floor_change",r===null?null:G(r,-1,1)*.35),W(t,"sales_depth",n===null?null:G(n/50)*.18)}function zi(e,t){let r=z(e.flowImbalance??e.imbalance),n=z(e.fundingRate??e.funding);W(t,"flow_imbalance",r===null?null:G(r,-1,1)*.42),W(t,"funding",n===null?null:-G(n*100,-1,1)*.12)}function Wi(e,t){let r=z(e.marketProbability??e.marketPrice??e.probability),n=z(e.fairProbability??e.referenceProbability??e.fairValue);W(t,"probability_mispricing",r===null||n===null?null:G(n-r,-1,1)*.65);let o=z(e.liquidityUsd??e.liquidity);W(t,"market_liquidity",o===null?null:G(Math.log10(Math.max(1,o))/6)*.12)}var Fu=Object.freeze({wallet:Mi,pool:ji,nft_floor:Hi,hl_flow:zi,prediction_market:Wi});Ht();Vt();Y();import{Interface as Rn,getAddress as Mf,id as Ka,isAddress as jf}from"ethers";Y();var Hl=Object.freeze({1:"assertion failed",17:"arithmetic overflow or underflow",18:"division or modulo by zero",33:"invalid enum value",34:"invalid storage byte array encoding",49:"pop() on an empty array",50:"array index out of bounds",65:"out of memory",81:"call to an uninitialized function pointer"});var Wl=Object.freeze(["blockNumber","nativeBalance","tokenBalance","resolveToken","resolvePools","scanBlocks","scoreRisk","quote","sellSimulation","prepareUnsignedTx"]),Kt=Object.freeze({LIVE:"LIVE",CACHED:"CACHED",STALE:"STALE",UNKNOWN:"UNKNOWN",UNAVAILABLE:"UNAVAILABLE"}),Gt=Object.freeze({PASS:"PASS",CAUTION:"CAUTION",FAIL:"FAIL",UNKNOWN:"UNKNOWN"});var Ua=Object.freeze({FULL:"FULL",NO_GAS:"NO_GAS",FAILED:"FAILED"});kn();On();Cn();j();X();st();F();Yt();Ht();Vt();j();var pf=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"]});at();Y();var Tf=Object.freeze(["lifi","relay"]);F();var Pf=Object.freeze({TRANSACTION:"unsigned-transaction",TYPED_DATA_ORDER:"typed-data-order"});var $f=new Set(["0x0000000000000000000000000000000000000000","0x000000000000000000000000000000000000dead","0x0000000000000000000000000000000000000001","0x00000000000000000000000000000000000a1ce5"].map(e=>e.toLowerCase()));var Bf=Object.freeze(["operation","exactOutput","amountOut","multihop","path","positionManager","modifyLiquidities","commands","actions"]);F();var Ln=Object.freeze({1:Object.freeze({name:"ethereum",positionManager:"0xC36442b4a4522E871399CD717aBDD847Ab11FE88",wrappedNative:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",venue:"uniswap-v3",source:"https://docs.uniswap.org/contracts/v3/reference/deployments/ethereum-deployments"}),8453:Object.freeze({name:"base",positionManager:"0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",wrappedNative:"0x4200000000000000000000000000000000000006",venue:"uniswap-v3",source:"https://docs.uniswap.org/contracts/v3/reference/deployments/base-deployments"})}),Kf=new Rn(["function ownerOf(uint256 tokenId) view returns (address)","function positions(uint256 tokenId) view returns (uint96 nonce,address operator,address token0,address token1,uint24 fee,int24 tickLower,int24 tickUpper,uint128 liquidity,uint256 feeGrowthInside0LastX128,uint256 feeGrowthInside1LastX128,uint128 tokensOwed0,uint128 tokensOwed1)","function decreaseLiquidity((uint256 tokenId,uint128 liquidity,uint256 amount0Min,uint256 amount1Min,uint256 deadline) params) payable returns (uint256 amount0,uint256 amount1)","function collect((uint256 tokenId,address recipient,uint128 amount0Max,uint128 amount1Max) params) payable returns (uint256 amount0,uint256 amount1)","function multicall(bytes[] data) payable returns (bytes[] results)"]),Gf=new Rn(["function withdraw(uint256 wad)"]),Jf=(1n<<128n)-1n;var Yf=Ka("Transfer(address,address,uint256)").toLowerCase();j();st();F();import{getAddress as tp,Interface as ct,TypedDataEncoder as rp,parseUnits as np}from"ethers";var Ja="fulfillAdvancedOrder(((address offerer,address zone,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)[] offer,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 totalOriginalConsiderationItems) parameters,uint120 numerator,uint120 denominator,bytes signature,bytes extraData) advancedOrder,(uint256 orderIndex,uint8 side,uint256 index,uint256 identifier,bytes32[] criteriaProof)[] criteriaResolvers,bytes32 fulfillerConduitKey,address recipient)",cp=new ct([`function ${Ja}`]),up=new ct(["function mintPublic(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity) payable","function mintAllowList(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity,(uint80 mintPrice,uint48 maxTotalMintableByWallet,uint48 startTime,uint48 endTime,uint48 dropStageIndex,uint32 maxTokenSupplyForStage,uint16 feeBps,bool restrictFeeRecipients) mintParams,bytes32[] proof) payable"]),Ya=Object.freeze(["blast","base","ethereum","zora","arbitrum","sei","avalanche","polygon","optimism","ape_chain","flow","b3","soneium","ronin","bera_chain","solana","shape","unichain","gunzilla","abstract","animechain","hyperevm","somnia","monad","hyperliquid","megaeth","ink","robinhood","stablechain"]),lp=new Set(Ya);var Pn=Object.freeze({robinhood:4663,ethereum:1,base:8453,arbitrum:42161,optimism:10,polygon:137,avalanche:43114,zora:7777777,blast:81457,sei:1329,ape_chain:33139,b3:8333,soneium:1868,ronin:2020,bera_chain:80094,shape:360,unichain:130,gunzilla:43419,abstract:2741,animechain:69e3,hyperevm:999,somnia:5031,monad:143,megaeth:4326,ink:57073,stablechain:988});var dp=Object.freeze({OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]});var fp=new ct(["function setApprovalForAll(address operator,bool approved)"]),pp=new ct(["function cancel((address offerer,address zone,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)[] offer,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 counter)[] orders) returns (bool cancelled)"]);Y();nt();j();Y();Y();Ut();var Xt=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",stableQuoteAssets:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"],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",stableQuoteAssets:["0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85","0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"],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",stableQuoteAssets:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"],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",stableQuoteAssets:["0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"],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",stableQuoteAssets:["0x5fc5360d0400a0fd4f2af552add042d716f1d168"],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",stableQuoteAssets:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"],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",stableQuoteAssets:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"],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",stableQuoteAssets:["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"],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}}]}]);var ut=new Map,Xa=Object.keys(jt).map(Number),Qa=Object.keys(Wt).map(Number),Za=Object.keys(Ln).map(Number),Zt=Xt.map(e=>e.chainId),es=[...new Set(Object.values(Pn))],Qt=new Set,$n=!1;function Bn(e){if(!e||typeof e!="object"||Object.isFrozen(e))return e;for(let t of Object.values(e))Bn(t);return Object.freeze(e)}function a(e){if(!e?.id)throw new Error("registerProvider requires id");if(!e.venue)throw new Error("registerProvider requires venue");if(!Array.isArray(e.ops))throw new Error("registerProvider requires ops[]");let t=String(e.id);if($n&&Qt.has(t))throw new Error(`registerProvider refuses to overwrite built-in provider: ${t}`);return ut.set(t,{chainIds:e.chainIds||[],auth:e.auth||"none",description:e.description||"",baseEnv:e.baseEnv||[],...e,id:t}),ut.get(t)}function er({venue:e,op:t}={}){let r=[...ut.values()];return e&&(r=r.filter(n=>n.venue===e)),t&&(r=r.filter(n=>n.ops.includes(t))),r}function ts(){Qt.clear();for(let[e,t]of ut)Qt.add(e),Bn(t);$n=!0}a({id:"hl-info",venue:"hl",chainIds:[],auth:"none",ops:["health","allMids","l2Book","outcomeMeta","clearinghouse","userFills","meta","metaAndAssetCtxs","candleSnapshot","openOrders","frontendOpenOrders","userState","spotMeta"],baseEnv:["HL_INFO_URL","HL_API_URL"],description:"Hyperliquid public /info"});a({id:"hl-vaults",venue:"hyperliquid-vaults",chainIds:[],auth:"none",ops:["health","summaries","details","userEquities","tracker"],execution:"read-only",baseEnv:["HL_INFO_URL","HL_API_URL"],description:"Read-only Hyperliquid vault summaries, vault details, user vault equities, and HLP tracking."});a({id:"hl-precompiles",venue:"hyperliquid",chainIds:[999],auth:"none",ops:["health","read","l1BlockNumber","markPx","oraclePx","spotPx","position","spotBalance","vaultEquity","withdrawable"],execution:"read-only",baseEnv:["HYPEREVM_RPC_URL","HYPER_EVM_RPC"],description:"HyperEVM L1Read precompiles (0x800-0x809). eth_call only. Includes HLP vault equity. No CoreWriter."});a({id:"protocol-templates",venue:"protocol-builder",chainIds:[],auth:"none",ops:["health","list","listNative","gate","prepareDeploy","buildNative","eval"],description:"Gated EVM templates plus deterministic Solana program and Bitcoin policy scaffolds. Native bundles require chain-specific compile, tests, and simulation before any unsigned deploy/funding prepare. NOT a firm audit."});a({id:"poly-public",venue:"poly",chainIds:[137],auth:"none",ops:["health","time","markets","book","midpoint","spread","price","events"],execution:"read-only",baseEnv:["POLY_CLOB_URL","POLY_GAMMA_URL"],description:"Polymarket CLOB + Gamma public REST"});a({id:"poly-clob",venue:"poly",chainIds:[137],auth:"none",ops:["health","prepareOrder"],execution:"prepare",localSignerSurfaces:["poly"],description:"Polymarket CLOB unsigned EIP-712 order prepare plus owner-operated local-signer submit. Hosted/keyless remains prepare-only."});a({id:"hl-delta-neutral",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","scan","quote","prepare","loop"],execution:"prepare",localSignerSurfaces:["hl"],description:"Hyperliquid funding carry. Armed through the existing hl signer. Hosted/keyless remains prepare-only. Not automated."});a({id:"lighter-delta-neutral",venue:"lighter",chainIds:[],auth:"none",ops:["health","scan","quote","prepare","loop"],execution:"prepare",localSignerSurfaces:["lighter"],description:"Lighter.xyz funding carry. Armed through the official sendTx local-signer. Hosted/keyless remains prepare-only. Not automated."});a({id:"portfolio",venue:"multichain-wallet",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","balances","snapshot","history","valueGraph"],execution:"read-only",description:"Read-only balance aggregation across configured EVM chains, Solana, Bitcoin, and Hyperliquid, plus profile-local observation snapshots, history, and value graphs with explicit partial coverage."});a({id:"nft-portfolio",venue:"multichain-nft-wallet",chainIds:[1,10,137,988,999,2741,4663,8453,42161,43114],auth:"optionalApiKey",ops:["health","inventory","gallery","pnl","prepareList","traitSnipe"],execution:"prepare",baseEnv:["OPENSEA_API_KEY","MAGICEDEN_API_KEY","SATFLOW_API_KEY"],description:"Normalized EVM, Solana, and Bitcoin NFT inventory, static contact-sheet galleries, explicit PnL coverage, user-confirmed unsigned listing preparation, and evidence-gated trait-snipe buy intents."});a({id:"evm-simulate",venue:"onchain-simulation",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","simulate"],execution:"read",baseEnv:[],description:"Pre-sign EVM transaction simulation: eth_call at pending state to catch reverts, decoded revert reasons (Error(string), Panic codes, custom-error selectors), and a buffered gas estimate. Distinguishes a genuine revert from an unreachable node \u2014 an infra failure is never reported as 'would fail'. A pass reflects current chain state and is explicitly not a guarantee."});a({id:"bitcoin-mint-funding",venue:"onchain-mint",chainIds:[],auth:"none",ops:["health","annotateOutpoints","selectFundingInputs","liveFeeRate","planInscriptionFunding"],execution:"read",baseEnv:[],description:"Bitcoin/Ordinals mint funding safety. btcUtxos returns every UTXO an address owns and prepareOrdinalsMint validates PSBT structure but never checks whether an input holds an inscription \u2014 this is the missing step between them. Classifies outpoints against an ordinals index and EXCLUDES before selecting, so an inscription is never spent as fee-paying change and burned. An unreachable index degrades to 'nothing is provably safe' rather than 'everything looks clean'. Prices fees from the marginal rate of a projected block, and refuses an inscription too heavy to relay before any UTXO is touched."});a({id:"solana-mint-submit",venue:"onchain-mint",chainIds:[],auth:"none",ops:["health","freshBlockhash","deriveComputeUnitPrice","planMintFee","measureComputeUnits","constraints","planRpcEnvelope","planBundleEnvelope","planRetryEnvelope","bundleStatus"],execution:"read",baseEnv:[],description:"Solana mint submission adapter. Prepare-only: builds sendTransaction and Jito sendBundle requests for already-signed bytes and never broadcasts, because solanaRpc refuses every send* method by design. Derives the compute-unit price from live getRecentPrioritizationFees samples rather than any hardcoded figure, pins blockhash fetches to 'confirmed' (the 'finalized' default silently burns ~21% of the ~60s window), and refuses a re-signed retry \u2014 Solana has no nonce, so a re-signed transaction can land alongside the original and mint twice."});a({id:"mint-race",venue:"onchain-mint",chainIds:[1,10,56,137,8453,42161,81457,7777777],auth:"none",ops:["health","probeOpen","measureLatency","inclusionStrategy","raceIntel"],execution:"read",baseEnv:[],description:"Mint race intelligence: probe every sale-state flag in one concurrent round trip instead of five sequential ones, measure RPC round-trip latency against a contested-mint threshold, and classify whether a chain's inclusion is won by priority fee (builder auction) or by raw latency (centralized sequencer). Read-only: never prepares, signs, or broadcasts."});a({id:"nft-mint",venue:"onchain-mint",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","discover","prepare","priceGas","createTrigger","checkOpen","evaluateTrigger"],execution:"prepare",localSignerSurfaces:["evm-nft"],baseEnv:[],description:"EVM NFT mints: discover the collection's mint entrypoint from bytecode, price a competitive EIP-1559 bid from fee-history percentiles, enforce gas-war caps, surface contract risk, and hand execution to the local signer after explicit arming and bounded grant."});a({id:"universal-mint-router",venue:"universal-nft-mint",chainIds:[],auth:"optionalApiKey",ops:["health","capabilities","prepare"],execution:"prepare",baseEnv:["OPENSEA_API_KEY"],description:"Prepare-only exact universal mint routing across reviewed EVM and Ordinals adapters. Universal Solana mint is RESEARCH_ONLY and disabled until canonical serialized-message decoding ships; the separate Magic Eden marketplace provider is unchanged. It never signs or broadcasts."});a({id:"universal-nft-lifecycle",venue:"universal-nft-lifecycle",chainIds:[],auth:"optionalApiKey",ops:["health","capabilities","route"],execution:"read",baseEnv:["OPENSEA_API_KEY","MAGICEDEN_API_KEY","SATFLOW_API_KEY"],description:"Read-only NFT lifecycle route discovery. It does not prepare, sign, or broadcast artifacts; callers must invoke and review the selected provider operation separately."});for(let[e,t,r]of[["universal-evm-nft-transfer","evm-nft-transfer","Exact unsigned ERC-721/ERC-1155 safeTransferFrom preparation."],["universal-solana-nft-transfer","solana-nft-transfer","Exact unsigned verified Metaplex NFT/Core transfer preparation."],["universal-ordinals-transfer","bitcoin-nft-transfer","Exact unsigned Ordinals PSBT transfer-plan preparation."]])a({id:e,venue:t,chainIds:[],auth:"none",ops:["health","prepare"],execution:"prepare",description:r});a({id:"contract-risk",venue:"onchain-bytecode",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","scan"],execution:"read",baseEnv:[],description:"Structural contract risk from on-chain bytecode: retained owner powers (mint, blacklist, pause, fee changes) and upgradeability across EIP-1967, legacy zeppelinos, and EIP-1822 proxy slots. Complements behavioural sell simulation. Never reports 'safe' \u2014 a clean scan is weak evidence, not a guarantee."});a({id:"evm-token-sniper",venue:"evm-token-launches",chainIds:Zt,auth:"none",ops:["health","scan"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:Xt.flatMap(e=>e.rpcEnv),description:"One generic EVM token-sniping path across every configured EVM chain: live identity, pools, structural risk, sell simulation, quote, guarded transaction preparation, and local-signer execution handoff. Robinhood Chain is the default, not a special implementation."});a({id:"evm-rpc",venue:"evm",chainIds:[1,137,42161,8453,10,4663,999],auth:"none",ops:["health","healthAll","blockNumber","chainId","getBalance","call","erc20Allowance","erc20Balance","transactionReceipt"],baseEnv:["ETH_RPC_URL","POLYGON_RPC_URL","RH_CHAIN_RPC","BASE_RPC_URL","ARBITRUM_RPC_URL"],description:"EVM JSON-RPC multi-chain (env RPC or public fallbacks)"});a({id:"solana-rpc",venue:"solana",chainIds:[],auth:"none",ops:["health","latestBlockhash","getBalance","tokenAccounts","simulate"],baseEnv:["SOLANA_RPC_URL"],description:"Solana mainnet JSON-RPC read/prepare surface (no key, no signing, no broadcast)"});a({id:"bitcoin-esplora",venue:"bitcoin",chainIds:[],auth:"none",ops:["health","tipHeight","fees","address","utxos","tx","decode"],execution:"read-only",baseEnv:["BTC_ESPLORA_URL","BTC_NETWORK"],description:"Bitcoin L1 via Esplora (mempool.space/Blockstream). Reads only on data plane. User-signed broadcast is bitcoin_send on exec MCP. No Core RPC, no house keys. Wallets: Xverse/UniSat/Leather/OKX/Phantom"});a({id:"bitcoin-meta",venue:"bitcoin-metaprotocol",chainIds:[],auth:"optionalApiKey",ops:["health","runeBalances","inscriptions","inscriptionInfo","inscriptionChildren","ordBlockInfo"],execution:"read-only",baseEnv:["BTC_META_API_URL","UNISAT_API_KEY","BESTINSLOT_API_KEY"],description:"Bitcoin ordinals/runes reads. Keyless tier via ordinals.com recursive (inscriptionInfo/children/blockInfo); address-indexed ops (inscriptions, runeBalances) need a keyed indexer. Hiro is deprecated (410) and Magic Eden BTC is dead \u2014 use satflow for market."});a({id:"satflow",venue:"bitcoin-marketplace",chainIds:[],auth:"apiKey",ops:["health","collectionFloors","collectionStats","item","walletContents","floorListings","preparePurchase","prepareList"],execution:"prepare",localSignerSurfaces:["btc"],baseEnv:["SATFLOW_API_KEY","SATFLOW_API_URL"],description:"Satflow ordinals+runes marketplace (api.satflow.com). Primary BTC NFT market after Magic Eden BTC sunset. PSBT intents for buy/list; key via x-api-key."});a({id:"jupiter",venue:"solana-dex",chainIds:[],auth:"none",ops:["health","venues","quote","prepare"],execution:"prepare",localSignerSurfaces:["sol"],baseEnv:["JUPITER_SWAP_API_URL","SOLANA_RPC_URL"],description:"Jupiter Swap API quote + unsigned Solana swap prepare, routed through `oracle route swap solana`"});a({id:"hl-perps",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","assetInfo","prepareOrder","prepareCancel","prepareLeverage","prepareIsolatedMargin","prepareBracket","prepareBuilderApproval"],execution:"prepare",localSignerSurfaces:["hl"],notes:"Hyperliquid perp, HIP-3, and HIP-4 outcome orders through local-signer L1 action handoff."});a({id:"hl-markets",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","markets","leaderboards","coin","spot"],notes:"Joined Hyperliquid market datapoints for the Hyperliquid agent. Read-only."});a({id:"hl-entry-state",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","see","qualify","lock","list","watch"],execution:"read-only",description:"SEE/ENTER/MANAGE for discretionary HL perps: compose sourced /info fields, qualify a side, lock the state only after a fill receipt, and alert_only-diff live vs that lock. Never signs."});a({id:"hl-staking",venue:"hypercore-staking",chainIds:[],auth:"none",ops:["health","validators","delegatorSummary","delegations","rewards","history","preflight","prepareStakeDeposit","prepareStakeWithdraw","prepareDelegate"],execution:"prepare",localSignerSurfaces:["hl"],baseEnv:["HL_INFO_URL","HL_EXCHANGE_URL","HL_TESTNET"],description:"Hyperliquid HyperCore HYPE staking. Public reads plus local-signer EIP-712 execution for cDeposit / cWithdraw / tokenDelegate after arming. Hosted/keyless remains prepare-only."});a({id:"magiceden-sol",venue:"solana-nft",chainIds:[],auth:"optionalApiKey",ops:["health","stats","listings","tokenListings","prepareBuy","prepareList","prepareMint"],execution:"prepare",baseEnv:["MAGICEDEN_API_KEY","MAGICEDEN_API_URL"],description:"Magic Eden Solana NFT market. Reads (stats/listings) are keyless; buy/list/mint instruction builders need MAGICEDEN_API_KEY and return an unsigned base64 transaction for the user's Solana wallet. Never signs or broadcasts."});a({id:"defillama",venue:"prices",chainIds:[],auth:"none",ops:["health","prices","pricesBySymbol","protocols","yields","stablecoins","dexVolumes"],baseEnv:["DEFILLAMA_COINS_URL","DEFILLAMA_API_URL"],description:"DeFiLlama public prices + protocols TVL"});a({id:"lifi",venue:"dex",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","quote","prepare","chains"],execution:"prepare",baseEnv:["LIFI_API_URL"],description:"LI.FI public cross-chain / DEX aggregator quotes (no key)"});a({id:"dexscreener",venue:"dex",chainIds:[],auth:"none",ops:["health","token","search","pair","latestTokenProfiles","communityTakeovers","latestTokenBoosts","topTokenBoosts","tokenPairs","batchTokens"],execution:"read-only",baseEnv:["DEXSCREENER_API_URL"],description:"DexScreener keyless read-only token profiles, community takeovers, boosts, and token/pair discovery"});a({id:"bubblemaps",venue:"token-intelligence",chainIds:[1,56,137,999,4663,8453,42161,43114],auth:"apiKey",ops:["health","chains","search","metadata","holders","metrics","map"],execution:"read-only",baseEnv:["BUBBLEMAPS_API_KEY"],description:"Official Bubblemaps Data API v0 token-holder maps, clusters, concentration metrics, and source-backed interactive artifacts."});a({id:"uniswap-v3",venue:"dex",chainIds:Xa,auth:"none",ops:["health","quote","prepare","quotePath","ethUsdc","chains"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:["ETH_RPC_URL","BASE_RPC_URL","ARBITRUM_RPC_URL","OPTIMISM_RPC_URL","BSC_RPC_URL","POLYGON_RPC_URL","AVALANCHE_RPC_URL","RH_CHAIN_RPC"],description:"Uniswap V3 QuoterV2 exact-in quotes via eth_call across official deployments plus Robinhood Chain, no key"});a({id:"lp-exit",venue:"dex",chainIds:Za,auth:"none",ops:["health","inspect","prepareRemove","prepareSettlement","prepareUnwrap","chains"],execution:"prepare",baseEnv:["ETH_RPC_URL","BASE_RPC_URL"],description:"Receipt-gated Uniswap V3 LP exit into native asset: remove/collect, net-route token legs, then unwrap. Unsigned only."});a({id:"lp-liquidity-ranker",venue:"dex",chainIds:Zt,auth:"none",ops:["health","rank"],execution:"read-only",description:"Cross-chain LP destination analysis: deepest liquidity and net-best migration are separate, exact canonical mappings required."});a({id:"lp-destination-discovery",venue:"dex",chainIds:Zt,auth:"none",ops:["health","discover"],execution:"read-only",description:"Live exact-address LP pool discovery across configured chains; reports deepest liquidity separately from cost-qualified migration evidence."});a({id:"uniswap-v4",venue:"dex",chainIds:Qa,auth:"none",ops:["health","quote","inspectHook","prepare","chains"],execution:"prepare",baseEnv:["ETH_RPC_URL","BASE_RPC_URL","ARBITRUM_RPC_URL","OPTIMISM_RPC_URL","BSC_RPC_URL","POLYGON_RPC_URL","AVALANCHE_RPC_URL","RH_CHAIN_RPC"],description:"Uniswap V4 quotes, hook permission/code/pool-state inspection, and guarded unsigned Universal Router preparation across official deployments plus Robinhood Chain."});a({id:"x402",venue:"payments",chainIds:[],auth:"none",ops:["health","inspect","prepare"],execution:"prepare",description:"x402 v2 PAYMENT-REQUIRED inspection and explicit-cap exact-payment templates. Never signs, calls a facilitator, or retries a paid request."});a({id:"bankr",venue:"wallet-data",chainIds:[],auth:"apiKey",ops:["health","wallet","portfolio","swapQuote"],execution:"read-only",baseEnv:["BANKR_API_KEY","BANKR_API_URL"],description:"Bankr Wallet API read-only identity, portfolio, and swap quotes. Oracle excludes Bankr swap, transfer, sign, submit, agent, and LLM endpoints."});a({id:"aerodrome",venue:"dex",chainIds:[8453],auth:"none",ops:["health","quote","prepare","chains"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:["BASE_RPC_URL"],description:"Aerodrome Slipstream CL on Base \u2014 QuoterV2 + SwapRouter exact-input via eth_call (tickSpacing, no key)"});a({id:"zerox",venue:"dex",chainIds:[1,10,137,8453,42161],auth:"apiKey",ops:["health","price","quote","prepare"],execution:"prepare",baseEnv:["ZEROX_API_KEY","ZEROX_API_URL"],description:"0x Swap API v2 price/quote/prepare \u2014 requires ZEROX_API_KEY (unconfigured without key; no Oracle key shipped)"});a({id:"across",venue:"bridge",chainIds:[1,10,137,42161,8453],auth:"none",ops:["health","suggestedFees"],baseEnv:["ACROSS_API_URL"],description:"Across bridge suggested-fees (public)"});a({id:"hop",venue:"bridge",chainIds:[1,10,137,42161],auth:"none",ops:["health","quote"],baseEnv:["HOP_API_URL"],description:"Hop Protocol bridge quotes (public)"});a({id:"relay",venue:"bridge",chainIds:[1,10,137,8453,42161],auth:"none",ops:["health","quote","prepare"],execution:"prepare",baseEnv:["RELAY_API_URL"],description:"Relay.link bridge/swap quotes (public)"});a({id:"cowswap",venue:"dex",chainIds:[1,100,42161,8453],auth:"none",ops:["health","quote","prepareOrder","order","status","chains","arm"],execution:"armed-local",localSignerSurfaces:["evm-order"],baseEnv:[],description:"CowSwap batch auction. Quote is public; Allow posts official api.cow.fi orders."});a({id:"oneinch",venue:"dex",chainIds:[1,10,137,8453,42161],auth:"apiKey",ops:["health","quote","prepare","approveSpender"],execution:"prepare",baseEnv:["ONEINCH_API_KEY","ONEINCH_API_URL"],description:"1inch Swap API v6 quote/prepare \u2014 requires ONEINCH_API_KEY (unconfigured without key; no Oracle key shipped)"});a({id:"hl-ws",venue:"hl",chainIds:[],auth:"none",ops:["health","allMids","l2Book","snapshot"],baseEnv:["HL_WS_URL"],description:"Hyperliquid short-lived WS snapshots (allMids/l2Book)"});a({id:"poly-ws",venue:"poly",chainIds:[137],auth:"none",ops:["health","book","snapshot"],baseEnv:["POLY_WS_URL"],description:"Polymarket CLOB short-lived WS market snapshots"});a({id:"anvil-nft",venue:"robinhood-nft",chainIds:[4663],auth:"optionalApiKey",ops:["health","markets","quoteSpecificBuy","quoteSell","scanCollection","scanAllMarkets","scanCrossVenueArb","scanAllMarketsArb","prepareSpecificBuy","prepareSell"],execution:"prepare",localSignerSurfaces:["evm-nft"],baseEnv:["RH_CHAIN_RPC","OPENSEA_API_KEY","OPENSEA_ENV_FILE"],description:"All-market Anvil discovery and exact-token arbitrage, with exact buy and sell execution through the armed owner-local signer after human confirmation"});a({id:"stonkbrokers",venue:"robinhood-nft",chainIds:[4663],auth:"optionalApiKey",ops:["health","quoteBrokerBuy","scanBrokerLoot","prepareBrokerBuy","brokerDesk","clockInStatus","prepareClockIn"],execution:"prepare",baseEnv:["RH_CHAIN_RPC"],description:"Unsigned StonkBrokers Broker Desk discovery, nested-loot verification, and bounded local-only preparations"});a({id:"opensea-nft",venue:"nft",chainIds:es,auth:"apiKey",ops:["health","collection","floor","bestListings","bestListing","bestOffer","accountNfts","accountPnl","prepareMint","prepareList","prepareCancel"],execution:"prepare",baseEnv:["OPENSEA_API_KEY","OPENSEA_ENV_FILE"],description:"OpenSea multichain NFT inventory, floors, and unsigned bounded mint, listing, and listing-cancellation preparations; opaque buy/sweep fulfillment is disabled"});a({id:"local-marketplace",venue:"local-p2",chainIds:[],auth:"none",ops:["health","createListing","listListings","cancelListing","createOffer","armFill"],execution:"prepare",localSignerSurfaces:["evm-nft"],description:"Owner-local P2 catalog stored under ~/.config/oracle. Additive and isolated from OpenSea, Magic Eden, Satflow, Bisq, Anvil, and Polymarket. Listings are armed for the owner-local signer; sign-and-broadcast is an explicit createLocalMarketplace().instructFill instruction. Generic signHash is refused."});a({id:"local-x402",venue:"local-x402",chainIds:[],auth:"none",ops:["health","createIntent","listIntents","cancelIntent","armPayment"],execution:"prepare",localSignerSurfaces:["evm-swap"],description:"Owner-local x402 payment budgets under ~/.config/oracle. Additive and isolated from OpenSea and Telegram. Intents are armed; sign-and-broadcast is an explicit createLocalX402().instructPay instruction. Generic signHash is refused."});a({id:"local-pack-registry",venue:"local-packs",chainIds:[],auth:"none",ops:["health","registerPack","listPacks","revokePack"],execution:"read-only",description:"Owner-local third-party pack REGISTRY under ~/.config/oracle. Catalog only: packs are never loaded or executed. Isolated from OpenSea and Telegram."});a({id:"erc8004-identity",venue:"agent-identity",chainIds:[],auth:"none",ops:["health","prepareIdentityRegistration","prepareAgentURIUpdate","inspectIdentity","arm"],execution:"armed-local",localSignerSurfaces:["evm"],baseEnv:["ORACLE_ERC8004_CHAIN_ID","ORACLE_ERC8004_IDENTITY_REGISTRY"],description:"Draft ERC-8004 identity. Public prepare is keyless; Allow broadcasts type-2 register/setAgentURI."});a({id:"hyperevm-dex",venue:"hyperevm",chainIds:[999],auth:"none",ops:["health","search","token"],baseEnv:["HYPEREVM_RPC_URL"],description:"HyperEVM pair discovery via DexScreener + optional RPC"});a({id:"geckoterminal",venue:"dex-data",chainIds:[],auth:"none",ops:["health","networks","pool","token","ohlcv"],baseEnv:["GECKOTERMINAL_API_URL"],description:"GeckoTerminal public networks, pools, tokens, and OHLCV"});a({id:"curve",venue:"dex",chainIds:[1,10,56,137,988,999,4663,8453,42161,43114],auth:"none",ops:["health","openapi","pools","quote","prepare"],execution:"prepare",baseEnv:["CURVE_API_URL"],description:"Curve public pool registry API + RouterNG validated single-hop prepare"});a({id:"gmx",venue:"perps-data",chainIds:[42161,43114],auth:"none",ops:["health","tickers","markets","marketsInfo","tokens","prepareOrder","positions","orderStatus","verifyOrder"],execution:"intent",baseEnv:[],description:"GMX v2 public oracle/markets plus guarded async order intents on Arbitrum and Avalanche"});a({id:"morpho",venue:"lending-data",chainIds:[1,10,137,2741,8453,42161,4663,999,988],auth:"none",ops:["health","markets","vaults","prepareVault"],execution:"intent",baseEnv:["MORPHO_API_URL"],description:"Morpho public GraphQL markets/vaults + guarded ERC-4626 vault intents"});a({id:"balancer",venue:"dex",chainIds:[1,10,137,42161,43114,8453],auth:"none",ops:["health","pools","quote","prepare"],execution:"prepare",baseEnv:["BALANCER_API_URL"],description:"Balancer public GraphQL pool data + v3 Router exact-input prepare (Polygon read-only)"});a({id:"pendle",venue:"yield",chainIds:[1,10,56,8453,42161,999],auth:"none",ops:["health","markets","quote","prepare"],execution:"prepare",baseEnv:["PENDLE_API_URL"],description:"Pendle public yield-market API + Hosted SDK direct Convert prepare"});a({id:"odos",venue:"dex",chainIds:[1,10,56,137,8453,42161,43114,4663],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-07-30",reason:"Odos sunset the public SOR API; /sor/quote/v2 and v3 both return 410 Gone",evidence:"sunset: Thu, 30 Jul 2026 12:00:00 GMT response header"},baseEnv:["ODOS_API_URL"],description:"Odos public SOR (DEPRECATED upstream 2026-07-30 -- endpoint returns 410)"});a({id:"blockscout",venue:"explorer",chainIds:[1,10,137,8453,42161],auth:"none",ops:["health","stats","address","token"],baseEnv:[],description:"Verified public Blockscout REST v2 instances"});a({id:"paraswap",venue:"dex",chainIds:[1,10,56,137,8453,42161,43114,4663],auth:"none",ops:["health","tokens","price","quote","prepare"],execution:"prepare",baseEnv:["PARASWAP_API_URL"],description:"ParaSwap/Velora public price routes + validated transaction builder"});a({id:"rfq",venue:"intent-rfq",chainIds:[1,10,56,137,8453,42161,43114,4663],auth:"none",ops:["health","intent","quote"],execution:"prepare",baseEnv:["ZEROX_API_KEY","ONEINCH_API_KEY"],description:"Cross-chain RFQ intent normalizer and firm-quote fanout over reviewed venues. Prepares artifacts only, never signs or broadcasts."});a({id:"execution-strategies",venue:"oracle-native",chainIds:[],auth:"none",ops:["health","plan"],execution:"plan-only",baseEnv:[],description:"Oracle-native TWAP, VWAP, POV, iceberg, and implementation-shortfall planners. No Tread.fi/API dependency. Plans never sign or broadcast; every slice requires a fresh best-execution quote, policy check, simulation, confirmation, wallet signature, and receipt."});a({id:"polygon-staking",venue:"polygon-staking",chainIds:[137],auth:"none",ops:["health","validators","validatorDetail"],baseEnv:["POLYGON_STAKING_API_URL"],description:"Polygon POS staking validators"});a({id:"babylon-staking",venue:"btc-staking",chainIds:[],auth:"none",ops:["health","stats","finalityProviders","delegations"],execution:"read-only",baseEnv:["BABYLON_STAKING_API_URL"],description:"Babylon native BTC staking (staking-api.babylonlabs.io v2). Keyless per-staker positions from a PUBLIC key alone \u2014 APR, TVL, finality-provider roster, and delegations. Read-only; staking/unbonding is user-wallet."});a({id:"mempool-mining",venue:"btc-mining",chainIds:[],auth:"none",ops:["health","difficulty","poolShare","hashrate","rewardStats"],execution:"read-only",baseEnv:["MEMPOOL_API_URL"],description:"Bitcoin mining + network security telemetry via mempool.space /api/v1/mining. Difficulty retarget, pool concentration (top-1/top-3 share), hashrate trend, subsidy-vs-fee split."});a({id:"liquid-esplora",venue:"liquid",chainIds:[],auth:"none",ops:["health","tipHeight","addressInfo","assetInfo"],execution:"read-only",baseEnv:["LIQUID_ESPLORA_URL"],description:"Liquid Network (Blockstream sidechain) via Esplora. Same schema as bitcoin-esplora plus multi-asset issuance/peg stats. Address state exposes transaction counts; per-asset sums can be absent for unconfidential multi-asset addresses and are blinded for confidential addresses."});a({id:"hiro-stacks",venue:"stacks",chainIds:[],auth:"none",ops:["health","networkInfo","stackingInfo","poxCycles","blocks"],execution:"read-only",baseEnv:["HIRO_API_URL","HIRO_API_KEY"],description:"Stacks (Bitcoin L2) via Hiro public API. Network tip, PoX stacking state (the BTC-yield mechanism), and historical reward cycles. Keyless tier is ~20 rps; HIRO_API_KEY is optional and never required."});a({id:"tron-public",venue:"tron",chainIds:[],auth:"none",ops:["health","account","trc20Balances","trc20Transfers","chainParameters"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TRON_API_URL","TRONGRID_API_KEY"],description:"Tron mainnet via public TronGrid. TRX balance, TRC20 token balances, USDT-TRC20 transfer history, chain parameters. Tron carries the largest USDT float of any chain. Keyless; TRONGRID_API_KEY only raises the rate ceiling and never travels to a non-TronGrid host."});a({id:"ton-public",venue:"ton",chainIds:[],auth:"none",ops:["health","accountState","jettonBalances","transactions"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TON_API_URL","TONCENTER_API_KEY"],description:"TON via public toncenter. Account state + nanoton balance, jetton (TON's ERC20) balances, transaction history. The settlement layer for Telegram-native assets. Keyless; TONCENTER_API_KEY only raises the rate ceiling."});a({id:"cosmos-lcd",venue:"cosmos",chainIds:[],auth:"none",ops:["health","chains","balances","delegations","denomTrace"],execution:"read-only",localSignerSurfaces:[],baseEnv:["COSMOS_LCD_URL","COSMOS_CHAIN"],description:"Cosmos SDK chains via keyless LCD/REST \u2014 one provider, many chains (cosmoshub default, plus osmosis/celestia/injective/neutron/dydx/noble/kava, or any LCD via COSMOS_LCD_URL_<CHAIN>). Bank balances, staking delegations + unbondings + rewards, and IBC denom-trace resolution for ibc/<hash> denoms."});a({id:"sui-public",venue:"sui",chainIds:[],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-08-25",reason:"Sui public fullnodes return JSON-RPC -32601 because the JSON-RPC surface is deprecated",evidence:"Migrate the provider to Sui GraphQL or gRPC before restoring it to the live roster"},localSignerSurfaces:[],baseEnv:["SUI_RPC_URL"],description:"QUARANTINED: Sui public JSON-RPC is deprecated. A GraphQL or gRPC replacement has not shipped."});a({id:"aptos-public",venue:"aptos",chainIds:[],auth:"none",ops:["health","account","resources","coinBalances"],execution:"read-only",localSignerSurfaces:[],baseEnv:["APTOS_FULLNODE_URL","APTOS_API_KEY"],description:"Aptos mainnet via the public fullnode REST API. Ledger info, account sequence/auth key, Move resources, type-specific 0x1::coin::balance views, and legacy CoinStore enumeration. Generic enumeration does not cover newer Fungible Asset stores. Read-only; the transaction submit door is never called."});a({id:"canton-scan",venue:"canton",chainIds:[],auth:"none",ops:["health","guide","dso","party","holdings","rounds"],execution:"read-only",localSignerSurfaces:[],baseEnv:["CANTON_SCAN_URL","CANTON_NETWORK","CANTON_MIGRATION_ID"],description:"Canton Network Scan reads for Canton Coin (CC / Amulet) plus static onboarding steps. Not EVM: no chainId, no JSON-RPC, no ERC-20, no Uniswap. Scan sees CC and DSO/governance only. Quote/prepare/sign stay unimplemented."});a({id:"ordinals-runes",venue:"btc-runes",chainIds:[],auth:"none",ops:["health","blockHeight","blockInfo","satInfo","runeInfo"],execution:"read-only",baseEnv:["ORDINALS_BASE_URL"],description:"Runes + sat/block index via a public ord server (ordinals.com). /r/blockheight is PLAIN TEXT; the /runes listing is 406 'JSON API disabled' so only per-rune lookup exists; rune names must drop the bullet spacer (UNCOMMONGOODS)."});a({id:"mempool-lightning",venue:"btc-lightning",chainIds:[],auth:"none",ops:["health","statistics","nodeRankings","nodeCountries"],execution:"read-only",baseEnv:["MEMPOOL_API_URL"],description:"Lightning Network topology via mempool.space. Capacity/channel/node aggregates, node rankings, country distribution. STALE-PRONE: the crawler snapshot has been observed weeks behind, so every response carries ageDays + a stale flag."});a({id:"bob-rootstock",venue:"btc-l2",chainIds:[60808,30],auth:"none",ops:["health","stats","addressInfo","tokenBalances"],execution:"read-only",baseEnv:["BOB_EXPLORER_URL","ROOTSTOCK_EXPLORER_URL"],description:"BOB (60808) and Rootstock (30) \u2014 the EVM Bitcoin L2s \u2014 via their Blockscout v2 instances (identical schema, one code path). Chain stats, gas prices, native balances, token holdings. Pass chainId 'all' to fan out."});a({id:"bisq-markets",venue:"bisq",chainIds:[],auth:"none",ops:["health","markets","ticker","trades"],execution:"read-only",baseEnv:["BISQ_MARKETS_URL"],description:"Bisq non-KYC P2P BTC price discovery (markets.bisq.network). Value is the BASIS against centralized spot, not the absolute print: volume is thin and the last trade can be hours old, so trade age is always reported."});a({id:"social-intel",venue:"oracle-social",chainIds:[],auth:"none",ops:["health","trendingTokens","trendingCas","keywordMentions","smartAccounts","narratives"],execution:"read-only",localSignerSurfaces:[],baseEnv:["ORACLE_SOCIAL_INTEL_STORE","ORACLE_SOCIAL_INTEL_STALE_MIN"],description:"Local curated-account crypto social intelligence. Sample = graded caller list, NOT a firehose; every response reports sample size and snapshot age."});a({id:"magiceden-ordinals",venue:"btc-ordinals-market",chainIds:[],auth:"none",ops:["health","collectionStat"],execution:"read-only",baseEnv:["MAGICEDEN_ORD_API_URL","MAGICEDEN_API_KEY","MAGICEDEN_PROBE_COLLECTION"],description:"Magic Eden ordinals collection stats. DEGRADED UPSTREAM: /v2/ord/btc/* returned 503 'no healthy upstream' on every verification attempt. health() reports ok:false while it is down and collectionStat() returns upstreamDown:true with fallback 'satflow' instead of throwing. Only /stat is wired; 600 req/min documented."});a({id:"braiins-insights",venue:"btc-mining",chainIds:[],auth:"none",ops:["health","priceStats","poolStats"],execution:"read-only",baseEnv:["BRAIINS_INSIGHTS_URL"],description:"Braiins mining insights \u2014 BTC price tick + per-pool block/hashrate distribution. Use insights.braiins.com (302s to learn.braiins.com, followed transparently); pool.braiins.com/api is 403 and is NOT the public API."});a({id:"pyth-price-feeds",venue:"solana-oracle",chainIds:[],auth:"none",ops:["health","latestPrice","latestPrices","feedDirectory"],baseEnv:["PYTH_HERMES_URL"],description:"Pyth Network: Solana price feeds with confidence intervals, real-time updates, zero auth"});a({id:"solend-lending",venue:"solana-lending",chainIds:[],auth:"none",ops:["health","markets","reserves"],baseEnv:["SAVE_API_URL"],description:"Solend/Save lending: markets + per-reserve supply/borrow APY, Solana's Aave equivalent (keyless)"});a({id:"jito-mev",venue:"solana-mev",chainIds:[],auth:"none",ops:["health","recentBundles","tipFloor"],baseEnv:["JITO_API_URL"],description:"Jito MEV: recent bundles, tippers, tip floor \u2014 real-time Solana MEV data (keyless)"});a({id:"sanctum-lst",venue:"solana-staking",chainIds:[],auth:"none",ops:["health","lstList","apyAll","apyIndividual"],baseEnv:["SANCTUM_API_URL"],description:"Sanctum LST: liquid staking tokens with per-token APY \u2014 JitoSOL, mSOL, bSOL, compSOL, pathSOL, etc. (keyless)"});a({id:"kamino-strategies",venue:"solana-yield",chainIds:[],auth:"none",ops:["health","strategies","strategyMetrics"],baseEnv:["KAMINO_API_URL"],description:"Kamino: live yield strategies with APY, TVL, vault balances (keyless)"});a({id:"meteora-dlmm",venue:"solana-dex",chainIds:[],auth:"none",ops:["health","pools","poolSearch"],baseEnv:["METEORA_API_URL"],description:"Meteora DLMM: concentrated liquidity pools via amm-v2 API, distinct from Jupiter DEX routes (keyless)"});a({id:"aave-v3",venue:"evm-lending",chainIds:[1,10,56,137,59144,1088,534352,8453,42161,43114,5e3,1868],auth:"none",ops:["health","markets","marketReserves","chains"],baseEnv:["AAVE_V3_API_URL"],description:"Aave V3 GraphQL: multi-chain lending, full market + reserve schema with supplyInfo/borrowInfo (keyless)"});a({id:"cow-protocol",venue:"evm-intent",chainIds:[1,100,42161],auth:"none",ops:["health","auction","openOrders","recentTrades"],baseEnv:["COW_API_URL"],description:"CoW Protocol: intent/solver auction data, open orders, trades \u2014 intent-based DEX not covered by existing providers (keyless)"});a({id:"relayscan-mev",venue:"evm-mev",chainIds:[1],auth:"none",ops:["health","overview","builderProfit","dailyStats"],baseEnv:["RELAYSCAN_API_URL"],description:"Relayscan: MEV relay overview, builder profit rankings, daily block stats (keyless)"});a({id:"birdeye-tokens",venue:"solana-tokens",chainIds:[],auth:"none",ops:["health","tokenList"],baseEnv:["BIRDEYE_API_URL"],description:"Birdeye public token list: Solana tokens ranked by 24h volume, market cap (keyless)"});a({id:"das-assets",venue:"solana-nft",chainIds:[],auth:"none",ops:["health","assetsByOwner","searchAssets","assetProof"],baseEnv:["SOLANA_RPC_URL"],description:"Digital Asset Standard (DAS): compressed NFT reads via public Solana RPC \u2014 getAssetsByOwner, searchAssets, assetProof. No Helius key needed."});a({id:"symbiotic-restaking",venue:"evm-restaking",chainIds:[1],auth:"none",ops:["health","vaults","vaultDetail"],baseEnv:["SYMBIOTIC_API_URL"],description:"Symbiotic restaking: vaults with collateral data, approved status, operator metadata (keyless)"});a({id:"beefy-yields",venue:"evm-yield",chainIds:[1,10,56,137,8453,42161,43114,250,1088],auth:"none",ops:["health","apy","apyBreakdown"],baseEnv:["BEEFY_API_URL"],description:"Beefy Finance: cross-chain yield aggregator vaults with APY breakdowns (keyless)"});a({id:"across-bridge",venue:"evm-bridge",chainIds:[1,10,42161,8453,324,59144],auth:"none",ops:["health","pools","suggestedFees"],baseEnv:["ACROSS_API_URL"],description:"Across bridge: pool liquidity + APY per bridge pool with suggested fees (keyless)"});a({id:"spark-lend",venue:"evm-lending",chainIds:[1],auth:"none",ops:["health","markets"],baseEnv:["SPARK_API_URL"],description:"Spark Lend / Sky Savings: ERC-4626 vault APY + TVL + user count (keyless)"});a({id:"solana-token-risk",venue:"solana-tokens",chainIds:[],auth:"none",ops:["health","scan"],execution:"read-only",baseEnv:[],description:"GoPlus official Solana token security: mint/freeze authority, transfer hooks, metadata mutability, holder concentration (keyless read-only)"});a({id:"robinhood-wallet-history",venue:"explorer",chainIds:[4663],auth:"none",ops:["health","transactions","tokenBalances","history"],execution:"read-only",baseEnv:[],description:"Robinhood Chain (4663) wallet transaction history and token balances via the official Blockscout explorer (keyless read-only)"});a({id:"l2beat-tvl",venue:"evm-l2",chainIds:[],auth:"none",ops:["health","tvl","activity"],baseEnv:["L2BEAT_API_URL"],description:"L2Beat: L2 scaling TVL, project-level breakdowns, activity metrics (keyless)"});a({id:"celestia-da",venue:"evm-da",chainIds:[],auth:"none",ops:["health","stats","blockStats"],baseEnv:["CELENIUM_API_URL"],description:"Celestia DA via Celenium: blob stats, block-level blob counts, network metrics (keyless)"});a({id:"limit-order",venue:"1inch-lop",chainIds:[1,10,56,137,8453,42161],auth:"none",ops:["health","prepare","arm"],execution:"armed-local",localSignerSurfaces:["evm-order"],description:"1inch Limit Order Protocol v4. Queues on the local signer; Allow posts the order."});a({id:"jupiter-dca",venue:"jupiter",chainIds:[],auth:"none",ops:["health","prepare","arm"],execution:"armed-local",localSignerSurfaces:["sol"],description:"Jupiter limit/DCA. Unsigned tx queues on the sol signer; Allow submits."});a({id:"protective-monitors",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health","depeg","oracleDeviation","exploitFeed","goplus","liquidationLadder"],execution:"read-only",description:"Alert-only depeg, oracle deviation, exploit feed, GoPlus second opinion, liquidation ladder."});a({id:"funding-scanner",venue:"perps",chainIds:[],auth:"none",ops:["health","scan"],execution:"read-only",description:"Cross-venue funding carry ranked net of fee drag. Failed venues stay FAILED."});a({id:"perp-universal",venue:"perps",chainIds:[],auth:"none",ops:["health","fundingAll","prepareOrder"],execution:"prepare-only",description:"Live fundingAll across HL/GMX/dYdX + honest FAILED Drift/Vertex. prepareOrder unsigned."});a({id:"onchain-options",venue:"options",chainIds:[],auth:"none",ops:["health","rank"],execution:"read-only",description:"Local Black-Scholes ranking. No arm until official Derive/Lyra domain is pinned."});a({id:"holder-clusters",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health","score"],execution:"read-only",description:"Heuristic holder HHI + common-funding clusters. Not identity."});a({id:"kalshi",venue:"prediction",chainIds:[],auth:"none",ops:["health","markets"],execution:"read-only",description:"Kalshi market catalog read-only. Trading may be US-restricted. Prepare refused."});a({id:"derive-options",venue:"options",chainIds:[],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-08-25",reason:"No official Derive EIP-712 domain or contract is pinned, so prepare remains unavailable",evidence:"prepareOption() in onchain-options.mjs refuses unconditionally"},description:"UNAVAILABLE: Derive execution has no pinned official domain. Use onchain-options for local ranking."});a({id:"limitless",venue:"prediction",chainIds:[],auth:"none",ops:["health","markets"],execution:"read-only",description:"Limitless market catalog. Prepare refused \u2014 no grant-bound decoder."});a({id:"dov-vaults",venue:"options",chainIds:[],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-08-25",reason:"The reviewed DOV vault registry is empty, so every vault read refuses",evidence:"REVIEWED_DOV_VAULTS.length is zero and no reviewed code hash is pinned"},description:"UNAVAILABLE: the reviewed DOV vault registry is empty and every read fails closed."});a({id:"prediction-match",venue:"prediction",chainIds:[],auth:"none",ops:["health","match"],execution:"read-only",description:"Cross-venue event match. Same title is not a match."});a({id:"tee-attestation",venue:"identity",chainIds:[],auth:"none",ops:["health","verify"],execution:"read-only",description:"TEE schema stub. Hardware unavailable. Unknown root unverified."});a({id:"keeper-mirror",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health"],execution:"read-only",description:"Keeper alert-mirror. Off by default. No execute path."});a({id:"erc7715-permissions",venue:"aa",chainIds:[],auth:"none",ops:["health","normalize"],execution:"read-only",description:"ERC-7715 permission normalize. Wildcards refused. aa allowlist empty."});a({id:"erc7710-delegation",venue:"aa",chainIds:[],auth:"none",ops:["health","inspect"],execution:"read-only",description:"ERC-7710 delegation inspect. Missing revocation/expiry fails closed."});a({id:"binance-public",venue:"cex",chainIds:[],auth:"none",ops:["health","ticker","orderbook","funding","markPrice","openInterest","fundingHistory"],execution:"read-only",localSignerSurfaces:[],baseEnv:["BINANCE_API_URL","BINANCE_FAPI_URL"],description:"Binance public spot + USD-M perp market data (ticker, depth, premiumIndex funding, open interest). Keyless reads only; no trading endpoints."});a({id:"okx-public",venue:"cex",chainIds:[],auth:"none",ops:["health","ticker","orderbook","funding","markPrice","openInterest"],execution:"read-only",localSignerSurfaces:[],baseEnv:["OKX_API_URL"],description:"OKX public v5 market data (ticker, books, swap funding-rate, mark-price, open-interest). Keyless reads only; no trading endpoints."});a({id:"bybit-public",venue:"cex",chainIds:[],auth:"none",ops:["health","ticker","orderbook","funding","markPrice","openInterest","fundingHistory"],execution:"read-only",localSignerSurfaces:[],baseEnv:["BYBIT_API_URL"],description:"Bybit public v5 market data (spot/linear tickers, orderbook, funding, open interest). Keyless reads only; no trading endpoints."});a({id:"cex-basis",venue:"cex",chainIds:[],auth:"none",ops:["health","basis","fundingSpread","legs"],execution:"read-only",localSignerSurfaces:[],baseEnv:["BINANCE_API_URL","OKX_API_URL","BYBIT_API_URL","HL_INFO_URL"],description:"Cross-venue perp basis and annualized funding spreads across Binance, OKX, Bybit and Hyperliquid public data. Analysis only, no sizing and no prepare."});a({id:"snapshot-governance",venue:"governance",chainIds:[],auth:"none",ops:["health","spaces","proposals","activeProposals","proposal","votes","votingPower"],execution:"read-only",localSignerSurfaces:[],baseEnv:["SNAPSHOT_API_URL"],description:"Snapshot.org off-chain governance reads: spaces, proposals, proposal detail, an address's votes and voting power. Never signs a vote."});a({id:"tally-governance",venue:"governance",chainIds:[1,10,42161],auth:"none",ops:["health","governors","info","proposals","proposal","voterStatus","tallyProposals"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TALLY_API_URL","TALLY_API_KEY"],description:"Governor Bravo / OZ Governor on-chain proposal state and vote tallies for major DAOs, plus optional keyed Tally metadata. Read-only ABI has no vote/queue/execute selector."});a({id:"launch-radar",venue:"launch-radar",chainIds:[],auth:"none",ops:["health","status","snapshot","candidates","rpcHealth","evaluateStrategy"],execution:"read-only",localSignerSurfaces:[],baseEnv:["ORACLE_CONFIG_DIR","LAUNCH_RADAR_STORE_PATH"],description:"Read-only Launch Radar data plane: durable shadow-cycle status/snapshot from local disk, plus pure candidate normalization, RPC-sample ranking, and strategy-policy evaluation over caller-supplied inputs. Shadow-only, unfunded, no signer, no broadcast."});a({id:"stablecoin-peg",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health","scan"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Peg-deviation scan across major and Hyperliquid-native stables. Ranks by absolute bps from $1 and classifies normal/watch/warn/depeg. Unpriced is unknown, never on-peg. Read-only composition of DefiLlama/Pyth/DexScreener."});a({id:"news-rss",venue:"oracle-news",chainIds:[],auth:"none",ops:["health","latest","search"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Curated official crypto news wires (CoinDesk, The Block, Decrypt, Blockworks, Bankless, DL News, Hyperliquid blog) parsed from RSS/Atom with no npm dependency. Curated roster, NOT a firehose: feed URLs are fixed and SSRF-guarded, and every response grades each feed ok/degraded/unavailable so a dead wire never reads as no news. Items cap at 200 with complete:false and rowsOmitted."});a({id:"social-farcaster",venue:"oracle-social",chainIds:[],auth:"none",ops:["health","channel","search","user"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Keyless Farcaster read through the public Warpcast API (api.farcaster.xyz). Probed live: Neynar free and the Neynar hub both answer 402, so the Warpcast public endpoints are used. No keyless channel timeline exists, so channel is a channel-scoped search. Unauthenticated endpoint with an undocumented rate limit; failures return unavailable with zero rows, never a quiet feed."});a({id:"social-x-public",venue:"oracle-social",chainIds:[],auth:"optionalApiKey",optionalAuth:{operation:"search",type:"bearerToken",env:"ORACLE_X_BEARER_TOKEN"},ops:["health","search"],execution:"read-only",localSignerSurfaces:[],baseEnv:["ORACLE_X_BEARER_TOKEN"],description:"Capability-honest X reader. X has no keyless read tier and this never scrapes: without ORACLE_X_BEARER_TOKEN every op returns ok:false with the unset reason and makes NO network call. With a token it calls /2/tweets/search/recent. The token is read only from the caller-supplied env object, never from disk, and never when allowAmbientCredentials is false."});a({id:"news-digest",venue:"oracle-news",chainIds:[],auth:"none",ops:["health","latest"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Cross-plane news digest: fans out to news-rss, social-farcaster, and social-x-public, dedupes by normalized URL, filters by entity match, sorts by publishedAt desc, and reports per-source ok/degraded/unavailable. A blind source is reported as unavailable, never as an absence of news; when every plane is blind the digest returns ok:false."});a({id:"onchain-investigator",venue:"oracle-intel",chainIds:[],auth:"optionalApiKey",optionalAuth:{operation:"wallet",optInField:"includeOpenSea",type:"apiKey",env:"OPENSEA_API_KEY"},ops:["health","capabilities","wallet","analyze","nftOverlap"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TRONGRID_API_KEY","TRON_PRO_API_KEY","TONCENTER_API_KEY","TON_API_KEY","APTOS_API_KEY","OPENSEA_API_KEY"],allowCallerOptions:!1,opPolicies:{health:{argsSensitivity:"none",resultSensitivity:"public",cache:!0},capabilities:{argsSensitivity:"none",resultSensitivity:"public",cache:!0},wallet:{argsSensitivity:"sensitive",resultSensitivity:"sensitive",cache:!1},analyze:{argsSensitivity:"sensitive",resultSensitivity:"sensitive",cache:!1},nftOverlap:{argsSensitivity:"sensitive",resultSensitivity:"sensitive",cache:!1}},description:"Bounded, report-only on-chain evidence collection through fixed family/network endpoints, literal-opt-in one-page OpenSea v2 enrichment, and deterministic offline coordination/NFT-overlap analysis. Optional ambient keys only raise trusted-provider rate limits. Wallet addresses, snapshots, and evidence reports are sensitive and never cacheable. OpenSea reads only OPENSEA_API_KEY after opt-in and has no inventory cursor. No caller URL, RPC, transport, signer, prepare, broadcast, scam claim, or identity claim surface."});ts();var Kp=Object.freeze(["live","needs_key","deprecated","soft_fail","hard_down"]),rs=new Set(["apiKey","agentKey"]),ns=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|CREDENTIAL|AUTH|ENV_FILE)$/i,os=/(?:URL|URI|HOST|ENDPOINT|RPC)$/i;function is(e={}){return rs.has(e.auth)?(Array.isArray(e.baseEnv)?e.baseEnv:[]).filter(t=>ns.test(t)&&!os.test(t)):[]}function lt(e={}){return e.execution==="unavailable"||!!e.deprecated}function as(e={},t={},{env:r=process.env}={}){let n;if(lt(e))n="deprecated";else if(t?.ok===!0)n="live";else{let o=is(e);o.length>0&&!o.some(s=>String(r?.[s]||"").trim())?n="needs_key":e.softFail?n="soft_fail":n="hard_down"}return Object.freeze({provider:e.id||null,class:n,hardDown:n==="hard_down",quarantined:n==="deprecated",probe:t})}function Dn(e=[],t=null,{env:r=process.env}={}){let n=t?.providers&&typeof t.providers=="object"?t.providers:{},o={live:0,needs_key:0,deprecated:0,soft_fail:0,hard_down:0,unknown:0},i={},s=[],p=[];for(let c of e){if(!lt(c)&&!Object.hasOwn(n,c.id)){o.unknown+=1,i[c.id]=Object.freeze({provider:c.id,class:"unknown",hardDown:!1,quarantined:!1});continue}let f=as(c,n[c.id],{env:r});i[c.id]=f,o[f.class]+=1,f.hardDown&&s.push(c.id),f.quarantined&&p.push(c.id)}return Object.freeze({ok:s.length===0,roster:e.length,probed:t!=null,counts:Object.freeze(o),hardDown:s.length,hardDownIds:Object.freeze(s),quarantined:p.length,quarantinedIds:Object.freeze(p),classifications:Object.freeze(i)})}function Fn(e){try{return Le.existsSync(e)}catch{return!1}}function tr(e){for(let t of e)if(t&&Fn(t))return t;return null}function rr(e){try{return rn(e,import.meta.url)}catch{return null}}function ss(){let e=er(),t=e.filter(lt).map(r=>r.id);return Object.freeze({source:"catalog",count:e.length,live:e.length-t.length,quarantined:t.length,quarantinedIds:Object.freeze(t)})}function qn(){let e=tr([rr("skills"),$.join(L,"skills"),$.join(L,"dist/assets/skills"),$.join(L,"assets/skills")]);if(!e)return{count:0,trading:[],building:[]};let t=Le.readdirSync(e),r=t.filter(o=>/trade|swap|snipe|farm|hyperliquid|poly|best-exec|circuit|meme|token-research|rfq/i.test(o)),n=t.filter(o=>/launch|builder|protocol|nft|dex-launch|token-launch|security|contract/i.test(o));return{count:t.length,trading:r,building:n}}function cs(){let e=tr([rr("protocols/templates"),$.join(L,"protocols/templates"),$.join(L,"dist/assets/protocols/templates"),$.join(L,"assets/protocols/templates")]);return e?Le.readdirSync(e).filter(r=>!r.startsWith(".")):qn().building.some(r=>/protocol-builder|dex-launch|token-launch/i.test(r))?["(via skills: protocol-builder / launch packs)"]:[]}function us(){let e=tr([rr("profiles"),$.join(L,"profiles"),$.join(L,"dist/assets/profiles"),$.join(L,"assets/profiles")]);return e?Le.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&!t.name.startsWith("_")).map(t=>t.name):[]}function ls(){try{if(oe.includes("trade_lifecycle")&&!oe.some(t=>/broadcast|wallet_sign/.test(t)))return!0}catch{}let e=[$.join(L,"src/capability-posture.mjs"),$.join(L,"dist/capability-posture.mjs"),$.join(L,"capability-posture.mjs"),$.join(L,"dist/public-control/policy-schema.mjs"),$.join(L,"README.md"),$.join(L,"package.json")];for(let t of e)if(Fn(t))try{let r=Le.readFileSync(t,"utf8");if(/prepare-only|never takes your key|never.*broadcast/i.test(r))return!0}catch{}return!1}function Un(e=process.env,{health:t=null}={}){let r=[],n=(x,_,U,b=1)=>{r.push({id:x,status:_,detail:U,weight:b})},[o,i]=process.versions.node.split(".").map(Number),s=o>20||o===20&&i>=19;n("node",s?"ok":"fail",`node ${process.versions.node}`,2);let c=["oracle_cli","research_delegate","trade_lifecycle","signal_score","skill_load","learn_skill","code_eval","cron_add","web_fetch"].filter(x=>!oe.includes(x));n("agent_tools",c.length===0?"ok":"warn",c.length===0?`safe tools ${oe.length}; signal_score present`:`missing tools: ${c.join(",")}`,3),n("research_attributes","ok",`attrs [${It.join(", ")}]; mode=${kt(e)?"ON":"off"}`,2);let f=ss(),u=f.quarantinedIds.length?`: ${f.quarantinedIds.join(", ")}`:"";n("providers",f.count>=40?"ok":f.count>=10?"warn":"fail",`${f.count} providers from catalog, ${f.live} live, ${f.quarantined} quarantined${u}`,3);let d=Dn(er(),t,{env:e}),h=d.hardDown>0?"fail":d.quarantined>0||d.counts.needs_key>0||d.counts.unknown>0?"warn":"ok",m=d.hardDownIds.length?`; hard_down_ids=${d.hardDownIds.join(",")}`:"";n("provider_health",h,`live=${d.counts.live} needs_key=${d.counts.needs_key} deprecated=${d.counts.deprecated} soft_fail=${d.counts.soft_fail} hard_down=${d.counts.hard_down} unknown=${d.counts.unknown}${m}`,3);let w=qn();n("skills_trading_build",w.trading.length>=5&&w.building.length>=4?"ok":w.count>=10?"warn":"fail",`${w.count} skills; trading=${w.trading.length} building=${w.building.length}`,3);let g=cs();n("protocol_templates",g.length>=2?"ok":"warn",g.length?g.join(", "):"none",2);let y=us();n("profiles",y.includes("protocol-builder")&&y.includes("oracle")?"ok":y.length>=1?"warn":"fail",y.join(", ")||"none",2),n("signals_engine",_t.length>=4?"ok":"fail",`types: ${_t.join(", ")} (cold / no hot exec)`,2);let S=nn();n("harness_roster",S.length>=8?"ok":"warn",`${S.length} supported harnesses; Oracle native default; MCP inbound only`,2),n("custody_prepare_only",ls()?"ok":"fail","public plane prepare-only",4);let P=e.ORACLE_DATA_URL||"http://127.0.0.1:8787";n("data_url","ok",P,1);let E=0,A=0;for(let x of r)A+=x.weight,x.status==="ok"?E+=x.weight:x.status==="warn"&&(E+=x.weight*.5);let N=A?Math.round(E/A*100):0,q=!r.some(x=>x.status==="fail")&&N>=70,v=q?`AGENTIC READY ${N}% \u2014 Oracle is the crypto control plane (prepare-only); pair coding harnesses via MCP for build.`:`AGENTIC GAPS ${N}% \u2014 fix fail/warn checks before calling Oracle the default crypto harness.`;return{ok:q,score:E,max:A,pct:N,summary:v,researchMode:kt(e),attributes:[...It],packageRoot:L,checks:r}}function hi(){let[e,t]=process.versions.node.split(".").map(Number);return e>20||e===20&&t>=19}function lu(e){if(!ke.existsSync(e))return{};let t={};for(let r of ke.readFileSync(e,"utf8").split(/\r?\n/)){let n=r.match(/^([A-Z0-9_]+)=(.*)$/);n&&(t[n[1]]=n[2])}return t}async function du(e){let t=e.replace(/\/$/,"");return(await Promise.all(["/health","/public/health"].map(async n=>{try{return(await fetch(t+n)).ok}catch{return!1}}))).some(Boolean)}var ex={name:"doctor",summary:"check the read plane (+ optional --agentic readiness score)",group:"read",usage:"oracle doctor [--json] [--agentic] [--first-hour]",async run(e){let t=e.argv.includes("--json"),r=e.argv.includes("--agentic"),n=e.argv.includes("--first-hour"),o=[],i=!1,s=(E,A,N,q=null)=>{o.push({id:E,status:A,detail:N,fix:q}),A==="fail"&&(i=!0)};s("node",hi()?"ok":"fail",`node ${process.versions.node}`,hi()?null:"install node >= 20.19");let p=e.paths.oracleExecEnvPath(),c=lu(p),f=process.env.ORACLE_ROUTE_ATTESTATION_SECRET||process.env.MAD_ROUTE_ATTESTATION_SECRET||process.env.ORACLE_ATTESTATION_SECRET||process.env.ORACLE_STAMP_HMAC_SECRET||c.ORACLE_ROUTE_ATTESTATION_SECRET||c.MAD_ROUTE_ATTESTATION_SECRET||c.ORACLE_ATTESTATION_SECRET||c.ORACLE_STAMP_HMAC_SECRET;s("attestation_secret",f?"ok":"warn",f?"present":"missing",f?null:"run oracle init --apply (writes ~/.config/oracle/exec.env)");let u=process.env.ORACLE_DATA_URL||"http://127.0.0.1:8787",d=await du(u),h=e.paths.loadDeskRouting&&(process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL)?`desk ${process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL}`:null;s("data_server",d?"ok":"warn",d?`reachable ${u}${h?` (${h})`:""}`:`down ${u}`,d?null:u.includes("127.0.0.1")||u.includes("localhost")?"oracle data serve OR set ~/.config/oracle/desk.json to YOUR_DESK_HOST":"check the desk URL in ~/.config/oracle/desk.json (/public/health)");let m=Zr();s("harness_model","ok","Oracle native harness is default; external harnesses are inbound MCP only (oracle harness detect)",null),s("hermes_opt_in","ok",m.ok?`detected ${m.bin} (${m.source}) \u2014 unused unless explicitly opted in`:"not detected \u2014 native-only OK",null);let w=mi.join(e.paths.hermesRoot(),"profiles"),g=0;ke.existsSync(w)&&(g=ke.readdirSync(w,{withFileTypes:!0}).filter(E=>E.isDirectory()).length),s("hermes_lanes","ok",g>0?`${g} profile dir(s) (optional surface)`:"no Hermes lane profiles (native-only OK)",null);{let E=mi.join(w,"oracle",".env"),A=[];if(ke.existsSync(E)){let N=ke.readFileSync(E,"utf8");/^TELEGRAM_BOT_TOKEN=.+/m.test(N)&&A.push("telegram"),/^DISCORD_BOT_TOKEN=.+/m.test(N)&&A.push("discord"),/^SLACK_BOT_TOKEN=.+/m.test(N)&&A.push("slack")}A.length?m.ok?s("messaging","ok",`${A.join("/")} configured \xB7 runtime ${m.source}`,null):s("messaging","warn",`${A.join("/")} token set but messaging runtime missing \u2014 bot cannot answer`,"oracle bootstrap, then oracle setup gateway restart"):s("messaging","ok","no channel tokens configured (optional \u2014 oracle setup)",null)}let y=null;if(r){y=Un(process.env);for(let E of y.checks)s(`agentic_${E.id}`,E.status,E.detail,null)}let S=null;if(n){let{firstHourReport:E,probeReviewModule:A,probeReceiptModule:N}=await Promise.resolve().then(()=>(Wr(),li)),{probeSigner:q,probeQuote:v}=await Promise.resolve().then(()=>(pi(),fi)),[x,_,U,b]=await Promise.all([q(process.env),v(),A(),N()]);S=E({signerReachable:x,quote:_,reviewAvailable:U,receiptAvailable:b});for(let T of S.checks)s(`hour_${T.id}`,T.status,T.detail,T.fix);s("hour_score",S.ok?"ok":"warn",S.firstRunScore.label,null)}let P={ok:!i&&(y?y.ok:!0)&&(S?S.ok:!0),checks:o,...S?{firstHour:S}:{},...y?{agentic:{pct:y.pct,summary:y.summary,attributes:y.attributes,researchMode:y.researchMode}}:{}};if(t)process.stdout.write(JSON.stringify(P,null,2)+`
6
+ `);return 0}}});import ke from"node:fs";import bi from"node:path";import Zr from"node:fs";import be from"node:path";Qe();var Li="0.19.0",Au=`hermes-agent==${Li}`;var Qr="0.12.1",Iu=Object.freeze({posix:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${Qr}/uv-installer.sh`,sha256:"d3f5412d38c99f9d024901843bf98206f0d2c6dbe64df40d0b740e2751ca62c1"}),windows:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${Qr}/uv-installer.ps1`,sha256:"b9ec035151bfbb11d616dbd69886498d885551489eddf095ea3c0ad59f640eb0"})});function Pi(){return be.join(ye(),"runtime")}function $i(){return be.join(Pi(),"venv")}function Bi(e){let t=process.platform==="win32"?"Scripts":"bin",r=process.platform==="win32"?`${e}.exe`:e;return be.join($i(),t,r)}function Di(){return Bi("hermes")}function Fi(e){let t=process.platform==="win32"&&!be.extname(e)?["",".exe",".cmd",".bat"]:[""];for(let r of(process.env.PATH||"").split(be.delimiter))if(r)for(let n of t){let o=be.join(r,`${e}${n}`);try{if(Zr.existsSync(o))return o}catch{}}return null}function en(){if(process.env.ORACLE_HERMES_BIN)return{ok:!0,bin:process.env.ORACLE_HERMES_BIN,source:"env"};let e=Di();if(Zr.existsSync(e))return{ok:!0,bin:e,source:"managed"};let t=Fi("hermes");return t?{ok:!0,bin:t,source:"path"}:{ok:!1,bin:null,source:null}}import Le from"node:fs";import $ from"node:path";Qe();import{existsSync as rn,readFileSync as qi}from"node:fs";import{dirname as tn,join as Ot}from"node:path";import{fileURLToPath as Ui}from"node:url";function Mi(e){let t=tn(Ui(e));for(let r=0;r<8;r+=1){let n=Ot(t,"package.json");if(rn(n))try{let i=JSON.parse(qi(n,"utf8"));if(i&&typeof i.version=="string")return t}catch{}let o=tn(t);if(o===t)break;t=o}throw new Error(`oracle: could not resolve package root from ${e}`)}function nn(e,t){let r=Mi(t),n=Ot(r,e);return rn(n)?n:Ot(r,"dist","assets",e)}var ji=Object.freeze([{id:"oracle",label:"Oracle Native",kind:"oracle",bins:["oracle"],website:!0,detect:!0},{id:"hermes",label:"Hermes Agent",kind:"mcp",bins:["hermes"],mcpTarget:"generic",configKey:"hermes",website:!0,detect:!0},{id:"claude",label:"Claude Code",kind:"mcp",bins:["claude"],mcpTarget:"claude-code",configKey:"claudeCode",website:!0,detect:!0},{id:"claude-desktop",label:"Claude Desktop",kind:"mcp",bins:[],mcpTarget:"claude-desktop",configKey:"claudeDesktop",website:!0,detect:!1},{id:"chatgpt",label:"ChatGPT",kind:"mcp",bins:[],mcpTarget:"chatgpt",configKey:"chatgpt",website:!0,detect:!1},{id:"codex",label:"OpenAI Codex",kind:"mcp",bins:["codex"],mcpTarget:"codex",configKey:"codex",website:!0,detect:!0},{id:"cursor",label:"Cursor",kind:"mcp",bins:["cursor","cursor-agent"],mcpTarget:"cursor",configKey:"cursor",website:!0,detect:!0},{id:"windsurf",label:"Windsurf",kind:"mcp",bins:["windsurf"],mcpTarget:"vscode",configKey:"windsurf",website:!0,detect:!0},{id:"vscode",label:"VS Code / Copilot",kind:"mcp",bins:["code","code-insiders"],mcpTarget:"vscode",configKey:"vscode",website:!0,detect:!0},{id:"openclaw",label:"OpenClaw",kind:"mcp",bins:["openclaw","claw"],mcpTarget:"generic",configKey:"openclaw",website:!0,detect:!0},{id:"perplexity",label:"Perplexity",kind:"mcp",bins:["perplexity","pplx"],mcpTarget:"generic",configKey:"perplexity",website:!0,detect:!0},{id:"manus",label:"Manus",kind:"mcp",bins:["manus"],mcpTarget:"generic",configKey:"manus",website:!0,detect:!0},{id:"prime",label:"Prime Intellect Agent",kind:"mcp",bins:["prime-agent","prime"],mcpTarget:"generic",configKey:"prime",website:!1,detect:!0},{id:"opencode",label:"OpenCode",kind:"mcp",bins:["opencode"],mcpTarget:"generic",configKey:"opencode",website:!1,detect:!0},{id:"aider",label:"Aider",kind:"mcp",bins:["aider"],mcpTarget:"generic",configKey:"aider",website:!1,detect:!0},{id:"continue",label:"Continue",kind:"mcp",bins:["continue"],mcpTarget:"vscode",configKey:"continue",website:!1,detect:!0},{id:"goose",label:"Goose",kind:"mcp",bins:["goose"],mcpTarget:"generic",configKey:"goose",website:!1,detect:!0},{id:"amp",label:"Amp",kind:"mcp",bins:["amp"],mcpTarget:"generic",configKey:"amp",website:!1,detect:!0},{id:"generic",label:"Generic MCP",kind:"mcp",bins:[],mcpTarget:"generic",configKey:"genericMcp",website:!0,detect:!1}]);function on(){return ji.filter(e=>e.website)}var _t=Object.freeze(["long_horizon","recursive_fanout","continual_learn","evidence_first","prepare_only"]);function Tt(e=process.env){let t=String(e?.ORACLE_RESEARCH_MODE??e?.ORACLE_RLM_MODE??"").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"||t==="on"||t==="research"}var oe=Object.freeze(["oracle_cli","memory_add","memory_remove","memory_search","skill_load","skill_create","skill_list","cron_add","cron_list","cron_remove","meta_analyze","web_fetch","web_search","file_read","file_write","mcp_list","mcp_call","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","learn_skill","approval_preview","workspace_artifact","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","vault_status","signer_status","signer_execute","signer_disarm","receipt_report","watch_create","watch_list","portfolio_snapshot","vision_analyze","browser_exec","xurl","knowledge_search","x402_prepare"]),Hi="deny",Lu=256*1024;var Pu=Object.freeze({version:1,source:"default",defaultDecision:Hi,allow:oe,deny:Object.freeze([])});var zi=Object.freeze(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","approval_preview","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","vault_status","signer_status","receipt_report","watch_list","portfolio_snapshot","vision_analyze","knowledge_search"]),$u=new Set(zi);var ce=Object.freeze({PUBLIC_APP:"public-app",RESEARCH_X_TELEGRAM:"research-x-telegram",OWNER_DESK:"owner-desk"}),Bu=Object.freeze(Object.values(ce));function an(e){let t=e.filter(r=>!oe.includes(r));if(t.length)throw new Error(`tool surface allowlist names unknown shipped tools: ${t.join(", ")}`);return Object.freeze([...e])}var Ct=an(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","approval_preview","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","receipt_report","watch_list","portfolio_snapshot","vision_analyze","knowledge_search","x402_prepare"]),sn=an([...Ct,"file_read","meta_analyze","cron_list","mcp_list","xurl"]),cn=Object.freeze([...oe]),Du=Object.freeze({[ce.PUBLIC_APP]:Ct,[ce.RESEARCH_X_TELEGRAM]:sn,[ce.OWNER_DESK]:cn}),Fu=Object.freeze({[ce.PUBLIC_APP]:new Set(Ct),[ce.RESEARCH_X_TELEGRAM]:new Set(sn),[ce.OWNER_DESK]:new Set(cn)});var Nt=Object.freeze(["wallet","pool","nft_floor","hl_flow","prediction_market"]),Uu=Object.freeze({wallets:"wallet",smart_wallet:"wallet",pools:"pool",new_pool:"pool",nft:"nft_floor",nft_floors:"nft_floor",hyperliquid:"hl_flow",prediction:"prediction_market",prediction_markets:"prediction_market"}),G=(e,t=0,r=1)=>Math.min(r,Math.max(t,e)),z=e=>Number.isFinite(Number(e))?Number(e):null,Wi=e=>Math.round(e*1e4)/1e4;function W(e,t,r,n=!0){!n||r===null||!Number.isFinite(r)||e.push({feature:t,value:Wi(r)})}function Vi(e,t){let r=z(e.repeatBuys??e.repeat_buys??e.buyCount),n=z(e.walletWinRate??e.winRate);W(t,"repeat_buys",r===null?null:G((r-1)/4)*.38),W(t,"wallet_win_rate",n===null?null:(G(n)-.5)*.5)}function Ki(e,t){let r=z(e.ageHours??e.poolAgeHours),n=z(e.liquidityUsd??e.liquidity),o=e.liquidityLocked??e.locked;W(t,"pool_age",r===null?null:r<24?-.42:G(r/720)*.12),W(t,"liquidity",n===null?null:(G(Math.log10(Math.max(1,n))/7)-.5)*.28),W(t,"liquidity_lock",o==null?null:o?.12:-.28)}function Gi(e,t){let r=z(e.floorChange??e.floorChangePct),n=z(e.sales??e.saleCount);W(t,"floor_change",r===null?null:G(r,-1,1)*.35),W(t,"sales_depth",n===null?null:G(n/50)*.18)}function Yi(e,t){let r=z(e.flowImbalance??e.imbalance),n=z(e.fundingRate??e.funding);W(t,"flow_imbalance",r===null?null:G(r,-1,1)*.42),W(t,"funding",n===null?null:-G(n*100,-1,1)*.12)}function Ji(e,t){let r=z(e.marketProbability??e.marketPrice??e.probability),n=z(e.fairProbability??e.referenceProbability??e.fairValue);W(t,"probability_mispricing",r===null||n===null?null:G(n-r,-1,1)*.65);let o=z(e.liquidityUsd??e.liquidity);W(t,"market_liquidity",o===null?null:G(Math.log10(Math.max(1,o))/6)*.12)}var Mu=Object.freeze({wallet:Vi,pool:Ki,nft_floor:Gi,hl_flow:Yi,prediction_market:Ji});Vt();Yt();J();import{Interface as Ln,getAddress as zf,id as Za,isAddress as Wf}from"ethers";J();var Vl=Object.freeze({1:"assertion failed",17:"arithmetic overflow or underflow",18:"division or modulo by zero",33:"invalid enum value",34:"invalid storage byte array encoding",49:"pop() on an empty array",50:"array index out of bounds",65:"out of memory",81:"call to an uninitialized function pointer"});var Gl=Object.freeze(["blockNumber","nativeBalance","tokenBalance","resolveToken","resolvePools","scanBlocks","scoreRisk","quote","sellSimulation","prepareUnsignedTx"]),Jt=Object.freeze({LIVE:"LIVE",CACHED:"CACHED",STALE:"STALE",UNKNOWN:"UNKNOWN",UNAVAILABLE:"UNAVAILABLE"}),Xt=Object.freeze({PASS:"PASS",CAUTION:"CAUTION",FAIL:"FAIL",UNKNOWN:"UNKNOWN"});var Va=Object.freeze({FULL:"FULL",NO_GAS:"NO_GAS",FAILED:"FAILED"});On();_n();Nn();j();X();ct();F();Zt();Vt();Yt();j();var wf=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"]});st();J();var Rf=Object.freeze(["lifi","relay"]);F();var Df=Object.freeze({TRANSACTION:"unsigned-transaction",TYPED_DATA_ORDER:"typed-data-order"});var Ff=new Set(["0x0000000000000000000000000000000000000000","0x000000000000000000000000000000000000dead","0x0000000000000000000000000000000000000001","0x00000000000000000000000000000000000a1ce5"].map(e=>e.toLowerCase()));var qf=Object.freeze(["operation","exactOutput","amountOut","multihop","path","positionManager","modifyLiquidities","commands","actions"]);F();var Pn=Object.freeze({1:Object.freeze({name:"ethereum",positionManager:"0xC36442b4a4522E871399CD717aBDD847Ab11FE88",wrappedNative:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",venue:"uniswap-v3",source:"https://docs.uniswap.org/contracts/v3/reference/deployments/ethereum-deployments"}),8453:Object.freeze({name:"base",positionManager:"0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",wrappedNative:"0x4200000000000000000000000000000000000006",venue:"uniswap-v3",source:"https://docs.uniswap.org/contracts/v3/reference/deployments/base-deployments"})}),Jf=new Ln(["function ownerOf(uint256 tokenId) view returns (address)","function positions(uint256 tokenId) view returns (uint96 nonce,address operator,address token0,address token1,uint24 fee,int24 tickLower,int24 tickUpper,uint128 liquidity,uint256 feeGrowthInside0LastX128,uint256 feeGrowthInside1LastX128,uint128 tokensOwed0,uint128 tokensOwed1)","function decreaseLiquidity((uint256 tokenId,uint128 liquidity,uint256 amount0Min,uint256 amount1Min,uint256 deadline) params) payable returns (uint256 amount0,uint256 amount1)","function collect((uint256 tokenId,address recipient,uint128 amount0Max,uint128 amount1Max) params) payable returns (uint256 amount0,uint256 amount1)","function multicall(bytes[] data) payable returns (bytes[] results)"]),Xf=new Ln(["function withdraw(uint256 wad)"]),Qf=(1n<<128n)-1n;var Zf=Za("Transfer(address,address,uint256)").toLowerCase();j();ct();F();import{getAddress as op,Interface as ut,TypedDataEncoder as ip,parseUnits as ap}from"ethers";var ts="fulfillAdvancedOrder(((address offerer,address zone,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)[] offer,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 totalOriginalConsiderationItems) parameters,uint120 numerator,uint120 denominator,bytes signature,bytes extraData) advancedOrder,(uint256 orderIndex,uint8 side,uint256 index,uint256 identifier,bytes32[] criteriaProof)[] criteriaResolvers,bytes32 fulfillerConduitKey,address recipient)",dp=new ut([`function ${ts}`]),fp=new ut(["function mintPublic(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity) payable","function mintAllowList(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity,(uint80 mintPrice,uint48 maxTotalMintableByWallet,uint48 startTime,uint48 endTime,uint48 dropStageIndex,uint32 maxTokenSupplyForStage,uint16 feeBps,bool restrictFeeRecipients) mintParams,bytes32[] proof) payable"]),rs=Object.freeze(["blast","base","ethereum","zora","arbitrum","sei","avalanche","polygon","optimism","ape_chain","flow","b3","soneium","ronin","bera_chain","solana","shape","unichain","gunzilla","abstract","animechain","hyperevm","somnia","monad","hyperliquid","megaeth","ink","robinhood","stablechain"]),pp=new Set(rs);var $n=Object.freeze({robinhood:4663,ethereum:1,base:8453,arbitrum:42161,optimism:10,polygon:137,avalanche:43114,zora:7777777,blast:81457,sei:1329,ape_chain:33139,b3:8333,soneium:1868,ronin:2020,bera_chain:80094,shape:360,unichain:130,gunzilla:43419,abstract:2741,animechain:69e3,hyperevm:999,somnia:5031,monad:143,megaeth:4326,ink:57073,stablechain:988});var mp=Object.freeze({OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]});var hp=new ut(["function setApprovalForAll(address operator,bool approved)"]),wp=new ut(["function cancel((address offerer,address zone,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)[] offer,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 counter)[] orders) returns (bool cancelled)"]);J();ot();j();J();J();Ht();var er=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",stableQuoteAssets:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"],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",stableQuoteAssets:["0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85","0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"],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",stableQuoteAssets:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955"],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",stableQuoteAssets:["0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"],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",stableQuoteAssets:["0x5fc5360d0400a0fd4f2af552add042d716f1d168"],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",stableQuoteAssets:["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"],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",stableQuoteAssets:["0xaf88d065e77c8cC2239327C5EDb3A432268e5831","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"],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",stableQuoteAssets:["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"],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}}]}]);var lt=new Map,ns=Object.keys(Wt).map(Number),os=Object.keys(Gt).map(Number),is=Object.keys(Pn).map(Number),rr=er.map(e=>e.chainId),as=[...new Set(Object.values($n))],tr=new Set,Bn=!1;function Dn(e){if(!e||typeof e!="object"||Object.isFrozen(e))return e;for(let t of Object.values(e))Dn(t);return Object.freeze(e)}function a(e){if(!e?.id)throw new Error("registerProvider requires id");if(!e.venue)throw new Error("registerProvider requires venue");if(!Array.isArray(e.ops))throw new Error("registerProvider requires ops[]");let t=String(e.id);if(Bn&&tr.has(t))throw new Error(`registerProvider refuses to overwrite built-in provider: ${t}`);return lt.set(t,{chainIds:e.chainIds||[],auth:e.auth||"none",description:e.description||"",baseEnv:e.baseEnv||[],...e,id:t}),lt.get(t)}function nr({venue:e,op:t}={}){let r=[...lt.values()];return e&&(r=r.filter(n=>n.venue===e)),t&&(r=r.filter(n=>n.ops.includes(t))),r}function ss(){tr.clear();for(let[e,t]of lt)tr.add(e),Dn(t);Bn=!0}a({id:"hl-info",venue:"hl",chainIds:[],auth:"none",ops:["health","allMids","l2Book","outcomeMeta","clearinghouse","userFills","meta","metaAndAssetCtxs","candleSnapshot","openOrders","frontendOpenOrders","userState","spotMeta"],baseEnv:["HL_INFO_URL","HL_API_URL"],description:"Hyperliquid public /info"});a({id:"hl-vaults",venue:"hyperliquid-vaults",chainIds:[],auth:"none",ops:["health","summaries","details","userEquities","tracker"],execution:"read-only",baseEnv:["HL_INFO_URL","HL_API_URL"],description:"Read-only Hyperliquid vault summaries, vault details, user vault equities, and HLP tracking."});a({id:"hl-precompiles",venue:"hyperliquid",chainIds:[999],auth:"none",ops:["health","read","l1BlockNumber","markPx","oraclePx","spotPx","position","spotBalance","vaultEquity","withdrawable"],execution:"read-only",baseEnv:["HYPEREVM_RPC_URL","HYPER_EVM_RPC"],description:"HyperEVM L1Read precompiles (0x800-0x809). eth_call only. Includes HLP vault equity. No CoreWriter."});a({id:"protocol-templates",venue:"protocol-builder",chainIds:[],auth:"none",ops:["health","list","listNative","gate","prepareDeploy","buildNative","eval"],description:"Gated EVM templates plus deterministic Solana program and Bitcoin policy scaffolds. Native bundles require chain-specific compile, tests, and simulation before any unsigned deploy/funding prepare. NOT a firm audit."});a({id:"poly-public",venue:"poly",chainIds:[137],auth:"none",ops:["health","time","markets","book","midpoint","spread","price","events"],execution:"read-only",baseEnv:["POLY_CLOB_URL","POLY_GAMMA_URL"],description:"Polymarket CLOB + Gamma public REST"});a({id:"poly-clob",venue:"poly",chainIds:[137],auth:"none",ops:["health","prepareOrder"],execution:"prepare",localSignerSurfaces:["poly"],description:"Polymarket CLOB unsigned EIP-712 order prepare plus owner-operated local-signer submit. Hosted/keyless remains prepare-only."});a({id:"hl-delta-neutral",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","scan","quote","prepare","loop"],execution:"prepare",localSignerSurfaces:["hl"],description:"Hyperliquid funding carry. Armed through the existing hl signer. Hosted/keyless remains prepare-only. Not automated."});a({id:"lighter-delta-neutral",venue:"lighter",chainIds:[],auth:"none",ops:["health","scan","quote","prepare","loop"],execution:"prepare",localSignerSurfaces:["lighter"],description:"Lighter.xyz funding carry. Armed through the official sendTx local-signer. Hosted/keyless remains prepare-only. Not automated."});a({id:"portfolio",venue:"multichain-wallet",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","balances","snapshot","history","valueGraph"],execution:"read-only",description:"Read-only balance aggregation across configured EVM chains, Solana, Bitcoin, and Hyperliquid, plus profile-local observation snapshots, history, and value graphs with explicit partial coverage."});a({id:"nft-portfolio",venue:"multichain-nft-wallet",chainIds:[1,10,137,988,999,2741,4663,8453,42161,43114],auth:"optionalApiKey",ops:["health","inventory","gallery","pnl","prepareList","traitSnipe"],execution:"prepare",baseEnv:["OPENSEA_API_KEY","MAGICEDEN_API_KEY","SATFLOW_API_KEY"],description:"Normalized EVM, Solana, and Bitcoin NFT inventory, static contact-sheet galleries, explicit PnL coverage, user-confirmed unsigned listing preparation, and evidence-gated trait-snipe buy intents."});a({id:"evm-simulate",venue:"onchain-simulation",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","simulate"],execution:"read",baseEnv:[],description:"Pre-sign EVM transaction simulation: eth_call at pending state to catch reverts, decoded revert reasons (Error(string), Panic codes, custom-error selectors), and a buffered gas estimate. Distinguishes a genuine revert from an unreachable node \u2014 an infra failure is never reported as 'would fail'. A pass reflects current chain state and is explicitly not a guarantee."});a({id:"bitcoin-mint-funding",venue:"onchain-mint",chainIds:[],auth:"none",ops:["health","annotateOutpoints","selectFundingInputs","liveFeeRate","planInscriptionFunding"],execution:"read",baseEnv:[],description:"Bitcoin/Ordinals mint funding safety. btcUtxos returns every UTXO an address owns and prepareOrdinalsMint validates PSBT structure but never checks whether an input holds an inscription \u2014 this is the missing step between them. Classifies outpoints against an ordinals index and EXCLUDES before selecting, so an inscription is never spent as fee-paying change and burned. An unreachable index degrades to 'nothing is provably safe' rather than 'everything looks clean'. Prices fees from the marginal rate of a projected block, and refuses an inscription too heavy to relay before any UTXO is touched."});a({id:"solana-mint-submit",venue:"onchain-mint",chainIds:[],auth:"none",ops:["health","freshBlockhash","deriveComputeUnitPrice","planMintFee","measureComputeUnits","constraints","planRpcEnvelope","planBundleEnvelope","planRetryEnvelope","bundleStatus"],execution:"read",baseEnv:[],description:"Solana mint submission adapter. Prepare-only: builds sendTransaction and Jito sendBundle requests for already-signed bytes and never broadcasts, because solanaRpc refuses every send* method by design. Derives the compute-unit price from live getRecentPrioritizationFees samples rather than any hardcoded figure, pins blockhash fetches to 'confirmed' (the 'finalized' default silently burns ~21% of the ~60s window), and refuses a re-signed retry \u2014 Solana has no nonce, so a re-signed transaction can land alongside the original and mint twice."});a({id:"mint-race",venue:"onchain-mint",chainIds:[1,10,56,137,8453,42161,81457,7777777],auth:"none",ops:["health","probeOpen","measureLatency","inclusionStrategy","raceIntel"],execution:"read",baseEnv:[],description:"Mint race intelligence: probe every sale-state flag in one concurrent round trip instead of five sequential ones, measure RPC round-trip latency against a contested-mint threshold, and classify whether a chain's inclusion is won by priority fee (builder auction) or by raw latency (centralized sequencer). Read-only: never prepares, signs, or broadcasts."});a({id:"nft-mint",venue:"onchain-mint",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","discover","prepare","priceGas","createTrigger","checkOpen","evaluateTrigger"],execution:"prepare",localSignerSurfaces:["evm-nft"],baseEnv:[],description:"EVM NFT mints: discover the collection's mint entrypoint from bytecode, price a competitive EIP-1559 bid from fee-history percentiles, enforce gas-war caps, surface contract risk, and hand execution to the local signer after explicit arming and bounded grant."});a({id:"universal-mint-router",venue:"universal-nft-mint",chainIds:[],auth:"optionalApiKey",ops:["health","capabilities","prepare"],execution:"prepare",baseEnv:["OPENSEA_API_KEY"],description:"Prepare-only exact universal mint routing across reviewed EVM and Ordinals adapters. Universal Solana mint is RESEARCH_ONLY and disabled until canonical serialized-message decoding ships; the separate Magic Eden marketplace provider is unchanged. It never signs or broadcasts."});a({id:"universal-nft-lifecycle",venue:"universal-nft-lifecycle",chainIds:[],auth:"optionalApiKey",ops:["health","capabilities","route"],execution:"read",baseEnv:["OPENSEA_API_KEY","MAGICEDEN_API_KEY","SATFLOW_API_KEY"],description:"Read-only NFT lifecycle route discovery. It does not prepare, sign, or broadcast artifacts; callers must invoke and review the selected provider operation separately."});for(let[e,t,r]of[["universal-evm-nft-transfer","evm-nft-transfer","Exact unsigned ERC-721/ERC-1155 safeTransferFrom preparation."],["universal-solana-nft-transfer","solana-nft-transfer","Exact unsigned verified Metaplex NFT/Core transfer preparation."],["universal-ordinals-transfer","bitcoin-nft-transfer","Exact unsigned Ordinals PSBT transfer-plan preparation."]])a({id:e,venue:t,chainIds:[],auth:"none",ops:["health","prepare"],execution:"prepare",description:r});a({id:"contract-risk",venue:"onchain-bytecode",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","scan"],execution:"read",baseEnv:[],description:"Structural contract risk from on-chain bytecode: retained owner powers (mint, blacklist, pause, fee changes) and upgradeability across EIP-1967, legacy zeppelinos, and EIP-1822 proxy slots. Complements behavioural sell simulation. Never reports 'safe' \u2014 a clean scan is weak evidence, not a guarantee."});a({id:"evm-token-sniper",venue:"evm-token-launches",chainIds:rr,auth:"none",ops:["health","scan"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:er.flatMap(e=>e.rpcEnv),description:"One generic EVM token-sniping path across every configured EVM chain: live identity, pools, structural risk, sell simulation, quote, guarded transaction preparation, and local-signer execution handoff. Robinhood Chain is the default, not a special implementation."});a({id:"evm-rpc",venue:"evm",chainIds:[1,137,42161,8453,10,4663,999],auth:"none",ops:["health","healthAll","blockNumber","chainId","getBalance","call","erc20Allowance","erc20Balance","transactionReceipt"],baseEnv:["ETH_RPC_URL","POLYGON_RPC_URL","RH_CHAIN_RPC","BASE_RPC_URL","ARBITRUM_RPC_URL"],description:"EVM JSON-RPC multi-chain (env RPC or public fallbacks)"});a({id:"solana-rpc",venue:"solana",chainIds:[],auth:"none",ops:["health","latestBlockhash","getBalance","tokenAccounts","simulate"],baseEnv:["SOLANA_RPC_URL"],description:"Solana mainnet JSON-RPC read/prepare surface (no key, no signing, no broadcast)"});a({id:"bitcoin-esplora",venue:"bitcoin",chainIds:[],auth:"none",ops:["health","tipHeight","fees","address","utxos","tx","decode"],execution:"read-only",baseEnv:["BTC_ESPLORA_URL","BTC_NETWORK"],description:"Bitcoin L1 via Esplora (mempool.space/Blockstream). Reads only on data plane. User-signed broadcast is bitcoin_send on exec MCP. No Core RPC, no house keys. Wallets: Xverse/UniSat/Leather/OKX/Phantom"});a({id:"bitcoin-meta",venue:"bitcoin-metaprotocol",chainIds:[],auth:"optionalApiKey",ops:["health","runeBalances","inscriptions","inscriptionInfo","inscriptionChildren","ordBlockInfo"],execution:"read-only",baseEnv:["BTC_META_API_URL","UNISAT_API_KEY","BESTINSLOT_API_KEY"],description:"Bitcoin ordinals/runes reads. Keyless tier via ordinals.com recursive (inscriptionInfo/children/blockInfo); address-indexed ops (inscriptions, runeBalances) need a keyed indexer. Hiro is deprecated (410) and Magic Eden BTC is dead \u2014 use satflow for market."});a({id:"satflow",venue:"bitcoin-marketplace",chainIds:[],auth:"apiKey",ops:["health","collectionFloors","collectionStats","item","walletContents","floorListings","preparePurchase","prepareList"],execution:"prepare",localSignerSurfaces:["btc"],baseEnv:["SATFLOW_API_KEY","SATFLOW_API_URL"],description:"Satflow ordinals+runes marketplace (api.satflow.com). Primary BTC NFT market after Magic Eden BTC sunset. PSBT intents for buy/list; key via x-api-key."});a({id:"jupiter",venue:"solana-dex",chainIds:[],auth:"none",ops:["health","venues","quote","prepare"],execution:"prepare",localSignerSurfaces:["sol"],baseEnv:["JUPITER_SWAP_API_URL","SOLANA_RPC_URL"],description:"Jupiter Swap API quote + unsigned Solana swap prepare, routed through `oracle route swap solana`"});a({id:"hl-perps",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","assetInfo","prepareOrder","prepareCancel","prepareLeverage","prepareIsolatedMargin","prepareBracket","prepareBuilderApproval"],execution:"prepare",localSignerSurfaces:["hl"],notes:"Hyperliquid perp, HIP-3, and HIP-4 outcome orders through local-signer L1 action handoff."});a({id:"hl-markets",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","markets","leaderboards","coin","spot"],notes:"Joined Hyperliquid market datapoints for the Hyperliquid agent. Read-only."});a({id:"hl-entry-state",venue:"hyperliquid",chainIds:[],auth:"none",ops:["health","see","qualify","lock","list","watch"],execution:"read-only",description:"SEE/ENTER/MANAGE for discretionary HL perps: compose sourced /info fields, qualify a side, lock the state only after a fill receipt, and alert_only-diff live vs that lock. Never signs."});a({id:"hl-staking",venue:"hypercore-staking",chainIds:[],auth:"none",ops:["health","validators","delegatorSummary","delegations","rewards","history","preflight","prepareStakeDeposit","prepareStakeWithdraw","prepareDelegate"],execution:"prepare",localSignerSurfaces:["hl"],baseEnv:["HL_INFO_URL","HL_EXCHANGE_URL","HL_TESTNET"],description:"Hyperliquid HyperCore HYPE staking. Public reads plus local-signer EIP-712 execution for cDeposit / cWithdraw / tokenDelegate after arming. Hosted/keyless remains prepare-only."});a({id:"magiceden-sol",venue:"solana-nft",chainIds:[],auth:"optionalApiKey",ops:["health","stats","listings","tokenListings","prepareBuy","prepareList","prepareMint"],execution:"prepare",baseEnv:["MAGICEDEN_API_KEY","MAGICEDEN_API_URL"],description:"Magic Eden Solana NFT market. Reads (stats/listings) are keyless; buy/list/mint instruction builders need MAGICEDEN_API_KEY and return an unsigned base64 transaction for the user's Solana wallet. Never signs or broadcasts."});a({id:"defillama",venue:"prices",chainIds:[],auth:"none",ops:["health","prices","pricesBySymbol","protocols","yields","stablecoins","dexVolumes"],baseEnv:["DEFILLAMA_COINS_URL","DEFILLAMA_API_URL"],description:"DeFiLlama public prices + protocols TVL"});a({id:"lifi",venue:"dex",chainIds:[1,10,56,137,988,999,2741,4663,8453,42161,43114],auth:"none",ops:["health","quote","prepare","chains"],execution:"prepare",baseEnv:["LIFI_API_URL"],description:"LI.FI public cross-chain / DEX aggregator quotes (no key)"});a({id:"dexscreener",venue:"dex",chainIds:[],auth:"none",ops:["health","token","search","pair","latestTokenProfiles","communityTakeovers","latestTokenBoosts","topTokenBoosts","tokenPairs","batchTokens"],execution:"read-only",baseEnv:["DEXSCREENER_API_URL"],description:"DexScreener keyless read-only token profiles, community takeovers, boosts, and token/pair discovery"});a({id:"bubblemaps",venue:"token-intelligence",chainIds:[1,56,137,999,4663,8453,42161,43114],auth:"apiKey",ops:["health","chains","search","metadata","holders","metrics","map"],execution:"read-only",baseEnv:["BUBBLEMAPS_API_KEY"],description:"Official Bubblemaps Data API v0 token-holder maps, clusters, concentration metrics, and source-backed interactive artifacts."});a({id:"uniswap-v3",venue:"dex",chainIds:ns,auth:"none",ops:["health","quote","prepare","quotePath","ethUsdc","chains"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:["ETH_RPC_URL","BASE_RPC_URL","ARBITRUM_RPC_URL","OPTIMISM_RPC_URL","BSC_RPC_URL","POLYGON_RPC_URL","AVALANCHE_RPC_URL","RH_CHAIN_RPC"],description:"Uniswap V3 QuoterV2 exact-in quotes via eth_call across official deployments plus Robinhood Chain, no key"});a({id:"lp-exit",venue:"dex",chainIds:is,auth:"none",ops:["health","inspect","prepareRemove","prepareSettlement","prepareUnwrap","chains"],execution:"prepare",baseEnv:["ETH_RPC_URL","BASE_RPC_URL"],description:"Receipt-gated Uniswap V3 LP exit into native asset: remove/collect, net-route token legs, then unwrap. Unsigned only."});a({id:"lp-liquidity-ranker",venue:"dex",chainIds:rr,auth:"none",ops:["health","rank"],execution:"read-only",description:"Cross-chain LP destination analysis: deepest liquidity and net-best migration are separate, exact canonical mappings required."});a({id:"lp-destination-discovery",venue:"dex",chainIds:rr,auth:"none",ops:["health","discover"],execution:"read-only",description:"Live exact-address LP pool discovery across configured chains; reports deepest liquidity separately from cost-qualified migration evidence."});a({id:"uniswap-v4",venue:"dex",chainIds:os,auth:"none",ops:["health","quote","inspectHook","prepare","chains"],execution:"prepare",baseEnv:["ETH_RPC_URL","BASE_RPC_URL","ARBITRUM_RPC_URL","OPTIMISM_RPC_URL","BSC_RPC_URL","POLYGON_RPC_URL","AVALANCHE_RPC_URL","RH_CHAIN_RPC"],description:"Uniswap V4 quotes, hook permission/code/pool-state inspection, and guarded unsigned Universal Router preparation across official deployments plus Robinhood Chain."});a({id:"x402",venue:"payments",chainIds:[],auth:"none",ops:["health","inspect","prepare"],execution:"prepare",description:"x402 v2 PAYMENT-REQUIRED inspection and explicit-cap exact-payment templates. Never signs, calls a facilitator, or retries a paid request."});a({id:"bankr",venue:"wallet-data",chainIds:[],auth:"apiKey",ops:["health","wallet","portfolio","swapQuote"],execution:"read-only",baseEnv:["BANKR_API_KEY","BANKR_API_URL"],description:"Bankr Wallet API read-only identity, portfolio, and swap quotes. Oracle excludes Bankr swap, transfer, sign, submit, agent, and LLM endpoints."});a({id:"aerodrome",venue:"dex",chainIds:[8453],auth:"none",ops:["health","quote","prepare","chains"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:["BASE_RPC_URL"],description:"Aerodrome Slipstream CL on Base \u2014 QuoterV2 + SwapRouter exact-input via eth_call (tickSpacing, no key)"});a({id:"zerox",venue:"dex",chainIds:[1,10,137,8453,42161],auth:"apiKey",ops:["health","price","quote","prepare"],execution:"prepare",baseEnv:["ZEROX_API_KEY","ZEROX_API_URL"],description:"0x Swap API v2 price/quote/prepare \u2014 requires ZEROX_API_KEY (unconfigured without key; no Oracle key shipped)"});a({id:"across",venue:"bridge",chainIds:[1,10,137,42161,8453],auth:"none",ops:["health","suggestedFees"],baseEnv:["ACROSS_API_URL"],description:"Across bridge suggested-fees (public)"});a({id:"hop",venue:"bridge",chainIds:[1,10,137,42161],auth:"none",ops:["health","quote"],baseEnv:["HOP_API_URL"],description:"Hop Protocol bridge quotes (public)"});a({id:"relay",venue:"bridge",chainIds:[1,10,137,8453,42161],auth:"none",ops:["health","quote","prepare"],execution:"prepare",baseEnv:["RELAY_API_URL"],description:"Relay.link bridge/swap quotes (public)"});a({id:"cowswap",venue:"dex",chainIds:[1,100,42161,8453],auth:"none",ops:["health","quote","prepareOrder","order","status","chains","arm"],execution:"armed-local",localSignerSurfaces:["evm-order"],baseEnv:[],description:"CowSwap batch auction. Quote is public; Allow posts official api.cow.fi orders."});a({id:"oneinch",venue:"dex",chainIds:[1,10,137,8453,42161],auth:"apiKey",ops:["health","quote","prepare","approveSpender"],execution:"prepare",baseEnv:["ONEINCH_API_KEY","ONEINCH_API_URL"],description:"1inch Swap API v6 quote/prepare \u2014 requires ONEINCH_API_KEY (unconfigured without key; no Oracle key shipped)"});a({id:"hl-ws",venue:"hl",chainIds:[],auth:"none",ops:["health","allMids","l2Book","snapshot"],baseEnv:["HL_WS_URL"],description:"Hyperliquid short-lived WS snapshots (allMids/l2Book)"});a({id:"poly-ws",venue:"poly",chainIds:[137],auth:"none",ops:["health","book","snapshot"],baseEnv:["POLY_WS_URL"],description:"Polymarket CLOB short-lived WS market snapshots"});a({id:"anvil-nft",venue:"robinhood-nft",chainIds:[4663],auth:"optionalApiKey",ops:["health","markets","quoteSpecificBuy","quoteSell","scanCollection","scanAllMarkets","scanCrossVenueArb","scanAllMarketsArb","prepareSpecificBuy","prepareSell"],execution:"prepare",localSignerSurfaces:["evm-nft"],baseEnv:["RH_CHAIN_RPC","OPENSEA_API_KEY","OPENSEA_ENV_FILE"],description:"All-market Anvil discovery and exact-token arbitrage, with exact buy and sell execution through the armed owner-local signer after human confirmation"});a({id:"stonkbrokers",venue:"robinhood-nft",chainIds:[4663],auth:"optionalApiKey",ops:["health","quoteBrokerBuy","scanBrokerLoot","prepareBrokerBuy","brokerDesk","clockInStatus","prepareClockIn"],execution:"prepare",baseEnv:["RH_CHAIN_RPC"],description:"Unsigned StonkBrokers Broker Desk discovery, nested-loot verification, and bounded local-only preparations"});a({id:"opensea-nft",venue:"nft",chainIds:as,auth:"apiKey",ops:["health","collection","floor","bestListings","bestListing","bestOffer","accountNfts","accountPnl","prepareMint","prepareList","prepareCancel"],execution:"prepare",baseEnv:["OPENSEA_API_KEY","OPENSEA_ENV_FILE"],description:"OpenSea multichain NFT inventory, floors, and unsigned bounded mint, listing, and listing-cancellation preparations; opaque buy/sweep fulfillment is disabled"});a({id:"local-marketplace",venue:"local-p2",chainIds:[],auth:"none",ops:["health","createListing","listListings","cancelListing","createOffer","armFill"],execution:"prepare",localSignerSurfaces:["evm-nft"],description:"Owner-local P2 catalog stored under ~/.config/oracle. Additive and isolated from OpenSea, Magic Eden, Satflow, Bisq, Anvil, and Polymarket. Listings are armed for the owner-local signer; sign-and-broadcast is an explicit createLocalMarketplace().instructFill instruction. Generic signHash is refused."});a({id:"local-x402",venue:"local-x402",chainIds:[],auth:"none",ops:["health","createIntent","listIntents","cancelIntent","armPayment"],execution:"prepare",localSignerSurfaces:["evm-swap"],description:"Owner-local x402 payment budgets under ~/.config/oracle. Additive and isolated from OpenSea and Telegram. Intents are armed; sign-and-broadcast is an explicit createLocalX402().instructPay instruction. Generic signHash is refused."});a({id:"local-pack-registry",venue:"local-packs",chainIds:[],auth:"none",ops:["health","registerPack","listPacks","revokePack"],execution:"read-only",description:"Owner-local third-party pack REGISTRY under ~/.config/oracle. Catalog only: packs are never loaded or executed. Isolated from OpenSea and Telegram."});a({id:"erc8004-identity",venue:"agent-identity",chainIds:[],auth:"none",ops:["health","prepareIdentityRegistration","prepareAgentURIUpdate","inspectIdentity","arm"],execution:"armed-local",localSignerSurfaces:["evm"],baseEnv:["ORACLE_ERC8004_CHAIN_ID","ORACLE_ERC8004_IDENTITY_REGISTRY"],description:"Draft ERC-8004 identity. Public prepare is keyless; Allow broadcasts type-2 register/setAgentURI."});a({id:"hyperevm-dex",venue:"hyperevm",chainIds:[999],auth:"none",ops:["health","search","token"],baseEnv:["HYPEREVM_RPC_URL"],description:"HyperEVM pair discovery via DexScreener + optional RPC"});a({id:"geckoterminal",venue:"dex-data",chainIds:[],auth:"none",ops:["health","networks","pool","token","ohlcv"],baseEnv:["GECKOTERMINAL_API_URL"],description:"GeckoTerminal public networks, pools, tokens, and OHLCV"});a({id:"curve",venue:"dex",chainIds:[1,10,56,137,988,999,4663,8453,42161,43114],auth:"none",ops:["health","openapi","pools","quote","prepare"],execution:"prepare",baseEnv:["CURVE_API_URL"],description:"Curve public pool registry API + RouterNG validated single-hop prepare"});a({id:"gmx",venue:"perps-data",chainIds:[42161,43114],auth:"none",ops:["health","tickers","markets","marketsInfo","tokens","prepareOrder","positions","orderStatus","verifyOrder"],execution:"intent",baseEnv:[],description:"GMX v2 public oracle/markets plus guarded async order intents on Arbitrum and Avalanche"});a({id:"morpho",venue:"lending-data",chainIds:[1,10,137,2741,8453,42161,4663,999,988],auth:"none",ops:["health","markets","vaults","prepareVault"],execution:"intent",baseEnv:["MORPHO_API_URL"],description:"Morpho public GraphQL markets/vaults + guarded ERC-4626 vault intents"});a({id:"balancer",venue:"dex",chainIds:[1,10,137,42161,43114,8453],auth:"none",ops:["health","pools","quote","prepare"],execution:"prepare",baseEnv:["BALANCER_API_URL"],description:"Balancer public GraphQL pool data + v3 Router exact-input prepare (Polygon read-only)"});a({id:"pendle",venue:"yield",chainIds:[1,10,56,8453,42161,999],auth:"none",ops:["health","markets","quote","prepare"],execution:"prepare",baseEnv:["PENDLE_API_URL"],description:"Pendle public yield-market API + Hosted SDK direct Convert prepare"});a({id:"odos",venue:"dex",chainIds:[1,10,56,137,8453,42161,43114,4663],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-07-30",reason:"Odos sunset the public SOR API; /sor/quote/v2 and v3 both return 410 Gone",evidence:"sunset: Thu, 30 Jul 2026 12:00:00 GMT response header"},baseEnv:["ODOS_API_URL"],description:"Odos public SOR (DEPRECATED upstream 2026-07-30 -- endpoint returns 410)"});a({id:"blockscout",venue:"explorer",chainIds:[1,10,137,8453,42161],auth:"none",ops:["health","stats","address","token"],baseEnv:[],description:"Verified public Blockscout REST v2 instances"});a({id:"paraswap",venue:"dex",chainIds:[1,10,56,137,8453,42161,43114,4663],auth:"none",ops:["health","tokens","price","quote","prepare"],execution:"prepare",baseEnv:["PARASWAP_API_URL"],description:"ParaSwap/Velora public price routes + validated transaction builder"});a({id:"rfq",venue:"intent-rfq",chainIds:[1,10,56,137,8453,42161,43114,4663],auth:"none",ops:["health","intent","quote"],execution:"prepare",baseEnv:["ZEROX_API_KEY","ONEINCH_API_KEY"],description:"Cross-chain RFQ intent normalizer and firm-quote fanout over reviewed venues. Prepares artifacts only, never signs or broadcasts."});a({id:"execution-strategies",venue:"oracle-native",chainIds:[],auth:"none",ops:["health","plan"],execution:"plan-only",baseEnv:[],description:"Oracle-native TWAP, VWAP, POV, iceberg, and implementation-shortfall planners. No Tread.fi/API dependency. Plans never sign or broadcast; every slice requires a fresh best-execution quote, policy check, simulation, confirmation, wallet signature, and receipt."});a({id:"polygon-staking",venue:"polygon-staking",chainIds:[137],auth:"none",ops:["health","validators","validatorDetail"],baseEnv:["POLYGON_STAKING_API_URL"],description:"Polygon POS staking validators"});a({id:"babylon-staking",venue:"btc-staking",chainIds:[],auth:"none",ops:["health","stats","finalityProviders","delegations"],execution:"read-only",baseEnv:["BABYLON_STAKING_API_URL"],description:"Babylon native BTC staking (staking-api.babylonlabs.io v2). Keyless per-staker positions from a PUBLIC key alone \u2014 APR, TVL, finality-provider roster, and delegations. Read-only; staking/unbonding is user-wallet."});a({id:"mempool-mining",venue:"btc-mining",chainIds:[],auth:"none",ops:["health","difficulty","poolShare","hashrate","rewardStats"],execution:"read-only",baseEnv:["MEMPOOL_API_URL"],description:"Bitcoin mining + network security telemetry via mempool.space /api/v1/mining. Difficulty retarget, pool concentration (top-1/top-3 share), hashrate trend, subsidy-vs-fee split."});a({id:"liquid-esplora",venue:"liquid",chainIds:[],auth:"none",ops:["health","tipHeight","addressInfo","assetInfo"],execution:"read-only",baseEnv:["LIQUID_ESPLORA_URL"],description:"Liquid Network (Blockstream sidechain) via Esplora. Same schema as bitcoin-esplora plus multi-asset issuance/peg stats. Address state exposes transaction counts; per-asset sums can be absent for unconfidential multi-asset addresses and are blinded for confidential addresses."});a({id:"hiro-stacks",venue:"stacks",chainIds:[],auth:"none",ops:["health","networkInfo","stackingInfo","poxCycles","blocks"],execution:"read-only",baseEnv:["HIRO_API_URL","HIRO_API_KEY"],description:"Stacks (Bitcoin L2) via Hiro public API. Network tip, PoX stacking state (the BTC-yield mechanism), and historical reward cycles. Keyless tier is ~20 rps; HIRO_API_KEY is optional and never required."});a({id:"tron-public",venue:"tron",chainIds:[],auth:"none",ops:["health","account","trc20Balances","trc20Transfers","chainParameters"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TRON_API_URL","TRONGRID_API_KEY"],description:"Tron mainnet via public TronGrid. TRX balance, TRC20 token balances, USDT-TRC20 transfer history, chain parameters. Tron carries the largest USDT float of any chain. Keyless; TRONGRID_API_KEY only raises the rate ceiling and never travels to a non-TronGrid host."});a({id:"ton-public",venue:"ton",chainIds:[],auth:"none",ops:["health","accountState","jettonBalances","transactions"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TON_API_URL","TONCENTER_API_KEY"],description:"TON via public toncenter. Account state + nanoton balance, jetton (TON's ERC20) balances, transaction history. The settlement layer for Telegram-native assets. Keyless; TONCENTER_API_KEY only raises the rate ceiling."});a({id:"cosmos-lcd",venue:"cosmos",chainIds:[],auth:"none",ops:["health","chains","balances","delegations","denomTrace"],execution:"read-only",localSignerSurfaces:[],baseEnv:["COSMOS_LCD_URL","COSMOS_CHAIN"],description:"Cosmos SDK chains via keyless LCD/REST \u2014 one provider, many chains (cosmoshub default, plus osmosis/celestia/injective/neutron/dydx/noble/kava, or any LCD via COSMOS_LCD_URL_<CHAIN>). Bank balances, staking delegations + unbondings + rewards, and IBC denom-trace resolution for ibc/<hash> denoms."});a({id:"sui-public",venue:"sui",chainIds:[],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-08-25",reason:"Sui public fullnodes return JSON-RPC -32601 because the JSON-RPC surface is deprecated",evidence:"Migrate the provider to Sui GraphQL or gRPC before restoring it to the live roster"},localSignerSurfaces:[],baseEnv:["SUI_RPC_URL"],description:"QUARANTINED: Sui public JSON-RPC is deprecated. A GraphQL or gRPC replacement has not shipped."});a({id:"aptos-public",venue:"aptos",chainIds:[],auth:"none",ops:["health","account","resources","coinBalances"],execution:"read-only",localSignerSurfaces:[],baseEnv:["APTOS_FULLNODE_URL","APTOS_API_KEY"],description:"Aptos mainnet via the public fullnode REST API. Ledger info, account sequence/auth key, Move resources, type-specific 0x1::coin::balance views, and legacy CoinStore enumeration. Generic enumeration does not cover newer Fungible Asset stores. Read-only; the transaction submit door is never called."});a({id:"canton-scan",venue:"canton",chainIds:[],auth:"none",ops:["health","guide","dso","party","holdings","rounds"],execution:"read-only",localSignerSurfaces:[],baseEnv:["CANTON_SCAN_URL","CANTON_NETWORK","CANTON_MIGRATION_ID"],description:"Canton Network Scan reads for Canton Coin (CC / Amulet) plus static onboarding steps. Not EVM: no chainId, no JSON-RPC, no ERC-20, no Uniswap. Scan sees CC and DSO/governance only. Quote/prepare/sign stay unimplemented."});a({id:"ordinals-runes",venue:"btc-runes",chainIds:[],auth:"none",ops:["health","blockHeight","blockInfo","satInfo","runeInfo"],execution:"read-only",baseEnv:["ORDINALS_BASE_URL"],description:"Runes + sat/block index via a public ord server (ordinals.com). /r/blockheight is PLAIN TEXT; the /runes listing is 406 'JSON API disabled' so only per-rune lookup exists; rune names must drop the bullet spacer (UNCOMMONGOODS)."});a({id:"mempool-lightning",venue:"btc-lightning",chainIds:[],auth:"none",ops:["health","statistics","nodeRankings","nodeCountries"],execution:"read-only",baseEnv:["MEMPOOL_API_URL"],description:"Lightning Network topology via mempool.space. Capacity/channel/node aggregates, node rankings, country distribution. STALE-PRONE: the crawler snapshot has been observed weeks behind, so every response carries ageDays + a stale flag."});a({id:"bob-rootstock",venue:"btc-l2",chainIds:[60808,30],auth:"none",ops:["health","stats","addressInfo","tokenBalances"],execution:"read-only",baseEnv:["BOB_EXPLORER_URL","ROOTSTOCK_EXPLORER_URL"],description:"BOB (60808) and Rootstock (30) \u2014 the EVM Bitcoin L2s \u2014 via their Blockscout v2 instances (identical schema, one code path). Chain stats, gas prices, native balances, token holdings. Pass chainId 'all' to fan out."});a({id:"bisq-markets",venue:"bisq",chainIds:[],auth:"none",ops:["health","markets","ticker","trades"],execution:"read-only",baseEnv:["BISQ_MARKETS_URL"],description:"Bisq non-KYC P2P BTC price discovery (markets.bisq.network). Value is the BASIS against centralized spot, not the absolute print: volume is thin and the last trade can be hours old, so trade age is always reported."});a({id:"social-intel",venue:"oracle-social",chainIds:[],auth:"none",ops:["health","trendingTokens","trendingCas","keywordMentions","smartAccounts","narratives"],execution:"read-only",localSignerSurfaces:[],baseEnv:["ORACLE_SOCIAL_INTEL_STORE","ORACLE_SOCIAL_INTEL_STALE_MIN"],description:"Local curated-account crypto social intelligence. Sample = graded caller list, NOT a firehose; every response reports sample size and snapshot age."});a({id:"magiceden-ordinals",venue:"btc-ordinals-market",chainIds:[],auth:"none",ops:["health","collectionStat"],execution:"read-only",baseEnv:["MAGICEDEN_ORD_API_URL","MAGICEDEN_API_KEY","MAGICEDEN_PROBE_COLLECTION"],description:"Magic Eden ordinals collection stats. DEGRADED UPSTREAM: /v2/ord/btc/* returned 503 'no healthy upstream' on every verification attempt. health() reports ok:false while it is down and collectionStat() returns upstreamDown:true with fallback 'satflow' instead of throwing. Only /stat is wired; 600 req/min documented."});a({id:"braiins-insights",venue:"btc-mining",chainIds:[],auth:"none",ops:["health","priceStats","poolStats"],execution:"read-only",baseEnv:["BRAIINS_INSIGHTS_URL"],description:"Braiins mining insights \u2014 BTC price tick + per-pool block/hashrate distribution. Use insights.braiins.com (302s to learn.braiins.com, followed transparently); pool.braiins.com/api is 403 and is NOT the public API."});a({id:"pyth-price-feeds",venue:"solana-oracle",chainIds:[],auth:"none",ops:["health","latestPrice","latestPrices","feedDirectory"],baseEnv:["PYTH_HERMES_URL"],description:"Pyth Network: Solana price feeds with confidence intervals, real-time updates, zero auth"});a({id:"solend-lending",venue:"solana-lending",chainIds:[],auth:"none",ops:["health","markets","reserves"],baseEnv:["SAVE_API_URL"],description:"Solend/Save lending: markets + per-reserve supply/borrow APY, Solana's Aave equivalent (keyless)"});a({id:"jito-mev",venue:"solana-mev",chainIds:[],auth:"none",ops:["health","recentBundles","tipFloor"],baseEnv:["JITO_API_URL"],description:"Jito MEV: recent bundles, tippers, tip floor \u2014 real-time Solana MEV data (keyless)"});a({id:"sanctum-lst",venue:"solana-staking",chainIds:[],auth:"none",ops:["health","lstList","apyAll","apyIndividual"],baseEnv:["SANCTUM_API_URL"],description:"Sanctum LST: liquid staking tokens with per-token APY \u2014 JitoSOL, mSOL, bSOL, compSOL, pathSOL, etc. (keyless)"});a({id:"kamino-strategies",venue:"solana-yield",chainIds:[],auth:"none",ops:["health","strategies","strategyMetrics"],baseEnv:["KAMINO_API_URL"],description:"Kamino: live yield strategies with APY, TVL, vault balances (keyless)"});a({id:"meteora-dlmm",venue:"solana-dex",chainIds:[],auth:"none",ops:["health","pools","poolSearch"],baseEnv:["METEORA_API_URL"],description:"Meteora DLMM: concentrated liquidity pools via amm-v2 API, distinct from Jupiter DEX routes (keyless)"});a({id:"aave-v3",venue:"evm-lending",chainIds:[1,10,56,137,59144,1088,534352,8453,42161,43114,5e3,1868],auth:"none",ops:["health","markets","marketReserves","chains"],baseEnv:["AAVE_V3_API_URL"],description:"Aave V3 GraphQL: multi-chain lending, full market + reserve schema with supplyInfo/borrowInfo (keyless)"});a({id:"cow-protocol",venue:"evm-intent",chainIds:[1,100,42161],auth:"none",ops:["health","auction","openOrders","recentTrades"],baseEnv:["COW_API_URL"],description:"CoW Protocol: intent/solver auction data, open orders, trades \u2014 intent-based DEX not covered by existing providers (keyless)"});a({id:"relayscan-mev",venue:"evm-mev",chainIds:[1],auth:"none",ops:["health","overview","builderProfit","dailyStats"],baseEnv:["RELAYSCAN_API_URL"],description:"Relayscan: MEV relay overview, builder profit rankings, daily block stats (keyless)"});a({id:"birdeye-tokens",venue:"solana-tokens",chainIds:[],auth:"none",ops:["health","tokenList"],baseEnv:["BIRDEYE_API_URL"],description:"Birdeye public token list: Solana tokens ranked by 24h volume, market cap (keyless)"});a({id:"das-assets",venue:"solana-nft",chainIds:[],auth:"none",ops:["health","assetsByOwner","searchAssets","assetProof"],baseEnv:["SOLANA_RPC_URL"],description:"Digital Asset Standard (DAS): compressed NFT reads via public Solana RPC \u2014 getAssetsByOwner, searchAssets, assetProof. No Helius key needed."});a({id:"symbiotic-restaking",venue:"evm-restaking",chainIds:[1],auth:"none",ops:["health","vaults","vaultDetail"],baseEnv:["SYMBIOTIC_API_URL"],description:"Symbiotic restaking: vaults with collateral data, approved status, operator metadata (keyless)"});a({id:"beefy-yields",venue:"evm-yield",chainIds:[1,10,56,137,8453,42161,43114,250,1088],auth:"none",ops:["health","apy","apyBreakdown"],baseEnv:["BEEFY_API_URL"],description:"Beefy Finance: cross-chain yield aggregator vaults with APY breakdowns (keyless)"});a({id:"across-bridge",venue:"evm-bridge",chainIds:[1,10,42161,8453,324,59144],auth:"none",ops:["health","pools","suggestedFees"],baseEnv:["ACROSS_API_URL"],description:"Across bridge: pool liquidity + APY per bridge pool with suggested fees (keyless)"});a({id:"spark-lend",venue:"evm-lending",chainIds:[1],auth:"none",ops:["health","markets"],baseEnv:["SPARK_API_URL"],description:"Spark Lend / Sky Savings: ERC-4626 vault APY + TVL + user count (keyless)"});a({id:"solana-token-risk",venue:"solana-tokens",chainIds:[],auth:"none",ops:["health","scan"],execution:"read-only",baseEnv:[],description:"GoPlus official Solana token security: mint/freeze authority, transfer hooks, metadata mutability, holder concentration (keyless read-only)"});a({id:"robinhood-wallet-history",venue:"explorer",chainIds:[4663],auth:"none",ops:["health","transactions","tokenBalances","history"],execution:"read-only",baseEnv:[],description:"Robinhood Chain (4663) wallet transaction history and token balances via the official Blockscout explorer (keyless read-only)"});a({id:"l2beat-tvl",venue:"evm-l2",chainIds:[],auth:"none",ops:["health","tvl","activity"],baseEnv:["L2BEAT_API_URL"],description:"L2Beat: L2 scaling TVL, project-level breakdowns, activity metrics (keyless)"});a({id:"celestia-da",venue:"evm-da",chainIds:[],auth:"none",ops:["health","stats","blockStats"],baseEnv:["CELENIUM_API_URL"],description:"Celestia DA via Celenium: blob stats, block-level blob counts, network metrics (keyless)"});a({id:"limit-order",venue:"1inch-lop",chainIds:[1,10,56,137,8453,42161],auth:"none",ops:["health","prepare","arm"],execution:"armed-local",localSignerSurfaces:["evm-order"],description:"1inch Limit Order Protocol v4. Queues on the local signer; Allow posts the order."});a({id:"jupiter-dca",venue:"jupiter",chainIds:[],auth:"none",ops:["health","prepare","arm"],execution:"armed-local",localSignerSurfaces:["sol"],description:"Jupiter limit/DCA. Unsigned tx queues on the sol signer; Allow submits."});a({id:"protective-monitors",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health","depeg","oracleDeviation","exploitFeed","goplus","liquidationLadder"],execution:"read-only",description:"Alert-only depeg, oracle deviation, exploit feed, GoPlus second opinion, liquidation ladder."});a({id:"funding-scanner",venue:"perps",chainIds:[],auth:"none",ops:["health","scan"],execution:"read-only",description:"Cross-venue funding carry ranked net of fee drag. Failed venues stay FAILED."});a({id:"perp-universal",venue:"perps",chainIds:[],auth:"none",ops:["health","fundingAll","prepareOrder"],execution:"prepare-only",description:"Live fundingAll across HL/GMX/dYdX + honest FAILED Drift/Vertex. prepareOrder unsigned."});a({id:"onchain-options",venue:"options",chainIds:[],auth:"none",ops:["health","rank"],execution:"read-only",description:"Local Black-Scholes ranking. No arm until official Derive/Lyra domain is pinned."});a({id:"holder-clusters",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health","score"],execution:"read-only",description:"Heuristic holder HHI + common-funding clusters. Not identity."});a({id:"kalshi",venue:"prediction",chainIds:[],auth:"none",ops:["health","markets"],execution:"read-only",description:"Kalshi market catalog read-only. Trading may be US-restricted. Prepare refused."});a({id:"derive-options",venue:"options",chainIds:[],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-08-25",reason:"No official Derive EIP-712 domain or contract is pinned, so prepare remains unavailable",evidence:"prepareOption() in onchain-options.mjs refuses unconditionally"},description:"UNAVAILABLE: Derive execution has no pinned official domain. Use onchain-options for local ranking."});a({id:"limitless",venue:"prediction",chainIds:[],auth:"none",ops:["health","markets"],execution:"read-only",description:"Limitless market catalog. Prepare refused \u2014 no grant-bound decoder."});a({id:"dov-vaults",venue:"options",chainIds:[],auth:"none",ops:["health"],execution:"unavailable",deprecated:{since:"2026-08-25",reason:"The reviewed DOV vault registry is empty, so every vault read refuses",evidence:"REVIEWED_DOV_VAULTS.length is zero and no reviewed code hash is pinned"},description:"UNAVAILABLE: the reviewed DOV vault registry is empty and every read fails closed."});a({id:"prediction-match",venue:"prediction",chainIds:[],auth:"none",ops:["health","match"],execution:"read-only",description:"Cross-venue event match. Same title is not a match."});a({id:"tee-attestation",venue:"identity",chainIds:[],auth:"none",ops:["health","verify"],execution:"read-only",description:"TEE schema stub. Hardware unavailable. Unknown root unverified."});a({id:"keeper-mirror",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health"],execution:"read-only",description:"Keeper alert-mirror. Off by default. No execute path."});a({id:"erc7715-permissions",venue:"aa",chainIds:[],auth:"none",ops:["health","normalize"],execution:"read-only",description:"ERC-7715 permission normalize. Wildcards refused. aa allowlist empty."});a({id:"erc7710-delegation",venue:"aa",chainIds:[],auth:"none",ops:["health","inspect"],execution:"read-only",description:"ERC-7710 delegation inspect. Missing revocation/expiry fails closed."});a({id:"binance-public",venue:"cex",chainIds:[],auth:"none",ops:["health","ticker","orderbook","funding","markPrice","openInterest","fundingHistory"],execution:"read-only",localSignerSurfaces:[],baseEnv:["BINANCE_API_URL","BINANCE_FAPI_URL"],description:"Binance public spot + USD-M perp market data (ticker, depth, premiumIndex funding, open interest). Keyless reads only; no trading endpoints."});a({id:"okx-public",venue:"cex",chainIds:[],auth:"none",ops:["health","ticker","orderbook","funding","markPrice","openInterest"],execution:"read-only",localSignerSurfaces:[],baseEnv:["OKX_API_URL"],description:"OKX public v5 market data (ticker, books, swap funding-rate, mark-price, open-interest). Keyless reads only; no trading endpoints."});a({id:"bybit-public",venue:"cex",chainIds:[],auth:"none",ops:["health","ticker","orderbook","funding","markPrice","openInterest","fundingHistory"],execution:"read-only",localSignerSurfaces:[],baseEnv:["BYBIT_API_URL"],description:"Bybit public v5 market data (spot/linear tickers, orderbook, funding, open interest). Keyless reads only; no trading endpoints."});a({id:"cex-basis",venue:"cex",chainIds:[],auth:"none",ops:["health","basis","fundingSpread","legs"],execution:"read-only",localSignerSurfaces:[],baseEnv:["BINANCE_API_URL","OKX_API_URL","BYBIT_API_URL","HL_INFO_URL"],description:"Cross-venue perp basis and annualized funding spreads across Binance, OKX, Bybit and Hyperliquid public data. Analysis only, no sizing and no prepare."});a({id:"snapshot-governance",venue:"governance",chainIds:[],auth:"none",ops:["health","spaces","proposals","activeProposals","proposal","votes","votingPower"],execution:"read-only",localSignerSurfaces:[],baseEnv:["SNAPSHOT_API_URL"],description:"Snapshot.org off-chain governance reads: spaces, proposals, proposal detail, an address's votes and voting power. Never signs a vote."});a({id:"tally-governance",venue:"governance",chainIds:[1,10,42161],auth:"none",ops:["health","governors","info","proposals","proposal","voterStatus","tallyProposals"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TALLY_API_URL","TALLY_API_KEY"],description:"Governor Bravo / OZ Governor on-chain proposal state and vote tallies for major DAOs, plus optional keyed Tally metadata. Read-only ABI has no vote/queue/execute selector."});a({id:"launch-radar",venue:"launch-radar",chainIds:[],auth:"none",ops:["health","status","snapshot","candidates","rpcHealth","evaluateStrategy"],execution:"read-only",localSignerSurfaces:[],baseEnv:["ORACLE_CONFIG_DIR","LAUNCH_RADAR_STORE_PATH"],description:"Read-only Launch Radar data plane: durable shadow-cycle status/snapshot from local disk, plus pure candidate normalization, RPC-sample ranking, and strategy-policy evaluation over caller-supplied inputs. Shadow-only, unfunded, no signer, no broadcast."});a({id:"stablecoin-peg",venue:"oracle-intel",chainIds:[],auth:"none",ops:["health","scan"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Peg-deviation scan across major and Hyperliquid-native stables. Ranks by absolute bps from $1 and classifies normal/watch/warn/depeg. Unpriced is unknown, never on-peg. Read-only composition of DefiLlama/Pyth/DexScreener."});a({id:"news-rss",venue:"oracle-news",chainIds:[],auth:"none",ops:["health","latest","search"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Curated official crypto news wires (CoinDesk, The Block, Decrypt, Blockworks, Bankless, DL News, Hyperliquid blog) parsed from RSS/Atom with no npm dependency. Curated roster, NOT a firehose: feed URLs are fixed and SSRF-guarded, and every response grades each feed ok/degraded/unavailable so a dead wire never reads as no news. Items cap at 200 with complete:false and rowsOmitted."});a({id:"social-farcaster",venue:"oracle-social",chainIds:[],auth:"none",ops:["health","channel","search","user"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Keyless Farcaster read through the public Warpcast API (api.farcaster.xyz). Probed live: Neynar free and the Neynar hub both answer 402, so the Warpcast public endpoints are used. No keyless channel timeline exists, so channel is a channel-scoped search. Unauthenticated endpoint with an undocumented rate limit; failures return unavailable with zero rows, never a quiet feed."});a({id:"social-x-public",venue:"oracle-social",chainIds:[],auth:"optionalApiKey",optionalAuth:{operation:"search",type:"bearerToken",env:"ORACLE_X_BEARER_TOKEN"},ops:["health","search"],execution:"read-only",localSignerSurfaces:[],baseEnv:["ORACLE_X_BEARER_TOKEN"],description:"Capability-honest X reader. X has no keyless read tier and this never scrapes: without ORACLE_X_BEARER_TOKEN every op returns ok:false with the unset reason and makes NO network call. With a token it calls /2/tweets/search/recent. The token is read only from the caller-supplied env object, never from disk, and never when allowAmbientCredentials is false."});a({id:"news-digest",venue:"oracle-news",chainIds:[],auth:"none",ops:["health","latest"],execution:"read-only",localSignerSurfaces:[],baseEnv:[],description:"Cross-plane news digest: fans out to news-rss, social-farcaster, and social-x-public, dedupes by normalized URL, filters by entity match, sorts by publishedAt desc, and reports per-source ok/degraded/unavailable. A blind source is reported as unavailable, never as an absence of news; when every plane is blind the digest returns ok:false."});a({id:"onchain-investigator",venue:"oracle-intel",chainIds:[],auth:"optionalApiKey",optionalAuth:{operation:"wallet",optInField:"includeOpenSea",type:"apiKey",env:"OPENSEA_API_KEY"},ops:["health","capabilities","wallet","analyze","nftOverlap"],execution:"read-only",localSignerSurfaces:[],baseEnv:["TRONGRID_API_KEY","TRON_PRO_API_KEY","TONCENTER_API_KEY","TON_API_KEY","APTOS_API_KEY","OPENSEA_API_KEY"],allowCallerOptions:!1,opPolicies:{health:{argsSensitivity:"none",resultSensitivity:"public",cache:!0},capabilities:{argsSensitivity:"none",resultSensitivity:"public",cache:!0},wallet:{argsSensitivity:"sensitive",resultSensitivity:"sensitive",cache:!1},analyze:{argsSensitivity:"sensitive",resultSensitivity:"sensitive",cache:!1},nftOverlap:{argsSensitivity:"sensitive",resultSensitivity:"sensitive",cache:!1}},description:"Bounded, report-only on-chain evidence collection through fixed family/network endpoints, literal-opt-in one-page OpenSea v2 enrichment, and deterministic offline coordination/NFT-overlap analysis. Optional ambient keys only raise trusted-provider rate limits. Wallet addresses, snapshots, and evidence reports are sensitive and never cacheable. OpenSea reads only OPENSEA_API_KEY after opt-in and has no inventory cursor. No caller URL, RPC, transport, signer, prepare, broadcast, scam claim, or identity claim surface."});ss();var Jp=Object.freeze(["live","needs_key","deprecated","soft_fail","hard_down"]),cs=new Set(["apiKey","agentKey"]),us=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|CREDENTIAL|AUTH|ENV_FILE)$/i,ls=/(?:URL|URI|HOST|ENDPOINT|RPC)$/i;function ds(e={}){return cs.has(e.auth)?(Array.isArray(e.baseEnv)?e.baseEnv:[]).filter(t=>us.test(t)&&!ls.test(t)):[]}function dt(e={}){return e.execution==="unavailable"||!!e.deprecated}function fs(e={},t={},{env:r=process.env}={}){let n;if(dt(e))n="deprecated";else if(t?.ok===!0)n="live";else{let o=ds(e);o.length>0&&!o.some(s=>String(r?.[s]||"").trim())?n="needs_key":e.softFail?n="soft_fail":n="hard_down"}return Object.freeze({provider:e.id||null,class:n,hardDown:n==="hard_down",quarantined:n==="deprecated",probe:t})}function Fn(e=[],t=null,{env:r=process.env}={}){let n=t?.providers&&typeof t.providers=="object"?t.providers:{},o={live:0,needs_key:0,deprecated:0,soft_fail:0,hard_down:0,unknown:0},i={},s=[],d=[];for(let c of e){if(!dt(c)&&!Object.hasOwn(n,c.id)){o.unknown+=1,i[c.id]=Object.freeze({provider:c.id,class:"unknown",hardDown:!1,quarantined:!1});continue}let f=fs(c,n[c.id],{env:r});i[c.id]=f,o[f.class]+=1,f.hardDown&&s.push(c.id),f.quarantined&&d.push(c.id)}return Object.freeze({ok:s.length===0,roster:e.length,probed:t!=null,counts:Object.freeze(o),hardDown:s.length,hardDownIds:Object.freeze(s),quarantined:d.length,quarantinedIds:Object.freeze(d),classifications:Object.freeze(i)})}function qn(e){try{return Le.existsSync(e)}catch{return!1}}function or(e){for(let t of e)if(t&&qn(t))return t;return null}function ir(e){try{return nn(e,import.meta.url)}catch{return null}}function ps(){let e=nr(),t=e.filter(dt).map(r=>r.id);return Object.freeze({source:"catalog",count:e.length,live:e.length-t.length,quarantined:t.length,quarantinedIds:Object.freeze(t)})}function Un(){let e=or([ir("skills"),$.join(L,"skills"),$.join(L,"dist/assets/skills"),$.join(L,"assets/skills")]);if(!e)return{count:0,trading:[],building:[]};let t=Le.readdirSync(e),r=t.filter(o=>/trade|swap|snipe|farm|hyperliquid|poly|best-exec|circuit|meme|token-research|rfq/i.test(o)),n=t.filter(o=>/launch|builder|protocol|nft|dex-launch|token-launch|security|contract/i.test(o));return{count:t.length,trading:r,building:n}}function ms(){let e=or([ir("protocols/templates"),$.join(L,"protocols/templates"),$.join(L,"dist/assets/protocols/templates"),$.join(L,"assets/protocols/templates")]);return e?Le.readdirSync(e).filter(r=>!r.startsWith(".")):Un().building.some(r=>/protocol-builder|dex-launch|token-launch/i.test(r))?["(via skills: protocol-builder / launch packs)"]:[]}function hs(){let e=or([ir("profiles"),$.join(L,"profiles"),$.join(L,"dist/assets/profiles"),$.join(L,"assets/profiles")]);return e?Le.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&!t.name.startsWith("_")).map(t=>t.name):[]}function ws(){try{if(oe.includes("trade_lifecycle")&&!oe.some(t=>/broadcast|wallet_sign/.test(t)))return!0}catch{}let e=[$.join(L,"src/capability-posture.mjs"),$.join(L,"dist/capability-posture.mjs"),$.join(L,"capability-posture.mjs"),$.join(L,"dist/public-control/policy-schema.mjs"),$.join(L,"README.md"),$.join(L,"package.json")];for(let t of e)if(qn(t))try{let r=Le.readFileSync(t,"utf8");if(/prepare-only|never takes your key|never.*broadcast/i.test(r))return!0}catch{}return!1}function Mn(e=process.env,{health:t=null}={}){let r=[],n=(x,_,U,y=1)=>{r.push({id:x,status:_,detail:U,weight:y})},[o,i]=process.versions.node.split(".").map(Number),s=o>20||o===20&&i>=19;n("node",s?"ok":"fail",`node ${process.versions.node}`,2);let c=["oracle_cli","research_delegate","trade_lifecycle","signal_score","skill_load","learn_skill","code_eval","cron_add","web_fetch"].filter(x=>!oe.includes(x));n("agent_tools",c.length===0?"ok":"warn",c.length===0?`safe tools ${oe.length}; signal_score present`:`missing tools: ${c.join(",")}`,3),n("research_attributes","ok",`attrs [${_t.join(", ")}]; mode=${Tt(e)?"ON":"off"}`,2);let f=ps(),u=f.quarantinedIds.length?`: ${f.quarantinedIds.join(", ")}`:"";n("providers",f.count>=40?"ok":f.count>=10?"warn":"fail",`${f.count} providers from catalog, ${f.live} live, ${f.quarantined} quarantined${u}`,3);let m=Fn(nr(),t,{env:e}),b=m.hardDown>0?"fail":m.quarantined>0||m.counts.needs_key>0||m.counts.unknown>0?"warn":"ok",p=m.hardDownIds.length?`; hard_down_ids=${m.hardDownIds.join(",")}`:"";n("provider_health",b,`live=${m.counts.live} needs_key=${m.counts.needs_key} deprecated=${m.counts.deprecated} soft_fail=${m.counts.soft_fail} hard_down=${m.counts.hard_down} unknown=${m.counts.unknown}${p}`,3);let h=Un();n("skills_trading_build",h.trading.length>=5&&h.building.length>=4?"ok":h.count>=10?"warn":"fail",`${h.count} skills; trading=${h.trading.length} building=${h.building.length}`,3);let w=ms();n("protocol_templates",w.length>=2?"ok":"warn",w.length?w.join(", "):"none",2);let g=hs();n("profiles",g.includes("protocol-builder")&&g.includes("oracle")?"ok":g.length>=1?"warn":"fail",g.join(", ")||"none",2),n("signals_engine",Nt.length>=4?"ok":"fail",`types: ${Nt.join(", ")} (cold / no hot exec)`,2);let S=on();n("harness_roster",S.length>=8?"ok":"warn",`${S.length} supported harnesses; Oracle native default; MCP inbound only`,2),n("custody_prepare_only",ws()?"ok":"fail","public plane prepare-only",4);let P=e.ORACLE_DATA_URL||"http://127.0.0.1:8787";n("data_url","ok",P,1);let E=0,A=0;for(let x of r)A+=x.weight,x.status==="ok"?E+=x.weight:x.status==="warn"&&(E+=x.weight*.5);let N=A?Math.round(E/A*100):0,q=!r.some(x=>x.status==="fail")&&N>=70,v=q?`AGENTIC READY ${N}% \u2014 Oracle is the crypto control plane (prepare-only); pair coding harnesses via MCP for build.`:`AGENTIC GAPS ${N}% \u2014 fix fail/warn checks before calling Oracle the default crypto harness.`;return{ok:q,score:E,max:A,pct:N,summary:v,researchMode:Tt(e),attributes:[..._t],packageRoot:L,checks:r}}function Ei(){let[e,t]=process.versions.node.split(".").map(Number);return e>20||e===20&&t>=19}function pu(e){if(!ke.existsSync(e))return{};let t={};for(let r of ke.readFileSync(e,"utf8").split(/\r?\n/)){let n=r.match(/^([A-Z0-9_]+)=(.*)$/);n&&(t[n[1]]=n[2])}return t}async function mu(e){let t=e.replace(/\/$/,"");return(await Promise.all(["/health","/public/health"].map(async n=>{try{return(await fetch(t+n)).ok}catch{return!1}}))).some(Boolean)}var lx={name:"doctor",summary:"check the read plane (+ optional --agentic readiness score)",group:"read",usage:"oracle doctor [--json] [--agentic] [--first-hour]",async run(e){let t=e.argv.includes("--json"),r=e.argv.includes("--agentic"),n=e.argv.includes("--first-hour"),o=[],i=!1,s=(E,A,N,q=null)=>{o.push({id:E,status:A,detail:N,fix:q}),A==="fail"&&(i=!0)};s("node",Ei()?"ok":"fail",`node ${process.versions.node}`,Ei()?null:"install node >= 20.19");let d=e.paths.oracleExecEnvPath(),c=pu(d),f=process.env.ORACLE_ROUTE_ATTESTATION_SECRET||process.env.MAD_ROUTE_ATTESTATION_SECRET||process.env.ORACLE_ATTESTATION_SECRET||process.env.ORACLE_STAMP_HMAC_SECRET||c.ORACLE_ROUTE_ATTESTATION_SECRET||c.MAD_ROUTE_ATTESTATION_SECRET||c.ORACLE_ATTESTATION_SECRET||c.ORACLE_STAMP_HMAC_SECRET;s("attestation_secret",f?"ok":"warn",f?"present":"missing",f?null:"run oracle init --apply (writes ~/.config/oracle/exec.env)");let u=process.env.ORACLE_DATA_URL||"http://127.0.0.1:8787",m=await mu(u),b=e.paths.loadDeskRouting&&(process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL)?`desk ${process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL}`:null;s("data_server",m?"ok":"warn",m?`reachable ${u}${b?` (${b})`:""}`:`down ${u}`,m?null:u.includes("127.0.0.1")||u.includes("localhost")?"oracle data serve OR set ~/.config/oracle/desk.json to YOUR_DESK_HOST":"check the desk URL in ~/.config/oracle/desk.json (/public/health)");let p=en();s("harness_model","ok","Oracle native harness is default; external harnesses are inbound MCP only (oracle harness detect)",null),s("hermes_opt_in","ok",p.ok?`detected ${p.bin} (${p.source}) \u2014 unused unless explicitly opted in`:"not detected \u2014 native-only OK",null);let h=bi.join(e.paths.hermesRoot(),"profiles"),w=0;ke.existsSync(h)&&(w=ke.readdirSync(h,{withFileTypes:!0}).filter(E=>E.isDirectory()).length),s("hermes_lanes","ok",w>0?`${w} profile dir(s) (optional surface)`:"no Hermes lane profiles (native-only OK)",null);{let E=bi.join(h,"oracle",".env"),A=[];if(ke.existsSync(E)){let N=ke.readFileSync(E,"utf8");/^TELEGRAM_BOT_TOKEN=.+/m.test(N)&&A.push("telegram"),/^DISCORD_BOT_TOKEN=.+/m.test(N)&&A.push("discord"),/^SLACK_BOT_TOKEN=.+/m.test(N)&&A.push("slack")}A.length?p.ok?s("messaging","ok",`${A.join("/")} configured \xB7 runtime ${p.source}`,null):s("messaging","warn",`${A.join("/")} token set but messaging runtime missing \u2014 bot cannot answer`,"oracle bootstrap, then oracle setup gateway restart"):s("messaging","ok","no channel tokens configured (optional \u2014 oracle setup)",null)}let g=null;if(r){g=Mn(process.env);for(let E of g.checks)s(`agentic_${E.id}`,E.status,E.detail,null)}let S=null;if(n){let{firstHourReport:E,probeReviewModule:A,probeReceiptModule:N}=await Promise.resolve().then(()=>(Vr(),hi)),{probeSigner:q,probeQuote:v}=await Promise.resolve().then(()=>(yi(),gi)),[x,_,U,y]=await Promise.all([q(process.env),v(),A(),N()]);S=E({signerReachable:x,quote:_,reviewAvailable:U,receiptAvailable:y});for(let T of S.checks)s(`hour_${T.id}`,T.status,T.detail,T.fix);s("hour_score",S.ok?"ok":"warn",S.firstRunScore.label,null)}let P={ok:!i&&(g?g.ok:!0)&&(S?S.ok:!0),checks:o,...S?{firstHour:S}:{},...g?{agentic:{pct:g.pct,summary:g.summary,attributes:g.attributes,researchMode:g.researchMode}}:{}};if(t)process.stdout.write(JSON.stringify(P,null,2)+`
7
7
  `);else{for(let E of o)process.stdout.write(`${E.status.toUpperCase().padEnd(4)} ${E.id}: ${E.detail}
8
8
  `),E.fix&&process.stdout.write(` fix: ${E.fix}
9
- `);y&&process.stdout.write(`
10
- ${y.summary}
11
- `)}return P.ok?0:1}};export{ex as default};
9
+ `);g&&process.stdout.write(`
10
+ ${g.summary}
11
+ `)}return P.ok?0:1}};export{lx as default};