@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 +20 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -618,7 +618,13 @@ var RelayService = class {
|
|
|
618
618
|
const feeAmount = await quoteOperatorFeePt({
|
|
619
619
|
provider: this.provider,
|
|
620
620
|
chainId: this.chainId,
|
|
621
|
-
pointTokenAddress: params.pointTokenAddress
|
|
621
|
+
pointTokenAddress: params.pointTokenAddress,
|
|
622
|
+
allowStaleFallback: true,
|
|
623
|
+
onFallback: (info) => {
|
|
624
|
+
console.warn(
|
|
625
|
+
`[RelayService] operatorFeeQuoter fallback (${info.source}): ${info.reason} \u2192 using ${info.fallbackValue}`
|
|
626
|
+
);
|
|
627
|
+
}
|
|
622
628
|
});
|
|
623
629
|
return { feeAmount, feeRecipient };
|
|
624
630
|
}
|
|
@@ -3718,6 +3724,12 @@ var BalanceAggregator = class {
|
|
|
3718
3724
|
|
|
3719
3725
|
// src/pafi-backend/client.ts
|
|
3720
3726
|
import { getPafiServiceUrls } from "@pafi-dev/core";
|
|
3727
|
+
function extractPafiErrorFields(json, status) {
|
|
3728
|
+
const inner = typeof json.error === "object" && json.error !== null ? json.error : null;
|
|
3729
|
+
const code = inner?.code ?? json.code ?? "INTERNAL_ERROR";
|
|
3730
|
+
const message = inner?.message ?? json.message ?? `HTTP ${status}`;
|
|
3731
|
+
return { code, message };
|
|
3732
|
+
}
|
|
3721
3733
|
function serializeBigInt(_key, value) {
|
|
3722
3734
|
return typeof value === "bigint" ? value.toString(10) : value;
|
|
3723
3735
|
}
|
|
@@ -3793,8 +3805,7 @@ var PafiBackendClient = class {
|
|
|
3793
3805
|
} catch {
|
|
3794
3806
|
}
|
|
3795
3807
|
if (!response.ok) {
|
|
3796
|
-
const code = json.
|
|
3797
|
-
const message = json.message ?? `HTTP ${response.status}`;
|
|
3808
|
+
const { code, message } = extractPafiErrorFields(json, response.status);
|
|
3798
3809
|
throw new PafiBackendError(code, message, response.status, json);
|
|
3799
3810
|
}
|
|
3800
3811
|
if (json.pending) return null;
|
|
@@ -3832,8 +3843,7 @@ var PafiBackendClient = class {
|
|
|
3832
3843
|
} catch {
|
|
3833
3844
|
}
|
|
3834
3845
|
if (!response.ok) {
|
|
3835
|
-
const code = json.
|
|
3836
|
-
const message = json.message ?? `HTTP ${response.status}`;
|
|
3846
|
+
const { code, message } = extractPafiErrorFields(json, response.status);
|
|
3837
3847
|
throw new PafiBackendError(code, message, response.status, json);
|
|
3838
3848
|
}
|
|
3839
3849
|
return { userOpHash: json.userOpHash };
|
|
@@ -3867,10 +3877,10 @@ var PafiBackendClient = class {
|
|
|
3867
3877
|
} catch {
|
|
3868
3878
|
}
|
|
3869
3879
|
if (!response.ok) {
|
|
3870
|
-
const code = json.
|
|
3871
|
-
const
|
|
3872
|
-
const retryAfter = typeof json.retryAfter === "number" ? json.retryAfter : void 0;
|
|
3873
|
-
const safeToRetry = typeof json.safeToRetry === "boolean" ? json.safeToRetry : void 0;
|
|
3880
|
+
const { code, message } = extractPafiErrorFields(json, response.status);
|
|
3881
|
+
const errInner = typeof json.error === "object" && json.error !== null ? json.error : json;
|
|
3882
|
+
const retryAfter = typeof errInner.retryAfter === "number" ? errInner.retryAfter : typeof json.retryAfter === "number" ? json.retryAfter : void 0;
|
|
3883
|
+
const safeToRetry = typeof errInner.safeToRetry === "boolean" ? errInner.safeToRetry : typeof json.safeToRetry === "boolean" ? json.safeToRetry : void 0;
|
|
3874
3884
|
throw new PafiBackendError(code, message, response.status, json, {
|
|
3875
3885
|
retryAfter,
|
|
3876
3886
|
safeToRetry
|
|
@@ -4551,7 +4561,7 @@ var MemoryRedemptionHistoryStore = class {
|
|
|
4551
4561
|
};
|
|
4552
4562
|
|
|
4553
4563
|
// src/index.ts
|
|
4554
|
-
var PAFI_ISSUER_SDK_VERSION = true ? "0.12.
|
|
4564
|
+
var PAFI_ISSUER_SDK_VERSION = true ? "0.12.5" : "dev";
|
|
4555
4565
|
export {
|
|
4556
4566
|
AdapterMisconfiguredError,
|
|
4557
4567
|
AuthError,
|