@oracle-agent/oracle 0.35.40 → 0.35.42

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 (118) hide show
  1. package/dist/agent-sessions.mjs +17 -17
  2. package/dist/assets/skills/oracle-desk-product/SKILL.md +1 -1
  3. package/dist/bin/desk-server.mjs +28 -28
  4. package/dist/bin/oracle-data-mcp.mjs +19 -19
  5. package/dist/bin/oracle-gateway.mjs +44 -44
  6. package/dist/bin/oracle-investigate.mjs +5 -5
  7. package/dist/bin/oracle-launch-radar-shadow.mjs +6 -6
  8. package/dist/bin/oracle-mev-arb-shadow.mjs +6 -6
  9. package/dist/bin/oracle-mev-shadow.mjs +6 -6
  10. package/dist/bin/oracle-public-server.mjs +5 -5
  11. package/dist/bin/oracle-route.mjs +31 -31
  12. package/dist/bin/oracle-scan.mjs +11 -11
  13. package/dist/bin/oracle.mjs +1 -1
  14. package/dist/cli/commands/agent-session.mjs +20 -20
  15. package/dist/cli/commands/airdrop.mjs +8 -8
  16. package/dist/cli/commands/auth.mjs +5 -5
  17. package/dist/cli/commands/chat.mjs +218 -217
  18. package/dist/cli/commands/doctor.mjs +9 -9
  19. package/dist/cli/commands/eval.mjs +204 -217
  20. package/dist/cli/commands/extension-policy.mjs +3 -3
  21. package/dist/cli/commands/farm.mjs +17 -17
  22. package/dist/cli/commands/follow.mjs +17 -17
  23. package/dist/cli/commands/harness.mjs +7 -7
  24. package/dist/cli/commands/mint.mjs +10 -10
  25. package/dist/cli/commands/model.mjs +222 -221
  26. package/dist/cli/commands/portfolio-risk.mjs +1 -1
  27. package/dist/cli/commands/project.mjs +7 -7
  28. package/dist/cli/commands/quickstart.mjs +6 -6
  29. package/dist/cli/commands/receipt.mjs +12 -12
  30. package/dist/cli/commands/resolve.mjs +7 -7
  31. package/dist/cli/commands/setup.mjs +13 -13
  32. package/dist/cli/commands/sign.mjs +4 -4
  33. package/dist/cli/commands/signer.mjs +14 -14
  34. package/dist/cli/commands/snipe.mjs +9 -9
  35. package/dist/cli/commands/strategy.mjs +4 -4
  36. package/dist/cli/commands/swap.mjs +14 -14
  37. package/dist/cli/commands/venues.mjs +2 -2
  38. package/dist/cli/project-access.mjs +3 -0
  39. package/dist/data/desk-data.mjs +26 -26
  40. package/dist/data/names.mjs +3 -3
  41. package/dist/data/providers/farming.mjs +2 -2
  42. package/dist/data/providers/lp-destination-discovery.mjs +4 -4
  43. package/dist/index.mjs +44 -44
  44. package/dist/investigator/index.mjs +2 -2
  45. package/dist/launch-radar/index.mjs +5 -5
  46. package/dist/local-signer/anvil-attestation-worker.mjs +1 -1
  47. package/dist/local-signer/index.mjs +2 -2
  48. package/dist/local-signer/runtime.mjs +8 -8
  49. package/dist/nft/universal-mint-router.mjs +4 -4
  50. package/dist/notifications/index.mjs +8 -8
  51. package/dist/portfolio-risk.mjs +1 -1
  52. package/dist/router/index.mjs +3 -3
  53. package/dist/router/prepare-bridge.mjs +2 -2
  54. package/dist/router/prepare-route.mjs +3 -3
  55. package/dist/scanner/index.mjs +4 -4
  56. package/dist/strategy/index.mjs +3 -3
  57. package/dist/tui/standalone-client.mjs +86 -85
  58. package/package.json +5 -4
  59. package/public/eval-report.json +1 -1
  60. package/public/oracle-splash/_variants/ice.html +2 -4
  61. package/public/oracle-splash/_variants/ivory.html +2 -4
  62. package/public/oracle-splash/assets/fonts/LICENSE-Cormorant-Garamond.txt +93 -0
  63. package/public/oracle-splash/assets/fonts/LICENSE-IBM-Plex-Mono.txt +93 -0
  64. package/public/oracle-splash/assets/fonts/LICENSE-Outfit.txt +93 -0
  65. package/public/oracle-splash/assets/fonts/LICENSE-UnifrakturCook.txt +94 -0
  66. package/public/oracle-splash/assets/fonts/font-provenance.json +426 -0
  67. package/public/oracle-splash/assets/fonts/oracle-font-00.woff2 +0 -0
  68. package/public/oracle-splash/assets/fonts/oracle-font-01.woff2 +0 -0
  69. package/public/oracle-splash/assets/fonts/oracle-font-02.woff2 +0 -0
  70. package/public/oracle-splash/assets/fonts/oracle-font-03.woff2 +0 -0
  71. package/public/oracle-splash/assets/fonts/oracle-font-04.woff2 +0 -0
  72. package/public/oracle-splash/assets/fonts/oracle-font-05.woff2 +0 -0
  73. package/public/oracle-splash/assets/fonts/oracle-font-06.woff2 +0 -0
  74. package/public/oracle-splash/assets/fonts/oracle-font-07.woff2 +0 -0
  75. package/public/oracle-splash/assets/fonts/oracle-font-08.woff2 +0 -0
  76. package/public/oracle-splash/assets/fonts/oracle-font-09.woff2 +0 -0
  77. package/public/oracle-splash/assets/fonts/oracle-font-10.woff2 +0 -0
  78. package/public/oracle-splash/assets/fonts/oracle-font-11.woff2 +0 -0
  79. package/public/oracle-splash/assets/fonts/oracle-font-12.woff2 +0 -0
  80. package/public/oracle-splash/assets/fonts/oracle-font-13.woff2 +0 -0
  81. package/public/oracle-splash/assets/fonts/oracle-font-14.woff2 +0 -0
  82. package/public/oracle-splash/assets/fonts/oracle-font-15.woff2 +0 -0
  83. package/public/oracle-splash/assets/fonts/oracle-font-16.woff2 +0 -0
  84. package/public/oracle-splash/assets/fonts/oracle-font-17.woff2 +0 -0
  85. package/public/oracle-splash/assets/fonts/oracle-font-18.woff2 +0 -0
  86. package/public/oracle-splash/assets/fonts/oracle-font-19.woff2 +0 -0
  87. package/public/oracle-splash/assets/fonts/oracle-font-20.woff2 +0 -0
  88. package/public/oracle-splash/assets/fonts/oracle-font-21.woff2 +0 -0
  89. package/public/oracle-splash/assets/fonts/oracle-font-22.woff2 +0 -0
  90. package/public/oracle-splash/assets/fonts/oracle-font-23.woff2 +0 -0
  91. package/public/oracle-splash/assets/fonts/oracle-font-24.woff2 +0 -0
  92. package/public/oracle-splash/assets/fonts/oracle-font-25.woff2 +0 -0
  93. package/public/oracle-splash/assets/fonts/oracle-font-26.woff2 +0 -0
  94. package/public/oracle-splash/assets/fonts/oracle-font-27.woff2 +0 -0
  95. package/public/oracle-splash/assets/fonts/oracle-fonts.css +504 -0
  96. package/public/oracle-splash/assets/transport-probe-sw.js +2 -0
  97. package/public/oracle-splash/docs/browser-and-web/index.html +6 -6
  98. package/public/oracle-splash/docs/connectors/index.html +5 -5
  99. package/public/oracle-splash/docs/docs.css +4 -4
  100. package/public/oracle-splash/docs/docs.js +119 -7
  101. package/public/oracle-splash/docs/getting-started/index.html +5 -5
  102. package/public/oracle-splash/docs/index.html +6 -6
  103. package/public/oracle-splash/docs/reference/index.html +5 -5
  104. package/public/oracle-splash/docs/security/index.html +5 -5
  105. package/public/oracle-splash/docs/using-oracle/index.html +5 -5
  106. package/public/oracle-splash/download/index.html +8 -10
  107. package/public/oracle-splash/downloads/index.html +3 -5
  108. package/public/oracle-splash/eval/archive/oracle-0.35.40.json +101 -0
  109. package/public/oracle-splash/eval/archive/oracle-0.35.41-blocked-attempt.json +672 -0
  110. package/public/oracle-splash/eval/index.html +104 -0
  111. package/public/oracle-splash/eval/releases/oracle-0.35.41.json +788 -0
  112. package/public/oracle-splash/index.html +16 -18
  113. package/public/oracle-splash/mesh-graph.svg +1 -1
  114. package/public/oracle-splash/pricing/index.html +6 -8
  115. package/public/oracle-splash/security/index.html +3 -5
  116. package/public/oracle-splash/what-it-does/index.html +4 -6
  117. package/public/oracle-splash/where-it-works/index.html +3 -5
  118. package/server.json +2 -2
