@medialane/sdk 0.112.0 → 0.113.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.
@@ -1,4 +1,4 @@
1
- import { bb as ResolvedConfig, bj as TxResult, ay as CreatePopCollectionParams, aj as ClaimConditions, au as CreateDropParams, aD as CreateTicketParams, aY as MintTicketsParams, aw as CreateMembershipParams, aX as MintMembershipsParams, aB as CreateSponsorshipOfferParams, b8 as ProposeSponsorshipParams, l as ApiClient, aV as MedialaneConfig, aW as MedialaneErrorCode, b1 as OrderDetails, R as ResolvedFeeConfig, C as ApiIntentCreated } from '../services-BcsFAZzQ.cjs';
1
+ import { bd as ResolvedConfig, bl as TxResult, aA as CreatePopCollectionParams, al as ClaimConditions, aw as CreateDropParams, aF as CreateTicketParams, a_ as MintTicketsParams, ay as CreateMembershipParams, aZ as MintMembershipsParams, aD as CreateSponsorshipOfferParams, ba as ProposeSponsorshipParams, l as ApiClient, aX as MedialaneConfig, aY as MedialaneErrorCode, b3 as OrderDetails, R as ResolvedFeeConfig, D as ApiIntentCreated } from '../services-D971bAZ2.cjs';
2
2
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
3
3
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.cjs';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- import { bb as ResolvedConfig, bj as TxResult, ay as CreatePopCollectionParams, aj as ClaimConditions, au as CreateDropParams, aD as CreateTicketParams, aY as MintTicketsParams, aw as CreateMembershipParams, aX as MintMembershipsParams, aB as CreateSponsorshipOfferParams, b8 as ProposeSponsorshipParams, l as ApiClient, aV as MedialaneConfig, aW as MedialaneErrorCode, b1 as OrderDetails, R as ResolvedFeeConfig, C as ApiIntentCreated } from '../services-BBXTfVDt.js';
1
+ import { bd as ResolvedConfig, bl as TxResult, aA as CreatePopCollectionParams, al as ClaimConditions, aw as CreateDropParams, aF as CreateTicketParams, a_ as MintTicketsParams, ay as CreateMembershipParams, aZ as MintMembershipsParams, aD as CreateSponsorshipOfferParams, ba as ProposeSponsorshipParams, l as ApiClient, aX as MedialaneConfig, aY as MedialaneErrorCode, b3 as OrderDetails, R as ResolvedFeeConfig, D as ApiIntentCreated } from '../services-BezTZ6gM.js';
2
2
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
3
3
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.js';
4
4
  import 'zod';
@@ -314,6 +314,9 @@ var ApiClient = class {
314
314
  bearer(siwsToken) {
315
315
  return { Authorization: `Bearer ${siwsToken}` };
316
316
  }
317
+ asSubject(siwsToken) {
318
+ return siwsToken ? this.bearer(siwsToken) : void 0;
319
+ }
317
320
  getOrders(query = {}) {
318
321
  const params = new URLSearchParams();
319
322
  if (query.status) params.set("status", query.status);
@@ -508,20 +511,49 @@ var ApiClient = class {
508
511
  body: formData
509
512
  });
510
513
  }
511
- getMe() {
512
- return this.get("/v1/portal/me");
514
+ getMe(siwsToken) {
515
+ return this.request("/v1/portal/me", {
516
+ method: "GET",
517
+ headers: this.asSubject(siwsToken)
518
+ });
519
+ }
520
+ getApiKeys(siwsToken) {
521
+ return this.request("/v1/portal/keys", {
522
+ method: "GET",
523
+ headers: this.asSubject(siwsToken)
524
+ });
525
+ }
526
+ createApiKey(input, siwsToken) {
527
+ return this.request("/v1/portal/keys", {
528
+ method: "POST",
529
+ body: JSON.stringify(input ?? {}),
530
+ headers: this.asSubject(siwsToken)
531
+ });
513
532
  }
514
- getApiKeys() {
515
- return this.get("/v1/portal/keys");
533
+ deleteApiKey(id, siwsToken) {
534
+ return this.request(`/v1/portal/keys/${id}`, {
535
+ method: "DELETE",
536
+ headers: this.asSubject(siwsToken)
537
+ });
516
538
  }
517
- createApiKey(label) {
518
- return this.post("/v1/portal/keys", label ? { label } : {});
539
+ getCreditHistory(siwsToken) {
540
+ return this.request("/v1/portal/credits/history", {
541
+ method: "GET",
542
+ headers: this.asSubject(siwsToken)
543
+ });
519
544
  }
520
- deleteApiKey(id) {
521
- return this.del(`/v1/portal/keys/${id}`);
545
+ getSpend(siwsToken) {
546
+ return this.request("/v1/portal/credits/spend", {
547
+ method: "GET",
548
+ headers: this.asSubject(siwsToken)
549
+ });
522
550
  }
523
- getUsage() {
524
- return this.get("/v1/portal/usage");
551
+ checkDeposit(txHash, siwsToken) {
552
+ return this.request("/v1/portal/credits/check", {
553
+ method: "POST",
554
+ body: JSON.stringify({ txHash }),
555
+ headers: this.asSubject(siwsToken)
556
+ });
525
557
  }
526
558
  getWebhooks() {
527
559
  return this.get("/v1/portal/webhooks");