@pafi-dev/core 0.10.0 → 0.13.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.
Files changed (40) hide show
  1. package/README.md +23 -70
  2. package/dist/abi/index.cjs +2 -2
  3. package/dist/abi/index.cjs.map +1 -1
  4. package/dist/abi/index.d.cts +58 -106
  5. package/dist/abi/index.d.ts +58 -106
  6. package/dist/abi/index.js +3 -3
  7. package/dist/{chunk-J7EYOLMI.js → chunk-H3X3FYUU.js} +1 -1
  8. package/dist/chunk-H3X3FYUU.js.map +1 -0
  9. package/dist/{chunk-4NTU7XGP.cjs → chunk-NT2ZPF72.cjs} +53 -23
  10. package/dist/chunk-NT2ZPF72.cjs.map +1 -0
  11. package/dist/{chunk-BBQLGBOD.cjs → chunk-TRYGIC2I.cjs} +1 -1
  12. package/dist/{chunk-BBQLGBOD.cjs.map → chunk-TRYGIC2I.cjs.map} +1 -1
  13. package/dist/{chunk-RVSW7I6U.js → chunk-UEO4YN6T.js} +52 -22
  14. package/dist/chunk-UEO4YN6T.js.map +1 -0
  15. package/dist/{chunk-MIQA46E3.cjs → chunk-XXLIIWIF.cjs} +45 -53
  16. package/dist/chunk-XXLIIWIF.cjs.map +1 -0
  17. package/dist/{chunk-CWH4KOUW.js → chunk-ZJXXCG5P.js} +45 -53
  18. package/dist/chunk-ZJXXCG5P.js.map +1 -0
  19. package/dist/contract/index.cjs +2 -2
  20. package/dist/contract/index.d.cts +4 -5
  21. package/dist/contract/index.d.ts +4 -5
  22. package/dist/contract/index.js +1 -1
  23. package/dist/eip712/index.cjs +2 -2
  24. package/dist/eip712/index.d.cts +30 -5
  25. package/dist/eip712/index.d.ts +30 -5
  26. package/dist/eip712/index.js +1 -1
  27. package/dist/index.cjs +144 -125
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +185 -118
  30. package/dist/index.d.ts +185 -118
  31. package/dist/index.js +129 -110
  32. package/dist/index.js.map +1 -1
  33. package/dist/{types-B3UivyQ1.d.cts → types-C17pznGz.d.cts} +72 -21
  34. package/dist/{types-B3UivyQ1.d.ts → types-C17pznGz.d.ts} +72 -21
  35. package/package.json +6 -5
  36. package/dist/chunk-4NTU7XGP.cjs.map +0 -1
  37. package/dist/chunk-CWH4KOUW.js.map +0 -1
  38. package/dist/chunk-J7EYOLMI.js.map +0 -1
  39. package/dist/chunk-MIQA46E3.cjs.map +0 -1
  40. package/dist/chunk-RVSW7I6U.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { Address, Hex, TypedDataDomain, PublicClient, WalletClient, TransactionReceipt, HttpTransport } from 'viem';
2
- import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, E as EIP712Signature, S as SignatureVerification } from './types-B3UivyQ1.cjs';
3
- export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, e as ExactOutputBestQuote, f as ExactOutputQuoteResult, I as Issuer, g as PathKey, Q as QuoteResult, R as Recipient, h as RedemptionDecision, i as RedemptionDenial, j as RedemptionDenialCode, k as RedemptionPolicy, l as RedemptionPolicySource, m as RedemptionPreview, T as TokenCap } from './types-B3UivyQ1.cjs';
4
- export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
2
+ import { P as PoolKey, C as ChainConfig, V as V3Path, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, E as EIP712Signature, S as SignatureVerifyOptions, c as SignatureVerification } from './types-C17pznGz.cjs';
3
+ export { B as BestQuote, d as BlackoutWindow, e as BurnRequest, f as ExactOutputBestQuote, g as ExactOutputQuoteResult, I as Issuer, Q as QuoteResult, R as Recipient, h as RedemptionDecision, i as RedemptionDenial, j as RedemptionDenialCode, k as RedemptionPolicy, l as RedemptionPolicySource, m as RedemptionPreview, n as SignatureVerificationFailReason, T as TokenCap } from './types-C17pznGz.cjs';
4
+ export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v3QuoterV2Abi } from './abi/index.cjs';
5
5
  export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, signBurnRequest, signMintRequest, verifyBurnRequest, verifyMintRequest } from './eip712/index.cjs';
