@medialane/sdk 0.112.0 → 0.114.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 +42 -10
- 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 +42 -10
- package/dist/index.js.map +1 -1
- package/dist/{services-BBXTfVDt.d.ts → services-BezTZ6gM.d.ts} +43 -12
- package/dist/{services-BcsFAZzQ.d.cts → services-D971bAZ2.d.cts} +43 -12
- package/dist/starknet/index.cjs +62 -10
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +6 -2
- package/dist/starknet/index.d.ts +6 -2
- package/dist/starknet/index.js +62 -11
- package/dist/starknet/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -343,6 +343,9 @@ var ApiClient = class {
|
|
|
343
343
|
bearer(siwsToken) {
|
|
344
344
|
return { Authorization: `Bearer ${siwsToken}` };
|
|
345
345
|
}
|
|
346
|
+
asSubject(siwsToken) {
|
|
347
|
+
return siwsToken ? this.bearer(siwsToken) : void 0;
|
|
348
|
+
}
|
|
346
349
|
getOrders(query = {}) {
|
|
347
350
|
const params = new URLSearchParams();
|
|
348
351
|
if (query.status) params.set("status", query.status);
|
|
@@ -537,20 +540,49 @@ var ApiClient = class {
|
|
|
537
540
|
body: formData
|
|
538
541
|
});
|
|
539
542
|
}
|
|
540
|
-
getMe() {
|
|
541
|
-
return this.
|
|
543
|
+
getMe(siwsToken) {
|
|
544
|
+
return this.request("/v1/portal/me", {
|
|
545
|
+
method: "GET",
|
|
546
|
+
headers: this.asSubject(siwsToken)
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
getApiKeys(siwsToken) {
|
|
550
|
+
return this.request("/v1/portal/keys", {
|
|
551
|
+
method: "GET",
|
|
552
|
+
headers: this.asSubject(siwsToken)
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
createApiKey(input, siwsToken) {
|
|
556
|
+
return this.request("/v1/portal/keys", {
|
|
557
|
+
method: "POST",
|
|
558
|
+
body: JSON.stringify(input ?? {}),
|
|
559
|
+
headers: this.asSubject(siwsToken)
|
|
560
|
+
});
|
|
542
561
|
}
|
|
543
|
-
|
|
544
|
-
return this.
|
|
562
|
+
deleteApiKey(id, siwsToken) {
|
|
563
|
+
return this.request(`/v1/portal/keys/${id}`, {
|
|
564
|
+
method: "DELETE",
|
|
565
|
+
headers: this.asSubject(siwsToken)
|
|
566
|
+
});
|
|
545
567
|
}
|
|
546
|
-
|
|
547
|
-
return this.
|
|
568
|
+
getCreditHistory(siwsToken) {
|
|
569
|
+
return this.request("/v1/portal/credits/history", {
|
|
570
|
+
method: "GET",
|
|
571
|
+
headers: this.asSubject(siwsToken)
|
|
572
|
+
});
|
|
548
573
|
}
|
|
549
|
-
|
|
550
|
-
return this.
|
|
574
|
+
getSpend(siwsToken) {
|
|
575
|
+
return this.request("/v1/portal/credits/spend", {
|
|
576
|
+
method: "GET",
|
|
577
|
+
headers: this.asSubject(siwsToken)
|
|
578
|
+
});
|
|
551
579
|
}
|
|
552
|
-
|
|
553
|
-
return this.
|
|
580
|
+
checkDeposit(txHash, siwsToken) {
|
|
581
|
+
return this.request("/v1/portal/credits/check", {
|
|
582
|
+
method: "POST",
|
|
583
|
+
body: JSON.stringify({ txHash }),
|
|
584
|
+
headers: this.asSubject(siwsToken)
|
|
585
|
+
});
|
|
554
586
|
}
|
|
555
587
|
getWebhooks() {
|
|
556
588
|
return this.get("/v1/portal/webhooks");
|