@pafi-dev/core 0.19.0 → 0.20.1

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 +46 -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 +132 -23
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +508 -9
  39. package/dist/index.d.ts +508 -9
  40. package/dist/index.js +132 -23
  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 +1 -1
  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.js CHANGED
@@ -1,10 +1,15 @@
1
1
  import {
2
2
  erc20Abi,
3
3
  permit2Abi,
4
+ pointModuleCoreAbi,
4
5
  pointTokenFactoryAbi,
6
+ settlementVaultAbi,
7
+ tokenRegistryAbi,
5
8
  universalRouterAbi,
6
- v3QuoterV2Abi
7
- } from "./chunk-ZJXXCG5P.js";
9
+ v3QuoterV2Abi,
10
+ vaultFactoryAbi,
11
+ vaultRegistryAbi
12
+ } from "./chunk-ZQVYWMOG.js";
8
13
  import {
9
14
  SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET,
10
15
  SPONSOR_AUTH_DOMAIN_NAME,
@@ -22,26 +27,29 @@ import {
22
27
  verifySponsorAuth
23
28
  } from "./chunk-4EGXLYMM.js";
24
29
  import {
30
+ Source,
31
+ computeEquityCap,
25
32
  getBurnRequestNonce,
26
33
  getIssuer,
27
34
  getIssuer2,
28
35
  getMintFeeBps,
29
36
  getMintFeeRecipients,
30
37
  getMintRequestNonce,
38
+ getOracleRegistries,
31
39
  getPointTokenBalance,
32
- getPointTokenIssuer,
33
- getTokenCap,
34
40
  getTokenName,
35
41
  isActiveIssuer,
36
42
  isMinter,
37
43
  issuerRegistryGetIssuerFlatAbi,
38
- verifyMintCap
39
- } from "./chunk-H3X3FYUU.js";
44
+ verifyEquityMint,
45
+ verifyIssuerOperative,
46
+ verifyMint
47
+ } from "./chunk-4VPIPVV5.js";
40
48
  import {
41
49
  issuerRegistryAbi,
42
50
  mintFeeWrapperAbi,
43
51
  mintingOracleAbi
44
- } from "./chunk-LF5GIN5P.js";
52
+ } from "./chunk-W2DHHR2N.js";
45
53
  import {
46
54
  COMMON_POOLS,
47
55
  COMMON_TOKENS,
@@ -66,10 +74,10 @@ import {
66
74
  signMintRequest,
67
75
  verifyBurnRequest,
68
76
  verifyMintRequest
69
- } from "./chunk-4TNHRZ4X.js";
77
+ } from "./chunk-K4GBOB5V.js";
70
78
  import {
71
79
  pointTokenAbi
72
- } from "./chunk-UCO5DXD6.js";
80
+ } from "./chunk-5Y7MGN56.js";
73
81
  import "./chunk-DGUM43GV.js";
74
82
 
75
83
  // src/index.ts
