@routstr/sdk 0.1.3 → 0.1.4
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/client/index.js +3 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +3 -0
- package/dist/client/index.mjs.map +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2737,12 +2737,14 @@ var RoutstrClient = class {
|
|
|
2737
2737
|
try {
|
|
2738
2738
|
const url = `${baseUrl.replace(/\/$/, "")}${path}`;
|
|
2739
2739
|
if (this.mode === "xcashu") this._log("DEBUG", "HEADERS,", headers);
|
|
2740
|
+
this._log("DEBUG", "HEADERS,", headers);
|
|
2740
2741
|
const response = await fetch(url, {
|
|
2741
2742
|
method,
|
|
2742
2743
|
headers,
|
|
2743
2744
|
body: body === void 0 || method === "GET" ? void 0 : JSON.stringify(body)
|
|
2744
2745
|
});
|
|
2745
2746
|
if (this.mode === "xcashu") this._log("DEBUG", "response,", response);
|
|
2747
|
+
this._log("DEBUG", "response,", response);
|
|
2746
2748
|
response.baseUrl = baseUrl;
|
|
2747
2749
|
response.token = token;
|
|
2748
2750
|
if (!response.ok) {
|
|
@@ -2849,6 +2851,7 @@ var RoutstrClient = class {
|
|
|
2849
2851
|
}
|
|
2850
2852
|
}
|
|
2851
2853
|
if ((status === 402 || status === 413 && responseBody?.includes("Insufficient balance")) && !tryNextProvider && (this.mode === "apikeys" || this.mode === "lazyrefund")) {
|
|
2854
|
+
console.log("RESPONSFE ", responseBody);
|
|
2852
2855
|
const topupResult = await this.balanceManager.topUp({
|
|
2853
2856
|
mintUrl,
|
|
2854
2857
|
baseUrl,
|
|
@@ -4213,7 +4216,8 @@ async function routeRequests(options) {
|
|
|
4213
4216
|
includeProviderUrls = [],
|
|
4214
4217
|
torMode = false,
|
|
4215
4218
|
forceRefresh = false,
|
|
4216
|
-
modelManager: providedModelManager
|
|
4219
|
+
modelManager: providedModelManager,
|
|
4220
|
+
debugLevel
|
|
4217
4221
|
} = options;
|
|
4218
4222
|
let modelManager;
|
|
4219
4223
|
let providers;
|
|
@@ -4280,6 +4284,9 @@ async function routeRequests(options) {
|
|
|
4280
4284
|
alertLevel,
|
|
4281
4285
|
"apikeys"
|
|
4282
4286
|
);
|
|
4287
|
+
if (debugLevel) {
|
|
4288
|
+
client.setDebugLevel(debugLevel);
|
|
4289
|
+
}
|
|
4283
4290
|
const maxTokens = extractMaxTokens(requestBody);
|
|
4284
4291
|
const stream = extractStream(requestBody);
|
|
4285
4292
|
let response = null;
|