@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 +18 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +24 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -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
|
|
1527
|
-
if (!
|
|
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
|
-
|
|
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 };
|
|
1533
1540
|
}
|
|
1534
1541
|
|
|
1535
1542
|
// src/web-handoff/webPopup.ts
|