@pafi-dev/core 0.22.0 → 0.24.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.d.cts CHANGED
@@ -2491,9 +2491,34 @@ interface PafiServiceUrls {
2491
2491
  * NOTE: placeholder URLs — Phi will swap in real prod/staging hosts
2492
2492
  * once the deploy targets are finalized. SDK version bump captures
2493
2493
  * the change.
2494
+ *
2495
+ * Audit PACI5-17 — production deployments SHOULD pass explicit
2496
+ * `overrides` to `getPafiServiceUrls(chainId, overrides)` (sourced from
2497
+ * env vars like `PAFI_SPONSOR_RELAYER_URL`, `PAFI_ISSUER_API_URL`)
2498
+ * instead of relying on these defaults. The SDK ship-default is a
2499
+ * convenience for dev/test; relying on it for production means an SDK
2500
+ * version bump is required to retarget environments.
2494
2501
  */
2495
2502
  declare const PAFI_SERVICE_URLS: Record<number, PafiServiceUrls>;
2496
- declare function getPafiServiceUrls(chainId: number): PafiServiceUrls;
2503
+ /**
2504
+ * Resolve PAFI HTTP service URLs for the chain. Caller MAY pass
2505
+ * `overrides` to point at a different environment (production,
2506
+ * staging, local mock) without bumping the SDK.
2507
+ *
2508
+ * Audit PACI5-17 — production issuer backends MUST surface the URL
2509
+ * via env vars and pass them through here so the deployed binary
2510
+ * does not depend on hardcoded ship-defaults that may target dev
2511
+ * infrastructure. Example:
2512
+ *
2513
+ * const services = getPafiServiceUrls(8453, {
2514
+ * sponsorRelayer: process.env.PAFI_SPONSOR_RELAYER_URL,
2515
+ * issuerApi: process.env.PAFI_ISSUER_API_URL,
2516
+ * });
2517
+ *
2518
+ * Undefined / empty-string overrides are ignored so callers can safely
2519
+ * pass through optional env vars.
2520
+ */
2521
+ declare function getPafiServiceUrls(chainId: number, overrides?: Partial<PafiServiceUrls>): PafiServiceUrls;
2497
2522
 
2498
2523
  /**
2499
2524
  * Public contract surface for `@pafi-dev/core/contracts`.
package/dist/index.d.ts CHANGED
@@ -2491,9 +2491,34 @@ interface PafiServiceUrls {
2491
2491
  * NOTE: placeholder URLs — Phi will swap in real prod/staging hosts
2492
2492
  * once the deploy targets are finalized. SDK version bump captures
2493
2493
  * the change.
2494
+ *
2495
+ * Audit PACI5-17 — production deployments SHOULD pass explicit
2496
+ * `overrides` to `getPafiServiceUrls(chainId, overrides)` (sourced from
2497
+ * env vars like `PAFI_SPONSOR_RELAYER_URL`, `PAFI_ISSUER_API_URL`)
2498
+ * instead of relying on these defaults. The SDK ship-default is a
2499
+ * convenience for dev/test; relying on it for production means an SDK
2500
+ * version bump is required to retarget environments.
2494
2501
  */
2495
2502
  declare const PAFI_SERVICE_URLS: Record<number, PafiServiceUrls>;
2496
- declare function getPafiServiceUrls(chainId: number): PafiServiceUrls;
2503
+ /**
2504
+ * Resolve PAFI HTTP service URLs for the chain. Caller MAY pass
2505
+ * `overrides` to point at a different environment (production,
2506
+ * staging, local mock) without bumping the SDK.
2507
+ *
2508
+ * Audit PACI5-17 — production issuer backends MUST surface the URL
2509
+ * via env vars and pass them through here so the deployed binary
2510
+ * does not depend on hardcoded ship-defaults that may target dev
2511
+ * infrastructure. Example:
2512
+ *
2513
+ * const services = getPafiServiceUrls(8453, {
2514
+ * sponsorRelayer: process.env.PAFI_SPONSOR_RELAYER_URL,
2515
+ * issuerApi: process.env.PAFI_ISSUER_API_URL,
2516
+ * });
2517
+ *
2518
+ * Undefined / empty-string overrides are ignored so callers can safely
2519
+ * pass through optional env vars.
2520
+ */
2521
+ declare function getPafiServiceUrls(chainId: number, overrides?: Partial<PafiServiceUrls>): PafiServiceUrls;
2497
2522
 
2498
2523
  /**
2499
2524
  * Public contract surface for `@pafi-dev/core/contracts`.
package/dist/index.js CHANGED
@@ -1,15 +1,3 @@
1
- import {
2
- erc20Abi,
3
- permit2Abi,
4
- pointModuleCoreAbi,
5
- pointTokenFactoryAbi,
6
- settlementVaultAbi,
7
- tokenRegistryAbi,
8
- universalRouterAbi,
9
- v3QuoterV2Abi,
10
- vaultFactoryAbi,
11
- vaultRegistryAbi
12
- } from "./chunk-ZQVYWMOG.js";
13
1
  import {
14
2
  SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET,
15
3
  SPONSOR_AUTH_DOMAIN_NAME,
@@ -45,6 +33,18 @@ import {
45
33
  verifyIssuerOperative,
46
34
  verifyMint
47
35
  } from "./chunk-4VPIPVV5.js";
36
+ import {
37
+ erc20Abi,
38
+ permit2Abi,
39
+ pointModuleCoreAbi,
40
+ pointTokenFactoryAbi,
41
+ settlementVaultAbi,
42
+ tokenRegistryAbi,
43
+ universalRouterAbi,
44
+ v3QuoterV2Abi,
45
+ vaultFactoryAbi,
46
+ vaultRegistryAbi
47
+ } from "./chunk-ZQVYWMOG.js";
48
48
  import {
49
49
  issuerRegistryAbi,
50
50
  mintFeeWrapperAbi,
@@ -900,11 +900,23 @@ var CONTRACT_ADDRESSES = {
900
900
  // top-level export.
901
901
  permit2: "0xEB450d21ae68D3303Cf5775A54Cc84EE7c3fC8eC",
902
902
  // ── Stablecoins ───────────────────────────────────────────────
903
- // USDT inherited from v1.6 (MockUSDT no new V2 USDT deploy).
904
- usdt: "0x3F7e71B150e97316Bb9f363A32c19CcD36ac2382",
905
- // V2 USDC PAFI ecosystem USDC (custom deploy, NOT canonical Base
906
- // USDC `0x833589fC...`). Paired with the USDC/USD Chainlink feed below.
907
- usdc: "0xf0Fa9eB05fd3a373d3c54775Ff0ed55Dc9cc2D3E",
903
+ // Canonical Base stables the PT pools team deploys against these
904
+ // (verified on-chain: pool `0xB135E06E…` LTR/USDC and `0x6348D133…`
905
+ // JLB/USDC both list `token = 0x833589fC…` = canonical USDC). The
906
+ // earlier PAFI custom-deploy USDT/USDC (MockUSDT `0x3F7e71…` +
907
+ // PAFI V2 USDC `0xf0Fa9eB0…`) were unused by production pools and
908
+ // caused sponsor-relayer's `isStableFeeToken` to fall through to
909
+ // the PT quoter, producing 1e12× INSUFFICIENT_FEE rejects on every
910
+ // swap. See addresses.ts history before 2026-06-16 if archeology
911
+ // is needed.
912
+ //
913
+ // Canonical Tether USDT on Base (Tether's official native deploy,
914
+ // symbol="USDT", name="Tether USD", 6 decimals).
915
+ usdt: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
916
+ // Canonical Circle USDC on Base (Coinbase official deploy,
917
+ // symbol="USDC", 6 decimals). Paired with the USDC/USD Chainlink
918
+ // feed below.
919
+ usdc: "0x833589fCD6EDb6E08f4c7C32D4f71b54bdA02913",
908
920
  chainlinkUsdcUsd: "0xEE86BfD4E2B3A1e71a1b45f750791D67e735e4a7",
909
921
  // ── V2 core registries (replaces v1.6) ────────────────────────
910
922
  issuerRegistry: "0x3e82647b0f716f80e65d311354E2C4F0DcFd6997",
@@ -1510,14 +1522,21 @@ var PAFI_SERVICE_URLS = {
1510
1522
  issuerApi: "https://api-dev.pacificfinance.org/api/issuer"
1511
1523
  }
1512
1524
  };
1513
- function getPafiServiceUrls(chainId) {
1514
- const urls = PAFI_SERVICE_URLS[chainId];
1515
- if (!urls) {
1525
+ function getPafiServiceUrls(chainId, overrides) {
1526
+ const defaults = PAFI_SERVICE_URLS[chainId];
1527
+ if (!defaults) {
1516
1528
  throw new Error(
1517
- `getPafiServiceUrls: no PAFI service URLs for chainId ${chainId}. Supported: ${Object.keys(PAFI_SERVICE_URLS).join(", ")}`
1529
+ `getPafiServiceUrls: no PAFI service URLs for chainId ${chainId}. Supported: ${Object.keys(PAFI_SERVICE_URLS).join(", ")}. Provide explicit overrides for unsupported chains.`
1518
1530
  );
1519
1531
  }
1520
- return urls;
1532
+ const cleanOverrides = {};
1533
+ if (overrides?.sponsorRelayer) {
1534
+ cleanOverrides.sponsorRelayer = overrides.sponsorRelayer;
1535
+ }
1536
+ if (overrides?.issuerApi) {
1537
+ cleanOverrides.issuerApi = overrides.issuerApi;
1538
+ }
1539
+ return { ...defaults, ...cleanOverrides };
1521
1540
  }
1522
1541
 
1523
1542
  // src/web-handoff/webPopup.ts