@medialane/sdk 0.117.0 → 0.118.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/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/{services-D971bAZ2.d.cts → services-BVGQSIjq.d.cts} +31 -5
- package/dist/{services-BezTZ6gM.d.ts → services-Bb_anNPX.d.ts} +31 -5
- package/dist/starknet/index.cjs +13 -2
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +1 -1
- package/dist/starknet/index.d.ts +1 -1
- package/dist/starknet/index.js +13 -2
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -275,10 +275,11 @@ function deriveErrorCode(status) {
|
|
|
275
275
|
return "UNKNOWN";
|
|
276
276
|
}
|
|
277
277
|
var MedialaneApiError = class extends Error {
|
|
278
|
-
constructor(status, message, retryAfterMs) {
|
|
278
|
+
constructor(status, message, retryAfterMs, details) {
|
|
279
279
|
super(message);
|
|
280
280
|
this.status = status;
|
|
281
281
|
this.retryAfterMs = retryAfterMs;
|
|
282
|
+
this.details = details;
|
|
282
283
|
this.name = "MedialaneApiError";
|
|
283
284
|
this.code = deriveErrorCode(status);
|
|
284
285
|
}
|
|
@@ -316,12 +317,19 @@ var ApiClient = class {
|
|
|
316
317
|
if (!response.ok && !allowed(response.status)) {
|
|
317
318
|
const text = await response.text().catch(() => response.statusText);
|
|
318
319
|
let message = text;
|
|
320
|
+
let details;
|
|
319
321
|
try {
|
|
320
322
|
const body = JSON.parse(text);
|
|
321
323
|
if (body.error) message = body.error;
|
|
324
|
+
details = body;
|
|
322
325
|
} catch {
|
|
323
326
|
}
|
|
324
|
-
throw new MedialaneApiError(
|
|
327
|
+
throw new MedialaneApiError(
|
|
328
|
+
response.status,
|
|
329
|
+
message,
|
|
330
|
+
parseRetryAfter(response.headers.get("retry-after")),
|
|
331
|
+
details
|
|
332
|
+
);
|
|
325
333
|
}
|
|
326
334
|
return response;
|
|
327
335
|
}, this.retryOptions);
|
|
@@ -472,6 +480,9 @@ var ApiClient = class {
|
|
|
472
480
|
createTierIntent(params) {
|
|
473
481
|
return this.post("/v1/intents/create-tier", params);
|
|
474
482
|
}
|
|
483
|
+
mintCalls(params) {
|
|
484
|
+
return this.post("/v1/business/issuance/mint-calls", params);
|
|
485
|
+
}
|
|
475
486
|
createCoinIntent(params) {
|
|
476
487
|
return this.post("/v1/intents/create-coin", params);
|
|
477
488
|
}
|