@compass-labs/api-sdk 2.2.77 → 2.2.78-rc.0
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/README.md +5 -3
- package/codeSamples_typescript.yaml +6 -0
- package/dist/commonjs/funcs/creditCreditUnloop.d.ts +40 -0
- package/dist/commonjs/funcs/creditCreditUnloop.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditUnloop.js +141 -0
- package/dist/commonjs/funcs/creditCreditUnloop.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/creditunlooppreview.d.ts +57 -0
- package/dist/commonjs/models/components/creditunlooppreview.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditunlooppreview.js +74 -0
- package/dist/commonjs/models/components/creditunlooppreview.js.map +1 -0
- package/dist/commonjs/models/components/creditunlooprequest.d.ts +97 -0
- package/dist/commonjs/models/components/creditunlooprequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditunlooprequest.js +83 -0
- package/dist/commonjs/models/components/creditunlooprequest.js.map +1 -0
- package/dist/commonjs/models/components/creditunloopresponse.d.ts +27 -0
- package/dist/commonjs/models/components/creditunloopresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditunloopresponse.js +61 -0
- package/dist/commonjs/models/components/creditunloopresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +4 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +4 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/unlooplegpreview.d.ts +28 -0
- package/dist/commonjs/models/components/unlooplegpreview.d.ts.map +1 -0
- package/dist/commonjs/models/components/unlooplegpreview.js +61 -0
- package/dist/commonjs/models/components/unlooplegpreview.js.map +1 -0
- package/dist/commonjs/sdk/credit.d.ts +29 -0
- package/dist/commonjs/sdk/credit.d.ts.map +1 -1
- package/dist/commonjs/sdk/credit.js +32 -0
- package/dist/commonjs/sdk/credit.js.map +1 -1
- package/dist/esm/funcs/creditCreditUnloop.d.ts +40 -0
- package/dist/esm/funcs/creditCreditUnloop.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditUnloop.js +105 -0
- package/dist/esm/funcs/creditCreditUnloop.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/creditunlooppreview.d.ts +57 -0
- package/dist/esm/models/components/creditunlooppreview.d.ts.map +1 -0
- package/dist/esm/models/components/creditunlooppreview.js +37 -0
- package/dist/esm/models/components/creditunlooppreview.js.map +1 -0
- package/dist/esm/models/components/creditunlooprequest.d.ts +97 -0
- package/dist/esm/models/components/creditunlooprequest.d.ts.map +1 -0
- package/dist/esm/models/components/creditunlooprequest.js +44 -0
- package/dist/esm/models/components/creditunlooprequest.js.map +1 -0
- package/dist/esm/models/components/creditunloopresponse.d.ts +27 -0
- package/dist/esm/models/components/creditunloopresponse.d.ts.map +1 -0
- package/dist/esm/models/components/creditunloopresponse.js +24 -0
- package/dist/esm/models/components/creditunloopresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +4 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +4 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/unlooplegpreview.d.ts +28 -0
- package/dist/esm/models/components/unlooplegpreview.d.ts.map +1 -0
- package/dist/esm/models/components/unlooplegpreview.js +24 -0
- package/dist/esm/models/components/unlooplegpreview.js.map +1 -0
- package/dist/esm/sdk/credit.d.ts +29 -0
- package/dist/esm/sdk/credit.d.ts.map +1 -1
- package/dist/esm/sdk/credit.js +32 -0
- package/dist/esm/sdk/credit.js.map +1 -1
- package/docs/models/components/creditunlooppreview.md +39 -0
- package/docs/models/components/creditunlooprequest.md +37 -0
- package/docs/models/components/creditunlooprequestmaxslippagepercent.md +19 -0
- package/docs/models/components/creditunloopresponse.md +33 -0
- package/docs/models/components/targetmultiplier.md +19 -0
- package/docs/models/components/unlooplegpreview.md +23 -0
- package/docs/sdks/credit/README.md +111 -0
- package/examples/node_modules/tsx/dist/cjs/api/index.cjs +1 -1
- package/examples/node_modules/tsx/dist/cjs/api/index.mjs +1 -1
- package/examples/node_modules/tsx/dist/cjs/index.cjs +1 -1
- package/examples/node_modules/tsx/dist/cjs/index.mjs +1 -1
- package/examples/node_modules/tsx/dist/cli.cjs +1 -1
- package/examples/node_modules/tsx/dist/cli.mjs +1 -1
- package/examples/node_modules/tsx/dist/esm/api/index.cjs +1 -1
- package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -1
- package/examples/node_modules/tsx/dist/esm/index.cjs +1 -1
- package/examples/node_modules/tsx/dist/esm/index.mjs +1 -1
- package/examples/node_modules/tsx/dist/loader.cjs +1 -1
- package/examples/node_modules/tsx/dist/loader.mjs +1 -1
- package/examples/node_modules/tsx/dist/package-BgaOhdqD.mjs +1 -0
- package/examples/node_modules/tsx/dist/package-BqwdNe35.cjs +1 -0
- package/examples/node_modules/tsx/dist/register-BLKDwPDF.mjs +10 -0
- package/examples/node_modules/tsx/dist/{register-BOkp8V6j.cjs → register-BLUABhh3.cjs} +7 -7
- package/examples/node_modules/tsx/dist/register-CN6UEFH9.cjs +2 -0
- package/examples/node_modules/tsx/dist/register-D5KIhaFJ.mjs +2 -0
- package/examples/node_modules/tsx/dist/repl.cjs +1 -1
- package/examples/node_modules/tsx/dist/repl.mjs +1 -1
- package/examples/node_modules/tsx/dist/{require-CjvaJWEr.cjs → require-DVoFfmDN.cjs} +1 -1
- package/examples/node_modules/tsx/dist/{require-DzmC1hVr.mjs → require-l-oOTCoT.mjs} +1 -1
- package/examples/node_modules/tsx/package.json +1 -1
- package/examples/package-lock.json +3 -3
- package/openapi_prepped_for_speakeasy.json +319 -0
- package/package.json +1 -1
- package/src/funcs/creditCreditUnloop.ts +193 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/creditunlooppreview.ts +104 -0
- package/src/models/components/creditunlooprequest.ts +169 -0
- package/src/models/components/creditunloopresponse.ts +65 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/unlooplegpreview.ts +60 -0
- package/src/sdk/credit.ts +40 -0
- package/examples/node_modules/tsx/dist/package-BhsaYzSJ.cjs +0 -1
- package/examples/node_modules/tsx/dist/package-REq4Oepp.mjs +0 -1
- package/examples/node_modules/tsx/dist/register-BBZNEaBg.cjs +0 -2
- package/examples/node_modules/tsx/dist/register-BnTWPeIB.mjs +0 -10
- package/examples/node_modules/tsx/dist/register-tkXbOgAS.mjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var he=Object.defineProperty;var l=(e,r)=>he(e,"name",{value:r,configurable:!0});var L=require("node:module"),ye=require("node:worker_threads"),y=require("./node-features-CQLdkVE6.cjs"),n=require("./register-BLUABhh3.cjs"),f=require("node:url"),z=require("node:fs"),Pe=require("node:fs/promises"),h=require("./index-D9F1FXzN.cjs"),X=require("./client-D3mGB526.cjs"),U=require("node:path"),T=typeof document<"u"?document.currentScript:null;const Re=l(()=>({active:!0,parsedTsconfig:void 0}),"createDefaultData"),V=l(e=>{const r={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(r.parsedTsconfig=n.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),Ue=l(e=>async r=>{if(!r)throw new Error(`tsx must be loaded with --import instead of --loader
|
|
2
|
+
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(e,V(r)),r.port&&r.port.on("message",t=>{t==="deactivate"&&(e.active=!1,r.port.postMessage({type:"deactivated"}))})},"createInitialize"),Se=l(e=>()=>(e.parsedTsconfig=n.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"createGlobalPreload"),Ee=l(e=>{const{pathname:r}=new URL(e),t=U.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageType(e)},"getFormatFromFileUrl"),ve=l(e=>{const{pathname:r}=new URL(e),t=U.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),S="tsx-namespace=",W="tsx-commonjs-export-preparse",K=`${W}=1`,F="tsx-commonjs-virtual-query",j=new Map,A=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),$=l((e,r)=>{const t=A(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),Le=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Te=l(e=>{const r=Le(e);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const t=r.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(s=>{const o=s.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),we=l((e,r,t)=>{const s=j.get(e);if(!s)return!1;try{const[o]=h.parseEsm(s);return o.some(a=>{if(a.d!==-1||a.n!==r)return!1;const m=Te(s.slice(a.ss,a.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),E=l(e=>{const r=e.indexOf(S);if(r===-1)return;const t=e[r-1];if(t!=="?"&&t!=="&")return;const s=r+S.length,o=e.indexOf("&",s);return o===-1?e.slice(s):e.slice(s,o)},"getNamespace"),Y=y.isFeatureSupported(y.importAttributes)?"importAttributes":"importAssertions",Z=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),k=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Fe=y.isFeatureSupported(y.esmLoadReadFile),je=[`${F}=`],J=[`${W}=`,`${F}=`],v=l((e,r)=>r.parsedTsconfig&&n.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),Ie=l(e=>{if(!e.searchParams.has(F))return;const{pathname:r}=e,t=r.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const s=new URL(e);return s.pathname=r.slice(0,t),s.search="",f.fileURLToPath(s)},"getFilePathFromVirtualQuery"),B=l(e=>{const r=e.startsWith(n.fileUrlPrefix)?new URL(e):void 0,t=r?f.fileURLToPath(r):e,s=r&&Ie(r),o=s||t,a=r&&s?f.pathToFileURL(o).toString()+$(r.search,je):e;return{fileUrl:r,filePath:o,loadUrl:a}},"getFileLoadContext"),ee=l((e,r)=>{if(!r?.search)return e;const t=$(r.search,J);return t?f.pathToFileURL(e).toString()+t:e},"getTransformPath"),te=l((e,r,t)=>{const s=[...r?A(r.search,[S,...J]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),_e=new TextDecoder,re=l(e=>typeof e=="string"?e:_e.decode(e),"decodeSource"),be=l((e,r)=>{const t=new URL(r),s=r.startsWith(n.fileUrlPrefix)?B(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(W),t.searchParams.delete(F),s&&(t.pathname=new URL(f.pathToFileURL(s)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),se=l((e,r)=>{if(!e.active)return!1;const t=E(r);if(e.namespace&&e.namespace!==t)return!1;const s=be(e,r);return X.parent.send&&X.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),ne=l((e,r)=>{if(!n.isJsonPattern.test(e))return r;const t=r[Y];return t?.type?r:{...r,[Y]:{...t,type:"json"}}},"prepareJsonAttributes"),Q=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Ce=l(e=>{const r=l(async(t,s,o)=>{if(!se(e,t))return o(t,s);const a=E(t),{fileUrl:m,filePath:c,loadUrl:i}=B(t),u=ne(i,s),d=await o(i,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:i,loaded:d});const P=m?.searchParams.has(W)===!0,R=d.format,w=m?new URL(f.pathToFileURL(c)):void 0;if(w&&m&&(w.search=$(m.search,J)),Z(R)&&m&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=await Pe.readFile(f.pathToFileURL(c),"utf8"),b=h.isESM(p);if(R==="commonjs-typescript"||!c.endsWith(".js")||b){if(!Fe){if(P&&b&&n.implicitTsExtensionsPattern.test(c)){const C=await h.transform(p,c,{define:{"import.meta.url":JSON.stringify(w.toString())},tsconfigRaw:v(c,e)});return j.set(t,C.code),{format:"module",source:n.inlineSourceMap(C)}}return d}if(!a&&!P&&!c.endsWith(".cts"))return d;const D=!!(a||P||$(m.search,J)),x=h.transformSync(p,ee(c,m),{cjsBanner:D?`require = require("node:module").createRequire(${JSON.stringify(f.pathToFileURL(c).toString())});`:void 0,tsconfigRaw:v(c,e)});if(d.format="commonjs",d.source=n.inlineSourceMap(x),D){const C=te(c,m,a);d.responseURL=`data:text/javascript,${encodeURIComponent(x.code)}?filePath=${encodeURIComponent(C)}`}return n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const g=re(d.source),_=R==="json"&&!Q(s);if(R==="commonjs-typescript"){const p=h.transformSync(g,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",source:n.inlineSourceMap(p)}}if(_||k(R)||n.tsExtensionsPattern.test(t)){const p=await h.transform(g,c,{tsconfigRaw:v(c,e)});return j.set(t,p.code),{format:"module",source:n.inlineSourceMap(p)}}if(d.format==="module"){const p=h.transformDynamicImport(c,g);p?(d.source=n.inlineSourceMap(p),j.set(t,p.code)):j.set(t,g)}return d},"load");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"load",{url:t,context:s});const a=await r(t,s,o);return n.logEsm(1,"loaded",{url:t,result:a}),a}:r},"createLoad"),We=l(e=>{const r=l((t,s,o)=>{if(Q(s)&&n.isGlobalCjsLoaderActive()||!se(e,t))return o(t,s);const a=E(t),{fileUrl:m,filePath:c,loadUrl:i}=B(t),u=ne(i,s),d=o(i,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:i,loaded:d});const P=d.format;if(Z(P)&&y.isFeatureSupported(y.esmLoadReadFile)&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const g=z.readFileSync(f.pathToFileURL(c),"utf8");if(P==="commonjs-typescript"||!c.endsWith(".js")||h.isESM(g)){const _=h.transformSync(g,ee(c,m),{tsconfigRaw:v(c,e)}),p=!a&&n.isGlobalCjsLoaderActive(),b=te(c,m,a);return d.format="commonjs",d.shouldBeReloadedByCJSLoader=p,d.source=n.inlineSourceMap(_),p||(d.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent(b)}`),n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const R=re(d.source),w=P==="json"&&!Q(s);if(P==="commonjs-typescript"){const g=h.transformSync(R,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:n.inlineSourceMap(g)}}if(w||k(P)||n.tsExtensionsPattern.test(t)){const g=h.transformEsmSync(R,c,{tsconfigRaw:v(c,e)});return{format:"module",source:n.inlineSourceMap(g)}}if(d.format==="module"){const g=h.transformDynamicImport(c,R);g&&(d.source=n.inlineSourceMap(g))}return d},"load");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"loadSync",{url:t,context:s});const a=r(t,s,o);return n.logEsm(1,"loadedSync",{url:t,result:a}),a}:r},"createLoadSync"),$e=y.isFeatureSupported(y.esmLoadReadFile),Je=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,oe=l(e=>!n.isFilePath(e)&&!Je.test(e),"isTsconfigPathAliasSpecifier"),M=l(e=>{if(e.url)return e.url;const r=e.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,s]=t;if(!U.isAbsolute(s))return;const o=f.pathToFileURL(s);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const a=h.readJsonFile(o);if(a?.main)return new URL(a.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),O=l(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),ae=l(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),Me=l((e,r)=>{const[t]=e.split("?");try{if(t.startsWith(n.fileUrlPrefix))return f.fileURLToPath(t);if(U.isAbsolute(t))return t;if(n.isRelativePath(t)&&r?.startsWith(n.fileUrlPrefix))return f.fileURLToPath(new URL(t,r))}catch{}},"getProbeFilePath"),ie=l((e,r)=>{const t=Me(e,r);return t!==void 0&&!z.existsSync(t)},"candidateDoesntExist"),q=l(async(e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let a;for(const m of o)if(!ie(m,r.parentURL))try{return await t(m,r)}catch(c){const{code:i}=c;if(!O(i)&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(s){if(a===void 0)return t(o[0],r);throw a}},"resolveExtensions"),I=l((e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let a;for(const m of o)if(!ie(m,r.parentURL))try{return t(m,r)}catch(c){const{code:i}=c;if(!O(i)&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(s){if(a===void 0)return t(o[0],r);throw a}},"resolveExtensionsSync"),Oe=l(async(e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const a=await q(e,r,t);if(n.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:a}),a)return a}try{return await t(e,r)}catch(a){if(n.logEsm(3,"resolveBase error",{specifier:e,context:r,error:a}),a instanceof Error){const m=a;if(O(m.code)){const c=M(m);if(c){const i=await q(c,r,t);if(i)return i}}}throw a}},"resolveBase"),H=l((e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const a=I(e,r,t);if(n.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:a}),a)return a}try{return t(e,r)}catch(a){if(n.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:a}),a instanceof Error){const m=a;if(O(m.code)){const c=M(m);if(c){const i=I(c,r,t);if(i)return i}}}throw a}},"resolveBaseSync"),ce=l(async(e,r,t,s)=>{if(n.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=U.join(o.pathname,"index"),await q(o.toString(),r,t,!0)}try{return await Oe(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(a);if(m)try{return await q(`${m}/index`,r,t,!0)}catch(c){const i=c,{message:u}=i;throw i.message=i.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),i.stack=i.stack.replace(u,i.message),i}}}throw o}},"resolveDirectory"),le=l((e,r,t,s)=>{if(n.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=ae(r);if(o&&!n.isFilePath(e))return H(e,r,t,s);const a=new URL(e,r.parentURL);return a.pathname=U.join(a.pathname,"index"),o?I(f.fileURLToPath(a),r,t,!1)??H(e,r,t,s):I(a.toString(),r,t,!0)}try{return H(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(a);if(m)try{return I(`${m}/index`,r,t,!0)}catch(c){const i=c,{message:u}=i;throw i.message=i.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),i.stack=i.stack.replace(u,i.message),i}}}throw o}},"resolveDirectorySync"),qe=l(async(e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const a=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPaths",{possiblePaths:a});for(const m of a)try{return await ce(f.pathToFileURL(m).toString(),r,t,s)}catch{}}return ce(e,r,t,s)},"resolveTsPaths"),Ne=l((e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const a=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPathsSync",{possiblePaths:a});for(const m of a)try{return le(f.pathToFileURL(m).toString(),r,t,s)}catch{}}return le(e,r,t,s)},"resolveTsPathsSync"),N="tsx://",G=l((e,r)=>`${e}${e.includes("?")?"&":"?"}${r}`,"addQuery"),me=l((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(n.fileUrlPrefix)||!n.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),o=[A(s.search,[S]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(s.pathname+=`%3F${o}`,s.searchParams.set(F,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),Ae=l(e=>{const r=l(async(t,s,o)=>{if(!e.active||t.startsWith("node:"))return o(t,s);let a=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let d;if(t.startsWith(N)){try{d=JSON.parse(t.slice(N.length))}catch{}d?.namespace&&(a=d.namespace)}if(e.namespace!==a)return o(t,s);d&&(t=d.specifier,s.parentURL=d.parentURL)}const[m,c]=t.split("?"),i=await qe(m,s,o,e);if(n.logEsm(2,"nextResolve",{resolved:i}),i.format==="builtin")return i;(!i.format||i.format==="commonjs-typescript"||i.format==="module-typescript")&&i.url.startsWith(n.fileUrlPrefix)&&(i.format=await Ee(i.url),n.logEsm(2,"getFormatFromFileUrl",{resolved:i,format:i.format})),c&&(i.url+=`?${c}`);const u=s.parentURL&&i.format==="commonjs"&&n.implicitTsExtensionsPattern.test(i.url)&&(s.parentURL.includes(K)||we(s.parentURL,t,$e));return a&&!i.url.includes(S)&&(i.url=G(i.url,`${S}${a}`)),u&&(i.url=G(i.url,K)),(a||u)&&(i.url=me(i.url,i.format,a)),i},"resolve");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"resolve",{specifier:t,context:s});const a=await r(t,s,o);return n.logEsm(1,"resolved",{specifier:t,context:s,result:a}),a}:r},"createResolve"),Be=l(e=>{const r=l((t,s,o)=>{if(!e.active||t.startsWith("node:")||ae(s)&&n.isGlobalCjsLoaderActive())return o(t,s);let a=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let u;if(t.startsWith(N)){try{u=JSON.parse(t.slice(N.length))}catch{}u?.namespace&&(a=u.namespace)}if(e.namespace!==a)return o(t,s);u&&(t=u.specifier,s.parentURL=u.parentURL)}const[m,c]=t.split("?"),i=Ne(m,s,o,e);return n.logEsm(2,"nextResolve",{resolved:i}),i.format==="builtin"||((!i.format||i.format==="commonjs-typescript"||i.format==="module-typescript")&&i.url.startsWith(n.fileUrlPrefix)&&(i.format=ve(i.url),n.logEsm(2,"getFormatFromFileUrlSync",{resolved:i,format:i.format})),c&&(i.url+=`?${c}`),a&&!i.url.includes(S)&&(i.url=G(i.url,`${S}${a}`)),i.url=me(i.url,i.format,a)),i},"resolve");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"resolveSync",{specifier:t,context:s});const a=r(t,s,o);return n.logEsm(1,"resolvedSync",{specifier:t,context:s,result:a}),a}:r},"createResolveSync"),de=l(e=>(r,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=t.startsWith(n.fileUrlPrefix)?t:f.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let ue=!1;const Qe=l(e=>{const r=[];for(let t=0;t<e.length;t+=1){const s=e[t];if(s==="--import"){const o=e[t+1];o&&r.push(o),t+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),He=l(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),fe=[new URL("loader.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:T&&T.src||new URL("register-CN6UEFH9.cjs",document.baseURI).href).toString(),new URL("esm/index.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:T&&T.src||new URL("register-CN6UEFH9.cjs",document.baseURI).href).toString()],Ge=new Set(["tsx","tsx/esm",...fe,...fe.map(e=>decodeURI(new URL(e).pathname))]),De=l(e=>Ge.has(e),"isTsxImport"),pe=l(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),xe=l(()=>{const e=Qe(process.execArgv),r=e.findIndex(De);return r>0&&e.slice(0,r).some(pe)},"hasCliTypeScriptPreload"),ze=He().some(pe)||xe(),ge=typeof L.registerHooks=="function"&&y.isFeatureSupported(y.moduleRegisterHooksCjsReload)&&!ze,Xe=l(e=>{if(!L.register&&!ge)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!ue){const{_resolveFilename:c}=L;L._resolveFilename=(i,...u)=>c(n.interopCjsExports(i),...u),ue=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),ge){const c=V({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),i=L.registerHooks({load:We(c),resolve:Be(c)}),u=l(async()=>{c.active=!1,i.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=de(e.namespace),u.unregister=u),u}const{port1:t,port2:s}=new ye.MessageChannel;L.register(`./esm/index.mjs?${Date.now()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:T&&T.src||new URL("register-CN6UEFH9.cjs",document.baseURI).href,data:{port:s,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[s]});const o=e?.onImport,a=o&&(c=>{c.type==="load"&&o(c.url)});a&&(t.on("message",a),t.unref());const m=l(()=>(r===!1&&process.setSourceMapsEnabled(!1),a&&t.off("message",a),t.postMessage("deactivate"),new Promise(c=>{const i=l(u=>{u.type==="deactivated"&&(c(),t.off("message",i))},"onDeactivated");t.on("message",i)})),"unregister");return e?.namespace&&(m.import=de(e.namespace),m.unregister=m),m},"register");exports.createDefaultData=Re,exports.createGlobalPreload=Se,exports.createInitialize=Ue,exports.createLoad=Ce,exports.createResolve=Ae,exports.register=Xe;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var _e=Object.defineProperty;var i=(e,s)=>_e(e,"name",{value:s,configurable:!0});import T from"node:module";import{MessageChannel as $e}from"node:worker_threads";import{i as j,b as be,e as z,m as Je}from"./node-features-B9BBLzwu.mjs";import{l as se,t as re,g as Oe,a as Ne,d as O,b as l,e as V,f as S,h as L,j as D,k as Ae,m as h,n as Me,w as oe,o as ne,p as N,q as ae,s as I,u as Be}from"./register-BLKDwPDF.mjs";import{pathToFileURL as g,fileURLToPath as F}from"node:url";import{readFileSync as qe,existsSync as Qe}from"node:fs";import{readFile as He}from"node:fs/promises";import{p as Ge,i as ce,t as ie,a as A,b as me,c as Xe,r as ze}from"./index-XurvG3JN.mjs";import{p as de}from"./client-D_mPDF5S.mjs";import R from"node:path";const Ve=i(()=>({active:!0,parsedTsconfig:void 0}),"createDefaultData"),le=i(e=>{const s={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(s.parsedTsconfig=se(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),s},"createData"),De=i(e=>async s=>{if(!s)throw new Error(`tsx must be loaded with --import instead of --loader
|
|
2
|
+
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(e,le(s)),s.port&&s.port.on("message",t=>{t==="deactivate"&&(e.active=!1,s.port.postMessage({type:"deactivated"}))})},"createInitialize"),Ke=i(e=>()=>(e.parsedTsconfig=se(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"createGlobalPreload"),Ye=i(e=>{const{pathname:s}=new URL(e),t=R.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||re.includes(t))return Oe(e)},"getFormatFromFileUrl"),Ze=i(e=>{const{pathname:s}=new URL(e),t=R.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||re.includes(t))return Ne(e)},"getFormatFromFileUrlSync"),U="tsx-namespace=",M="tsx-commonjs-export-preparse",ue=`${M}=1`,C="tsx-commonjs-virtual-query",W=new Map,K=i((e,s)=>e.slice(1).split("&").filter(t=>t&&s.every(r=>!t.startsWith(r))).join("&"),"getQueryWithoutParameters"),B=i((e,s)=>{const t=K(e,s);return t?`?${t}`:""},"getSearchWithoutParameters"),ke=i(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),xe=i(e=>{const s=ke(e);if(/^\s*export\s*\*/.test(s))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(s))return"namespace";const t=s.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(r=>{const o=r.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),et=i((e,s,t)=>{const r=W.get(e);if(!r)return!1;try{const[o]=Ge(r);return o.some(n=>{if(n.d!==-1||n.n!==s)return!1;const m=xe(r.slice(n.ss,n.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),v=i(e=>{const s=e.indexOf(U);if(s===-1)return;const t=e[s-1];if(t!=="?"&&t!=="&")return;const r=s+U.length,o=e.indexOf("&",r);return o===-1?e.slice(r):e.slice(r,o)},"getNamespace"),fe=j(be)?"importAttributes":"importAssertions",pe=i(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),he=i(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),tt=j(z),st=[`${C}=`],q=[`${M}=`,`${C}=`],w=i((e,s)=>s.parsedTsconfig&&Ae(s.parsedTsconfig,e)?s.parsedTsconfig.config:void 0,"getTsconfigRaw"),rt=i(e=>{if(!e.searchParams.has(C))return;const{pathname:s}=e,t=s.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const r=new URL(e);return r.pathname=s.slice(0,t),r.search="",F(r)},"getFilePathFromVirtualQuery"),Y=i(e=>{const s=e.startsWith(h)?new URL(e):void 0,t=s?F(s):e,r=s&&rt(s),o=r||t,n=s&&r?g(o).toString()+B(s.search,st):e;return{fileUrl:s,filePath:o,loadUrl:n}},"getFileLoadContext"),ge=i((e,s)=>{if(!s?.search)return e;const t=B(s.search,q);return t?g(e).toString()+t:e},"getTransformPath"),ye=i((e,s,t)=>{const r=[...s?K(s.search,[U,...q]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return r?`${e}?${r}`:e},"getFilePathWithQuery"),ot=new TextDecoder,Pe=i(e=>typeof e=="string"?e:ot.decode(e),"decodeSource"),nt=i((e,s)=>{const t=new URL(s),r=s.startsWith(h)?Y(s).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(M),t.searchParams.delete(C),r&&(t.pathname=new URL(g(r)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),Se=i((e,s)=>{if(!e.active)return!1;const t=v(s);if(e.namespace&&e.namespace!==t)return!1;const r=nt(e,s);return de.send&&de.send({type:"dependency",path:r}),!0},"prepareLoad"),Re=i((e,s)=>{if(!Me.test(e))return s;const t=s[fe];return t?.type?s:{...s,[fe]:{...t,type:"json"}}},"prepareJsonAttributes"),Z=i(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),at=i(e=>{const s=i(async(t,r,o)=>{if(!Se(e,t))return o(t,r);const n=v(t),{fileUrl:m,filePath:c,loadUrl:a}=Y(t),u=Re(a,r),d=await o(a,u);l(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const y=m?.searchParams.has(M)===!0,P=d.format,E=m?new URL(g(c)):void 0;if(E&&m&&(E.search=B(m.search,q)),pe(P)&&m&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await He(g(c),"utf8"),b=ce(f);if(P==="commonjs-typescript"||!c.endsWith(".js")||b){if(!tt){if(y&&b&&V.test(c)){const J=await ie(f,c,{define:{"import.meta.url":JSON.stringify(E.toString())},tsconfigRaw:w(c,e)});return W.set(t,J.code),{format:"module",source:S(J)}}return d}if(!n&&!y&&!c.endsWith(".cts"))return d;const ee=!!(n||y||B(m.search,q)),te=A(f,ge(c,m),{cjsBanner:ee?`require = require("node:module").createRequire(${JSON.stringify(g(c).toString())});`:void 0,tsconfigRaw:w(c,e)});if(d.format="commonjs",d.source=S(te),ee){const J=ye(c,m,n);d.responseURL=`data:text/javascript,${encodeURIComponent(te.code)}?filePath=${encodeURIComponent(J)}`}return l(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const p=Pe(d.source),$=P==="json"&&!Z(r);if(P==="commonjs-typescript"){const f=A(p,c,{tsconfigRaw:w(c,e)});return{...d,format:"commonjs",source:S(f)}}if($||he(P)||L.test(t)){const f=await ie(p,c,{tsconfigRaw:w(c,e)});return W.set(t,f.code),{format:"module",source:S(f)}}if(d.format==="module"){const f=me(c,p);f?(d.source=S(f),W.set(t,f.code)):W.set(t,p)}return d},"load");return O?async(t,r,o)=>{l(2,"load",{url:t,context:r});const n=await s(t,r,o);return l(1,"loaded",{url:t,result:n}),n}:s},"createLoad"),ct=i(e=>{const s=i((t,r,o)=>{if(Z(r)&&D()||!Se(e,t))return o(t,r);const n=v(t),{fileUrl:m,filePath:c,loadUrl:a}=Y(t),u=Re(a,r),d=o(a,u);l(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const y=d.format;if(pe(y)&&j(z)&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=qe(g(c),"utf8");if(y==="commonjs-typescript"||!c.endsWith(".js")||ce(p)){const $=A(p,ge(c,m),{tsconfigRaw:w(c,e)}),f=!n&&D(),b=ye(c,m,n);return d.format="commonjs",d.shouldBeReloadedByCJSLoader=f,d.source=S($),f||(d.responseURL=`data:text/javascript,${encodeURIComponent($.code)}?filePath=${encodeURIComponent(b)}`),l(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const P=Pe(d.source),E=y==="json"&&!Z(r);if(y==="commonjs-typescript"){const p=A(P,c,{tsconfigRaw:w(c,e)});return{...d,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:S(p)}}if(E||he(y)||L.test(t)){const p=Xe(P,c,{tsconfigRaw:w(c,e)});return{format:"module",source:S(p)}}if(d.format==="module"){const p=me(c,P);p&&(d.source=S(p))}return d},"load");return O?(t,r,o)=>{l(2,"loadSync",{url:t,context:r});const n=s(t,r,o);return l(1,"loadedSync",{url:t,result:n}),n}:s},"createLoadSync"),it=j(z),mt=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,Ue=i(e=>!ne(e)&&!mt.test(e),"isTsconfigPathAliasSpecifier"),Q=i(e=>{if(e.url)return e.url;const s=e.message.match(/^Cannot find module '([^']+)'/);if(s){const[,r]=s;return r}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,r]=t;if(!R.isAbsolute(r))return;const o=g(r);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const n=ze(o);if(n?.main)return new URL(n.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),H=i(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),ve=i(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),dt=i((e,s)=>{const[t]=e.split("?");try{if(t.startsWith(h))return F(t);if(R.isAbsolute(t))return t;if(I(t)&&s?.startsWith(h))return F(new URL(t,s))}catch{}},"getProbeFilePath"),we=i((e,s)=>{const t=dt(e,s);return t!==void 0&&!Qe(t)},"candidateDoesntExist"),G=i(async(e,s,t,r)=>{const o=ae(e);if(l(3,"resolveExtensions",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let n;for(const m of o)if(!we(m,s.parentURL))try{return await t(m,s)}catch(c){const{code:a}=c;if(!H(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;n=c}if(r){if(n===void 0)return t(o[0],s);throw n}},"resolveExtensions"),_=i((e,s,t,r)=>{const o=ae(e);if(l(3,"resolveExtensionsSync",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let n;for(const m of o)if(!we(m,s.parentURL))try{return t(m,s)}catch(c){const{code:a}=c;if(!H(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;n=c}if(r){if(n===void 0)return t(o[0],s);throw n}},"resolveExtensionsSync"),lt=i(async(e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(l(3,"resolveBase",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(h),isRelativePath:I(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(h)||I(e))&&(L.test(s.parentURL)||o)){const n=await G(e,s,t);if(l(3,"resolveBase resolved",{specifier:e,context:s,resolved:n}),n)return n}try{return await t(e,s)}catch(n){if(l(3,"resolveBase error",{specifier:e,context:s,error:n}),n instanceof Error){const m=n;if(H(m.code)){const c=Q(m);if(c){const a=await G(c,s,t);if(a)return a}}}throw n}},"resolveBase"),k=i((e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(l(3,"resolveBaseSync",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(h),isRelativePath:I(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(h)||I(e))&&(L.test(s.parentURL)||o)){const n=_(e,s,t);if(l(3,"resolveBaseSync resolved",{specifier:e,context:s,resolved:n}),n)return n}try{return t(e,s)}catch(n){if(l(3,"resolveBaseSync error",{specifier:e,context:s,error:n}),n instanceof Error){const m=n;if(H(m.code)){const c=Q(m);if(c){const a=_(c,s,t);if(a)return a}}}throw n}},"resolveBaseSync"),Te=i(async(e,s,t,r)=>{if(l(3,"resolveDirectory",{specifier:e,context:s,isDirectory:N.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),N.test(e)){const o=new URL(e,s.parentURL);return o.pathname=R.join(o.pathname,"index"),await G(o.toString(),s,t,!0)}try{return await lt(e,s,t,r)}catch(o){if(o instanceof Error){l(3,"resolveDirectory error",{specifier:e,context:s,error:o});const n=o;if(n.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=Q(n);if(m)try{return await G(`${m}/index`,s,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",R.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectory"),Le=i((e,s,t,r)=>{if(l(3,"resolveDirectorySync",{specifier:e,context:s,isDirectory:N.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),N.test(e)){const o=ve(s);if(o&&!ne(e))return k(e,s,t,r);const n=new URL(e,s.parentURL);return n.pathname=R.join(n.pathname,"index"),o?_(F(n),s,t,!1)??k(e,s,t,r):_(n.toString(),s,t,!0)}try{return k(e,s,t,r)}catch(o){if(o instanceof Error){l(3,"resolveDirectorySync error",{specifier:e,context:s,error:o});const n=o;if(n.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=Q(n);if(m)try{return _(`${m}/index`,s,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",R.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectorySync"),ut=i(async(e,s,t,r)=>{const o=Ue(e);if(l(3,"resolveTsPaths",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const n=oe(r.parsedTsconfig,e);l(3,"resolveTsPaths",{possiblePaths:n});for(const m of n)try{return await Te(g(m).toString(),s,t,r)}catch{}}return Te(e,s,t,r)},"resolveTsPaths"),ft=i((e,s,t,r)=>{const o=Ue(e);if(l(3,"resolveTsPathsSync",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const n=oe(r.parsedTsconfig,e);l(3,"resolveTsPathsSync",{possiblePaths:n});for(const m of n)try{return Le(g(m).toString(),s,t,r)}catch{}}return Le(e,s,t,r)},"resolveTsPathsSync"),X="tsx://",x=i((e,s)=>`${e}${e.includes("?")?"&":"?"}${s}`,"addQuery"),Ee=i((e,s,t)=>{if(s!=="commonjs"||!e.startsWith(h)||!V.test(e))return e;const r=new URL(e),o=[K(r.search,[U]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(r.pathname+=`%3F${o}`,r.searchParams.set(C,"1"),r.toString()):e},"preserveCommonJsQueryIdentity"),pt=i(e=>{const s=i(async(t,r,o)=>{if(!e.active||t.startsWith("node:"))return o(t,r);let n=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let d;if(t.startsWith(X)){try{d=JSON.parse(t.slice(X.length))}catch{}d?.namespace&&(n=d.namespace)}if(e.namespace!==n)return o(t,r);d&&(t=d.specifier,r.parentURL=d.parentURL)}const[m,c]=t.split("?"),a=await ut(m,r,o,e);if(l(2,"nextResolve",{resolved:a}),a.format==="builtin")return a;(!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(h)&&(a.format=await Ye(a.url),l(2,"getFormatFromFileUrl",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`);const u=r.parentURL&&a.format==="commonjs"&&V.test(a.url)&&(r.parentURL.includes(ue)||et(r.parentURL,t,it));return n&&!a.url.includes(U)&&(a.url=x(a.url,`${U}${n}`)),u&&(a.url=x(a.url,ue)),(n||u)&&(a.url=Ee(a.url,a.format,n)),a},"resolve");return O?async(t,r,o)=>{l(2,"resolve",{specifier:t,context:r});const n=await s(t,r,o);return l(1,"resolved",{specifier:t,context:r,result:n}),n}:s},"createResolve"),ht=i(e=>{const s=i((t,r,o)=>{if(!e.active||t.startsWith("node:")||ve(r)&&D())return o(t,r);let n=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let u;if(t.startsWith(X)){try{u=JSON.parse(t.slice(X.length))}catch{}u?.namespace&&(n=u.namespace)}if(e.namespace!==n)return o(t,r);u&&(t=u.specifier,r.parentURL=u.parentURL)}const[m,c]=t.split("?"),a=ft(m,r,o,e);return l(2,"nextResolve",{resolved:a}),a.format==="builtin"||((!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(h)&&(a.format=Ze(a.url),l(2,"getFormatFromFileUrlSync",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`),n&&!a.url.includes(U)&&(a.url=x(a.url,`${U}${n}`)),a.url=Ee(a.url,a.format,n)),a},"resolve");return O?(t,r,o)=>{l(2,"resolveSync",{specifier:t,context:r});const n=s(t,r,o);return l(1,"resolvedSync",{specifier:t,context:r,result:n}),n}:s},"createResolveSync"),je=i(e=>(s,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const r=t.startsWith(h)?t:g(t).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:r,namespace:e})}`)},"createScopedImport");let Ie=!1;const gt=i(e=>{const s=[];for(let t=0;t<e.length;t+=1){const r=e[t];if(r==="--import"){const o=e[t+1];o&&s.push(o),t+=1}else r.startsWith("--import=")&&s.push(r.slice(9))}return s},"collectImportSpecifiers"),yt=i(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),Fe=[new URL("loader.mjs",import.meta.url).toString(),new URL("esm/index.mjs",import.meta.url).toString()],Pt=new Set(["tsx","tsx/esm",...Fe,...Fe.map(e=>decodeURI(new URL(e).pathname))]),St=i(e=>Pt.has(e),"isTsxImport"),Ce=i(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),Rt=i(()=>{const e=gt(process.execArgv),s=e.findIndex(St);return s>0&&e.slice(0,s).some(Ce)},"hasCliTypeScriptPreload"),Ut=yt().some(Ce)||Rt(),We=typeof T.registerHooks=="function"&&j(Je)&&!Ut,vt=i(e=>{if(!T.register&&!We)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!Ie){const{_resolveFilename:c}=T;T._resolveFilename=(a,...u)=>c(Be(a),...u),Ie=!0}const{sourceMapsEnabled:s}=process;if(process.setSourceMapsEnabled(!0),We){const c=le({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),a=T.registerHooks({load:ct(c),resolve:ht(c)}),u=i(async()=>{c.active=!1,a.deregister(),s===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=je(e.namespace),u.unregister=u),u}const{port1:t,port2:r}=new $e;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:r,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[r]});const o=e?.onImport,n=o&&(c=>{c.type==="load"&&o(c.url)});n&&(t.on("message",n),t.unref());const m=i(()=>(s===!1&&process.setSourceMapsEnabled(!1),n&&t.off("message",n),t.postMessage("deactivate"),new Promise(c=>{const a=i(u=>{u.type==="deactivated"&&(c(),t.off("message",a))},"onDeactivated");t.on("message",a)})),"unregister");return e?.namespace&&(m.import=je(e.namespace),m.unregister=m),m},"register");export{Ke as a,at as b,De as c,pt as d,Ve as e,vt as r};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var s=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=require("node:repl"),l=require("./package-
|
|
1
|
+
"use strict";var u=Object.defineProperty;var s=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=require("node:repl"),l=require("./package-BqwdNe35.cjs"),q=require("./index-D9F1FXzN.cjs");require("node:path"),require("node:url"),require("esbuild"),require("node:crypto"),require("./node-features-CQLdkVE6.cjs"),require("node:fs"),require("node:os"),require("./temporary-directory-B83uKxJF.cjs"),console.log(`Welcome to tsx v${l.version} (Node.js ${process.version}).
|
|
2
2
|
Type ".help" for more information.`);const i=c.start(),{eval:p}=i,v=s(async function(e,r,o,t){const a=await q.transform(e,o,{loader:"ts",tsconfigRaw:{compilerOptions:{preserveValueImports:!0}},define:{require:"global.require"}}).catch(n=>(console.log(n.message),{code:`
|
|
3
3
|
`}));return p.call(this,a.code,r,o,t)},"preEval");i.eval=v;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var p=Object.defineProperty;var t=(o,r)=>p(o,"name",{value:r,configurable:!0});import a from"node:repl";import{v as l}from"./package-
|
|
1
|
+
var p=Object.defineProperty;var t=(o,r)=>p(o,"name",{value:r,configurable:!0});import a from"node:repl";import{v as l}from"./package-BgaOhdqD.mjs";import{t as c}from"./index-XurvG3JN.mjs";import"node:path";import"node:url";import"esbuild";import"node:crypto";import"./node-features-B9BBLzwu.mjs";import"node:fs";import"node:os";import"./temporary-directory-BDDVQOvU.mjs";console.log(`Welcome to tsx v${l} (Node.js ${process.version}).
|
|
2
2
|
Type ".help" for more information.`);const s=a.start(),{eval:f}=s,v=t(async function(o,r,e,i){const m=await c(o,e,{loader:"ts",tsconfigRaw:{compilerOptions:{preserveValueImports:!0}},define:{require:"global.require"}}).catch(n=>(console.log(n.message),{code:`
|
|
3
3
|
`}));return f.call(this,m.code,r,e,i)},"preEval");s.eval=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var a=(r,t)=>c(r,"name",{value:t,configurable:!0});var s=require("./get-pipe-path-D4YM6rQt.cjs"),n=require("./register-
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(r,t)=>c(r,"name",{value:t,configurable:!0});var s=require("./get-pipe-path-D4YM6rQt.cjs"),n=require("./register-BLUABhh3.cjs");let e;const i=a((r,t)=>(e||(e=n.register({namespace:Date.now().toString()})),e.require(r,t)),"tsxRequire"),o=a((r,t,u)=>(e||(e=n.register({namespace:Date.now().toString()})),e.resolve(r,t,u)),"resolve");o.paths=s.require.resolve.paths,i.resolve=o,i.main=s.require.main,i.extensions=s.require.extensions,i.cache=s.require.cache,exports.tsxRequire=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var m=Object.defineProperty;var a=(r,t)=>m(r,"name",{value:t,configurable:!0});import{r as o}from"./get-pipe-path-_tAJyU_v.mjs";import{r as n}from"./register-
|
|
1
|
+
var m=Object.defineProperty;var a=(r,t)=>m(r,"name",{value:t,configurable:!0});import{r as o}from"./get-pipe-path-_tAJyU_v.mjs";import{r as n}from"./register-BLKDwPDF.mjs";let e;const s=a((r,t)=>(e||(e=n({namespace:Date.now().toString()})),e.require(r,t)),"tsxRequire"),i=a((r,t,c)=>(e||(e=n({namespace:Date.now().toString()})),e.resolve(r,t,c)),"resolve");i.paths=o.resolve.paths,s.resolve=i,s.main=o.main,s.extensions=o.extensions,s.cache=o.cache;export{s as t};
|
|
@@ -558,9 +558,9 @@
|
|
|
558
558
|
}
|
|
559
559
|
},
|
|
560
560
|
"node_modules/tsx": {
|
|
561
|
-
"version": "4.
|
|
562
|
-
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.
|
|
563
|
-
"integrity": "sha512-
|
|
561
|
+
"version": "4.23.0",
|
|
562
|
+
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.0.tgz",
|
|
563
|
+
"integrity": "sha512-eUdUIaCr963q2h5u3+QwvYp0+eqPvn+egeqZUm0hwERCqqx1E3kK5ehbGCvqSE5MQAULr67ww0cA3jKc3YkM1w==",
|
|
564
564
|
"dev": true,
|
|
565
565
|
"license": "MIT",
|
|
566
566
|
"dependencies": {
|
|
@@ -6307,6 +6307,49 @@
|
|
|
6307
6307
|
"x-speakeasy-name-override": "credit_loop"
|
|
6308
6308
|
}
|
|
6309
6309
|
},
|
|
6310
|
+
"/v2/credit/unloop": {
|
|
6311
|
+
"post": {
|
|
6312
|
+
"tags": [
|
|
6313
|
+
"Credit"
|
|
6314
|
+
],
|
|
6315
|
+
"summary": "Unwind a leveraged loop",
|
|
6316
|
+
"description": "Unwind an Aave or Morpho loop in ONE atomic transaction.\n\nRepeatedly withdraws collateral, swaps it to the borrow token at a GUARANTEED\nminimum output (enforced on-chain), and repays. The floor discipline means a\nswap filling anywhere within the slippage tolerance can never break a later\nstep; any positive surplus stays in the Credit Account as borrow-token dust\n(the preview reports the bound as estimated_max_dust).\n\nOmit target_multiplier for a full close: the debt is cleared exactly \u2014\naccrued interest included \u2014 and the pair collateral is returned to the Credit\nAccount. Pass 1 to clear the debt but keep the collateral supplied, or a value\nabove 1 to delever to that multiplier (it must be below the position's current\nmultiplier).\n\nEach withdrawal is sized to keep the position's health factor \u2265 1.02 at that\nstep, so a position opened very close to the liquidation threshold may need\nmore than one transaction to fully close \u2014 set allow_partial=true to return\nthe maximum single-transaction progress (preview.fully_unwound=false), then\ncall unloop again to finish. Very large unwinds relative to pool depth can\nstill exceed the slippage tolerance through their own cumulative price impact.\n\nFor protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect\nopen loops via /v2/credit/looped_positions.",
|
|
6317
|
+
"operationId": "v2_credit_unloop",
|
|
6318
|
+
"requestBody": {
|
|
6319
|
+
"content": {
|
|
6320
|
+
"application/json": {
|
|
6321
|
+
"schema": {
|
|
6322
|
+
"$ref": "#/components/schemas/CreditUnloopRequest"
|
|
6323
|
+
}
|
|
6324
|
+
}
|
|
6325
|
+
},
|
|
6326
|
+
"required": true
|
|
6327
|
+
},
|
|
6328
|
+
"responses": {
|
|
6329
|
+
"200": {
|
|
6330
|
+
"description": "Successful Response",
|
|
6331
|
+
"content": {
|
|
6332
|
+
"application/json": {
|
|
6333
|
+
"schema": {
|
|
6334
|
+
"$ref": "#/components/schemas/CreditUnloopResponse"
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6337
|
+
}
|
|
6338
|
+
},
|
|
6339
|
+
"422": {
|
|
6340
|
+
"description": "Validation Error",
|
|
6341
|
+
"content": {
|
|
6342
|
+
"application/json": {
|
|
6343
|
+
"schema": {
|
|
6344
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
6345
|
+
}
|
|
6346
|
+
}
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
},
|
|
6350
|
+
"x-speakeasy-name-override": "credit_unloop"
|
|
6351
|
+
}
|
|
6352
|
+
},
|
|
6310
6353
|
"/v2/credit/transfer": {
|
|
6311
6354
|
"post": {
|
|
6312
6355
|
"tags": [
|
|
@@ -13708,6 +13751,229 @@
|
|
|
13708
13751
|
"title": "CreditTransferToAddressParams",
|
|
13709
13752
|
"description": "Transfer tokens from Credit Account to an arbitrary address.\n\nRequires all debt positions to be fully repaid (totalDebtBase == 0)\nbefore the transfer is allowed."
|
|
13710
13753
|
},
|
|
13754
|
+
"CreditUnloopPreview": {
|
|
13755
|
+
"properties": {
|
|
13756
|
+
"iterations": {
|
|
13757
|
+
"type": "integer",
|
|
13758
|
+
"title": "Iterations",
|
|
13759
|
+
"description": "Number of swap-bearing unwind iterations bundled (the final collateral sweep leg does not count)."
|
|
13760
|
+
},
|
|
13761
|
+
"total_collateral_withdrawn": {
|
|
13762
|
+
"type": "string",
|
|
13763
|
+
"title": "Total Collateral Withdrawn",
|
|
13764
|
+
"description": "Guaranteed minimum total collateral withdrawn (token units)."
|
|
13765
|
+
},
|
|
13766
|
+
"total_debt_repaid": {
|
|
13767
|
+
"type": "string",
|
|
13768
|
+
"title": "Total Debt Repaid",
|
|
13769
|
+
"description": "Guaranteed minimum total debt repaid (borrow-token units); actual can only be higher (swap fills above the floor repay more)."
|
|
13770
|
+
},
|
|
13771
|
+
"ending_collateral": {
|
|
13772
|
+
"type": "string",
|
|
13773
|
+
"title": "Ending Collateral",
|
|
13774
|
+
"description": "Pair collateral left supplied after the unwind (token units). On a full close this is 0, except when non-pair Aave debt still needs this collateral as backing \u2014 then the final sweep is capped and this reports the residual left supplied."
|
|
13775
|
+
},
|
|
13776
|
+
"ending_debt": {
|
|
13777
|
+
"type": "string",
|
|
13778
|
+
"title": "Ending Debt",
|
|
13779
|
+
"description": "Projected remaining debt (borrow-token units); 0 on a full close."
|
|
13780
|
+
},
|
|
13781
|
+
"ending_multiplier": {
|
|
13782
|
+
"type": "string",
|
|
13783
|
+
"title": "Ending Multiplier",
|
|
13784
|
+
"description": "Projected leverage after the unwind; 1 when the debt is cleared. Never promises more deleverage than is guaranteed."
|
|
13785
|
+
},
|
|
13786
|
+
"projected_ltv": {
|
|
13787
|
+
"type": "string",
|
|
13788
|
+
"title": "Projected Ltv",
|
|
13789
|
+
"description": "Projected end loan-to-value in percent, at the sizing oracle prices; 0 when the debt is cleared."
|
|
13790
|
+
},
|
|
13791
|
+
"projected_health_factor": {
|
|
13792
|
+
"type": "string",
|
|
13793
|
+
"title": "Projected Health Factor",
|
|
13794
|
+
"description": "Projected health factor (Aave account-level / Morpho market-level). Never overstated at the 1.0 boundary."
|
|
13795
|
+
},
|
|
13796
|
+
"estimated_max_dust": {
|
|
13797
|
+
"type": "string",
|
|
13798
|
+
"title": "Estimated Max Dust",
|
|
13799
|
+
"description": "Upper bound of borrow-token surplus the unwind can leave in the Credit Account \u2014 the sum of each swap's quote minus its guaranteed floor plus the full-close overshoot. It accumulates in the Credit Account, is recoverable, and is never lost."
|
|
13800
|
+
},
|
|
13801
|
+
"fully_unwound": {
|
|
13802
|
+
"type": "boolean",
|
|
13803
|
+
"title": "Fully Unwound",
|
|
13804
|
+
"description": "True when the requested target was fully reached in this transaction. False on a partial-progress plan (allow_partial=true) \u2014 call unloop again to finish."
|
|
13805
|
+
},
|
|
13806
|
+
"legs": {
|
|
13807
|
+
"items": {
|
|
13808
|
+
"$ref": "#/components/schemas/UnloopLegPreview"
|
|
13809
|
+
},
|
|
13810
|
+
"type": "array",
|
|
13811
|
+
"title": "Legs",
|
|
13812
|
+
"description": "Per-iteration breakdown.",
|
|
13813
|
+
"example": []
|
|
13814
|
+
}
|
|
13815
|
+
},
|
|
13816
|
+
"additionalProperties": false,
|
|
13817
|
+
"type": "object",
|
|
13818
|
+
"required": [
|
|
13819
|
+
"iterations",
|
|
13820
|
+
"total_collateral_withdrawn",
|
|
13821
|
+
"total_debt_repaid",
|
|
13822
|
+
"ending_collateral",
|
|
13823
|
+
"ending_debt",
|
|
13824
|
+
"ending_multiplier",
|
|
13825
|
+
"projected_ltv",
|
|
13826
|
+
"projected_health_factor",
|
|
13827
|
+
"estimated_max_dust",
|
|
13828
|
+
"fully_unwound"
|
|
13829
|
+
],
|
|
13830
|
+
"title": "CreditUnloopPreview",
|
|
13831
|
+
"description": "Projected end state of the unwind, computed on GUARANTEED swap floors."
|
|
13832
|
+
},
|
|
13833
|
+
"CreditUnloopRequest": {
|
|
13834
|
+
"properties": {
|
|
13835
|
+
"owner": {
|
|
13836
|
+
"type": "string",
|
|
13837
|
+
"title": "Owner",
|
|
13838
|
+
"description": "The address that owns the Credit Account.",
|
|
13839
|
+
"example": "0x0E407CdeBD8e078E6966ef6740540d25F5897082"
|
|
13840
|
+
},
|
|
13841
|
+
"chain": {
|
|
13842
|
+
"$ref": "#/components/schemas/Chain",
|
|
13843
|
+
"description": "Blockchain network.",
|
|
13844
|
+
"example": "ethereum"
|
|
13845
|
+
},
|
|
13846
|
+
"protocol": {
|
|
13847
|
+
"$ref": "#/components/schemas/CreditProtocol",
|
|
13848
|
+
"description": "Lending protocol to unwind: AAVE or MORPHO. EULER unlooping is not available yet.",
|
|
13849
|
+
"example": "AAVE"
|
|
13850
|
+
},
|
|
13851
|
+
"market_id": {
|
|
13852
|
+
"anyOf": [
|
|
13853
|
+
{
|
|
13854
|
+
"type": "string"
|
|
13855
|
+
},
|
|
13856
|
+
{
|
|
13857
|
+
"type": "null"
|
|
13858
|
+
}
|
|
13859
|
+
],
|
|
13860
|
+
"title": "Market Id",
|
|
13861
|
+
"description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
|
|
13862
|
+
},
|
|
13863
|
+
"collateral_token": {
|
|
13864
|
+
"type": "string",
|
|
13865
|
+
"title": "Token",
|
|
13866
|
+
"description": "Token supplied as collateral in the loop being unwound. For MORPHO it must be the market's collateral token.",
|
|
13867
|
+
"example": "WETH"
|
|
13868
|
+
},
|
|
13869
|
+
"borrow_token": {
|
|
13870
|
+
"type": "string",
|
|
13871
|
+
"title": "Token",
|
|
13872
|
+
"description": "Token borrowed in the loop; withdrawn collateral is swapped back to it and used to repay. For MORPHO it must be the market's loan token.",
|
|
13873
|
+
"example": "USDC"
|
|
13874
|
+
},
|
|
13875
|
+
"target_multiplier": {
|
|
13876
|
+
"anyOf": [
|
|
13877
|
+
{
|
|
13878
|
+
"type": "number",
|
|
13879
|
+
"minimum": 1.0
|
|
13880
|
+
},
|
|
13881
|
+
{
|
|
13882
|
+
"type": "string",
|
|
13883
|
+
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
|
|
13884
|
+
},
|
|
13885
|
+
{
|
|
13886
|
+
"type": "null"
|
|
13887
|
+
}
|
|
13888
|
+
],
|
|
13889
|
+
"title": "Target Multiplier",
|
|
13890
|
+
"description": "Target leverage after the unwind. Omit (null) for a FULL unwind: the debt is cleared exactly \u2014 accrued interest included \u2014 and all pair collateral is withdrawn back to the Credit Account. `1` runs the same exact debt close but leaves the collateral supplied (earning). A value greater than 1 delevers the position to that multiplier. Must be below the position's current multiplier."
|
|
13891
|
+
},
|
|
13892
|
+
"max_slippage_percent": {
|
|
13893
|
+
"anyOf": [
|
|
13894
|
+
{
|
|
13895
|
+
"type": "number",
|
|
13896
|
+
"maximum": 10.0,
|
|
13897
|
+
"exclusiveMinimum": 0.0
|
|
13898
|
+
},
|
|
13899
|
+
{
|
|
13900
|
+
"type": "string",
|
|
13901
|
+
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
|
|
13902
|
+
}
|
|
13903
|
+
],
|
|
13904
|
+
"title": "Max Slippage Percent",
|
|
13905
|
+
"description": "Per-swap slippage tolerance in percent. Unwind dust is bounded by this per iteration, so tighter slippage means less dust.",
|
|
13906
|
+
"example": "0.5"
|
|
13907
|
+
},
|
|
13908
|
+
"allow_partial": {
|
|
13909
|
+
"type": "boolean",
|
|
13910
|
+
"title": "Allow Partial",
|
|
13911
|
+
"description": "If the target cannot be reached in one transaction (e.g. a position opened very close to the liquidation threshold), return the maximum-progress plan (preview.fully_unwound=false) instead of a 400. A second unloop call, now from a much lower leverage, finishes the job.",
|
|
13912
|
+
"example": false
|
|
13913
|
+
},
|
|
13914
|
+
"gas_sponsorship": {
|
|
13915
|
+
"type": "boolean",
|
|
13916
|
+
"title": "Gas Sponsorship",
|
|
13917
|
+
"description": "If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction.",
|
|
13918
|
+
"example": false
|
|
13919
|
+
}
|
|
13920
|
+
},
|
|
13921
|
+
"type": "object",
|
|
13922
|
+
"required": [
|
|
13923
|
+
"owner",
|
|
13924
|
+
"chain",
|
|
13925
|
+
"collateral_token",
|
|
13926
|
+
"borrow_token"
|
|
13927
|
+
],
|
|
13928
|
+
"title": "CreditUnloopRequest",
|
|
13929
|
+
"description": "Unwind a leveraged loop: repeatedly withdraw collateral, swap it back to\nthe borrow token at a guaranteed minimum output, and repay \u2014 all in ONE\natomic transaction from the Credit Account.",
|
|
13930
|
+
"example": {
|
|
13931
|
+
"owner": "0x0E407CdeBD8e078E6966ef6740540d25F5897082",
|
|
13932
|
+
"chain": "ethereum",
|
|
13933
|
+
"protocol": "AAVE",
|
|
13934
|
+
"collateral_token": "WETH",
|
|
13935
|
+
"borrow_token": "USDC",
|
|
13936
|
+
"max_slippage_percent": 0.5,
|
|
13937
|
+
"allow_partial": false,
|
|
13938
|
+
"gas_sponsorship": false
|
|
13939
|
+
}
|
|
13940
|
+
},
|
|
13941
|
+
"CreditUnloopResponse": {
|
|
13942
|
+
"properties": {
|
|
13943
|
+
"transaction": {
|
|
13944
|
+
"anyOf": [
|
|
13945
|
+
{
|
|
13946
|
+
"$ref": "#/components/schemas/UnsignedTransaction"
|
|
13947
|
+
},
|
|
13948
|
+
{
|
|
13949
|
+
"type": "null"
|
|
13950
|
+
}
|
|
13951
|
+
],
|
|
13952
|
+
"description": "Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false."
|
|
13953
|
+
},
|
|
13954
|
+
"eip_712": {
|
|
13955
|
+
"anyOf": [
|
|
13956
|
+
{
|
|
13957
|
+
"$ref": "#/components/schemas/BatchedSafeOperationsResponse-Output"
|
|
13958
|
+
},
|
|
13959
|
+
{
|
|
13960
|
+
"type": "null"
|
|
13961
|
+
}
|
|
13962
|
+
],
|
|
13963
|
+
"description": "EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true."
|
|
13964
|
+
},
|
|
13965
|
+
"preview": {
|
|
13966
|
+
"$ref": "#/components/schemas/CreditUnloopPreview",
|
|
13967
|
+
"description": "Projected end state, computed on guaranteed swap floors."
|
|
13968
|
+
}
|
|
13969
|
+
},
|
|
13970
|
+
"type": "object",
|
|
13971
|
+
"required": [
|
|
13972
|
+
"preview"
|
|
13973
|
+
],
|
|
13974
|
+
"title": "CreditUnloopResponse",
|
|
13975
|
+
"description": "The atomic unwind transaction plus its guaranteed-floor preview."
|
|
13976
|
+
},
|
|
13711
13977
|
"CreditUserOperation": {
|
|
13712
13978
|
"properties": {
|
|
13713
13979
|
"body": {
|
|
@@ -26222,6 +26488,59 @@
|
|
|
26222
26488
|
"percentage_for_withdrawal": 1
|
|
26223
26489
|
}
|
|
26224
26490
|
},
|
|
26491
|
+
"UnloopLegPreview": {
|
|
26492
|
+
"properties": {
|
|
26493
|
+
"withdraw_amount": {
|
|
26494
|
+
"anyOf": [
|
|
26495
|
+
{
|
|
26496
|
+
"type": "string"
|
|
26497
|
+
},
|
|
26498
|
+
{
|
|
26499
|
+
"type": "null"
|
|
26500
|
+
}
|
|
26501
|
+
],
|
|
26502
|
+
"title": "Withdraw Amount",
|
|
26503
|
+
"description": "Collateral withdrawn this iteration (token units)."
|
|
26504
|
+
},
|
|
26505
|
+
"min_swap_out": {
|
|
26506
|
+
"anyOf": [
|
|
26507
|
+
{
|
|
26508
|
+
"type": "string"
|
|
26509
|
+
},
|
|
26510
|
+
{
|
|
26511
|
+
"type": "null"
|
|
26512
|
+
}
|
|
26513
|
+
],
|
|
26514
|
+
"title": "Min Swap Out",
|
|
26515
|
+
"description": "Guaranteed swap output (borrow-token units) \u2014 enforced on-chain by the swap's minimum-return. Null on the final collateral sweep leg, which does not swap."
|
|
26516
|
+
},
|
|
26517
|
+
"repay_amount": {
|
|
26518
|
+
"anyOf": [
|
|
26519
|
+
{
|
|
26520
|
+
"type": "string"
|
|
26521
|
+
},
|
|
26522
|
+
{
|
|
26523
|
+
"type": "null"
|
|
26524
|
+
}
|
|
26525
|
+
],
|
|
26526
|
+
"title": "Repay Amount",
|
|
26527
|
+
"description": "Debt repaid this iteration (borrow-token units); null on the final collateral sweep leg."
|
|
26528
|
+
},
|
|
26529
|
+
"full_repay": {
|
|
26530
|
+
"type": "boolean",
|
|
26531
|
+
"title": "Full Repay",
|
|
26532
|
+
"description": "True on the closing leg that clears the remaining debt exactly (Aave clamps to live debt; Morpho repays the remaining shares).",
|
|
26533
|
+
"example": false
|
|
26534
|
+
}
|
|
26535
|
+
},
|
|
26536
|
+
"additionalProperties": false,
|
|
26537
|
+
"type": "object",
|
|
26538
|
+
"required": [
|
|
26539
|
+
"withdraw_amount"
|
|
26540
|
+
],
|
|
26541
|
+
"title": "UnloopLegPreview",
|
|
26542
|
+
"description": "One planned unwind iteration: withdraw [+ swap + repay]."
|
|
26543
|
+
},
|
|
26225
26544
|
"UnsignedMulticallTransaction": {
|
|
26226
26545
|
"properties": {
|
|
26227
26546
|
"chainId": {
|