@medialane/sdk 0.139.0 → 0.140.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.
@@ -12325,9 +12325,9 @@ function mintedTokenIdFromReceipt(receipt, contract) {
12325
12325
  // src/starknet/services/sponsoredExecutor.ts
12326
12326
  var SponsoredCallRejectedError = class extends Error {
12327
12327
  };
12328
- var USER_MAY_PAY = /* @__PURE__ */ new Set(["sponsor_unavailable", "credits_exhausted"]);
12329
- function userMayPayInstead(code, status, stage) {
12330
- if (code) return USER_MAY_PAY.has(code);
12328
+ var FALLBACK_FUNDING_FAILURES = /* @__PURE__ */ new Set(["sponsor_unavailable", "credits_exhausted"]);
12329
+ function allowsFallbackFunding(code, status, stage) {
12330
+ if (code) return FALLBACK_FUNDING_FAILURES.has(code);
12331
12331
  return stage === "build" ? status >= 500 : status === 503;
12332
12332
  }
12333
12333
  async function failureOf(res, fallback) {
@@ -12345,7 +12345,7 @@ async function executeSponsored(config, signer, calls) {
12345
12345
  });
12346
12346
  if (!buildRes.ok) {
12347
12347
  const { reason, code } = await failureOf(buildRes, "We couldn't prepare this transaction.");
12348
- if (userMayPayInstead(code, buildRes.status, "build")) return { status: "unavailable", reason };
12348
+ if (allowsFallbackFunding(code, buildRes.status, "build")) return { status: "unavailable", reason };
12349
12349
  throw new SponsoredCallRejectedError(reason);
12350
12350
  }
12351
12351
  const { typedData } = await buildRes.json();
@@ -12357,7 +12357,7 @@ async function executeSponsored(config, signer, calls) {
12357
12357
  });
12358
12358
  if (!executeRes.ok) {
12359
12359
  const { reason, code } = await failureOf(executeRes, "We couldn't submit this transaction.");
12360
- if (userMayPayInstead(code, executeRes.status, "execute")) {
12360
+ if (allowsFallbackFunding(code, executeRes.status, "execute")) {
12361
12361
  return { status: "unavailable", reason };
12362
12362
  }
12363
12363
  throw new SponsoredCallRejectedError(reason);
@@ -13226,6 +13226,7 @@ exports.UserFacingError = UserFacingError;
13226
13226
  exports.VALIDATED_EKUBO_PARAMS = VALIDATED_EKUBO_PARAMS;
13227
13227
  exports.accountFor = accountFor;
13228
13228
  exports.adminRequestDigest = adminRequestDigest;
13229
+ exports.allowsFallbackFunding = allowsFallbackFunding;
13229
13230
  exports.assertTransactionSucceeded = assertTransactionSucceeded;
13230
13231
  exports.build1155CancellationTypedData = build1155CancellationTypedData;
13231
13232
  exports.build1155OrderTypedData = build1155OrderTypedData;
@@ -13317,7 +13318,6 @@ exports.syncTransactionBestEffort = syncTransactionBestEffort;
13317
13318
  exports.teamCoinsRaw = teamCoinsRaw;
13318
13319
  exports.toDropContractConditions = toContractConditions;
13319
13320
  exports.unsealPrivateKey = unsealPrivateKey;
13320
- exports.userMayPayInstead = userMayPayInstead;
13321
13321
  exports.validateCoinName = validateName;
13322
13322
  exports.validateCoinSupply = validateSupply;
13323
13323
  exports.validateCoinSymbol = validateSymbol;