@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.cjs CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
 
11
11
 
12
- var _chunk2DVM77Y2cjs = require('./chunk-2DVM77Y2.cjs');
13
12
 
14
13
 
15
14
 
16
15
 
16
+ var _chunk75JWR5SAcjs = require('./chunk-75JWR5SA.cjs');
17
17
 
18
18
 
19
19
 
@@ -25,7 +25,6 @@ var _chunk2DVM77Y2cjs = require('./chunk-2DVM77Y2.cjs');
25
25
 
26
26
 
27
27
 
28
- var _chunk75JWR5SAcjs = require('./chunk-75JWR5SA.cjs');
29
28
 
30
29
 
31
30
 
@@ -33,6 +32,7 @@ var _chunk75JWR5SAcjs = require('./chunk-75JWR5SA.cjs');
33
32
 
34
33
 
35
34
 
35
+ var _chunkDQKCPH6Bcjs = require('./chunk-DQKCPH6B.cjs');
36
36
 
37
37
 
38
38
 
@@ -44,7 +44,7 @@ var _chunk75JWR5SAcjs = require('./chunk-75JWR5SA.cjs');
44
44
 
45
45
 
46
46
 
47
- var _chunkDQKCPH6Bcjs = require('./chunk-DQKCPH6B.cjs');
47
+ var _chunk2DVM77Y2cjs = require('./chunk-2DVM77Y2.cjs');
48
48
 
49
49
 
50
50
 
@@ -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 (_optionalChain([overrides, 'optionalAccess', _54 => _54.sponsorRelayer])) {
1534
+ cleanOverrides.sponsorRelayer = overrides.sponsorRelayer;
1535
+ }
1536
+ if (_optionalChain([overrides, 'optionalAccess', _55 => _55.issuerApi])) {
1537
+ cleanOverrides.issuerApi = overrides.issuerApi;
1538
+ }
1539
+ return { ...defaults, ...cleanOverrides };
1521
1540
  }
1522
1541
 
1523
1542
  // src/web-handoff/webPopup.ts
@@ -1533,8 +1552,8 @@ function openWebPopup(url, options = {}) {
1533
1552
  const width = _nullishCoalesce(options.width, () => ( DEFAULT_WIDTH));
1534
1553
  const height = _nullishCoalesce(options.height, () => ( DEFAULT_HEIGHT));
1535
1554
  const name = _nullishCoalesce(options.windowName, () => ( DEFAULT_NAME));
1536
- const screenW = _nullishCoalesce(_optionalChain([window, 'access', _54 => _54.screen, 'optionalAccess', _55 => _55.availWidth]), () => ( window.innerWidth));
1537
- const screenH = _nullishCoalesce(_optionalChain([window, 'access', _56 => _56.screen, 'optionalAccess', _57 => _57.availHeight]), () => ( window.innerHeight));
1555
+ const screenW = _nullishCoalesce(_optionalChain([window, 'access', _56 => _56.screen, 'optionalAccess', _57 => _57.availWidth]), () => ( window.innerWidth));
1556
+ const screenH = _nullishCoalesce(_optionalChain([window, 'access', _58 => _58.screen, 'optionalAccess', _59 => _59.availHeight]), () => ( window.innerHeight));
1538
1557
  const left = Math.max(0, Math.floor((screenW - width) / 2));
1539
1558
  const top = Math.max(0, Math.floor((screenH - height) / 2));
1540
1559
  const features = [
@@ -1567,7 +1586,7 @@ function openWebPopup(url, options = {}) {
1567
1586
  window.removeEventListener("message", messageListener);
1568
1587
  messageListener = null;
1569
1588
  }
1570
- _optionalChain([options, 'access', _58 => _58.onClose, 'optionalCall', _59 => _59()]);
1589
+ _optionalChain([options, 'access', _60 => _60.onClose, 'optionalCall', _61 => _61()]);
1571
1590
  };
1572
1591
  pollId = setInterval(() => {
1573
1592
  if (popup.closed) {