@@ -1,11 +1,11 @@
1
- var ci=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 We=(e,t)=>{for(var r in t)ci(e,r,{get:t[r],enumerable:!0})};import Ve from"node:fs";import ui from"node:os";import he from"node:path";import{fileURLToPath as li}from"node:url";function bt(){return process.env.ORACLE_FAKE_HOME||ui.homedir()}function fi(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function we(){return fi()?process.env.ORACLE_CONFIG_DIR||he.join(bt(),".config","oracle"):he.join(bt(),".config","oracle")}function pi(){return he.join(we(),"desk.json")}function mi(){return he.join(we(),"env")}function me({force:e=!1}={}){if(me._done&&!e)return me._result||null;me._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=mi();if(Ve.existsSync(o))for(let i of Ve.readFileSync(o,"utf8").split(/\r?\n/)){let s=i.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!s||s[2].startsWith("#"))continue;let f=s[2];(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))&&(f=f.slice(1,-1)),r(s[1],f)}}catch{}try{let o=pi();if(Ve.existsSync(o)){let i=JSON.parse(Ve.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)),me._result=Object.keys(t).length?t:null,me._result}var di,L,Ke=l(()=>{di=he.dirname(li(import.meta.url)),L=he.resolve(di,"../..");try{me()}catch{}});import se from"node:net";import Pi from"node:dns";function Ge(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 f=t.includes("::"),c=8-i.length-s.length;if(!f&&c!==0||f&&c<1)return null;let p=[...i,...Array(Math.max(0,c)).fill(0),...s];return p.length!==8?null:Uint8Array.from(p.flatMap(u=>[u>>8,u&255]))}function At(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 It(e){if(se.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(se.isIPv6(e)){let t=Ge(e);if(!t)return!1;let r=Ge("::ffff:0:0");return At(t,r,96)?It([...t.slice(12)].join(".")):At(t,Ge("2000::"),3)?![["2001::",23],["2001:db8::",32],["2001:10::",28],["2001:2::",48],["2002::",16],["3fff::",20]].some(([o,i])=>At(t,Ge(o),i)):!1}return!1}function Bi(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($i.has(r)||r.endsWith(".localhost")||r.endsWith(".internal"))return{ok:!1,error:`refused internal host ${r}`};let n=se.isIP(r);return n!==0&&!It(r)?{ok:!1,error:`refused private address ${r}`}:{ok:!0,url:t,host:r,isLiteralIp:n!==0}}async function kt(e,{lookupFn:t=Pi.promises.lookup}={}){let r=Bi(e);if(!r.ok)return r;if(r.isLiteralIp)return{ok:!0,url:r.url,addresses:[{address:r.host,family:se.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=>!It(o.address))?{ok:!1,error:`refused: ${r.host} resolves to a non-public address`}:{ok:!0,url:r.url,addresses:n}}async function Ot({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||(se.isIPv6(h.address)?6:4)})),f=(d,h,m)=>{i.set(o(d),s(typeof h=="string"?[{address:h,family:m}]:h))},c=d=>{let h=o(d);if(se.isIP(h))return[{address:h,family:se.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},p=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=Di((d,h={})=>n(d,{...h,dispatcher:p}),f);return{dispatcher:p,fetch:u,pin:f,resolve:c,async close(){try{await p.destroy()}catch{}}}}function Di(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[_t]=Object.freeze({pin:t}),e}function Tt(e){return typeof e=="function"&&typeof e[_t]?.pin=="function"}function Xr(e,t,r){if(!Tt(e))throw new Error("pinFetchToAddresses: fetchImpl is not pin-capable");e[_t].pin(t,r)}var $i,_t,Qr=l(()=>{$i=new Set(["localhost","metadata.google.internal","metadata.goog"]);_t=Symbol.for("oracle.egressGuard.pinCapableFetch")});import{createHash as Fi}from"node:crypto";import{types as ee}from"node:util";function C(e){return ne(`HTTP JSON body refused: ${e}`)}function Ki(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 ee[t]=="function"&&ee[t](e))}function Gi(e){let t=[],r=0,n=0,o=0,i=0,s=new WeakSet,f=u=>{if(r+=Buffer.byteLength(u,"utf8"),r>Z.bytes)throw C("serialized byte limit exceeded");t.push(u)},c=u=>{if(Buffer.byteLength(u,"utf8")>Z.bytes)throw C("serialized byte limit exceeded");return JSON.stringify(u)},p=(u,d)=>{if(n+=1,n>Z.nodes)throw C("node limit exceeded");if(d>Z.depth)throw C("depth limit exceeded");if(u===null){f("null");return}if(typeof u=="string"){f(c(u));return}if(typeof u=="boolean"){f(u?"true":"false");return}if(typeof u=="number"){if(!Number.isFinite(u))throw C("non-finite number");f(Object.is(u,-0)?"0":String(u));return}if(typeof u!="object")throw C("unsupported non-JSON value");if(ee.isProxy(u))throw C("proxy value");if(Ki(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(ee.isProxy(w))throw C("proxy array prototype");if(g+=1,g>Z.depth)throw C("array prototype depth limit exceeded");w=Object.getPrototypeOf(w)}if(u.length>Z.arrayLength)throw C("array length limit exceeded");for(let A=0;A<u.length;A+=1){let P=Object.getOwnPropertyDescriptor(u,String(A));if(!P||!Object.hasOwn(P,"value")||P.enumerable!==!0)throw C("array entries must be dense enumerable own data")}let E=0;for(let A in u){if(i+=1,i>Z.fields)throw C("enumeration limit exceeded");if(Object.hasOwn(u,A)&&(E+=1,E>u.length))throw C("named array fields are unsupported")}if(E!==u.length)throw C("array entries must be dense enumerable own data");f("[");for(let A=0;A<u.length;A+=1)A&&f(","),p(Object.getOwnPropertyDescriptor(u,String(A)).value,d+1);f("]");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>Z.fields)throw C("enumeration limit exceeded");if(!Object.hasOwn(u,w))continue;if(o+=1,o>Z.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])}f("{");for(let w=0;w<m.length;w+=1)w&&f(","),f(c(m[w][0])),f(":"),p(m[w][1],d+1);f("}")}finally{s.delete(u)}};return p(e,0),t.join("")}function Ji(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(ee.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 Yi(){return Object.assign(Object.create(null),{Accept:"application/json"})}function Xi(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 Qi(e,t){return new URL(String(e)).origin===new URL(String(t)).origin}function Je(e){if((typeof e!="object"||e===null)&&typeof e!="function")return`${typeof e}:${String(e)}`;let t=rn.get(e);return t||(t=nn,nn+=1,rn.set(e,t)),`reference:${t}`}function on(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?Zi.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 an(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(on);if(!r||typeof r!="object")return!1;if(Object.hasOwn(r,"jsonrpc")||Object.hasOwn(r,"method"))return on(r);let n=Object.hasOwn(r,"type")?r.type:null;return typeof n=="string"&&ea.has(n)&&(!Object.hasOwn(r,"action")||r.action==null)&&(!Object.hasOwn(r,"signature")||r.signature==null)&&(!Object.hasOwn(r,"nonce")||r.nonce==null)}function ta(e,t,r,n={},o=null){let i=Fi("sha256"),s=(c,p)=>{let u=String(p);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,p)=>({name:c.toLowerCase(),order:p,value:String(r[c])})).sort((c,p)=>c.name.localeCompare(p.name)||c.order-p.order).forEach((c,p)=>{s(`header-name-${p}`,c.name),s(`header-value-${p}`,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 ra(e,t){let r=Number(t);return Number.isFinite(r)&&r>0?Math.min(r*1e3,en):Math.min(250*2**e,en)+Math.floor(Math.random()*100)}function ne(e,t={}){let r=new Error(e);return r.retryable=!1,Object.assign(r,t),r}function Nt(e,t,r){return ne(`HTTP response from ${e} exceeded maxResponseBytes ${r} (${t})`,{oversize:!0})}function ce(e){try{let t=e?.body?.cancel?.();t&&typeof t.then=="function"&&t.catch(()=>{})}catch{}}function oa(e){return e?e.byteLength??e.length??0:0}async function ia(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&&(ce(e),!n))throw Nt(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 Nt(r,`body ${h} bytes`,t);return Buffer.from(d,"utf8").subarray(0,t).toString("utf8")}return d}let f=[],c=0,p=!1;try{for(;;){let{value:d,done:h}=await s.read();if(h)break;if(d&&(f.push(Buffer.from(d)),c+=oa(d),c>t)){p=!0;break}}}finally{if(p)try{await s.cancel()}catch{}try{s.releaseLock?.()}catch{}}if(p&&(typeof o=="function"&&o(),!n))throw Nt(r,`streamed ${c} bytes`,t);let u=Buffer.concat(f);return(p?u.subarray(0,t):u).toString("utf8")}function aa(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function sa(e,{fetchImpl:t,method:r,headers:n,body:o,timeoutMs:i,lookupFn:s,realFetch:f,untrustedUrl:c=!1,maxResponseBytes:p=null,sameOriginRedirectsOnly:u=!1,importUndici:d,validateResponse:h,signal:m,redirectPolicy:w="follow",maxRedirects:g=Ye}){let E=new AbortController,A=setTimeout(()=>E.abort(),i),P=m?tn?tn([m,E.signal]):m:E.signal,y=null,x=t,_=s?{lookupFn:s}:{};if(c&&!f&&!Tt(x))throw ne(`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 q=async(v,{status:S=null}={})=>{let T=await kt(v,_);if(!T.ok)throw ne(S==null?`HTTP refused ${v}: ${T.error}`:`HTTP redirect to ${v} ${T.error}`,S==null?{}:{status:S});let U=new URL(v).hostname;if(f){if(y&&(await y.close(),y=null),!y)try{y=await Ot({requireUndici:!0,...d?{importUndici:d}:{}})}catch(b){throw ne(S==null?`HTTP refused ${v}: ${b?.message||b}`:`HTTP redirect to ${v} refused: ${b?.message||b}`,S==null?{}:{status:S})}y.pin(U,T.addresses),x=y.fetch}else Xr(x,U,T.addresses);return T};try{let v=String(e),S=Object.assign(Object.create(null),n||{});c&&await q(v);for(let T=0;T<=g;T+=1){let U=Object.assign(Object.create(null),{method:r,headers:S,body:o,signal:P,redirect:"manual",dispatcher:void 0}),b=await x(v,U);if((w==="error"||g===0)&&b.status>=300&&b.status<400)throw ce(b),ne(`HTTP ${b.status} ${r} redirect refused`,{status:b.status,redirectRefused:!0});if(Vi.has(b.status)){let M=u===!0&&r==="POST"&&[307,308].includes(b.status)&&an(r,o);if(r!=="GET"&&r!=="HEAD"&&!M){ce(b);let N=new Error(`HTTP ${b.status} ${r} ${v} redirected non-idempotent request`);throw N.status=b.status,N}if(T===g)throw ce(b),ne(`HTTP ${b.status} ${r} redirect budget exhausted`,{status:b.status,redirectRefused:!0});let jr=b.headers?.get?.("location"),K;try{K=Xi(jr,v)}catch(N){throw ce(b),N}let ie=!Qi(K,v);if(ce(b),ie&&r==="POST"){let N=new Error(`HTTP ${b.status} ${r} cross-origin redirect refused`);throw N.status=b.status,N}if(ie&&u){let N=new Error(`HTTP ${b.status} ${r} cross-origin redirect refused`);throw N.status=b.status,N.retryable=!1,N}if(ie&&(S=Yi(S)),c)await q(K,{status:b.status});else if(ie){let N=await kt(K,_);if(!N.ok){let O=new Error(`HTTP redirect from ${v} ${N.error}`);throw O.status=b.status,O.retryable=!1,O}f&&N.addresses?.length&&(y||(y=await Ot(d?{importUndici:d}:{})),y&&(y.pin(new URL(K).hostname,N.addresses),x=y.fetch))}v=K;continue}if(typeof h=="function")try{await h(b,{url:v})}catch(M){throw ce(b),ne(M?.message||String(M))}let R=await ia(b,p,{url:v,onOversize:()=>E.abort()}),ke=aa(R);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=ke??R.slice(0,300),M}return ke??R}throw new Error(`HTTP redirect loop for ${e}`)}catch(v){if(E.signal.aborted&&!Rt(m)){let S=v&&(typeof v=="object"||typeof v=="function")&&!ee.isProxy(v)?v:null,T=S?Object.getOwnPropertyDescriptor(S,"oversize"):null;if(!(T&&Object.hasOwn(T,"value")&&T.value===!0))try{if(!S)throw new TypeError("unsafe rejection");Object.defineProperties(S,{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&&ee.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 O of Object.getOwnPropertyNames(t)){let I=Object.getOwnPropertyDescriptor(t,O);if(!(O==="toJSON"&&I&&Object.hasOwn(I,"value")&&I.value===void 0)){if(!r.has(O))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=O=>{if(t==null||!Object.hasOwn(t,O))return;let I=Object.getOwnPropertyDescriptor(t,O);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 f=n("redirectPolicy");if(f!==void 0&&f!=="follow"&&f!=="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>Ye))throw new TypeError(`HTTP maxRedirects must be an integer from 0 through ${Ye}`);if(f==="error"&&c!==void 0&&c!==0)throw new TypeError('HTTP redirectPolicy "error" requires maxRedirects 0 when supplied');let p=f??"follow",u=p==="error"?0:c??Ye;for(let O of["dedupe","untrustedUrl","sameOriginRedirectsOnly"]){let I=n(O);if(I!==void 0&&typeof I!="boolean")throw new TypeError(`HTTP ${O} 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(ee.isProxy(h)||!(h instanceof AbortSignal))throw new TypeError("HTTP signal must be a native AbortSignal");try{Rt(h)}catch{throw new TypeError("HTTP signal must be a native AbortSignal")}}for(let O of["importUndici","lookupFn","validateResponse"]){let I=n(O);if(I!==void 0&&typeof I!="function")throw new TypeError(`HTTP ${O} 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,E=(o||"GET").toUpperCase(),A=n("headers"),P=Ji(A),y=Object.assign(Object.create(null),P);Object.keys(y).some(O=>O.toLowerCase()==="accept")||(y.Accept="application/json");let x=n("body");x!=null&&typeof x!="string"&&(Object.keys(y).find(I=>I.toLowerCase()==="content-type")||(y["Content-Type"]="application/json"),x=Gi(x));let _=s??Ui,q=n("lookupFn"),v=!m,S=n("untrustedUrl")===!0,T=n("sameOriginRedirectsOnly")===!0,U=n("importUndici"),b=n("validateResponse"),R=h,ke=d??null,M=async()=>{let O;for(let I=0;I<=_;I++){R&&Hi.call(R);try{return await sa(e,{fetchImpl:w,method:E,headers:y,body:x,timeoutMs:g,lookupFn:q,realFetch:v,untrustedUrl:S,maxResponseBytes:ke,sameOriginRedirectsOnly:T,importUndici:U,validateResponse:b,signal:R,redirectPolicy:p,maxRedirects:u})}catch(ae){O=ae;let pe=yt=>{if(!ae||typeof ae!="object"&&typeof ae!="function"||ee.isProxy(ae))return;let Oe=Object.getOwnPropertyDescriptor(ae,yt);return Oe&&Object.hasOwn(Oe,"value")?Oe.value:void 0},gt=pe("status"),oi=pe("oracleTimeout")===!0||pe("name")==="AbortError"||pe("name")==="TimeoutError"||Rt(R),ii=new Set([408,425,429]),ai=pe("retryable")===!1?!1:gt!=null?ii.has(gt)||qi.has(gt)&&Zr.has(E):!oi&&Zr.has(E);if(I===_||!ai)throw ae;let Hr=ra(I,pe("retryAfter"));R?await new Promise((yt,Oe)=>{let si=setTimeout(yt,Hr);zi.call(R,"abort",()=>{clearTimeout(si),Oe(Wi(R)||new DOMException("Aborted","AbortError"))},{once:!0})}):await na(Hr)}}throw O};if(!(n("dedupe")!==!1&&!R&&an(E,x)))return M();let K=ta(E,e,y,{untrustedUrl:S,maxResponseBytes:ke,sameOriginRedirectsOnly:T,redirectPolicy:p,maxRedirects:u,timeoutMs:g,retries:_,fetchImpl:Je(w),realFetch:v,lookupFn:Je(q),importUndici:Je(U),validateResponse:Je(b)},x),ie=Ct.get(K);if(ie)return ie;let N=M().finally(()=>Ct.delete(K));return Ct.set(K,N),N}var qi,Zr,Ui,en,Mi,ji,Hi,zi,tn,Rt,Wi,Vi,Ye,Ou,Z,Ct,rn,nn,Zi,ea,na,j=l(()=>{Qr();qi=new Set([408,425,429,500,502,503,504]),Zr=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]),Ui=2,en=4e3,Mi=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted")?.get,ji=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"reason")?.get,Hi=AbortSignal.prototype.throwIfAborted,zi=EventTarget.prototype.addEventListener,tn=typeof AbortSignal.any=="function"?AbortSignal.any.bind(AbortSignal):null,Rt=e=>e?Mi.call(e):!1,Wi=e=>e?ji.call(e):void 0,Vi=new Set([301,302,303,307,308]),Ye=3,Ou=64*1024,Z=Object.freeze({depth:32,nodes:1e4,fields:1e4,arrayLength:1e4,bytes:1024*1024});Ct=new Map,rn=new WeakMap,nn=1;Zi=new Set(["eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","getHealth","minimumLedgerSlot","net_version","simulateTransaction","web3_clientVersion"]),ea=new Set(["allMids","l2Book","outcomeMeta","spotClearinghouseState","userFills","meta","metaAndAssetCtxs","perpDexs","candleSnapshot","fundingHistory","openOrders","frontendOpenOrders","clearinghouseState","spotMeta","validatorSummaries","delegatorSummary","delegations","delegatorRewards","delegatorHistory","maxBuilderFee"]);na=e=>new Promise(t=>setTimeout(t,e))});function sn(e){return ca.get(Number(e))||null}function cn(e,t=process.env){let r=sn(e);if(!r)return null;for(let n of r.rpcEnv){let o=(t[n]||"").trim();if(o)return o}return null}var Xe,ca,Lt=l(()=>{Xe={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(Xe).map(e=>[e.chainId,e]))});import{Interface as ua,getAddress as la}from"ethers";function Pt(e,t){try{return la(e).toLowerCase()}catch{throw new Error(`${t} must be a valid EVM address`)}}function da(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 $t(e){return e==null?null:Number.parseInt(String(e),16)}function pa(e,{rpcUrl:t,env:r=process.env}={}){if(t)return t;let n=cn(e,r);return n||fa[Number(e)]||null}function ha(e){let t=String(e||""),r=t.toLowerCase();if(t!==t.trim()||!/^[a-zA-Z0-9_]+$/.test(t)||!ma.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 wa(e){let t=new Error(e?.message||JSON.stringify(e));return t.code=e?.code,t}function ga(e){if(e?.error)throw wa(e.error);return e?.result}function ya(e,t,r){return`${e}
1
+ var hi=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 Ge=(e,t)=>{for(var r in t)hi(e,r,{get:t[r],enumerable:!0})};import Je from"node:fs";import wi from"node:os";import ge from"node:path";import{fileURLToPath as gi}from"node:url";function xt(){return process.env.ORACLE_FAKE_HOME||wi.homedir()}function bi(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function ye(){return bi()?process.env.ORACLE_CONFIG_DIR||ge.join(xt(),".config","oracle"):ge.join(xt(),".config","oracle")}function Ei(){return ge.join(ye(),"desk.json")}function Si(){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=Si();if(Je.existsSync(o))for(let i of Je.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=Ei();if(Je.existsSync(o)){let i=JSON.parse(Je.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 yi,L,Ye=l(()=>{yi=ge.dirname(gi(import.meta.url)),L=ge.resolve(yi,"../..");try{we()}catch{}});import ue from"node:net";import Mi from"node:dns";function Xe(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 _t(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 Tt(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=Xe(e);if(!t)return!1;let r=Xe("::ffff:0:0");return _t(t,r,96)?Tt([...t.slice(12)].join(".")):_t(t,Xe("2000::"),3)?![["2001::",23],["2001:db8::",32],["2001:10::",28],["2001:2::",48],["2002::",16],["3fff::",20]].some(([o,i])=>_t(t,Xe(o),i)):!1}return!1}function Hi(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(ji.has(r)||r.endsWith(".localhost")||r.endsWith(".internal"))return{ok:!1,error:`refused internal host ${r}`};let n=ue.isIP(r);return n!==0&&!Tt(r)?{ok:!1,error:`refused private address ${r}`}:{ok:!0,url:t,host:r,isLiteralIp:n!==0}}async function Ct(e,{lookupFn:t=Mi.promises.lookup}={}){let r=Hi(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=>!Tt(o.address))?{ok:!1,error:`refused: ${r.host} resolves to a non-public address`}:{ok:!0,url:r.url,addresses:n}}async function Nt({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[Rt]=Object.freeze({pin:t}),e}function Lt(e){return typeof e=="function"&&typeof e[Rt]?.pin=="function"}function on(e,t,r){if(!Lt(e))throw new Error("pinFetchToAddresses: fetchImpl is not pin-capable");e[Rt].pin(t,r)}var ji,Rt,an=l(()=>{ji=new Set(["localhost","metadata.google.internal","metadata.goog"]);Rt=Symbol.for("oracle.egressGuard.pinCapableFetch")});import{createHash as Wi}from"node:crypto";import{types as ee}from"node:util";function C(e){return oe(`HTTP JSON body refused: ${e}`)}function ea(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 ee[t]=="function"&&ee[t](e))}function ta(e){let t=[],r=0,n=0,o=0,i=0,s=new WeakSet,p=u=>{if(r+=Buffer.byteLength(u,"utf8"),r>Z.bytes)throw C("serialized byte limit exceeded");t.push(u)},c=u=>{if(Buffer.byteLength(u,"utf8")>Z.bytes)throw C("serialized byte limit exceeded");return JSON.stringify(u)},f=(u,d)=>{if(n+=1,n>Z.nodes)throw C("node limit exceeded");if(d>Z.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(ee.isProxy(u))throw C("proxy value");if(ea(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(ee.isProxy(w))throw C("proxy array prototype");if(g+=1,g>Z.depth)throw C("array prototype depth limit exceeded");w=Object.getPrototypeOf(w)}if(u.length>Z.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>Z.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>Z.fields)throw C("enumeration limit exceeded");if(!Object.hasOwn(u,w))continue;if(o+=1,o>Z.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 ra(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(ee.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 na(){return Object.assign(Object.create(null),{Accept:"application/json"})}function oa(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 ia(e,t){return new URL(String(e)).origin===new URL(String(t)).origin}function Qe(e){if((typeof e!="object"||e===null)&&typeof e!="function")return`${typeof e}:${String(e)}`;let t=dn.get(e);return t||(t=fn,fn+=1,dn.set(e,t)),`reference:${t}`}function pn(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?aa.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 mn(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(pn);if(!r||typeof r!="object")return!1;if(Object.hasOwn(r,"jsonrpc")||Object.hasOwn(r,"method"))return pn(r);let n=Object.hasOwn(r,"type")?r.type:null;return typeof n=="string"&&sa.has(n)&&(!Object.hasOwn(r,"action")||r.action==null)&&(!Object.hasOwn(r,"signature")||r.signature==null)&&(!Object.hasOwn(r,"nonce")||r.nonce==null)}function ca(e,t,r,n={},o=null){let i=Wi("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 ua(e,t){let r=Number(t);return Number.isFinite(r)&&r>0?Math.min(r*1e3,cn):Math.min(250*2**e,cn)+Math.floor(Math.random()*100)}function oe(e,t={}){let r=new Error(e);return r.retryable=!1,Object.assign(r,t),r}function $t(e,t,r){return oe(`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 da(e){return e?e.byteLength??e.length??0:0}async function fa(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 $t(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 $t(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+=da(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 $t(r,`streamed ${c} bytes`,t);let u=Buffer.concat(p);return(f?u.subarray(0,t):u).toString("utf8")}function pa(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function ma(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=Ze}){let y=null,S=t,P=s?{lookupFn:s}:{};if(c&&!p&&!Lt(S))throw oe(`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?ln?ln([m,E.signal]):m:E.signal,q=async(v,{status:x=null}={})=>{let _=await Ct(v,P);if(!_.ok)throw oe(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 Nt({requireUndici:!0,...d?{importUndici:d}:{}})}catch(b){throw oe(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 on(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),oe(`HTTP ${b.status} ${r} redirect refused`,{status:b.status,redirectRefused:!0});if(Zi.has(b.status)){let M=u===!0&&r==="POST"&&[307,308].includes(b.status)&&mn(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),oe(`HTTP ${b.status} ${r} redirect budget exhausted`,{status:b.status,redirectRefused:!0});let Wr=b.headers?.get?.("location"),K;try{K=oa(Wr,v)}catch(R){throw le(b),R}let ae=!ia(K,v);if(le(b),ae&&r==="POST"){let R=new Error(`HTTP ${b.status} ${r} cross-origin redirect refused`);throw R.status=b.status,R}if(ae&&u){let R=new Error(`HTTP ${b.status} ${r} cross-origin redirect refused`);throw R.status=b.status,R.retryable=!1,R}if(ae&&(x=na(x)),c)await q(K,{status:b.status});else if(ae){let R=await Ct(K,P);if(!R.ok){let O=new Error(`HTTP redirect from ${v} ${R.error}`);throw O.status=b.status,O.retryable=!1,O}p&&R.addresses?.length&&(y||(y=await Nt(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),oe(M?.message||String(M))}let T=await fa(b,f,{url:v,onOversize:()=>E.abort()}),Oe=pa(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")&&!ee.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&&ee.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 O of Object.getOwnPropertyNames(t)){let I=Object.getOwnPropertyDescriptor(t,O);if(!(O==="toJSON"&&I&&Object.hasOwn(I,"value")&&I.value===void 0)){if(!r.has(O))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=O=>{if(t==null||!Object.hasOwn(t,O))return;let I=Object.getOwnPropertyDescriptor(t,O);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>Ze))throw new TypeError(`HTTP maxRedirects must be an integer from 0 through ${Ze}`);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??Ze;for(let O of["dedupe","untrustedUrl","sameOriginRedirectsOnly"]){let I=n(O);if(I!==void 0&&typeof I!="boolean")throw new TypeError(`HTTP ${O} 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(ee.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 O of["importUndici","lookupFn","validateResponse"]){let I=n(O);if(I!==void 0&&typeof I!="function")throw new TypeError(`HTTP ${O} 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=ra(S),E=Object.assign(Object.create(null),P);Object.keys(E).some(O=>O.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=ta(A));let N=s??Ki,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 O;for(let I=0;I<=N;I++){T&&Yi.call(T);try{return await ma(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})}catch(se){O=se;let he=St=>{if(!se||typeof se!="object"&&typeof se!="function"||ee.isProxy(se))return;let _e=Object.getOwnPropertyDescriptor(se,St);return _e&&Object.hasOwn(_e,"value")?_e.value:void 0},Et=he("status"),fi=he("oracleTimeout")===!0||he("name")==="AbortError"||he("name")==="TimeoutError"||Ce(T),pi=new Set([408,425,429]),mi=he("retryable")===!1?!1:Et!=null?pi.has(Et)||Vi.has(Et)&&sn.has(y):!fi&&sn.has(y);if(I===N||!mi)throw se;let Vr=ua(I,he("retryAfter"));T?await new Promise((St,_e)=>{let Kr,Te=()=>{clearTimeout(Kr),un.call(T,"abort",Te),_e(Qi(T)||new DOMException("Aborted","AbortError"))};if(Ce(T)){Te();return}Kr=setTimeout(()=>{un.call(T,"abort",Te),St()},Vr),Xi.call(T,"abort",Te,{once:!0}),Ce(T)&&Te()}):await la(Vr)}}throw O};if(!(n("dedupe")!==!1&&!T&&mn(y,A)))return M();let K=ca(y,e,E,{untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,redirectPolicy:f,maxRedirects:u,timeoutMs:g,retries:N,fetchImpl:Qe(w),realFetch:v,lookupFn:Qe(q),importUndici:Qe(U),validateResponse:Qe(b)},A),ae=Pt.get(K);if(ae)return ae;let R=M().finally(()=>Pt.delete(K));return Pt.set(K,R),R}var Vi,sn,Ki,cn,Gi,Ji,Yi,Xi,un,ln,Ce,Qi,Zi,Ze,Du,Z,Pt,dn,fn,aa,sa,la,j=l(()=>{an();Vi=new Set([408,425,429,500,502,503,504]),sn=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]),Ki=2,cn=4e3,Gi=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted")?.get,Ji=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"reason")?.get,Yi=AbortSignal.prototype.throwIfAborted,Xi=EventTarget.prototype.addEventListener,un=EventTarget.prototype.removeEventListener,ln=typeof AbortSignal.any=="function"?AbortSignal.any.bind(AbortSignal):null,Ce=e=>e?Gi.call(e):!1,Qi=e=>e?Ji.call(e):void 0,Zi=new Set([301,302,303,307,308]),Ze=3,Du=64*1024,Z=Object.freeze({depth:32,nodes:1e4,fields:1e4,arrayLength:1e4,bytes:1024*1024});Pt=new Map,dn=new WeakMap,fn=1;aa=new Set(["eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","getHealth","minimumLedgerSlot","net_version","simulateTransaction","web3_clientVersion"]),sa=new Set(["allMids","l2Book","outcomeMeta","spotClearinghouseState","userFills","meta","metaAndAssetCtxs","perpDexs","candleSnapshot","fundingHistory","openOrders","frontendOpenOrders","clearinghouseState","spotMeta","validatorSummaries","delegatorSummary","delegations","delegatorRewards","delegatorHistory","maxBuilderFee"]);la=e=>new Promise(t=>setTimeout(t,e))});function hn(e){return ha.get(Number(e))||null}function wn(e,t=process.env){let r=hn(e);if(!r)return null;for(let n of r.rpcEnv){let o=(t[n]||"").trim();if(o)return o}return null}var et,ha,Bt=l(()=>{et={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}},ha=new Map(Object.values(et).map(e=>[e.chainId,e]))});import{Interface as wa,getAddress as ga}from"ethers";function Dt(e,t){try{return ga(e).toLowerCase()}catch{throw new Error(`${t} must be a valid EVM address`)}}function ya(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 Ft(e){return e==null?null:Number.parseInt(String(e),16)}function Ea(e,{rpcUrl:t,env:r=process.env}={}){if(t)return t;let n=wn(e,r);return n||ba[Number(e)]||null}function xa(e){let t=String(e||""),r=t.toLowerCase();if(t!==t.trim()||!/^[a-zA-Z0-9_]+$/.test(t)||!Sa.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 va(e){let t=new Error(e?.message||JSON.stringify(e));return t.code=e?.code,t}function Aa(e){if(e?.error)throw va(e.error);return e?.result}function Ia(e,t,r){return`${e}
3
3
  ${t}
4
- ${JSON.stringify(r??[])}`}async function ba(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=ha(o),s=pa(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=un.get(s);if(u!=null)return u}let c=n.dedupe!==!1&&!n.signal?ya(s,o,r):null;if(c&&_e.has(c))return _e.get(c);let p=(async()=>{let u=await ba(s,{jsonrpc:"2.0",id:1,method:t,params:r},n),d=ga(u);return i==="eth_chainid"&&typeof d=="string"&&un.set(s,d),d})();return c&&(_e.set(c,p),p.finally(()=>{_e.get(c)===p&&_e.delete(c)}).catch(()=>{})),p}async function ln(e={},t={}){let r=Number(e.chainId??t.chainId??1),n=da(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=$t(o.status),s=i===1,f=i===1?"success":i===0?"reverted":"unknown",c=s?null:f==="reverted"?"transaction reverted":"unknown receipt status",p=e.expectedTo?Pt(e.expectedTo,"expectedTo"):null,u=o.to?Pt(o.to,"receipt.to"):null;return p&&u!==p&&(s=!1,c=`to mismatch: expected ${p}, got ${u||"null"}`),{ok:s,chainId:r,txHash:n,status:f,reason:c,statusCode:i,to:u,from:o.from?Pt(o.from,"receipt.from"):null,blockNumber:$t(o.blockNumber),transactionIndex:$t(o.transactionIndex),logs:Array.isArray(o.logs)?o.logs:[],receipt:o}}var Pu,fa,ma,_e,un,Y=l(()=>{j();Lt();Pu=new ua(["function allowance(address owner,address spender) view returns (uint256)","function balanceOf(address account) view returns (uint256)"]);fa={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"};ma=/^(?:eth_(?:call|blocknumber|chainid|get[a-z0-9]+|feehistory|gasprice|maxpriorityfeepergas|syncing|protocolversion|estimategas|createaccesslist)|net_(?:version|listening|peercount)|web3_(?:clientversion|sha3))$/;_e=new Map,un=new Map});var Bt=l(()=>{});var qu,Qe=l(()=>{j();Bt();qu=Object.freeze({1:"ethereum",10:"optimism",56:"bsc",137:"polygon",8453:"base",42161:"arbitrum",43114:"avalanche",999:"hyperevm",4663:"robinhood"})});var Te=l(()=>{});var be=l(()=>{});var X=l(()=>{Te();be()});var xa,Vu,F=l(()=>{xa=300*1e3,Vu=(()=>{let e=Number(process.env.ORACLE_PREPARE_HARD_MAX_AGE_MS);return Number.isFinite(e)&&e>0?e:1800*1e3})()});import{Interface as dn,getAddress as Ju,isAddress as Yu}from"ethers";var Ft,tl,rl,qt=l(()=>{Y();Qe();X();F();Ft={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"}},tl=new dn(["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)"]),rl=new dn(["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 va,Interface as Ut,getAddress as al,isAddress as sl,keccak256 as cl}from"ethers";var pl,Mt,ml,hl,wl,gl,yl,jt=l(()=>{Y();Qe();X();F();pl=va.defaultAbiCoder(),Mt={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"}},ml=new Ut(["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)"]),hl=new Ut(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),wl=new Ut(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96,int24 tick,uint24 protocolFee,uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),gl=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"]]),yl=(1n<<14n)-1n});var Wt=l(()=>{});import{Contract as Cl,JsonRpcProvider as Nl}from"ethers";var fn=l(()=>{});var $l,tt=l(()=>{fn();$l=Object.freeze({swap:5,bridge:5,perps:0,nft:0})});var mn=l(()=>{j();X();Wt();F();tt()});var hn=l(()=>{j();X();F();tt()});var rt=l(()=>{});var yn=l(()=>{j();X();rt();F()});var sd,bn=l(()=>{sd=Object.freeze({READ:"read",PREPARE:"prepare",EXECUTE:"execute",AUTONOMOUS:"autonomous"})});import{TypedDataEncoder as fd,getAddress as pd,isAddress as md}from"ethers";var Oa,xd,_a,Sd,Vt=l(()=>{j();X();bn();Wt();F();Oa=Object.freeze({1:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",100:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",42161:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",8453:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41"}),xd=Object.freeze({1:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",100:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",42161:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",8453:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110"}),_a=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"}]}),Sd=Object.freeze({OrderCancellations:[{name:"orderUids",type:"bytes[]"}]})});function Ne(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 Zt=l(()=>{});var Tn=l(()=>{});var Cn=l(()=>{});import{isAddress as jp}from"ethers";var er=l(()=>{X();Te();be()});import{Interface as Xa,isAddress as Gp}from"ethers";var Qp,Nn=l(()=>{er();Te();be();Qp=new Xa(["function approve(address spender,uint256 amount) returns (bool)"])});import{Interface as Qa,isAddress as tm}from"ethers";var im,am,Rn=l(()=>{er();Te();be();im=new Qa(["function approve(address spender,uint256 amount) returns (bool)"]),am=Object.freeze({42161:"0x1c3fa76e6e1088bce750f23a5bfcffa1efef6a41",43114:"0x8f550e53dfe96c055d5bdb267c21f268fcaf63b2"})});var ue=l(()=>{});import{Interface as Za,MaxUint256 as pm,isAddress as mm,keccak256 as hm,toUtf8Bytes as wm}from"ethers";var Sm,le=l(()=>{Cn();Nn();Rn();ue();be();Sm=new Za(["function approve(address spender,uint256 amount) returns (bool)"])});var at=l(()=>{le()});import{Address as Om,NETWORK as _m,OutScript as Tm,RawTx as Cm,SigHash as Nm,TEST_NETWORK as Rm,Transaction as Lm}from"@scure/btc-signer";var nr=l(()=>{});import{createHash as es}from"node:crypto";import{base58 as Dm}from"@scure/base";import{getCompiledTransactionMessageDecoder as qm}from"@solana/transaction-messages";var Ln,Um,or=l(()=>{Ln=e=>es("sha256").update(`global:${e}`).digest().subarray(0,8).toString("hex"),Um=new Map([[Ln("route"),{name:"route",prefixBytes:0}],[Ln("shared_accounts_route"),{name:"shared_accounts_route",prefixBytes:1}]])});var Pn=l(()=>{});var $n=l(()=>{j();Pn()});var Ym,Bn=l(()=>{$n();Ym=Object.freeze({tradexyz:"xyz",ventuals:"vntl",hypernova:"hyna",paradex:"para",entropy:"io",entropyio:"io"})});var th,rh,ar=l(()=>{ue();Bn();th=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"}),rh=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 ih,sr=l(()=>{ue();ih="0x"+"00".repeat(32)});var ts,lh,cr=l(()=>{sr();ue();ts=Object.freeze([["salt","uint256"],["maker","address"],["signer","address"],["tokenId","uint256"],["makerAmount","uint256"],["takerAmount","uint256"],["side","uint8"],["signatureType","uint8"],["timestamp","uint256"],["metadata","bytes32"],["builder","bytes32"]]),lh=Object.freeze(ts.map(e=>e[0]))});var st=l(()=>{ue()});import{TypedDataEncoder as hh,getAddress as wh,isAddress as gh}from"ethers";var rs,ns,Un=l(()=>{F();rs=Object.freeze({1:"0x111111125421cA6dc452d289314280a0f8842A65",8453:"0x111111125421cA6dc452d289314280a0f8842A65",42161:"0x111111125421cA6dc452d289314280a0f8842A65",10:"0x111111125421cA6dc452d289314280a0f8842A65",137:"0x111111125421cA6dc452d289314280a0f8842A65",56:"0x111111125421cA6dc452d289314280a0f8842A65"}),ns=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 xh,getAddress as Sh}from"ethers";var Ih,ur=l(()=>{Un();Vt();Ih=Object.freeze(["https://limit-orders.1inch.io","https://api.1inch.dev/orderbook"])});import{Interface as jn}from"ethers";var us,Mh,ls,jh,Hh,zh,Wh,ds,Vh,ct=l(()=>{le();X();F();at();nr();or();ar();cr();st();ur();us=new Set(["evm","evm-swap","evm-bridge","evm-nft","evm-order","btc","sol","hl","poly","lighter"]),Mh=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}),ls=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"}}),jh=Object.freeze({"0x161ac21f":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-public"},"0xc2f6663a":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-allowlist"}}),Hh=new jn(["function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),zh=new jn(["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"]),Wh=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"}}),ds=Object.freeze([...us]),Vh=Object.freeze({...ls})});import{encode as Jh}from"@msgpack/msgpack";import{keccak256 as Xh,verifyTypedData as Qh}from"ethers";var Zh,ew,lr=l(()=>{Zh=Object.freeze({name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"}),ew=Object.freeze({Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]})});var dr=l(()=>{st()});import{ed25519 as cw}from"@noble/curves/ed25519.js";import{base58 as lw}from"@scure/base";import{RawTx as fw,SigHash as pw,Transaction as mw}from"@scure/btc-signer";import{Transaction as ww,keccak256 as gw,verifyTypedData as yw}from"ethers";var fr=l(()=>{lr();dr()});import{base58 as Iw}from"@scure/base";var Le=l(()=>{ct();at();le();fr()});var Hn=l(()=>{Le();ct()});import{wordlists as ms}from"ethers";function ys(e){let t=String(e).trim().toLowerCase().split(/\s+/).filter(Boolean);return gs.has(t.length)&&t.every(r=>ms.en.getWordIndex(r)>=0)}function Ss(e){let t=zn(e);return xs.has(t)||Es.test(t)}function zn(e){return String(e).replace(/[^a-z0-9]/gi,"").toLowerCase()}function vs(e){let t=zn(e);return[...hs].some(r=>t.includes(r))}function As(e,t,r){if(typeof t=="string"){if(ws.some(n=>n.test(t))||ys(t))throw new Pe(r);if(bs.test(t)&&!Ss(e))throw new Pe(r)}}function mr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string")return As(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)=>mr(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(vs(o))throw new Pe(i);e[o]!==void 0&&(n[o]=mr(e[o],i,o))}return n}function ut(e){return mr(e)}var hs,ws,gs,bs,Es,xs,Pe,$e=l(()=>{hs=new Set(["privatekey","privkey","secretkey","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","wif","xprv","xpriv","bearer","authorization","signature","apikey","credential"]),ws=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/],gs=new Set([12,15,18,21,24]);bs=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/,Es=/(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i,xs=new Set(["calldata","data","publickey","pubkey","message","payload","input","extradata"]);Pe=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 Uw,constants as Is,fchmodSync as Mw,fsyncSync as jw,lstatSync as Hw,mkdirSync as zw,openSync as Ww,readFileSync as Vw,renameSync as Kw,rmSync as Gw,writeFileSync as Jw}from"node:fs";var Qw,Wn=l(()=>{$e();Le();Qw=Is.O_NOFOLLOW??0});import{wordlists as tg}from"ethers";var Vn,ng,xe=l(()=>{$e();Vn=64*1024,ng=32*1024});var _s,ag,sg,dt=l(()=>{xe();_s=["schemaVersion","buildVersion","recordType","execution","custody"],ag=[..._s,"recordHash"],sg=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 Ts,to,fg,br=l(()=>{xe();dt();Ts=Object.freeze(["draft","checked","approval","signed","submitted","finalized","reorged","orphaned","compensating","compensated","failed","cancelled"]),to=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"]),fg=new Set(to)});var $s,ro=l(()=>{xe();br();$s=64*1024*1024});var bg,Eg,xg,no=l(()=>{bg=Object.freeze(["chainId","agentAddress","accountAddress","actions","targets","maxValueWei","maxGasWei","maxSlippageBps","expiresAt","nonce","revocationKey"]),Eg=Object.freeze(["read","simulate"]),xg=1440*60});function Er(e){let t=String(e),r=t.toLowerCase().replace(/[\s._-]+/g,"");return Bs.test(t)||Ds.includes(r)}function Fs(e){return e.replace(/"([A-Za-z0-9_-]+)"\s*:\s*"(?:0x)?([0-9a-fA-F]{64})"/g,(t,r)=>io.includes(String(r).toLowerCase().replace(/[_-]/g,""))?`"${r}":"<hex64>"`:t)}function ao(e){let t;try{t=JSON.stringify(e)}catch(o){throw new te("$",`unserializable-payload: ${String(o?.message||o)}`)}if(t===void 0)return"null";let r=Fs(t);for(let{rule:o,re:i}of oo)if(i.test(r))throw new te("$<serialized>",o);if(/(?:^|[^0-9a-fA-Fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/.test(r))throw new te("$<serialized>","raw-32-byte-hex-embedded");return JSON.parse(t,(o,i)=>{if(o&&Er(o))throw new te(`$<serialized>.${o}`,"forbidden-key-name");return i}),t}function oe(e,t="$",r=new Set,n=""){if(e==null)return e;if(typeof e=="string"){let o=io.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 te(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"&&Er(o))throw new te(`${t}[${JSON.stringify(o)}]`,"forbidden-key-name");oe(o,`${t}[key]`,r),oe(i,`${t}[${String(o)}]`,r)}return e}if(e instanceof Set){let o=0;for(let i of e.values())oe(i,`${t}[${o++}]`,r);return e}if(Array.isArray(e))return e.forEach((o,i)=>oe(o,`${t}[${i}]`,r)),e;for(let[o,i]of Object.entries(e)){if(Er(o))throw new te(`${t}.${o}`,"forbidden-key-name");oe(i,`${t}.${o}`,r,o)}return e}var te,Bs,Ds,oo,io,xr=l(()=>{no();te=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}},Bs=/(private[_-]?key|secret|bearer|keystore|mnemonic|seed[_-]?phrase|passphrase|password|api[_-]?key|access[_-]?token|auth[_-]?token|session[_-]?token|signer[_-]?url|signature)/i,Ds=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}]),io=Object.freeze(["grantid","id","hash","sha256","sha256hex","checksum","txhash","transactionhash","blockhash","digest","userophash","commithash","prevhash","intenthash","canonicalhash","payloadhash","requestid"])});var Sr,Rg,so=l(()=>{xr();Sr=Object.freeze(["intent","quote_comparison","simulation","prepared","approval","signed","broadcast","settlement","balance_delta","position"]),Rg=Object.freeze(Object.fromEntries(Sr.map((e,t)=>[e,Object.freeze(t+1<Sr.length?[Sr[t+1]]:[])])))});var qs,co=l(()=>{so();xe();dt();qs=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 uo=l(()=>{xe();dt();br();ro();co()});var Ms,js,Hs,wy,gy,yy,by,Ey,zs,xy,lo=l(()=>{Ms=Object.freeze(["owner","operator","agent","viewer"]),js=Object.freeze(["tenant","config","policy","grant","workflow","trade","receipt","audit","telemetry","context","lifecycle"]),Hs=Object.freeze({read:"read",create:"create",update:"update",delete:"delete",manage:"manage",prepare:"prepare",cancel:"cancel",export:"export",approve:"approve"}),wy=Object.freeze(["owner"]),gy=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"}),yy=new Set(Ms),by=new Set(js),Ey=new Set(Object.values(Hs)),zs=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"])}),xy=Object.freeze(Object.fromEntries(Object.entries(zs).map(([e,t])=>[e,Object.freeze([...t])])))});var Ws,Vs,Ks,Iy,ky,Oy,_y,Ty,Cy,vr=l(()=>{lo();Ws=Object.freeze(["succeeded","denied","invalid","failed","cancelled","timed_out","unavailable","skipped"]),Vs=Object.freeze(["workflow","task","intent","plan","run","event","eval"]),Ks=Object.freeze(["taskId","intentId","planId","runId","eventId"]),Iy=Object.freeze({maxAttributes:24,maxKeyLength:48,maxStringLength:256,maxArrayLength:8}),ky=new Set(Ws),Oy=new Set(Vs),_y=new Set(Ks),Ty=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"]),Cy=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 By,fo=l(()=>{uo();vr();By=Object.freeze({"workflow.cancelled":"cancelled","workflow.failed":"failed"})});var jy,po=l(()=>{vr();jy=32*1024*1024});var zy,Wy,Vy,Se=l(()=>{zy=Object.freeze({N:1<<17,r:8,p:1}),Wy=256*1024*1024,Vy=16*1024});var Gy,mo=l(()=>{Gy=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 Ar}from"node:os";import{join as Ir}from"node:path";var ho,Gs,Qy,wo=l(()=>{ho=process.env.ORACLE_PUBLIC_DESKTOP==="1",Gs=ho?process.env.ORACLE_CONFIG_DIR||Ir(Ar(),".config","oracle"):Ir(Ar(),".config","oracle"),Qy=ho?Gs:Ir(Ar(),".config","mad-desk")});var n0,o0,i0,go=l(()=>{wo();n0="0".repeat(64),o0=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"}),i0=Promise.resolve()});var kr=l(()=>{go();ue();Se();Le()});var bo=l(()=>{});var So={};We(So,{SIGN_TIME_REVIEW_VERSION:()=>Js,SignTimeReviewSecretError:()=>Be,createSignTimeReview:()=>xo});function Or(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string"){let o=e.trim().split(/\s+/);if(ec.test(e)||tc.has(o.length)&&o.every(i=>/^[a-z]+$/i.test(i)))throw new Be(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)=>Or(o,`${t}[${i}]`,r));de(e,t);let n={};for(let o of Object.keys(e).sort()){let i=o.replace(/[^a-z0-9]/gi,"");if(Zs.test(i))throw new Be(`${t}.${o}`);e[o]!==void 0&&(n[o]=Or(e[o],`${t}.${o}`,o))}return n}function de(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 De(e,t){if(e==null||e==="")throw new TypeError(`sign-time review: ${t} required`);return e}function ve(e,t){let r=String(De(e,t)).toLowerCase();if(!Ys.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(De(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 _r(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 Eo(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))Eo(t);Object.freeze(e)}return e}function rc(e,t){if(typeof e=="boolean")return{passed:e,reason:e?"passed":"failed"};de(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:_r(String(n),`${t}.reason`)}}function nc(e){if(!Array.isArray(e))throw new TypeError("sign-time review: policyChecks must be an array");let t=e.map((n,o)=>rc(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 oc(e){if(e==null)return null;if(de(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:_r(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 ic(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)=>{de(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:_r(String(De(t.asset??t.token,`assetDeltas[${r}].asset`)),`assetDeltas[${r}].asset`),before:n,after:o,delta:s}})}function ac(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)=>{de(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:ve(t.token,`approvalDeltas[${r}].token`),spender:ve(t.spender,`approvalDeltas[${r}].spender`),owner:ve(t.owner,`approvalDeltas[${r}].owner`),amount:n,revokeLike:t.revokeLike??BigInt(n)===0n}})}function xo(e={}){de(e,"input");let t=Or(e),r=t.tx==null?t:de(t.tx,"tx"),n=re(t.chainId??r.chainId,"chainId",{positive:!0}),o=ve(t.account??t.from??r.from,"account/from"),i=ve(t.destination??t.to??r.to,"destination/to"),s=String(De(t.prepareHash,"prepareHash")).toLowerCase();if(!Qs.test(s))throw new TypeError("sign-time review: prepareHash must be a 32-byte hash");let f=t.route??t.venue;if(f==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 p=String(De(t.calldata??t.data??r.data,"calldata/data")).toLowerCase();if(!Xs.test(p))throw new TypeError("sign-time review: calldata/data must be even-length hex");let u=t.policyChecks!==void 0&&t.policyChecks!==null,d=nc(u?t.policyChecks:[]),h=oc(t.simulation),m=ic(t.assetDeltas),w=ac(t.approvalDeltas),g=t.allowlistHits??[];if(!Array.isArray(g))throw new TypeError("sign-time review: allowlistHits must be an array");let E=h?.willRevert===!0||["failed","error"].includes(h?.status),A=h!=null&&h.willRevert===!1&&["ok","success"].includes(h.status),P=E||d.failed>0?"BLOCKED":A&&u&&d.checks.length>0&&m!=null?"READY":"UNKNOWN",y=typeof c=="string"?c:c.method??c.action??c.type??"transaction",x=`${P}: review ${y} on chain ${n}; policy ${d.passed} passed, ${d.failed} failed; ${m?.length??0} asset delta${m?.length===1?"":"s"}; local signature required`,_={reviewVersion:1,status:P,requiresLocalSignature:!0,signingLocal:!0,custody:"none",execution:"review-only",chainId:n,account:o,from:o,route:f,venue:t.venue??(typeof f=="string"?f:f.venue??f.provider??null),destination:i,to:i,...t.spender==null?{}:{spender:ve(t.spender,"spender")},prepareHash:s,...t.decodedCalldata!==void 0?{decodedCalldata:t.decodedCalldata}:{decodedAction:t.decodedAction},calldata:p,data:p,selector:p.length>=10?p.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:h,policyChecks:d,allowlistHits:g,assetDeltas:m,approvalDeltas:w,summary:x};return Eo(_)}var Js,Ys,Xs,Qs,Zs,ec,tc,Be,Tr=l(()=>{Js=1,Ys=/^0x[0-9a-f]{40}$/,Xs=/^0x(?:[0-9a-f]{2})*$/,Qs=/^(?:0x)?[0-9a-f]{64}$/,Zs=/(privatekey|privkey|secretkey|seedphrase|mnemonic|passphrase|password|keystore|keymaterial|wif|xprv|xpriv|bearer|authorization|signature|apikey|credential)/i,ec=/\b(?:[5KL][1-9A-HJ-NP-Za-km-z]{50,51}|xprv[0-9A-Za-z]{50,})\b/,tc=new Set([12,15,18,21,24]),Be=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 h0,readdirSync as w0,existsSync as sc}from"node:fs";import{dirname as cc,join as Fe}from"node:path";import{fileURLToPath as uc}from"node:url";function lc(){let e=[Fe(qe,"descriptors"),Fe(qe,"clear-sign","descriptors"),Fe(qe,"..","clear-sign","descriptors"),Fe(qe,"..","..","clear-sign","descriptors"),Fe(qe,"..","..","..","clear-sign","descriptors")];for(let t of e)if(sc(t))return t;return e[0]}var qe,E0,x0,vo=l(()=>{le();qe=cc(uc(import.meta.url));E0=lc(),x0=(1n<<256n)-1n});var Ao=l(()=>{Tr();le();vo()});import{Wallet as T0}from"ethers";import{base58 as N0}from"@scure/base";import{ed25519 as L0}from"@noble/curves/ed25519.js";import{NETWORK as $0,TEST_NETWORK as B0,WIF as D0,p2wpkh as F0}from"@scure/btc-signer";import{pubECDSA as U0}from"@scure/btc-signer/utils.js";var Io=l(()=>{});var H0,z0,W0,V0,K0,G0,J0,Y0,X0,Q0,Z0,ko=l(()=>{kr();H0=Object.freeze(["spot-limit-create","spot-limit-cancel","spot-order-status"]),z0=Object.freeze(["binance","bybit","okx","coinbase"]),W0=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"}),V0=Object.freeze({binance:"/api/v3",bybit:"/v5/order",okx:"/api/v5/trade",coinbase:"/orders"}),K0=Object.freeze(["version","surface","kind","venue","credentialRef","symbol","base","quote","side","baseSize","limitPrice","maxQuoteNotional","timeInForce","clientOrderId","expiresAtMs","venueOrderId","nonce","grantId","artifactHash"]),G0=Object.freeze(["market-create","withdraw","transfer","subaccount","leverage","futures","margin","convert","api-key"]),J0=Object.freeze(["url","host","path","method","headers","signature","apiKey","apiSecret","passphrase","privateKey","redirect","proxy"]),Y0=Object.freeze(["ccxt","binance-api-node","node-binance-api","coinbase-advanced-node","@okx-dex/okx-dex-sdk","bybit-api"]),X0=Object.freeze({perOrderQuote:"sealed-owner-policy",dailyGrossQuote:"sealed-owner-policy",scope:Object.freeze(["per-order","UTC-day","account","venue","quote"]),envelopeFieldIsNotCeiling:!0}),Q0=Object.freeze({binanceRecvWindowMs:5e3,bybitWindowMs:5e3,maxLocalSkewMs:2e3}),Z0=Object.freeze({perSecond:1,perMinute:30,bind:"tighter"})});var Oo=l(()=>{Se()});var pc,_o,pt=l(()=>{pc=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}"]})}),_o=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"})});var To=l(()=>{pt()});var ub,Co=l(()=>{pt();To();ub=256*1024});var No=l(()=>{pt();Co()});var Ro=l(()=>{Se()});import B from"node:path";import mc from"node:os";import{createHash as hc,randomBytes as nE}from"node:crypto";import{Interface as Cr,keccak256 as iE}from"ethers";import{Transaction as sE}from"@scure/btc-signer";import{ed25519 as uE}from"@noble/curves/ed25519.js";function Lo(e){let t=process.env.ORACLE_SIGNER_STATE_DIR||B.join(process.env.XDG_STATE_HOME||B.join(mc.homedir(),".local","state"),"oracle"),r=hc("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 UE,ME,jE,Po=l(()=>{Hn();Wn();fo();po();Le();Se();mo();kr();bo();le();Ao();ct();at();fr();ar();cr();st();dr();sr();lr();nr();or();ur();Io();ko();Oo();No();Ro();UE=new Cr(["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"]),ME=new Cr(["function decimals() view returns (uint8)","function allowance(address owner,address spender) view returns (uint256)"]),jE=new Cr(["function ownerOf(uint256 tokenId) view returns (address)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner,address operator) view returns (bool)"])});import Nr from"node:fs";import $o from"node:path";import{homedir as wc}from"node:os";function gc(){return process.env.ORACLE_CONFIG_DIR||$o.join(wc(),".config","oracle")}function Ue(){let e=Lo($o.join(gc(),"signer")),t=Nr.existsSync(e.vault),r=Nr.existsSync(e.lock),n=t?r?"disarmed":"armed-owner-confirmed":"inert-no-key";return{vaultExists:t,policyConfigured:Nr.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 ZE,Rr=l(()=>{Zt();Tn();Po();Se();ZE=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 mt(e){return String(e||"").trim()||void 0}function bc(e,{required:t=!1}={}){let r=mt(e)?.toLowerCase();if(!r){if(t)throw new Error("model provider is required");return}if(!yc.has(r))throw new Error(`unsupported provider: ${r}`);return r}function Ec(e,{required:t=!1}={}){let r=mt(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 xc(e){let t=mt(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 Bo({provider:e,model:t,baseUrl:r}={},{requireModel:n=!1}={}){let o=bc(e),i=Ec(t,{required:n});if(o==="custom")return{provider:o,...i?{model:i}:{},baseUrl:xc(r)};if(mt(r))throw new Error("baseUrl is only supported for the custom provider");return{...o?{provider:o}:{},...i?{model:i}:{}}}var yc,Do=l(()=>{yc=new Set(["openrouter","openai","anthropic","xai","deepseek","gemini","kimi","mistral","nous","qwen","glm","local","ollama","custom","anthropic-oauth","openai-codex","xai-oauth"])});import Fo from"node:fs";import Sc from"node:path";function Ac(){return Sc.join(we(),"model.json")}function Ae(e){return String(e||"").trim()||void 0}function Ic(e={}){let t=Ae(e.backend)?.toLowerCase()||"auto",r=Bo({provider:e.provider,model:e.model,baseUrl:e.baseUrl},{requireModel:t==="standalone"}),n=Ae(e.apiKeyEnv),o=Number.parseInt(String(e.contextLength||""),10),i=Ae(e.reasoningEffort),s=Ae(e.computeHost||e.remoteHost),f=Ae(e.computeUser||e.remoteUser),c=Ae(e.computePath||e.remotePath);if(!vc.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"&&!s)throw new Error("remote backend requires computeHost");return{backend:t,...r,...n?{apiKeyEnv:n}:{},...Number.isFinite(o)&&o>0?{contextLength:o}:{},...i?{reasoningEffort:i}:{},...s?{computeHost:s}:{},...f?{computeUser:f}:{},...c?{computePath:c}:{}}}function qo(){let e=Ac();if(!Fo.existsSync(e))return null;try{return Ic(JSON.parse(Fo.readFileSync(e,"utf8")))}catch{return null}}var vc,Uo=l(()=>{Ke();Do();vc=new Set(["auto","standalone","hermes","remote","arch"])});function Lr(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 Pr(e,t="control input"){try{oe(e,t),ao(e)}catch(r){throw new TypeError(`${t} contains secret or custody material: ${r.message}`)}return e}function Me(e,{required:t=[],optional:r=[]}={},n="object"){Lr(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 $r(e,t,r=200,{lower:n=!1}={}){if(typeof e!="string"||!e.trim()||e.length>r||kc.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 je(e,t,r=80){let n=$r(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 ht(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 kc,Br=l(()=>{$e();xr();kc=/[\u0000-\u001f\u007f]/});function Mo({family:e,chainId:t},r="chain"){let n=je(e,`${r}.family`,40),o;if(n==="evm"){if(typeof t=="number")o=String(ht(t,`${r}.chainId`,{positive:!0}));else if(o=$r(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=je(t,`${r}.chainId`,80);return{family:n,chainId:o}}function Tc(e,t="chain"){return Me(e,{required:["family","chainId"]},t),H(Mo(e,t))}function jo(e,t="finality rule"){Pr(e,t),Lr(e,t);let r=e.rule;if(!Oc.includes(r))throw new TypeError(`${t}.rule must be confirmations, finalizedTag, or checkpoint`);let n=r==="confirmations"?"confirmations":r;Me(e,{required:["family","chainId","rule",n]},t);let o=Mo(e,t);return r==="confirmations"?{...o,rule:r,confirmations:ht(e.confirmations,`${t}.confirmations`,{positive:!0})}:{...o,rule:r,[n]:je(e[n],`${t}.${n}`,80)}}function Dr(e){if(!Array.isArray(e))throw new TypeError("finality policy rules must be an array");let t=e.map((n,o)=>jo(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 Cc(e){if(Me(e,{required:["policyVersion","rules"]},"finality policy"),e.policyVersion!==1||!Array.isArray(e.rules))throw new TypeError("unsupported finality policy");return Dr(e.rules)}function Ho(e,t){let r=Tc(t,"finality query"),o=Cc(e).rules.find(i=>i.family===r.family&&i.chainId===r.chainId);return o?H({status:"KNOWN",...r,rule:o}):H({status:fe.UNKNOWN,reason:"MISSING_FINALITY_RULE",...r,rule:null})}function Nc(e,t){if(e==null)return null;Pr(e,"finality evidence");let r=t.rule==="confirmations"?"confirmations":t.rule;if(Me(e,{required:["status"],optional:[r]},"finality evidence"),!_c.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"?ht(e.confirmations,"finality evidence.confirmations",{positive:!0}):je(e[r],`finality evidence.${r}`,80)),n}function zo(e,t){if(!e||e.status===fe.UNKNOWN||e.rule==null)return H({status:fe.UNKNOWN,final:!1,reason:"MISSING_FINALITY_RULE"});let r=jo(e.rule??e,"resolved finality rule"),n=Nc(t,r);if(n==null)return H({status:fe.UNKNOWN,final:!1,reason:"MISSING_FINALITY_EVIDENCE"});if(n.status!=="LIVE")return H({status:fe.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?fe.FINAL:fe.INCLUDED,final:o,reason:o?"PINNED_RULE_SATISFIED":"PINNED_RULE_NOT_SATISFIED",rule:r})}var Oc,fe,_c,Wo=l(()=>{Br();Oc=Object.freeze(["confirmations","finalizedTag","checkpoint"]),fe=Object.freeze({UNKNOWN:"UNKNOWN",INCLUDED:"INCLUDED",FINAL:"FINAL"}),_c=Object.freeze(["LIVE","STALE","UNKNOWN","UNAVAILABLE"])});function Lc(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 Vo(e){return typeof e=="string"&&["FAIL","FAILED","FAILURE","ORPHAN","ORPHANED","REVERTED"].includes(e.trim().toUpperCase())}function qr(e){return e==null?e:Array.isArray(e)?e.map(qr):He(e)?Object.fromEntries(Object.keys(e).sort().map(t=>[t,qr(e[t])])):String(e)}function Pc(e,t,r,n){let o=k(e.finalityEvidence,n?.finality,e.evidence),i=k(e.finalityPolicy,e.policy);try{return i==null&&He(e.finalityRule)&&(i=Dr([{family:t,chainId:r,...e.finalityRule}])),i==null||t==null||r==null?{status:"UNKNOWN",final:!1,reason:"MISSING_FINALITY_RULE"}:zo(Ho(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 $c(e){return e==null?null:String(e).trim().toLowerCase()}function Fr(...e){let t=e.map($c).filter(Boolean);return t.length<=1||t.every(r=>r===t[0])}function Ko(e={}){if(!He(e))throw new TypeError("verified receipt: input object required");let t=ut(e),r=k(t.actionReceipt,t.receipt),n=He(r)?r:t,o=k(t.observation,t.chainObservation,t.observedReceipt),i=He(o),s=k(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash),f=k(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family),c=k(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),p=!Fr(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash)||!Fr(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family)||!Fr(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),u=Pc(t,f,c,i&&!p?o:null),d=Lc(k(o?.receiptStatus,o?.executionStatus,o?.status)),h=k(t.reconciliationStatus,t.reconciliation?.status,o?.reconciliationStatus),m=k(t.finalityState,t.finalityEvidence?.status,t.evidence?.status,o?.finalityState),w="UNKNOWN";Vo(h)||!p&&(i&&d==="FAIL"||Vo(m))?w="FAIL":!p&&s&&i&&d==="SUCCESS"&&["INCLUDED","FINAL"].includes(u.status)&&(w="SUCCESS");let g={verifiedReceiptVersion:Rc,status:w};p&&(g.reason="REFERENCE_MISMATCH"),D(g,"txHash",s),D(g,"chain",k(t.chain,n.chain,o?.chain)),D(g,"family",f),D(g,"chainId",c),D(g,"block",k(o?.block,t.block)),D(g,"blockState",k(o?.blockState,o?.inclusionState)),g.finalityState=u.status,D(g,"confirmations",k(o?.confirmations,o?.finality?.confirmations,t.finalityEvidence?.confirmations,t.evidence?.confirmations)),D(g,"observedAt",k(o?.observedAt,t.observedAt)),D(g,"route",k(t.route,n.route)),D(g,"prepareHash",k(t.prepareHash,n.prepareHash)),D(g,"policyOutcome",k(t.policyOutcome,n.policyOutcome,n.policyChecks));let E=k(t.balanceChanges,o?.balanceChanges,o?.balances,n.balanceChanges,n.balances);return E!=null&&(g.balanceChanges=qr(E)),D(g,"createdAt",k(t.createdAt,n.createdAt)),D(g,"submittedAt",k(t.submittedAt,n.submittedAt)),D(g,"finalizedAt",k(t.finalizedAt,o?.finalizedAt)),D(g,"timestamps",k(t.timestamps,n.timestamps,o?.timestamps)),H(g)}var Rc,wx,k,He,Go=l(()=>{$e();Wo();Br();Rc=1,wx=Object.freeze(["SUCCESS","FAIL","UNKNOWN"]),k=(...e)=>e.find(t=>t!=null),He=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype});var Yo={};We(Yo,{observeEvmReceipt:()=>Jo,verifyEvmReceipt:()=>Fc});function Dc(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 Jo({txHash:e,chainId:t,rpcUrl:r},n={}){let o=String(e||"").trim().toLowerCase();if(!Bc.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||ln,f=n.rpcCall||J,c={...n.rpcOptions||{},...r?{rpcUrl:r}:{}},p;try{p=await s({txHash:o,chainId:i},c)}catch(m){return{observation:null,reason:`RPC_UNAVAILABLE: ${m.message}`}}if(!p||p.receipt==null)return{observation:null,reason:p?.reason||"receipt pending"};let u=null,d=p.blockNumber;if(Number.isSafeInteger(d))try{let m=Dc(await f(i,"eth_blockNumber",[],c));m!=null&&m>=d&&(u=m-d+1)}catch{}let h={txHash:o,family:"evm",chainId:String(i),receiptStatus:p.status==="success"?"SUCCESS":p.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 Fc({txHash:e,chainId:t,confirmations:r=1,rpcUrl:n},o={}){let{observation:i,reason:s}=await Jo({txHash:e,chainId:t,rpcUrl:n},o),f=Ko({txHash:String(e).trim().toLowerCase(),family:"evm",chainId:String(Number(t)),finalityRule:{rule:"confirmations",confirmations:r},...i?{observation:i}:{}});return{receipt:f,observed:!!i,final:f.finalityState==="FINAL",requiredConfirmations:r,reason:s}}var Bc,Xo=l(()=>{Y();Go();Bc=/^0x[0-9a-f]{64}$/});var Qo={};We(Qo,{classifyReceipt:()=>Ne,configDir:()=>jc,firstHourReport:()=>Ur,probeReceiptModule:()=>zc,probeReviewModule:()=>Hc,venueMap:()=>wt});import qc from"node:path";import{homedir as Uc}from"node:os";function jc(e=process.env){return e.ORACLE_CONFIG_DIR||qc.join(Uc(),".config","oracle")}function wt({env:e=process.env,vault:t=null}={}){let r=t||Ue(),n=[];for(let[o,i]of Object.entries(Xe)){let s=(i.rpcEnv||[]).some(c=>String(e[c]||"").trim()),f="prepare";i.evm?s&&(f="live"):f="unavailable",n.push({key:o,chainId:i.chainId,name:i.name,family:"evm",status:f,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 Ur({env:e=process.env,model:t=qo(),vault:r=Ue(),signerReachable:n=!1,quote:o=null,reviewAvailable:i=!1,receiptAvailable:s=!1}={}){let f=[],c=(m,w,g,E=null)=>f.push({id:m,status:w,detail:g,fix:E}),p=(()=>{let[m,w]=process.versions.node.split(".").map(Number);return m>20||m===20&&w>=19})();c("node",p?"ok":"fail",`node ${process.versions.node}`,p?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(Mc.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=f.some(m=>m.status==="fail"),h=f.filter(m=>m.status==="ok").length;return{ok:!d,checks:f,firstRunScore:{ok:h,total:f.length,label:`${h}/${f.length} first-run hops green`},venues:wt({env:e,vault:r})}}async function Hc(){try{return typeof(await Promise.resolve().then(()=>(Tr(),So))).createSignTimeReview=="function"}catch{return!1}}async function zc(){try{let e=await Promise.resolve().then(()=>(Xo(),Yo));return typeof e.observeReceipt=="function"||typeof e.default=="function"||Object.values(e).some(t=>typeof t=="function")}catch{return!1}}var Mc,Mr=l(()=>{Lt();Rr();Uo();Zt();Mc=new Set(["127.0.0.1","::1","localhost"])});var ei={};We(ei,{classifyReceipt:()=>Ne,default:()=>Kc,detailText:()=>Zo,firstHourReport:()=>Ur,probeQuote:()=>Vc,probeSigner:()=>Wc,symbol:()=>ze,vaultStatus:()=>Ue});async function Wc(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 ze(e){let t=String(e??"?").replace(/[^\w.$-]/g,"");return t.length>12?`${t.slice(0,12)}...`:t||"?"}function Zo(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 Vc(){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:`${ze(r.chainId)} ${ze(r.baseToken?.symbol)}/${ze(r.quoteToken?.symbol)} $${ze(r.priceUsd)}`}}catch(e){return{ok:!1,detail:Zo(e instanceof Error?e.message:"quote failed")}}}var Kc,ti=l(()=>{Mr();Rr();Kc={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=wt();if(t)return process.stdout.write(`${JSON.stringify({venues:r},null,2)}
4
+ ${JSON.stringify(r??[])}`}async function ka(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=xa(o),s=Ea(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=gn.get(s);if(u!=null)return u}let c=n.dedupe!==!1&&!n.signal?Ia(s,o,r):null;if(c&&Ne.has(c))return Ne.get(c);let f=(async()=>{let u=await ka(s,{jsonrpc:"2.0",id:1,method:t,params:r},n),d=Aa(u);return i==="eth_chainid"&&typeof d=="string"&&gn.set(s,d),d})();return c&&(Ne.set(c,f),f.finally(()=>{Ne.get(c)===f&&Ne.delete(c)}).catch(()=>{})),f}async function yn(e={},t={}){let r=Number(e.chainId??t.chainId??1),n=ya(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=Ft(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?Dt(e.expectedTo,"expectedTo"):null,u=o.to?Dt(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?Dt(o.from,"receipt.from"):null,blockNumber:Ft(o.blockNumber),transactionIndex:Ft(o.transactionIndex),logs:Array.isArray(o.logs)?o.logs:[],receipt:o}}var zu,ba,Sa,Ne,gn,Y=l(()=>{j();Bt();zu=new wa(["function allowance(address owner,address spender) view returns (uint256)","function balanceOf(address account) view returns (uint256)"]);ba={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"};Sa=/^(?: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,gn=new Map});var qt=l(()=>{});var Ju,tt=l(()=>{j();qt();Ju=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 _a,rl,F=l(()=>{_a=300*1e3,rl=(()=>{let e=Number(process.env.ORACLE_PREPARE_HARD_MAX_AGE_MS);return Number.isFinite(e)&&e>0?e:1800*1e3})()});import{Interface as bn,getAddress as il,isAddress as al}from"ethers";var Mt,dl,fl,jt=l(()=>{Y();tt();X();F();Mt={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"}},dl=new bn(["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)"]),fl=new bn(["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 Ca,Interface as Ht,getAddress as wl,isAddress as gl,keccak256 as yl}from"ethers";var vl,zt,Al,Il,kl,Ol,_l,Wt=l(()=>{Y();tt();X();F();vl=Ca.defaultAbiCoder(),zt={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"}},Al=new Ht(["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)"]),Il=new Ht(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),kl=new Ht(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96,int24 tick,uint24 protocolFee,uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Ol=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"]]),_l=(1n<<14n)-1n});var Gt=l(()=>{});import{Contract as Ul,JsonRpcProvider as Ml}from"ethers";var En=l(()=>{});var Wl,ot=l(()=>{En();Wl=Object.freeze({swap:5,bridge:5,perps:0,nft:0})});var xn=l(()=>{j();X();Gt();F();ot()});var vn=l(()=>{j();X();F();ot()});var it=l(()=>{});var kn=l(()=>{j();X();it();F()});var gd,On=l(()=>{gd=Object.freeze({READ:"read",PREPARE:"prepare",EXECUTE:"execute",AUTONOMOUS:"autonomous"})});import{TypedDataEncoder as xd,getAddress as vd,isAddress as Ad}from"ethers";var Pa,Nd,$a,Rd,Jt=l(()=>{j();X();On();Gt();F();Pa=Object.freeze({1:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",100:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",42161:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",8453:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41"}),Nd=Object.freeze({1:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",100:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",42161:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",8453:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110"}),$a=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"}]}),Rd=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 rr=l(()=>{});var Dn=l(()=>{});var Fn=l(()=>{});import{isAddress as Qp}from"ethers";var nr=l(()=>{X();Re();Ee()});import{Interface as os,isAddress as om}from"ethers";var cm,qn=l(()=>{nr();Re();Ee();cm=new os(["function approve(address spender,uint256 amount) returns (bool)"])});import{Interface as is,isAddress as dm}from"ethers";var hm,wm,Un=l(()=>{nr();Re();Ee();hm=new is(["function approve(address spender,uint256 amount) returns (bool)"]),wm=Object.freeze({42161:"0x1c3fa76e6e1088bce750f23a5bfcffa1efef6a41",43114:"0x8f550e53dfe96c055d5bdb267c21f268fcaf63b2"})});var de=l(()=>{});import{Interface as as,MaxUint256 as vm,isAddress as Am,keccak256 as Im,toUtf8Bytes as km}from"ethers";var Rm,fe=l(()=>{Fn();qn();Un();de();Ee();Rm=new as(["function approve(address spender,uint256 amount) returns (bool)"])});var ut=l(()=>{fe()});import{Address as Dm,NETWORK as Fm,OutScript as qm,RawTx as Um,SigHash as Mm,TEST_NETWORK as jm,Transaction as Hm}from"@scure/btc-signer";var ar=l(()=>{});import{createHash as ss}from"node:crypto";import{base58 as Km}from"@scure/base";import{getCompiledTransactionMessageDecoder as Jm}from"@solana/transaction-messages";var Mn,Ym,sr=l(()=>{Mn=e=>ss("sha256").update(`global:${e}`).digest().subarray(0,8).toString("hex"),Ym=new Map([[Mn("route"),{name:"route",prefixBytes:0}],[Mn("shared_accounts_route"),{name:"shared_accounts_route",prefixBytes:1}]])});var jn=l(()=>{});var Hn=l(()=>{j();jn()});var ah,zn=l(()=>{Hn();ah=Object.freeze({tradexyz:"xyz",ventuals:"vntl",hypernova:"hyna",paradex:"para",entropy:"io",entropyio:"io"})});var dh,fh,ur=l(()=>{de();zn();dh=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"}),fh=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 hh,lr=l(()=>{de();hh="0x"+"00".repeat(32)});var cs,Eh,dr=l(()=>{lr();de();cs=Object.freeze([["salt","uint256"],["maker","address"],["signer","address"],["tokenId","uint256"],["makerAmount","uint256"],["takerAmount","uint256"],["side","uint8"],["signatureType","uint8"],["timestamp","uint256"],["metadata","bytes32"],["builder","bytes32"]]),Eh=Object.freeze(cs.map(e=>e[0]))});var lt=l(()=>{de()});import{TypedDataEncoder as Ih,getAddress as kh,isAddress as Oh}from"ethers";var us,ls,Gn=l(()=>{F();us=Object.freeze({1:"0x111111125421cA6dc452d289314280a0f8842A65",8453:"0x111111125421cA6dc452d289314280a0f8842A65",42161:"0x111111125421cA6dc452d289314280a0f8842A65",10:"0x111111125421cA6dc452d289314280a0f8842A65",137:"0x111111125421cA6dc452d289314280a0f8842A65",56:"0x111111125421cA6dc452d289314280a0f8842A65"}),ls=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 Nh,getAddress as Rh}from"ethers";var $h,fr=l(()=>{Gn();Jt();$h=Object.freeze(["https://limit-orders.1inch.io","https://api.1inch.dev/orderbook"])});import{Interface as Yn}from"ethers";var ws,Xh,gs,Qh,Zh,ew,tw,ys,rw,dt=l(()=>{fe();X();F();ut();ar();sr();ur();dr();lt();fr();ws=new Set(["evm","evm-swap","evm-bridge","evm-nft","evm-order","btc","sol","hl","poly","lighter"]),Xh=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}),gs=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"}}),Qh=Object.freeze({"0x161ac21f":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-public"},"0xc2f6663a":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-allowlist"}}),Zh=new Yn(["function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),ew=new Yn(["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"]),tw=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"}}),ys=Object.freeze([...ws]),rw=Object.freeze({...gs})});import{encode as iw}from"@msgpack/msgpack";import{keccak256 as sw,verifyTypedData as cw}from"ethers";var uw,lw,pr=l(()=>{uw=Object.freeze({name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"}),lw=Object.freeze({Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]})});var mr=l(()=>{lt()});import{ed25519 as yw}from"@noble/curves/ed25519.js";import{base58 as Ew}from"@scure/base";import{RawTx as xw,SigHash as vw,Transaction as Aw}from"@scure/btc-signer";import{Transaction as kw,keccak256 as Ow,verifyTypedData as _w}from"ethers";var hr=l(()=>{pr();mr()});import{base58 as $w}from"@scure/base";var Be=l(()=>{dt();ut();fe();hr()});var Xn=l(()=>{Be();dt()});import{wordlists as Ss}from"ethers";function Is(e){let t=String(e).trim().toLowerCase().split(/\s+/).filter(Boolean);return As.has(t.length)&&t.every(r=>Ss.en.getWordIndex(r)>=0)}function Ts(e){let t=Qn(e);return _s.has(t)||Os.test(t)}function Qn(e){return String(e).replace(/[^a-z0-9]/gi,"").toLowerCase()}function Cs(e){let t=Qn(e);return[...xs].some(r=>t.includes(r))}function Ns(e,t,r){if(typeof t=="string"){if(vs.some(n=>n.test(t))||Is(t))throw new De(r);if(ks.test(t)&&!Ts(e))throw new De(r)}}function gr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string")return Ns(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)=>gr(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(Cs(o))throw new De(i);e[o]!==void 0&&(n[o]=gr(e[o],i,o))}return n}function ft(e){return gr(e)}var xs,vs,As,ks,Os,_s,De,Fe=l(()=>{xs=new Set(["privatekey","privkey","secretkey","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","wif","xprv","xpriv","bearer","authorization","signature","apikey","credential"]),vs=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/],As=new Set([12,15,18,21,24]);ks=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/,Os=/(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i,_s=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 Yw,constants as Rs,fchmodSync as Xw,fsyncSync as Qw,lstatSync as Zw,mkdirSync as eg,openSync as tg,readFileSync as rg,renameSync as ng,rmSync as og,writeFileSync as ig}from"node:fs";var cg,Zn=l(()=>{Fe();Be();cg=Rs.O_NOFOLLOW??0});import{wordlists as dg}from"ethers";var eo,pg,xe=l(()=>{Fe();eo=64*1024,pg=32*1024});var $s,wg,gg,mt=l(()=>{xe();$s=["schemaVersion","buildVersion","recordType","execution","custody"],wg=[...$s,"recordHash"],gg=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 Bs,uo,xg,xr=l(()=>{xe();mt();Bs=Object.freeze(["draft","checked","approval","signed","submitted","finalized","reorged","orphaned","compensating","compensated","failed","cancelled"]),uo=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"]),xg=new Set(uo)});var js,lo=l(()=>{xe();xr();js=64*1024*1024});var Tg,Cg,Ng,fo=l(()=>{Tg=Object.freeze(["chainId","agentAddress","accountAddress","actions","targets","maxValueWei","maxGasWei","maxSlippageBps","expiresAt","nonce","revocationKey"]),Cg=Object.freeze(["read","simulate"]),Ng=1440*60});function vr(e){let t=String(e),r=t.toLowerCase().replace(/[\s._-]+/g,"");return Hs.test(t)||zs.includes(r)}function Ws(e){return e.replace(/"([A-Za-z0-9_-]+)"\s*:\s*"(?:0x)?([0-9a-fA-F]{64})"/g,(t,r)=>mo.includes(String(r).toLowerCase().replace(/[_-]/g,""))?`"${r}":"<hex64>"`:t)}function ho(e){let t;try{t=JSON.stringify(e)}catch(o){throw new te("$",`unserializable-payload: ${String(o?.message||o)}`)}if(t===void 0)return"null";let r=Ws(t);for(let{rule:o,re:i}of po)if(i.test(r))throw new te("$<serialized>",o);if(/(?:^|[^0-9a-fA-Fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/.test(r))throw new te("$<serialized>","raw-32-byte-hex-embedded");return JSON.parse(t,(o,i)=>{if(o&&vr(o))throw new te(`$<serialized>.${o}`,"forbidden-key-name");return i}),t}function ie(e,t="$",r=new Set,n=""){if(e==null)return e;if(typeof e=="string"){let o=mo.includes(String(n).toLowerCase().replace(/[_-]/g,""));for(let{rule:i,re:s}of po)if(!(o&&i.startsWith("raw-32-byte-hex"))&&s.test(e))throw new te(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"&&vr(o))throw new te(`${t}[${JSON.stringify(o)}]`,"forbidden-key-name");ie(o,`${t}[key]`,r),ie(i,`${t}[${String(o)}]`,r)}return e}if(e instanceof Set){let o=0;for(let i of e.values())ie(i,`${t}[${o++}]`,r);return e}if(Array.isArray(e))return e.forEach((o,i)=>ie(o,`${t}[${i}]`,r)),e;for(let[o,i]of Object.entries(e)){if(vr(o))throw new te(`${t}.${o}`,"forbidden-key-name");ie(i,`${t}.${o}`,r,o)}return e}var te,Hs,zs,po,mo,Ar=l(()=>{fo();te=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}},Hs=/(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"]);po=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}]),mo=Object.freeze(["grantid","id","hash","sha256","sha256hex","checksum","txhash","transactionhash","blockhash","digest","userophash","commithash","prevhash","intenthash","canonicalhash","payloadhash","requestid"])});var Ir,jg,wo=l(()=>{Ar();Ir=Object.freeze(["intent","quote_comparison","simulation","prepared","approval","signed","broadcast","settlement","balance_delta","position"]),jg=Object.freeze(Object.fromEntries(Ir.map((e,t)=>[e,Object.freeze(t+1<Ir.length?[Ir[t+1]]:[])])))});var Vs,go=l(()=>{wo();xe();mt();Vs=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 yo=l(()=>{xe();mt();xr();lo();go()});var Gs,Js,Ys,ky,Oy,_y,Ty,Cy,Xs,Ny,bo=l(()=>{Gs=Object.freeze(["owner","operator","agent","viewer"]),Js=Object.freeze(["tenant","config","policy","grant","workflow","trade","receipt","audit","telemetry","context","lifecycle"]),Ys=Object.freeze({read:"read",create:"create",update:"update",delete:"delete",manage:"manage",prepare:"prepare",cancel:"cancel",export:"export",approve:"approve"}),ky=Object.freeze(["owner"]),Oy=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"}),_y=new Set(Gs),Ty=new Set(Js),Cy=new Set(Object.values(Ys)),Xs=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"])}),Ny=Object.freeze(Object.fromEntries(Object.entries(Xs).map(([e,t])=>[e,Object.freeze([...t])])))});var Qs,Zs,ec,$y,By,Dy,Fy,qy,Uy,kr=l(()=>{bo();Qs=Object.freeze(["succeeded","denied","invalid","failed","cancelled","timed_out","unavailable","skipped"]),Zs=Object.freeze(["workflow","task","intent","plan","run","event","eval"]),ec=Object.freeze(["taskId","intentId","planId","runId","eventId"]),$y=Object.freeze({maxAttributes:24,maxKeyLength:48,maxStringLength:256,maxArrayLength:8}),By=new Set(Qs),Dy=new Set(Zs),Fy=new Set(ec),qy=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"]),Uy=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 Vy,Eo=l(()=>{yo();kr();Vy=Object.freeze({"workflow.cancelled":"cancelled","workflow.failed":"failed"})});var Qy,So=l(()=>{kr();Qy=32*1024*1024});var e0,t0,r0,ve=l(()=>{e0=Object.freeze({N:1<<17,r:8,p:1}),t0=256*1024*1024,r0=16*1024});var o0,xo=l(()=>{o0=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 Or}from"node:os";import{join as _r}from"node:path";var vo,tc,c0,Ao=l(()=>{vo=process.env.ORACLE_PUBLIC_DESKTOP==="1",tc=vo?process.env.ORACLE_CONFIG_DIR||_r(Or(),".config","oracle"):_r(Or(),".config","oracle"),c0=vo?tc:_r(Or(),".config","mad-desk")});var p0,m0,h0,Io=l(()=>{Ao();p0="0".repeat(64),m0=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"}),h0=Promise.resolve()});var Tr=l(()=>{Io();de();ve();Be()});var Oo=l(()=>{});var Co={};Ge(Co,{SIGN_TIME_REVIEW_VERSION:()=>rc,SignTimeReviewSecretError:()=>qe,createSignTimeReview:()=>To});function Cr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string"){let o=e.trim().split(/\s+/);if(sc.test(e)||cc.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)=>Cr(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(ac.test(i))throw new qe(`${t}.${o}`);e[o]!==void 0&&(n[o]=Cr(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(!nc.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(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 Nr(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 _o(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))_o(t);Object.freeze(e)}return e}function uc(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:Nr(String(n),`${t}.reason`)}}function lc(e){if(!Array.isArray(e))throw new TypeError("sign-time review: policyChecks must be an array");let t=e.map((n,o)=>uc(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 dc(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:Nr(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 fc(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:Nr(String(Ue(t.asset??t.token,`assetDeltas[${r}].asset`)),`assetDeltas[${r}].asset`),before:n,after:o,delta:s}})}function pc(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: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 To(e={}){pe(e,"input");let t=Cr(e),r=t.tx==null?t:pe(t.tx,"tx"),n=re(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(!ic.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(!oc.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=lc(u?t.policyChecks:[]),h=dc(t.simulation),m=fc(t.assetDeltas),w=pc(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: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:h,policyChecks:d,allowlistHits:g,assetDeltas:m,approvalDeltas:w,summary:A};return _o(N)}var rc,nc,oc,ic,ac,sc,cc,qe,Rr=l(()=>{rc=1,nc=/^0x[0-9a-f]{40}$/,oc=/^0x(?:[0-9a-f]{2})*$/,ic=/^(?:0x)?[0-9a-f]{64}$/,ac=/(privatekey|privkey|secretkey|seedphrase|mnemonic|passphrase|password|keystore|keymaterial|wif|xprv|xpriv|bearer|authorization|signature|apikey|credential)/i,sc=/\b(?:[5KL][1-9A-HJ-NP-Za-km-z]{50,51}|xprv[0-9A-Za-z]{50,})\b/,cc=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 I0,readdirSync as k0,existsSync as mc}from"node:fs";import{dirname as hc,join as Me}from"node:path";import{fileURLToPath as wc}from"node:url";function gc(){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(mc(t))return t;return e[0]}var je,C0,N0,No=l(()=>{fe();je=hc(wc(import.meta.url));C0=gc(),N0=(1n<<256n)-1n});var Ro=l(()=>{Rr();fe();No()});import{Wallet as q0}from"ethers";import{base58 as M0}from"@scure/base";import{ed25519 as H0}from"@noble/curves/ed25519.js";import{NETWORK as W0,TEST_NETWORK as V0,WIF as K0,p2wpkh as G0}from"@scure/btc-signer";import{pubECDSA as Y0}from"@scure/btc-signer/utils.js";var Lo=l(()=>{});var Z0,eb,tb,rb,nb,ob,ib,ab,sb,cb,ub,Po=l(()=>{Tr();Z0=Object.freeze(["spot-limit-create","spot-limit-cancel","spot-order-status"]),eb=Object.freeze(["binance","bybit","okx","coinbase"]),tb=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"}),rb=Object.freeze({binance:"/api/v3",bybit:"/v5/order",okx:"/api/v5/trade",coinbase:"/orders"}),nb=Object.freeze(["version","surface","kind","venue","credentialRef","symbol","base","quote","side","baseSize","limitPrice","maxQuoteNotional","timeInForce","clientOrderId","expiresAtMs","venueOrderId","nonce","grantId","artifactHash"]),ob=Object.freeze(["market-create","withdraw","transfer","subaccount","leverage","futures","margin","convert","api-key"]),ib=Object.freeze(["url","host","path","method","headers","signature","apiKey","apiSecret","passphrase","privateKey","redirect","proxy"]),ab=Object.freeze(["ccxt","binance-api-node","node-binance-api","coinbase-advanced-node","@okx-dex/okx-dex-sdk","bybit-api"]),sb=Object.freeze({perOrderQuote:"sealed-owner-policy",dailyGrossQuote:"sealed-owner-policy",scope:Object.freeze(["per-order","UTC-day","account","venue","quote"]),envelopeFieldIsNotCeiling:!0}),cb=Object.freeze({binanceRecvWindowMs:5e3,bybitWindowMs:5e3,maxLocalSkewMs:2e3}),ub=Object.freeze({perSecond:1,perMinute:30,bind:"tighter"})});var $o=l(()=>{ve()});var Ec,Bo,wt=l(()=>{Ec=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}"]})}),Bo=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"})});var Do=l(()=>{wt()});var bb,Fo=l(()=>{wt();Do();bb=256*1024});var qo=l(()=>{wt();Fo()});var Uo=l(()=>{ve()});import B from"node:path";import Sc from"node:os";import{createHash as xc,randomBytes as pE}from"node:crypto";import{Interface as Lr,keccak256 as hE}from"ethers";import{Transaction as gE}from"@scure/btc-signer";import{ed25519 as bE}from"@noble/curves/ed25519.js";function Mo(e){let t=process.env.ORACLE_SIGNER_STATE_DIR||B.join(process.env.XDG_STATE_HOME||B.join(Sc.homedir(),".local","state"),"oracle"),r=xc("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 YE,XE,QE,jo=l(()=>{Xn();Zn();Eo();So();Be();ve();xo();Tr();Oo();fe();Ro();dt();ut();hr();ur();dr();lt();mr();lr();pr();ar();sr();fr();Lo();Po();$o();qo();Uo();YE=new Lr(["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"]),XE=new Lr(["function decimals() view returns (uint8)","function allowance(address owner,address spender) view returns (uint256)"]),QE=new Lr(["function ownerOf(uint256 tokenId) view returns (address)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner,address operator) view returns (bool)"])});import Pr from"node:fs";import Ho from"node:path";import{homedir as vc}from"node:os";function Ac(){return process.env.ORACLE_CONFIG_DIR||Ho.join(vc(),".config","oracle")}function He(){let e=Mo(Ho.join(Ac(),"signer")),t=Pr.existsSync(e.vault),r=Pr.existsSync(e.lock),n=t?r?"disarmed":"armed-owner-confirmed":"inert-no-key";return{vaultExists:t,policyConfigured:Pr.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 uS,$r=l(()=>{rr();Dn();jo();ve();uS=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 gt(e){return String(e||"").trim()||void 0}function kc(e,{required:t=!1}={}){let r=gt(e)?.toLowerCase();if(!r){if(t)throw new Error("model provider is required");return}if(!Ic.has(r))throw new Error(`unsupported provider: ${r}`);return r}function Oc(e,{required:t=!1}={}){let r=gt(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 _c(e){let t=gt(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=kc(e),i=Oc(t,{required:n});if(o==="custom")return{provider:o,...i?{model:i}:{},baseUrl:_c(r)};if(gt(r))throw new Error("baseUrl is only supported for the custom provider");return{...o?{provider:o}:{},...i?{model:i}:{}}}var Ic,Wo=l(()=>{Ic=new Set(["openrouter","openai","anthropic","xai","deepseek","gemini","kimi","mistral","nous","qwen","glm","local","ollama","custom","anthropic-oauth","openai-codex","xai-oauth"])});import Vo from"node:fs";import Tc from"node:path";function Nc(){return Tc.join(ye(),"model.json")}function Ie(e){return String(e||"").trim()||void 0}function Rc(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),p=Ie(e.computeHost||e.remoteHost),c=Ie(e.computeUser||e.remoteUser),f=Ie(e.computePath||e.remotePath);if(!Cc.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 Ko(){let e=Nc();if(!Vo.existsSync(e))return null;try{return Rc(JSON.parse(Vo.readFileSync(e,"utf8")))}catch{return null}}var Cc,Go=l(()=>{Ye();Wo();Cc=new Set(["auto","standalone","hermes","remote","arch"])});function Br(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 Dr(e,t="control input"){try{ie(e,t),ho(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"){Br(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 Fr(e,t,r=200,{lower:n=!1}={}){if(typeof e!="string"||!e.trim()||e.length>r||Lc.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=Fr(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 yt(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 Lc,qr=l(()=>{Fe();Ar();Lc=/[\u0000-\u001f\u007f]/});function Jo({family:e,chainId:t},r="chain"){let n=We(e,`${r}.family`,40),o;if(n==="evm"){if(typeof t=="number")o=String(yt(t,`${r}.chainId`,{positive:!0}));else if(o=Fr(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 Bc(e,t="chain"){return ze(e,{required:["family","chainId"]},t),H(Jo(e,t))}function Yo(e,t="finality rule"){Dr(e,t),Br(e,t);let r=e.rule;if(!Pc.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=Jo(e,t);return r==="confirmations"?{...o,rule:r,confirmations:yt(e.confirmations,`${t}.confirmations`,{positive:!0})}:{...o,rule:r,[n]:We(e[n],`${t}.${n}`,80)}}function Ur(e){if(!Array.isArray(e))throw new TypeError("finality policy rules must be an array");let t=e.map((n,o)=>Yo(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 Dc(e){if(ze(e,{required:["policyVersion","rules"]},"finality policy"),e.policyVersion!==1||!Array.isArray(e.rules))throw new TypeError("unsupported finality policy");return Ur(e.rules)}function Xo(e,t){let r=Bc(t,"finality query"),o=Dc(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 Fc(e,t){if(e==null)return null;Dr(e,"finality evidence");let r=t.rule==="confirmations"?"confirmations":t.rule;if(ze(e,{required:["status"],optional:[r]},"finality evidence"),!$c.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"?yt(e.confirmations,"finality evidence.confirmations",{positive:!0}):We(e[r],`finality evidence.${r}`,80)),n}function Qo(e,t){if(!e||e.status===me.UNKNOWN||e.rule==null)return H({status:me.UNKNOWN,final:!1,reason:"MISSING_FINALITY_RULE"});let r=Yo(e.rule??e,"resolved finality rule"),n=Fc(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 Pc,me,$c,Zo=l(()=>{qr();Pc=Object.freeze(["confirmations","finalizedTag","checkpoint"]),me=Object.freeze({UNKNOWN:"UNKNOWN",INCLUDED:"INCLUDED",FINAL:"FINAL"}),$c=Object.freeze(["LIVE","STALE","UNKNOWN","UNAVAILABLE"])});function Uc(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 ei(e){return typeof e=="string"&&["FAIL","FAILED","FAILURE","ORPHAN","ORPHANED","REVERTED"].includes(e.trim().toUpperCase())}function jr(e){return e==null?e:Array.isArray(e)?e.map(jr):Ve(e)?Object.fromEntries(Object.keys(e).sort().map(t=>[t,jr(e[t])])):String(e)}function Mc(e,t,r,n){let o=k(e.finalityEvidence,n?.finality,e.evidence),i=k(e.finalityPolicy,e.policy);try{return i==null&&Ve(e.finalityRule)&&(i=Ur([{family:t,chainId:r,...e.finalityRule}])),i==null||t==null||r==null?{status:"UNKNOWN",final:!1,reason:"MISSING_FINALITY_RULE"}:Qo(Xo(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 jc(e){return e==null?null:String(e).trim().toLowerCase()}function Mr(...e){let t=e.map(jc).filter(Boolean);return t.length<=1||t.every(r=>r===t[0])}function ti(e={}){if(!Ve(e))throw new TypeError("verified receipt: input object required");let t=ft(e),r=k(t.actionReceipt,t.receipt),n=Ve(r)?r:t,o=k(t.observation,t.chainObservation,t.observedReceipt),i=Ve(o),s=k(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash),p=k(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family),c=k(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),f=!Mr(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash)||!Mr(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family)||!Mr(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),u=Mc(t,p,c,i&&!f?o:null),d=Uc(k(o?.receiptStatus,o?.executionStatus,o?.status)),h=k(t.reconciliationStatus,t.reconciliation?.status,o?.reconciliationStatus),m=k(t.finalityState,t.finalityEvidence?.status,t.evidence?.status,o?.finalityState),w="UNKNOWN";ei(h)||!f&&(i&&d==="FAIL"||ei(m))?w="FAIL":!f&&s&&i&&d==="SUCCESS"&&["INCLUDED","FINAL"].includes(u.status)&&(w="SUCCESS");let g={verifiedReceiptVersion:qc,status:w};f&&(g.reason="REFERENCE_MISMATCH"),D(g,"txHash",s),D(g,"chain",k(t.chain,n.chain,o?.chain)),D(g,"family",p),D(g,"chainId",c),D(g,"block",k(o?.block,t.block)),D(g,"blockState",k(o?.blockState,o?.inclusionState)),g.finalityState=u.status,D(g,"confirmations",k(o?.confirmations,o?.finality?.confirmations,t.finalityEvidence?.confirmations,t.evidence?.confirmations)),D(g,"observedAt",k(o?.observedAt,t.observedAt)),D(g,"route",k(t.route,n.route)),D(g,"prepareHash",k(t.prepareHash,n.prepareHash)),D(g,"policyOutcome",k(t.policyOutcome,n.policyOutcome,n.policyChecks));let y=k(t.balanceChanges,o?.balanceChanges,o?.balances,n.balanceChanges,n.balances);return y!=null&&(g.balanceChanges=jr(y)),D(g,"createdAt",k(t.createdAt,n.createdAt)),D(g,"submittedAt",k(t.submittedAt,n.submittedAt)),D(g,"finalizedAt",k(t.finalizedAt,o?.finalizedAt)),D(g,"timestamps",k(t.timestamps,n.timestamps,o?.timestamps)),H(g)}var qc,kS,k,Ve,ri=l(()=>{Fe();Zo();qr();qc=1,kS=Object.freeze(["SUCCESS","FAIL","UNKNOWN"]),k=(...e)=>e.find(t=>t!=null),Ve=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype});var oi={};Ge(oi,{observeEvmReceipt:()=>ni,verifyEvmReceipt:()=>Wc});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 ni({txHash:e,chainId:t,rpcUrl:r},n={}){let o=String(e||"").trim().toLowerCase();if(!Hc.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||yn,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 Wc({txHash:e,chainId:t,confirmations:r=1,rpcUrl:n},o={}){let{observation:i,reason:s}=await ni({txHash:e,chainId:t,rpcUrl:n},o),p=ti({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 Hc,ii=l(()=>{Y();ri();Hc=/^0x[0-9a-f]{64}$/});var ai={};Ge(ai,{classifyReceipt:()=>Pe,configDir:()=>Jc,firstHourReport:()=>Hr,probeReceiptModule:()=>Xc,probeReviewModule:()=>Yc,venueMap:()=>bt});import Vc from"node:path";import{homedir as Kc}from"node:os";function Jc(e=process.env){return e.ORACLE_CONFIG_DIR||Vc.join(Kc(),".config","oracle")}function bt({env:e=process.env,vault:t=null}={}){let r=t||He(),n=[];for(let[o,i]of Object.entries(et)){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 Hr({env:e=process.env,model:t=Ko(),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(Gc.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:bt({env:e,vault:r})}}async function Yc(){try{return typeof(await Promise.resolve().then(()=>(Rr(),Co))).createSignTimeReview=="function"}catch{return!1}}async function Xc(){try{let e=await Promise.resolve().then(()=>(ii(),oi));return typeof e.observeReceipt=="function"||typeof e.default=="function"||Object.values(e).some(t=>typeof t=="function")}catch{return!1}}var Gc,zr=l(()=>{Bt();$r();Go();rr();Gc=new Set(["127.0.0.1","::1","localhost"])});var ci={};Ge(ci,{classifyReceipt:()=>Pe,default:()=>eu,detailText:()=>si,firstHourReport:()=>Hr,probeQuote:()=>Zc,probeSigner:()=>Qc,symbol:()=>Ke,vaultStatus:()=>He});async function Qc(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 si(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 Zc(){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:si(e instanceof Error?e.message:"quote failed")}}}var eu,ui=l(()=>{zr();$r();eu={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=bt();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 Ie from"node:fs";import ri from"node:path";import Wr from"node:fs";import ge from"node:path";Ke();var wi="0.19.0",iu=`hermes-agent==${wi}`;var zr="0.12.1",au=Object.freeze({posix:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${zr}/uv-installer.sh`,sha256:"d3f5412d38c99f9d024901843bf98206f0d2c6dbe64df40d0b740e2751ca62c1"}),windows:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${zr}/uv-installer.ps1`,sha256:"b9ec035151bfbb11d616dbd69886498d885551489eddf095ea3c0ad59f640eb0"})});function gi(){return ge.join(we(),"runtime")}function yi(){return ge.join(gi(),"venv")}function bi(e){let t=process.platform==="win32"?"Scripts":"bin",r=process.platform==="win32"?`${e}.exe`:e;return ge.join(yi(),t,r)}function Ei(){return bi("hermes")}function xi(e){let t=process.platform==="win32"&&!ge.extname(e)?["",".exe",".cmd",".bat"]:[""];for(let r of(process.env.PATH||"").split(ge.delimiter))if(r)for(let n of t){let o=ge.join(r,`${e}${n}`);try{if(Wr.existsSync(o))return o}catch{}}return null}function Vr(){if(process.env.ORACLE_HERMES_BIN)return{ok:!0,bin:process.env.ORACLE_HERMES_BIN,source:"env"};let e=Ei();if(Wr.existsSync(e))return{ok:!0,bin:e,source:"managed"};let t=xi("hermes");return t?{ok:!0,bin:t,source:"path"}:{ok:!1,bin:null,source:null}}import Ce from"node:fs";import $ from"node:path";Ke();import{existsSync as Gr,readFileSync as Si}from"node:fs";import{dirname as Kr,join as Et}from"node:path";import{fileURLToPath as vi}from"node:url";function Ai(e){let t=Kr(vi(e));for(let r=0;r<8;r+=1){let n=Et(t,"package.json");if(Gr(n))try{let i=JSON.parse(Si(n,"utf8"));if(i&&typeof i.version=="string")return t}catch{}let o=Kr(t);if(o===t)break;t=o}throw new Error(`oracle: could not resolve package root from ${e}`)}function Jr(e,t){let r=Ai(t),n=Et(r,e);return Gr(n)?n:Et(r,"dist","assets",e)}var Ii=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 Yr(){return Ii.filter(e=>e.website)}var xt=Object.freeze(["long_horizon","recursive_fanout","continual_learn","evidence_first","prepare_only"]);function St(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 ye=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","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"]),ki="deny",mu=256*1024;var hu=Object.freeze({version:1,source:"default",defaultDecision:ki,allow:ye,deny:Object.freeze([])});var Oi=Object.freeze(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","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"]),wu=new Set(Oi);var vt=Object.freeze(["wallet","pool","nft_floor","hl_flow","prediction_market"]),yu=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,_i=e=>Math.round(e*1e4)/1e4;function W(e,t,r,n=!0){!n||r===null||!Number.isFinite(r)||e.push({feature:t,value:_i(r)})}function Ti(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 Ci(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 Ni(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 Ri(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 Li(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 bu=Object.freeze({wallet:Ti,pool:Ci,nft_floor:Ni,hl_flow:Ri,prediction_market:Li});qt();jt();Y();import{Interface as En,getAddress as bf,id as Na,isAddress as Ef}from"ethers";Y();var xl=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 vl=Object.freeze(["blockNumber","nativeBalance","tokenBalance","resolveToken","resolvePools","scanBlocks","scoreRisk","quote","sellSimulation","prepareUnsignedTx"]),Ht=Object.freeze({LIVE:"LIVE",CACHED:"CACHED",STALE:"STALE",UNKNOWN:"UNKNOWN",UNAVAILABLE:"UNAVAILABLE"}),zt=Object.freeze({PASS:"PASS",CAUTION:"CAUTION",FAIL:"FAIL",UNKNOWN:"UNKNOWN"});var Aa=Object.freeze({FULL:"FULL",NO_GAS:"NO_GAS",FAILED:"FAILED"});mn();hn();yn();j();X();rt();F();Vt();qt();jt();j();var zd=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"]});tt();Y();var sf=Object.freeze(["lifi","relay"]);F();var ff=Object.freeze({TRANSACTION:"unsigned-transaction",TYPED_DATA_ORDER:"typed-data-order"});var pf=new Set(["0x0000000000000000000000000000000000000000","0x000000000000000000000000000000000000dead","0x0000000000000000000000000000000000000001","0x00000000000000000000000000000000000a1ce5"].map(e=>e.toLowerCase()));var mf=Object.freeze(["operation","exactOutput","amountOut","multihop","path","positionManager","modifyLiquidities","commands","actions"]);F();var xn=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"})}),If=new En(["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)"]),kf=new En(["function withdraw(uint256 wad)"]),Of=(1n<<128n)-1n;var _f=Na("Transfer(address,address,uint256)").toLowerCase();j();rt();F();import{getAddress as Lf,Interface as nt,TypedDataEncoder as Pf,parseUnits as $f}from"ethers";var La="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)",Uf=new nt([`function ${La}`]),Mf=new nt(["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"]),Pa=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"]),jf=new Set(Pa);var Sn=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 Hf=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 zf=new nt(["function setApprovalForAll(address operator,bool approved)"]),Wf=new nt(["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();Qe();j();Y();Y();Bt();var Kt=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 ot=new Map,$a=Object.keys(Ft).map(Number),Ba=Object.keys(Mt).map(Number),Da=Object.keys(xn).map(Number),Jt=Kt.map(e=>e.chainId),Fa=[...new Set(Object.values(Sn))],Gt=new Set,vn=!1;function An(e){if(!e||typeof e!="object"||Object.isFrozen(e))return e;for(let t of Object.values(e))An(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(vn&&Gt.has(t))throw new Error(`registerProvider refuses to overwrite built-in provider: ${t}`);return ot.set(t,{chainIds:e.chainIds||[],auth:e.auth||"none",description:e.description||"",baseEnv:e.baseEnv||[],...e,id:t}),ot.get(t)}function Yt({venue:e,op:t}={}){let r=[...ot.values()];return e&&(r=r.filter(n=>n.venue===e)),t&&(r=r.filter(n=>n.ops.includes(t))),r}function qa(){Gt.clear();for(let[e,t]of ot)Gt.add(e),An(t);vn=!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:Jt,auth:"none",ops:["health","scan"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:Kt.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:$a,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:Da,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:Jt,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:Jt,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:Ba,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:Fa,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."});qa();var Ip=Object.freeze(["live","needs_key","deprecated","soft_fail","hard_down"]),Ua=new Set(["apiKey","agentKey"]),Ma=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|CREDENTIAL|AUTH|ENV_FILE)$/i,ja=/(?:URL|URI|HOST|ENDPOINT|RPC)$/i;function Ha(e={}){return Ua.has(e.auth)?(Array.isArray(e.baseEnv)?e.baseEnv:[]).filter(t=>Ma.test(t)&&!ja.test(t)):[]}function it(e={}){return e.execution==="unavailable"||!!e.deprecated}function za(e={},t={},{env:r=process.env}={}){let n;if(it(e))n="deprecated";else if(t?.ok===!0)n="live";else{let o=Ha(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 In(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=[],f=[];for(let c of e){if(!it(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 p=za(c,n[c.id],{env:r});i[c.id]=p,o[p.class]+=1,p.hardDown&&s.push(c.id),p.quarantined&&f.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:f.length,quarantinedIds:Object.freeze(f),classifications:Object.freeze(i)})}function kn(e){try{return Ce.existsSync(e)}catch{return!1}}function Xt(e){for(let t of e)if(t&&kn(t))return t;return null}function Qt(e){try{return Jr(e,import.meta.url)}catch{return null}}function Wa(){let e=Yt(),t=e.filter(it).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 On(){let e=Xt([Qt("skills"),$.join(L,"skills"),$.join(L,"dist/assets/skills"),$.join(L,"assets/skills")]);if(!e)return{count:0,trading:[],building:[]};let t=Ce.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 Va(){let e=Xt([Qt("protocols/templates"),$.join(L,"protocols/templates"),$.join(L,"dist/assets/protocols/templates"),$.join(L,"assets/protocols/templates")]);return e?Ce.readdirSync(e).filter(r=>!r.startsWith(".")):On().building.some(r=>/protocol-builder|dex-launch|token-launch/i.test(r))?["(via skills: protocol-builder / launch packs)"]:[]}function Ka(){let e=Xt([Qt("profiles"),$.join(L,"profiles"),$.join(L,"dist/assets/profiles"),$.join(L,"assets/profiles")]);return e?Ce.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&!t.name.startsWith("_")).map(t=>t.name):[]}function Ga(){try{if(ye.includes("trade_lifecycle")&&!ye.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(kn(t))try{let r=Ce.readFileSync(t,"utf8");if(/prepare-only|never takes your key|never.*broadcast/i.test(r))return!0}catch{}return!1}function _n(e=process.env,{health:t=null}={}){let r=[],n=(S,T,U,b=1)=>{r.push({id:S,status:T,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(S=>!ye.includes(S));n("agent_tools",c.length===0?"ok":"warn",c.length===0?`safe tools ${ye.length}; signal_score present`:`missing tools: ${c.join(",")}`,3),n("research_attributes","ok",`attrs [${xt.join(", ")}]; mode=${St(e)?"ON":"off"}`,2);let p=Wa(),u=p.quarantinedIds.length?`: ${p.quarantinedIds.join(", ")}`:"";n("providers",p.count>=40?"ok":p.count>=10?"warn":"fail",`${p.count} providers from catalog, ${p.live} live, ${p.quarantined} quarantined${u}`,3);let d=In(Yt(),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=On();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=Va();n("protocol_templates",g.length>=2?"ok":"warn",g.length?g.join(", "):"none",2);let E=Ka();n("profiles",E.includes("protocol-builder")&&E.includes("oracle")?"ok":E.length>=1?"warn":"fail",E.join(", ")||"none",2),n("signals_engine",vt.length>=4?"ok":"fail",`types: ${vt.join(", ")} (cold / no hot exec)`,2);let A=Yr();n("harness_roster",A.length>=8?"ok":"warn",`${A.length} supported harnesses; Oracle native default; MCP inbound only`,2),n("custody_prepare_only",Ga()?"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 y=0,x=0;for(let S of r)x+=S.weight,S.status==="ok"?y+=S.weight:S.status==="warn"&&(y+=S.weight*.5);let _=x?Math.round(y/x*100):0,q=!r.some(S=>S.status==="fail")&&_>=70,v=q?`AGENTIC READY ${_}% \u2014 Oracle is the crypto control plane (prepare-only); pair coding harnesses via MCP for build.`:`AGENTIC GAPS ${_}% \u2014 fix fail/warn checks before calling Oracle the default crypto harness.`;return{ok:q,score:y,max:x,pct:_,summary:v,researchMode:St(e),attributes:[...xt],packageRoot:L,checks:r}}function ni(){let[e,t]=process.versions.node.split(".").map(Number);return e>20||e===20&&t>=19}function Gc(e){if(!Ie.existsSync(e))return{};let t={};for(let r of Ie.readFileSync(e,"utf8").split(/\r?\n/)){let n=r.match(/^([A-Z0-9_]+)=(.*)$/);n&&(t[n[1]]=n[2])}return t}async function Jc(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 Rx={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=(y,x,_,q=null)=>{o.push({id:y,status:x,detail:_,fix:q}),x==="fail"&&(i=!0)};s("node",ni()?"ok":"fail",`node ${process.versions.node}`,ni()?null:"install node >= 20.19");let f=e.paths.oracleExecEnvPath(),c=Gc(f),p=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",p?"ok":"warn",p?"present":"missing",p?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 Jc(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=Vr();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=ri.join(e.paths.hermesRoot(),"profiles"),g=0;Ie.existsSync(w)&&(g=Ie.readdirSync(w,{withFileTypes:!0}).filter(y=>y.isDirectory()).length),s("hermes_lanes","ok",g>0?`${g} profile dir(s) (optional surface)`:"no Hermes lane profiles (native-only OK)",null);{let y=ri.join(w,"oracle",".env"),x=[];if(Ie.existsSync(y)){let _=Ie.readFileSync(y,"utf8");/^TELEGRAM_BOT_TOKEN=.+/m.test(_)&&x.push("telegram"),/^DISCORD_BOT_TOKEN=.+/m.test(_)&&x.push("discord"),/^SLACK_BOT_TOKEN=.+/m.test(_)&&x.push("slack")}x.length?m.ok?s("messaging","ok",`${x.join("/")} configured \xB7 runtime ${m.source}`,null):s("messaging","warn",`${x.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 E=null;if(r){E=_n(process.env);for(let y of E.checks)s(`agentic_${y.id}`,y.status,y.detail,null)}let A=null;if(n){let{firstHourReport:y,probeReviewModule:x,probeReceiptModule:_}=await Promise.resolve().then(()=>(Mr(),Qo)),{probeSigner:q,probeQuote:v}=await Promise.resolve().then(()=>(ti(),ei)),[S,T,U,b]=await Promise.all([q(process.env),v(),x(),_()]);A=y({signerReachable:S,quote:T,reviewAvailable:U,receiptAvailable:b});for(let R of A.checks)s(`hour_${R.id}`,R.status,R.detail,R.fix);s("hour_score",A.ok?"ok":"warn",A.firstRunScore.label,null)}let P={ok:!i&&(E?E.ok:!0)&&(A?A.ok:!0),checks:o,...A?{firstHour:A}:{},...E?{agentic:{pct:E.pct,summary:E.summary,attributes:E.attributes,researchMode:E.researchMode}}:{}};if(t)process.stdout.write(JSON.stringify(P,null,2)+`
7
- `);else{for(let y of o)process.stdout.write(`${y.status.toUpperCase().padEnd(4)} ${y.id}: ${y.detail}
8
- `),y.fix&&process.stdout.write(` fix: ${y.fix}
9
- `);E&&process.stdout.write(`
10
- ${E.summary}
11
- `)}return P.ok?0:1}};export{Rx as default};
6
+ `);return 0}}});import ke from"node:fs";import li from"node:path";import Jr from"node:fs";import be from"node:path";Ye();var vi="0.19.0",fu=`hermes-agent==${vi}`;var Gr="0.12.1",pu=Object.freeze({posix:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${Gr}/uv-installer.sh`,sha256:"d3f5412d38c99f9d024901843bf98206f0d2c6dbe64df40d0b740e2751ca62c1"}),windows:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${Gr}/uv-installer.ps1`,sha256:"b9ec035151bfbb11d616dbd69886498d885551489eddf095ea3c0ad59f640eb0"})});function Ai(){return be.join(ye(),"runtime")}function Ii(){return be.join(Ai(),"venv")}function ki(e){let t=process.platform==="win32"?"Scripts":"bin",r=process.platform==="win32"?`${e}.exe`:e;return be.join(Ii(),t,r)}function Oi(){return ki("hermes")}function _i(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(Jr.existsSync(o))return o}catch{}}return null}function Yr(){if(process.env.ORACLE_HERMES_BIN)return{ok:!0,bin:process.env.ORACLE_HERMES_BIN,source:"env"};let e=Oi();if(Jr.existsSync(e))return{ok:!0,bin:e,source:"managed"};let t=_i("hermes");return t?{ok:!0,bin:t,source:"path"}:{ok:!1,bin:null,source:null}}import Le from"node:fs";import $ from"node:path";Ye();import{existsSync as Qr,readFileSync as Ti}from"node:fs";import{dirname as Xr,join as vt}from"node:path";import{fileURLToPath as Ci}from"node:url";function Ni(e){let t=Xr(Ci(e));for(let r=0;r<8;r+=1){let n=vt(t,"package.json");if(Qr(n))try{let i=JSON.parse(Ti(n,"utf8"));if(i&&typeof i.version=="string")return t}catch{}let o=Xr(t);if(o===t)break;t=o}throw new Error(`oracle: could not resolve package root from ${e}`)}function Zr(e,t){let r=Ni(t),n=vt(r,e);return Qr(n)?n:vt(r,"dist","assets",e)}var Ri=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 en(){return Ri.filter(e=>e.website)}var At=Object.freeze(["long_horizon","recursive_fanout","continual_learn","evidence_first","prepare_only"]);function It(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 ne=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","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"]),Li="deny",Su=256*1024;var xu=Object.freeze({version:1,source:"default",defaultDecision:Li,allow:ne,deny:Object.freeze([])});var Pi=Object.freeze(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","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"]),vu=new Set(Pi);var ce=Object.freeze({PUBLIC_APP:"public-app",RESEARCH_X_TELEGRAM:"research-x-telegram",OWNER_DESK:"owner-desk"}),Au=Object.freeze(Object.values(ce));function tn(e){let t=e.filter(r=>!ne.includes(r));if(t.length)throw new Error(`tool surface allowlist names unknown shipped tools: ${t.join(", ")}`);return Object.freeze([...e])}var kt=tn(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","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"]),rn=tn([...kt,"file_read","meta_analyze","cron_list","mcp_list","xurl"]),nn=Object.freeze([...ne]),Iu=Object.freeze({[ce.PUBLIC_APP]:kt,[ce.RESEARCH_X_TELEGRAM]:rn,[ce.OWNER_DESK]:nn}),ku=Object.freeze({[ce.PUBLIC_APP]:new Set(kt),[ce.RESEARCH_X_TELEGRAM]:new Set(rn),[ce.OWNER_DESK]:new Set(nn)});var Ot=Object.freeze(["wallet","pool","nft_floor","hl_flow","prediction_market"]),_u=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,$i=e=>Math.round(e*1e4)/1e4;function W(e,t,r,n=!0){!n||r===null||!Number.isFinite(r)||e.push({feature:t,value:$i(r)})}function Bi(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 Di(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 Fi(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 qi(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 Ui(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 Tu=Object.freeze({wallet:Bi,pool:Di,nft_floor:Fi,hl_flow:qi,prediction_market:Ui});jt();Wt();Y();import{Interface as _n,getAddress as Tf,id as Fa,isAddress as Cf}from"ethers";Y();var Nl=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 Ll=Object.freeze(["blockNumber","nativeBalance","tokenBalance","resolveToken","resolvePools","scanBlocks","scoreRisk","quote","sellSimulation","prepareUnsignedTx"]),Vt=Object.freeze({LIVE:"LIVE",CACHED:"CACHED",STALE:"STALE",UNKNOWN:"UNKNOWN",UNAVAILABLE:"UNAVAILABLE"}),Kt=Object.freeze({PASS:"PASS",CAUTION:"CAUTION",FAIL:"FAIL",UNKNOWN:"UNKNOWN"});var Na=Object.freeze({FULL:"FULL",NO_GAS:"NO_GAS",FAILED:"FAILED"});xn();vn();kn();j();X();it();F();Jt();jt();Wt();j();var ef=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"]});ot();Y();var gf=Object.freeze(["lifi","relay"]);F();var xf=Object.freeze({TRANSACTION:"unsigned-transaction",TYPED_DATA_ORDER:"typed-data-order"});var vf=new Set(["0x0000000000000000000000000000000000000000","0x000000000000000000000000000000000000dead","0x0000000000000000000000000000000000000001","0x00000000000000000000000000000000000a1ce5"].map(e=>e.toLowerCase()));var Af=Object.freeze(["operation","exactOutput","amountOut","multihop","path","positionManager","modifyLiquidities","commands","actions"]);F();var Tn=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"})}),$f=new _n(["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)"]),Bf=new _n(["function withdraw(uint256 wad)"]),Df=(1n<<128n)-1n;var Ff=Fa("Transfer(address,address,uint256)").toLowerCase();j();it();F();import{getAddress as Hf,Interface as at,TypedDataEncoder as zf,parseUnits as Wf}from"ethers";var Ua="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)",Yf=new at([`function ${Ua}`]),Xf=new at(["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"]),Ma=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"]),Qf=new Set(Ma);var Cn=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 Zf=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 ep=new at(["function setApprovalForAll(address operator,bool approved)"]),tp=new at(["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();tt();j();Y();Y();qt();var Yt=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 st=new Map,ja=Object.keys(Mt).map(Number),Ha=Object.keys(zt).map(Number),za=Object.keys(Tn).map(Number),Qt=Yt.map(e=>e.chainId),Wa=[...new Set(Object.values(Cn))],Xt=new Set,Nn=!1;function Rn(e){if(!e||typeof e!="object"||Object.isFrozen(e))return e;for(let t of Object.values(e))Rn(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(Nn&&Xt.has(t))throw new Error(`registerProvider refuses to overwrite built-in provider: ${t}`);return st.set(t,{chainIds:e.chainIds||[],auth:e.auth||"none",description:e.description||"",baseEnv:e.baseEnv||[],...e,id:t}),st.get(t)}function Zt({venue:e,op:t}={}){let r=[...st.values()];return e&&(r=r.filter(n=>n.venue===e)),t&&(r=r.filter(n=>n.ops.includes(t))),r}function Va(){Xt.clear();for(let[e,t]of st)Xt.add(e),Rn(t);Nn=!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:Qt,auth:"none",ops:["health","scan"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:Yt.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:ja,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:Qt,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:Qt,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:Ha,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:Wa,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."});Va();var $p=Object.freeze(["live","needs_key","deprecated","soft_fail","hard_down"]),Ka=new Set(["apiKey","agentKey"]),Ga=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|CREDENTIAL|AUTH|ENV_FILE)$/i,Ja=/(?:URL|URI|HOST|ENDPOINT|RPC)$/i;function Ya(e={}){return Ka.has(e.auth)?(Array.isArray(e.baseEnv)?e.baseEnv:[]).filter(t=>Ga.test(t)&&!Ja.test(t)):[]}function ct(e={}){return e.execution==="unavailable"||!!e.deprecated}function Xa(e={},t={},{env:r=process.env}={}){let n;if(ct(e))n="deprecated";else if(t?.ok===!0)n="live";else{let o=Ya(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 Ln(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(!ct(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=Xa(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 Pn(e){try{return Le.existsSync(e)}catch{return!1}}function er(e){for(let t of e)if(t&&Pn(t))return t;return null}function tr(e){try{return Zr(e,import.meta.url)}catch{return null}}function Qa(){let e=Zt(),t=e.filter(ct).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 $n(){let e=er([tr("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 Za(){let e=er([tr("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(".")):$n().building.some(r=>/protocol-builder|dex-launch|token-launch/i.test(r))?["(via skills: protocol-builder / launch packs)"]:[]}function es(){let e=er([tr("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 ts(){try{if(ne.includes("trade_lifecycle")&&!ne.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(Pn(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 Bn(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=>!ne.includes(x));n("agent_tools",c.length===0?"ok":"warn",c.length===0?`safe tools ${ne.length}; signal_score present`:`missing tools: ${c.join(",")}`,3),n("research_attributes","ok",`attrs [${At.join(", ")}]; mode=${It(e)?"ON":"off"}`,2);let f=Qa(),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=Ln(Zt(),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=$n();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=Za();n("protocol_templates",g.length>=2?"ok":"warn",g.length?g.join(", "):"none",2);let y=es();n("profiles",y.includes("protocol-builder")&&y.includes("oracle")?"ok":y.length>=1?"warn":"fail",y.join(", ")||"none",2),n("signals_engine",Ot.length>=4?"ok":"fail",`types: ${Ot.join(", ")} (cold / no hot exec)`,2);let S=en();n("harness_roster",S.length>=8?"ok":"warn",`${S.length} supported harnesses; Oracle native default; MCP inbound only`,2),n("custody_prepare_only",ts()?"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:It(e),attributes:[...At],packageRoot:L,checks:r}}function di(){let[e,t]=process.versions.node.split(".").map(Number);return e>20||e===20&&t>=19}function tu(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 ru(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 jS={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",di()?"ok":"fail",`node ${process.versions.node}`,di()?null:"install node >= 20.19");let p=e.paths.oracleExecEnvPath(),c=tu(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 ru(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=Yr();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=li.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=li.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=Bn(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(()=>(zr(),ai)),{probeSigner:q,probeQuote:v}=await Promise.resolve().then(()=>(ui(),ci)),[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)+`
7
+ `);else{for(let E of o)process.stdout.write(`${E.status.toUpperCase().padEnd(4)} ${E.id}: ${E.detail}
8
+ `),E.fix&&process.stdout.write(` fix: ${E.fix}
9
+ `);y&&process.stdout.write(`
10
+ ${y.summary}
11
+ `)}return P.ok?0:1}};export{jS as default};