@pafi-dev/core 0.23.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
 
@@ -1522,14 +1522,21 @@ var PAFI_SERVICE_URLS = {
1522
1522
  issuerApi: "https://api-dev.pacificfinance.org/api/issuer"
1523
1523
  }
1524
1524
  };
1525
- function getPafiServiceUrls(chainId) {
1526
- const urls = PAFI_SERVICE_URLS[chainId];
1527
- if (!urls) {
1525
+ function getPafiServiceUrls(chainId, overrides) {
1526
+ const defaults = PAFI_SERVICE_URLS[chainId];
1527
+ if (!defaults) {
1528
1528
  throw new Error(
1529
- `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.`
1530
1530
  );
1531
1531
  }
1532
- 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 };
1533
1540
  }
1534
1541
 
1535
1542
  // src/web-handoff/webPopup.ts
@@ -1545,8 +1552,8 @@ function openWebPopup(url, options = {}) {
1545
1552
  const width = _nullishCoalesce(options.width, () => ( DEFAULT_WIDTH));
1546
1553
  const height = _nullishCoalesce(options.height, () => ( DEFAULT_HEIGHT));
1547
1554
  const name = _nullishCoalesce(options.windowName, () => ( DEFAULT_NAME));
1548
- const screenW = _nullishCoalesce(_optionalChain([window, 'access', _54 => _54.screen, 'optionalAccess', _55 => _55.availWidth]), () => ( window.innerWidth));
1549
- 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));
1550
1557
  const left = Math.max(0, Math.floor((screenW - width) / 2));
1551
1558
  const top = Math.max(0, Math.floor((screenH - height) / 2));
1552
1559
  const features = [
@@ -1579,7 +1586,7 @@ function openWebPopup(url, options = {}) {
1579
1586
  window.removeEventListener("message", messageListener);
1580
1587
  messageListener = null;
1581
1588
  }
1582
- _optionalChain([options, 'access', _58 => _58.onClose, 'optionalCall', _59 => _59()]);
1589
+ _optionalChain([options, 'access', _60 => _60.onClose, 'optionalCall', _61 => _61()]);
1583
1590
  };
1584
1591
  pollId = setInterval(() => {
1585
1592
  if (popup.closed) {