@medialane/sdk 0.126.0 → 0.128.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,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { C as Chain } from './types-CuSlc_YE.cjs';
3
+ import { Call, TypedData } from 'starknet';
3
4
 
4
5
  interface RetryOptions {
5
6
  maxAttempts?: number;
@@ -1056,8 +1057,9 @@ declare class MedialaneApiError extends Error {
1056
1057
  readonly status: number;
1057
1058
  readonly retryAfterMs?: number | undefined;
1058
1059
  readonly details?: unknown | undefined;
1060
+ readonly isAuthored: boolean;
1059
1061
  readonly code: MedialaneErrorCode;
1060
- constructor(status: number, message: string, retryAfterMs?: number | undefined, details?: unknown | undefined);
1062
+ constructor(status: number, message: string, retryAfterMs?: number | undefined, details?: unknown | undefined, isAuthored?: boolean);
1061
1063
  }
1062
1064
  declare class ApiClient {
1063
1065
  private readonly baseUrl;
@@ -1272,6 +1274,57 @@ declare class ApiClient {
1272
1274
  getRewardsBatch(addresses: string[]): Promise<ApiRewardsBatchEntry[]>;
1273
1275
  }
1274
1276
 
1277
+ interface SealedOwner {
1278
+ credentialId: string;
1279
+ ownerPubKey: string;
1280
+ address: string;
1281
+ iv: string;
1282
+ ciphertext: string;
1283
+ }
1284
+ interface OwnerSigner {
1285
+ address: string;
1286
+ signTypedData(typedData: TypedData): Promise<string[]>;
1287
+ }
1288
+ interface ExecutedTransaction {
1289
+ transactionHash: string;
1290
+ }
1291
+ interface WalletExecutor {
1292
+ execute(input: {
1293
+ userAddress: string;
1294
+ privateKeyHex: string;
1295
+ calls: Call[];
1296
+ }): Promise<ExecutedTransaction>;
1297
+ }
1298
+ interface ReceiptProviderLike {
1299
+ getClassHashAt(address: string): Promise<unknown>;
1300
+ }
1301
+
1302
+ declare class PasskeyCancelledError extends Error {
1303
+ constructor(message?: string);
1304
+ }
1305
+ interface PasskeyConfig {
1306
+ appName: string;
1307
+ relyingPartyName: string;
1308
+ relyingPartyId: () => string;
1309
+ prfSalt: Uint8Array<ArrayBuffer>;
1310
+ hkdfInfo: Uint8Array<ArrayBuffer>;
1311
+ passkeyUser: () => Promise<PublicKeyCredentialUserEntity>;
1312
+ knownCredentials: () => PublicKeyCredentialDescriptor[];
1313
+ credentials?: CredentialsContainer;
1314
+ randomBytes?: (length: number) => Uint8Array<ArrayBuffer>;
1315
+ }
1316
+ interface CreatedOwner {
1317
+ sealed: SealedOwner;
1318
+ privateKeyHex: string;
1319
+ }
1320
+ interface PasskeyOwner {
1321
+ createOwnerKey(): Promise<CreatedOwner>;
1322
+ unlockOwnerKey(sealed: SealedOwner): Promise<string>;
1323
+ sealImportedOwnerKey(privateKeyInput: string): Promise<SealedOwner>;
1324
+ walletAddressForPrivateKey(privateKeyInput: string): string;
1325
+ }
1326
+ declare function createPasskeyOwner(config: PasskeyConfig): PasskeyOwner;
1327
+
1275
1328
  interface OfferItem {
1276
1329
  item_type: string;
1277
1330
  token: string;
@@ -1383,4 +1436,8 @@ interface ProposeSponsorshipParams {
1383
1436
  royaltyBps: bigint | string;
1384
1437
  }
1385
1438
 
1386
- export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneConfig as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateListingIntentParams as aA, type CreateMembershipParams as aB, type CreateMintIntentParams as aC, type CreatePopCollectionParams as aD, type CreateRemixOfferParams as aE, type CreateSponsorshipOfferIntentParams as aF, type CreateSponsorshipOfferParams as aG, type CreateSponsorshipProposalIntentParams as aH, type CreateTicketParams as aI, type CreateTierIntentParams as aJ, type CreateWebhookParams as aK, type DropMintStatus as aL, type EmissionParams as aM, type EnforcementDeclaration as aN, type FactoryFamilyServiceId as aO, type FeeConfig as aP, FeeConfigSchema as aQ, type FulfillOrderIntentParams as aR, type IPType as aS, type IntentCall as aT, type IntentStatus as aU, type IntentType as aV, type IpAttribute as aW, type IpNftMetadata as aX, type LaunchCoinIntentParams as aY, type MakeOfferIntentParams as aZ, MedialaneApiError as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiTxSyncResult as ae, type ApiUserRewards as af, type ApiUserWallet as ag, type ApiWalletActivity as ah, type ApiWebhookCreated as ai, type ApiWebhookEndpoint as aj, type AutoRemixOfferParams as ak, type CancelOrderIntentParams as al, type ChainFilter as am, type CheckoutIntentItem as an, type ClaimConditions as ao, type CollectionServiceId as ap, type CollectionSort as aq, type CollectionTokensSort as ar, type ConfirmRemixOfferParams as as, type ConfirmSelfRemixParams as at, type ConsiderationItem as au, type CreateCheckoutIntentParams as av, type CreateCoinIntentParams as aw, type CreateCollectionIntentParams as ax, type CreateCounterOfferIntentParams as ay, type CreateDropParams as az, type AcceptSponsorshipProposalIntentParams as b, type MedialaneErrorCode as b0, type MintMembershipsParams as b1, type MintTicketsParams as b2, OPEN_LICENSES as b3, type OfferItem as b4, type OpenLicense as b5, type Order as b6, type OrderDetails as b7, type OrderParameters as b8, type OrderStatus as b9, type PlaceSponsorshipBidIntentParams as ba, type PopBatchEligibilityItem as bb, type PopClaimStatus as bc, type PopEventType as bd, type ProposeSponsorshipParams as be, type RejectSponsorshipProposalIntentParams as bf, type RemixOfferStatus as bg, type ResolvedConfig as bh, type RetractSponsorshipBidIntentParams as bi, type RetryOptions as bj, type ServiceEventDeclaration as bk, type SetSponsorshipOfferOpenIntentParams as bl, type SortOrder as bm, type TenantPlan as bn, type TierServiceId as bo, type TxResult as bp, type UpdateCollectionProfileInput as bq, type WebhookEventType as br, type WebhookStatus as bs, type WithdrawSponsorshipProposalIntentParams as bt, resolveConfig as bu, resolveFeeConfig as bv, 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 };
1439
+ declare class UserFacingError extends Error {
1440
+ constructor(message: string);
1441
+ }
1442
+
1443
+ export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneConfig as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateListingIntentParams as aA, type CreateMembershipParams as aB, type CreateMintIntentParams as aC, type CreatePopCollectionParams as aD, type CreateRemixOfferParams as aE, type CreateSponsorshipOfferIntentParams as aF, type CreateSponsorshipOfferParams as aG, type CreateSponsorshipProposalIntentParams as aH, type CreateTicketParams as aI, type CreateTierIntentParams as aJ, type CreateWebhookParams as aK, type DropMintStatus as aL, type EmissionParams as aM, type EnforcementDeclaration as aN, type FactoryFamilyServiceId as aO, type FeeConfig as aP, FeeConfigSchema as aQ, type FulfillOrderIntentParams as aR, type IPType as aS, type IntentCall as aT, type IntentStatus as aU, type IntentType as aV, type IpAttribute as aW, type IpNftMetadata as aX, type LaunchCoinIntentParams as aY, type MakeOfferIntentParams as aZ, MedialaneApiError as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiTxSyncResult as ae, type ApiUserRewards as af, type ApiUserWallet as ag, type ApiWalletActivity as ah, type ApiWebhookCreated as ai, type ApiWebhookEndpoint as aj, type AutoRemixOfferParams as ak, type CancelOrderIntentParams as al, type ChainFilter as am, type CheckoutIntentItem as an, type ClaimConditions as ao, type CollectionServiceId as ap, type CollectionSort as aq, type CollectionTokensSort as ar, type ConfirmRemixOfferParams as as, type ConfirmSelfRemixParams as at, type ConsiderationItem as au, type CreateCheckoutIntentParams as av, type CreateCoinIntentParams as aw, type CreateCollectionIntentParams as ax, type CreateCounterOfferIntentParams as ay, type CreateDropParams as az, type AcceptSponsorshipProposalIntentParams as b, type MedialaneErrorCode as b0, type MintMembershipsParams as b1, type MintTicketsParams as b2, OPEN_LICENSES as b3, type OfferItem as b4, type OpenLicense as b5, type Order as b6, type OrderDetails as b7, type OrderParameters as b8, type OrderStatus as b9, type WalletExecutor as bA, type ExecutedTransaction as bB, type PasskeyOwner as bC, type CreatedOwner as bD, type OwnerSigner as bE, type PasskeyConfig as bF, createPasskeyOwner as bG, PasskeyCancelledError as ba, type PlaceSponsorshipBidIntentParams as bb, type PopBatchEligibilityItem as bc, type PopClaimStatus as bd, type PopEventType as be, type ProposeSponsorshipParams as bf, type RejectSponsorshipProposalIntentParams as bg, type RemixOfferStatus as bh, type ResolvedConfig as bi, type RetractSponsorshipBidIntentParams as bj, type RetryOptions as bk, type ServiceEventDeclaration as bl, type SetSponsorshipOfferOpenIntentParams as bm, type SortOrder as bn, type TenantPlan as bo, type TierServiceId as bp, type TxResult as bq, type UpdateCollectionProfileInput as br, UserFacingError as bs, type WebhookEventType as bt, type WebhookStatus as bu, type WithdrawSponsorshipProposalIntentParams as bv, resolveConfig as bw, resolveFeeConfig as bx, type SealedOwner as by, type ReceiptProviderLike as bz, 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 };
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { C as Chain } from './types-CuSlc_YE.js';
3
+ import { Call, TypedData } from 'starknet';
3
4
 
4
5
  interface RetryOptions {
5
6
  maxAttempts?: number;
@@ -1056,8 +1057,9 @@ declare class MedialaneApiError extends Error {
1056
1057
  readonly status: number;
1057
1058
  readonly retryAfterMs?: number | undefined;
1058
1059
  readonly details?: unknown | undefined;
1060
+ readonly isAuthored: boolean;
1059
1061
  readonly code: MedialaneErrorCode;
1060
- constructor(status: number, message: string, retryAfterMs?: number | undefined, details?: unknown | undefined);
1062
+ constructor(status: number, message: string, retryAfterMs?: number | undefined, details?: unknown | undefined, isAuthored?: boolean);
1061
1063
  }
1062
1064
  declare class ApiClient {
1063
1065
  private readonly baseUrl;
@@ -1272,6 +1274,57 @@ declare class ApiClient {
1272
1274
  getRewardsBatch(addresses: string[]): Promise<ApiRewardsBatchEntry[]>;
1273
1275
  }
1274
1276
 
1277
+ interface SealedOwner {
1278
+ credentialId: string;
1279
+ ownerPubKey: string;
1280
+ address: string;
1281
+ iv: string;
1282
+ ciphertext: string;
1283
+ }
1284
+ interface OwnerSigner {
1285
+ address: string;
1286
+ signTypedData(typedData: TypedData): Promise<string[]>;
1287
+ }
1288
+ interface ExecutedTransaction {
1289
+ transactionHash: string;
1290
+ }
1291
+ interface WalletExecutor {
1292
+ execute(input: {
1293
+ userAddress: string;
1294
+ privateKeyHex: string;
1295
+ calls: Call[];
1296
+ }): Promise<ExecutedTransaction>;
1297
+ }
1298
+ interface ReceiptProviderLike {
1299
+ getClassHashAt(address: string): Promise<unknown>;
1300
+ }
1301
+
1302
+ declare class PasskeyCancelledError extends Error {
1303
+ constructor(message?: string);
1304
+ }
1305
+ interface PasskeyConfig {
1306
+ appName: string;
1307
+ relyingPartyName: string;
1308
+ relyingPartyId: () => string;
1309
+ prfSalt: Uint8Array<ArrayBuffer>;
1310
+ hkdfInfo: Uint8Array<ArrayBuffer>;
1311
+ passkeyUser: () => Promise<PublicKeyCredentialUserEntity>;
1312
+ knownCredentials: () => PublicKeyCredentialDescriptor[];
1313
+ credentials?: CredentialsContainer;
1314
+ randomBytes?: (length: number) => Uint8Array<ArrayBuffer>;
1315
+ }
1316
+ interface CreatedOwner {
1317
+ sealed: SealedOwner;
1318
+ privateKeyHex: string;
1319
+ }
1320
+ interface PasskeyOwner {
1321
+ createOwnerKey(): Promise<CreatedOwner>;
1322
+ unlockOwnerKey(sealed: SealedOwner): Promise<string>;
1323
+ sealImportedOwnerKey(privateKeyInput: string): Promise<SealedOwner>;
1324
+ walletAddressForPrivateKey(privateKeyInput: string): string;
1325
+ }
1326
+ declare function createPasskeyOwner(config: PasskeyConfig): PasskeyOwner;
1327
+
1275
1328
  interface OfferItem {
1276
1329
  item_type: string;
1277
1330
  token: string;
@@ -1383,4 +1436,8 @@ interface ProposeSponsorshipParams {
1383
1436
  royaltyBps: bigint | string;
1384
1437
  }
1385
1438
 
1386
- export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneConfig as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateListingIntentParams as aA, type CreateMembershipParams as aB, type CreateMintIntentParams as aC, type CreatePopCollectionParams as aD, type CreateRemixOfferParams as aE, type CreateSponsorshipOfferIntentParams as aF, type CreateSponsorshipOfferParams as aG, type CreateSponsorshipProposalIntentParams as aH, type CreateTicketParams as aI, type CreateTierIntentParams as aJ, type CreateWebhookParams as aK, type DropMintStatus as aL, type EmissionParams as aM, type EnforcementDeclaration as aN, type FactoryFamilyServiceId as aO, type FeeConfig as aP, FeeConfigSchema as aQ, type FulfillOrderIntentParams as aR, type IPType as aS, type IntentCall as aT, type IntentStatus as aU, type IntentType as aV, type IpAttribute as aW, type IpNftMetadata as aX, type LaunchCoinIntentParams as aY, type MakeOfferIntentParams as aZ, MedialaneApiError as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiTxSyncResult as ae, type ApiUserRewards as af, type ApiUserWallet as ag, type ApiWalletActivity as ah, type ApiWebhookCreated as ai, type ApiWebhookEndpoint as aj, type AutoRemixOfferParams as ak, type CancelOrderIntentParams as al, type ChainFilter as am, type CheckoutIntentItem as an, type ClaimConditions as ao, type CollectionServiceId as ap, type CollectionSort as aq, type CollectionTokensSort as ar, type ConfirmRemixOfferParams as as, type ConfirmSelfRemixParams as at, type ConsiderationItem as au, type CreateCheckoutIntentParams as av, type CreateCoinIntentParams as aw, type CreateCollectionIntentParams as ax, type CreateCounterOfferIntentParams as ay, type CreateDropParams as az, type AcceptSponsorshipProposalIntentParams as b, type MedialaneErrorCode as b0, type MintMembershipsParams as b1, type MintTicketsParams as b2, OPEN_LICENSES as b3, type OfferItem as b4, type OpenLicense as b5, type Order as b6, type OrderDetails as b7, type OrderParameters as b8, type OrderStatus as b9, type PlaceSponsorshipBidIntentParams as ba, type PopBatchEligibilityItem as bb, type PopClaimStatus as bc, type PopEventType as bd, type ProposeSponsorshipParams as be, type RejectSponsorshipProposalIntentParams as bf, type RemixOfferStatus as bg, type ResolvedConfig as bh, type RetractSponsorshipBidIntentParams as bi, type RetryOptions as bj, type ServiceEventDeclaration as bk, type SetSponsorshipOfferOpenIntentParams as bl, type SortOrder as bm, type TenantPlan as bn, type TierServiceId as bo, type TxResult as bp, type UpdateCollectionProfileInput as bq, type WebhookEventType as br, type WebhookStatus as bs, type WithdrawSponsorshipProposalIntentParams as bt, resolveConfig as bu, resolveFeeConfig as bv, 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 };
1439
+ declare class UserFacingError extends Error {
1440
+ constructor(message: string);
1441
+ }
1442
+
1443
+ export { type ApiRemixOffersQuery as $, type AcceptSponsorshipBidIntentParams as A, type ApiCreditPayment as B, type ApiEmissionCall as C, type ApiEmissionResult as D, type ApiIntent as E, type ApiIntentCreated as F, type ApiKeyStatus as G, type ApiMeta as H, type ApiMetadataSignedUrl as I, type ApiMetadataUpload as J, type ApiOrder as K, type ApiOrderConsideration as L, type ApiOrderOffer as M, type ApiOrderPrice as N, type ApiOrderTokenMeta as O, type ApiOrderTxHash as P, type ApiOrdersQuery as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPointEvent as T, type ApiPortalKey as U, type ApiPortalKeyCreated as V, type ApiPortalMe as W, type ApiPortalSpend as X, type ApiPublicRemix as Y, type ApiRemixOffer as Z, type ApiRemixOfferPrice as _, type ServiceCapability as a, type MedialaneConfig as a$, type ApiResponse as a0, type ApiRewardsBadge as a1, type ApiRewardsBatchEntry as a2, type ApiRewardsConfig as a3, type ApiRewardsLeaderboardEntry as a4, type ApiRewardsLevel as a5, type ApiSearchCollectionResult as a6, type ApiSearchCreatorResult as a7, type ApiSearchResult as a8, type ApiSearchTokenResult as a9, type CreateListingIntentParams as aA, type CreateMembershipParams as aB, type CreateMintIntentParams as aC, type CreatePopCollectionParams as aD, type CreateRemixOfferParams as aE, type CreateSponsorshipOfferIntentParams as aF, type CreateSponsorshipOfferParams as aG, type CreateSponsorshipProposalIntentParams as aH, type CreateTicketParams as aI, type CreateTierIntentParams as aJ, type CreateWebhookParams as aK, type DropMintStatus as aL, type EmissionParams as aM, type EnforcementDeclaration as aN, type FactoryFamilyServiceId as aO, type FeeConfig as aP, FeeConfigSchema as aQ, type FulfillOrderIntentParams as aR, type IPType as aS, type IntentCall as aT, type IntentStatus as aU, type IntentType as aV, type IpAttribute as aW, type IpNftMetadata as aX, type LaunchCoinIntentParams as aY, type MakeOfferIntentParams as aZ, MedialaneApiError as a_, type ApiSpendByAction as aa, type ApiToken as ab, type ApiTokenBalance as ac, type ApiTokenMetadata as ad, type ApiTxSyncResult as ae, type ApiUserRewards as af, type ApiUserWallet as ag, type ApiWalletActivity as ah, type ApiWebhookCreated as ai, type ApiWebhookEndpoint as aj, type AutoRemixOfferParams as ak, type CancelOrderIntentParams as al, type ChainFilter as am, type CheckoutIntentItem as an, type ClaimConditions as ao, type CollectionServiceId as ap, type CollectionSort as aq, type CollectionTokensSort as ar, type ConfirmRemixOfferParams as as, type ConfirmSelfRemixParams as at, type ConsiderationItem as au, type CreateCheckoutIntentParams as av, type CreateCoinIntentParams as aw, type CreateCollectionIntentParams as ax, type CreateCounterOfferIntentParams as ay, type CreateDropParams as az, type AcceptSponsorshipProposalIntentParams as b, type MedialaneErrorCode as b0, type MintMembershipsParams as b1, type MintTicketsParams as b2, OPEN_LICENSES as b3, type OfferItem as b4, type OpenLicense as b5, type Order as b6, type OrderDetails as b7, type OrderParameters as b8, type OrderStatus as b9, type WalletExecutor as bA, type ExecutedTransaction as bB, type PasskeyOwner as bC, type CreatedOwner as bD, type OwnerSigner as bE, type PasskeyConfig as bF, createPasskeyOwner as bG, PasskeyCancelledError as ba, type PlaceSponsorshipBidIntentParams as bb, type PopBatchEligibilityItem as bc, type PopClaimStatus as bd, type PopEventType as be, type ProposeSponsorshipParams as bf, type RejectSponsorshipProposalIntentParams as bg, type RemixOfferStatus as bh, type ResolvedConfig as bi, type RetractSponsorshipBidIntentParams as bj, type RetryOptions as bk, type ServiceEventDeclaration as bl, type SetSponsorshipOfferOpenIntentParams as bm, type SortOrder as bn, type TenantPlan as bo, type TierServiceId as bp, type TxResult as bq, type UpdateCollectionProfileInput as br, UserFacingError as bs, type WebhookEventType as bt, type WebhookStatus as bu, type WithdrawSponsorshipProposalIntentParams as bv, resolveConfig as bw, resolveFeeConfig as bx, type SealedOwner as by, type ReceiptProviderLike as bz, 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 };
package/dist/index.cjs CHANGED
@@ -275,11 +275,12 @@ function deriveErrorCode(status) {
275
275
  return "UNKNOWN";
276
276
  }
277
277
  var MedialaneApiError = class extends Error {
278
- constructor(status, message, retryAfterMs, details) {
278
+ constructor(status, message, retryAfterMs, details, isAuthored = false) {
279
279
  super(message);
280
280
  this.status = status;
281
281
  this.retryAfterMs = retryAfterMs;
282
282
  this.details = details;
283
+ this.isAuthored = isAuthored;
283
284
  this.name = "MedialaneApiError";
284
285
  this.code = deriveErrorCode(status);
285
286
  }
@@ -318,9 +319,13 @@ var ApiClient = class {
318
319
  const text = await response.text().catch(() => response.statusText);
319
320
  let message = text;
320
321
  let details;
322
+ let isAuthored = false;
321
323
  try {
322
324
  const body = JSON.parse(text);
323
- if (body.error) message = body.error;
325
+ if (typeof body.error === "string" && body.error.trim() !== "") {
326
+ message = body.error;
327
+ isAuthored = true;
328
+ }
324
329
  details = body;
325
330
  } catch {
326
331
  }
@@ -328,7 +333,8 @@ var ApiClient = class {
328
333
  response.status,
329
334
  message,
330
335
  parseRetryAfter(response.headers.get("retry-after")),
331
- details
336
+ details,
337
+ isAuthored
332
338
  );
333
339
  }
334
340
  return response;
@@ -896,9 +902,6 @@ var ApiClient = class {
896
902
  }
897
903
  };
898
904
 
899
- // src/types/api.ts
900
- var OPEN_LICENSES = ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
901
-
902
905
  // src/constants.ts
903
906
  var SN = getCoordinates("STARKNET");
904
907
  var STARKNET_MARKETPLACE_721_CONTRACT = SN.marketplace721;
@@ -971,6 +974,17 @@ var SUPPORTED_TOKENS = [
971
974
  ];
972
975
  var DEFAULT_CURRENCY = "USDC";
973
976
 
977
+ // src/wallet/passkey.ts
978
+ var PasskeyCancelledError = class extends Error {
979
+ constructor(message = "Passkey prompt was cancelled.") {
980
+ super(message);
981
+ this.name = "PasskeyCancelledError";
982
+ }
983
+ };
984
+
985
+ // src/types/api.ts
986
+ var OPEN_LICENSES = ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
987
+
974
988
  // src/routes.ts
975
989
  var SUPPORTED_URL_CHAINS = ["STARKNET"];
976
990
  function chainSlug(chain) {
@@ -2018,6 +2032,14 @@ function resolveSafeImageContentType(contentType) {
2018
2032
  }
2019
2033
  var MAX_IPFS_GATEWAY_RESPONSE_BYTES = 25 * 1024 * 1024;
2020
2034
 
2035
+ // src/errors.ts
2036
+ var UserFacingError = class extends Error {
2037
+ constructor(message) {
2038
+ super(message);
2039
+ this.name = "UserFacingError";
2040
+ }
2041
+ };
2042
+
2021
2043
  exports.ACCOUNT_SESSION_TTL_SECONDS = ACCOUNT_SESSION_TTL_SECONDS;
2022
2044
  exports.ALLOWED_IMAGE_CONTENT_TYPES = ALLOWED_IMAGE_CONTENT_TYPES;
2023
2045
  exports.ApiClient = ApiClient;
@@ -2033,6 +2055,7 @@ exports.MAX_IPFS_GATEWAY_RESPONSE_BYTES = MAX_IPFS_GATEWAY_RESPONSE_BYTES;
2033
2055
  exports.MedialaneApiError = MedialaneApiError;
2034
2056
  exports.OPEN_LICENSES = OPEN_LICENSES;
2035
2057
  exports.POLICY_REFUSAL_CODES = POLICY_REFUSAL_CODES;
2058
+ exports.PasskeyCancelledError = PasskeyCancelledError;
2036
2059
  exports.RESERVED_TRAITS = RESERVED_TRAITS;
2037
2060
  exports.STARKNET_COLLECTION_1155_CLASS_HASH = STARKNET_COLLECTION_1155_CLASS_HASH;
2038
2061
  exports.STARKNET_COLLECTION_1155_CONTRACT = STARKNET_COLLECTION_1155_CONTRACT;
@@ -2072,6 +2095,7 @@ exports.STARKNET_POP_FACTORY_CONTRACT = STARKNET_POP_FACTORY_CONTRACT;
2072
2095
  exports.SUPPORTED_TOKENS = SUPPORTED_TOKENS;
2073
2096
  exports.SUPPORTED_URL_CHAINS = SUPPORTED_URL_CHAINS;
2074
2097
  exports.TRUSTED_APP_IP_HEADER = TRUSTED_APP_IP_HEADER;
2098
+ exports.UserFacingError = UserFacingError;
2075
2099
  exports.assetHref = assetHref;
2076
2100
  exports.buildAssetMetadata = buildAssetMetadata;
2077
2101
  exports.chainFromSlug = chainFromSlug;