@pafi-dev/issuer 0.35.1 → 0.36.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.
package/dist/index.cjs CHANGED
@@ -4437,6 +4437,7 @@ function createNativePtQuoter(config) {
4437
4437
  cacheTtlMs = 3e4,
4438
4438
  fallbackEthPriceUsd = 3e3,
4439
4439
  fallbackPtPriceUsdt = 0.1,
4440
+ failClosed = false,
4440
4441
  fetchImpl = globalThis.fetch,
4441
4442
  now = () => Date.now()
4442
4443
  } = config;
@@ -4461,6 +4462,11 @@ function createNativePtQuoter(config) {
4461
4462
  ethPriceCache = { value: answer, expiresAt: ts + cacheTtlMs };
4462
4463
  return answer;
4463
4464
  } catch (err) {
4465
+ if (failClosed) {
4466
+ throw new Error(
4467
+ `[nativePtQuoter] Chainlink unavailable in fail-closed mode: ${err.message}`
4468
+ );
4469
+ }
4464
4470
  console.warn("[nativePtQuoter] Chainlink unavailable, using fallback:", err.message);
4465
4471
  return BigInt(Math.round(fallbackEthPriceUsd * 1e8));
4466
4472
  }
@@ -4493,6 +4499,11 @@ function createNativePtQuoter(config) {
4493
4499
  ptPriceCache = { value, expiresAt: ts + cacheTtlMs };
4494
4500
  return value;
4495
4501
  } catch (err) {
4502
+ if (failClosed) {
4503
+ throw new Error(
4504
+ `[nativePtQuoter] subgraph miss for ${pointTokenAddress} in fail-closed mode: ${err.message}`
4505
+ );
4506
+ }
4496
4507
  console.warn("[nativePtQuoter] subgraph unavailable, using fallback:", err.message);
4497
4508
  const ptPerUsdtHuman = 1 / fallbackPtPriceUsdt;
4498
4509
  return parseBigDecimalTo18(ptPerUsdtHuman.toFixed(18));
@@ -5410,7 +5421,7 @@ var MemoryRedemptionHistoryStore = class {
5410
5421
  };
5411
5422
 
5412
5423
  // src/index.ts
5413
- var PAFI_ISSUER_SDK_VERSION = true ? "0.35.0" : "dev";
5424
+ var PAFI_ISSUER_SDK_VERSION = true ? "0.35.1" : "dev";
5414
5425
  // Annotate the CommonJS export names for ESM import in node:
5415
5426
  0 && (module.exports = {
5416
5427
  AdapterMisconfiguredError,