@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.
@@ -951,9 +951,6 @@ var MedialaneError = class extends Error {
951
951
  };
952
952
 
953
953
  // src/utils/rpc.ts
954
- var PUBLIC_RPC_FALLBACKS = [
955
- "https://rpc.starknet.lava.build"
956
- ];
957
954
  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;
958
955
  var POLICY_REFUSAL_CODES = [-32003, -32005, -32600];
959
956
  function isPolicyRefusal(input) {
@@ -1045,7 +1042,7 @@ var _providerCache = /* @__PURE__ */ new WeakMap();
1045
1042
  function getProvider(config) {
1046
1043
  let p = _providerCache.get(config);
1047
1044
  if (!p) {
1048
- const urls = Array.from(/* @__PURE__ */ new Set([config.rpcUrl, ...PUBLIC_RPC_FALLBACKS]));
1045
+ const urls = [config.rpcUrl];
1049
1046
  p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: createFailoverFetch(urls) });
1050
1047
  _providerCache.set(config, p);
1051
1048
  }
@@ -11583,7 +11580,8 @@ function normalizeSiwsSignature(signature) {
11583
11580
  async function requestSiwsToken({
11584
11581
  backendUrl,
11585
11582
  walletAddress,
11586
- signer
11583
+ signer,
11584
+ appSource
11587
11585
  }) {
11588
11586
  const base = backendUrl.replace(/\/$/, "");
11589
11587
  const nonceRes = await fetch(`${base}/v1/auth/siws/nonce`, {
@@ -11599,7 +11597,7 @@ async function requestSiwsToken({
11599
11597
  const verifyRes = await fetch(`${base}/v1/auth/siws/verify`, {
11600
11598
  method: "POST",
11601
11599
  headers: { "Content-Type": "application/json" },
11602
- body: JSON.stringify({ walletAddress, nonce, signature })
11600
+ body: JSON.stringify({ walletAddress, nonce, signature, ...appSource ? { appSource } : {} })
11603
11601
  });
11604
11602
  if (!verifyRes.ok) {
11605
11603
  let backendMessage;