@@ -865,14 +873,18 @@ function buildEip7702Authorization(params) {
865
873
  // src/contracts/real/addresses.ts
866
874
  var PLACEHOLDER_DEAD = (suffix) => `0x000000000000000000000000000000000000${suffix.toLowerCase().padStart(4, "0")}`;
867
875
  var CONTRACT_ADDRESSES = {
868
- // Base mainnet — live deployment
876
+ // ──────────────────────────────────────────────────────────────────
877
+ // Base mainnet (8453) — V2 dual-bucket deploy 2026-06-12
878
+ //
879
+ // Replaces the v1.6 single-bucket deploy (2026-05-07). Periphery
880
+ // addresses (batchExecutor / chainlinkEthUsd / orderlyRelay /
881
+ // universalRouter / permit2 / pafiFeeRecipient) are inherited from
882
+ // v1.6 — they were not redeployed for V2. PointToken impl + factory
883
+ // were rotated as part of the dual-bucket schema change.
884
+ // ──────────────────────────────────────────────────────────────────
869
885
  8453: {
886
+ // ── Periphery (inherited from v1.6, unchanged) ────────────────
870
887
  batchExecutor: "0xe6Cae83BdE06E4c305530e199D7217f42808555B",
871
- usdt: "0x3F7e71B150e97316Bb9f363A32c19CcD36ac2382",
872
- usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
873
- issuerRegistry: "0xAB1d1e117c41636f30bb10194Fe6B774B6Da9E01",
874
- mintingOracle: "0x2f4cf8C5F8b41efC970c5b46a5d905CeA1f871a0",
875
- mintFeeWrapper: "0xD324EE2e3220B23d1b1BfbB85f5bC1EF2E917B93",
876
888
  chainlinkEthUsd: "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70",
877
889
  orderlyRelay: "0xDA082DAce1522c185aeB5A713FcA6fa6B6E99e7f",
878
890
  pafiFeeRecipient: "0xa3F71eadEd101513a0151007590020dCFD7C495e",
@@ -886,7 +898,22 @@ var CONTRACT_ADDRESSES = {
886
898
  // Permit2, so swaps signed against the canonical Permit2 fail
887
899
  // signature verification. Keep in sync with `PERMIT2_ADDRESS`
888
900
  // top-level export.
889
- permit2: "0xEB450d21ae68D3303Cf5775A54Cc84EE7c3fC8eC"
901
+ permit2: "0xEB450d21ae68D3303Cf5775A54Cc84EE7c3fC8eC",
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",
908
+ chainlinkUsdcUsd: "0xEE86BfD4E2B3A1e71a1b45f750791D67e735e4a7",
909
+ // ── V2 core registries (replaces v1.6) ────────────────────────
910
+ issuerRegistry: "0x3e82647b0f716f80e65d311354E2C4F0DcFd6997",
911
+ mintingOracle: "0x19F5Ea31D42E957F66B672c83293588f190f9fEB",
912
+ mintFeeWrapper: "0x72B8FB182A72741d2F85Bd78B5cAAC8b98c5A493",
913
+ tokenRegistry: "0x7092b329a5c9a823EE0b629D391330D29E109d97",
914
+ vaultRegistry: "0x8D97352cEaA6d6C1Ee2ddFd327F1487357650712",
915
+ vaultFactory: "0xDaD6b27Be7d89A6776b85D0672e0B645318DE63b",
916
+ pointModuleCore: "0x3995fE8ED9dc563C2d7268fCA86d08cc1A2C1c9c"
890
917
  },
891
918
  // Base Sepolia — not in active use; placeholders kept so the map
892
919
  // compiles for tooling that enumerates chains.
@@ -900,15 +927,31 @@ var CONTRACT_ADDRESSES = {
900
927
  orderlyRelay: PLACEHOLDER_DEAD("de03"),
901
928
  pafiFeeRecipient: PLACEHOLDER_DEAD("de04"),
902
929
  universalRouter: PLACEHOLDER_DEAD("de05"),
903
- permit2: PLACEHOLDER_DEAD("de06")
930
+ permit2: PLACEHOLDER_DEAD("de06"),
931
+ tokenRegistry: PLACEHOLDER_DEAD("de07"),
932
+ vaultRegistry: PLACEHOLDER_DEAD("de08"),
933
+ vaultFactory: PLACEHOLDER_DEAD("de09"),
934
+ pointModuleCore: PLACEHOLDER_DEAD("de0a")
904
935
  }
905
936
  };
906
937
  var POINT_TOKEN_FACTORY_ADDRESSES = {
907
- 8453: "0xA08274458b43E7D6F4ff61ddFe8A9852c6531085",
938
+ // V2 dual-bucket factory (2026-06-12). Replaces v1.6 factory
939
+ // `0xA08274458b43E7D6F4ff61ddFe8A9852c6531085`.
940
+ 8453: "0x34f9F84841A77A19040686396b8B64522A2da4c8",
908
941
  84532: PLACEHOLDER_DEAD("dead")
909
942
  };
910
943
  var POINT_TOKEN_IMPL_ADDRESSES = {
911
- 8453: "0xc41c3F8A0380c7760Ee1209d6d19C4b81dE994e4",
944
+ // V2 dual-bucket impl (2026-06-12). Replaces v1.6 impl
945
+ // `0xc41c3F8A0380c7760Ee1209d6d19C4b81dE994e4` (single-bucket).
946
+ 8453: "0x067d2d82F7cfbAf9bBA1f493167cC6043eD5d7dd",
947
+ 84532: PLACEHOLDER_DEAD("dead")
948
+ };
949
+ var POINT_TOKEN_BEACON_ADDRESSES = {
950
+ 8453: "0xdC479E294FD12658FDC68B9400c2073De291acf3",
951
+ 84532: PLACEHOLDER_DEAD("dead")
952
+ };
953
+ var VAULT_BEACON_ADDRESSES = {
954
+ 8453: "0x4E583d64bfcCD86dFf1f68b792D5a1Cd169f22eB",
912
955
  84532: PLACEHOLDER_DEAD("dead")
913
956
  };
914
957
  function getContractAddresses(chainId) {
@@ -1356,6 +1399,60 @@ function parseBigDecimalTo18(s) {
1356
1399
  return BigInt(whole + padded);
1357
1400
  }
1358
1401
 
1402
+ // src/contracts/real/pointToken.ts
1403
+ import { parseAbi as parseAbi4 } from "viem";
1404
+ var POINT_TOKEN_MINT_SIG_ABI = parseAbi4([
1405
+ "function mint(address user, uint256 amount, uint8 source, uint256 deadline, bytes minterSig) external"
1406
+ ]);
1407
+ var POINT_TOKEN_BURN_SIG_ABI = parseAbi4([
1408
+ "function burn(address from, uint256 amount, uint8 source, uint256 deadline, bytes burnerSig) external"
1409
+ ]);
1410
+ var POINT_TOKEN_ABI = parseAbi4([
1411
+ // --- Mint paths (V2 dual-bucket: +uint8 source) ---
1412
+ "function mint(address to, uint256 amount, uint8 source) external",
1413
+ "function mint(address user, uint256 amount, uint8 source, uint256 deadline, bytes minterSig) external",
1414
+ // --- Burn paths (V2 dual-bucket: +uint8 source) ---
1415
+ "function burn(address from, uint256 amount, uint8 source) external",
1416
+ "function burn(address from, uint256 amount, uint8 source, uint256 deadline, bytes burnerSig) external",
1417
+ // --- V2 per-bucket supply views ---
1418
+ "function equitySupply() external view returns (uint256)",
1419
+ "function vaultSupply() external view returns (uint256)",
1420
+ // --- Authorization reads ---
1421
+ "function minters(address account) external view returns (bool)",
1422
+ "function burners(address account) external view returns (bool)",
1423
+ // --- Authorization writes (owner-only; used by provisioning scripts) ---
1424
+ "function addMinter(address minter) external",
1425
+ "function removeMinter(address minter) external",
1426
+ "function addBurner(address burner) external",
1427
+ "function removeBurner(address burner) external",
1428
+ // --- Nonces (sig-gated paths) ---
1429
+ "function mintRequestNonces(address receiver) external view returns (uint256)",
1430
+ "function burnRequestNonces(address from) external view returns (uint256)",
1431
+ // --- Oracle ---
1432
+ "function mintingOracle() external view returns (address)",
1433
+ "function setMintingOracle(address _mintingOracle) external",
1434
+ // --- Issuer ---
1435
+ "function issuer() external view returns (address)",
1436
+ // --- Standard ERC-20 reads ---
1437
+ "function balanceOf(address account) external view returns (uint256)",
1438
+ "function totalSupply() external view returns (uint256)",
1439
+ "function name() external view returns (string)",
1440
+ "function symbol() external view returns (string)",
1441
+ "function decimals() external view returns (uint8)",
1442
+ // --- EIP-712 domain (for off-chain sig verification) ---
1443
+ "function DOMAIN_SEPARATOR() external view returns (bytes32)",
1444
+ "function eip712Domain() external view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)",
1445
+ // --- Events ---
1446
+ // PointIndexer filters Transfer(from=0x0) for mints
1447
+ // BurnIndexer filters Transfer(to=0x0) for burns
1448
+ "event Transfer(address indexed from, address indexed to, uint256 value)",
1449
+ "event MinterAdded(address indexed minter)",
1450
+ "event MinterRemoved(address indexed minter)",
1451
+ "event BurnerAdded(address indexed burner)",
1452
+ "event BurnerRemoved(address indexed burner)",
1453
+ "event MintingOracleUpdated(address indexed mintingOracle)"
1454
+ ]);
1455
+
1359
1456
  // src/contracts/real/batchExecutor.ts
1360
1457
  var BATCH_EXECUTOR_ADDRESS_BASE_MAINNET = getContractAddresses(8453).batchExecutor;
1361
1458
  var BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA = getContractAddresses(84532).batchExecutor;
@@ -1669,9 +1766,12 @@ export {
1669
1766
  PAFI_SERVICE_URLS,
1670
1767
  PAFI_SUBGRAPH_URL,
1671
1768
  PERMIT2_ADDRESS,
1672
- pointTokenAbi as POINT_TOKEN_ABI,
1769
+ POINT_TOKEN_ABI,
1770
+ POINT_TOKEN_BEACON_ADDRESSES,
1771
+ POINT_TOKEN_BURN_SIG_ABI,
1673
1772
  POINT_TOKEN_FACTORY_ADDRESSES,
1674
1773
  POINT_TOKEN_IMPL_ADDRESSES,
1774
+ POINT_TOKEN_MINT_SIG_ABI,
1675
1775
  POINT_TOKEN_POOLS,
1676
1776
  PafiSDK,
1677
1777
  PafiSdkError,
@@ -1685,11 +1785,13 @@ export {
1685
1785
  SUPPORTED_CHAINS,
1686
1786
  SigningError,
1687
1787
  SimulationError,
1788
+ Source,
1688
1789
  TOKEN_HASHES,
1689
1790
  UNIVERSAL_ROUTER_ADDRESSES,
1690
1791
  V3_FACTORY_ADDRESSES,
1691
1792
  V3_POOL_INIT_CODE_HASH,
1692
1793
  V3_SWAP_ROUTER_ADDRESSES,
1794
+ VAULT_BEACON_ADDRESSES,
1693
1795
  ValidationError,
1694
1796
  ZERO_VALUE,
1695
1797
  assembleUserOperation,
@@ -1713,6 +1815,7 @@ export {
1713
1815
  computeAccountId,
1714
1816
  computeAuthorizationHash,
1715
1817
  computeCallDataHash,
1818
+ computeEquityCap,
1716
1819
  computeUserOpHash,
1717
1820
  computeV3PoolAddress,
1718
1821
  createLoginMessage,
@@ -1738,13 +1841,12 @@ export {
1738
1841
  getMintFeeBps,
1739
1842
  getMintFeeRecipients,
1740
1843
  getMintRequestNonce,
1844
+ getOracleRegistries,
1741
1845
  getPafiServiceUrls,
1742
1846
  getPafiWebModalAdapter,
1743
1847
  getPointTokenBalance,
1744
- getPointTokenIssuer,
1745
1848
  getIssuer as getPointTokenIssuerAddress,
1746
1849
  getSponsorAuthDomainAnchor,
1747
- getTokenCap,
1748
1850
  getTokenName,
1749
1851
  isActiveIssuer,
1750
1852
  isDelegatedTo,
@@ -1761,6 +1863,7 @@ export {
1761
1863
  parseEip7702DelegatedAddress,
1762
1864
  parseLoginMessage,
1763
1865
  permit2Abi,
1866
+ pointModuleCoreAbi,
1764
1867
  pointTokenAbi,
1765
1868
  pointTokenFactoryAbi,
1766
1869
  quoteOperatorFeeForTransfer,
@@ -1770,15 +1873,21 @@ export {
1770
1873
  sendWithPaymasterFallback,
1771
1874
  serializeUserOpToJsonRpc,
1772
1875
  setPafiWebModalAdapter,
1876
+ settlementVaultAbi,
1773
1877
  signBurnRequest,
1774
1878
  signMintRequest,
1775
1879
  signSponsorAuth,
1776
1880
  splitAuthorizationSig,
1881
+ tokenRegistryAbi,
1777
1882
  universalRouterAbi,
1778
1883
  v3QuoterV2Abi,
1884
+ vaultFactoryAbi,
1885
+ vaultRegistryAbi,
1779
1886
  verifyBurnRequest,
1887
+ verifyEquityMint,
1888
+ verifyIssuerOperative,
1780
1889
  verifyLoginMessage,
1781
- verifyMintCap,
1890
+ verifyMint,
1782
1891
  verifyMintRequest,
1783
1892
  verifySponsorAuth,
1784
1893
  webPopupAdapter