@pafi-dev/core 0.19.0 → 0.22.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 (57) hide show
  1. package/README.md +100 -8
  2. package/dist/abi/index.cjs +14 -4
  3. package/dist/abi/index.cjs.map +1 -1
  4. package/dist/abi/index.d.cts +3846 -482
  5. package/dist/abi/index.d.ts +3846 -482
  6. package/dist/abi/index.js +15 -5
  7. package/dist/{chunk-KRHGFUDI.cjs → chunk-245YA3CQ.cjs} +87 -20
  8. package/dist/chunk-245YA3CQ.cjs.map +1 -0
  9. package/dist/{chunk-C7VB6WTL.cjs → chunk-2CU7ZH2A.cjs} +490 -497
  10. package/dist/chunk-2CU7ZH2A.cjs.map +1 -0
  11. package/dist/chunk-2DVM77Y2.cjs +5018 -0
  12. package/dist/chunk-2DVM77Y2.cjs.map +1 -0
  13. package/dist/{chunk-UZUDJXKE.cjs → chunk-3ZT7KTN4.cjs} +5 -3
  14. package/dist/chunk-3ZT7KTN4.cjs.map +1 -0
  15. package/dist/{chunk-H3X3FYUU.js → chunk-4VPIPVV5.js} +62 -35
  16. package/dist/chunk-4VPIPVV5.js.map +1 -0
  17. package/dist/{chunk-UCO5DXD6.js → chunk-5Y7MGN56.js} +87 -20
  18. package/dist/chunk-5Y7MGN56.js.map +1 -0
  19. package/dist/chunk-DQKCPH6B.cjs +199 -0
  20. package/dist/chunk-DQKCPH6B.cjs.map +1 -0
  21. package/dist/{chunk-4TNHRZ4X.js → chunk-K4GBOB5V.js} +4 -2
  22. package/dist/chunk-K4GBOB5V.js.map +1 -0
  23. package/dist/{chunk-LF5GIN5P.js → chunk-W2DHHR2N.js} +490 -497
  24. package/dist/chunk-W2DHHR2N.js.map +1 -0
  25. package/dist/chunk-ZQVYWMOG.js +5018 -0
  26. package/dist/chunk-ZQVYWMOG.js.map +1 -0
  27. package/dist/contract/index.cjs +8 -4
  28. package/dist/contract/index.cjs.map +1 -1
  29. package/dist/contract/index.d.cts +53 -27
  30. package/dist/contract/index.d.ts +53 -27
  31. package/dist/contract/index.js +13 -9
  32. package/dist/eip712/index.cjs +3 -3
  33. package/dist/eip712/index.d.cts +7 -1
  34. package/dist/eip712/index.d.ts +7 -1
  35. package/dist/eip712/index.js +2 -2
  36. package/dist/index.cjs +174 -24
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +604 -10
  39. package/dist/index.d.ts +604 -10
  40. package/dist/index.js +174 -24
  41. package/dist/index.js.map +1 -1
  42. package/dist/{types-C17pznGz.d.ts → types-Hn1zUPTt.d.cts} +46 -13
  43. package/dist/{types-C17pznGz.d.cts → types-Hn1zUPTt.d.ts} +46 -13
  44. package/package.json +12 -12
  45. package/dist/chunk-4TNHRZ4X.js.map +0 -1
  46. package/dist/chunk-C7VB6WTL.cjs.map +0 -1
  47. package/dist/chunk-H3X3FYUU.js.map +0 -1
  48. package/dist/chunk-KRHGFUDI.cjs.map +0 -1
  49. package/dist/chunk-LF5GIN5P.js.map +0 -1
  50. package/dist/chunk-TRYGIC2I.cjs +0 -172
  51. package/dist/chunk-TRYGIC2I.cjs.map +0 -1
  52. package/dist/chunk-UCO5DXD6.js.map +0 -1
  53. package/dist/chunk-UZUDJXKE.cjs.map +0 -1
  54. package/dist/chunk-XXLIIWIF.cjs +0 -711
  55. package/dist/chunk-XXLIIWIF.cjs.map +0 -1
  56. package/dist/chunk-ZJXXCG5P.js +0 -711
  57. package/dist/chunk-ZJXXCG5P.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,15 +1,26 @@
1
1
  import { Address, Hex, TypedDataDomain, PublicClient, WalletClient, TransactionReceipt, HttpTransport } from 'viem';
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_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v3QuoterV2Abi } 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-Hn1zUPTt.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, o as Source } from './types-Hn1zUPTt.cjs';
4
+ export { erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointModuleCoreAbi, pointTokenAbi, pointTokenFactoryAbi, settlementVaultAbi, tokenRegistryAbi, universalRouterAbi, v3QuoterV2Abi, vaultFactoryAbi, vaultRegistryAbi } from './abi/index.cjs';
5
5
  export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, signBurnRequest, signMintRequest, verifyBurnRequest, verifyMintRequest } from './eip712/index.cjs';