6
6
  export { getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getTokenCap, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.cjs';
7
7
  import { LoginMessageParams } from './auth/index.cjs';
8
8
  export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, generateSponsorAuthNonce, getSponsorAuthDomainAnchor, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.cjs';
9
9
 
10
10
  /**
11
- * EIP-712 typed data for the v1.6 sig-gated mint path.
11
+ * EIP-712 typed data for the sig-gated mint path.
12
12
  *
13
13
  * Contract enforces:
14
14
  * - msg.sender == receiver (the on-chain caller of `mint`)
@@ -53,8 +53,35 @@ declare const burnRequestTypes: {
53
53
  }];
54
54
  };
55
55
  declare const SUPPORTED_CHAINS: Record<number, ChainConfig>;
56
- declare const V4_QUOTER_ADDRESSES: Record<number, Address>;
56
+ /**
57
+ * Uniswap V3 QuoterV2 — used by `findBestQuote` / `quoteExactInput` etc.
58
+ * QuoterV2 (vs V1) reverts cleanly inside multicall and returns a 4-tuple
59
+ * `(amountOut, sqrtPriceX96AfterList, initializedTicksCrossedList, gasEstimate)`.
60
+ */
61
+ declare const QUOTER_V2_ADDRESSES: Record<number, Address>;
62
+ /**
63
+ * Uniswap UniversalRouter — used for AA/batched swaps via PT delegated
64
+ * accounts. Speaks V3 commands (`V3_SWAP_EXACT_IN = 0x00`,
65
+ * `V3_SWAP_EXACT_OUT = 0x01`).
66
+ */
57
67
  declare const UNIVERSAL_ROUTER_ADDRESSES: Record<number, Address>;
68
+ /**
69
+ * Uniswap V3 SwapRouter — used by `swapDirect`-style flows that bypass
70
+ * the UniversalRouter. Takes `exactInput` / `exactOutput` with packed-bytes
71
+ * paths directly.
72
+ */
73
+ declare const V3_SWAP_ROUTER_ADDRESSES: Record<number, Address>;
74
+ /**
75
+ * PAFI's Uniswap V3 factory — used together with `V3_POOL_INIT_CODE_HASH`
76
+ * to derive pool addresses deterministically (`computeV3PoolAddress`).
77
+ */
78
+ declare const V3_FACTORY_ADDRESSES: Record<number, Address>;
79
+ /**
80
+ * Pool-init code hash for PAFI's V3 deployment. Combined with the factory
81
+ * address + sorted tokens + fee, deterministically yields a pool's
82
+ * address via the standard Uniswap V3 CREATE2 derivation.
83
+ */
84
+ declare const V3_POOL_INIT_CODE_HASH: Hex;
58
85
  declare const COMMON_TOKENS: Record<number, Record<string, Address>>;
59
86
  declare const COMMON_POOLS: Record<number, PoolKey[]>;
60
87
  declare const POINT_TOKEN_POOLS: Record<number, Record<Address, PoolKey[]>>;
@@ -126,29 +153,67 @@ declare abstract class PafiSdkError extends Error {
126
153
  constructor(message: string);
127
154
  }
128
155
  /**
129
- * @deprecated Use `PafiSdkError` (capital S, lowercase dk).
130
- * The two classes existed in parallel ("PafiSDKError" in core,
131
- * "PafiSdkError" in issuer) due to historical drift; consolidating
132
- * here. Kept as alias for back-compat through v0.7.x; will be removed
133
- * in v0.8.
156
+ * SDK-level misconfiguration required input missing on the
157
+ * `PafiSDK` class or a helper that needs a provider/signer/chainId.
158
+ * The SDK can't service the request until the deployment is fixed,
159
+ * so this routes to **503** in `createSdkErrorMapper`.
160
+ *
161
+ * Note: `@pafi-dev/issuer` has a separate `ConfigurationError` with
162
+ * the same name but a different shape (carries a caller-supplied
163
+ * `code`). Both extend `PafiSdkError`; pick based on which package
164
+ * raised the error.
134
165
  */
135
- declare class PafiSDKError extends Error {
136
- constructor(message: string);
137
- }
138
- declare class ConfigurationError extends PafiSDKError {
166
+ declare class ConfigurationError extends PafiSdkError {
167
+ readonly httpStatus: "service_unavailable";
168
+ readonly code: "CONFIGURATION_ERROR";
169
+ readonly type: "server_error";
139
170
  constructor(message: string);
140
171
  }
141
- declare class SigningError extends PafiSDKError {
172
+ /**
173
+ * EIP-712 / EIP-7702 signing failed inside the SDK — typically the
174
+ * signer wallet rejected, the KMS was unreachable, or a signature
175
+ * post-condition (recover-to-expected-address) didn't hold.
176
+ *
177
+ * Routes to **503** because the most common cause is transient signer
178
+ * infrastructure (KMS hiccup); retry is often safe. Set
179
+ * `safeToRetry = true` from the call site if you can prove it.
180
+ */
181
+ declare class SigningError extends PafiSdkError {
182
+ readonly httpStatus: "service_unavailable";
183
+ readonly code: "SIGNING_FAILED";
184
+ readonly type: "server_error";
142
185
  constructor(message: string);
143
186
  }
144
- declare class SimulationError extends PafiSDKError {
145
- operation: string;
146
- reason: string;
187
+ /**
188
+ * `eth_call` dry-run reverted. The on-chain tx would also revert —
189
+ * caller's params are bad (slippage, insufficient balance, expired
190
+ * deadline). Routes to **422** as a business-logic failure.
191
+ *
192
+ * `operation` is a short tag (`"swap"`, `"perp-deposit"`, etc.) for
193
+ * log-grouping; `reason` carries the raw revert string surfaced by
194
+ * the simulator.
195
+ */
196
+ declare class SimulationError extends PafiSdkError {
197
+ readonly httpStatus: "unprocessable";
198
+ readonly code: "SIMULATION_FAILED";
199
+ readonly type: "business_logic_error";
200
+ readonly operation: string;
201
+ readonly reason: string;
147
202
  constructor(operation: string, reason: string);
148
203
  }
149
- declare class ApiError extends PafiSDKError {
150
- status?: number | undefined;
151
- constructor(message: string, status?: number | undefined);
204
+ /**
205
+ * External HTTP call (Pimlico bundler, PAFI sponsor-relayer, PAFI
206
+ * issuer-api) failed. Routes to **503**. `upstreamStatus` carries the
207
+ * remote HTTP status when known (e.g. 502 from Pimlico for a bundler
208
+ * outage) — useful for log-grouping but distinct from `httpStatus`
209
+ * which is the status PAFI returns to its OWN caller.
210
+ */
211
+ declare class ApiError extends PafiSdkError {
212
+ readonly httpStatus: "service_unavailable";
213
+ readonly code: "API_ERROR";
214
+ readonly type: "service_unavailable_error";
215
+ readonly upstreamStatus?: number;
216
+ constructor(message: string, upstreamStatus?: number);
152
217
  }
153
218
  /**
154
219
  * Thrown by `quoteOperatorFee*` when an upstream price source
@@ -413,8 +478,8 @@ interface UserOpReceipt {
413
478
  declare const ZERO_VALUE = 0n;
414
479
 
415
480
  /**
416
- * v1.5 — Scenario 3: deposit USDC from the user's wallet into the
417
- * Orderly perp Vault on Base mainnet.
481
+ * Deposit USDC from the user's wallet into the Orderly perp Vault on
482
+ * Base mainnet.
418
483
  *
419
484
  * Builds a `PartialUserOperation` packaging the 2 inner calls:
420
485
  *
@@ -598,10 +663,8 @@ interface BuildPerpDepositViaRelayParams {
598
663
  * flows (PAFI gas reimbursement). Pass `0n` / `undefined` for the
599
664
  * fallback path where the user pays ERC-4337 gas in ETH directly.
600
665
  *
601
- * v0.7 — input-token fee position rule: user holds USDC BEFORE
602
- * deposit (token-availability), so charge there. Replaces the old
603
- * `gasFeePt` / `gasFeePtRecipient` / `pointTokenAddress` triple from
604
- * v0.6.
666
+ * Input-token fee position rule: user holds USDC BEFORE deposit
667
+ * (token-availability), so charge there.
605
668
  */
606
669
  gasFeeUsdc?: bigint;
607
670
  gasFeeUsdcRecipient?: Address;
@@ -660,12 +723,10 @@ declare function rawCallOp(target: Address, data: `0x${string}`, value?: bigint)
660
723
  *
661
724
  * Function name is `executeBatch` (selector `0x34fcd5be`) to match
662
725
  * Pimlico's `Simple7702Account` — the EIP-7702 delegate impl PAFI
663
- * pins on Base mainnet as of v1.4 (replaced an earlier Coinbase Smart
664
- * Wallet v2 trial). The shorter `execute(Call[])` (selector
665
- * `0x3f707e6b`) only exists on legacy/standalone batch executor
666
- * contracts; calling it on a 7702 delegated EOA falls through to the
667
- * fallback function and reverts with "account: not from EntryPoint"
668
- * (AA23).
726
+ * pins on Base mainnet. The shorter `execute(Call[])` (selector
727
+ * `0x3f707e6b`) only exists on standalone batch executor contracts;
728
+ * calling it on a 7702 delegated EOA falls through to the fallback
729
+ * function and reverts with "account: not from EntryPoint" (AA23).
669
730
  */
670
731
  declare const BATCH_EXECUTOR_ABI: readonly [{
671
732
  readonly name: "executeBatch";
@@ -869,25 +930,23 @@ declare function computeUserOpHash(userOp: Parameters<typeof buildUserOpTypedDat
869
930
  * `pm_sponsorUserOperation` simulation accepts.
870
931
  *
871
932
  * Current primary impl is `simple7702` (Pimlico's `Simple7702Account`).
872
- * `batchExecutor` is retained for transition / back-compat with EOAs
873
- * that delegated to the earlier Coinbase Smart Wallet v2 BatchExecutor
874
- * (trialled before v1.4 Pimlico became the canonical impl on
875
- * 2026-04-27 due to a Coinbase SignatureWrapper incompatibility that
876
- * caused AA23 0x3c10b94e during validateUserOp).
933
+ * `batchExecutor` is retained for back-compat with EOAs that delegated
934
+ * to an earlier Coinbase Smart Wallet v2 BatchExecutor — Pimlico is
935
+ * the canonical impl now (the Coinbase SignatureWrapper format caused
936
+ * AA23 0x3c10b94e during validateUserOp).
877
937
  */
878
938
  type DelegateImpl = "simple7702" | "batchExecutor" | "unknown";
879
939
  /**
880
940
  * Pimlico's `Simple7702Account` implementation address on Base mainnet —
881
- * the canonical PAFI delegation target as of v1.4 (2026-04-27).
882
- * Used by `permissionless.to7702SimpleSmartAccount`.
941
+ * the canonical PAFI delegation target. Used by
942
+ * `permissionless.to7702SimpleSmartAccount`.
883
943
  */
884
944
  declare const SIMPLE_7702_IMPL_BASE_MAINNET: Address;
885
945
  /**
886
- * Legacy Coinbase Smart Wallet v2 BatchExecutor — PAFI's pre-v1.4
887
- * delegation target. Same on Base mainnet + Base Sepolia. Detected
888
- * here so EOAs that delegated to this address before the v1.4 cutover
889
- * still pass the impl check; new delegations should target
890
- * {@link SIMPLE_7702_IMPL_BASE_MAINNET} instead.
946
+ * Legacy Coinbase Smart Wallet v2 BatchExecutor — an earlier PAFI
947
+ * delegation target. Same on Base mainnet + Base Sepolia. Detected here
948
+ * so EOAs that delegated to this address still pass the impl check;
949
+ * new delegations should target {@link SIMPLE_7702_IMPL_BASE_MAINNET}.
891
950
  */
892
951
  declare const BATCH_EXECUTOR_7702_IMPL: Address;
893
952
  /**
@@ -923,11 +982,11 @@ declare function getDummySignatureFor7702(impl: DelegateImpl): Hex;
923
982
 
924
983
  /**
925
984
  * Module-level paymaster config shared by all batch builders and the
926
- * `@pafi/issuer` RelayService. Holds the fee recipient address and the
985
+ * `@pafi-dev/issuer` RelayService. Holds the fee recipient address and the
927
986
  * PAFI-assigned issuer identity.
928
987
  *
929
- * v1.4 update: the paymaster endpoint is **PAFI Backend**, which proxies
930
- * to PAFI sponsor-relayer. See [SPONSORED_PATH_FLOW.md].
988
+ * The paymaster endpoint is **PAFI Backend**, which proxies to PAFI
989
+ * sponsor-relayer. See [SPONSORED_PATH_FLOW.md].
931
990
  */
932
991
  interface PaymasterConfig {
933
992
  /**
@@ -957,23 +1016,6 @@ interface PaymasterConfig {
957
1016
  */
958
1017
  type SponsorshipScenario = "mint" | "burn" | "swap" | "perp-deposit" | "delegate";
959
1018
 
960
- /**
961
- * @deprecated v0.7.1 — see file comment.
962
- *
963
- * Set the application-wide paymaster config. Safe to call multiple
964
- * times (later calls override earlier). Throws if required fields
965
- * are missing.
966
- */
967
- declare function setPaymasterConfig(config: PaymasterConfig): void;
968
- /**
969
- * @deprecated v0.7.1 — see file comment.
970
- */
971
- declare function getPaymasterConfig(): PaymasterConfig;
972
- /** Test helper — clear the singleton. */
973
- declare function _resetPaymasterConfigForTests(): void;
974
- /** Check whether paymaster config has been initialized. */
975
- declare function isPaymasterConfigured(): boolean;
976
-
977
1019
  /**
978
1020
  * Submission path chosen by `checkEthAndBranch`.
979
1021
  * - `normal`: initiator has enough ETH; submit via `walletClient.writeContract`
@@ -1009,6 +1051,42 @@ interface CheckEthAndBranchParams {
1009
1051
  */
1010
1052
  declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<SubmissionPath>;
1011
1053
 
1054
+ /**
1055
+ * Encode a V3 swap path as packed bytes, oriented input→output:
1056
+ * `tokens[0] ‖ fees[0] ‖ tokens[1] ‖ fees[1] ‖ … ‖ tokens[N]`
1057
+ *
1058
+ * Each address is 20 bytes; each fee is uint24 (3 bytes). For an N-hop
1059
+ * swap the result is `(N + 1) * 20 + N * 3` bytes.
1060
+ *
1061
+ * For exact-output quoting the Quoter walks the path output→input —
1062
+ * reverse the underlying `tokens` and `fees` arrays before calling this
1063
+ * encoder (or use `encodeV3PathReversed`).
1064
+ *
1065
+ * @throws if `tokens.length !== fees.length + 1` or any input is malformed.
1066
+ */
1067
+ declare function encodeV3Path(path: V3Path): Hex;
1068
+ /**
1069
+ * Encode the same path reversed (output→input). Convenience used by
1070
+ * exact-output quoting and exact-output swap-builder paths.
1071
+ */
1072
+ declare function encodeV3PathReversed(path: V3Path): Hex;
1073
+ /**
1074
+ * Compute a V3 pool address deterministically from factory + initCodeHash.
1075
+ *
1076
+ * Uses the standard Uniswap V3 derivation:
1077
+ * `keccak256(0xff ‖ factory ‖ keccak256(abi.encode(token0, token1, fee)) ‖ initCodeHash)`
1078
+ *
1079
+ * Tokens are sorted ascending — the helper accepts them in any order.
1080
+ * Returns a checksummed address.
1081
+ */
1082
+ declare function computeV3PoolAddress(params: {
1083
+ factory: Address;
1084
+ tokenA: Address;
1085
+ tokenB: Address;
1086
+ fee: number;
1087
+ initCodeHash: Hex;
1088
+ }): Address;
1089
+
1012
1090
  /**
1013
1091
  * Parse the implementation address out of an EIP-7702 delegation designator.
1014
1092
  *
@@ -1609,57 +1687,44 @@ declare const BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: `0x${string}`;
1609
1687
  declare const BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: `0x${string}`;
1610
1688
 
1611
1689
  /**
1612
- * Per-chain deployed contract addresses — v1.6 flow.
1613
- *
1614
- * ## Status (2026-05-07)
1690
+ * Per-chain deployed contract addresses.
1615
1691
  *
1616
- * Base mainnet (8453): v1.6 redeploy. PAFIHook removed entirely fee on
1617
- * mint now happens via `MintFeeWrapper` (single global instance, multi-PT).
1618
- * `pafiHook` field kept as placeholder for back-compat with consumers that
1619
- * still reference it; set to a deterministic dead address to make misuse
1620
- * obvious.
1692
+ * Base mainnet (8453): live deployment. Fee on mint happens via
1693
+ * `MintFeeWrapper` (single global instance, multi-PT).
1621
1694
  *
1622
1695
  * Base Sepolia (84532): entire row is placeholder — not in active use.
1623
1696
  *
1624
1697
  * ## What lives where
1625
1698
  *
1626
- * pointToken — DEAD legacy field (per-issuer, not chain-level).
1627
- * Each issuer's clone is configured via env or
1628
- * resolved from PointTokenFactory at runtime. Set
1629
- * to a deterministic dead address so misuse fails
1630
- * loudly. Will be removed when downstream consumers
1631
- * stop referencing it.
1632
1699
  * batchExecutor — EIP-7702 delegation target (Pimlico Simple7702Account)
1633
- * usdt — MockERC20 used by Uniswap pools
1700
+ * usdt — Stablecoin used by Uniswap pools
1634
1701
  * issuerRegistry — registry of all issuers on this chain
1635
- * mintingOracle — per-token mint cap enforcer (v1.6: per-token, not per-issuer)
1636
- * mintFeeWrapper — v1.6 mint-time fee splitter (single global instance)
1637
- * pafiHook DEAD; v1.5 V4 swap fee removed in v1.6. Kept for ABI compat.
1702
+ * mintingOracle — per-token mint cap enforcer
1703
+ * mintFeeWrapper — mint-time fee splitter (single global instance)
1704
+ * chainlinkEthUsd ETH/USD price feed used by FeeManager
1705
+ * orderlyRelay — Orderly perp-deposit Relay
1706
+ * pafiFeeRecipient — PAFI-controlled fee recipient (sponsored gas reimbursement)
1707
+ * universalRouter — Uniswap V4 swap entry point
1708
+ *
1709
+ * PointToken addresses are per-issuer and resolved from the issuer's
1710
+ * config (env / DB / PointTokenFactory readout). PointTokenFactory and
1711
+ * the PointToken implementation live in separate exports below.
1638
1712
  *
1639
- * PointTokenFactory + PointToken implementation addresses live in
1640
- * separate exports below — they're only needed at provisioning /
1641
- * observability time, not in the hot mint/burn path, so excluded from
1642
- * the per-chain bundle.
1713
+ * Fee logic lives in `MintFeeWrapper` on the mint path; swaps are
1714
+ * hook-free (`hooks = address(0)`).
1643
1715
  */
1644
1716
  interface ContractAddresses {
1645
- pointToken: Address;
1646
1717
  batchExecutor: Address;
1647
1718
  usdt: Address;
1648
1719
  issuerRegistry: Address;
1649
1720
  mintingOracle: Address;
1650
1721
  /**
1651
- * v1.6 — single-instance MintFeeWrapper that skims a fee on every
1652
- * sig-gated mint and distributes across the registered recipient
1653
- * list for the target PointToken. Issuers route mints through this
1654
- * by passing `mintFeeWrapperAddress` to `prepareMint`.
1722
+ * Single-instance MintFeeWrapper that skims a fee on every sig-gated
1723
+ * mint and distributes across the registered recipient list for the
1724
+ * target PointToken. Issuers route mints through this by passing
1725
+ * `mintFeeWrapperAddress` to `prepareMint`.
1655
1726
  */
1656
1727
  mintFeeWrapper: Address;
1657
- /**
1658
- * @deprecated v1.5 PAFIHook (10% PT→USDT swap fee) was removed in
1659
- * v1.6. Field kept as a dead placeholder so older consumers don't
1660
- * crash on missing-property errors; do not use for new code.
1661
- */
1662
- pafiHook: Address;
1663
1728
  /** Chainlink ETH/USD price feed — used by FeeManager to convert gas cost to USDT. */
1664
1729
  chainlinkEthUsd: Address;
1665
1730
  /**
@@ -1743,14 +1808,14 @@ declare function getPafiServiceUrls(chainId: number): PafiServiceUrls;
1743
1808
  * `./eip712/` and are re-exported from the package root — not duplicated
1744
1809
  * here.
1745
1810
  *
1746
- * ## v1.4 flow no Relayer, sig-gated mint/burn
1811
+ * ## Sig-gated mint / burn (no Relayer contract)
1747
1812
  *
1748
- * Relayer contract dropped. Users call `PointToken.mint(to, amount,
1749
- * deadline, minterSig)` directly via an EIP-7702 delegated UserOp —
1750
- * `msg.sender == user == to`. `minterSig` is an EIP-712 `MintRequest`
1751
- * signed off-chain by the issuer's minter signer (HSM/KMS). Mirror
1752
- * structure on the burn side with `BurnRequest` + `burn(from, amount,
1753
- * deadline, burnerSig)`.
1813
+ * Users call `PointToken.mint(to, amount, deadline, minterSig)`
1814
+ * directly via an EIP-7702 delegated UserOp — `msg.sender == user
1815
+ * == to`. `minterSig` is an EIP-712 `MintRequest` signed off-chain
1816
+ * by the issuer's minter signer (HSM/KMS). Mirror structure on the
1817
+ * burn side with `BurnRequest` + `burn(from, amount, deadline,
1818
+ * burnerSig)`.
1754
1819
  *
1755
1820
  * Exports:
1756
1821
  * - `POINT_TOKEN_V2_ABI` — full mint + burn + admin surface
@@ -1768,8 +1833,8 @@ declare function getPafiServiceUrls(chainId: number): PafiServiceUrls;
1768
1833
 
1769
1834
  /**
1770
1835
  * Signature struct — kept for consumers that want the tuple form.
1771
- * Most v1.4 paths pass `bytes` (serialized signature) directly to the
1772
- * contract; this struct is only needed if you're manually splitting
1836
+ * The canonical paths pass `bytes` (serialized signature) directly to
1837
+ * the contract; this struct is only needed if you're manually splitting
1773
1838
  * for other on-chain verifiers.
1774
1839
  */
1775
1840
  interface SignatureStruct {
@@ -1961,23 +2026,25 @@ declare function getPafiWebModalAdapter(): PafiWebModalAdapter | null;
1961
2026
  declare function openPafiWebModal(url: string, options?: ModalOpenOptions): Promise<PafiWebModalHandle>;
1962
2027
 
1963
2028
  /**
1964
- * PAFI-hosted subgraph endpoint — single source of truth across all SDK packages.
2029
+ * PAFI-hosted subgraph endpoint — single source of truth across all
2030
+ * SDK packages.
1965
2031
  *
1966
- * v3 (deployed 2026-05-08) indexes the v1.6 contract redeploy starting at
1967
- * block 45683465 IssuerRegistry/PointTokenFactory/MintingOracle/MintFeeWrapper
1968
- * (single global wrapper instance, replaces v1.5 PAFIHook). Schema additions:
1969
- * `MintFeeWrapper`, `MintFeeConfig`, `FeeRecipient`, `MintWithFeeEvent`,
1970
- * `FeeDistribution`. v2 endpoint is kept live as rollback for ~1 week before
1971
- * removal.
2032
+ * Indexes IssuerRegistry, PointTokenFactory, MintingOracle, and
2033
+ * MintFeeWrapper. Schema entities: `MintFeeWrapper`, `MintFeeConfig`,
2034
+ * `FeeRecipient`, `MintWithFeeEvent`, `FeeDistribution`.
1972
2035
  */
1973
- declare const PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-v3";
2036
+ declare const PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-v4";
1974
2037
  /**
1975
- * Fetch the Uniswap V4 pool(s) for a PAFI PointToken from the subgraph.
2038
+ * Fetch the Uniswap V3 pool(s) for a PAFI PointToken from the subgraph.
1976
2039
  *
1977
2040
  * Browser and Node compatible — uses globalThis.fetch. Returns an empty
1978
2041
  * array (never throws) when the token has no pool yet or the subgraph is
1979
2042
  * unreachable, so callers can show "quote unavailable" without crashing.
1980
2043
  *
2044
+ * Tolerates subgraph responses still carrying the V4-era `tickSpacing`
2045
+ * and `hooks` fields — those are silently ignored. Subgraph migration
2046
+ * can land independently of the SDK migration.
2047
+ *
1981
2048
  * @param chainId - Chain ID (reserved for multi-subgraph routing; currently unused)
1982
2049
  * @param pointTokenAddress - The PointToken contract address
1983
2050
  * @param subgraphUrl - Override the default PAFI subgraph URL
@@ -2037,11 +2104,11 @@ declare class PafiSDK {
2037
2104
  message: MintRequest;
2038
2105
  }>;
2039
2106
  signMintRequest(message: MintRequest): Promise<EIP712Signature>;
2040
- verifyMintRequest(message: MintRequest, signature: Hex, expectedMinter: Address): Promise<SignatureVerification>;
2107
+ verifyMintRequest(message: MintRequest, signature: Hex, expectedMinter: Address, options?: SignatureVerifyOptions): Promise<SignatureVerification>;
2041
2108
  getMintRequestNonce(receiver: Address): Promise<bigint>;
2042
2109
  createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
2043
2110
  /** Sign a login message string with the current signer (personal_sign) */
2044
2111
  signLoginMessage(message: string): Promise<Hex>;
2045
2112
  }
2046
2113
 
2047
- export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, SDK_ERROR_HTTP_STATUS_CODE, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, defaultErrorTypeForStatus, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
2114
+ export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, QUOTER_V2_ADDRESSES, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, SDK_ERROR_HTTP_STATUS_CODE, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, SignatureVerifyOptions, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V3Path, V3_FACTORY_ADDRESSES, V3_POOL_INIT_CODE_HASH, V3_SWAP_ROUTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, computeV3PoolAddress, createPafiProxyTransport, decodeBatchExecuteCalls, defaultErrorTypeForStatus, delegateDirect, detectDelegateImpl, encodeBatchExecute, encodeV3Path, encodeV3PathReversed, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, isDelegatedTo, isDelegatedToTarget, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, splitAuthorizationSig, webPopupAdapter };