@medialane/sdk 0.122.1 → 0.124.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.
@@ -559,6 +559,7 @@ interface RequestSiwsTokenArgs {
559
559
  backendUrl: string;
560
560
  walletAddress: string;
561
561
  signer: SiwsSigner;
562
+ appSource?: string;
562
563
  }
563
564
 
564
565
  declare function getSiwsStorageKey(address: string): string;
@@ -566,7 +567,7 @@ declare function isSiwsTokenValid(token: string | null | undefined): token is st
566
567
  declare function getStoredSiwsToken(address: string): string | null;
567
568
  declare function storeSiwsToken(address: string, token: string): void;
568
569
  declare function normalizeSiwsSignature(signature: unknown): string[];
569
- declare function requestSiwsToken({ backendUrl, walletAddress, signer, }: RequestSiwsTokenArgs): Promise<string>;
570
+ declare function requestSiwsToken({ backendUrl, walletAddress, signer, appSource, }: RequestSiwsTokenArgs): Promise<string>;
570
571
 
571
572
  declare const IPMarketplaceABI: readonly [{
572
573
  readonly type: "impl";
@@ -559,6 +559,7 @@ interface RequestSiwsTokenArgs {
559
559
  backendUrl: string;
560
560
  walletAddress: string;
561
561
  signer: SiwsSigner;
562
+ appSource?: string;
562
563
  }
563
564
 
564
565
  declare function getSiwsStorageKey(address: string): string;
@@ -566,7 +567,7 @@ declare function isSiwsTokenValid(token: string | null | undefined): token is st
566
567
  declare function getStoredSiwsToken(address: string): string | null;
567
568
  declare function storeSiwsToken(address: string, token: string): void;
568
569
  declare function normalizeSiwsSignature(signature: unknown): string[];
569
- declare function requestSiwsToken({ backendUrl, walletAddress, signer, }: RequestSiwsTokenArgs): Promise<string>;
570
+ declare function requestSiwsToken({ backendUrl, walletAddress, signer, appSource, }: RequestSiwsTokenArgs): Promise<string>;
570
571
 
571
572
  declare const IPMarketplaceABI: readonly [{
572
573
  readonly type: "impl";
@@ -949,9 +949,6 @@ var MedialaneError = class extends Error {
949
949
  };
950
950
 
951
951
  // src/utils/rpc.ts
952
- var PUBLIC_RPC_FALLBACKS = [
953
- "https://rpc.starknet.lava.build"
954
- ];
955
952
  var TRANSIENT_BODY_RE = /"code"\s*:\s*-32001|"code"\s*:\s*-32603|unable to complete|rate.?limit|too many|throttl|exceed.*quota|temporarily unavailable|service unavailable|overload|gateway.*time|upstream.*time|backend.*error/i;
956
953
  var POLICY_REFUSAL_CODES = [-32003, -32005, -32600];
957
954
  function isPolicyRefusal(input) {
@@ -1043,7 +1040,7 @@ var _providerCache = /* @__PURE__ */ new WeakMap();
1043
1040
  function getProvider(config) {
1044
1041
  let p = _providerCache.get(config);
1045
1042
  if (!p) {
1046
- const urls = Array.from(/* @__PURE__ */ new Set([config.rpcUrl, ...PUBLIC_RPC_FALLBACKS]));
1043
+ const urls = [config.rpcUrl];
1047
1044
  p = new RpcProvider({ nodeUrl: urls[0], baseFetch: createFailoverFetch(urls) });
1048
1045
  _providerCache.set(config, p);
1049
1046
  }
@@ -11581,7 +11578,8 @@ function normalizeSiwsSignature(signature) {
11581
11578
  async function requestSiwsToken({
11582
11579
  backendUrl,
11583
11580
  walletAddress,
11584
- signer
11581
+ signer,
11582
+ appSource
11585
11583
  }) {
11586
11584
  const base = backendUrl.replace(/\/$/, "");
11587
11585
  const nonceRes = await fetch(`${base}/v1/auth/siws/nonce`, {
@@ -11597,7 +11595,7 @@ async function requestSiwsToken({
11597
11595
  const verifyRes = await fetch(`${base}/v1/auth/siws/verify`, {
11598
11596
  method: "POST",
11599
11597
  headers: { "Content-Type": "application/json" },
11600
- body: JSON.stringify({ walletAddress, nonce, signature })
11598
+ body: JSON.stringify({ walletAddress, nonce, signature, ...appSource ? { appSource } : {} })
11601
11599
  });
11602
11600
  if (!verifyRes.ok) {
11603
11601
  let backendMessage;