@medialane/sdk 0.125.1 → 0.127.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 +21 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +21 -11
- package/dist/index.js.map +1 -1
- package/dist/{services-4Z16tkFa.d.ts → services-9dR1FQF_.d.ts} +55 -2
- package/dist/{services-CkUqZ75g.d.cts → services-CzBHF_gq.d.cts} +55 -2
- package/dist/starknet/index.cjs +10 -9
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +3 -55
- package/dist/starknet/index.d.ts +3 -55
- package/dist/starknet/index.js +10 -9
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,4 @@ 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
|
|
1439
|
+
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 ExecutedTransaction as bA, type PasskeyOwner as bB, type CreatedOwner as bC, type OwnerSigner as bD, type PasskeyConfig as bE, createPasskeyOwner as bF, 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, type WebhookEventType as bs, type WebhookStatus as bt, type WithdrawSponsorshipProposalIntentParams as bu, resolveConfig as bv, resolveFeeConfig as bw, type SealedOwner as bx, type ReceiptProviderLike as by, type WalletExecutor 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.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,4 @@ 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
|
|
1439
|
+
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 ExecutedTransaction as bA, type PasskeyOwner as bB, type CreatedOwner as bC, type OwnerSigner as bD, type PasskeyConfig as bE, createPasskeyOwner as bF, 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, type WebhookEventType as bs, type WebhookStatus as bt, type WithdrawSponsorshipProposalIntentParams as bu, resolveConfig as bv, resolveFeeConfig as bw, type SealedOwner as bx, type ReceiptProviderLike as by, type WalletExecutor 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/starknet/index.cjs
CHANGED
|
@@ -248,11 +248,12 @@ function deriveErrorCode(status) {
|
|
|
248
248
|
return "UNKNOWN";
|
|
249
249
|
}
|
|
250
250
|
var MedialaneApiError = class extends Error {
|
|
251
|
-
constructor(status, message, retryAfterMs, details) {
|
|
251
|
+
constructor(status, message, retryAfterMs, details, isAuthored = false) {
|
|
252
252
|
super(message);
|
|
253
253
|
this.status = status;
|
|
254
254
|
this.retryAfterMs = retryAfterMs;
|
|
255
255
|
this.details = details;
|
|
256
|
+
this.isAuthored = isAuthored;
|
|
256
257
|
this.name = "MedialaneApiError";
|
|
257
258
|
this.code = deriveErrorCode(status);
|
|
258
259
|
}
|
|
@@ -291,9 +292,13 @@ var ApiClient = class {
|
|
|
291
292
|
const text = await response.text().catch(() => response.statusText);
|
|
292
293
|
let message = text;
|
|
293
294
|
let details;
|
|
295
|
+
let isAuthored = false;
|
|
294
296
|
try {
|
|
295
297
|
const body = JSON.parse(text);
|
|
296
|
-
if (body.error
|
|
298
|
+
if (typeof body.error === "string" && body.error.trim() !== "") {
|
|
299
|
+
message = body.error;
|
|
300
|
+
isAuthored = true;
|
|
301
|
+
}
|
|
297
302
|
details = body;
|
|
298
303
|
} catch {
|
|
299
304
|
}
|
|
@@ -301,7 +306,8 @@ var ApiClient = class {
|
|
|
301
306
|
response.status,
|
|
302
307
|
message,
|
|
303
308
|
parseRetryAfter(response.headers.get("retry-after")),
|
|
304
|
-
details
|
|
309
|
+
details,
|
|
310
|
+
isAuthored
|
|
305
311
|
);
|
|
306
312
|
}
|
|
307
313
|
return response;
|
|
@@ -12040,7 +12046,6 @@ async function executeSponsored(config, signer, calls) {
|
|
|
12040
12046
|
const doFetch = config.fetchImpl ?? fetch;
|
|
12041
12047
|
const base = config.proxyUrl.replace(/\/$/, "");
|
|
12042
12048
|
const headers = { "Content-Type": "application/json" };
|
|
12043
|
-
if (config.identityToken) headers.Authorization = `Bearer ${config.identityToken}`;
|
|
12044
12049
|
const buildRes = await doFetch(`${base}/build`, {
|
|
12045
12050
|
method: "POST",
|
|
12046
12051
|
headers,
|
|
@@ -12638,11 +12643,7 @@ function sponsoredExecutor(deps) {
|
|
|
12638
12643
|
async execute(input) {
|
|
12639
12644
|
const { userAddress, privateKeyHex, calls } = input;
|
|
12640
12645
|
const result = await executeSponsored(
|
|
12641
|
-
{
|
|
12642
|
-
proxyUrl: deps.proxyUrl,
|
|
12643
|
-
fetchImpl: deps.fetchImpl,
|
|
12644
|
-
identityToken: deps.identityToken?.() ?? void 0
|
|
12645
|
-
},
|
|
12646
|
+
{ proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
|
|
12646
12647
|
{
|
|
12647
12648
|
address: userAddress,
|
|
12648
12649
|
signTypedData: async (data) => signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
|