6
- export { getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getTokenCap, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.cjs';
6
+ export { computeEquityCap, getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getOracleRegistries, getPointTokenBalance, getPointTokenIssuerAddress, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyEquityMint, verifyIssuerOperative, verifyMint } 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
11
  * EIP-712 typed data for the sig-gated mint path.
12
12
  *
13
+ * V2 dual-bucket — adds `source` (uint8) so the on-chain digest matches
14
+ * `MintForRequest(address user,address receiver,uint256 amount,uint8 source,uint256 nonce,uint256 deadline)`.
15
+ * Source values per `IPointToken.Source`:
16
+ * 0 = EQUITY (mint backed by issuer's declared capital)
17
+ * 1 = VAULT (mint backed by LP collateral in SettlementVault)
18
+ *
19
+ * SDK helpers `signMintRequest` / `prepareMint` hardcode `source = 0`
20
+ * (EQUITY). VAULT minting is contract-ready but no SDK writer ships it
21
+ * until the LP/admin dashboard lands; sponsor-relayer fails closed on
22
+ * `source != EQUITY` for the same reason.
23
+ *
13
24
  * Contract enforces:
14
25
  * - msg.sender == receiver (the on-chain caller of `mint`)
15
26
  * - nonce == mintRequestNonces[user] (per-user nonce stream)
@@ -29,6 +40,9 @@ declare const mintRequestTypes: {
29
40
  }, {
30
41
  readonly name: "amount";
31
42
  readonly type: "uint256";
43
+ }, {
44
+ readonly name: "source";
45
+ readonly type: "uint8";
32
46
  }, {
33
47
  readonly name: "nonce";
34
48
  readonly type: "uint256";
@@ -37,6 +51,13 @@ declare const mintRequestTypes: {
37
51
  readonly type: "uint256";
38
52
  }];
39
53
  };
54
+ /**
55
+ * EIP-712 typed data for the sig-gated burn path. V2 adds `source`
56
+ * (uint8) to match the contract's 6-field digest:
57
+ * `BurnRequest(address from,uint256 amount,uint8 source,uint256 nonce,uint256 deadline)`
58
+ *
59
+ * Same EQUITY-only policy as `mintRequestTypes`.
60
+ */
40
61
  declare const burnRequestTypes: {
41
62
  readonly BurnRequest: readonly [{
42
63
  readonly name: "from";
@@ -44,6 +65,9 @@ declare const burnRequestTypes: {
44
65
  }, {
45
66
  readonly name: "amount";
46
67
  readonly type: "uint256";
68
+ }, {
69
+ readonly name: "source";
70
+ readonly type: "uint8";
47
71
  }, {
48
72
  readonly name: "nonce";
49
73
  readonly type: "uint256";
@@ -1475,6 +1499,87 @@ interface DelegateDirectResult {
1475
1499
  */
1476
1500
  declare function delegateDirect(params: DelegateDirectParams): Promise<DelegateDirectResult>;
1477
1501
 
1502
+ interface AttachDelegationIfNeededParams {
1503
+ /**
1504
+ * Public client connected to the chain on which the delegation lives.
1505
+ * The helper uses it to (1) read on-chain code via `eth_getCode` and
1506
+ * (2) read the EOA's tx nonce — both reads must hit the SAME chain
1507
+ * that `chainId` declares, otherwise Pimlico's bundler will reject the
1508
+ * authorization with a chain-mismatch error.
1509
+ */
1510
+ rpc: PublicClient;
1511
+ /**
1512
+ * The user's EOA — the wallet that will become a temporary smart account
1513
+ * via EIP-7702 SetCode. MUST match the `sender` of the UserOp the caller
1514
+ * is about to submit; otherwise the bundler's recovered-signer check
1515
+ * fails ("recovered signer does not match userOperation sender").
1516
+ */
1517
+ account: Address;
1518
+ /**
1519
+ * The implementation address the EOA should delegate to — typically the
1520
+ * Pimlico Simple7702Account / BatchExecutor on the target chain (Base
1521
+ * mainnet: `0xe6Cae83BdE06E4c305530e199D7217f42808555B`).
1522
+ *
1523
+ * The helper compares the on-chain code at `account` against this address.
1524
+ * Mismatch → sign a new authorization to switch the delegate. Match →
1525
+ * return `undefined` (caller passes nothing — extra auth would be wasted
1526
+ * gas + the bundler may reject redundant authorizations).
1527
+ */
1528
+ expectedDelegate: Address;
1529
+ /**
1530
+ * Chain id baked into the EIP-7702 authorization tuple. Must equal the
1531
+ * chain `rpc` connects to.
1532
+ */
1533
+ chainId: number;
1534
+ /**
1535
+ * Privy-shaped authorization signer. Pass `useSign7702Authorization().signAuthorization`
1536
+ * directly on web, or the Expo SDK's equivalent on mobile.
1537
+ *
1538
+ * The helper feeds it `(contractAddress, chainId, nonce)` — the signer
1539
+ * MUST sign with the same private key that controls `account`, otherwise
1540
+ * the recovered signer mismatch above triggers.
1541
+ */
1542
+ signAuthorization: SignAuthorizationFn;
1543
+ }
1544
+ /**
1545
+ * Sign an EIP-7702 authorization for `account` ONLY when the EOA does not
1546
+ * already delegate to `expectedDelegate`. Returns the authorization in the
1547
+ * shape that permissionless / viem expect on
1548
+ * `smartClient.sendTransaction({ authorization, ... })`. Pimlico bundles
1549
+ * the SetCode + UserOp execution into a SINGLE bundler tx — "atomic
1550
+ * activation" — so the user never sees a separate "delegate" step on their
1551
+ * first action.
1552
+ *
1553
+ * Returns `undefined` when the EOA already points at `expectedDelegate`.
1554
+ * Caller spreads the return value into the tx params:
1555
+ *
1556
+ * ```ts
1557
+ * const authPart = await attachDelegationIfNeeded({ ... });
1558
+ * await smartClient.sendTransaction({
1559
+ * to: pointToken,
1560
+ * data: encodeMintCalldata(amount),
1561
+ * ...(authPart ?? {}), // attaches { authorization: ... } only when needed
1562
+ * });
1563
+ * ```
1564
+ *
1565
+ * Cost: 1 `eth_getCode` read every time + 1 `eth_getTransactionCount` +
1566
+ * 1 signature (only the first time per EOA). Subsequent calls collapse to
1567
+ * a single RPC read and return `undefined` — cheap to call before every
1568
+ * UserOp.
1569
+ *
1570
+ * Implementation notes:
1571
+ * - Comparison is case-insensitive (`isDelegatedTo` lowercases both
1572
+ * sides) so passing checksum-cased addresses is safe.
1573
+ * - Nonce is fetched freshly per call to avoid replaying an old nonce
1574
+ * when the FE held the helper params across multiple actions.
1575
+ * - The signed tuple is passed through `buildEip7702Authorization` to
1576
+ * normalise `r` / `s` / `yParity` into the wire shape Pimlico accepts
1577
+ * (handles Privy's bigint `v` and string-hex `yParity` variants).
1578
+ */
1579
+ declare function attachDelegationIfNeeded(params: AttachDelegationIfNeededParams): Promise<{
1580
+ authorization: Eip7702AuthorizationJsonRpc;
1581
+ } | undefined>;
1582
+
1478
1583
  /**
1479
1584
  * Parameters for `createPafiProxyTransport`.
1480
1585
  */
@@ -1781,6 +1886,441 @@ interface QuoteOperatorFeeForTransferConfig extends Omit<QuoteOperatorFeeUsdtCon
1781
1886
  }
1782
1887
  declare function quoteOperatorFeeForTransfer(config: QuoteOperatorFeeForTransferConfig): Promise<bigint>;
1783
1888
 
1889
+ /**
1890
+ * Real `PointToken` ABI — matches the V2 dual-bucket PointToken on
1891
+ * Base. Each issuer's clone is per-deploy, created via
1892
+ * `PointTokenFactory.createToken()`. ABI sourced from the Solidity
1893
+ * contract shipped by the SC team (Pacific-Finance-Lab/PAFI-Point-module-sc).
1894
+ *
1895
+ * ## V2 Source enum
1896
+ *
1897
+ * Every mint and burn now requires a `Source` argument:
1898
+ * 0 = EQUITY — issuer's declared capital
1899
+ * 1 = VAULT — LP collateral in SettlementVault
1900
+ *
1901
+ * SDK helpers + sponsor-relayer hardcode / enforce `source = EQUITY`
1902
+ * until the VAULT writer surface lands.
1903
+ *
1904
+ * ## Mint — two paths
1905
+ *
1906
+ * Path 1 — Direct (whitelisted minter):
1907
+ * mint(address to, uint256 amount, uint8 source)
1908
+ * - msg.sender must be in minters[]
1909
+ * - Used by off-chain services that hold a minter key
1910
+ *
1911
+ * Path 2 — Sig-gated (sponsored flow):
1912
+ * mint(address user, uint256 amount, uint8 source, uint256 deadline, bytes minterSig)
1913
+ * - msg.sender MUST equal `user` (the receiver)
1914
+ * - minterSig is an EIP-712 MintForRequest signature from a whitelisted minter
1915
+ * - Consumes `mintRequestNonces[user]`
1916
+ * - Canonical PAFI path: issuer backend signs, user submits via
1917
+ * EIP-7702 + PAFI sponsor-relayer
1918
+ *
1919
+ * ## Burn — mirror structure
1920
+ *
1921
+ * Path 1: burn(address from, uint256 amount, uint8 source) — whitelisted burner
1922
+ * Path 2: burn(address from, uint256 amount, uint8 source, uint256 deadline, bytes burnerSig)
1923
+ * — msg.sender must equal `from`, burnerSig from whitelisted burner,
1924
+ * consumes `burnRequestNonces[from]`
1925
+ *
1926
+ * Either burn path emits `Transfer(from → 0x0)` so BurnIndexer semantics
1927
+ * don't depend on which path was taken. Bucket-specific underflow
1928
+ * surfaces as `BucketUnderflow(source, amount, available)`.
1929
+ *
1930
+ * ## EIP-712 type hashes (V2 — from contract source)
1931
+ *
1932
+ * MintForRequest(address user,address receiver,uint256 amount,uint8 source,uint256 nonce,uint256 deadline)
1933
+ * BurnRequest(address from,uint256 amount,uint8 source,uint256 nonce,uint256 deadline)
1934
+ *
1935
+ * `user` drives the `mintRequestNonces[user]` stream; `receiver ==
1936
+ * msg.sender` of `mint()` (= user for direct, = MintFeeWrapper for
1937
+ * wrapper-mediated mints).
1938
+ *
1939
+ * Domain: EIP-712 standard — name = ERC-20 token name, version = "1",
1940
+ * chainId, verifyingContract = this PointToken address.
1941
+ */
1942
+ /**
1943
+ * Single-signature ABI for the sig-gated mint (the canonical PAFI
1944
+ * sponsored path). Split out from `POINT_TOKEN_ABI` because viem's
1945
+ * type-level overload resolution on `encodeFunctionData({abi, functionName:"mint", args:[...]})`
1946
+ * cannot unambiguously pick between the 3-arg direct path and the
1947
+ * 5-arg sig-gated path when both share the `mint` name. Callers that
1948
+ * need to ENCODE the sig-gated mint should use this ABI; ABI reads
1949
+ * (e.g. balance views) keep `POINT_TOKEN_ABI`.
1950
+ */
1951
+ declare const POINT_TOKEN_MINT_SIG_ABI: readonly [{
1952
+ readonly name: "mint";
1953
+ readonly type: "function";
1954
+ readonly stateMutability: "nonpayable";
1955
+ readonly inputs: readonly [{
1956
+ readonly type: "address";
1957
+ readonly name: "user";
1958
+ }, {
1959
+ readonly type: "uint256";
1960
+ readonly name: "amount";
1961
+ }, {
1962
+ readonly type: "uint8";
1963
+ readonly name: "source";
1964
+ }, {
1965
+ readonly type: "uint256";
1966
+ readonly name: "deadline";
1967
+ }, {
1968
+ readonly type: "bytes";
1969
+ readonly name: "minterSig";
1970
+ }];
1971
+ readonly outputs: readonly [];
1972
+ }];
1973
+ /** Sig-gated burn ABI — see `POINT_TOKEN_MINT_SIG_ABI` rationale. */
1974
+ declare const POINT_TOKEN_BURN_SIG_ABI: readonly [{
1975
+ readonly name: "burn";
1976
+ readonly type: "function";
1977
+ readonly stateMutability: "nonpayable";
1978
+ readonly inputs: readonly [{
1979
+ readonly type: "address";
1980
+ readonly name: "from";
1981
+ }, {
1982
+ readonly type: "uint256";
1983
+ readonly name: "amount";
1984
+ }, {
1985
+ readonly type: "uint8";
1986
+ readonly name: "source";
1987
+ }, {
1988
+ readonly type: "uint256";
1989
+ readonly name: "deadline";
1990
+ }, {
1991
+ readonly type: "bytes";
1992
+ readonly name: "burnerSig";
1993
+ }];
1994
+ readonly outputs: readonly [];
1995
+ }];
1996
+ declare const POINT_TOKEN_ABI: readonly [{
1997
+ readonly name: "mint";
1998
+ readonly type: "function";
1999
+ readonly stateMutability: "nonpayable";
2000
+ readonly inputs: readonly [{
2001
+ readonly type: "address";
2002
+ readonly name: "to";
2003
+ }, {
2004
+ readonly type: "uint256";
2005
+ readonly name: "amount";
2006
+ }, {
2007
+ readonly type: "uint8";
2008
+ readonly name: "source";
2009
+ }];
2010
+ readonly outputs: readonly [];
2011
+ }, {
2012
+ readonly name: "mint";
2013
+ readonly type: "function";
2014
+ readonly stateMutability: "nonpayable";
2015
+ readonly inputs: readonly [{
2016
+ readonly type: "address";
2017
+ readonly name: "user";
2018
+ }, {
2019
+ readonly type: "uint256";
2020
+ readonly name: "amount";
2021
+ }, {
2022
+ readonly type: "uint8";
2023
+ readonly name: "source";
2024
+ }, {
2025
+ readonly type: "uint256";
2026
+ readonly name: "deadline";
2027
+ }, {
2028
+ readonly type: "bytes";
2029
+ readonly name: "minterSig";
2030
+ }];
2031
+ readonly outputs: readonly [];
2032
+ }, {
2033
+ readonly name: "burn";
2034
+ readonly type: "function";
2035
+ readonly stateMutability: "nonpayable";
2036
+ readonly inputs: readonly [{
2037
+ readonly type: "address";
2038
+ readonly name: "from";
2039
+ }, {
2040
+ readonly type: "uint256";
2041
+ readonly name: "amount";
2042
+ }, {
2043
+ readonly type: "uint8";
2044
+ readonly name: "source";
2045
+ }];
2046
+ readonly outputs: readonly [];
2047
+ }, {
2048
+ readonly name: "burn";
2049
+ readonly type: "function";
2050
+ readonly stateMutability: "nonpayable";
2051
+ readonly inputs: readonly [{
2052
+ readonly type: "address";
2053
+ readonly name: "from";
2054
+ }, {
2055
+ readonly type: "uint256";
2056
+ readonly name: "amount";
2057
+ }, {
2058
+ readonly type: "uint8";
2059
+ readonly name: "source";
2060
+ }, {
2061
+ readonly type: "uint256";
2062
+ readonly name: "deadline";
2063
+ }, {
2064
+ readonly type: "bytes";
2065
+ readonly name: "burnerSig";
2066
+ }];
2067
+ readonly outputs: readonly [];
2068
+ }, {
2069
+ readonly name: "equitySupply";
2070
+ readonly type: "function";
2071
+ readonly stateMutability: "view";
2072
+ readonly inputs: readonly [];
2073
+ readonly outputs: readonly [{
2074
+ readonly type: "uint256";
2075
+ }];
2076
+ }, {
2077
+ readonly name: "vaultSupply";
2078
+ readonly type: "function";
2079
+ readonly stateMutability: "view";
2080
+ readonly inputs: readonly [];
2081
+ readonly outputs: readonly [{
2082
+ readonly type: "uint256";
2083
+ }];
2084
+ }, {
2085
+ readonly name: "minters";
2086
+ readonly type: "function";
2087
+ readonly stateMutability: "view";
2088
+ readonly inputs: readonly [{
2089
+ readonly type: "address";
2090
+ readonly name: "account";
2091
+ }];
2092
+ readonly outputs: readonly [{
2093
+ readonly type: "bool";
2094
+ }];
2095
+ }, {
2096
+ readonly name: "burners";
2097
+ readonly type: "function";
2098
+ readonly stateMutability: "view";
2099
+ readonly inputs: readonly [{
2100
+ readonly type: "address";
2101
+ readonly name: "account";
2102
+ }];
2103
+ readonly outputs: readonly [{
2104
+ readonly type: "bool";
2105
+ }];
2106
+ }, {
2107
+ readonly name: "addMinter";
2108
+ readonly type: "function";
2109
+ readonly stateMutability: "nonpayable";
2110
+ readonly inputs: readonly [{
2111
+ readonly type: "address";
2112
+ readonly name: "minter";
2113
+ }];
2114
+ readonly outputs: readonly [];
2115
+ }, {
2116
+ readonly name: "removeMinter";
2117
+ readonly type: "function";
2118
+ readonly stateMutability: "nonpayable";
2119
+ readonly inputs: readonly [{
2120
+ readonly type: "address";
2121
+ readonly name: "minter";
2122
+ }];
2123
+ readonly outputs: readonly [];
2124
+ }, {
2125
+ readonly name: "addBurner";
2126
+ readonly type: "function";
2127
+ readonly stateMutability: "nonpayable";
2128
+ readonly inputs: readonly [{
2129
+ readonly type: "address";
2130
+ readonly name: "burner";
2131
+ }];
2132
+ readonly outputs: readonly [];
2133
+ }, {
2134
+ readonly name: "removeBurner";
2135
+ readonly type: "function";
2136
+ readonly stateMutability: "nonpayable";
2137
+ readonly inputs: readonly [{
2138
+ readonly type: "address";
2139
+ readonly name: "burner";
2140
+ }];
2141
+ readonly outputs: readonly [];
2142
+ }, {
2143
+ readonly name: "mintRequestNonces";
2144
+ readonly type: "function";
2145
+ readonly stateMutability: "view";
2146
+ readonly inputs: readonly [{
2147
+ readonly type: "address";
2148
+ readonly name: "receiver";
2149
+ }];
2150
+ readonly outputs: readonly [{
2151
+ readonly type: "uint256";
2152
+ }];
2153
+ }, {
2154
+ readonly name: "burnRequestNonces";
2155
+ readonly type: "function";
2156
+ readonly stateMutability: "view";
2157
+ readonly inputs: readonly [{
2158
+ readonly type: "address";
2159
+ readonly name: "from";
2160
+ }];
2161
+ readonly outputs: readonly [{
2162
+ readonly type: "uint256";
2163
+ }];
2164
+ }, {
2165
+ readonly name: "mintingOracle";
2166
+ readonly type: "function";
2167
+ readonly stateMutability: "view";
2168
+ readonly inputs: readonly [];
2169
+ readonly outputs: readonly [{
2170
+ readonly type: "address";
2171
+ }];
2172
+ }, {
2173
+ readonly name: "setMintingOracle";
2174
+ readonly type: "function";
2175
+ readonly stateMutability: "nonpayable";
2176
+ readonly inputs: readonly [{
2177
+ readonly type: "address";
2178
+ readonly name: "_mintingOracle";
2179
+ }];
2180
+ readonly outputs: readonly [];
2181
+ }, {
2182
+ readonly name: "issuer";
2183
+ readonly type: "function";
2184
+ readonly stateMutability: "view";
2185
+ readonly inputs: readonly [];
2186
+ readonly outputs: readonly [{
2187
+ readonly type: "address";
2188
+ }];
2189
+ }, {
2190
+ readonly name: "balanceOf";
2191
+ readonly type: "function";
2192
+ readonly stateMutability: "view";
2193
+ readonly inputs: readonly [{
2194
+ readonly type: "address";
2195
+ readonly name: "account";
2196
+ }];
2197
+ readonly outputs: readonly [{
2198
+ readonly type: "uint256";
2199
+ }];
2200
+ }, {
2201
+ readonly name: "totalSupply";
2202
+ readonly type: "function";
2203
+ readonly stateMutability: "view";
2204
+ readonly inputs: readonly [];
2205
+ readonly outputs: readonly [{
2206
+ readonly type: "uint256";
2207
+ }];
2208
+ }, {
2209
+ readonly name: "name";
2210
+ readonly type: "function";
2211
+ readonly stateMutability: "view";
2212
+ readonly inputs: readonly [];
2213
+ readonly outputs: readonly [{
2214
+ readonly type: "string";
2215
+ }];
2216
+ }, {
2217
+ readonly name: "symbol";
2218
+ readonly type: "function";
2219
+ readonly stateMutability: "view";
2220
+ readonly inputs: readonly [];
2221
+ readonly outputs: readonly [{
2222
+ readonly type: "string";
2223
+ }];
2224
+ }, {
2225
+ readonly name: "decimals";
2226
+ readonly type: "function";
2227
+ readonly stateMutability: "view";
2228
+ readonly inputs: readonly [];
2229
+ readonly outputs: readonly [{
2230
+ readonly type: "uint8";
2231
+ }];
2232
+ }, {
2233
+ readonly name: "DOMAIN_SEPARATOR";
2234
+ readonly type: "function";
2235
+ readonly stateMutability: "view";
2236
+ readonly inputs: readonly [];
2237
+ readonly outputs: readonly [{
2238
+ readonly type: "bytes32";
2239
+ }];
2240
+ }, {
2241
+ readonly name: "eip712Domain";
2242
+ readonly type: "function";
2243
+ readonly stateMutability: "view";
2244
+ readonly inputs: readonly [];
2245
+ readonly outputs: readonly [{
2246
+ readonly type: "bytes1";
2247
+ readonly name: "fields";
2248
+ }, {
2249
+ readonly type: "string";
2250
+ readonly name: "name";
2251
+ }, {
2252
+ readonly type: "string";
2253
+ readonly name: "version";
2254
+ }, {
2255
+ readonly type: "uint256";
2256
+ readonly name: "chainId";
2257
+ }, {
2258
+ readonly type: "address";
2259
+ readonly name: "verifyingContract";
2260
+ }, {
2261
+ readonly type: "bytes32";
2262
+ readonly name: "salt";
2263
+ }, {
2264
+ readonly type: "uint256[]";
2265
+ readonly name: "extensions";
2266
+ }];
2267
+ }, {
2268
+ readonly name: "Transfer";
2269
+ readonly type: "event";
2270
+ readonly inputs: readonly [{
2271
+ readonly type: "address";
2272
+ readonly name: "from";
2273
+ readonly indexed: true;
2274
+ }, {
2275
+ readonly type: "address";
2276
+ readonly name: "to";
2277
+ readonly indexed: true;
2278
+ }, {
2279
+ readonly type: "uint256";
2280
+ readonly name: "value";
2281
+ }];
2282
+ }, {
2283
+ readonly name: "MinterAdded";
2284
+ readonly type: "event";
2285
+ readonly inputs: readonly [{
2286
+ readonly type: "address";
2287
+ readonly name: "minter";
2288
+ readonly indexed: true;
2289
+ }];
2290
+ }, {
2291
+ readonly name: "MinterRemoved";
2292
+ readonly type: "event";
2293
+ readonly inputs: readonly [{
2294
+ readonly type: "address";
2295
+ readonly name: "minter";
2296
+ readonly indexed: true;
2297
+ }];
2298
+ }, {
2299
+ readonly name: "BurnerAdded";
2300
+ readonly type: "event";
2301
+ readonly inputs: readonly [{
2302
+ readonly type: "address";
2303
+ readonly name: "burner";
2304
+ readonly indexed: true;
2305
+ }];
2306
+ }, {
2307
+ readonly name: "BurnerRemoved";
2308
+ readonly type: "event";
2309
+ readonly inputs: readonly [{
2310
+ readonly type: "address";
2311
+ readonly name: "burner";
2312
+ readonly indexed: true;
2313
+ }];
2314
+ }, {
2315
+ readonly name: "MintingOracleUpdated";
2316
+ readonly type: "event";
2317
+ readonly inputs: readonly [{
2318
+ readonly type: "address";
2319
+ readonly name: "mintingOracle";
2320
+ readonly indexed: true;
2321
+ }];
2322
+ }];
2323
+
1784
2324
  declare const BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: `0x${string}`;
1785
2325
  declare const BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: `0x${string}`;
1786
2326
 
@@ -1836,6 +2376,12 @@ interface ContractAddresses {
1836
2376
  mintFeeWrapper: Address;
1837
2377
  /** Chainlink ETH/USD price feed — used by FeeManager to convert gas cost to USDT. */
1838
2378
  chainlinkEthUsd: Address;
2379
+ /**
2380
+ * Chainlink USDC/USD price feed — paired with the canonical USDC.
2381
+ * Optional because not every chain ships a USDC oracle; FeeManager
2382
+ * falls back to 1:1 (USDC pegged) when undefined.
2383
+ */
2384
+ chainlinkUsdcUsd?: Address;
1839
2385
  /**
1840
2386
  * Orderly perp-deposit Relay — holds an ETH reserve to cover the
1841
2387
  * LayerZero msg.value, charges a USDC token-fee reimbursement.
@@ -1851,7 +2397,7 @@ interface ContractAddresses {
1851
2397
  * shouldn't be able to redirect this fee to themselves.
1852
2398
  */
1853
2399
  pafiFeeRecipient: Address;
1854
- /** Uniswap V4 UniversalRouter — swap entry point for the swap handler. */
2400
+ /** UniversalRouter — swap entry point for the swap handler. */
1855
2401
  universalRouter: Address;
1856
2402
  /**
1857
2403
  * PAFI fork of Uniswap's Permit2. Acts as the unified token-approval
@@ -1862,6 +2408,22 @@ interface ContractAddresses {
1862
2408
  * sync with `PERMIT2_ADDRESS` top-level export.
1863
2409
  */
1864
2410
  permit2: Address;
2411
+ /** V2: TokenRegistry — per-PointToken metadata + active flag. */
2412
+ tokenRegistry: Address;
2413
+ /**
2414
+ * V2: VaultRegistry — per-PointToken SettlementVault registration.
2415
+ * Read-only from the SDK's perspective today (issuer-equity-only
2416
+ * launch); becomes write-side relevant when the LP vault flow lands.
2417
+ */
2418
+ vaultRegistry: Address;
2419
+ /** V2: VaultFactory — deploys SettlementVault UUPS-beacon clones. */
2420
+ vaultFactory: Address;
2421
+ /**
2422
+ * V2: PointModuleCore — top-level coordinator. Holds references to
2423
+ * the IssuerRegistry, TokenRegistry, VaultRegistry, MintingOracle so
2424
+ * consumers can resolve the full registry set from one address.
2425
+ */
2426
+ pointModuleCore: Address;
1865
2427
  }
1866
2428
  declare const CONTRACT_ADDRESSES: Record<number, ContractAddresses>;
1867
2429
  /**
@@ -1871,11 +2433,26 @@ declare const CONTRACT_ADDRESSES: Record<number, ContractAddresses>;
1871
2433
  */
1872
2434
  declare const POINT_TOKEN_FACTORY_ADDRESSES: Record<number, Address>;
1873
2435
  /**
1874
- * PointToken implementation address — the EIP-1167 clone target used
1875
- * by PointTokenFactory. Exposed for observability / proxy verification;
1876
- * consumers should never call this directly.
2436
+ * PointToken implementation address — the clone target used by
2437
+ * PointTokenFactory. V2 switched from EIP-1167 minimal proxy to a
2438
+ * UUPS-beacon pattern (see `POINT_TOKEN_BEACON_ADDRESSES`); each clone
2439
+ * delegates through the beacon to this impl. Exposed for observability
2440
+ * / proxy verification; consumers should never call this directly.
1877
2441
  */
1878
2442
  declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
2443
+ /**
2444
+ * V2: PointToken UUPS beacon — clones point at this beacon; the beacon
2445
+ * delegates to the impl. Upgrading the impl is done by re-pointing the
2446
+ * beacon. Exposed for upgrade audits and observability; runtime SDK
2447
+ * paths never reference it directly.
2448
+ */
2449
+ declare const POINT_TOKEN_BEACON_ADDRESSES: Record<number, Address>;
2450
+ /**
2451
+ * V2: SettlementVault UUPS beacon — same pattern as the PointToken
2452
+ * beacon, for the per-PointToken ERC-4626 LP vault deployed by
2453
+ * VaultFactory. Exposed for upgrade audits.
2454
+ */
2455
+ declare const VAULT_BEACON_ADDRESSES: Record<number, Address>;
1879
2456
  /**
1880
2457
  * Lookup helper — throws if the chain isn't in the map so callers fail
1881
2458
  * loudly on misconfiguration instead of silently using `undefined`.
@@ -2154,7 +2731,21 @@ declare function openPafiWebModal(url: string, options?: ModalOpenOptions): Prom
2154
2731
  * MintFeeWrapper. Schema entities: `MintFeeWrapper`, `MintFeeConfig`,
2155
2732
  * `FeeRecipient`, `MintWithFeeEvent`, `FeeDistribution`.
2156
2733
  */
2157
- declare const PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-v4";
2734
+ /**
2735
+ * Default subgraph endpoint. Points at `pafi-subgraph-v1` — the deployment
2736
+ * that indexes the V2 contract bucket (IssuerRegistry 0x3e8264…,
2737
+ * PointTokenFactory 0x34f9F8…, TokenRegistry 0x7092b3…, MintingOracle
2738
+ * 0x19F5Ea…, MintFeeWrapper 0x72B8FB…). Despite the "v1" name in the URL
2739
+ * this is the freshest subgraph — naming is a deploy-order artifact, not
2740
+ * a contract-version indicator.
2741
+ *
2742
+ * Previous deployments (`pafi-subgraph-v4`, `v5`) tracked the v1.6
2743
+ * contract bucket and have been retired alongside the v2 cutover.
2744
+ *
2745
+ * Override per-call via `subgraphUrl` parameter when you need to point at
2746
+ * a fork or a private graph node for staging.
2747
+ */
2748
+ declare const PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-v1";
2158
2749
  /**
2159
2750
  * Fetch the Uniswap V3 pool(s) for a PAFI PointToken from the subgraph.
2160
2751
  *
@@ -2213,6 +2804,9 @@ declare class PafiSDK {
2213
2804
  }, {
2214
2805
  readonly name: "amount";
2215
2806
  readonly type: "uint256";
2807
+ }, {
2808
+ readonly name: "source";
2809
+ readonly type: "uint8";
2216
2810
  }, {
2217
2811
  readonly name: "nonce";
2218
2812
  readonly type: "uint256";
@@ -2232,4 +2826,4 @@ declare class PafiSDK {
2232
2826
  signLoginMessage(message: string): Promise<Hex>;
2233
2827
  }
2234
2828
 
2235
- export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildErc20TransferParams, 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, type FallbackInfo, type FeeScenario, 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 QuoteOperatorFeeForTransferConfig, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, SCENARIO_GAS_UNITS, 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, buildErc20TransferUserOp, 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, quoteOperatorFeeForTransfer, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, splitAuthorizationSig, webPopupAdapter };
2829
+ export { ApiError, type AttachDelegationIfNeededParams, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildErc20TransferParams, 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, type FallbackInfo, type FeeScenario, 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_ABI, POINT_TOKEN_BEACON_ADDRESSES, POINT_TOKEN_BURN_SIG_ABI, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_MINT_SIG_ABI, 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 QuoteOperatorFeeForTransferConfig, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, SCENARIO_GAS_UNITS, 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, VAULT_BEACON_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, assembleUserOperation, attachDelegationIfNeeded, buildDelegationUserOp, buildEip7702Authorization, buildErc20TransferUserOp, 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, quoteOperatorFeeForTransfer, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, splitAuthorizationSig, webPopupAdapter };