@oracle-agent/oracle 0.35.55 → 0.35.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/oracle-desk-product/SKILL.md +1 -1
- package/dist/bin/desk-server.mjs +1 -1
- package/dist/cli/commands/chat.mjs +221 -221
- package/dist/cli/commands/data.mjs +1 -1
- package/dist/cli/commands/doctor.mjs +5 -5
- package/dist/cli/commands/eval.mjs +150 -150
- package/dist/cli/commands/farm.mjs +16 -16
- package/dist/cli/commands/model.mjs +223 -223
- package/dist/cli/commands/quickstart.mjs +6 -6
- package/dist/cli/commands/sign.mjs +14 -14
- package/dist/cli/commands/signer.mjs +32 -25
- package/dist/cli/commands/venues.mjs +2 -2
- package/dist/data/desk-data.mjs +22 -22
- package/dist/data/providers/farming.mjs +2 -2
- package/dist/index.mjs +31 -31
- package/dist/local-signer/anvil-attestation-worker.mjs +1 -1
- package/dist/local-signer/index.mjs +5 -5
- package/dist/local-signer/runtime.mjs +21 -22
- package/dist/teams/index.mjs +7 -7
- package/dist/tui/standalone-client.mjs +102 -102
- package/package.json +1 -1
- package/public/oracle-splash/docs/browser-and-web/index.html +2 -2
- package/public/oracle-splash/docs/connectors/index.html +2 -2
- package/public/oracle-splash/docs/getting-started/index.html +2 -2
- package/public/oracle-splash/docs/index.html +3 -3
- package/public/oracle-splash/docs/reference/index.html +2 -2
- package/public/oracle-splash/docs/security/index.html +2 -2
- package/public/oracle-splash/docs/using-oracle/index.html +2 -2
- package/public/oracle-splash/download/index.html +3 -3
- package/public/oracle-splash/downloads/index.html +1 -1
- package/public/oracle-splash/index.html +6 -6
- package/server.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var ki=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 Xe=(e,t)=>{for(var r in t)ki(e,r,{get:t[r],enumerable:!0})};import Qe from"node:fs";import Oi from"node:os";import ge from"node:path";import{fileURLToPath as _i}from"node:url";function _t(){return process.env.ORACLE_FAKE_HOME||Oi.homedir()}function Ci(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function ye(){return Ci()?process.env.ORACLE_CONFIG_DIR||ge.join(_t(),".config","oracle"):ge.join(_t(),".config","oracle")}function Ni(){return ge.join(ye(),"desk.json")}function Ri(){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=Ri();if(Qe.existsSync(o))for(let i of Qe.readFileSync(o,"utf8").split(/\r?\n/)){let s=i.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!s||s[2].startsWith("#"))continue;let d=s[2];(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))&&(d=d.slice(1,-1)),r(s[1],d)}}catch{}try{let o=Ni();if(Qe.existsSync(o)){let i=JSON.parse(Qe.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 Ti,L,Ze=l(()=>{Ti=ge.dirname(_i(import.meta.url)),L=ge.resolve(Ti,"../..");try{we()}catch{}});import{AsyncLocalStorage as Qi}from"node:async_hooks";function et(e){let t=Zi.getStore();if(!t||t.closed||!ea.includes(e))return null;if(t.spans.length>=ta)return t.droppedSpans++,null;let r={stage:e,startMs:t.now()-t.start,durationMs:null,outcome:"pending",status:null};return t.spans.push(r),(n,o=null)=>{t.closed||r.durationMs!==null||(r.durationMs=Math.max(0,t.now()-t.start-r.startMs),r.outcome=n==="succeeded"?"succeeded":"failed",r.status=Number.isInteger(o)&&o>=100&&o<=599?o:null)}}var Zi,ea,ta,ln=l(()=>{Zi=new Qi,ea=["http","retry","shared"],ta=512});import ue from"node:net";import ra from"node:dns";function tt(e){let t=String(e).toLowerCase().split("%")[0];if((t.match(/::/g)||[]).length>1)return null;let r=u=>{if(!u)return[];let m=u.split(":"),b=m.at(-1);if(b?.includes(".")){let p=b.split(".").map(Number);if(p.length!==4||p.some(h=>!Number.isInteger(h)||h<0||h>255))return null;m.splice(m.length-1,1,(p[0]<<8|p[1]).toString(16),(p[2]<<8|p[3]).toString(16))}return m.some(p=>!/^[0-9a-f]{1,4}$/.test(p))?null:m.map(p=>Number.parseInt(p,16))},[n,o]=t.split("::"),i=r(n),s=r(o);if(!i||!s)return null;let d=t.includes("::"),c=8-i.length-s.length;if(!d&&c!==0||d&&c<1)return null;let f=[...i,...Array(Math.max(0,c)).fill(0),...s];return f.length!==8?null:Uint8Array.from(f.flatMap(u=>[u>>8,u&255]))}function Pt(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 $t(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=tt(e);if(!t)return!1;let r=tt("::ffff:0:0");return Pt(t,r,96)?$t([...t.slice(12)].join(".")):Pt(t,tt("2000::"),3)?![["2001::",23],["2001:db8::",32],["2001:10::",28],["2001:2::",48],["2002::",16],["3fff::",20]].some(([o,i])=>Pt(t,tt(o),i)):!1}return!1}function oa(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(na.has(r)||r.endsWith(".localhost")||r.endsWith(".internal"))return{ok:!1,error:`refused internal host ${r}`};let n=ue.isIP(r);return n!==0&&!$t(r)?{ok:!1,error:`refused private address ${r}`}:{ok:!0,url:t,host:r,isLiteralIp:n!==0}}async function Bt(e,{lookupFn:t=ra.promises.lookup}={}){let r=oa(e);if(!r.ok)return r;if(r.isLiteralIp)return{ok:!0,url:r.url,addresses:[{address:r.host,family:ue.isIPv6(r.host)?6:4}]};let n;if(process.env.ORACLE_HOSTED_EGRESS_PROXY)return{ok:!0,url:r.url,addresses:[]};try{n=await t(r.host,{all:!0,verbatim:!0})}catch{return{ok:!1,error:`refused: ${r.host} did not resolve`}}return!Array.isArray(n)||n.length===0||n.some(o=>!$t(o.address))?{ok:!1,error:`refused: ${r.host} resolves to a non-public address`}:{ok:!0,url:r.url,addresses:n}}function ia(e=process.env){let t=e.ORACLE_HOSTED_EGRESS_PROXY||"";if(!t)return null;let r;try{r=new URL(t)}catch{throw new Error("egress-guard: ORACLE_HOSTED_EGRESS_PROXY is not a URL")}if(r.protocol!=="http:"||!["127.0.0.1","::1","localhost","[::1]"].includes(r.hostname)||!r.port||r.username||r.password)throw new Error("egress-guard: egress proxy must be an exact loopback http origin");let n=e.ORACLE_HOSTED_EGRESS_TOKEN||"";if(!/^[A-Za-z0-9_-]{43}$/.test(n))throw new Error("egress-guard: egress proxy token is missing");return{uri:r.origin,token:n}}async function Dt({requireUndici:e=!1,importUndici:t=()=>import("undici")}={}){let r,n,o;try{o=await t(),r=o.Agent,n=o.fetch}catch(p){if(e)throw new Error(`egress-guard: untrustedUrl pinning requires the undici package, which failed to load: ${p?.message||p}`);return null}if(typeof r!="function"||typeof n!="function"){if(e)throw new Error("egress-guard: untrustedUrl pinning requires undici's Agent and fetch exports, which were not found on the imported module");return null}let i=p=>String(p).toLowerCase().replace(/^\[|\]$/g,"").replace(/\.+$/,""),s=new Map,d=p=>(Array.isArray(p)?p:[p]).map(h=>typeof h=="string"?{address:h}:h).filter(h=>h&&h.address).map(h=>({address:h.address,family:h.family||(ue.isIPv6(h.address)?6:4)})),c=(p,h,w)=>{s.set(i(p),d(typeof h=="string"?[{address:h,family:w}]:h))},f=p=>{let h=i(p);if(ue.isIP(h))return[{address:h,family:ue.isIPv6(h)?6:4}];let w=s.get(h);if(!w||!w.length)throw new Error(`refused: unpinned host ${p} during pinned fetch`);return w},u=ia(),m=u&&typeof o.ProxyAgent=="function"?new o.ProxyAgent({uri:u.uri,token:`Bearer ${u.token}`,connectTimeout:1e4}):new r({connect:{lookup(p,h,w){let g;try{g=f(p)}catch(S){return w(S)}return h?.all?w(null,g):w(null,g[0].address,g[0].family)}}}),b=aa((p,h={})=>n(p,{...h,dispatcher:m}),c);return{dispatcher:m,fetch:b,pin:c,resolve:f,async close(){try{await m.destroy()}catch{}}}}function aa(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[Ft]=Object.freeze({pin:t}),e}function qt(e){return typeof e=="function"&&typeof e[Ft]?.pin=="function"}function dn(e,t,r){if(!qt(e))throw new Error("pinFetchToAddresses: fetchImpl is not pin-capable");e[Ft].pin(t,r)}var na,Ft,fn=l(()=>{na=new Set(["localhost","metadata.google.internal","metadata.goog"]);Ft=Symbol.for("oracle.egressGuard.pinCapableFetch")});import{createHash as sa}from"node:crypto";import{types as te}from"node:util";function C(e){return ie(`HTTP JSON body refused: ${e}`)}function wa(e){return["isArgumentsObject","isArrayBuffer","isAnyArrayBuffer","isArrayBufferView","isBoxedPrimitive","isDataView","isDate","isExternal","isGeneratorObject","isKeyObject","isCryptoKey","isMap","isMapIterator","isModuleNamespaceObject","isNativeError","isPromise","isRegExp","isSet","isSetIterator","isTypedArray","isWeakMap","isWeakSet"].some(t=>typeof te[t]=="function"&&te[t](e))}function ga(e){let t=[],r=0,n=0,o=0,i=0,s=new WeakSet,d=u=>{if(r+=Buffer.byteLength(u,"utf8"),r>ee.bytes)throw C("serialized byte limit exceeded");t.push(u)},c=u=>{if(Buffer.byteLength(u,"utf8")>ee.bytes)throw C("serialized byte limit exceeded");return JSON.stringify(u)},f=(u,m)=>{if(n+=1,n>ee.nodes)throw C("node limit exceeded");if(m>ee.depth)throw C("depth limit exceeded");if(u===null){d("null");return}if(typeof u=="string"){d(c(u));return}if(typeof u=="boolean"){d(u?"true":"false");return}if(typeof u=="number"){if(!Number.isFinite(u))throw C("non-finite number");d(Object.is(u,-0)?"0":String(u));return}if(typeof u!="object")throw C("unsupported non-JSON value");if(te.isProxy(u))throw C("proxy value");if(wa(u))throw C("unsupported exotic object");if(s.has(u))throw C("cyclic value");s.add(u);try{if(Object.getOwnPropertySymbols(u).length>0)throw C("symbol-keyed fields are unsupported");if(Array.isArray(u)){let h=Object.getPrototypeOf(u),w=0;for(;h!==null;){if(te.isProxy(h))throw C("proxy array prototype");if(w+=1,w>ee.depth)throw C("array prototype depth limit exceeded");h=Object.getPrototypeOf(h)}if(u.length>ee.arrayLength)throw C("array length limit exceeded");for(let S=0;S<u.length;S+=1){let P=Object.getOwnPropertyDescriptor(u,String(S));if(!P||!Object.hasOwn(P,"value")||P.enumerable!==!0)throw C("array entries must be dense enumerable own data")}let g=0;for(let S in u){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(Object.hasOwn(u,S)&&(g+=1,g>u.length))throw C("named array fields are unsupported")}if(g!==u.length)throw C("array entries must be dense enumerable own data");d("[");for(let S=0;S<u.length;S+=1)S&&d(","),f(Object.getOwnPropertyDescriptor(u,String(S)).value,m+1);d("]");return}let b=Object.getPrototypeOf(u);if(b!==Object.prototype&&b!==null)throw C("non-plain object");let p=[];for(let h in u){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(!Object.hasOwn(u,h))continue;if(o+=1,o>ee.fields)throw C("field limit exceeded");let w=Object.getOwnPropertyDescriptor(u,h);if(!w||!Object.hasOwn(w,"value")||w.enumerable!==!0)throw C("object fields must be enumerable own data");p.push([h,w.value])}d("{");for(let h=0;h<p.length;h+=1)h&&d(","),d(c(p[h][0])),d(":"),f(p[h][1],m+1);d("}")}finally{s.delete(u)}};return f(e,0),t.join("")}function ya(e){let t=Object.create(null);if(e==null)return t;if(typeof e!="object"&&typeof e!="function")throw new TypeError("HTTP headers must be an object");if(te.isProxy(e))throw new TypeError("HTTP headers must not be a proxy");if(Object.getOwnPropertySymbols(e).length>0)throw new TypeError("HTTP headers must not contain symbol fields");let r=new Set;for(let n of Object.keys(e)){if(!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u.test(n))throw new TypeError("HTTP header names must be valid tokens");let o=n.toLowerCase();if(r.has(o))throw new TypeError("HTTP headers contain a duplicate canonical name");r.add(o);let i=Object.getOwnPropertyDescriptor(e,n);if(!i||!Object.hasOwn(i,"value"))throw new TypeError("HTTP headers must contain own data properties");let s=i.value;if(s==null||["object","function","symbol"].includes(typeof s))throw new TypeError("HTTP header values must be scalar");t[n]=String(s)}return t}function ba(){return Object.assign(Object.create(null),{Accept:"application/json"})}function Ea(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 Sa(e,t){return new URL(String(e)).origin===new URL(String(t)).origin}function rt(e){if((typeof e!="object"||e===null)&&typeof e!="function")return`${typeof e}:${String(e)}`;let t=gn.get(e);return t||(t=yn,yn+=1,gn.set(e,t)),`reference:${t}`}function bn(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?xa.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 En(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(bn);if(!r||typeof r!="object")return!1;if(Object.hasOwn(r,"jsonrpc")||Object.hasOwn(r,"method"))return bn(r);let n=Object.hasOwn(r,"type")?r.type:null;return typeof n=="string"&&va.has(n)&&(!Object.hasOwn(r,"action")||r.action==null)&&(!Object.hasOwn(r,"signature")||r.signature==null)&&(!Object.hasOwn(r,"nonce")||r.nonce==null)}function Aa(e,t,r,n={},o=null){let i=sa("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 Ia(e,t){let r=Number(t);return Number.isFinite(r)&&r>0?Math.min(r*1e3,mn):Math.min(250*2**e,mn)+Math.floor(Math.random()*100)}function ie(e,t={}){let r=new Error(e);return r.retryable=!1,Object.assign(r,t),r}function Mt(e,t,r){return ie(`HTTP response from ${e} exceeded maxResponseBytes ${r} (${t})`,{oversize:!0})}function le(e){try{let t=e?.body?.cancel?.();t&&typeof t.then=="function"&&t.catch(()=>{})}catch{}}function Oa(e){return e?e.byteLength??e.length??0:0}async function _a(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 Mt(r,`content-length ${i}`,t);let s=e.body?.getReader?.();if(!s){let m=await e.text(),b=Buffer.byteLength(m,"utf8");if(b>t){if(!n)throw Mt(r,`body ${b} bytes`,t);return Buffer.from(m,"utf8").subarray(0,t).toString("utf8")}return m}let d=[],c=0,f=!1;try{for(;;){let{value:m,done:b}=await s.read();if(b)break;if(m&&(d.push(Buffer.from(m)),c+=Oa(m),c>t)){f=!0;break}}}finally{if(f)try{await s.cancel()}catch{}try{s.releaseLock?.()}catch{}}if(f&&(typeof o=="function"&&o(),!n))throw Mt(r,`streamed ${c} bytes`,t);let u=Buffer.concat(d);return(f?u.subarray(0,t):u).toString("utf8")}function Ta(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function Ca(e,{fetchImpl:t,method:r,headers:n,body:o,timeoutMs:i,lookupFn:s,realFetch:d,untrustedUrl:c=!1,maxResponseBytes:f=null,sameOriginRedirectsOnly:u=!1,importUndici:m,validateResponse:b,signal:p,redirectPolicy:h="follow",maxRedirects:w=nt}){let g=null,S=t,P=s?{lookupFn:s}:{};if(c&&!d&&!qt(S))throw ie(`HTTP refused ${e}: untrustedUrl requires a pin-capable fetchImpl (see markPinCapableFetch in egress-guard.mjs) or no fetchImpl override so Oracle can pin the connection itself`);let E=new AbortController,A=setTimeout(()=>E.abort(),i),N=p?wn?wn([p,E.signal]):p:E.signal,q=async(v,{status:x=null}={})=>{let _=await Bt(v,P);if(!_.ok)throw ie(x==null?`HTTP refused ${v}: ${_.error}`:`HTTP redirect to ${v} ${_.error}`,x==null?{}:{status:x});let U=new URL(v).hostname;if(d){if(g&&(await g.close(),g=null),!g)try{g=await Dt({requireUndici:!0,...m?{importUndici:m}:{}})}catch(y){throw ie(x==null?`HTTP refused ${v}: ${y?.message||y}`:`HTTP redirect to ${v} refused: ${y?.message||y}`,x==null?{}:{status:x})}g.pin(U,_.addresses),S=g.fetch}else dn(S,U,_.addresses);return _};try{let v=String(e),x=Object.assign(Object.create(null),n||{});c&&await q(v);for(let _=0;_<=w;_+=1){let U=Object.assign(Object.create(null),{method:r,headers:x,body:o,signal:N,redirect:"manual",dispatcher:void 0}),y=await S(v,U);if((h==="error"||w===0)&&y.status>=300&&y.status<400)throw le(y),ie(`HTTP ${y.status} ${r} redirect refused`,{status:y.status,redirectRefused:!0});if(ha.has(y.status)){let M=u===!0&&r==="POST"&&[307,308].includes(y.status)&&En(r,o);if(r!=="GET"&&r!=="HEAD"&&!M){le(y);let R=new Error(`HTTP ${y.status} ${r} ${v} redirected non-idempotent request`);throw R.status=y.status,R}if(_===w)throw le(y),ie(`HTTP ${y.status} ${r} redirect budget exhausted`,{status:y.status,redirectRefused:!0});let Gr=y.headers?.get?.("location"),K;try{K=Ea(Gr,v)}catch(R){throw le(y),R}let se=!Sa(K,v);if(le(y),se&&r==="POST"){let R=new Error(`HTTP ${y.status} ${r} cross-origin redirect refused`);throw R.status=y.status,R}if(se&&u){let R=new Error(`HTTP ${y.status} ${r} cross-origin redirect refused`);throw R.status=y.status,R.retryable=!1,R}if(se&&(x=ba(x)),c)await q(K,{status:y.status});else if(se){let R=await Bt(K,P);if(!R.ok){let k=new Error(`HTTP redirect from ${v} ${R.error}`);throw k.status=y.status,k.retryable=!1,k}d&&R.addresses?.length&&(g||(g=await Dt(m?{importUndici:m}:{})),g&&(g.pin(new URL(K).hostname,R.addresses),S=g.fetch))}v=K;continue}if(typeof b=="function")try{await b(y,{url:v})}catch(M){throw le(y),ie(M?.message||String(M))}let T=await _a(y,f,{url:v,onOversize:()=>E.abort()}),Oe=Ta(T);if(!y.ok){let M=new Error(`HTTP ${y.status} ${r} ${v}`);throw M.status=y.status,M.retryAfter=y.headers?.get?.("retry-after")??null,M.body=Oe??T.slice(0,300),M}return Oe??T}throw new Error(`HTTP redirect loop for ${e}`)}catch(v){if(E.signal.aborted&&!Ce(p)){let x=v&&(typeof v=="object"||typeof v=="function")&&!te.isProxy(v)?v:null,_=x?Object.getOwnPropertyDescriptor(x,"oversize"):null;if(!(_&&Object.hasOwn(_,"value")&&_.value===!0))try{if(!x)throw new TypeError("unsafe rejection");Object.defineProperties(x,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}})}catch{let y=new Error("HTTP request timed out");throw Object.defineProperties(y,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}}),y}}throw v}finally{clearTimeout(A),g&&await g.close()}}async function V(e,t={}){if(t!=null&&typeof t!="object"&&typeof t!="function")throw new TypeError("HTTP options must be an object");if(t!=null&&te.isProxy(t))throw new TypeError("HTTP options must not be a proxy");let r=new Set(["body","dedupe","fetchImpl","headers","importUndici","lookupFn","maxRedirects","maxResponseBytes","method","redirectPolicy","retries","sameOriginRedirectsOnly","signal","timeoutMs","untrustedUrl","validateResponse"]);if(t!=null){if(Object.getOwnPropertySymbols(t).length>0)throw new TypeError("HTTP options contain unknown fields");for(let k of Object.getOwnPropertyNames(t)){let I=Object.getOwnPropertyDescriptor(t,k);if(!(k==="toJSON"&&I&&Object.hasOwn(I,"value")&&I.value===void 0)){if(!r.has(k))throw new TypeError("HTTP options contain unknown fields");if(!I||!I.enumerable||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain enumerable own data properties")}}}let n=k=>{if(t==null||!Object.hasOwn(t,k))return;let I=Object.getOwnPropertyDescriptor(t,k);if(!I||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain own data properties");return I.value};if(typeof e!="string"||e.length===0||e.length>8192)throw new TypeError("HTTP URL must be a bounded string");let o=n("method");if(o!==void 0&&(typeof o!="string"||!/^[A-Za-z]+$/u.test(o)))throw new TypeError("HTTP method must be a string token");let i=n("timeoutMs");if(i!==void 0&&(!Number.isInteger(i)||i<1||i>12e4))throw new TypeError("HTTP timeoutMs must be a bounded integer");let s=n("retries");if(s!==void 0&&(!Number.isInteger(s)||s<0||s>10))throw new TypeError("HTTP retries must be a bounded integer");let d=n("redirectPolicy");if(d!==void 0&&d!=="follow"&&d!=="error")throw new TypeError('HTTP redirectPolicy must be "follow" or "error"');let c=n("maxRedirects");if(c!==void 0&&(!Number.isInteger(c)||c<0||c>nt))throw new TypeError(`HTTP maxRedirects must be an integer from 0 through ${nt}`);if(d==="error"&&c!==void 0&&c!==0)throw new TypeError('HTTP redirectPolicy "error" requires maxRedirects 0 when supplied');let f=d??"follow",u=f==="error"?0:c??nt;for(let k of["dedupe","untrustedUrl","sameOriginRedirectsOnly"]){let I=n(k);if(I!==void 0&&typeof I!="boolean")throw new TypeError(`HTTP ${k} must be boolean`)}let m=n("maxResponseBytes");if(m!==void 0&&(!Number.isInteger(m)||m<1||m>64*1024*1024))throw new TypeError("HTTP maxResponseBytes must be a bounded integer");let b=n("signal");if(b!==void 0){if(te.isProxy(b)||!(b instanceof AbortSignal))throw new TypeError("HTTP signal must be a native AbortSignal");try{Ce(b)}catch{throw new TypeError("HTTP signal must be a native AbortSignal")}}for(let k of["importUndici","lookupFn","validateResponse"]){let I=n(k);if(I!==void 0&&typeof I!="function")throw new TypeError(`HTTP ${k} must be a function`)}let p=n("fetchImpl"),h=p||globalThis.fetch;if(typeof h!="function")throw new Error("fetch unavailable \u2014 pass opts.fetchImpl");let w=i??12e3,g=(o||"GET").toUpperCase(),S=n("headers"),P=ya(S),E=Object.assign(Object.create(null),P);Object.keys(E).some(k=>k.toLowerCase()==="accept")||(E.Accept="application/json");let A=n("body");A!=null&&typeof A!="string"&&(Object.keys(E).find(I=>I.toLowerCase()==="content-type")||(E["Content-Type"]="application/json"),A=ga(A));let N=s??ua,q=n("lookupFn"),v=!p,x=n("untrustedUrl")===!0,_=n("sameOriginRedirectsOnly")===!0,U=n("importUndici"),y=n("validateResponse"),T=b,Oe=m??null,M=async()=>{let k;for(let I=0;I<=N;I++){T&&fa.call(T);let Yr=et("http");try{let Z=await Ca(e,{fetchImpl:h,method:g,headers:E,body:A,timeoutMs:w,lookupFn:q,realFetch:v,untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,importUndici:U,validateResponse:y,signal:T,redirectPolicy:f,maxRedirects:u});return Yr?.("succeeded"),Z}catch(Z){k=Z;let he=Ot=>{if(!Z||typeof Z!="object"&&typeof Z!="function"||te.isProxy(Z))return;let _e=Object.getOwnPropertyDescriptor(Z,Ot);return _e&&Object.hasOwn(_e,"value")?_e.value:void 0},Je=he("status");Yr?.("failed",Je);let xi=he("oracleTimeout")===!0||he("name")==="AbortError"||he("name")==="TimeoutError"||Ce(T),vi=new Set([408,425,429]),Ai=he("retryable")===!1?!1:Je!=null?vi.has(Je)||ca.has(Je)&&pn.has(g):!xi&&pn.has(g);if(I===N||!Ai)throw Z;let Jr=Ia(I,he("retryAfter")),Ii=et("retry"),Xr=!1;try{T?await new Promise((Ot,_e)=>{let Qr,Te=()=>{clearTimeout(Qr),hn.call(T,"abort",Te),_e(ma(T)||new DOMException("Aborted","AbortError"))};if(Ce(T)){Te();return}Qr=setTimeout(()=>{hn.call(T,"abort",Te),Ot()},Jr),pa.call(T,"abort",Te,{once:!0}),Ce(T)&&Te()}):await ka(Jr),Xr=!0}finally{Ii?.(Xr?"succeeded":"failed")}}}throw k};if(!(n("dedupe")!==!1&&!T&&En(g,A)))return M();let K=Aa(g,e,E,{untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,redirectPolicy:f,maxRedirects:u,timeoutMs:w,retries:N,fetchImpl:rt(h),realFetch:v,lookupFn:rt(q),importUndici:rt(U),validateResponse:rt(y)},A),se=Ut.get(K);if(se){let k=et("shared");try{let I=await se;return k?.("succeeded"),I}catch(I){throw k?.("failed"),I}}let R=M().finally(()=>Ut.delete(K));return Ut.set(K,R),R}var ca,pn,ua,mn,la,da,fa,pa,hn,wn,Ce,ma,ha,nt,Zu,ee,Ut,gn,yn,xa,va,ka,j=l(()=>{ln();fn();ca=new Set([408,425,429,500,502,503,504]),pn=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]),ua=2,mn=4e3,la=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted")?.get,da=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"reason")?.get,fa=AbortSignal.prototype.throwIfAborted,pa=EventTarget.prototype.addEventListener,hn=EventTarget.prototype.removeEventListener,wn=typeof AbortSignal.any=="function"?AbortSignal.any.bind(AbortSignal):null,Ce=e=>e?la.call(e):!1,ma=e=>e?da.call(e):void 0,ha=new Set([301,302,303,307,308]),nt=3,Zu=64*1024,ee=Object.freeze({depth:32,nodes:1e4,fields:1e4,arrayLength:1e4,bytes:1024*1024});Ut=new Map,gn=new WeakMap,yn=1;xa=new Set(["eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","getHealth","minimumLedgerSlot","net_version","simulateTransaction","web3_clientVersion"]),va=new Set(["allMids","l2Book","outcomeMeta","spotClearinghouseState","userFills","meta","metaAndAssetCtxs","perpDexs","candleSnapshot","fundingHistory","openOrders","frontendOpenOrders","clearinghouseState","spotMeta","validatorSummaries","delegatorSummary","delegations","delegatorRewards","delegatorHistory","maxBuilderFee"]);ka=e=>new Promise(t=>setTimeout(t,e))});var Ne,Sn=l(()=>{Ne={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},elysium:{chainId:1339,name:"Elysium",rpcEnv:["ELYSIUM_RPC_URL"],evm:!0,readOnly:!0}}});function jt(e){return Na.get(Number(e))||null}function xn(e,t=process.env){let r=jt(e);if(!r)return null;for(let n of r.rpcEnv){let o=(t[n]||"").trim();if(o)return o}return null}var Na,ot=l(()=>{Sn();Na=new Map(Object.values(Ne).map(e=>[e.chainId,e]))});import{Interface as Ra,getAddress as La}from"ethers";function Ht(e,t){try{return La(e).toLowerCase()}catch{throw new Error(`${t} must be a valid EVM address`)}}function Pa(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 zt(e){return e==null?null:Number.parseInt(String(e),16)}function Ba(e,{rpcUrl:t,env:r=process.env}={}){if(t)return t;let n=xn(e,r);return n||$a[Number(e)]||null}function Fa(e){let t=String(e||""),r=t.toLowerCase();if(t!==t.trim()||!/^[a-zA-Z0-9_]+$/.test(t)||!Da.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 qa(e){let t=new Error(e?.message||JSON.stringify(e));return t.code=e?.code,t}function Ua(e){if(e?.error)throw qa(e.error);return e?.result}function Ma(e,t,r){return`${e}
|
|
1
|
+
var Ti=Object.defineProperty;var u=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var Xe=(e,t)=>{for(var r in t)Ti(e,r,{get:t[r],enumerable:!0})};import Qe from"node:fs";import Ci from"node:os";import ge from"node:path";import{fileURLToPath as Ni}from"node:url";function Nt(){return process.env.ORACLE_FAKE_HOME||Ci.homedir()}function Li(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function ye(){return Li()?process.env.ORACLE_CONFIG_DIR||ge.join(Nt(),".config","oracle"):ge.join(Nt(),".config","oracle")}function Pi(){return ge.join(ye(),"desk.json")}function $i(){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=$i();if(Qe.existsSync(o))for(let i of Qe.readFileSync(o,"utf8").split(/\r?\n/)){let s=i.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!s||s[2].startsWith("#"))continue;let d=s[2];(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))&&(d=d.slice(1,-1)),r(s[1],d)}}catch{}try{let o=Pi();if(Qe.existsSync(o)){let i=JSON.parse(Qe.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 Ri,L,Ze=u(()=>{Ri=ge.dirname(Ni(import.meta.url)),L=ge.resolve(Ri,"../..");try{we()}catch{}});import{AsyncLocalStorage as ta}from"node:async_hooks";function et(e){let t=ra.getStore();if(!t||t.closed||!na.includes(e))return null;if(t.spans.length>=oa)return t.droppedSpans++,null;let r={stage:e,startMs:t.now()-t.start,durationMs:null,outcome:"pending",status:null};return t.spans.push(r),(n,o=null)=>{t.closed||r.durationMs!==null||(r.durationMs=Math.max(0,t.now()-t.start-r.startMs),r.outcome=n==="succeeded"?"succeeded":"failed",r.status=Number.isInteger(o)&&o>=100&&o<=599?o:null)}}var ra,na,oa,hn=u(()=>{ra=new ta,na=["http","retry","shared"],oa=512});import ue from"node:net";import ia from"node:dns";function tt(e){let t=String(e).toLowerCase().split("%")[0];if((t.match(/::/g)||[]).length>1)return null;let r=l=>{if(!l)return[];let m=l.split(":"),b=m.at(-1);if(b?.includes(".")){let p=b.split(".").map(Number);if(p.length!==4||p.some(h=>!Number.isInteger(h)||h<0||h>255))return null;m.splice(m.length-1,1,(p[0]<<8|p[1]).toString(16),(p[2]<<8|p[3]).toString(16))}return m.some(p=>!/^[0-9a-f]{1,4}$/.test(p))?null:m.map(p=>Number.parseInt(p,16))},[n,o]=t.split("::"),i=r(n),s=r(o);if(!i||!s)return null;let d=t.includes("::"),c=8-i.length-s.length;if(!d&&c!==0||d&&c<1)return null;let f=[...i,...Array(Math.max(0,c)).fill(0),...s];return f.length!==8?null:Uint8Array.from(f.flatMap(l=>[l>>8,l&255]))}function Dt(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 Ft(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=tt(e);if(!t)return!1;let r=tt("::ffff:0:0");return Dt(t,r,96)?Ft([...t.slice(12)].join(".")):Dt(t,tt("2000::"),3)?![["2001::",23],["2001:db8::",32],["2001:10::",28],["2001:2::",48],["2002::",16],["3fff::",20]].some(([o,i])=>Dt(t,tt(o),i)):!1}return!1}function sa(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(aa.has(r)||r.endsWith(".localhost")||r.endsWith(".internal"))return{ok:!1,error:`refused internal host ${r}`};let n=ue.isIP(r);return n!==0&&!Ft(r)?{ok:!1,error:`refused private address ${r}`}:{ok:!0,url:t,host:r,isLiteralIp:n!==0}}async function qt(e,{lookupFn:t=ia.promises.lookup}={}){let r=sa(e);if(!r.ok)return r;if(r.isLiteralIp)return{ok:!0,url:r.url,addresses:[{address:r.host,family:ue.isIPv6(r.host)?6:4}]};let n;if(process.env.ORACLE_HOSTED_EGRESS_PROXY)return{ok:!0,url:r.url,addresses:[]};try{n=await t(r.host,{all:!0,verbatim:!0})}catch{return{ok:!1,error:`refused: ${r.host} did not resolve`}}return!Array.isArray(n)||n.length===0||n.some(o=>!Ft(o.address))?{ok:!1,error:`refused: ${r.host} resolves to a non-public address`}:{ok:!0,url:r.url,addresses:n}}function ca(e=process.env){let t=e.ORACLE_HOSTED_EGRESS_PROXY||"";if(!t)return null;let r;try{r=new URL(t)}catch{throw new Error("egress-guard: ORACLE_HOSTED_EGRESS_PROXY is not a URL")}if(r.protocol!=="http:"||!["127.0.0.1","::1","localhost","[::1]"].includes(r.hostname)||!r.port||r.username||r.password)throw new Error("egress-guard: egress proxy must be an exact loopback http origin");let n=e.ORACLE_HOSTED_EGRESS_TOKEN||"";if(!/^[A-Za-z0-9_-]{43}$/.test(n))throw new Error("egress-guard: egress proxy token is missing");return{uri:r.origin,token:n}}async function Mt({requireUndici:e=!1,importUndici:t=()=>import("undici")}={}){let r,n,o;try{o=await t(),r=o.Agent,n=o.fetch}catch(p){if(e)throw new Error(`egress-guard: untrustedUrl pinning requires the undici package, which failed to load: ${p?.message||p}`);return null}if(typeof r!="function"||typeof n!="function"){if(e)throw new Error("egress-guard: untrustedUrl pinning requires undici's Agent and fetch exports, which were not found on the imported module");return null}let i=p=>String(p).toLowerCase().replace(/^\[|\]$/g,"").replace(/\.+$/,""),s=new Map,d=p=>(Array.isArray(p)?p:[p]).map(h=>typeof h=="string"?{address:h}:h).filter(h=>h&&h.address).map(h=>({address:h.address,family:h.family||(ue.isIPv6(h.address)?6:4)})),c=(p,h,w)=>{s.set(i(p),d(typeof h=="string"?[{address:h,family:w}]:h))},f=p=>{let h=i(p);if(ue.isIP(h))return[{address:h,family:ue.isIPv6(h)?6:4}];let w=s.get(h);if(!w||!w.length)throw new Error(`refused: unpinned host ${p} during pinned fetch`);return w},l=ca(),m=l&&typeof o.ProxyAgent=="function"?new o.ProxyAgent({uri:l.uri,token:`Bearer ${l.token}`,connectTimeout:1e4}):new r({connect:{lookup(p,h,w){let g;try{g=f(p)}catch(S){return w(S)}return h?.all?w(null,g):w(null,g[0].address,g[0].family)}}}),b=la((p,h={})=>n(p,{...h,dispatcher:m}),c);return{dispatcher:m,fetch:b,pin:c,resolve:f,async close(){try{await m.destroy()}catch{}}}}function la(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[Ut]=Object.freeze({pin:t}),e}function jt(e){return typeof e=="function"&&typeof e[Ut]?.pin=="function"}function wn(e,t,r){if(!jt(e))throw new Error("pinFetchToAddresses: fetchImpl is not pin-capable");e[Ut].pin(t,r)}var aa,Ut,gn=u(()=>{aa=new Set(["localhost","metadata.google.internal","metadata.goog"]);Ut=Symbol.for("oracle.egressGuard.pinCapableFetch")});import{createHash as ua}from"node:crypto";import{types as te}from"node:util";function C(e){return ae(`HTTP JSON body refused: ${e}`)}function ba(e){return["isArgumentsObject","isArrayBuffer","isAnyArrayBuffer","isArrayBufferView","isBoxedPrimitive","isDataView","isDate","isExternal","isGeneratorObject","isKeyObject","isCryptoKey","isMap","isMapIterator","isModuleNamespaceObject","isNativeError","isPromise","isRegExp","isSet","isSetIterator","isTypedArray","isWeakMap","isWeakSet"].some(t=>typeof te[t]=="function"&&te[t](e))}function Ea(e){let t=[],r=0,n=0,o=0,i=0,s=new WeakSet,d=l=>{if(r+=Buffer.byteLength(l,"utf8"),r>ee.bytes)throw C("serialized byte limit exceeded");t.push(l)},c=l=>{if(Buffer.byteLength(l,"utf8")>ee.bytes)throw C("serialized byte limit exceeded");return JSON.stringify(l)},f=(l,m)=>{if(n+=1,n>ee.nodes)throw C("node limit exceeded");if(m>ee.depth)throw C("depth limit exceeded");if(l===null){d("null");return}if(typeof l=="string"){d(c(l));return}if(typeof l=="boolean"){d(l?"true":"false");return}if(typeof l=="number"){if(!Number.isFinite(l))throw C("non-finite number");d(Object.is(l,-0)?"0":String(l));return}if(typeof l!="object")throw C("unsupported non-JSON value");if(te.isProxy(l))throw C("proxy value");if(ba(l))throw C("unsupported exotic object");if(s.has(l))throw C("cyclic value");s.add(l);try{if(Object.getOwnPropertySymbols(l).length>0)throw C("symbol-keyed fields are unsupported");if(Array.isArray(l)){let h=Object.getPrototypeOf(l),w=0;for(;h!==null;){if(te.isProxy(h))throw C("proxy array prototype");if(w+=1,w>ee.depth)throw C("array prototype depth limit exceeded");h=Object.getPrototypeOf(h)}if(l.length>ee.arrayLength)throw C("array length limit exceeded");for(let S=0;S<l.length;S+=1){let P=Object.getOwnPropertyDescriptor(l,String(S));if(!P||!Object.hasOwn(P,"value")||P.enumerable!==!0)throw C("array entries must be dense enumerable own data")}let g=0;for(let S in l){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(Object.hasOwn(l,S)&&(g+=1,g>l.length))throw C("named array fields are unsupported")}if(g!==l.length)throw C("array entries must be dense enumerable own data");d("[");for(let S=0;S<l.length;S+=1)S&&d(","),f(Object.getOwnPropertyDescriptor(l,String(S)).value,m+1);d("]");return}let b=Object.getPrototypeOf(l);if(b!==Object.prototype&&b!==null)throw C("non-plain object");let p=[];for(let h in l){if(i+=1,i>ee.fields)throw C("enumeration limit exceeded");if(!Object.hasOwn(l,h))continue;if(o+=1,o>ee.fields)throw C("field limit exceeded");let w=Object.getOwnPropertyDescriptor(l,h);if(!w||!Object.hasOwn(w,"value")||w.enumerable!==!0)throw C("object fields must be enumerable own data");p.push([h,w.value])}d("{");for(let h=0;h<p.length;h+=1)h&&d(","),d(c(p[h][0])),d(":"),f(p[h][1],m+1);d("}")}finally{s.delete(l)}};return f(e,0),t.join("")}function Sa(e){let t=Object.create(null);if(e==null)return t;if(typeof e!="object"&&typeof e!="function")throw new TypeError("HTTP headers must be an object");if(te.isProxy(e))throw new TypeError("HTTP headers must not be a proxy");if(Object.getOwnPropertySymbols(e).length>0)throw new TypeError("HTTP headers must not contain symbol fields");let r=new Set;for(let n of Object.keys(e)){if(!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u.test(n))throw new TypeError("HTTP header names must be valid tokens");let o=n.toLowerCase();if(r.has(o))throw new TypeError("HTTP headers contain a duplicate canonical name");r.add(o);let i=Object.getOwnPropertyDescriptor(e,n);if(!i||!Object.hasOwn(i,"value"))throw new TypeError("HTTP headers must contain own data properties");let s=i.value;if(s==null||["object","function","symbol"].includes(typeof s))throw new TypeError("HTTP header values must be scalar");t[n]=String(s)}return t}function xa(){return Object.assign(Object.create(null),{Accept:"application/json"})}function va(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 Aa(e,t){return new URL(String(e)).origin===new URL(String(t)).origin}function rt(e){if((typeof e!="object"||e===null)&&typeof e!="function")return`${typeof e}:${String(e)}`;let t=xn.get(e);return t||(t=vn,vn+=1,xn.set(e,t)),`reference:${t}`}function An(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?Ia.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 In(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(An);if(!r||typeof r!="object")return!1;if(Object.hasOwn(r,"jsonrpc")||Object.hasOwn(r,"method"))return An(r);let n=Object.hasOwn(r,"type")?r.type:null;return typeof n=="string"&&ka.has(n)&&(!Object.hasOwn(r,"action")||r.action==null)&&(!Object.hasOwn(r,"signature")||r.signature==null)&&(!Object.hasOwn(r,"nonce")||r.nonce==null)}function Oa(e,t,r,n={},o=null){let i=ua("sha256"),s=(c,f)=>{let l=String(f);i.update(String(Buffer.byteLength(c,"utf8"))).update(":").update(c),i.update("=").update(String(Buffer.byteLength(l,"utf8"))).update(":").update(l).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 _a(e,t){let r=Number(t);return Number.isFinite(r)&&r>0?Math.min(r*1e3,bn):Math.min(250*2**e,bn)+Math.floor(Math.random()*100)}function ae(e,t={}){let r=new Error(e);return r.retryable=!1,Object.assign(r,t),r}function zt(e,t,r){return ae(`HTTP response from ${e} exceeded maxResponseBytes ${r} (${t})`,{oversize:!0})}function de(e){try{let t=e?.body?.cancel?.();t&&typeof t.then=="function"&&t.catch(()=>{})}catch{}}function Ca(e){return e?e.byteLength??e.length??0:0}async function Na(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&&(de(e),!n))throw zt(r,`content-length ${i}`,t);let s=e.body?.getReader?.();if(!s){let m=await e.text(),b=Buffer.byteLength(m,"utf8");if(b>t){if(!n)throw zt(r,`body ${b} bytes`,t);return Buffer.from(m,"utf8").subarray(0,t).toString("utf8")}return m}let d=[],c=0,f=!1;try{for(;;){let{value:m,done:b}=await s.read();if(b)break;if(m&&(d.push(Buffer.from(m)),c+=Ca(m),c>t)){f=!0;break}}}finally{if(f)try{await s.cancel()}catch{}try{s.releaseLock?.()}catch{}}if(f&&(typeof o=="function"&&o(),!n))throw zt(r,`streamed ${c} bytes`,t);let l=Buffer.concat(d);return(f?l.subarray(0,t):l).toString("utf8")}function Ra(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function La(e,{fetchImpl:t,method:r,headers:n,body:o,timeoutMs:i,lookupFn:s,realFetch:d,untrustedUrl:c=!1,maxResponseBytes:f=null,sameOriginRedirectsOnly:l=!1,importUndici:m,validateResponse:b,signal:p,redirectPolicy:h="follow",maxRedirects:w=nt}){let g=null,S=t,P=s?{lookupFn:s}:{};if(c&&!d&&!jt(S))throw ae(`HTTP refused ${e}: untrustedUrl requires a pin-capable fetchImpl (see markPinCapableFetch in egress-guard.mjs) or no fetchImpl override so Oracle can pin the connection itself`);let E=new AbortController,A=setTimeout(()=>E.abort(),i),N=p?Sn?Sn([p,E.signal]):p:E.signal,q=async(v,{status:x=null}={})=>{let _=await qt(v,P);if(!_.ok)throw ae(x==null?`HTTP refused ${v}: ${_.error}`:`HTTP redirect to ${v} ${_.error}`,x==null?{}:{status:x});let M=new URL(v).hostname;if(d){if(g&&(await g.close(),g=null),!g)try{g=await Mt({requireUndici:!0,...m?{importUndici:m}:{}})}catch(y){throw ae(x==null?`HTTP refused ${v}: ${y?.message||y}`:`HTTP redirect to ${v} refused: ${y?.message||y}`,x==null?{}:{status:x})}g.pin(M,_.addresses),S=g.fetch}else wn(S,M,_.addresses);return _};try{let v=String(e),x=Object.assign(Object.create(null),n||{});c&&await q(v);for(let _=0;_<=w;_+=1){let M=Object.assign(Object.create(null),{method:r,headers:x,body:o,signal:N,redirect:"manual",dispatcher:void 0}),y=await S(v,M);if((h==="error"||w===0)&&y.status>=300&&y.status<400)throw de(y),ae(`HTTP ${y.status} ${r} redirect refused`,{status:y.status,redirectRefused:!0});if(ya.has(y.status)){let U=l===!0&&r==="POST"&&[307,308].includes(y.status)&&In(r,o);if(r!=="GET"&&r!=="HEAD"&&!U){de(y);let R=new Error(`HTTP ${y.status} ${r} ${v} redirected non-idempotent request`);throw R.status=y.status,R}if(_===w)throw de(y),ae(`HTTP ${y.status} ${r} redirect budget exhausted`,{status:y.status,redirectRefused:!0});let Zr=y.headers?.get?.("location"),K;try{K=va(Zr,v)}catch(R){throw de(y),R}let ce=!Aa(K,v);if(de(y),ce&&r==="POST"){let R=new Error(`HTTP ${y.status} ${r} cross-origin redirect refused`);throw R.status=y.status,R}if(ce&&l){let R=new Error(`HTTP ${y.status} ${r} cross-origin redirect refused`);throw R.status=y.status,R.retryable=!1,R}if(ce&&(x=xa(x)),c)await q(K,{status:y.status});else if(ce){let R=await qt(K,P);if(!R.ok){let k=new Error(`HTTP redirect from ${v} ${R.error}`);throw k.status=y.status,k.retryable=!1,k}d&&R.addresses?.length&&(g||(g=await Mt(m?{importUndici:m}:{})),g&&(g.pin(new URL(K).hostname,R.addresses),S=g.fetch))}v=K;continue}if(typeof b=="function")try{await b(y,{url:v})}catch(U){throw de(y),ae(U?.message||String(U))}let T=await Na(y,f,{url:v,onOversize:()=>E.abort()}),Oe=Ra(T);if(!y.ok){let U=new Error(`HTTP ${y.status} ${r} ${v}`);throw U.status=y.status,U.retryAfter=y.headers?.get?.("retry-after")??null,U.body=Oe??T.slice(0,300),U}return Oe??T}throw new Error(`HTTP redirect loop for ${e}`)}catch(v){if(E.signal.aborted&&!Ce(p)){let x=v&&(typeof v=="object"||typeof v=="function")&&!te.isProxy(v)?v:null,_=x?Object.getOwnPropertyDescriptor(x,"oversize"):null;if(!(_&&Object.hasOwn(_,"value")&&_.value===!0))try{if(!x)throw new TypeError("unsafe rejection");Object.defineProperties(x,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}})}catch{let y=new Error("HTTP request timed out");throw Object.defineProperties(y,{oracleTimeout:{value:!0,enumerable:!1},retryable:{value:!1,enumerable:!1}}),y}}throw v}finally{clearTimeout(A),g&&await g.close()}}async function V(e,t={}){if(t!=null&&typeof t!="object"&&typeof t!="function")throw new TypeError("HTTP options must be an object");if(t!=null&&te.isProxy(t))throw new TypeError("HTTP options must not be a proxy");let r=new Set(["body","dedupe","fetchImpl","headers","importUndici","lookupFn","maxRedirects","maxResponseBytes","method","redirectPolicy","retries","sameOriginRedirectsOnly","signal","timeoutMs","untrustedUrl","validateResponse"]);if(t!=null){if(Object.getOwnPropertySymbols(t).length>0)throw new TypeError("HTTP options contain unknown fields");for(let k of Object.getOwnPropertyNames(t)){let I=Object.getOwnPropertyDescriptor(t,k);if(!(k==="toJSON"&&I&&Object.hasOwn(I,"value")&&I.value===void 0)){if(!r.has(k))throw new TypeError("HTTP options contain unknown fields");if(!I||!I.enumerable||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain enumerable own data properties")}}}let n=k=>{if(t==null||!Object.hasOwn(t,k))return;let I=Object.getOwnPropertyDescriptor(t,k);if(!I||!Object.hasOwn(I,"value"))throw new TypeError("HTTP options must contain own data properties");return I.value};if(typeof e!="string"||e.length===0||e.length>8192)throw new TypeError("HTTP URL must be a bounded string");let o=n("method");if(o!==void 0&&(typeof o!="string"||!/^[A-Za-z]+$/u.test(o)))throw new TypeError("HTTP method must be a string token");let i=n("timeoutMs");if(i!==void 0&&(!Number.isInteger(i)||i<1||i>12e4))throw new TypeError("HTTP timeoutMs must be a bounded integer");let s=n("retries");if(s!==void 0&&(!Number.isInteger(s)||s<0||s>10))throw new TypeError("HTTP retries must be a bounded integer");let d=n("redirectPolicy");if(d!==void 0&&d!=="follow"&&d!=="error")throw new TypeError('HTTP redirectPolicy must be "follow" or "error"');let c=n("maxRedirects");if(c!==void 0&&(!Number.isInteger(c)||c<0||c>nt))throw new TypeError(`HTTP maxRedirects must be an integer from 0 through ${nt}`);if(d==="error"&&c!==void 0&&c!==0)throw new TypeError('HTTP redirectPolicy "error" requires maxRedirects 0 when supplied');let f=d??"follow",l=f==="error"?0:c??nt;for(let k of["dedupe","untrustedUrl","sameOriginRedirectsOnly"]){let I=n(k);if(I!==void 0&&typeof I!="boolean")throw new TypeError(`HTTP ${k} must be boolean`)}let m=n("maxResponseBytes");if(m!==void 0&&(!Number.isInteger(m)||m<1||m>64*1024*1024))throw new TypeError("HTTP maxResponseBytes must be a bounded integer");let b=n("signal");if(b!==void 0){if(te.isProxy(b)||!(b instanceof AbortSignal))throw new TypeError("HTTP signal must be a native AbortSignal");try{Ce(b)}catch{throw new TypeError("HTTP signal must be a native AbortSignal")}}for(let k of["importUndici","lookupFn","validateResponse"]){let I=n(k);if(I!==void 0&&typeof I!="function")throw new TypeError(`HTTP ${k} must be a function`)}let p=n("fetchImpl"),h=p||globalThis.fetch;if(typeof h!="function")throw new Error("fetch unavailable \u2014 pass opts.fetchImpl");let w=i??12e3,g=(o||"GET").toUpperCase(),S=n("headers"),P=Sa(S),E=Object.assign(Object.create(null),P);Object.keys(E).some(k=>k.toLowerCase()==="accept")||(E.Accept="application/json");let A=n("body");A!=null&&typeof A!="string"&&(Object.keys(E).find(I=>I.toLowerCase()==="content-type")||(E["Content-Type"]="application/json"),A=Ea(A));let N=s??fa,q=n("lookupFn"),v=!p,x=n("untrustedUrl")===!0,_=n("sameOriginRedirectsOnly")===!0,M=n("importUndici"),y=n("validateResponse"),T=b,Oe=m??null,U=async()=>{let k;for(let I=0;I<=N;I++){T&&ha.call(T);let en=et("http");try{let Z=await La(e,{fetchImpl:h,method:g,headers:E,body:A,timeoutMs:w,lookupFn:q,realFetch:v,untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,importUndici:M,validateResponse:y,signal:T,redirectPolicy:f,maxRedirects:l});return en?.("succeeded"),Z}catch(Z){k=Z;let he=Ct=>{if(!Z||typeof Z!="object"&&typeof Z!="function"||te.isProxy(Z))return;let _e=Object.getOwnPropertyDescriptor(Z,Ct);return _e&&Object.hasOwn(_e,"value")?_e.value:void 0},Ye=he("status");en?.("failed",Ye);let Ii=he("oracleTimeout")===!0||he("name")==="AbortError"||he("name")==="TimeoutError"||Ce(T),ki=new Set([408,425,429]),Oi=he("retryable")===!1?!1:Ye!=null?ki.has(Ye)||da.has(Ye)&&yn.has(g):!Ii&&yn.has(g);if(I===N||!Oi)throw Z;let tn=_a(I,he("retryAfter")),_i=et("retry"),rn=!1;try{T?await new Promise((Ct,_e)=>{let nn,Te=()=>{clearTimeout(nn),En.call(T,"abort",Te),_e(ga(T)||new DOMException("Aborted","AbortError"))};if(Ce(T)){Te();return}nn=setTimeout(()=>{En.call(T,"abort",Te),Ct()},tn),wa.call(T,"abort",Te,{once:!0}),Ce(T)&&Te()}):await Ta(tn),rn=!0}finally{_i?.(rn?"succeeded":"failed")}}}throw k};if(!(n("dedupe")!==!1&&!T&&In(g,A)))return U();let K=Oa(g,e,E,{untrustedUrl:x,maxResponseBytes:Oe,sameOriginRedirectsOnly:_,redirectPolicy:f,maxRedirects:l,timeoutMs:w,retries:N,fetchImpl:rt(h),realFetch:v,lookupFn:rt(q),importUndici:rt(M),validateResponse:rt(y)},A),ce=Ht.get(K);if(ce){let k=et("shared");try{let I=await ce;return k?.("succeeded"),I}catch(I){throw k?.("failed"),I}}let R=U().finally(()=>Ht.delete(K));return Ht.set(K,R),R}var da,yn,fa,bn,pa,ma,ha,wa,En,Sn,Ce,ga,ya,nt,iu,ee,Ht,xn,vn,Ia,ka,Ta,j=u(()=>{hn();gn();da=new Set([408,425,429,500,502,503,504]),yn=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]),fa=2,bn=4e3,pa=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted")?.get,ma=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"reason")?.get,ha=AbortSignal.prototype.throwIfAborted,wa=EventTarget.prototype.addEventListener,En=EventTarget.prototype.removeEventListener,Sn=typeof AbortSignal.any=="function"?AbortSignal.any.bind(AbortSignal):null,Ce=e=>e?pa.call(e):!1,ga=e=>e?ma.call(e):void 0,ya=new Set([301,302,303,307,308]),nt=3,iu=64*1024,ee=Object.freeze({depth:32,nodes:1e4,fields:1e4,arrayLength:1e4,bytes:1024*1024});Ht=new Map,xn=new WeakMap,vn=1;Ia=new Set(["eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","getHealth","minimumLedgerSlot","net_version","simulateTransaction","web3_clientVersion"]),ka=new Set(["allMids","l2Book","outcomeMeta","spotClearinghouseState","userFills","meta","metaAndAssetCtxs","perpDexs","candleSnapshot","fundingHistory","openOrders","frontendOpenOrders","clearinghouseState","spotMeta","validatorSummaries","delegatorSummary","delegations","delegatorRewards","delegatorHistory","maxBuilderFee"]);Ta=e=>new Promise(t=>setTimeout(t,e))});var Ne,kn=u(()=>{Ne={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},elysium:{chainId:1339,name:"Elysium",rpcEnv:["ELYSIUM_RPC_URL"],evm:!0,readOnly:!0}}});function Wt(e){return Pa.get(Number(e))||null}function On(e,t=process.env){let r=Wt(e);if(!r)return null;for(let n of r.rpcEnv){let o=(t[n]||"").trim();if(o)return o}return null}var Pa,ot=u(()=>{kn();Pa=new Map(Object.values(Ne).map(e=>[e.chainId,e]))});import{Interface as $a,getAddress as Ba}from"ethers";function Vt(e,t){try{return Ba(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 Kt(e){return e==null?null:Number.parseInt(String(e),16)}function qa(e,{rpcUrl:t,env:r=process.env}={}){if(t)return t;let n=On(e,r);return n||Fa[Number(e)]||null}function Ua(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 ja(e){let t=new Error(e?.message||JSON.stringify(e));return t.code=e?.code,t}function Ha(e){if(e?.error)throw ja(e.error);return e?.result}function za(e,t,r){return`${e}
|
|
3
3
|
${t}
|
|
4
|
-
${JSON.stringify(r??[])}`}async function ja(e,t,r){return V(e,{method:"POST",body:t,fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs??12e3,signal:r.signal})}async function Y(e,t,r=[],n={}){let o=String(t||""),i=Fa(o),s=Ba(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=vn.get(s);if(u!=null)return u}let c=n.dedupe!==!1&&!n.signal?Ma(s,o,r):null;if(c&&Re.has(c))return Re.get(c);let f=(async()=>{let u=await ja(s,{jsonrpc:"2.0",id:1,method:t,params:r},n),m=Ua(u);return i==="eth_chainid"&&typeof m=="string"&&vn.set(s,m),m})();return c&&(Re.set(c,f),f.finally(()=>{Re.get(c)===f&&Re.delete(c)}).catch(()=>{})),f}async function An(e={},t={}){let r=Number(e.chainId??t.chainId??1),n=Pa(e.txHash||e.hash||e.transactionHash),o=await Y(r,"eth_getTransactionReceipt",[n],t);if(!o)return{ok:!1,chainId:r,txHash:n,status:"pending",receipt:null,reason:"receipt pending"};let i=zt(o.status),s=i===1,d=i===1?"success":i===0?"reverted":"unknown",c=s?null:d==="reverted"?"transaction reverted":"unknown receipt status",f=e.expectedTo?Ht(e.expectedTo,"expectedTo"):null,u=o.to?Ht(o.to,"receipt.to"):null;return f&&u!==f&&(s=!1,c=`to mismatch: expected ${f}, got ${u||"null"}`),{ok:s,chainId:r,txHash:n,status:d,reason:c,statusCode:i,to:u,from:o.from?Ht(o.from,"receipt.from"):null,blockNumber:zt(o.blockNumber),transactionIndex:zt(o.transactionIndex),logs:Array.isArray(o.logs)?o.logs:[],receipt:o}}var cl,$a,Da,Re,vn,J=l(()=>{j();ot();cl=new Ra(["function allowance(address owner,address spender) view returns (uint256)","function balanceOf(address account) view returns (uint256)"]);$a={1:"https://ethereum.publicnode.com",137:"https://polygon-bor-rpc.publicnode.com",42161:"https://arbitrum-one-rpc.publicnode.com",8453:"https://base-rpc.publicnode.com",10:"https://optimism-rpc.publicnode.com",988:"https://rpc.stable.xyz",56:"https://bsc-rpc.publicnode.com",43114:"https://avalanche-c-chain-rpc.publicnode.com",999:"https://rpc.hyperliquid.xyz/evm",2741:"https://api.mainnet.abs.xyz",4663:"https://rpc.mainnet.chain.robinhood.com",1339:"https://rpc.elysiumchain.tech"};Da=/^(?:eth_(?:call|blocknumber|chainid|get[a-z0-9]+|feehistory|gasprice|maxpriorityfeepergas|syncing|protocolversion|estimategas|createaccesslist)|net_(?:version|listening|peercount)|web3_(?:clientversion|sha3))$/;Re=new Map,vn=new Map});var Wt=l(()=>{});var pl,it=l(()=>{j();Wt();pl=Object.freeze({1:"ethereum",10:"optimism",56:"bsc",137:"polygon",8453:"base",42161:"arbitrum",43114:"avalanche",999:"hyperevm",4663:"robinhood"})});var Le=l(()=>{});var Ee=l(()=>{});var X=l(()=>{Le();Ee()});var za,El,F=l(()=>{za=300*1e3,El=(()=>{let e=Number(process.env.ORACLE_PREPARE_HARD_MAX_AGE_MS);return Number.isFinite(e)&&e>0?e:1800*1e3})()});import{Interface as In,getAddress as vl,isAddress as Al}from"ethers";var Kt,Tl,Cl,Gt=l(()=>{J();it();X();F();Kt={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 In(["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)"]),Cl=new In(["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 Yt,getAddress as Pl,isAddress as $l,keccak256 as Bl}from"ethers";var Ml,Jt,jl,Hl,zl,Wl,Vl,Xt=l(()=>{J();it();X();F();Ml=Va.defaultAbiCoder(),Jt={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"}},jl=new Yt(["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 Yt(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),zl=new Yt(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96,int24 tick,uint24 protocolFee,uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Wl=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"]]),Vl=(1n<<14n)-1n});var er=l(()=>{});import{Contract as od,JsonRpcProvider as id}from"ethers";var kn=l(()=>{});var ud,ct=l(()=>{kn();ud=Object.freeze({swap:5,bridge:5,perps:0,nft:0})});var _n=l(()=>{j();X();er();F();ct()});var Tn=l(()=>{j();X();F();ct()});var ut=l(()=>{});var Rn=l(()=>{j();X();ut();F()});var $d,Ln=l(()=>{$d=Object.freeze({READ:"read",PREPARE:"prepare",EXECUTE:"execute",AUTONOMOUS:"autonomous"})});import{TypedDataEncoder as Ud,getAddress as Md,isAddress as jd}from"ethers";var Ja,Yd,Xa,Jd,tr=l(()=>{j();X();Ln();er();F();Ja=Object.freeze({1:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",100:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",42161:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",8453:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41"}),Yd=Object.freeze({1:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",100:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",42161:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",8453:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110"}),Xa=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"}]}),Jd=Object.freeze({OrderCancellations:[{name:"orderUids",type:"bytes[]"}]})});function $e(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 sr=l(()=>{});var Hn=l(()=>{});var zn=l(()=>{});import{isAddress as Em}from"ethers";var cr=l(()=>{X();Le();Ee()});import{Interface as Es,isAddress as km}from"ethers";var Cm,Wn=l(()=>{cr();Le();Ee();Cm=new Es(["function approve(address spender,uint256 amount) returns (bool)"])});import{Interface as Ss,isAddress as Lm}from"ethers";var Dm,Fm,Vn=l(()=>{cr();Le();Ee();Dm=new Ss(["function approve(address spender,uint256 amount) returns (bool)"]),Fm=Object.freeze({42161:"0x1c3fa76e6e1088bce750f23a5bfcffa1efef6a41",43114:"0x8f550e53dfe96c055d5bdb267c21f268fcaf63b2"})});var de=l(()=>{});import{Interface as xs,MaxUint256 as Wm,isAddress as Vm,keccak256 as Km,toUtf8Bytes as Gm}from"ethers";var eh,fe=l(()=>{zn();Wn();Vn();de();Ee();eh=new xs(["function approve(address spender,uint256 amount) returns (bool)"])});var Yn={};Xe(Yn,{SIGN_TIME_REVIEW_VERSION:()=>vs,SignTimeReviewSecretError:()=>Be,createSignTimeReview:()=>Gn});function lr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string"){let o=e.trim().split(/\s+/);if(_s.test(e)||Ts.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)=>lr(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(Os.test(i))throw new Be(`${t}.${o}`);e[o]!==void 0&&(n[o]=lr(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 De(e,t){if(e==null||e==="")throw new TypeError(`sign-time review: ${t} required`);return e}function xe(e,t){let r=String(De(e,t)).toLowerCase();if(!As.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 dr(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 Kn(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))Kn(t);Object.freeze(e)}return e}function Cs(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:dr(String(n),`${t}.reason`)}}function Ns(e){if(!Array.isArray(e))throw new TypeError("sign-time review: policyChecks must be an array");let t=e.map((n,o)=>Cs(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 Rs(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:dr(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 Ls(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:dr(String(De(t.asset??t.token,`assetDeltas[${r}].asset`)),`assetDeltas[${r}].asset`),before:n,after:o,delta:s}})}function Ps(e){if(e==null)return[];if(!Array.isArray(e))throw new TypeError("sign-time review: approvalDeltas must be an array");return e.map((t,r)=>{pe(t,`approvalDeltas[${r}]`);let n=re(t.amount??t.after,`approvalDeltas[${r}].amount`);if(t.revokeLike!=null&&typeof t.revokeLike!="boolean")throw new TypeError(`sign-time review: approvalDeltas[${r}].revokeLike must be boolean`);return{token:xe(t.token,`approvalDeltas[${r}].token`),spender:xe(t.spender,`approvalDeltas[${r}].spender`),owner:xe(t.owner,`approvalDeltas[${r}].owner`),amount:n,revokeLike:t.revokeLike??BigInt(n)===0n}})}function Gn(e={}){pe(e,"input");let t=lr(e),r=t.tx==null?t:pe(t.tx,"tx"),n=re(t.chainId??r.chainId,"chainId",{positive:!0}),o=xe(t.account??t.from??r.from,"account/from"),i=xe(t.destination??t.to??r.to,"destination/to"),s=String(De(t.prepareHash,"prepareHash")).toLowerCase();if(!ks.test(s))throw new TypeError("sign-time review: prepareHash must be a 32-byte hash");let d=t.route??t.venue;if(d==null)throw new TypeError("sign-time review: route/venue required");let c=t.decodedCalldata??t.decodedAction;if(c==null)throw new TypeError("sign-time review: decodedCalldata or decodedAction required");let f=String(De(t.calldata??t.data??r.data,"calldata/data")).toLowerCase();if(!Is.test(f))throw new TypeError("sign-time review: calldata/data must be even-length hex");let u=t.policyChecks!==void 0&&t.policyChecks!==null,m=Ns(u?t.policyChecks:[]),b=Rs(t.simulation),p=Ls(t.assetDeltas),h=Ps(t.approvalDeltas),w=t.allowlistHits??[];if(!Array.isArray(w))throw new TypeError("sign-time review: allowlistHits must be an array");let g=b?.willRevert===!0||["failed","error"].includes(b?.status),S=b!=null&&b.willRevert===!1&&["ok","success"].includes(b.status),P=g||m.failed>0?"BLOCKED":S&&u&&m.checks.length>0&&p!=null?"READY":"UNKNOWN",E=typeof c=="string"?c:c.method??c.action??c.type??"transaction",A=`${P}: review ${E} on chain ${n}; policy ${m.passed} passed, ${m.failed} failed; ${p?.length??0} asset delta${p?.length===1?"":"s"}; local signature required`,N={reviewVersion:1,status:P,requiresLocalSignature:!0,signingLocal:!0,custody:"none",execution:"review-only",chainId:n,account:o,from:o,route:d,venue:t.venue??(typeof d=="string"?d:d.venue??d.provider??null),destination:i,to:i,...t.spender==null?{}:{spender:xe(t.spender,"spender")},prepareHash:s,...t.decodedCalldata!==void 0?{decodedCalldata:t.decodedCalldata}:{decodedAction:t.decodedAction},calldata:f,data:f,selector:f.length>=10?f.slice(0,10):null,value:re(t.value??r.value??0,"value"),...(t.gasEstimate??r.gasEstimate)==null?{}:{gasEstimate:re(t.gasEstimate??r.gasEstimate,"gasEstimate")},...(t.gasLimit??r.gasLimit)==null?{}:{gasLimit:re(t.gasLimit??r.gasLimit,"gasLimit")},simulation:b,policyChecks:m,allowlistHits:w,assetDeltas:p,approvalDeltas:h,summary:A};return Kn(N)}var vs,As,Is,ks,Os,_s,Ts,Be,fr=l(()=>{vs=1,As=/^0x[0-9a-f]{40}$/,Is=/^0x(?:[0-9a-f]{2})*$/,ks=/^(?:0x)?[0-9a-f]{64}$/,Os=/(privatekey|privkey|secretkey|seedphrase|mnemonic|passphrase|password|keystore|keymaterial|wif|xprv|xpriv|bearer|authorization|signature|apikey|credential)/i,_s=/\b(?:[5KL][1-9A-HJ-NP-Za-km-z]{50,51}|xprv[0-9A-Za-z]{50,})\b/,Ts=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 nh,readdirSync as oh,existsSync as $s}from"node:fs";import{dirname as Bs,join as Fe}from"node:path";import{fileURLToPath as Ds}from"node:url";function Fs(){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($s(t))return t;return e[0]}var qe,ch,uh,Jn=l(()=>{fe();qe=Bs(Ds(import.meta.url));ch=Fs(),uh=(1n<<256n)-1n});var Xn=l(()=>{fr();fe();Jn()});import{Address as gh,NETWORK as yh,OutScript as bh,RawTx as Eh,SigHash as Sh,TEST_NETWORK as xh,Transaction as vh}from"@scure/btc-signer";var mr=l(()=>{});import{createHash as qs}from"node:crypto";import{base58 as Oh}from"@scure/base";import{getCompiledTransactionMessageDecoder as Th}from"@solana/transaction-messages";var Qn,Ch,hr=l(()=>{Qn=e=>qs("sha256").update(`global:${e}`).digest().subarray(0,8).toString("hex"),Ch=new Map([[Qn("route"),{name:"route",prefixBytes:0}],[Qn("shared_accounts_route"),{name:"shared_accounts_route",prefixBytes:1}]])});var Zn=l(()=>{});var eo=l(()=>{j();Zn()});var Uh,to=l(()=>{eo();Uh=Object.freeze({tradexyz:"xyz",ventuals:"vntl",hypernova:"hyna",paradex:"para",entropy:"io",entropyio:"io"})});var Wh,Vh,mt=l(()=>{de();to();Wh=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"}),Vh=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 Yh,gr=l(()=>{de();Yh="0x"+"00".repeat(32)});var Us,ew,ht=l(()=>{gr();de();Us=Object.freeze([["salt","uint256"],["maker","address"],["signer","address"],["tokenId","uint256"],["makerAmount","uint256"],["takerAmount","uint256"],["side","uint8"],["signatureType","uint8"],["timestamp","uint256"],["metadata","bytes32"],["builder","bytes32"]]),ew=Object.freeze(Us.map(e=>e[0]))});var Me=l(()=>{de()});var wt=l(()=>{fe();Xn();mr();hr();mt();ht();Me()});var gt=l(()=>{fe()});import{TypedDataEncoder as yw,getAddress as bw,isAddress as Ew}from"ethers";var Ms,js,co=l(()=>{F();Ms=Object.freeze({1:"0x111111125421cA6dc452d289314280a0f8842A65",8453:"0x111111125421cA6dc452d289314280a0f8842A65",42161:"0x111111125421cA6dc452d289314280a0f8842A65",10:"0x111111125421cA6dc452d289314280a0f8842A65",137:"0x111111125421cA6dc452d289314280a0f8842A65",56:"0x111111125421cA6dc452d289314280a0f8842A65"}),js=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 Aw,getAddress as Iw}from"ethers";var _w,yr=l(()=>{co();tr();_w=Object.freeze(["https://limit-orders.1inch.io","https://api.1inch.dev/orderbook"])});import{Interface as lo}from"ethers";var Ws,zw,Vs,Ww,Vw,Kw,Gw,Ks,Yw,yt=l(()=>{fe();X();F();gt();mr();hr();mt();ht();Me();yr();Ws=new Set(["evm","evm-swap","evm-bridge","evm-nft","evm-order","btc","sol","hl","poly","lighter"]),zw=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}),Vs=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"}}),Ww=Object.freeze({"0x161ac21f":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-public"},"0xc2f6663a":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-allowlist"}}),Vw=new lo(["function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),Kw=new lo(["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"]),Gw=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"}}),Ks=Object.freeze([...Ws]),Yw=Object.freeze({...Vs})});import{encode as Qw}from"@msgpack/msgpack";import{keccak256 as eg,verifyTypedData as tg}from"ethers";var rg,ng,br=l(()=>{rg=Object.freeze({name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"}),ng=Object.freeze({Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]})});var Er=l(()=>{Me()});import{ed25519 as dg}from"@noble/curves/ed25519.js";import{base58 as pg}from"@scure/base";import{RawTx as hg,SigHash as wg,Transaction as gg}from"@scure/btc-signer";import{Transaction as bg,keccak256 as Eg,verifyTypedData as Sg}from"ethers";var Sr=l(()=>{br();Er()});import{base58 as Tg}from"@scure/base";var je=l(()=>{wt();yt();gt();fe();Sr()});var po=l(()=>{je();yt()});import{wordlists as Js}from"ethers";function ec(e){let t=String(e).trim().toLowerCase().split(/\s+/).filter(Boolean);return Zs.has(t.length)&&t.every(r=>Js.en.getWordIndex(r)>=0)}function oc(e){let t=mo(e);return nc.has(t)||rc.test(t)}function mo(e){return String(e).replace(/[^a-z0-9]/gi,"").toLowerCase()}function ic(e){let t=mo(e);return[...Xs].some(r=>t.includes(r))}function ac(e,t,r){if(typeof t=="string"){if(Qs.some(n=>n.test(t))||ec(t))throw new He(r);if(tc.test(t)&&!oc(e))throw new He(r)}}function vr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string")return ac(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)=>vr(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(ic(o))throw new He(i);e[o]!==void 0&&(n[o]=vr(e[o],i,o))}return n}function bt(e){return vr(e)}var Xs,Qs,Zs,tc,rc,nc,He,ze=l(()=>{Xs=new Set(["privatekey","privkey","secretkey","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","wif","xprv","xpriv","bearer","authorization","signature","apikey","credential"]),Qs=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/],Zs=new Set([12,15,18,21,24]);tc=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/,rc=/(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i,nc=new Set(["calldata","data","publickey","pubkey","message","payload","input","extradata"]);He=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 zg,constants as sc,fchmodSync as Wg,fsyncSync as Vg,lstatSync as Kg,mkdirSync as Gg,openSync as Yg,readFileSync as Jg,renameSync as Xg,rmSync as Qg,writeFileSync as Zg}from"node:fs";var ry,ho=l(()=>{ze();je();ry=sc.O_NOFOLLOW??0});import{wordlists as iy}from"ethers";var wo,sy,ve=l(()=>{ze();wo=64*1024,sy=32*1024});var lc,ly,dy,St=l(()=>{ve();lc=["schemaVersion","buildVersion","recordType","execution","custody"],ly=[...lc,"recordHash"],dy=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 dc,Io,wy,_r=l(()=>{ve();St();dc=Object.freeze(["draft","checked","approval","signed","submitted","finalized","reorged","orphaned","compensating","compensated","failed","cancelled"]),Io=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"]),wy=new Set(Io)});var gc,ko=l(()=>{ve();_r();gc=64*1024*1024});var vy,Ay,Iy,Oo=l(()=>{vy=Object.freeze(["chainId","agentAddress","accountAddress","actions","targets","maxValueWei","maxGasWei","maxSlippageBps","expiresAt","nonce","revocationKey"]),Ay=Object.freeze(["read","simulate"]),Iy=1440*60});function Tr(e){let t=String(e),r=t.toLowerCase().replace(/[\s._-]+/g,"");return yc.test(t)||bc.includes(r)}function Ec(e){return e.replace(/"([A-Za-z0-9_-]+)"\s*:\s*"(?:0x)?([0-9a-fA-F]{64})"/g,(t,r)=>To.includes(String(r).toLowerCase().replace(/[_-]/g,""))?`"${r}":"<hex64>"`:t)}function Co(e){let t;try{t=JSON.stringify(e)}catch(o){throw new ne("$",`unserializable-payload: ${String(o?.message||o)}`)}if(t===void 0)return"null";let r=Ec(t);for(let{rule:o,re:i}of _o)if(i.test(r))throw new ne("$<serialized>",o);if(/(?:^|[^0-9a-fA-Fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/.test(r))throw new ne("$<serialized>","raw-32-byte-hex-embedded");return JSON.parse(t,(o,i)=>{if(o&&Tr(o))throw new ne(`$<serialized>.${o}`,"forbidden-key-name");return i}),t}function ae(e,t="$",r=new Set,n=""){if(e==null)return e;if(typeof e=="string"){let o=To.includes(String(n).toLowerCase().replace(/[_-]/g,""));for(let{rule:i,re:s}of _o)if(!(o&&i.startsWith("raw-32-byte-hex"))&&s.test(e))throw new ne(t,i);return e}if(typeof e!="object"||r.has(e)||(r.add(e),ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e;if(e instanceof Map){for(let[o,i]of e.entries()){if(typeof o=="string"&&Tr(o))throw new ne(`${t}[${JSON.stringify(o)}]`,"forbidden-key-name");ae(o,`${t}[key]`,r),ae(i,`${t}[${String(o)}]`,r)}return e}if(e instanceof Set){let o=0;for(let i of e.values())ae(i,`${t}[${o++}]`,r);return e}if(Array.isArray(e))return e.forEach((o,i)=>ae(o,`${t}[${i}]`,r)),e;for(let[o,i]of Object.entries(e)){if(Tr(o))throw new ne(`${t}.${o}`,"forbidden-key-name");ae(i,`${t}.${o}`,r,o)}return e}var ne,yc,bc,_o,To,Cr=l(()=>{Oo();ne=class extends Error{constructor(t,r){super(`secret material must never appear in a public API object (at ${t}, rule: ${r})`),this.name="SecretLeakError",this.path=t,this.rule=r}},yc=/(private[_-]?key|secret|bearer|keystore|mnemonic|seed[_-]?phrase|passphrase|password|api[_-]?key|access[_-]?token|auth[_-]?token|session[_-]?token|signer[_-]?url|signature)/i,bc=Object.freeze(["privkey","wif","xprv","seed"]);_o=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}]),To=Object.freeze(["grantid","id","hash","sha256","sha256hex","checksum","txhash","transactionhash","blockhash","digest","userophash","commithash","prevhash","intenthash","canonicalhash","payloadhash","requestid"])});var Nr,By,No=l(()=>{Cr();Nr=Object.freeze(["intent","quote_comparison","simulation","prepared","approval","signed","broadcast","settlement","balance_delta","position"]),By=Object.freeze(Object.fromEntries(Nr.map((e,t)=>[e,Object.freeze(t+1<Nr.length?[Nr[t+1]]:[])])))});var Sc,Ro=l(()=>{No();ve();St();Sc=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 Lo=l(()=>{ve();St();_r();ko();Ro()});var vc,Ac,Ic,E0,S0,x0,v0,A0,kc,I0,Po=l(()=>{vc=Object.freeze(["owner","operator","agent","viewer"]),Ac=Object.freeze(["tenant","config","policy","grant","workflow","trade","receipt","audit","telemetry","context","lifecycle"]),Ic=Object.freeze({read:"read",create:"create",update:"update",delete:"delete",manage:"manage",prepare:"prepare",cancel:"cancel",export:"export",approve:"approve"}),E0=Object.freeze(["owner"]),S0=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"}),x0=new Set(vc),v0=new Set(Ac),A0=new Set(Object.values(Ic)),kc=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"])}),I0=Object.freeze(Object.fromEntries(Object.entries(kc).map(([e,t])=>[e,Object.freeze([...t])])))});var Oc,_c,Tc,T0,C0,N0,R0,L0,P0,Rr=l(()=>{Po();Oc=Object.freeze(["succeeded","denied","invalid","failed","cancelled","timed_out","unavailable","skipped"]),_c=Object.freeze(["workflow","task","intent","plan","run","event","eval"]),Tc=Object.freeze(["taskId","intentId","planId","runId","eventId"]),T0=Object.freeze({maxAttributes:24,maxKeyLength:48,maxStringLength:256,maxArrayLength:8}),C0=new Set(Oc),N0=new Set(_c),R0=new Set(Tc),L0=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"]),P0=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 U0,$o=l(()=>{Lo();Rr();U0=Object.freeze({"workflow.cancelled":"cancelled","workflow.failed":"failed"})});var V0,Bo=l(()=>{Rr();V0=32*1024*1024});var G0,Y0,J0,Ae=l(()=>{G0=Object.freeze({N:1<<17,r:8,p:1}),Y0=256*1024*1024,J0=16*1024});var Q0,Do=l(()=>{Q0=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 Lr}from"node:os";import{join as Pr}from"node:path";var Fo,Cc,rb,qo=l(()=>{Fo=process.env.ORACLE_PUBLIC_DESKTOP==="1",Cc=Fo?process.env.ORACLE_CONFIG_DIR||Pr(Lr(),".config","oracle"):Pr(Lr(),".config","oracle"),rb=Fo?Cc:Pr(Lr(),".config","mad-desk")});var sb,cb,ub,Uo=l(()=>{qo();sb="0".repeat(64),cb=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"}),ub=Promise.resolve()});var $r=l(()=>{Uo();de();Ae();je()});var jo=l(()=>{});import{Wallet as bb}from"ethers";import{base58 as Sb}from"@scure/base";import{ed25519 as vb}from"@noble/curves/ed25519.js";import{NETWORK as Ib,TEST_NETWORK as kb,WIF as Ob,p2wpkh as _b}from"@scure/btc-signer";import{pubECDSA as Cb}from"@scure/btc-signer/utils.js";var Ho=l(()=>{});var Lb,Pb,$b,Bb,Db,Fb,qb,Ub,Mb,jb,Hb,zo=l(()=>{$r();Lb=Object.freeze(["spot-limit-create","spot-limit-cancel","spot-order-status"]),Pb=Object.freeze(["binance","bybit","okx","coinbase"]),$b=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"}),Bb=Object.freeze({binance:"/api/v3",bybit:"/v5/order",okx:"/api/v5/trade",coinbase:"/orders"}),Db=Object.freeze(["version","surface","kind","venue","credentialRef","symbol","base","quote","side","baseSize","limitPrice","maxQuoteNotional","timeInForce","clientOrderId","expiresAtMs","venueOrderId","nonce","grantId","artifactHash"]),Fb=Object.freeze(["market-create","withdraw","transfer","subaccount","leverage","futures","margin","convert","api-key"]),qb=Object.freeze(["url","host","path","method","headers","signature","apiKey","apiSecret","passphrase","privateKey","redirect","proxy"]),Ub=Object.freeze(["ccxt","binance-api-node","node-binance-api","coinbase-advanced-node","@okx-dex/okx-dex-sdk","bybit-api"]),Mb=Object.freeze({perOrderQuote:"sealed-owner-policy",dailyGrossQuote:"sealed-owner-policy",scope:Object.freeze(["per-order","UTC-day","account","venue","quote"]),envelopeFieldIsNotCeiling:!0}),jb=Object.freeze({binanceRecvWindowMs:5e3,bybitWindowMs:5e3,maxLocalSkewMs:2e3}),Hb=Object.freeze({perSecond:1,perMinute:30,bind:"tighter"})});var Wo=l(()=>{Ae()});var Lc,Vo,vt=l(()=>{Lc=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}"]})}),Vo=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"})});var Ko=l(()=>{vt()});var Zb,Go=l(()=>{vt();Ko();Zb=256*1024});var Yo=l(()=>{vt();Go()});var Jo=l(()=>{Ae()});import B from"node:path";import Pc from"node:os";import{createHash as $c,randomBytes as zE}from"node:crypto";import{Interface as Br,keccak256 as VE}from"ethers";import{Transaction as GE}from"@scure/btc-signer";import{ed25519 as JE}from"@noble/curves/ed25519.js";function Xo(e){let t=process.env.ORACLE_SIGNER_STATE_DIR||B.join(process.env.XDG_STATE_HOME||B.join(Pc.homedir(),".local","state"),"oracle"),r=$c("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 AS,IS,kS,Qo=l(()=>{po();ho();$o();Bo();je();wt();wt();Ae();Do();$r();jo();yt();gt();Sr();mt();ht();Me();Er();gr();br();yr();Ho();zo();Wo();Yo();Jo();AS=new Br(["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"]),IS=new Br(["function decimals() view returns (uint8)","function allowance(address owner,address spender) view returns (uint256)"]),kS=new Br(["function ownerOf(uint256 tokenId) view returns (address)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner,address operator) view returns (bool)"])});import Dr from"node:fs";import Zo from"node:path";import{homedir as Bc}from"node:os";function Dc(){return process.env.ORACLE_CONFIG_DIR||Zo.join(Bc(),".config","oracle")}function We(){let e=Xo(Zo.join(Dc(),"signer")),t=Dr.existsSync(e.vault),r=Dr.existsSync(e.lock),n=t?r?"disarmed":"armed-owner-confirmed":"inert-no-key";return{vaultExists:t,policyConfigured:Dr.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 FS,Fr=l(()=>{sr();Hn();Qo();Ae();FS=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 At(e){return String(e||"").trim()||void 0}function qc(e,{required:t=!1}={}){let r=At(e)?.toLowerCase();if(!r){if(t)throw new Error("model provider is required");return}if(!Fc.has(r))throw new Error(`unsupported provider: ${r}`);return r}function Uc(e,{required:t=!1}={}){let r=At(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 Mc(e){let t=At(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 ei({provider:e,model:t,baseUrl:r}={},{requireModel:n=!1}={}){let o=qc(e),i=Uc(t,{required:n});if(o==="custom")return{provider:o,...i?{model:i}:{},baseUrl:Mc(r)};if(At(r))throw new Error("baseUrl is only supported for the custom provider");return{...o?{provider:o}:{},...i?{model:i}:{}}}var Fc,ti=l(()=>{Fc=new Set(["openrouter","openai","anthropic","xai","deepseek","gemini","kimi","mistral","nous","qwen","glm","local","ollama","custom","anthropic-oauth","openai-codex","xai-oauth"])});import ri from"node:fs";import jc from"node:path";function zc(){return jc.join(ye(),"model.json")}function Ie(e){return String(e||"").trim()||void 0}function Wc(e={}){let t=Ie(e.backend)?.toLowerCase()||"auto",r=ei({provider:e.provider,model:e.model,baseUrl:e.baseUrl},{requireModel:t==="standalone"}),n=Ie(e.apiKeyEnv),o=Number.parseInt(String(e.contextLength||""),10),i=Object.fromEntries(Object.entries(e.contextByModel||{}).filter(([,u])=>Number.isSafeInteger(u)&&u>0)),s=Ie(e.reasoningEffort),d=Ie(e.computeHost||e.remoteHost),c=Ie(e.computeUser||e.remoteUser),f=Ie(e.computePath||e.remotePath);if(!Hc.has(t))throw new Error(`unsupported backend: ${t}`);if(process.env.ORACLE_PUBLIC_DESKTOP==="1"&&["remote","arch"].includes(t))throw new Error("remote compute backends are disabled in the public desktop");if(n&&!/^[A-Z][A-Z0-9_]*$/.test(n))throw new Error("api key env must be an uppercase environment variable name");if(t==="remote"&&!d)throw new Error("remote backend requires computeHost");return{backend:t,...r,...n?{apiKeyEnv:n}:{},...Number.isFinite(o)&&o>0?{contextLength:o}:{},...Object.keys(i).length?{contextByModel:i}:{},...s?{reasoningEffort:s}:{},...d?{computeHost:d}:{},...c?{computeUser:c}:{},...f?{computePath:f}:{}}}function ni(){let e=zc();if(!ri.existsSync(e))return null;try{return Wc(JSON.parse(ri.readFileSync(e,"utf8")))}catch{return null}}var Hc,oi=l(()=>{Ze();ti();Hc=new Set(["auto","standalone","hermes","remote","arch"])});function qr(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 Ur(e,t="control input"){try{ae(e,t),Co(e)}catch(r){throw new TypeError(`${t} contains secret or custody material: ${r.message}`)}return e}function Ve(e,{required:t=[],optional:r=[]}={},n="object"){qr(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 Mr(e,t,r=200,{lower:n=!1}={}){if(typeof e!="string"||!e.trim()||e.length>r||Vc.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 Ke(e,t,r=80){let n=Mr(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 It(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 Vc,jr=l(()=>{ze();Cr();Vc=/[\u0000-\u001f\u007f]/});function ii({family:e,chainId:t},r="chain"){let n=Ke(e,`${r}.family`,40),o;if(n==="evm"){if(typeof t=="number")o=String(It(t,`${r}.chainId`,{positive:!0}));else if(o=Mr(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=Ke(t,`${r}.chainId`,80);return{family:n,chainId:o}}function Yc(e,t="chain"){return Ve(e,{required:["family","chainId"]},t),H(ii(e,t))}function ai(e,t="finality rule"){Ur(e,t),qr(e,t);let r=e.rule;if(!Kc.includes(r))throw new TypeError(`${t}.rule must be confirmations, finalizedTag, or checkpoint`);let n=r==="confirmations"?"confirmations":r;Ve(e,{required:["family","chainId","rule",n]},t);let o=ii(e,t);return r==="confirmations"?{...o,rule:r,confirmations:It(e.confirmations,`${t}.confirmations`,{positive:!0})}:{...o,rule:r,[n]:Ke(e[n],`${t}.${n}`,80)}}function Hr(e){if(!Array.isArray(e))throw new TypeError("finality policy rules must be an array");let t=e.map((n,o)=>ai(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 Jc(e){if(Ve(e,{required:["policyVersion","rules"]},"finality policy"),e.policyVersion!==1||!Array.isArray(e.rules))throw new TypeError("unsupported finality policy");return Hr(e.rules)}function si(e,t){let r=Yc(t,"finality query"),o=Jc(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 Xc(e,t){if(e==null)return null;Ur(e,"finality evidence");let r=t.rule==="confirmations"?"confirmations":t.rule;if(Ve(e,{required:["status"],optional:[r]},"finality evidence"),!Gc.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"?It(e.confirmations,"finality evidence.confirmations",{positive:!0}):Ke(e[r],`finality evidence.${r}`,80)),n}function ci(e,t){if(!e||e.status===me.UNKNOWN||e.rule==null)return H({status:me.UNKNOWN,final:!1,reason:"MISSING_FINALITY_RULE"});let r=ai(e.rule??e,"resolved finality rule"),n=Xc(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 Kc,me,Gc,ui=l(()=>{jr();Kc=Object.freeze(["confirmations","finalizedTag","checkpoint"]),me=Object.freeze({UNKNOWN:"UNKNOWN",INCLUDED:"INCLUDED",FINAL:"FINAL"}),Gc=Object.freeze(["LIVE","STALE","UNKNOWN","UNAVAILABLE"])});function Zc(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 li(e){return typeof e=="string"&&["FAIL","FAILED","FAILURE","ORPHAN","ORPHANED","REVERTED"].includes(e.trim().toUpperCase())}function Wr(e){return e==null?e:Array.isArray(e)?e.map(Wr):Ge(e)?Object.fromEntries(Object.keys(e).sort().map(t=>[t,Wr(e[t])])):String(e)}function eu(e,t,r,n){let o=O(e.finalityEvidence,n?.finality,e.evidence),i=O(e.finalityPolicy,e.policy);try{return i==null&&Ge(e.finalityRule)&&(i=Hr([{family:t,chainId:r,...e.finalityRule}])),i==null||t==null||r==null?{status:"UNKNOWN",final:!1,reason:"MISSING_FINALITY_RULE"}:ci(si(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 tu(e){return e==null?null:String(e).trim().toLowerCase()}function zr(...e){let t=e.map(tu).filter(Boolean);return t.length<=1||t.every(r=>r===t[0])}function di(e={}){if(!Ge(e))throw new TypeError("verified receipt: input object required");let t=bt(e),r=O(t.actionReceipt,t.receipt),n=Ge(r)?r:t,o=O(t.observation,t.chainObservation,t.observedReceipt),i=Ge(o),s=O(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash),d=O(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family),c=O(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),f=!zr(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash)||!zr(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family)||!zr(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),u=eu(t,d,c,i&&!f?o:null),m=Zc(O(o?.receiptStatus,o?.executionStatus,o?.status)),b=O(t.reconciliationStatus,t.reconciliation?.status,o?.reconciliationStatus),p=O(t.finalityState,t.finalityEvidence?.status,t.evidence?.status,o?.finalityState),h="UNKNOWN";li(b)||!f&&(i&&m==="FAIL"||li(p))?h="FAIL":!f&&s&&i&&m==="SUCCESS"&&["INCLUDED","FINAL"].includes(u.status)&&(h="SUCCESS");let w={verifiedReceiptVersion:Qc,status:h};f&&(w.reason="REFERENCE_MISMATCH"),D(w,"txHash",s),D(w,"chain",O(t.chain,n.chain,o?.chain)),D(w,"family",d),D(w,"chainId",c),D(w,"block",O(o?.block,t.block)),D(w,"blockState",O(o?.blockState,o?.inclusionState)),w.finalityState=u.status,D(w,"confirmations",O(o?.confirmations,o?.finality?.confirmations,t.finalityEvidence?.confirmations,t.evidence?.confirmations)),D(w,"observedAt",O(o?.observedAt,t.observedAt)),D(w,"route",O(t.route,n.route)),D(w,"prepareHash",O(t.prepareHash,n.prepareHash)),D(w,"policyOutcome",O(t.policyOutcome,n.policyOutcome,n.policyChecks));let g=O(t.balanceChanges,o?.balanceChanges,o?.balances,n.balanceChanges,n.balances);return g!=null&&(w.balanceChanges=Wr(g)),D(w,"createdAt",O(t.createdAt,n.createdAt)),D(w,"submittedAt",O(t.submittedAt,n.submittedAt)),D(w,"finalizedAt",O(t.finalizedAt,o?.finalizedAt)),D(w,"timestamps",O(t.timestamps,n.timestamps,o?.timestamps)),H(w)}var Qc,tx,O,Ge,fi=l(()=>{ze();ui();jr();Qc=1,tx=Object.freeze(["SUCCESS","FAIL","UNKNOWN"]),O=(...e)=>e.find(t=>t!=null),Ge=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype});var mi={};Xe(mi,{observeEvmReceipt:()=>pi,verifyEvmReceipt:()=>ou});function nu(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 pi({txHash:e,chainId:t,rpcUrl:r},n={}){let o=String(e||"").trim().toLowerCase();if(!ru.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||An,d=n.rpcCall||Y,c={...n.rpcOptions||{},...r?{rpcUrl:r}:{}},f;try{f=await s({txHash:o,chainId:i},c)}catch(p){return{observation:null,reason:`RPC_UNAVAILABLE: ${p.message}`}}if(!f||f.receipt==null)return{observation:null,reason:f?.reason||"receipt pending"};let u=null,m=f.blockNumber;if(Number.isSafeInteger(m))try{let p=nu(await d(i,"eth_blockNumber",[],c));p!=null&&p>=m&&(u=p-m+1)}catch{}let b={txHash:o,family:"evm",chainId:String(i),receiptStatus:f.status==="success"?"SUCCESS":f.status==="reverted"?"FAIL":"UNKNOWN",block:m==null?void 0:String(m),observedAt:new Date().toISOString(),finality:{status:"LIVE",...u==null?{}:{confirmations:u}}};return u!=null&&(b.confirmations=u),{observation:b,reason:null}}async function ou({txHash:e,chainId:t,confirmations:r=1,rpcUrl:n},o={}){let{observation:i,reason:s}=await pi({txHash:e,chainId:t,rpcUrl:n},o),d=di({txHash:String(e).trim().toLowerCase(),family:"evm",chainId:String(Number(t)),finalityRule:{rule:"confirmations",confirmations:r},...i?{observation:i}:{}});return{receipt:d,observed:!!i,final:d.finalityState==="FINAL",requiredConfirmations:r,reason:s}}var ru,hi=l(()=>{J();fi();ru=/^0x[0-9a-f]{64}$/});var wi={};Xe(wi,{classifyReceipt:()=>$e,configDir:()=>cu,firstHourReport:()=>Vr,probeReceiptModule:()=>lu,probeReviewModule:()=>uu,venueMap:()=>kt});import iu from"node:path";import{homedir as au}from"node:os";function cu(e=process.env){return e.ORACLE_CONFIG_DIR||iu.join(au(),".config","oracle")}function kt({env:e=process.env,vault:t=null}={}){let r=t||We(),n=[];for(let[o,i]of Object.entries(Ne)){let s=(i.rpcEnv||[]).some(c=>String(e[c]||"").trim());if(i.readOnly===!0){n.push({key:o,chainId:i.chainId,name:i.name,family:"evm",status:"read-only",execute:!1,note:s?"rpc configured; reads only \u2014 no venue, no prepare, no signer":"public RPC reads only \u2014 no venue, no prepare, no signer"});continue}let d="prepare";i.evm?s&&(d="live"):d="unavailable",n.push({key:o,chainId:i.chainId,name:i.name,family:"evm",status:d,execute:!!(r.vaultExists&&r.armed&&!r.disarmed),note:s?"rpc configured":"public read/prepare; set RPC for live reads"})}return n.push({key:"solana",chainId:null,name:"Solana",family:"sol",status:"prepare",execute:!1,note:"Jupiter quote/prepare; local sol signer"},{key:"bitcoin",chainId:null,name:"Bitcoin",family:"btc",status:"prepare",execute:!1,note:"Esplora read; local btc signer"},{key:"hyperliquid-l1",chainId:null,name:"Hyperliquid L1",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not an EVM signer family"},{key:"polymarket",chainId:null,name:"Polymarket",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not a signer family"}),n}function Vr({env:e=process.env,model:t=ni(),vault:r=We(),signerReachable:n=!1,quote:o=null,reviewAvailable:i=!1,receiptAvailable:s=!1}={}){let d=[],c=(p,h,w,g=null)=>d.push({id:p,status:h,detail:w,fix:g}),f=(()=>{let[p,h]=process.versions.node.split(".").map(Number);return p>20||p===20&&h>=19})();c("node",f?"ok":"fail",`node ${process.versions.node}`,f?null:"install node >= 20.19"),t?t.backend==="hermes"?c("model","warn","backend=hermes (opt-in attach)","oracle model --backend standalone"):c("model","ok",`${t.backend||"auto"} ${t.provider||""} ${t.model||""}`.trim()):c("model","fail","no model.json","oracle setup model"),r.vaultExists?r.disarmed?c("vault","warn","vault present, DISARMED","oracle signer (re-arm after confirm)"):c("vault",r.armed?"ok":"warn",r.armed?"present, armed":"present, not armed"):c("vault","fail","no local vault","oracle sign init");let u=e.ORACLE_SIGNER_HOST||"127.0.0.1";if(su.has(u)?c("signer",n?"ok":"warn",n?`loopback ${u}:${e.ORACLE_SIGNER_PORT||9462}`:"loopback signer not reachable",n?null:"oracle signer"):c("signer","fail",`signer host ${u} is not loopback`,"unset ORACLE_SIGNER_HOST"),!o)c("quote","warn","quote not probed",null);else if(o.ok){let p=String(o.detail||"net quote returned");c("quote","ok",p.length>140?`${p.slice(0,140)}\u2026`:p)}else c("quote","warn",o.detail||"quote unavailable","check network / oracle data serve");c("review",i?"ok":"fail",i?"sign-time review renders decoded action, policy hits, approval deltas":"sign-time review module missing from this build",i?null:"reinstall @oracle-agent/oracle (src/control/sign-time-review.mjs)"),c("receipt",s?"ok":"fail",s?"oracle receipt verifies on-chain state (SUCCESS/FAIL/UNKNOWN, finality-pinned)":"verified-receipt observer missing from this build",s?null:"reinstall @oracle-agent/oracle (src/desk/observe-receipt.mjs)");let m=d.some(p=>p.status==="fail"),b=d.filter(p=>p.status==="ok").length;return{ok:!m,checks:d,firstRunScore:{ok:b,total:d.length,label:`${b}/${d.length} first-run hops green`},venues:kt({env:e,vault:r})}}async function uu(){try{return typeof(await Promise.resolve().then(()=>(fr(),Yn))).createSignTimeReview=="function"}catch{return!1}}async function lu(){try{let e=await Promise.resolve().then(()=>(hi(),mi));return typeof e.observeReceipt=="function"||typeof e.default=="function"||Object.values(e).some(t=>typeof t=="function")}catch{return!1}}var su,Kr=l(()=>{ot();Fr();oi();sr();su=new Set(["127.0.0.1","::1","localhost"])});var yi={};Xe(yi,{classifyReceipt:()=>$e,default:()=>pu,detailText:()=>gi,firstHourReport:()=>Vr,probeQuote:()=>fu,probeSigner:()=>du,symbol:()=>Ye,vaultStatus:()=>We});async function du(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 Ye(e){let t=String(e??"?").replace(/[^\w.$-]/g,"");return t.length>12?`${t.slice(0,12)}...`:t||"?"}function gi(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 fu(){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:`${Ye(r.chainId)} ${Ye(r.baseToken?.symbol)}/${Ye(r.quoteToken?.symbol)} $${Ye(r.priceUsd)}`}}catch(e){return{ok:!1,detail:gi(e instanceof Error?e.message:"quote failed")}}}var pu,bi=l(()=>{Kr();Fr();pu={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=kt();if(t)return process.stdout.write(`${JSON.stringify({venues:r},null,2)}
|
|
4
|
+
${JSON.stringify(r??[])}`}async function Wa(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=Ua(o),s=qa(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 l=_n.get(s);if(l!=null)return l}let c=n.dedupe!==!1&&!n.signal?za(s,o,r):null;if(c&&Re.has(c))return Re.get(c);let f=(async()=>{let l=await Wa(s,{jsonrpc:"2.0",id:1,method:t,params:r},n),m=Ha(l);return i==="eth_chainid"&&typeof m=="string"&&_n.set(s,m),m})();return c&&(Re.set(c,f),f.finally(()=>{Re.get(c)===f&&Re.delete(c)}).catch(()=>{})),f}async function Tn(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=Kt(o.status),s=i===1,d=i===1?"success":i===0?"reverted":"unknown",c=s?null:d==="reverted"?"transaction reverted":"unknown receipt status",f=e.expectedTo?Vt(e.expectedTo,"expectedTo"):null,l=o.to?Vt(o.to,"receipt.to"):null;return f&&l!==f&&(s=!1,c=`to mismatch: expected ${f}, got ${l||"null"}`),{ok:s,chainId:r,txHash:n,status:d,reason:c,statusCode:i,to:l,from:o.from?Vt(o.from,"receipt.from"):null,blockNumber:Kt(o.blockNumber),transactionIndex:Kt(o.transactionIndex),logs:Array.isArray(o.logs)?o.logs:[],receipt:o}}var mu,Fa,Ma,Re,_n,Y=u(()=>{j();ot();mu=new $a(["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",1339:"https://rpc.elysiumchain.tech"};Ma=/^(?:eth_(?:call|blocknumber|chainid|get[a-z0-9]+|feehistory|gasprice|maxpriorityfeepergas|syncing|protocolversion|estimategas|createaccesslist)|net_(?:version|listening|peercount)|web3_(?:clientversion|sha3))$/;Re=new Map,_n=new Map});var Gt=u(()=>{});var bu,it=u(()=>{j();Gt();bu=Object.freeze({1:"ethereum",10:"optimism",56:"bsc",137:"polygon",8453:"base",42161:"arbitrum",43114:"avalanche",999:"hyperevm",4663:"robinhood"})});var Le=u(()=>{});var Ee=u(()=>{});var X=u(()=>{Le();Ee()});var Ka,ku,F=u(()=>{Ka=300*1e3,ku=(()=>{let e=Number(process.env.ORACLE_PREPARE_HARD_MAX_AGE_MS);return Number.isFinite(e)&&e>0?e:1800*1e3})()});import{Interface as Cn,getAddress as Tu,isAddress as Cu}from"ethers";var Yt,$u,Bu,Xt=u(()=>{Y();it();X();F();Yt={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"}},$u=new Cn(["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)"]),Bu=new Cn(["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 Ja,Interface as Qt,getAddress as Mu,isAddress as Uu,keccak256 as ju}from"ethers";var Ku,Zt,Gu,Ju,Yu,Xu,Qu,er=u(()=>{Y();it();X();F();Ku=Ja.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"}},Gu=new Qt(["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)"]),Ju=new Qt(["function execute(bytes commands,bytes[] inputs,uint256 deadline) payable"]),Yu=new Qt(["function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96,int24 tick,uint24 protocolFee,uint24 lpFee)","function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)"]),Xu=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"]]),Qu=(1n<<14n)-1n});var nr=u(()=>{});import{Contract as ud,JsonRpcProvider as dd}from"ethers";var Nn=u(()=>{});var hd,ct=u(()=>{Nn();hd=Object.freeze({swap:5,bridge:5,perps:0,nft:0})});var Ln=u(()=>{j();X();nr();F();ct()});var Pn=u(()=>{j();X();F();ct()});var lt=u(()=>{});var Dn=u(()=>{j();X();lt();F()});var Ud,Fn=u(()=>{Ud=Object.freeze({READ:"read",PREPARE:"prepare",EXECUTE:"execute",AUTONOMOUS:"autonomous"})});import{TypedDataEncoder as Vd,getAddress as Kd,isAddress as Gd}from"ethers";var Za,tf,es,rf,or=u(()=>{j();X();Fn();nr();F();Za=Object.freeze({1:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",100:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",42161:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41",8453:"0x9008D19f58AAbD9eD0D60971565AA8510560ab41"}),tf=Object.freeze({1:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",100:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",42161:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",8453:"0xC92E8bdf79f0507f65a392b0ab4667716BFE0110"}),es=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"}]}),rf=Object.freeze({OrderCancellations:[{name:"orderUids",type:"bytes[]"}]})});function $e(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 ur=u(()=>{});var Gn=u(()=>{});var Jn=u(()=>{});import{isAddress as km}from"ethers";var dr=u(()=>{X();Le();Ee()});import{Interface as vs,isAddress as Rm}from"ethers";var Bm,Yn=u(()=>{dr();Le();Ee();Bm=new vs(["function approve(address spender,uint256 amount) returns (bool)"])});import{Interface as As,isAddress as qm}from"ethers";var Hm,zm,Xn=u(()=>{dr();Le();Ee();Hm=new As(["function approve(address spender,uint256 amount) returns (bool)"]),zm=Object.freeze({42161:"0x1c3fa76e6e1088bce750f23a5bfcffa1efef6a41",43114:"0x8f550e53dfe96c055d5bdb267c21f268fcaf63b2"})});var re=u(()=>{});import{Interface as Is,MaxUint256 as Xm,isAddress as Qm,keccak256 as Zm,toUtf8Bytes as eh}from"ethers";var ah,fe=u(()=>{Jn();Yn();Xn();re();Ee();ah=new Is(["function approve(address spender,uint256 amount) returns (bool)"])});var eo={};Xe(eo,{SIGN_TIME_REVIEW_VERSION:()=>ks,SignTimeReviewSecretError:()=>Be,createSignTimeReview:()=>Zn});function pr(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string"){let o=e.trim().split(/\s+/);if(Ns.test(e)||Rs.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)=>pr(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(Cs.test(i))throw new Be(`${t}.${o}`);e[o]!==void 0&&(n[o]=pr(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 De(e,t){if(e==null||e==="")throw new TypeError(`sign-time review: ${t} required`);return e}function xe(e,t){let r=String(De(e,t)).toLowerCase();if(!Os.test(r))throw new TypeError(`sign-time review: ${t} must be an EVM address`);return r}function ne(e,t,{positive:r=!1}={}){try{let n=BigInt(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 mr(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 Qn(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){for(let t of Object.values(e))Qn(t);Object.freeze(e)}return e}function Ls(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:mr(String(n),`${t}.reason`)}}function Ps(e){if(!Array.isArray(e))throw new TypeError("sign-time review: policyChecks must be an array");let t=e.map((n,o)=>Ls(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 $s(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:mr(String(e.summary??"simulation result recorded"),"simulation.summary")};return e.gasEstimate!=null&&(t.gasEstimate=ne(e.gasEstimate,"simulation.gasEstimate")),e.gasLimit!=null&&(t.gasLimit=ne(e.gasLimit,"simulation.gasLimit")),t}function Bs(e){if(e==null)return null;if(!Array.isArray(e)||e.length===0)throw new TypeError("sign-time review: assetDeltas must be a non-empty array");return e.map((t,r)=>{pe(t,`assetDeltas[${r}]`);let n=ne(t.before,`assetDeltas[${r}].before`),o=ne(t.after,`assetDeltas[${r}].after`),i=(BigInt(o)-BigInt(n)).toString(),s;try{s=t.delta==null?i:BigInt(t.delta).toString()}catch{throw new TypeError(`sign-time review: assetDeltas[${r}].delta must be an integer`)}if(s!==i)throw new TypeError(`sign-time review: assetDeltas[${r}].delta does not match before/after`);return{...t,asset:mr(String(De(t.asset??t.token,`assetDeltas[${r}].asset`)),`assetDeltas[${r}].asset`),before:n,after:o,delta:s}})}function Ds(e){if(e==null)return[];if(!Array.isArray(e))throw new TypeError("sign-time review: approvalDeltas must be an array");return e.map((t,r)=>{pe(t,`approvalDeltas[${r}]`);let n=ne(t.amount??t.after,`approvalDeltas[${r}].amount`);if(t.revokeLike!=null&&typeof t.revokeLike!="boolean")throw new TypeError(`sign-time review: approvalDeltas[${r}].revokeLike must be boolean`);return{token:xe(t.token,`approvalDeltas[${r}].token`),spender:xe(t.spender,`approvalDeltas[${r}].spender`),owner:xe(t.owner,`approvalDeltas[${r}].owner`),amount:n,revokeLike:t.revokeLike??BigInt(n)===0n}})}function Zn(e={}){pe(e,"input");let t=pr(e),r=t.tx==null?t:pe(t.tx,"tx"),n=ne(t.chainId??r.chainId,"chainId",{positive:!0}),o=xe(t.account??t.from??r.from,"account/from"),i=xe(t.destination??t.to??r.to,"destination/to"),s=String(De(t.prepareHash,"prepareHash")).toLowerCase();if(!Ts.test(s))throw new TypeError("sign-time review: prepareHash must be a 32-byte hash");let d=t.route??t.venue;if(d==null)throw new TypeError("sign-time review: route/venue required");let c=t.decodedCalldata??t.decodedAction;if(c==null)throw new TypeError("sign-time review: decodedCalldata or decodedAction required");let f=String(De(t.calldata??t.data??r.data,"calldata/data")).toLowerCase();if(!_s.test(f))throw new TypeError("sign-time review: calldata/data must be even-length hex");let l=t.policyChecks!==void 0&&t.policyChecks!==null,m=Ps(l?t.policyChecks:[]),b=$s(t.simulation),p=Bs(t.assetDeltas),h=Ds(t.approvalDeltas),w=t.allowlistHits??[];if(!Array.isArray(w))throw new TypeError("sign-time review: allowlistHits must be an array");let g=b?.willRevert===!0||["failed","error"].includes(b?.status),S=b!=null&&b.willRevert===!1&&["ok","success"].includes(b.status),P=g||m.failed>0?"BLOCKED":S&&l&&m.checks.length>0&&p!=null?"READY":"UNKNOWN",E=typeof c=="string"?c:c.method??c.action??c.type??"transaction",A=`${P}: review ${E} on chain ${n}; policy ${m.passed} passed, ${m.failed} failed; ${p?.length??0} asset delta${p?.length===1?"":"s"}; local signature required`,N={reviewVersion:1,status:P,requiresLocalSignature:!0,signingLocal:!0,custody:"none",execution:"review-only",chainId:n,account:o,from:o,route:d,venue:t.venue??(typeof d=="string"?d:d.venue??d.provider??null),destination:i,to:i,...t.spender==null?{}:{spender:xe(t.spender,"spender")},prepareHash:s,...t.decodedCalldata!==void 0?{decodedCalldata:t.decodedCalldata}:{decodedAction:t.decodedAction},calldata:f,data:f,selector:f.length>=10?f.slice(0,10):null,value:ne(t.value??r.value??0,"value"),...(t.gasEstimate??r.gasEstimate)==null?{}:{gasEstimate:ne(t.gasEstimate??r.gasEstimate,"gasEstimate")},...(t.gasLimit??r.gasLimit)==null?{}:{gasLimit:ne(t.gasLimit??r.gasLimit,"gasLimit")},simulation:b,policyChecks:m,allowlistHits:w,assetDeltas:p,approvalDeltas:h,summary:A};return Qn(N)}var ks,Os,_s,Ts,Cs,Ns,Rs,Be,hr=u(()=>{ks=1,Os=/^0x[0-9a-f]{40}$/,_s=/^0x(?:[0-9a-f]{2})*$/,Ts=/^(?:0x)?[0-9a-f]{64}$/,Cs=/(privatekey|privkey|secretkey|seedphrase|mnemonic|passphrase|password|keystore|keymaterial|wif|xprv|xpriv|bearer|authorization|signature|apikey|credential)/i,Ns=/\b(?:[5KL][1-9A-HJ-NP-Za-km-z]{50,51}|xprv[0-9A-Za-z]{50,})\b/,Rs=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 lh,readdirSync as uh,existsSync as Fs}from"node:fs";import{dirname as qs,join as Fe}from"node:path";import{fileURLToPath as Ms}from"node:url";function Us(){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(Fs(t))return t;return e[0]}var qe,mh,hh,to=u(()=>{fe();qe=qs(Ms(import.meta.url));mh=Us(),hh=(1n<<256n)-1n});var ro=u(()=>{hr();fe();to()});import{Address as vh,NETWORK as Ah,OutScript as Ih,RawTx as kh,SigHash as Oh,TEST_NETWORK as _h,Transaction as Th}from"@scure/btc-signer";var gr=u(()=>{});import{createHash as js}from"node:crypto";import{base58 as Lh}from"@scure/base";import{getCompiledTransactionMessageDecoder as $h}from"@solana/transaction-messages";var no,Bh,yr=u(()=>{no=e=>js("sha256").update(`global:${e}`).digest().subarray(0,8).toString("hex"),Bh=new Map([[no("route"),{name:"route",prefixBytes:0}],[no("shared_accounts_route"),{name:"shared_accounts_route",prefixBytes:1}]])});var oo=u(()=>{});var io=u(()=>{j();oo()});var Vh,br=u(()=>{io();Vh=Object.freeze({tradexyz:"xyz",ventuals:"vntl",hypernova:"hyna",paradex:"para",entropy:"io",entropyio:"io"})});var Yh,Xh,ht=u(()=>{re();br();Yh=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"}),Xh=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 ew,Sr=u(()=>{re();ew="0x"+"00".repeat(32)});var zs,iw,wt=u(()=>{Sr();re();zs=Object.freeze([["salt","uint256"],["maker","address"],["signer","address"],["tokenId","uint256"],["makerAmount","uint256"],["takerAmount","uint256"],["side","uint8"],["signatureType","uint8"],["timestamp","uint256"],["metadata","bytes32"],["builder","bytes32"]]),iw=Object.freeze(zs.map(e=>e[0]))});var Ue=u(()=>{re()});var gt=u(()=>{fe();ro();gr();yr();ht();wt();Ue()});var yt=u(()=>{fe()});import{TypedDataEncoder as vw,getAddress as Aw,isAddress as Iw}from"ethers";var Ws,Vs,fo=u(()=>{F();Ws=Object.freeze({1:"0x111111125421cA6dc452d289314280a0f8842A65",8453:"0x111111125421cA6dc452d289314280a0f8842A65",42161:"0x111111125421cA6dc452d289314280a0f8842A65",10:"0x111111125421cA6dc452d289314280a0f8842A65",137:"0x111111125421cA6dc452d289314280a0f8842A65",56:"0x111111125421cA6dc452d289314280a0f8842A65"}),Vs=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 Tw,getAddress as Cw}from"ethers";var Lw,xr=u(()=>{fo();or();Lw=Object.freeze(["https://limit-orders.1inch.io","https://api.1inch.dev/orderbook"])});import{Interface as mo}from"ethers";var Js,Jw,Ys,Yw,Xw,Qw,Zw,Xs,eg,bt=u(()=>{fe();X();F();yt();gr();yr();ht();wt();Ue();xr();Js=new Set(["evm","evm-swap","evm-bridge","evm-nft","evm-order","btc","sol","hl","poly","lighter"]),Jw=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}),Ys=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"}}),Yw=Object.freeze({"0x161ac21f":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-public"},"0xc2f6663a":{provider:"opensea-nft",action:"mint",layout:"seadrop-mint-allowlist"}}),Xw=new mo(["function buySpecificNFT(uint256 tokenId,uint256 maxCost) payable","function sellNFT(uint256 tokenId,uint256 minPayout) payable"]),Qw=new mo(["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"]),Zw=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"}}),Xs=Object.freeze([...Js]),eg=Object.freeze({...Ys})});import{encode as ng}from"@msgpack/msgpack";import{keccak256 as ig,verifyTypedData as ag}from"ethers";var sg,cg,vr=u(()=>{sg=Object.freeze({name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"}),cg=Object.freeze({Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]})});var Ar=u(()=>{Ue()});import{ed25519 as wg}from"@noble/curves/ed25519.js";import{base58 as yg}from"@scure/base";import{RawTx as Eg,SigHash as Sg,Transaction as xg}from"@scure/btc-signer";import{Transaction as Ag,keccak256 as Ig,verifyTypedData as kg}from"ethers";var Ir=u(()=>{vr();Ar()});import{base58 as Pg}from"@scure/base";var je=u(()=>{gt();bt();yt();fe();Ir()});var wo=u(()=>{je();bt()});import{wordlists as ec}from"ethers";function oc(e){let t=String(e).trim().toLowerCase().split(/\s+/).filter(Boolean);return nc.has(t.length)&&t.every(r=>ec.en.getWordIndex(r)>=0)}function cc(e){let t=go(e);return sc.has(t)||ac.test(t)}function go(e){return String(e).replace(/[^a-z0-9]/gi,"").toLowerCase()}function lc(e){let t=go(e);return[...tc].some(r=>t.includes(r))}function uc(e,t,r){if(typeof t=="string"){if(rc.some(n=>n.test(t))||oc(t))throw new He(r);if(ic.test(t)&&!cc(e))throw new He(r)}}function Or(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string")return uc(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)=>Or(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(lc(o))throw new He(i);e[o]!==void 0&&(n[o]=Or(e[o],i,o))}return n}function Et(e){return Or(e)}var tc,rc,nc,ic,ac,sc,He,ze=u(()=>{tc=new Set(["privatekey","privkey","secretkey","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","wif","xprv","xpriv","bearer","authorization","signature","apikey","credential"]),rc=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/],nc=new Set([12,15,18,21,24]);ic=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/,ac=/(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i,sc=new Set(["calldata","data","publickey","pubkey","message","payload","input","extradata"]);He=class extends Error{constructor(t){super(`action receipt refused: secret-bearing field at ${t}`),this.name="ActionReceiptSecretError",this.code="ACTION_RECEIPT_SECRET"}}});var St=u(()=>{re()});import xt from"node:fs";var Xg,_r=u(()=>{Xg=xt.constants.O_CREAT|xt.constants.O_EXCL|xt.constants.O_WRONLY|(xt.constants.O_NOFOLLOW||0)});import{closeSync as ey,constants as pc,fchmodSync as ty,fsyncSync as ry,lstatSync as ny,mkdirSync as oy,openSync as iy,readFileSync as ay,renameSync as sy,rmSync as cy,writeFileSync as ly}from"node:fs";var my,yo=u(()=>{ze();St();je();_r();my=pc.O_NOFOLLOW??0});import{wordlists as gy}from"ethers";var bo,by,ve=u(()=>{ze();bo=64*1024,by=32*1024});var wc,xy,vy,At=u(()=>{ve();wc=["schemaVersion","buildVersion","recordType","execution","custody"],xy=[...wc,"recordHash"],vy=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 gc,_o,_y,Lr=u(()=>{ve();At();gc=Object.freeze(["draft","checked","approval","signed","submitted","finalized","reorged","orphaned","compensating","compensated","failed","cancelled"]),_o=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"]),_y=new Set(_o)});var vc,To=u(()=>{ve();Lr();vc=64*1024*1024});var $y,By,Dy,Co=u(()=>{$y=Object.freeze(["chainId","agentAddress","accountAddress","actions","targets","maxValueWei","maxGasWei","maxSlippageBps","expiresAt","nonce","revocationKey"]),By=Object.freeze(["read","simulate"]),Dy=1440*60});function Pr(e){let t=String(e),r=t.toLowerCase().replace(/[\s._-]+/g,"");return Ac.test(t)||Ic.includes(r)}function kc(e){return e.replace(/"([A-Za-z0-9_-]+)"\s*:\s*"(?:0x)?([0-9a-fA-F]{64})"/g,(t,r)=>Ro.includes(String(r).toLowerCase().replace(/[_-]/g,""))?`"${r}":"<hex64>"`:t)}function Lo(e){let t;try{t=JSON.stringify(e)}catch(o){throw new oe("$",`unserializable-payload: ${String(o?.message||o)}`)}if(t===void 0)return"null";let r=kc(t);for(let{rule:o,re:i}of No)if(i.test(r))throw new oe("$<serialized>",o);if(/(?:^|[^0-9a-fA-Fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/.test(r))throw new oe("$<serialized>","raw-32-byte-hex-embedded");return JSON.parse(t,(o,i)=>{if(o&&Pr(o))throw new oe(`$<serialized>.${o}`,"forbidden-key-name");return i}),t}function se(e,t="$",r=new Set,n=""){if(e==null)return e;if(typeof e=="string"){let o=Ro.includes(String(n).toLowerCase().replace(/[_-]/g,""));for(let{rule:i,re:s}of No)if(!(o&&i.startsWith("raw-32-byte-hex"))&&s.test(e))throw new oe(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"&&Pr(o))throw new oe(`${t}[${JSON.stringify(o)}]`,"forbidden-key-name");se(o,`${t}[key]`,r),se(i,`${t}[${String(o)}]`,r)}return e}if(e instanceof Set){let o=0;for(let i of e.values())se(i,`${t}[${o++}]`,r);return e}if(Array.isArray(e))return e.forEach((o,i)=>se(o,`${t}[${i}]`,r)),e;for(let[o,i]of Object.entries(e)){if(Pr(o))throw new oe(`${t}.${o}`,"forbidden-key-name");se(i,`${t}.${o}`,r,o)}return e}var oe,Ac,Ic,No,Ro,$r=u(()=>{Co();oe=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}},Ac=/(private[_-]?key|secret|bearer|keystore|mnemonic|seed[_-]?phrase|passphrase|password|api[_-]?key|access[_-]?token|auth[_-]?token|session[_-]?token|signer[_-]?url|signature)/i,Ic=Object.freeze(["privkey","wif","xprv","seed"]);No=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}]),Ro=Object.freeze(["grantid","id","hash","sha256","sha256hex","checksum","txhash","transactionhash","blockhash","digest","userophash","commithash","prevhash","intenthash","canonicalhash","payloadhash","requestid"])});var Br,Gy,Po=u(()=>{$r();Br=Object.freeze(["intent","quote_comparison","simulation","prepared","approval","signed","broadcast","settlement","balance_delta","position"]),Gy=Object.freeze(Object.fromEntries(Br.map((e,t)=>[e,Object.freeze(t+1<Br.length?[Br[t+1]]:[])])))});var Oc,$o=u(()=>{Po();ve();At();Oc=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 Bo=u(()=>{ve();At();Lr();To();$o()});var Tc,Cc,Nc,R0,L0,P0,$0,B0,Rc,D0,Do=u(()=>{Tc=Object.freeze(["owner","operator","agent","viewer"]),Cc=Object.freeze(["tenant","config","policy","grant","workflow","trade","receipt","audit","telemetry","context","lifecycle"]),Nc=Object.freeze({read:"read",create:"create",update:"update",delete:"delete",manage:"manage",prepare:"prepare",cancel:"cancel",export:"export",approve:"approve"}),R0=Object.freeze(["owner"]),L0=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"}),P0=new Set(Tc),$0=new Set(Cc),B0=new Set(Object.values(Nc)),Rc=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"])}),D0=Object.freeze(Object.fromEntries(Object.entries(Rc).map(([e,t])=>[e,Object.freeze([...t])])))});var Lc,Pc,$c,U0,j0,H0,z0,W0,V0,Dr=u(()=>{Do();Lc=Object.freeze(["succeeded","denied","invalid","failed","cancelled","timed_out","unavailable","skipped"]),Pc=Object.freeze(["workflow","task","intent","plan","run","event","eval"]),$c=Object.freeze(["taskId","intentId","planId","runId","eventId"]),U0=Object.freeze({maxAttributes:24,maxKeyLength:48,maxStringLength:256,maxArrayLength:8}),j0=new Set(Lc),H0=new Set(Pc),z0=new Set($c),W0=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"]),V0=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 Q0,Fo=u(()=>{Bo();Dr();Q0=Object.freeze({"workflow.cancelled":"cancelled","workflow.failed":"failed"})});var ob,qo=u(()=>{Dr();ob=32*1024*1024});var ab,sb,cb,Ae=u(()=>{ab=Object.freeze({N:1<<17,r:8,p:1}),sb=256*1024*1024,cb=16*1024});var ub,Mo=u(()=>{ub=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 Fr}from"node:os";import{join as qr}from"node:path";var Uo,Bc,mb,jo=u(()=>{Uo=process.env.ORACLE_PUBLIC_DESKTOP==="1",Bc=Uo?process.env.ORACLE_CONFIG_DIR||qr(Fr(),".config","oracle"):qr(Fr(),".config","oracle"),mb=Uo?Bc:qr(Fr(),".config","mad-desk")});var bb,Eb,Sb,Ho=u(()=>{jo();bb="0".repeat(64),Eb=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"}),Sb=Promise.resolve()});var Mr=u(()=>{Ho();re();Ae();je();_r();St()});var Wo=u(()=>{});import{Wallet as Pb}from"ethers";import{base58 as Bb}from"@scure/base";import{ed25519 as Fb}from"@noble/curves/ed25519.js";import{NETWORK as Mb,TEST_NETWORK as Ub,WIF as jb,p2wpkh as Hb}from"@scure/btc-signer";import{pubECDSA as Wb}from"@scure/btc-signer/utils.js";var Vo=u(()=>{});var Gb,Jb,Yb,Xb,Qb,Zb,eE,tE,rE,nE,oE,Ko=u(()=>{Mr();Gb=Object.freeze(["spot-limit-create","spot-limit-cancel","spot-order-status"]),Jb=Object.freeze(["binance","bybit","okx","coinbase"]),Yb=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"}),Xb=Object.freeze({binance:"/api/v3",bybit:"/v5/order",okx:"/api/v5/trade",coinbase:"/orders"}),Qb=Object.freeze(["version","surface","kind","venue","credentialRef","symbol","base","quote","side","baseSize","limitPrice","maxQuoteNotional","timeInForce","clientOrderId","expiresAtMs","venueOrderId","nonce","grantId","artifactHash"]),Zb=Object.freeze(["market-create","withdraw","transfer","subaccount","leverage","futures","margin","convert","api-key"]),eE=Object.freeze(["url","host","path","method","headers","signature","apiKey","apiSecret","passphrase","privateKey","redirect","proxy"]),tE=Object.freeze(["ccxt","binance-api-node","node-binance-api","coinbase-advanced-node","@okx-dex/okx-dex-sdk","bybit-api"]),rE=Object.freeze({perOrderQuote:"sealed-owner-policy",dailyGrossQuote:"sealed-owner-policy",scope:Object.freeze(["per-order","UTC-day","account","venue","quote"]),envelopeFieldIsNotCeiling:!0}),nE=Object.freeze({binanceRecvWindowMs:5e3,bybitWindowMs:5e3,maxLocalSkewMs:2e3}),oE=Object.freeze({perSecond:1,perMinute:30,bind:"tighter"})});var Go=u(()=>{Ae()});var qc,Jo,kt=u(()=>{qc=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}"]})}),Jo=Object.freeze({binance:"https://api.binance.com",bybit:"https://api.bybit.com",okx:"https://openapi.okx.com",coinbase:"https://api.exchange.coinbase.com"})});var Yo=u(()=>{kt()});var mE,Xo=u(()=>{kt();Yo();mE=256*1024});var Qo=u(()=>{kt();Xo()});var Zo=u(()=>{Ae()});import B from"node:path";import Mc from"node:os";import{createHash as Uc,randomBytes as uS}from"node:crypto";import{Interface as Ur,keccak256 as fS}from"ethers";import{Transaction as mS}from"@scure/btc-signer";import{ed25519 as wS}from"@noble/curves/ed25519.js";function ei(e){let t=process.env.ORACLE_SIGNER_STATE_DIR||B.join(process.env.XDG_STATE_HOME||B.join(Mc.homedir(),".local","state"),"oracle"),r=Uc("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 KS,GS,JS,ti=u(()=>{wo();yo();Fo();qo();je();gt();gt();Ae();Mo();Mr();Wo();bt();yt();Ir();br();re();ht();St();wt();Ue();Ar();Sr();vr();xr();Vo();Ko();Go();Qo();Zo();KS=new Ur(["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"]),GS=new Ur(["function decimals() view returns (uint8)","function allowance(address owner,address spender) view returns (uint256)"]),JS=new Ur(["function ownerOf(uint256 tokenId) view returns (address)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner,address operator) view returns (bool)"])});import jr from"node:fs";import ri from"node:path";import{homedir as jc}from"node:os";function Hc(){return process.env.ORACLE_CONFIG_DIR||ri.join(jc(),".config","oracle")}function We(){let e=ei(ri.join(Hc(),"signer")),t=jr.existsSync(e.vault),r=jr.existsSync(e.lock),n=t?r?"disarmed":"armed-owner-confirmed":"inert-no-key";return{vaultExists:t,policyConfigured:jr.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 sx,Hr=u(()=>{ur();Gn();ti();Ae();sx=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 Ot(e){return String(e||"").trim()||void 0}function Wc(e,{required:t=!1}={}){let r=Ot(e)?.toLowerCase();if(!r){if(t)throw new Error("model provider is required");return}if(!zc.has(r))throw new Error(`unsupported provider: ${r}`);return r}function Vc(e,{required:t=!1}={}){let r=Ot(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 Kc(e){let t=Ot(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 ni({provider:e,model:t,baseUrl:r}={},{requireModel:n=!1}={}){let o=Wc(e),i=Vc(t,{required:n});if(o==="custom")return{provider:o,...i?{model:i}:{},baseUrl:Kc(r)};if(Ot(r))throw new Error("baseUrl is only supported for the custom provider");return{...o?{provider:o}:{},...i?{model:i}:{}}}var zc,oi=u(()=>{zc=new Set(["openrouter","openai","anthropic","xai","deepseek","gemini","kimi","mistral","nous","qwen","glm","local","ollama","custom","anthropic-oauth","openai-codex","xai-oauth"])});import ii from"node:fs";import Gc from"node:path";function Yc(){return Gc.join(ye(),"model.json")}function Ie(e){return String(e||"").trim()||void 0}function Xc(e={}){let t=Ie(e.backend)?.toLowerCase()||"auto",r=ni({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(([,l])=>Number.isSafeInteger(l)&&l>0)),s=Ie(e.reasoningEffort),d=Ie(e.computeHost||e.remoteHost),c=Ie(e.computeUser||e.remoteUser),f=Ie(e.computePath||e.remotePath);if(!Jc.has(t))throw new Error(`unsupported backend: ${t}`);if(process.env.ORACLE_PUBLIC_DESKTOP==="1"&&["remote","arch"].includes(t))throw new Error("remote compute backends are disabled in the public desktop");if(n&&!/^[A-Z][A-Z0-9_]*$/.test(n))throw new Error("api key env must be an uppercase environment variable name");if(t==="remote"&&!d)throw new Error("remote backend requires computeHost");return{backend:t,...r,...n?{apiKeyEnv:n}:{},...Number.isFinite(o)&&o>0?{contextLength:o}:{},...Object.keys(i).length?{contextByModel:i}:{},...s?{reasoningEffort:s}:{},...d?{computeHost:d}:{},...c?{computeUser:c}:{},...f?{computePath:f}:{}}}function ai(){let e=Yc();if(!ii.existsSync(e))return null;try{return Xc(JSON.parse(ii.readFileSync(e,"utf8")))}catch{return null}}var Jc,si=u(()=>{Ze();oi();Jc=new Set(["auto","standalone","hermes","remote","arch"])});function zr(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 Wr(e,t="control input"){try{se(e,t),Lo(e)}catch(r){throw new TypeError(`${t} contains secret or custody material: ${r.message}`)}return e}function Ve(e,{required:t=[],optional:r=[]}={},n="object"){zr(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 Vr(e,t,r=200,{lower:n=!1}={}){if(typeof e!="string"||!e.trim()||e.length>r||Qc.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 Ke(e,t,r=80){let n=Vr(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 _t(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 Qc,Kr=u(()=>{ze();$r();Qc=/[\u0000-\u001f\u007f]/});function ci({family:e,chainId:t},r="chain"){let n=Ke(e,`${r}.family`,40),o;if(n==="evm"){if(typeof t=="number")o=String(_t(t,`${r}.chainId`,{positive:!0}));else if(o=Vr(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=Ke(t,`${r}.chainId`,80);return{family:n,chainId:o}}function tl(e,t="chain"){return Ve(e,{required:["family","chainId"]},t),H(ci(e,t))}function li(e,t="finality rule"){Wr(e,t),zr(e,t);let r=e.rule;if(!Zc.includes(r))throw new TypeError(`${t}.rule must be confirmations, finalizedTag, or checkpoint`);let n=r==="confirmations"?"confirmations":r;Ve(e,{required:["family","chainId","rule",n]},t);let o=ci(e,t);return r==="confirmations"?{...o,rule:r,confirmations:_t(e.confirmations,`${t}.confirmations`,{positive:!0})}:{...o,rule:r,[n]:Ke(e[n],`${t}.${n}`,80)}}function Gr(e){if(!Array.isArray(e))throw new TypeError("finality policy rules must be an array");let t=e.map((n,o)=>li(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 rl(e){if(Ve(e,{required:["policyVersion","rules"]},"finality policy"),e.policyVersion!==1||!Array.isArray(e.rules))throw new TypeError("unsupported finality policy");return Gr(e.rules)}function ui(e,t){let r=tl(t,"finality query"),o=rl(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 nl(e,t){if(e==null)return null;Wr(e,"finality evidence");let r=t.rule==="confirmations"?"confirmations":t.rule;if(Ve(e,{required:["status"],optional:[r]},"finality evidence"),!el.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"?_t(e.confirmations,"finality evidence.confirmations",{positive:!0}):Ke(e[r],`finality evidence.${r}`,80)),n}function di(e,t){if(!e||e.status===me.UNKNOWN||e.rule==null)return H({status:me.UNKNOWN,final:!1,reason:"MISSING_FINALITY_RULE"});let r=li(e.rule??e,"resolved finality rule"),n=nl(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 Zc,me,el,fi=u(()=>{Kr();Zc=Object.freeze(["confirmations","finalizedTag","checkpoint"]),me=Object.freeze({UNKNOWN:"UNKNOWN",INCLUDED:"INCLUDED",FINAL:"FINAL"}),el=Object.freeze(["LIVE","STALE","UNKNOWN","UNAVAILABLE"])});function il(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 pi(e){return typeof e=="string"&&["FAIL","FAILED","FAILURE","ORPHAN","ORPHANED","REVERTED"].includes(e.trim().toUpperCase())}function Yr(e){return e==null?e:Array.isArray(e)?e.map(Yr):Ge(e)?Object.fromEntries(Object.keys(e).sort().map(t=>[t,Yr(e[t])])):String(e)}function al(e,t,r,n){let o=O(e.finalityEvidence,n?.finality,e.evidence),i=O(e.finalityPolicy,e.policy);try{return i==null&&Ge(e.finalityRule)&&(i=Gr([{family:t,chainId:r,...e.finalityRule}])),i==null||t==null||r==null?{status:"UNKNOWN",final:!1,reason:"MISSING_FINALITY_RULE"}:di(ui(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 sl(e){return e==null?null:String(e).trim().toLowerCase()}function Jr(...e){let t=e.map(sl).filter(Boolean);return t.length<=1||t.every(r=>r===t[0])}function mi(e={}){if(!Ge(e))throw new TypeError("verified receipt: input object required");let t=Et(e),r=O(t.actionReceipt,t.receipt),n=Ge(r)?r:t,o=O(t.observation,t.chainObservation,t.observedReceipt),i=Ge(o),s=O(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash),d=O(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family),c=O(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),f=!Jr(t.txHash,n.txHash,n.transactionHash,o?.txHash,o?.transactionHash)||!Jr(t.family,n.family,n.chain?.family,o?.family,o?.chain?.family)||!Jr(t.chainId,n.chainId,n.chain?.chainId,o?.chainId,o?.chain?.chainId),l=al(t,d,c,i&&!f?o:null),m=il(O(o?.receiptStatus,o?.executionStatus,o?.status)),b=O(t.reconciliationStatus,t.reconciliation?.status,o?.reconciliationStatus),p=O(t.finalityState,t.finalityEvidence?.status,t.evidence?.status,o?.finalityState),h="UNKNOWN";pi(b)||!f&&(i&&m==="FAIL"||pi(p))?h="FAIL":!f&&s&&i&&m==="SUCCESS"&&["INCLUDED","FINAL"].includes(l.status)&&(h="SUCCESS");let w={verifiedReceiptVersion:ol,status:h};f&&(w.reason="REFERENCE_MISMATCH"),D(w,"txHash",s),D(w,"chain",O(t.chain,n.chain,o?.chain)),D(w,"family",d),D(w,"chainId",c),D(w,"block",O(o?.block,t.block)),D(w,"blockState",O(o?.blockState,o?.inclusionState)),w.finalityState=l.status,D(w,"confirmations",O(o?.confirmations,o?.finality?.confirmations,t.finalityEvidence?.confirmations,t.evidence?.confirmations)),D(w,"observedAt",O(o?.observedAt,t.observedAt)),D(w,"route",O(t.route,n.route)),D(w,"prepareHash",O(t.prepareHash,n.prepareHash)),D(w,"policyOutcome",O(t.policyOutcome,n.policyOutcome,n.policyChecks));let g=O(t.balanceChanges,o?.balanceChanges,o?.balances,n.balanceChanges,n.balances);return g!=null&&(w.balanceChanges=Yr(g)),D(w,"createdAt",O(t.createdAt,n.createdAt)),D(w,"submittedAt",O(t.submittedAt,n.submittedAt)),D(w,"finalizedAt",O(t.finalizedAt,o?.finalizedAt)),D(w,"timestamps",O(t.timestamps,n.timestamps,o?.timestamps)),H(w)}var ol,Ax,O,Ge,hi=u(()=>{ze();fi();Kr();ol=1,Ax=Object.freeze(["SUCCESS","FAIL","UNKNOWN"]),O=(...e)=>e.find(t=>t!=null),Ge=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype});var gi={};Xe(gi,{observeEvmReceipt:()=>wi,verifyEvmReceipt:()=>ul});function ll(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 wi({txHash:e,chainId:t,rpcUrl:r},n={}){let o=String(e||"").trim().toLowerCase();if(!cl.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||Tn,d=n.rpcCall||J,c={...n.rpcOptions||{},...r?{rpcUrl:r}:{}},f;try{f=await s({txHash:o,chainId:i},c)}catch(p){return{observation:null,reason:`RPC_UNAVAILABLE: ${p.message}`}}if(!f||f.receipt==null)return{observation:null,reason:f?.reason||"receipt pending"};let l=null,m=f.blockNumber;if(Number.isSafeInteger(m))try{let p=ll(await d(i,"eth_blockNumber",[],c));p!=null&&p>=m&&(l=p-m+1)}catch{}let b={txHash:o,family:"evm",chainId:String(i),receiptStatus:f.status==="success"?"SUCCESS":f.status==="reverted"?"FAIL":"UNKNOWN",block:m==null?void 0:String(m),observedAt:new Date().toISOString(),finality:{status:"LIVE",...l==null?{}:{confirmations:l}}};return l!=null&&(b.confirmations=l),{observation:b,reason:null}}async function ul({txHash:e,chainId:t,confirmations:r=1,rpcUrl:n},o={}){let{observation:i,reason:s}=await wi({txHash:e,chainId:t,rpcUrl:n},o),d=mi({txHash:String(e).trim().toLowerCase(),family:"evm",chainId:String(Number(t)),finalityRule:{rule:"confirmations",confirmations:r},...i?{observation:i}:{}});return{receipt:d,observed:!!i,final:d.finalityState==="FINAL",requiredConfirmations:r,reason:s}}var cl,yi=u(()=>{Y();hi();cl=/^0x[0-9a-f]{64}$/});var bi={};Xe(bi,{classifyReceipt:()=>$e,configDir:()=>ml,firstHourReport:()=>Xr,probeReceiptModule:()=>wl,probeReviewModule:()=>hl,venueMap:()=>Tt});import dl from"node:path";import{homedir as fl}from"node:os";function ml(e=process.env){return e.ORACLE_CONFIG_DIR||dl.join(fl(),".config","oracle")}function Tt({env:e=process.env,vault:t=null}={}){let r=t||We(),n=[];for(let[o,i]of Object.entries(Ne)){let s=(i.rpcEnv||[]).some(c=>String(e[c]||"").trim());if(i.readOnly===!0){n.push({key:o,chainId:i.chainId,name:i.name,family:"evm",status:"read-only",execute:!1,note:s?"rpc configured; reads only \u2014 no venue, no prepare, no signer":"public RPC reads only \u2014 no venue, no prepare, no signer"});continue}let d="prepare";i.evm?s&&(d="live"):d="unavailable",n.push({key:o,chainId:i.chainId,name:i.name,family:"evm",status:d,execute:!!(r.vaultExists&&r.armed&&!r.disarmed),note:s?"rpc configured":"public read/prepare; set RPC for live reads"})}return n.push({key:"solana",chainId:null,name:"Solana",family:"sol",status:"prepare",execute:!1,note:"Jupiter quote/prepare; local sol signer"},{key:"bitcoin",chainId:null,name:"Bitcoin",family:"btc",status:"prepare",execute:!1,note:"Esplora read; local btc signer"},{key:"hyperliquid-l1",chainId:null,name:"Hyperliquid L1",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not an EVM signer family"},{key:"polymarket",chainId:null,name:"Polymarket",family:"data",status:"live",execute:!1,note:"data/prepare only \u2014 not a signer family"}),n}function Xr({env:e=process.env,model:t=ai(),vault:r=We(),signerReachable:n=!1,quote:o=null,reviewAvailable:i=!1,receiptAvailable:s=!1}={}){let d=[],c=(p,h,w,g=null)=>d.push({id:p,status:h,detail:w,fix:g}),f=(()=>{let[p,h]=process.versions.node.split(".").map(Number);return p>20||p===20&&h>=19})();c("node",f?"ok":"fail",`node ${process.versions.node}`,f?null:"install node >= 20.19"),t?t.backend==="hermes"?c("model","warn","backend=hermes (opt-in attach)","oracle model --backend standalone"):c("model","ok",`${t.backend||"auto"} ${t.provider||""} ${t.model||""}`.trim()):c("model","fail","no model.json","oracle setup model"),r.vaultExists?r.disarmed?c("vault","warn","vault present, DISARMED","oracle signer (re-arm after confirm)"):c("vault",r.armed?"ok":"warn",r.armed?"present, armed":"present, not armed"):c("vault","fail","no local vault","oracle sign init");let l=e.ORACLE_SIGNER_HOST||"127.0.0.1";if(pl.has(l)?c("signer",n?"ok":"warn",n?`loopback ${l}:${e.ORACLE_SIGNER_PORT||9462}`:"loopback signer not reachable",n?null:"oracle signer"):c("signer","fail",`signer host ${l} is not loopback`,"unset ORACLE_SIGNER_HOST"),!o)c("quote","warn","quote not probed",null);else if(o.ok){let p=String(o.detail||"net quote returned");c("quote","ok",p.length>140?`${p.slice(0,140)}\u2026`:p)}else c("quote","warn",o.detail||"quote unavailable","check network / oracle data serve");c("review",i?"ok":"fail",i?"sign-time review renders decoded action, policy hits, approval deltas":"sign-time review module missing from this build",i?null:"reinstall @oracle-agent/oracle (src/control/sign-time-review.mjs)"),c("receipt",s?"ok":"fail",s?"oracle receipt verifies on-chain state (SUCCESS/FAIL/UNKNOWN, finality-pinned)":"verified-receipt observer missing from this build",s?null:"reinstall @oracle-agent/oracle (src/desk/observe-receipt.mjs)");let m=d.some(p=>p.status==="fail"),b=d.filter(p=>p.status==="ok").length;return{ok:!m,checks:d,firstRunScore:{ok:b,total:d.length,label:`${b}/${d.length} first-run hops green`},venues:Tt({env:e,vault:r})}}async function hl(){try{return typeof(await Promise.resolve().then(()=>(hr(),eo))).createSignTimeReview=="function"}catch{return!1}}async function wl(){try{let e=await Promise.resolve().then(()=>(yi(),gi));return typeof e.observeReceipt=="function"||typeof e.default=="function"||Object.values(e).some(t=>typeof t=="function")}catch{return!1}}var pl,Qr=u(()=>{ot();Hr();si();ur();pl=new Set(["127.0.0.1","::1","localhost"])});var Si={};Xe(Si,{classifyReceipt:()=>$e,default:()=>bl,detailText:()=>Ei,firstHourReport:()=>Xr,probeQuote:()=>yl,probeSigner:()=>gl,symbol:()=>Je,vaultStatus:()=>We});async function gl(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 Je(e){let t=String(e??"?").replace(/[^\w.$-]/g,"");return t.length>12?`${t.slice(0,12)}...`:t||"?"}function Ei(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 yl(){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:`${Je(r.chainId)} ${Je(r.baseToken?.symbol)}/${Je(r.quoteToken?.symbol)} $${Je(r.priceUsd)}`}}catch(e){return{ok:!1,detail:Ei(e instanceof Error?e.message:"quote failed")}}}var bl,xi=u(()=>{Qr();Hr();bl={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=Tt();if(t)return process.stdout.write(`${JSON.stringify({venues:r},null,2)}
|
|
5
5
|
`),0;for(let n of r)process.stdout.write(`${n.status.padEnd(12)} ${n.key.padEnd(16)} ${n.name} exec=${n.execute?"local":"no"}
|
|
6
|
-
`);return 0}}});import ke from"node:fs";import Ei from"node:path";import en from"node:fs";import be from"node:path";Ze();var Pi="0.19.0",Iu=`hermes-agent==${Pi}`;var Zr="0.12.1",ku=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 $i(){return be.join(ye(),"runtime")}function Bi(){return be.join($i(),"venv")}function Di(e){let t=process.platform==="win32"?"Scripts":"bin",r=process.platform==="win32"?`${e}.exe`:e;return be.join(Bi(),t,r)}function Fi(){return Di("hermes")}function qi(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(en.existsSync(o))return o}catch{}}return null}function tn(){if(process.env.ORACLE_HERMES_BIN)return{ok:!0,bin:process.env.ORACLE_HERMES_BIN,source:"env"};let e=Fi();if(en.existsSync(e))return{ok:!0,bin:e,source:"managed"};let t=qi("hermes");return t?{ok:!0,bin:t,source:"path"}:{ok:!1,bin:null,source:null}}import Pe from"node:fs";import $ from"node:path";Ze();import{existsSync as nn,readFileSync as Ui}from"node:fs";import{dirname as rn,join as Tt}from"node:path";import{fileURLToPath as Mi}from"node:url";function ji(e){let t=rn(Mi(e));for(let r=0;r<8;r+=1){let n=Tt(t,"package.json");if(nn(n))try{let i=JSON.parse(Ui(n,"utf8"));if(i&&typeof i.version=="string")return t}catch{}let o=rn(t);if(o===t)break;t=o}throw new Error(`oracle: could not resolve package root from ${e}`)}function on(e,t){let r=ji(t),n=Tt(r,e);return nn(n)?n:Tt(r,"dist","assets",e)}var Hi=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 an(){return Hi.filter(e=>e.website)}var Ct=Object.freeze(["long_horizon","recursive_fanout","continual_learn","evidence_first","prepare_only"]);function Nt(e=process.env){let t=String(e?.ORACLE_RESEARCH_MODE??e?.ORACLE_RLM_MODE??"").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"||t==="on"||t==="research"}var oe=Object.freeze(["oracle_cli","memory_add","memory_remove","memory_search","skill_load","skill_create","skill_list","cron_add","cron_list","cron_remove","meta_analyze","web_fetch","web_search","file_read","file_write","run_command","mcp_list","mcp_call","evidence_read","todo_list","todo_set","update_plan","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","wallet_strategy_infer","x402_prepare"]),zi="deny",Pu=256*1024;var $u=Object.freeze({version:1,source:"default",defaultDecision:zi,allow:oe,deny:Object.freeze([])});var Wi=Object.freeze(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","approval_preview","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","vault_status","signer_status","receipt_report","watch_list","portfolio_snapshot","vision_analyze","knowledge_search"]),Bu=new Set(Wi);var ce=Object.freeze({PUBLIC_APP:"public-app",RESEARCH_X_TELEGRAM:"research-x-telegram",OWNER_DESK:"owner-desk"}),Du=Object.freeze(Object.values(ce));function sn(e){let t=e.filter(r=>!oe.includes(r));if(t.length)throw new Error(`tool surface allowlist names unknown shipped tools: ${t.join(", ")}`);return Object.freeze([...e])}var Rt=sn(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","update_plan","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","wallet_strategy_infer","x402_prepare"]),cn=sn([...Rt,"file_read","meta_analyze","cron_list","mcp_list","xurl"]),un=Object.freeze([...oe]),Fu=Object.freeze({[ce.PUBLIC_APP]:Rt,[ce.RESEARCH_X_TELEGRAM]:cn,[ce.OWNER_DESK]:un}),qu=Object.freeze({[ce.PUBLIC_APP]:new Set(Rt),[ce.RESEARCH_X_TELEGRAM]:new Set(cn),[ce.OWNER_DESK]:new Set(un)});var Lt=Object.freeze(["wallet","pool","nft_floor","hl_flow","prediction_market"]),Mu=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,Vi=e=>Math.round(e*1e4)/1e4;function W(e,t,r,n=!0){!n||r===null||!Number.isFinite(r)||e.push({feature:t,value:Vi(r)})}function Ki(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 Gi(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 Yi(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 Ji(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 Xi(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 ju=Object.freeze({wallet:Ki,pool:Gi,nft_floor:Yi,hl_flow:Ji,prediction_market:Xi});Gt();Xt();J();import{Interface as Pn,getAddress as Yf,id as es,isAddress as Jf}from"ethers";J();var Yl=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 Xl=Object.freeze(["blockNumber","nativeBalance","tokenBalance","resolveToken","resolvePools","scanBlocks","scoreRisk","quote","sellSimulation","prepareUnsignedTx"]),Qt=Object.freeze({LIVE:"LIVE",CACHED:"CACHED",STALE:"STALE",UNKNOWN:"UNKNOWN",UNAVAILABLE:"UNAVAILABLE"}),Zt=Object.freeze({PASS:"PASS",CAUTION:"CAUTION",FAIL:"FAIL",UNKNOWN:"UNKNOWN"});var Ka=Object.freeze({FULL:"FULL",NO_GAS:"NO_GAS",FAILED:"FAILED"});_n();Tn();Rn();j();X();ut();F();tr();Gt();Xt();j();var bf=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"]});ct();J();ot();var Df=Object.freeze(["lifi","relay"]);F();var jf=Object.freeze({TRANSACTION:"unsigned-transaction",TYPED_DATA_ORDER:"typed-data-order"});var Hf=new Set(["0x0000000000000000000000000000000000000000","0x000000000000000000000000000000000000dead","0x0000000000000000000000000000000000000001","0x00000000000000000000000000000000000a1ce5"].map(e=>e.toLowerCase()));var zf=Object.freeze(["operation","exactOutput","amountOut","multihop","path","positionManager","modifyLiquidities","commands","actions"]);F();var $n=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"})}),tp=new Pn(["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)"]),rp=new Pn(["function withdraw(uint256 wad)"]),np=(1n<<128n)-1n;var op=es("Transfer(address,address,uint256)").toLowerCase();j();ut();F();import{getAddress as up,Interface as lt,TypedDataEncoder as lp,parseUnits as dp}from"ethers";var rs="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)",wp=new lt([`function ${rs}`]),gp=new lt(["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"]),ns=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"]),yp=new Set(ns);var Bn=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 bp=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 lt(["function setApprovalForAll(address operator,bool approved)"]),Sp=new lt(["function cancel((address offerer,address zone,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)[] offer,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 counter)[] orders) returns (bool cancelled)"]);J();it();j();J();J();Wt();var dt=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 ft=new Map,os=Object.keys(Kt).map(Number),is=Object.keys(Jt).map(Number),as=Object.keys($n).map(Number),nr=dt.map(e=>e.chainId),ss=[...new Set(Object.values(Bn))],rr=new Set,Dn=!1;function Fn(e){if(!e||typeof e!="object"||Object.isFrozen(e))return e;for(let t of Object.values(e))Fn(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(Dn&&rr.has(t))throw new Error(`registerProvider refuses to overwrite built-in provider: ${t}`);return ft.set(t,{chainIds:e.chainIds||[],auth:e.auth||"none",description:e.description||"",baseEnv:e.baseEnv||[],...e,id:t}),ft.get(t)}function or({venue:e,op:t}={}){let r=[...ft.values()];return e&&(r=r.filter(n=>n.venue===e)),t&&(r=r.filter(n=>n.ops.includes(t))),r}function cs(){rr.clear();for(let[e,t]of ft)rr.add(e),Fn(t);Dn=!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:nr,auth:"none",ops:["health","scan"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:dt.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:os,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:as,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:nr,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:nr,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:is,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:ss,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:"near-rpc",venue:"near",chainIds:[],auth:"none",ops:["health","guide","account","ftBalance","tx"],execution:"read-only",localSignerSurfaces:[],baseEnv:["NEAR_RPC_URL","NEAR_TESTNET_RPC_URL","NEAR_NETWORK"],description:"NEAR Protocol reads over public JSON-RPC: node health, account NEAR balance/storage, NEP-141 token balance (ft_balance_of + ft_metadata), and transaction status by hash + sender. Not EVM: named accounts, yoctoNEAR units, NEP-141 not ERC-20. Only status/query/tx leave the module; send_tx and broadcast_tx_* are refused before any network call. 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."});cs();var nm=Object.freeze(["live","needs_key","deprecated","soft_fail","hard_down"]),us=new Set(["apiKey","agentKey"]),ls=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|CREDENTIAL|AUTH|ENV_FILE)$/i,ds=/(?:URL|URI|HOST|ENDPOINT|RPC)$/i;function fs(e={}){return us.has(e.auth)?(Array.isArray(e.baseEnv)?e.baseEnv:[]).filter(t=>ls.test(t)&&!ds.test(t)):[]}function pt(e={}){return e.execution==="unavailable"||!!e.deprecated}function ps(e={},t={},{env:r=process.env}={}){let n;if(pt(e))n="deprecated";else if(t?.ok===!0)n="live";else{let o=fs(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 qn(e=[],t=null,{env:r=process.env}={}){let n=t?.providers&&typeof t.providers=="object"?t.providers:{},o={live:0,needs_key:0,deprecated:0,soft_fail:0,hard_down:0,unknown:0},i={},s=[],d=[];for(let c of e){if(!pt(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=ps(c,n[c.id],{env:r});i[c.id]=f,o[f.class]+=1,f.hardDown&&s.push(c.id),f.quarantined&&d.push(c.id)}return Object.freeze({ok:s.length===0,roster:e.length,probed:t!=null,counts:Object.freeze(o),hardDown:s.length,hardDownIds:Object.freeze(s),quarantined:d.length,quarantinedIds:Object.freeze(d),classifications:Object.freeze(i)})}function Un(e){try{return Pe.existsSync(e)}catch{return!1}}function ir(e){for(let t of e)if(t&&Un(t))return t;return null}function ar(e){try{return on(e,import.meta.url)}catch{return null}}function ms(){let e=or(),t=e.filter(pt).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 Mn(){let e=ir([ar("skills"),$.join(L,"skills"),$.join(L,"dist/assets/skills"),$.join(L,"assets/skills")]);if(!e)return{count:0,trading:[],building:[]};let t=Pe.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 hs(){let e=ir([ar("protocols/templates"),$.join(L,"protocols/templates"),$.join(L,"dist/assets/protocols/templates"),$.join(L,"assets/protocols/templates")]);return e?Pe.readdirSync(e).filter(r=>!r.startsWith(".")):Mn().building.some(r=>/protocol-builder|dex-launch|token-launch/i.test(r))?["(via skills: protocol-builder / launch packs)"]:[]}function ws(){let e=ir([ar("profiles"),$.join(L,"profiles"),$.join(L,"dist/assets/profiles"),$.join(L,"assets/profiles")]);return e?Pe.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&!t.name.startsWith("_")).map(t=>t.name):[]}function gs(){try{if(oe.includes("trade_lifecycle")&&!oe.some(t=>/broadcast|wallet_sign/.test(t)))return!0}catch{}let e=[$.join(L,"src/capability-posture.mjs"),$.join(L,"dist/capability-posture.mjs"),$.join(L,"capability-posture.mjs"),$.join(L,"dist/public-control/policy-schema.mjs"),$.join(L,"README.md"),$.join(L,"package.json")];for(let t of e)if(Un(t))try{let r=Pe.readFileSync(t,"utf8");if(/prepare-only|never takes your key|never.*broadcast/i.test(r))return!0}catch{}return!1}function jn(e=process.env,{health:t=null}={}){let r=[],n=(x,_,U,y=1)=>{r.push({id:x,status:_,detail:U,weight:y})},[o,i]=process.versions.node.split(".").map(Number),s=o>20||o===20&&i>=19;n("node",s?"ok":"fail",`node ${process.versions.node}`,2);let c=["oracle_cli","research_delegate","trade_lifecycle","signal_score","skill_load","learn_skill","code_eval","cron_add","web_fetch"].filter(x=>!oe.includes(x));n("agent_tools",c.length===0?"ok":"warn",c.length===0?`safe tools ${oe.length}; signal_score present`:`missing tools: ${c.join(",")}`,3),n("research_attributes","ok",`attrs [${Ct.join(", ")}]; mode=${Nt(e)?"ON":"off"}`,2);let f=ms(),u=f.quarantinedIds.length?`: ${f.quarantinedIds.join(", ")}`:"";n("providers",f.count>=40?"ok":f.count>=10?"warn":"fail",`${f.count} providers from catalog, ${f.live} live, ${f.quarantined} quarantined${u}`,3);let m=qn(or(),t,{env:e}),b=m.hardDown>0?"fail":m.quarantined>0||m.counts.needs_key>0||m.counts.unknown>0?"warn":"ok",p=m.hardDownIds.length?`; hard_down_ids=${m.hardDownIds.join(",")}`:"";n("provider_health",b,`live=${m.counts.live} needs_key=${m.counts.needs_key} deprecated=${m.counts.deprecated} soft_fail=${m.counts.soft_fail} hard_down=${m.counts.hard_down} unknown=${m.counts.unknown}${p}`,3);let h=Mn();n("skills_trading_build",h.trading.length>=5&&h.building.length>=4?"ok":h.count>=10?"warn":"fail",`${h.count} skills; trading=${h.trading.length} building=${h.building.length}`,3);let w=hs();n("protocol_templates",w.length>=2?"ok":"warn",w.length?w.join(", "):"none",2);let g=ws();n("profiles",g.includes("protocol-builder")&&g.includes("oracle")?"ok":g.length>=1?"warn":"fail",g.join(", ")||"none",2),n("signals_engine",Lt.length>=4?"ok":"fail",`types: ${Lt.join(", ")} (cold / no hot exec)`,2);let S=an();n("harness_roster",S.length>=8?"ok":"warn",`${S.length} supported harnesses; Oracle native default; MCP inbound only`,2),n("custody_prepare_only",gs()?"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:Nt(e),attributes:[...Ct],packageRoot:L,checks:r}}function Si(){let[e,t]=process.versions.node.split(".").map(Number);return e>20||e===20&&t>=19}function mu(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 hu(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 gx={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",Si()?"ok":"fail",`node ${process.versions.node}`,Si()?null:"install node >= 20.19");let d=e.paths.oracleExecEnvPath(),c=mu(d),f=process.env.ORACLE_ROUTE_ATTESTATION_SECRET||process.env.MAD_ROUTE_ATTESTATION_SECRET||process.env.ORACLE_ATTESTATION_SECRET||process.env.ORACLE_STAMP_HMAC_SECRET||c.ORACLE_ROUTE_ATTESTATION_SECRET||c.MAD_ROUTE_ATTESTATION_SECRET||c.ORACLE_ATTESTATION_SECRET||c.ORACLE_STAMP_HMAC_SECRET;s("attestation_secret",f?"ok":"warn",f?"present":"missing",f?null:"run oracle init --apply (writes ~/.config/oracle/exec.env)");let u=process.env.ORACLE_DATA_URL||"http://127.0.0.1:8787",m=await hu(u),b=e.paths.loadDeskRouting&&(process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL)?`desk ${process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL}`:null;s("data_server",m?"ok":"warn",m?`reachable ${u}${b?` (${b})`:""}`:`down ${u}`,m?null:u.includes("127.0.0.1")||u.includes("localhost")?"oracle data serve OR set ~/.config/oracle/desk.json to YOUR_DESK_HOST":"check the desk URL in ~/.config/oracle/desk.json (/public/health)");let p=tn();s("harness_model","ok","Oracle native harness is default; external harnesses are inbound MCP only (oracle harness detect)",null),s("hermes_opt_in","ok",p.ok?`detected ${p.bin} (${p.source}) \u2014 unused unless explicitly opted in`:"not detected \u2014 native-only OK",null);let h=Ei.join(e.paths.hermesRoot(),"profiles"),w=0;ke.existsSync(h)&&(w=ke.readdirSync(h,{withFileTypes:!0}).filter(E=>E.isDirectory()).length),s("hermes_lanes","ok",w>0?`${w} profile dir(s) (optional surface)`:"no Hermes lane profiles (native-only OK)",null);{let E=Ei.join(h,"oracle",".env"),A=[];if(ke.existsSync(E)){let N=ke.readFileSync(E,"utf8");/^TELEGRAM_BOT_TOKEN=.+/m.test(N)&&A.push("telegram"),/^DISCORD_BOT_TOKEN=.+/m.test(N)&&A.push("discord"),/^SLACK_BOT_TOKEN=.+/m.test(N)&&A.push("slack")}A.length?p.ok?s("messaging","ok",`${A.join("/")} configured \xB7 runtime ${p.source}`,null):s("messaging","warn",`${A.join("/")} token set but messaging runtime missing \u2014 bot cannot answer`,"oracle bootstrap, then oracle setup gateway restart"):s("messaging","ok","no channel tokens configured (optional \u2014 oracle setup)",null)}let g=null;if(r){g=jn(process.env);for(let E of g.checks)s(`agentic_${E.id}`,E.status,E.detail,null)}let S=null;if(n){let{firstHourReport:E,probeReviewModule:A,probeReceiptModule:N}=await Promise.resolve().then(()=>(Kr(),wi)),{probeSigner:q,probeQuote:v}=await Promise.resolve().then(()=>(bi(),yi)),[x,_,U,y]=await Promise.all([q(process.env),v(),A(),N()]);S=E({signerReachable:x,quote:_,reviewAvailable:U,receiptAvailable:y});for(let T of S.checks)s(`hour_${T.id}`,T.status,T.detail,T.fix);s("hour_score",S.ok?"ok":"warn",S.firstRunScore.label,null)}let P={ok:!i&&(g?g.ok:!0)&&(S?S.ok:!0),checks:o,...S?{firstHour:S}:{},...g?{agentic:{pct:g.pct,summary:g.summary,attributes:g.attributes,researchMode:g.researchMode}}:{}};if(t)process.stdout.write(JSON.stringify(P,null,2)+`
|
|
6
|
+
`);return 0}}});import ke from"node:fs";import vi from"node:path";import an from"node:fs";import be from"node:path";Ze();var Di="0.19.0",Nl=`hermes-agent==${Di}`;var on="0.12.1",Rl=Object.freeze({posix:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${on}/uv-installer.sh`,sha256:"d3f5412d38c99f9d024901843bf98206f0d2c6dbe64df40d0b740e2751ca62c1"}),windows:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${on}/uv-installer.ps1`,sha256:"b9ec035151bfbb11d616dbd69886498d885551489eddf095ea3c0ad59f640eb0"})});function Fi(){return be.join(ye(),"runtime")}function qi(){return be.join(Fi(),"venv")}function Mi(e){let t=process.platform==="win32"?"Scripts":"bin",r=process.platform==="win32"?`${e}.exe`:e;return be.join(qi(),t,r)}function Ui(){return Mi("hermes")}function ji(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(an.existsSync(o))return o}catch{}}return null}function sn(){if(process.env.ORACLE_HERMES_BIN)return{ok:!0,bin:process.env.ORACLE_HERMES_BIN,source:"env"};let e=Ui();if(an.existsSync(e))return{ok:!0,bin:e,source:"managed"};let t=ji("hermes");return t?{ok:!0,bin:t,source:"path"}:{ok:!1,bin:null,source:null}}import Pe from"node:fs";import $ from"node:path";Ze();import{existsSync as ln,readFileSync as Hi}from"node:fs";import{dirname as cn,join as Rt}from"node:path";import{fileURLToPath as zi}from"node:url";function Wi(e){let t=cn(zi(e));for(let r=0;r<8;r+=1){let n=Rt(t,"package.json");if(ln(n))try{let i=JSON.parse(Hi(n,"utf8"));if(i&&typeof i.version=="string")return t}catch{}let o=cn(t);if(o===t)break;t=o}throw new Error(`oracle: could not resolve package root from ${e}`)}function un(e,t){let r=Wi(t),n=Rt(r,e);return ln(n)?n:Rt(r,"dist","assets",e)}var Vi=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 dn(){return Vi.filter(e=>e.website)}var Lt=Object.freeze(["long_horizon","recursive_fanout","continual_learn","evidence_first","prepare_only"]);function Pt(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 ie=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","run_command","mcp_list","mcp_call","evidence_read","todo_list","todo_set","update_plan","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","wallet_strategy_infer","x402_prepare"]),Ki="deny",Ml=256*1024;var Ul=Object.freeze({version:1,source:"default",defaultDecision:Ki,allow:ie,deny:Object.freeze([])});var Gi=Object.freeze(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","session_search","research_delegate","rlm","deep_research","clarify","code_eval","approval_preview","research_artifact","portfolio_analyze","tax_lots","position_health","governance_prepare","safety_intelligence","portfolio_risk","trade_lifecycle","signal_score","vault_status","signer_status","receipt_report","watch_list","portfolio_snapshot","vision_analyze","knowledge_search"]),jl=new Set(Gi);var le=Object.freeze({PUBLIC_APP:"public-app",RESEARCH_X_TELEGRAM:"research-x-telegram",OWNER_DESK:"owner-desk"}),Hl=Object.freeze(Object.values(le));function fn(e){let t=e.filter(r=>!ie.includes(r));if(t.length)throw new Error(`tool surface allowlist names unknown shipped tools: ${t.join(", ")}`);return Object.freeze([...e])}var $t=fn(["oracle_cli","memory_search","skill_load","skill_list","web_fetch","web_search","evidence_read","todo_list","todo_set","update_plan","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","wallet_strategy_infer","x402_prepare"]),pn=fn([...$t,"file_read","meta_analyze","cron_list","mcp_list","xurl"]),mn=Object.freeze([...ie]),zl=Object.freeze({[le.PUBLIC_APP]:$t,[le.RESEARCH_X_TELEGRAM]:pn,[le.OWNER_DESK]:mn}),Wl=Object.freeze({[le.PUBLIC_APP]:new Set($t),[le.RESEARCH_X_TELEGRAM]:new Set(pn),[le.OWNER_DESK]:new Set(mn)});var Bt=Object.freeze(["wallet","pool","nft_floor","hl_flow","prediction_market"]),Kl=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,Ji=e=>Math.round(e*1e4)/1e4;function W(e,t,r,n=!0){!n||r===null||!Number.isFinite(r)||e.push({feature:t,value:Ji(r)})}function Yi(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 Xi(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 Qi(e,t){let r=z(e.floorChange??e.floorChangePct),n=z(e.sales??e.saleCount);W(t,"floor_change",r===null?null:G(r,-1,1)*.35),W(t,"sales_depth",n===null?null:G(n/50)*.18)}function Zi(e,t){let r=z(e.flowImbalance??e.imbalance),n=z(e.fundingRate??e.funding);W(t,"flow_imbalance",r===null?null:G(r,-1,1)*.42),W(t,"funding",n===null?null:-G(n*100,-1,1)*.12)}function ea(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 Gl=Object.freeze({wallet:Yi,pool:Xi,nft_floor:Qi,hl_flow:Zi,prediction_market:ea});Xt();er();Y();import{Interface as qn,getAddress as tp,id as ns,isAddress as rp}from"ethers";Y();var td=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 nd=Object.freeze(["blockNumber","nativeBalance","tokenBalance","resolveToken","resolvePools","scanBlocks","scoreRisk","quote","sellSimulation","prepareUnsignedTx"]),tr=Object.freeze({LIVE:"LIVE",CACHED:"CACHED",STALE:"STALE",UNKNOWN:"UNKNOWN",UNAVAILABLE:"UNAVAILABLE"}),rr=Object.freeze({PASS:"PASS",CAUTION:"CAUTION",FAIL:"FAIL",UNKNOWN:"UNKNOWN"});var Ya=Object.freeze({FULL:"FULL",NO_GAS:"NO_GAS",FAILED:"FAILED"});Ln();Pn();Dn();j();X();lt();F();or();Xt();er();j();var If=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"]});ct();Y();ot();var Hf=Object.freeze(["lifi","relay"]);F();var Gf=Object.freeze({TRANSACTION:"unsigned-transaction",TYPED_DATA_ORDER:"typed-data-order"});var Jf=new Set(["0x0000000000000000000000000000000000000000","0x000000000000000000000000000000000000dead","0x0000000000000000000000000000000000000001","0x00000000000000000000000000000000000a1ce5"].map(e=>e.toLowerCase()));var Yf=Object.freeze(["operation","exactOutput","amountOut","multihop","path","positionManager","modifyLiquidities","commands","actions"]);F();var Mn=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"})}),sp=new qn(["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)"]),cp=new qn(["function withdraw(uint256 wad)"]),lp=(1n<<128n)-1n;var up=ns("Transfer(address,address,uint256)").toLowerCase();j();lt();F();import{getAddress as hp,Interface as ut,TypedDataEncoder as wp,parseUnits as gp}from"ethers";var is="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)",xp=new ut([`function ${is}`]),vp=new ut(["function mintPublic(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity) payable","function mintAllowList(address nftContract,address feeRecipient,address minterIfNotPayer,uint256 quantity,(uint80 mintPrice,uint48 maxTotalMintableByWallet,uint48 startTime,uint48 endTime,uint48 dropStageIndex,uint32 maxTokenSupplyForStage,uint16 feeBps,bool restrictFeeRecipients) mintParams,bytes32[] proof) payable"]),as=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"]),Ap=new Set(as);var Un=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 Ip=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 kp=new ut(["function setApprovalForAll(address operator,bool approved)"]),Op=new ut(["function cancel((address offerer,address zone,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount)[] offer,(uint8 itemType,address token,uint256 identifierOrCriteria,uint256 startAmount,uint256 endAmount,address recipient)[] consideration,uint8 orderType,uint256 startTime,uint256 endTime,bytes32 zoneHash,uint256 salt,bytes32 conduitKey,uint256 counter)[] orders) returns (bool cancelled)"]);Y();it();j();Y();Y();Gt();var dt=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 ft=new Map,ss=Object.keys(Yt).map(Number),cs=Object.keys(Zt).map(Number),ls=Object.keys(Mn).map(Number),ar=dt.map(e=>e.chainId),us=[...new Set(Object.values(Un))],ir=new Set,jn=!1;function Hn(e){if(!e||typeof e!="object"||Object.isFrozen(e))return e;for(let t of Object.values(e))Hn(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(jn&&ir.has(t))throw new Error(`registerProvider refuses to overwrite built-in provider: ${t}`);return ft.set(t,{chainIds:e.chainIds||[],auth:e.auth||"none",description:e.description||"",baseEnv:e.baseEnv||[],...e,id:t}),ft.get(t)}function sr({venue:e,op:t}={}){let r=[...ft.values()];return e&&(r=r.filter(n=>n.venue===e)),t&&(r=r.filter(n=>n.ops.includes(t))),r}function ds(){ir.clear();for(let[e,t]of ft)ir.add(e),Hn(t);jn=!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:ar,auth:"none",ops:["health","scan"],execution:"prepare",localSignerSurfaces:["evm-swap"],baseEnv:dt.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:ss,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:ls,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:ar,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:ar,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:cs,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:us,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:"near-rpc",venue:"near",chainIds:[],auth:"none",ops:["health","guide","account","ftBalance","tx"],execution:"read-only",localSignerSurfaces:[],baseEnv:["NEAR_RPC_URL","NEAR_TESTNET_RPC_URL","NEAR_NETWORK"],description:"NEAR Protocol reads over public JSON-RPC: node health, account NEAR balance/storage, NEP-141 token balance (ft_balance_of + ft_metadata), and transaction status by hash + sender. Not EVM: named accounts, yoctoNEAR units, NEP-141 not ERC-20. Only status/query/tx leave the module; send_tx and broadcast_tx_* are refused before any network call. 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."});ds();var lm=Object.freeze(["live","needs_key","deprecated","soft_fail","hard_down"]),fs=new Set(["apiKey","agentKey"]),ps=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|CREDENTIAL|AUTH|ENV_FILE)$/i,ms=/(?:URL|URI|HOST|ENDPOINT|RPC)$/i;function hs(e={}){return fs.has(e.auth)?(Array.isArray(e.baseEnv)?e.baseEnv:[]).filter(t=>ps.test(t)&&!ms.test(t)):[]}function pt(e={}){return e.execution==="unavailable"||!!e.deprecated}function ws(e={},t={},{env:r=process.env}={}){let n;if(pt(e))n="deprecated";else if(t?.ok===!0)n="live";else{let o=hs(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 zn(e=[],t=null,{env:r=process.env}={}){let n=t?.providers&&typeof t.providers=="object"?t.providers:{},o={live:0,needs_key:0,deprecated:0,soft_fail:0,hard_down:0,unknown:0},i={},s=[],d=[];for(let c of e){if(!pt(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=ws(c,n[c.id],{env:r});i[c.id]=f,o[f.class]+=1,f.hardDown&&s.push(c.id),f.quarantined&&d.push(c.id)}return Object.freeze({ok:s.length===0,roster:e.length,probed:t!=null,counts:Object.freeze(o),hardDown:s.length,hardDownIds:Object.freeze(s),quarantined:d.length,quarantinedIds:Object.freeze(d),classifications:Object.freeze(i)})}function Wn(e){try{return Pe.existsSync(e)}catch{return!1}}function cr(e){for(let t of e)if(t&&Wn(t))return t;return null}function lr(e){try{return un(e,import.meta.url)}catch{return null}}function gs(){let e=sr(),t=e.filter(pt).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 Vn(){let e=cr([lr("skills"),$.join(L,"skills"),$.join(L,"dist/assets/skills"),$.join(L,"assets/skills")]);if(!e)return{count:0,trading:[],building:[]};let t=Pe.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 ys(){let e=cr([lr("protocols/templates"),$.join(L,"protocols/templates"),$.join(L,"dist/assets/protocols/templates"),$.join(L,"assets/protocols/templates")]);return e?Pe.readdirSync(e).filter(r=>!r.startsWith(".")):Vn().building.some(r=>/protocol-builder|dex-launch|token-launch/i.test(r))?["(via skills: protocol-builder / launch packs)"]:[]}function bs(){let e=cr([lr("profiles"),$.join(L,"profiles"),$.join(L,"dist/assets/profiles"),$.join(L,"assets/profiles")]);return e?Pe.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&!t.name.startsWith("_")).map(t=>t.name):[]}function Es(){try{if(ie.includes("trade_lifecycle")&&!ie.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(Wn(t))try{let r=Pe.readFileSync(t,"utf8");if(/prepare-only|never takes your key|never.*broadcast/i.test(r))return!0}catch{}return!1}function Kn(e=process.env,{health:t=null}={}){let r=[],n=(x,_,M,y=1)=>{r.push({id:x,status:_,detail:M,weight:y})},[o,i]=process.versions.node.split(".").map(Number),s=o>20||o===20&&i>=19;n("node",s?"ok":"fail",`node ${process.versions.node}`,2);let c=["oracle_cli","research_delegate","trade_lifecycle","signal_score","skill_load","learn_skill","code_eval","cron_add","web_fetch"].filter(x=>!ie.includes(x));n("agent_tools",c.length===0?"ok":"warn",c.length===0?`safe tools ${ie.length}; signal_score present`:`missing tools: ${c.join(",")}`,3),n("research_attributes","ok",`attrs [${Lt.join(", ")}]; mode=${Pt(e)?"ON":"off"}`,2);let f=gs(),l=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${l}`,3);let m=zn(sr(),t,{env:e}),b=m.hardDown>0?"fail":m.quarantined>0||m.counts.needs_key>0||m.counts.unknown>0?"warn":"ok",p=m.hardDownIds.length?`; hard_down_ids=${m.hardDownIds.join(",")}`:"";n("provider_health",b,`live=${m.counts.live} needs_key=${m.counts.needs_key} deprecated=${m.counts.deprecated} soft_fail=${m.counts.soft_fail} hard_down=${m.counts.hard_down} unknown=${m.counts.unknown}${p}`,3);let h=Vn();n("skills_trading_build",h.trading.length>=5&&h.building.length>=4?"ok":h.count>=10?"warn":"fail",`${h.count} skills; trading=${h.trading.length} building=${h.building.length}`,3);let w=ys();n("protocol_templates",w.length>=2?"ok":"warn",w.length?w.join(", "):"none",2);let g=bs();n("profiles",g.includes("protocol-builder")&&g.includes("oracle")?"ok":g.length>=1?"warn":"fail",g.join(", ")||"none",2),n("signals_engine",Bt.length>=4?"ok":"fail",`types: ${Bt.join(", ")} (cold / no hot exec)`,2);let S=dn();n("harness_roster",S.length>=8?"ok":"warn",`${S.length} supported harnesses; Oracle native default; MCP inbound only`,2),n("custody_prepare_only",Es()?"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:Pt(e),attributes:[...Lt],packageRoot:L,checks:r}}function Ai(){let[e,t]=process.versions.node.split(".").map(Number);return e>20||e===20&&t>=19}function El(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 Sl(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 Mx={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",Ai()?"ok":"fail",`node ${process.versions.node}`,Ai()?null:"install node >= 20.19");let d=e.paths.oracleExecEnvPath(),c=El(d),f=process.env.ORACLE_ROUTE_ATTESTATION_SECRET||process.env.MAD_ROUTE_ATTESTATION_SECRET||process.env.ORACLE_ATTESTATION_SECRET||process.env.ORACLE_STAMP_HMAC_SECRET||c.ORACLE_ROUTE_ATTESTATION_SECRET||c.MAD_ROUTE_ATTESTATION_SECRET||c.ORACLE_ATTESTATION_SECRET||c.ORACLE_STAMP_HMAC_SECRET;s("attestation_secret",f?"ok":"warn",f?"present":"missing",f?null:"run oracle init --apply (writes ~/.config/oracle/exec.env)");let l=process.env.ORACLE_DATA_URL||"http://127.0.0.1:8787",m=await Sl(l),b=e.paths.loadDeskRouting&&(process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL)?`desk ${process.env.ORACLE_DESK_URL||process.env.ORACLE_PUBLIC_URL}`:null;s("data_server",m?"ok":"warn",m?`reachable ${l}${b?` (${b})`:""}`:`down ${l}`,m?null:l.includes("127.0.0.1")||l.includes("localhost")?"oracle data serve OR set ~/.config/oracle/desk.json to YOUR_DESK_HOST":"check the desk URL in ~/.config/oracle/desk.json (/public/health)");let p=sn();s("harness_model","ok","Oracle native harness is default; external harnesses are inbound MCP only (oracle harness detect)",null),s("hermes_opt_in","ok",p.ok?`detected ${p.bin} (${p.source}) \u2014 unused unless explicitly opted in`:"not detected \u2014 native-only OK",null);let h=vi.join(e.paths.hermesRoot(),"profiles"),w=0;ke.existsSync(h)&&(w=ke.readdirSync(h,{withFileTypes:!0}).filter(E=>E.isDirectory()).length),s("hermes_lanes","ok",w>0?`${w} profile dir(s) (optional surface)`:"no Hermes lane profiles (native-only OK)",null);{let E=vi.join(h,"oracle",".env"),A=[];if(ke.existsSync(E)){let N=ke.readFileSync(E,"utf8");/^TELEGRAM_BOT_TOKEN=.+/m.test(N)&&A.push("telegram"),/^DISCORD_BOT_TOKEN=.+/m.test(N)&&A.push("discord"),/^SLACK_BOT_TOKEN=.+/m.test(N)&&A.push("slack")}A.length?p.ok?s("messaging","ok",`${A.join("/")} configured \xB7 runtime ${p.source}`,null):s("messaging","warn",`${A.join("/")} token set but messaging runtime missing \u2014 bot cannot answer`,"oracle bootstrap, then oracle setup gateway restart"):s("messaging","ok","no channel tokens configured (optional \u2014 oracle setup)",null)}let g=null;if(r){g=Kn(process.env);for(let E of g.checks)s(`agentic_${E.id}`,E.status,E.detail,null)}let S=null;if(n){let{firstHourReport:E,probeReviewModule:A,probeReceiptModule:N}=await Promise.resolve().then(()=>(Qr(),bi)),{probeSigner:q,probeQuote:v}=await Promise.resolve().then(()=>(xi(),Si)),[x,_,M,y]=await Promise.all([q(process.env),v(),A(),N()]);S=E({signerReachable:x,quote:_,reviewAvailable:M,receiptAvailable:y});for(let T of S.checks)s(`hour_${T.id}`,T.status,T.detail,T.fix);s("hour_score",S.ok?"ok":"warn",S.firstRunScore.label,null)}let P={ok:!i&&(g?g.ok:!0)&&(S?S.ok:!0),checks:o,...S?{firstHour:S}:{},...g?{agentic:{pct:g.pct,summary:g.summary,attributes:g.attributes,researchMode:g.researchMode}}:{}};if(t)process.stdout.write(JSON.stringify(P,null,2)+`
|
|
7
7
|
`);else{for(let E of o)process.stdout.write(`${E.status.toUpperCase().padEnd(4)} ${E.id}: ${E.detail}
|
|
8
8
|
`),E.fix&&process.stdout.write(` fix: ${E.fix}
|
|
9
9
|
`);g&&process.stdout.write(`
|
|
10
10
|
${g.summary}
|
|
11
|
-
`)}return P.ok?0:1}};export{
|
|
11
|
+
`)}return P.ok?0:1}};export{Mx as default};
|