@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.
@@ -762,15 +762,16 @@ interface ApiMetadataUpload {
762
762
  }
763
763
  interface ApiPortalMe {
764
764
  id: string;
765
- name: string;
766
- email: string;
765
+ accountId: string;
767
766
  plan: TenantPlan;
768
767
  status: string;
768
+ creditBalance: number;
769
769
  }
770
770
  interface ApiPortalKey {
771
771
  id: string;
772
772
  prefix: string;
773
- label: string;
773
+ label: string | null;
774
+ appSource: string | null;
774
775
  status: ApiKeyStatus;
775
776
  lastUsedAt: string | null;
776
777
  createdAt: string;
@@ -781,9 +782,31 @@ interface ApiPortalKeyCreated {
781
782
  label: string | null;
782
783
  plaintext: string;
783
784
  }
784
- interface ApiUsageDay {
785
- day: string;
786
- requests: number;
785
+ interface ApiCreditPayment {
786
+ id: string;
787
+ asset: string;
788
+ amountAtomic: string;
789
+ creditedAmount: number;
790
+ mdlnMultiplier: number;
791
+ txHash: string;
792
+ status: string;
793
+ createdAt: string;
794
+ }
795
+ interface ApiSpendByAction {
796
+ actionKey: string;
797
+ credits: number;
798
+ units: number;
799
+ }
800
+ interface ApiPortalSpend {
801
+ recent: Array<{
802
+ actionKey: string;
803
+ credits: number;
804
+ createdAt: string;
805
+ }>;
806
+ byAction: ApiSpendByAction[];
807
+ spent: number;
808
+ credited: number;
809
+ drift: number;
787
810
  }
788
811
  interface ApiWebhookEndpoint {
789
812
  id: string;
@@ -1019,6 +1042,7 @@ declare class ApiClient {
1019
1042
  private patch;
1020
1043
  private del;
1021
1044
  private bearer;
1045
+ private asSubject;
1022
1046
  getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
1023
1047
  getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
1024
1048
  getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
@@ -1069,14 +1093,21 @@ declare class ApiClient {
1069
1093
  uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
1070
1094
  resolveMetadata(uri: string): Promise<ApiResponse<unknown>>;
1071
1095
  uploadFile(file: File): Promise<ApiResponse<ApiMetadataUpload>>;
1072
- getMe(): Promise<ApiResponse<ApiPortalMe>>;
1073
- getApiKeys(): Promise<ApiResponse<ApiPortalKey[]>>;
1074
- createApiKey(label?: string): Promise<ApiResponse<ApiPortalKeyCreated>>;
1075
- deleteApiKey(id: string): Promise<ApiResponse<{
1096
+ getMe(siwsToken?: string): Promise<ApiResponse<ApiPortalMe>>;
1097
+ getApiKeys(siwsToken?: string): Promise<ApiResponse<ApiPortalKey[]>>;
1098
+ createApiKey(input?: {
1099
+ label?: string;
1100
+ appSource?: string;
1101
+ }, siwsToken?: string): Promise<ApiResponse<ApiPortalKeyCreated>>;
1102
+ deleteApiKey(id: string, siwsToken?: string): Promise<ApiResponse<{
1076
1103
  id: string;
1077
1104
  status: string;
1078
1105
  }>>;
1079
- getUsage(): Promise<ApiResponse<ApiUsageDay[]>>;
1106
+ getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
1107
+ getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
1108
+ checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
1109
+ deposits: number;
1110
+ }>>;
1080
1111
  getWebhooks(): Promise<ApiResponse<ApiWebhookEndpoint[]>>;
1081
1112
  createWebhook(params: CreateWebhookParams): Promise<ApiResponse<ApiWebhookCreated>>;
1082
1113
  deleteWebhook(id: string): Promise<ApiResponse<{
@@ -1315,4 +1346,4 @@ interface ProposeSponsorshipParams {
1315
1346
  royaltyBps: bigint | string;
1316
1347
  }
1317
1348
 
1318
- export { type ApiRewardsConfig as $, type AcceptSponsorshipBidIntentParams as A, type ApiIntent as B, type ApiIntentCreated as C, type ApiKeyStatus as D, type ApiMeta as E, type ApiMetadataSignedUrl as F, type ApiMetadataUpload as G, type ApiOrder as H, type ApiOrderConsideration as I, type ApiOrderOffer as J, type ApiOrderPrice as K, type ApiOrderTokenMeta as L, type ApiOrderTxHash as M, type ApiOrdersQuery as N, type ApiPointEvent as O, type ApiPortalKey as P, type ApiPortalKeyCreated as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPortalMe as T, type ApiPublicRemix as U, type ApiRemixOffer as V, type ApiRemixOfferPrice as W, type ApiRemixOffersQuery as X, type ApiResponse as Y, type ApiRewardsBadge as Z, type ApiRewardsBatchEntry as _, type ServiceCapability as a, type OpenLicense as a$, type ApiRewardsLeaderboardEntry as a0, type ApiRewardsLevel as a1, type ApiSearchCollectionResult as a2, type ApiSearchCreatorResult as a3, type ApiSearchResult as a4, type ApiSearchTokenResult as a5, type ApiToken as a6, type ApiTokenBalance as a7, type ApiTokenMetadata as a8, type ApiUsageDay as a9, type CreateSponsorshipOfferIntentParams as aA, type CreateSponsorshipOfferParams as aB, type CreateSponsorshipProposalIntentParams as aC, type CreateTicketParams as aD, type CreateTierIntentParams as aE, type CreateWebhookParams as aF, type DropMintStatus as aG, type EnforcementDeclaration as aH, type FactoryFamilyServiceId as aI, type FeeConfig as aJ, FeeConfigSchema as aK, type FulfillOrderIntentParams as aL, type IPType as aM, type IntentCall as aN, type IntentStatus as aO, type IntentType as aP, type IpAttribute as aQ, type IpNftMetadata as aR, type LaunchCoinIntentParams as aS, type MakeOfferIntentParams as aT, MedialaneApiError as aU, type MedialaneConfig as aV, type MedialaneErrorCode as aW, type MintMembershipsParams as aX, type MintTicketsParams as aY, OPEN_LICENSES as aZ, type OfferItem as a_, type ApiUserRewards as aa, type ApiUserWallet as ab, type ApiWalletActivity as ac, type ApiWebhookCreated as ad, type ApiWebhookEndpoint as ae, type AutoRemixOfferParams as af, type CancelOrderIntentParams as ag, type ChainFilter as ah, type CheckoutIntentItem as ai, type ClaimConditions as aj, type CollectionServiceId as ak, type CollectionSort as al, type CollectionTokensSort as am, type ConfirmRemixOfferParams as an, type ConfirmSelfRemixParams as ao, type ConsiderationItem as ap, type CreateCheckoutIntentParams as aq, type CreateCoinIntentParams as ar, type CreateCollectionIntentParams as as, type CreateCounterOfferIntentParams as at, type CreateDropParams as au, type CreateListingIntentParams as av, type CreateMembershipParams as aw, type CreateMintIntentParams as ax, type CreatePopCollectionParams as ay, type CreateRemixOfferParams as az, type AcceptSponsorshipProposalIntentParams as b, type Order as b0, type OrderDetails as b1, type OrderParameters as b2, type OrderStatus as b3, type PlaceSponsorshipBidIntentParams as b4, type PopBatchEligibilityItem as b5, type PopClaimStatus as b6, type PopEventType as b7, type ProposeSponsorshipParams as b8, type RejectSponsorshipProposalIntentParams as b9, type RemixOfferStatus as ba, type ResolvedConfig as bb, type RetractSponsorshipBidIntentParams as bc, type RetryOptions as bd, type ServiceEventDeclaration as be, type SetSponsorshipOfferOpenIntentParams as bf, type SortOrder as bg, type TenantPlan as bh, type TierServiceId as bi, type TxResult as bj, type UpdateCollectionProfileInput as bk, type WebhookEventType as bl, type WebhookStatus as bm, type WithdrawSponsorshipProposalIntentParams as bn, resolveConfig as bo, resolveFeeConfig as bp, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
1349
+ export { type ApiRewardsBadge as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiIntent as C, type ApiIntentCreated as D, type ApiKeyStatus as E, type ApiMeta as F, type ApiMetadataSignedUrl as G, type ApiMetadataUpload as H, type ApiOrder as I, type ApiOrderConsideration as J, type ApiOrderOffer as K, type ApiOrderPrice as L, type ApiOrderTokenMeta as M, type ApiOrderTxHash as N, type ApiOrdersQuery as O, type ApiPointEvent as P, type ApiPortalKey as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPortalKeyCreated as T, type ApiPortalMe as U, type ApiPortalSpend as V, type ApiPublicRemix as W, type ApiRemixOffer as X, type ApiRemixOfferPrice as Y, type ApiRemixOffersQuery as Z, type ApiResponse as _, type ServiceCapability as a, OPEN_LICENSES as a$, type ApiRewardsBatchEntry as a0, type ApiRewardsConfig as a1, type ApiRewardsLeaderboardEntry as a2, type ApiRewardsLevel as a3, type ApiSearchCollectionResult as a4, type ApiSearchCreatorResult as a5, type ApiSearchResult as a6, type ApiSearchTokenResult as a7, type ApiSpendByAction as a8, type ApiToken as a9, type CreatePopCollectionParams as aA, type CreateRemixOfferParams as aB, type CreateSponsorshipOfferIntentParams as aC, type CreateSponsorshipOfferParams as aD, type CreateSponsorshipProposalIntentParams as aE, type CreateTicketParams as aF, type CreateTierIntentParams as aG, type CreateWebhookParams as aH, type DropMintStatus as aI, type EnforcementDeclaration as aJ, type FactoryFamilyServiceId as aK, type FeeConfig as aL, FeeConfigSchema as aM, type FulfillOrderIntentParams as aN, type IPType as aO, type IntentCall as aP, type IntentStatus as aQ, type IntentType as aR, type IpAttribute as aS, type IpNftMetadata as aT, type LaunchCoinIntentParams as aU, type MakeOfferIntentParams as aV, MedialaneApiError as aW, type MedialaneConfig as aX, type MedialaneErrorCode as aY, type MintMembershipsParams as aZ, type MintTicketsParams as a_, type ApiTokenBalance as aa, type ApiTokenMetadata as ab, type ApiUserRewards as ac, type ApiUserWallet as ad, type ApiWalletActivity as ae, type ApiWebhookCreated as af, type ApiWebhookEndpoint as ag, type AutoRemixOfferParams as ah, type CancelOrderIntentParams as ai, type ChainFilter as aj, type CheckoutIntentItem as ak, type ClaimConditions as al, type CollectionServiceId as am, type CollectionSort as an, type CollectionTokensSort as ao, type ConfirmRemixOfferParams as ap, type ConfirmSelfRemixParams as aq, type ConsiderationItem as ar, type CreateCheckoutIntentParams as as, type CreateCoinIntentParams as at, type CreateCollectionIntentParams as au, type CreateCounterOfferIntentParams as av, type CreateDropParams as aw, type CreateListingIntentParams as ax, type CreateMembershipParams as ay, type CreateMintIntentParams as az, type AcceptSponsorshipProposalIntentParams as b, type OfferItem as b0, type OpenLicense as b1, type Order as b2, type OrderDetails as b3, type OrderParameters as b4, type OrderStatus as b5, type PlaceSponsorshipBidIntentParams as b6, type PopBatchEligibilityItem as b7, type PopClaimStatus as b8, type PopEventType as b9, type ProposeSponsorshipParams as ba, type RejectSponsorshipProposalIntentParams as bb, type RemixOfferStatus as bc, type ResolvedConfig as bd, type RetractSponsorshipBidIntentParams as be, type RetryOptions as bf, type ServiceEventDeclaration as bg, type SetSponsorshipOfferOpenIntentParams as bh, type SortOrder as bi, type TenantPlan as bj, type TierServiceId as bk, type TxResult as bl, type UpdateCollectionProfileInput as bm, type WebhookEventType as bn, type WebhookStatus as bo, type WithdrawSponsorshipProposalIntentParams as bp, resolveConfig as bq, resolveFeeConfig as br, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
@@ -762,15 +762,16 @@ interface ApiMetadataUpload {
762
762
  }
763
763
  interface ApiPortalMe {
764
764
  id: string;
765
- name: string;
766
- email: string;
765
+ accountId: string;
767
766
  plan: TenantPlan;
768
767
  status: string;
768
+ creditBalance: number;
769
769
  }
770
770
  interface ApiPortalKey {
771
771
  id: string;
772
772
  prefix: string;
773
- label: string;
773
+ label: string | null;
774
+ appSource: string | null;
774
775
  status: ApiKeyStatus;
775
776
  lastUsedAt: string | null;
776
777
  createdAt: string;
@@ -781,9 +782,31 @@ interface ApiPortalKeyCreated {
781
782
  label: string | null;
782
783
  plaintext: string;
783
784
  }
784
- interface ApiUsageDay {
785
- day: string;
786
- requests: number;
785
+ interface ApiCreditPayment {
786
+ id: string;
787
+ asset: string;
788
+ amountAtomic: string;
789
+ creditedAmount: number;
790
+ mdlnMultiplier: number;
791
+ txHash: string;
792
+ status: string;
793
+ createdAt: string;
794
+ }
795
+ interface ApiSpendByAction {
796
+ actionKey: string;
797
+ credits: number;
798
+ units: number;
799
+ }
800
+ interface ApiPortalSpend {
801
+ recent: Array<{
802
+ actionKey: string;
803
+ credits: number;
804
+ createdAt: string;
805
+ }>;
806
+ byAction: ApiSpendByAction[];
807
+ spent: number;
808
+ credited: number;
809
+ drift: number;
787
810
  }
788
811
  interface ApiWebhookEndpoint {
789
812
  id: string;
@@ -1019,6 +1042,7 @@ declare class ApiClient {
1019
1042
  private patch;
1020
1043
  private del;
1021
1044
  private bearer;
1045
+ private asSubject;
1022
1046
  getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
1023
1047
  getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
1024
1048
  getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
@@ -1069,14 +1093,21 @@ declare class ApiClient {
1069
1093
  uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
1070
1094
  resolveMetadata(uri: string): Promise<ApiResponse<unknown>>;
1071
1095
  uploadFile(file: File): Promise<ApiResponse<ApiMetadataUpload>>;
1072
- getMe(): Promise<ApiResponse<ApiPortalMe>>;
1073
- getApiKeys(): Promise<ApiResponse<ApiPortalKey[]>>;
1074
- createApiKey(label?: string): Promise<ApiResponse<ApiPortalKeyCreated>>;
1075
- deleteApiKey(id: string): Promise<ApiResponse<{
1096
+ getMe(siwsToken?: string): Promise<ApiResponse<ApiPortalMe>>;
1097
+ getApiKeys(siwsToken?: string): Promise<ApiResponse<ApiPortalKey[]>>;
1098
+ createApiKey(input?: {
1099
+ label?: string;
1100
+ appSource?: string;
1101
+ }, siwsToken?: string): Promise<ApiResponse<ApiPortalKeyCreated>>;
1102
+ deleteApiKey(id: string, siwsToken?: string): Promise<ApiResponse<{
1076
1103
  id: string;
1077
1104
  status: string;
1078
1105
  }>>;
1079
- getUsage(): Promise<ApiResponse<ApiUsageDay[]>>;
1106
+ getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
1107
+ getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
1108
+ checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
1109
+ deposits: number;
1110
+ }>>;
1080
1111
  getWebhooks(): Promise<ApiResponse<ApiWebhookEndpoint[]>>;
1081
1112
  createWebhook(params: CreateWebhookParams): Promise<ApiResponse<ApiWebhookCreated>>;
1082
1113
  deleteWebhook(id: string): Promise<ApiResponse<{
@@ -1315,4 +1346,4 @@ interface ProposeSponsorshipParams {
1315
1346
  royaltyBps: bigint | string;
1316
1347
  }
1317
1348
 
1318
- export { type ApiRewardsConfig as $, type AcceptSponsorshipBidIntentParams as A, type ApiIntent as B, type ApiIntentCreated as C, type ApiKeyStatus as D, type ApiMeta as E, type ApiMetadataSignedUrl as F, type ApiMetadataUpload as G, type ApiOrder as H, type ApiOrderConsideration as I, type ApiOrderOffer as J, type ApiOrderPrice as K, type ApiOrderTokenMeta as L, type ApiOrderTxHash as M, type ApiOrdersQuery as N, type ApiPointEvent as O, type ApiPortalKey as P, type ApiPortalKeyCreated as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPortalMe as T, type ApiPublicRemix as U, type ApiRemixOffer as V, type ApiRemixOfferPrice as W, type ApiRemixOffersQuery as X, type ApiResponse as Y, type ApiRewardsBadge as Z, type ApiRewardsBatchEntry as _, type ServiceCapability as a, type OpenLicense as a$, type ApiRewardsLeaderboardEntry as a0, type ApiRewardsLevel as a1, type ApiSearchCollectionResult as a2, type ApiSearchCreatorResult as a3, type ApiSearchResult as a4, type ApiSearchTokenResult as a5, type ApiToken as a6, type ApiTokenBalance as a7, type ApiTokenMetadata as a8, type ApiUsageDay as a9, type CreateSponsorshipOfferIntentParams as aA, type CreateSponsorshipOfferParams as aB, type CreateSponsorshipProposalIntentParams as aC, type CreateTicketParams as aD, type CreateTierIntentParams as aE, type CreateWebhookParams as aF, type DropMintStatus as aG, type EnforcementDeclaration as aH, type FactoryFamilyServiceId as aI, type FeeConfig as aJ, FeeConfigSchema as aK, type FulfillOrderIntentParams as aL, type IPType as aM, type IntentCall as aN, type IntentStatus as aO, type IntentType as aP, type IpAttribute as aQ, type IpNftMetadata as aR, type LaunchCoinIntentParams as aS, type MakeOfferIntentParams as aT, MedialaneApiError as aU, type MedialaneConfig as aV, type MedialaneErrorCode as aW, type MintMembershipsParams as aX, type MintTicketsParams as aY, OPEN_LICENSES as aZ, type OfferItem as a_, type ApiUserRewards as aa, type ApiUserWallet as ab, type ApiWalletActivity as ac, type ApiWebhookCreated as ad, type ApiWebhookEndpoint as ae, type AutoRemixOfferParams as af, type CancelOrderIntentParams as ag, type ChainFilter as ah, type CheckoutIntentItem as ai, type ClaimConditions as aj, type CollectionServiceId as ak, type CollectionSort as al, type CollectionTokensSort as am, type ConfirmRemixOfferParams as an, type ConfirmSelfRemixParams as ao, type ConsiderationItem as ap, type CreateCheckoutIntentParams as aq, type CreateCoinIntentParams as ar, type CreateCollectionIntentParams as as, type CreateCounterOfferIntentParams as at, type CreateDropParams as au, type CreateListingIntentParams as av, type CreateMembershipParams as aw, type CreateMintIntentParams as ax, type CreatePopCollectionParams as ay, type CreateRemixOfferParams as az, type AcceptSponsorshipProposalIntentParams as b, type Order as b0, type OrderDetails as b1, type OrderParameters as b2, type OrderStatus as b3, type PlaceSponsorshipBidIntentParams as b4, type PopBatchEligibilityItem as b5, type PopClaimStatus as b6, type PopEventType as b7, type ProposeSponsorshipParams as b8, type RejectSponsorshipProposalIntentParams as b9, type RemixOfferStatus as ba, type ResolvedConfig as bb, type RetractSponsorshipBidIntentParams as bc, type RetryOptions as bd, type ServiceEventDeclaration as be, type SetSponsorshipOfferOpenIntentParams as bf, type SortOrder as bg, type TenantPlan as bh, type TierServiceId as bi, type TxResult as bj, type UpdateCollectionProfileInput as bk, type WebhookEventType as bl, type WebhookStatus as bm, type WithdrawSponsorshipProposalIntentParams as bn, resolveConfig as bo, resolveFeeConfig as bp, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
1349
+ export { type ApiRewardsBadge as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiIntent as C, type ApiIntentCreated as D, type ApiKeyStatus as E, type ApiMeta as F, type ApiMetadataSignedUrl as G, type ApiMetadataUpload as H, type ApiOrder as I, type ApiOrderConsideration as J, type ApiOrderOffer as K, type ApiOrderPrice as L, type ApiOrderTokenMeta as M, type ApiOrderTxHash as N, type ApiOrdersQuery as O, type ApiPointEvent as P, type ApiPortalKey as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPortalKeyCreated as T, type ApiPortalMe as U, type ApiPortalSpend as V, type ApiPublicRemix as W, type ApiRemixOffer as X, type ApiRemixOfferPrice as Y, type ApiRemixOffersQuery as Z, type ApiResponse as _, type ServiceCapability as a, OPEN_LICENSES as a$, type ApiRewardsBatchEntry as a0, type ApiRewardsConfig as a1, type ApiRewardsLeaderboardEntry as a2, type ApiRewardsLevel as a3, type ApiSearchCollectionResult as a4, type ApiSearchCreatorResult as a5, type ApiSearchResult as a6, type ApiSearchTokenResult as a7, type ApiSpendByAction as a8, type ApiToken as a9, type CreatePopCollectionParams as aA, type CreateRemixOfferParams as aB, type CreateSponsorshipOfferIntentParams as aC, type CreateSponsorshipOfferParams as aD, type CreateSponsorshipProposalIntentParams as aE, type CreateTicketParams as aF, type CreateTierIntentParams as aG, type CreateWebhookParams as aH, type DropMintStatus as aI, type EnforcementDeclaration as aJ, type FactoryFamilyServiceId as aK, type FeeConfig as aL, FeeConfigSchema as aM, type FulfillOrderIntentParams as aN, type IPType as aO, type IntentCall as aP, type IntentStatus as aQ, type IntentType as aR, type IpAttribute as aS, type IpNftMetadata as aT, type LaunchCoinIntentParams as aU, type MakeOfferIntentParams as aV, MedialaneApiError as aW, type MedialaneConfig as aX, type MedialaneErrorCode as aY, type MintMembershipsParams as aZ, type MintTicketsParams as a_, type ApiTokenBalance as aa, type ApiTokenMetadata as ab, type ApiUserRewards as ac, type ApiUserWallet as ad, type ApiWalletActivity as ae, type ApiWebhookCreated as af, type ApiWebhookEndpoint as ag, type AutoRemixOfferParams as ah, type CancelOrderIntentParams as ai, type ChainFilter as aj, type CheckoutIntentItem as ak, type ClaimConditions as al, type CollectionServiceId as am, type CollectionSort as an, type CollectionTokensSort as ao, type ConfirmRemixOfferParams as ap, type ConfirmSelfRemixParams as aq, type ConsiderationItem as ar, type CreateCheckoutIntentParams as as, type CreateCoinIntentParams as at, type CreateCollectionIntentParams as au, type CreateCounterOfferIntentParams as av, type CreateDropParams as aw, type CreateListingIntentParams as ax, type CreateMembershipParams as ay, type CreateMintIntentParams as az, type AcceptSponsorshipProposalIntentParams as b, type OfferItem as b0, type OpenLicense as b1, type Order as b2, type OrderDetails as b3, type OrderParameters as b4, type OrderStatus as b5, type PlaceSponsorshipBidIntentParams as b6, type PopBatchEligibilityItem as b7, type PopClaimStatus as b8, type PopEventType as b9, type ProposeSponsorshipParams as ba, type RejectSponsorshipProposalIntentParams as bb, type RemixOfferStatus as bc, type ResolvedConfig as bd, type RetractSponsorshipBidIntentParams as be, type RetryOptions as bf, type ServiceEventDeclaration as bg, type SetSponsorshipOfferOpenIntentParams as bh, type SortOrder as bi, type TenantPlan as bj, type TierServiceId as bk, type TxResult as bl, type UpdateCollectionProfileInput as bm, type WebhookEventType as bn, type WebhookStatus as bo, type WithdrawSponsorshipProposalIntentParams as bp, resolveConfig as bq, resolveFeeConfig as br, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinClaimResult as n, type ApiCoinPrice as o, type ApiCoinPrices as p, type ApiCoinsQuery as q, type ApiCollection as r, type ApiCollectionClaim as s, type ApiCollectionProfile as t, type ApiCollectionSlugClaim as u, type ApiCollectionsQuery as v, type ApiComment as w, type ApiCounterOffersQuery as x, type ApiCreatorListResult as y, type ApiCreatorProfile as z };
@@ -316,6 +316,9 @@ var ApiClient = class {
316
316
  bearer(siwsToken) {
317
317
  return { Authorization: `Bearer ${siwsToken}` };
318
318
  }
319
+ asSubject(siwsToken) {
320
+ return siwsToken ? this.bearer(siwsToken) : void 0;
321
+ }
319
322
  getOrders(query = {}) {
320
323
  const params = new URLSearchParams();
321
324
  if (query.status) params.set("status", query.status);
@@ -510,20 +513,49 @@ var ApiClient = class {
510
513
  body: formData
511
514
  });
512
515
  }
513
- getMe() {
514
- return this.get("/v1/portal/me");
516
+ getMe(siwsToken) {
517
+ return this.request("/v1/portal/me", {
518
+ method: "GET",
519
+ headers: this.asSubject(siwsToken)
520
+ });
515
521
  }
516
- getApiKeys() {
517
- return this.get("/v1/portal/keys");
522
+ getApiKeys(siwsToken) {
523
+ return this.request("/v1/portal/keys", {
524
+ method: "GET",
525
+ headers: this.asSubject(siwsToken)
526
+ });
518
527
  }
519
- createApiKey(label) {
520
- return this.post("/v1/portal/keys", label ? { label } : {});
528
+ createApiKey(input, siwsToken) {
529
+ return this.request("/v1/portal/keys", {
530
+ method: "POST",
531
+ body: JSON.stringify(input ?? {}),
532
+ headers: this.asSubject(siwsToken)
533
+ });
534
+ }
535
+ deleteApiKey(id, siwsToken) {
536
+ return this.request(`/v1/portal/keys/${id}`, {
537
+ method: "DELETE",
538
+ headers: this.asSubject(siwsToken)
539
+ });
540
+ }
541
+ getCreditHistory(siwsToken) {
542
+ return this.request("/v1/portal/credits/history", {
543
+ method: "GET",
544
+ headers: this.asSubject(siwsToken)
545
+ });
521
546
  }
522
- deleteApiKey(id) {
523
- return this.del(`/v1/portal/keys/${id}`);
547
+ getSpend(siwsToken) {
548
+ return this.request("/v1/portal/credits/spend", {
549
+ method: "GET",
550
+ headers: this.asSubject(siwsToken)
551
+ });
524
552
  }
525
- getUsage() {
526
- return this.get("/v1/portal/usage");
553
+ checkDeposit(txHash, siwsToken) {
554
+ return this.request("/v1/portal/credits/check", {
555
+ method: "POST",
556
+ body: JSON.stringify({ txHash }),
557
+ headers: this.asSubject(siwsToken)
558
+ });
527
559
  }
528
560
  getWebhooks() {
529
561
  return this.get("/v1/portal/webhooks");
@@ -11880,6 +11912,25 @@ async function deriveAesKey(prfSecret, hkdfInfo) {
11880
11912
  ["encrypt", "decrypt"]
11881
11913
  );
11882
11914
  }
11915
+ var STARK_KEY_INFO = new TextEncoder().encode("medialane/passkey/stark-key/v1");
11916
+ var DERIVE_BITS = 384;
11917
+ function bytesToBigInt(bytes) {
11918
+ let value = 0n;
11919
+ for (const byte of bytes) value = value << 8n | BigInt(byte);
11920
+ return value;
11921
+ }
11922
+ async function deriveStarkKeyPair(prfSecret) {
11923
+ const hkdf = await crypto.subtle.importKey("raw", prfSecret, "HKDF", false, ["deriveBits"]);
11924
+ const bits = await crypto.subtle.deriveBits(
11925
+ { name: "HKDF", hash: "SHA-256", salt: new Uint8Array(0), info: STARK_KEY_INFO },
11926
+ hkdf,
11927
+ DERIVE_BITS
11928
+ );
11929
+ const order = starknet.ec.starkCurve.CURVE.n;
11930
+ const value = bytesToBigInt(new Uint8Array(bits)) % (order - 1n) + 1n;
11931
+ const privateKeyHex = "0x" + value.toString(16).padStart(64, "0");
11932
+ return { privateKeyHex, publicKeyHex: starknet.ec.starkCurve.getStarkKey(privateKeyHex) };
11933
+ }
11883
11934
  function generateStarkKeyPair() {
11884
11935
  const privateKeyHex = "0x" + Array.from(starknet.ec.starkCurve.utils.randomPrivateKey()).map((b) => b.toString(16).padStart(2, "0")).join("");
11885
11936
  return { privateKeyHex, publicKeyHex: starknet.ec.starkCurve.getStarkKey(privateKeyHex) };
@@ -11984,6 +12035,7 @@ exports.decodeEscapeAndStatus = decodeEscapeAndStatus;
11984
12035
  exports.decodeGuardiansInfo = decodeGuardiansInfo;
11985
12036
  exports.deriveAesKey = deriveAesKey;
11986
12037
  exports.deriveOwnerKeyPair = deriveOwnerKeyPair;
12038
+ exports.deriveStarkKeyPair = deriveStarkKeyPair;
11987
12039
  exports.encodeAdminHeaders = encodeAdminHeaders;
11988
12040
  exports.encodeByteArray = encodeByteArray;
11989
12041
  exports.executeIntent = executeIntent;