@pafi-dev/issuer 0.12.4 → 0.12.6

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 CHANGED
@@ -849,7 +849,13 @@ var RelayService = class {
849
849
  const feeAmount = await (0, import_core5.quoteOperatorFeePt)({
850
850
  provider: this.provider,
851
851
  chainId: this.chainId,
852
- pointTokenAddress: params.pointTokenAddress
852
+ pointTokenAddress: params.pointTokenAddress,
853
+ allowStaleFallback: true,
854
+ onFallback: (info) => {
855
+ console.warn(
856
+ `[RelayService] operatorFeeQuoter fallback (${info.source}): ${info.reason} \u2192 using ${info.fallbackValue}`
857
+ );
858
+ }
853
859
  });
854
860
  return { feeAmount, feeRecipient };
855
861
  }
@@ -3903,6 +3909,12 @@ var BalanceAggregator = class {
3903
3909
 
3904
3910
  // src/pafi-backend/client.ts
3905
3911
  var import_core17 = require("@pafi-dev/core");
3912
+ function extractPafiErrorFields(json, status) {
3913
+ const inner = typeof json.error === "object" && json.error !== null ? json.error : null;
3914
+ const code = inner?.code ?? json.code ?? "INTERNAL_ERROR";
3915
+ const message = inner?.message ?? json.message ?? `HTTP ${status}`;
3916
+ return { code, message };
3917
+ }
3906
3918
  function serializeBigInt(_key, value) {
3907
3919
  return typeof value === "bigint" ? value.toString(10) : value;
3908
3920
  }
@@ -3978,8 +3990,7 @@ var PafiBackendClient = class {
3978
3990
  } catch {
3979
3991
  }
3980
3992
  if (!response.ok) {
3981
- const code = json.code ?? "INTERNAL_ERROR";
3982
- const message = json.message ?? `HTTP ${response.status}`;
3993
+ const { code, message } = extractPafiErrorFields(json, response.status);
3983
3994
  throw new PafiBackendError(code, message, response.status, json);
3984
3995
  }
3985
3996
  if (json.pending) return null;
@@ -4017,8 +4028,7 @@ var PafiBackendClient = class {
4017
4028
  } catch {
4018
4029
  }
4019
4030
  if (!response.ok) {
4020
- const code = json.code ?? "INTERNAL_ERROR";
4021
- const message = json.message ?? `HTTP ${response.status}`;
4031
+ const { code, message } = extractPafiErrorFields(json, response.status);
4022
4032
  throw new PafiBackendError(code, message, response.status, json);
4023
4033
  }
4024
4034
  return { userOpHash: json.userOpHash };
@@ -4052,10 +4062,10 @@ var PafiBackendClient = class {
4052
4062
  } catch {
4053
4063
  }
4054
4064
  if (!response.ok) {
4055
- const code = json.code ?? "INTERNAL_ERROR";
4056
- const message = json.message ?? `HTTP ${response.status}`;
4057
- const retryAfter = typeof json.retryAfter === "number" ? json.retryAfter : void 0;
4058
- const safeToRetry = typeof json.safeToRetry === "boolean" ? json.safeToRetry : void 0;
4065
+ const { code, message } = extractPafiErrorFields(json, response.status);
4066
+ const errInner = typeof json.error === "object" && json.error !== null ? json.error : json;
4067
+ const retryAfter = typeof errInner.retryAfter === "number" ? errInner.retryAfter : typeof json.retryAfter === "number" ? json.retryAfter : void 0;
4068
+ const safeToRetry = typeof errInner.safeToRetry === "boolean" ? errInner.safeToRetry : typeof json.safeToRetry === "boolean" ? json.safeToRetry : void 0;
4059
4069
  throw new PafiBackendError(code, message, response.status, json, {
4060
4070
  retryAfter,
4061
4071
  safeToRetry
@@ -4729,7 +4739,7 @@ var MemoryRedemptionHistoryStore = class {
4729
4739
  };
4730
4740
 
4731
4741
  // src/index.ts
4732
- var PAFI_ISSUER_SDK_VERSION = true ? "0.12.3" : "dev";
4742
+ var PAFI_ISSUER_SDK_VERSION = true ? "0.12.5" : "dev";
4733
4743
  // Annotate the CommonJS export names for ESM import in node:
4734
4744
  0 && (module.exports = {
4735
4745
  AdapterMisconfiguredError,