@medialane/sdk 0.151.0 → 0.153.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,7 +1,7 @@
1
- import { bG as ResolvedConfig, bO as TxResult, a$ as CreatePopCollectionParams, aM as ClaimConditions, aX as CreateDropParams, b4 as CreateTicketParams, bq as MintTicketsParams, aZ as CreateMembershipParams, bp as MintMembershipsParams, b2 as CreateSponsorshipOfferParams, bD as ProposeSponsorshipParams, k as ApiClient, bn as MedialaneConfig, bo as MedialaneErrorCode, bv as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bW as SealedOwner, bX as ReceiptProviderLike, bY as WalletExecutor, bZ as ExecutedTransaction, b_ as PasskeyOwner, b$ as CreatedOwner } from '../errors-DY8a9DV-.cjs';
2
- export { c0 as InvalidRecoveryKeyError, c1 as OwnerSigner, by as PasskeyCancelledError, c2 as PasskeyConfig, c3 as RecoveryKey, bQ as UserFacingError, c4 as createPasskeyOwner, c5 as encodeRecoveryKey, c6 as parseRecoveryKey } from '../errors-DY8a9DV-.cjs';
1
+ import { bG as ResolvedConfig, bO as TxResult, a$ as CreatePopCollectionParams, aM as ClaimConditions, aX as CreateDropParams, b4 as CreateTicketParams, bq as MintTicketsParams, aZ as CreateMembershipParams, bp as MintMembershipsParams, b2 as CreateSponsorshipOfferParams, bD as ProposeSponsorshipParams, k as ApiClient, bn as MedialaneConfig, bo as MedialaneErrorCode, bv as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bW as SealedOwner, bX as ReceiptProviderLike, bY as WalletExecutor, bZ as ExecutedTransaction, b_ as PasskeyOwner, b$ as CreatedOwner } from '../errors-DQRDzDiT.cjs';
2
+ export { c0 as InvalidRecoveryKeyError, c1 as OwnerSigner, by as PasskeyCancelledError, c2 as PasskeyConfig, c3 as RecoveryKey, bQ as UserFacingError, c4 as createPasskeyOwner, c5 as encodeRecoveryKey, c6 as parseRecoveryKey } from '../errors-DQRDzDiT.cjs';
3
3
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
- import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.cjs';
4
+ import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CO6YYHVA.cjs';
5
5
  import 'zod';
6
6
 
7
7
  declare class PopService {
@@ -1,7 +1,7 @@
1
- import { bG as ResolvedConfig, bO as TxResult, a$ as CreatePopCollectionParams, aM as ClaimConditions, aX as CreateDropParams, b4 as CreateTicketParams, bq as MintTicketsParams, aZ as CreateMembershipParams, bp as MintMembershipsParams, b2 as CreateSponsorshipOfferParams, bD as ProposeSponsorshipParams, k as ApiClient, bn as MedialaneConfig, bo as MedialaneErrorCode, bv as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bW as SealedOwner, bX as ReceiptProviderLike, bY as WalletExecutor, bZ as ExecutedTransaction, b_ as PasskeyOwner, b$ as CreatedOwner } from '../errors-B315qikS.js';
2
- export { c0 as InvalidRecoveryKeyError, c1 as OwnerSigner, by as PasskeyCancelledError, c2 as PasskeyConfig, c3 as RecoveryKey, bQ as UserFacingError, c4 as createPasskeyOwner, c5 as encodeRecoveryKey, c6 as parseRecoveryKey } from '../errors-B315qikS.js';
1
+ import { bG as ResolvedConfig, bO as TxResult, a$ as CreatePopCollectionParams, aM as ClaimConditions, aX as CreateDropParams, b4 as CreateTicketParams, bq as MintTicketsParams, aZ as CreateMembershipParams, bp as MintMembershipsParams, b2 as CreateSponsorshipOfferParams, bD as ProposeSponsorshipParams, k as ApiClient, bn as MedialaneConfig, bo as MedialaneErrorCode, bv as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, bW as SealedOwner, bX as ReceiptProviderLike, bY as WalletExecutor, bZ as ExecutedTransaction, b_ as PasskeyOwner, b$ as CreatedOwner } from '../errors-dgfLd7nS.js';
2
+ export { c0 as InvalidRecoveryKeyError, c1 as OwnerSigner, by as PasskeyCancelledError, c2 as PasskeyConfig, c3 as RecoveryKey, bQ as UserFacingError, c4 as createPasskeyOwner, c5 as encodeRecoveryKey, c6 as parseRecoveryKey } from '../errors-dgfLd7nS.js';
3
3
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
- import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.js';
4
+ import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CO6YYHVA.js';
5
5
  import 'zod';
6
6
 
7
7
  declare class PopService {
@@ -51,9 +51,7 @@ var COORDINATES = {
51
51
  ipSponsorshipClassHash: "0x0626daac2ed7e2bf630ef5b10104b3202db1559216c0c1a504c0e99be2fbfec3",
52
52
  ipSponsorshipStartBlock: 11896456,
53
53
  mediaWalletClassHash: "0x014b210c7d47392691144bafecdca3c6c7791cc295ea305988da0a724c05ac31",
54
- genesisMintLaunch: "0x06ed61abba98a44d45bed2c4b1a456df15053c3321cfd6e007afb33b7226c9f0",
55
- genesisMintBR: "0x01f8b92e3b9e963b8eacb075207e2cc89d4614ff2ac6c2702c7ae10ad19a9db8",
56
- genesisMintGlobal: "0x06ad4d55ed2d12ad5d6d55587d800874ef807b051bfefe13497e60ec5b019369"
54
+ genesisMint: "0x06ed61abba98a44d45bed2c4b1a456df15053c3321cfd6e007afb33b7226c9f0"
57
55
  }
58
56
  };
59
57
  function getCoordinates(chain) {
@@ -92,6 +90,7 @@ var MedialaneConfigSchema = z.object({
92
90
  rpcUrl: z.string().url().optional(),
93
91
  backendUrl: z.string().url().optional(),
94
92
  apiKey: z.string().optional(),
93
+ appSource: z.string().regex(/^[A-Z][A-Z0-9_]*$/).optional(),
95
94
  marketplace721Contract: z.string().optional(),
96
95
  marketplaceContract: z.string().optional(),
97
96
  marketplace1155Contract: z.string().optional(),
@@ -116,6 +115,7 @@ function resolveConfig(raw) {
116
115
  rpcUrl: parsed.rpcUrl ?? coords.rpcUrl,
117
116
  backendUrl: parsed.backendUrl,
118
117
  apiKey: parsed.apiKey,
118
+ appSource: parsed.appSource,
119
119
  marketplace721Contract,
120
120
  marketplaceContract: marketplace721Contract,
121
121
  marketplace1155Contract: parsed.marketplace1155Contract ?? sn.marketplace1155,
@@ -266,10 +266,13 @@ function parseRetryAfter(value) {
266
266
  return void 0;
267
267
  }
268
268
  var ApiClient = class {
269
- constructor(baseUrl, apiKey, retryOptions, chain = "STARKNET") {
269
+ constructor(baseUrl, apiKey, retryOptions, chain = "STARKNET", appSource) {
270
270
  this.baseUrl = baseUrl;
271
271
  this.chain = chain;
272
- this.baseHeaders = apiKey ? { "x-api-key": apiKey } : {};
272
+ this.baseHeaders = {
273
+ ...apiKey ? { "x-api-key": apiKey } : {},
274
+ ...appSource ? { "x-app-source": appSource } : {}
275
+ };
273
276
  this.retryOptions = retryOptions;
274
277
  }
275
278
  addr(a) {
@@ -1124,10 +1127,7 @@ SN.creatorCoinEkuboLauncher;
1124
1127
  SN.creatorCoinClassHash;
1125
1128
  SN.creatorCoinFactoryClassHash;
1126
1129
  SN.creatorCoinStartBlock;
1127
- SN.genesisMintLaunch;
1128
- SN.genesisMintBR;
1129
- SN.genesisMintGlobal;
1130
- SN.genesisMintLaunch;
1130
+ SN.genesisMint;
1131
1131
  SN.ekuboCore;
1132
1132
  var SUPPORTED_TOKENS = [
1133
1133
  {
@@ -11114,7 +11114,7 @@ var MedialaneClient = class {
11114
11114
  }
11115
11115
  });
11116
11116
  } else {
11117
- this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
11117
+ this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain, this.config.appSource);
11118
11118
  }
11119
11119
  }
11120
11120
  get chain() {
@@ -11806,9 +11806,13 @@ async function requestSiwsToken({
11806
11806
  appSource
11807
11807
  }) {
11808
11808
  const base = backendUrl.replace(/\/$/, "");
11809
+ const headers = {
11810
+ "Content-Type": "application/json",
11811
+ ...appSource ? { "x-app-source": appSource } : {}
11812
+ };
11809
11813
  const nonceRes = await fetch(`${base}/v1/auth/siws/nonce`, {
11810
11814
  method: "POST",
11811
- headers: { "Content-Type": "application/json" },
11815
+ headers,
11812
11816
  body: JSON.stringify({ walletAddress })
11813
11817
  });
11814
11818
  if (!nonceRes.ok) {
@@ -11818,7 +11822,7 @@ async function requestSiwsToken({
11818
11822
  const signature = normalizeSiwsSignature(await signer.signMessage(typedData));
11819
11823
  const verifyRes = await fetch(`${base}/v1/auth/siws/verify`, {
11820
11824
  method: "POST",
11821
- headers: { "Content-Type": "application/json" },
11825
+ headers,
11822
11826
  body: JSON.stringify({ walletAddress, nonce, signature, ...appSource ? { appSource } : {} })
11823
11827
  });
11824
11828
  if (!verifyRes.ok) {