@pafi-dev/core 0.10.0 → 0.13.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.
- package/README.md +23 -70
- package/dist/abi/index.cjs +2 -2
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.d.cts +58 -106
- package/dist/abi/index.d.ts +58 -106
- package/dist/abi/index.js +3 -3
- package/dist/{chunk-J7EYOLMI.js → chunk-H3X3FYUU.js} +1 -1
- package/dist/chunk-H3X3FYUU.js.map +1 -0
- package/dist/{chunk-4NTU7XGP.cjs → chunk-NT2ZPF72.cjs} +53 -23
- package/dist/chunk-NT2ZPF72.cjs.map +1 -0
- package/dist/{chunk-BBQLGBOD.cjs → chunk-TRYGIC2I.cjs} +1 -1
- package/dist/{chunk-BBQLGBOD.cjs.map → chunk-TRYGIC2I.cjs.map} +1 -1
- package/dist/{chunk-RVSW7I6U.js → chunk-UEO4YN6T.js} +52 -22
- package/dist/chunk-UEO4YN6T.js.map +1 -0
- package/dist/{chunk-MIQA46E3.cjs → chunk-XXLIIWIF.cjs} +45 -53
- package/dist/chunk-XXLIIWIF.cjs.map +1 -0
- package/dist/{chunk-CWH4KOUW.js → chunk-ZJXXCG5P.js} +45 -53
- package/dist/chunk-ZJXXCG5P.js.map +1 -0
- package/dist/contract/index.cjs +2 -2
- package/dist/contract/index.d.cts +4 -5
- package/dist/contract/index.d.ts +4 -5
- package/dist/contract/index.js +1 -1
- package/dist/eip712/index.cjs +2 -2
- package/dist/eip712/index.d.cts +30 -5
- package/dist/eip712/index.d.ts +30 -5
- package/dist/eip712/index.js +1 -1
- package/dist/index.cjs +146 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +189 -119
- package/dist/index.d.ts +189 -119
- package/dist/index.js +135 -115
- package/dist/index.js.map +1 -1
- package/dist/{types-B3UivyQ1.d.cts → types-C17pznGz.d.cts} +72 -21
- package/dist/{types-B3UivyQ1.d.ts → types-C17pznGz.d.ts} +72 -21
- package/package.json +16 -15
- package/dist/chunk-4NTU7XGP.cjs.map +0 -1
- package/dist/chunk-CWH4KOUW.js.map +0 -1
- package/dist/chunk-J7EYOLMI.js.map +0 -1
- package/dist/chunk-MIQA46E3.cjs.map +0 -1
- package/dist/chunk-RVSW7I6U.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
erc20Abi,
|
|
3
|
+
permit2Abi,
|
|
4
|
+
pointTokenFactoryAbi,
|
|
5
|
+
universalRouterAbi,
|
|
6
|
+
v3QuoterV2Abi
|
|
7
|
+
} from "./chunk-ZJXXCG5P.js";
|
|
1
8
|
import {
|
|
2
9
|
SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET,
|
|
3
10
|
SPONSOR_AUTH_DOMAIN_NAME,
|
|
@@ -14,13 +21,6 @@ import {
|
|
|
14
21
|
verifyLoginMessage,
|
|
15
22
|
verifySponsorAuth
|
|
16
23
|
} from "./chunk-4EGXLYMM.js";
|
|
17
|
-
import {
|
|
18
|
-
erc20Abi,
|
|
19
|
-
permit2Abi,
|
|
20
|
-
pointTokenFactoryAbi,
|
|
21
|
-
universalRouterAbi,
|
|
22
|
-
v4QuoterAbi
|
|
23
|
-
} from "./chunk-CWH4KOUW.js";
|
|
24
24
|
import {
|
|
25
25
|
getBurnRequestNonce,
|
|
26
26
|
getIssuer,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
isMinter,
|
|
37
37
|
issuerRegistryGetIssuerFlatAbi,
|
|
38
38
|
verifyMintCap
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-H3X3FYUU.js";
|
|
40
40
|
import {
|
|
41
41
|
issuerRegistryAbi,
|
|
42
42
|
mintFeeWrapperAbi,
|
|
@@ -50,9 +50,12 @@ import {
|
|
|
50
50
|
Eip712DomainMismatchError,
|
|
51
51
|
PERMIT2_ADDRESS,
|
|
52
52
|
POINT_TOKEN_POOLS,
|
|
53
|
+
QUOTER_V2_ADDRESSES,
|
|
53
54
|
SUPPORTED_CHAINS,
|
|
54
55
|
UNIVERSAL_ROUTER_ADDRESSES,
|
|
55
|
-
|
|
56
|
+
V3_FACTORY_ADDRESSES,
|
|
57
|
+
V3_POOL_INIT_CODE_HASH,
|
|
58
|
+
V3_SWAP_ROUTER_ADDRESSES,
|
|
56
59
|
assertDomainMatchesContract,
|
|
57
60
|
buildBurnRequestTypedData,
|
|
58
61
|
buildDomain,
|
|
@@ -63,7 +66,7 @@ import {
|
|
|
63
66
|
signMintRequest,
|
|
64
67
|
verifyBurnRequest,
|
|
65
68
|
verifyMintRequest
|
|
66
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-UEO4YN6T.js";
|
|
67
70
|
import {
|
|
68
71
|
pointTokenAbi
|
|
69
72
|
} from "./chunk-UCO5DXD6.js";
|
|
@@ -119,41 +122,43 @@ var PafiSdkError = class extends Error {
|
|
|
119
122
|
this.name = new.target.name;
|
|
120
123
|
}
|
|
121
124
|
};
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
var ConfigurationError = class extends PafiSDKError {
|
|
125
|
+
var ConfigurationError = class extends PafiSdkError {
|
|
126
|
+
httpStatus = "service_unavailable";
|
|
127
|
+
code = "CONFIGURATION_ERROR";
|
|
128
|
+
type = "server_error";
|
|
129
129
|
constructor(message) {
|
|
130
130
|
super(message);
|
|
131
|
-
this.name = "ConfigurationError";
|
|
132
131
|
}
|
|
133
132
|
};
|
|
134
|
-
var SigningError = class extends
|
|
133
|
+
var SigningError = class extends PafiSdkError {
|
|
134
|
+
httpStatus = "service_unavailable";
|
|
135
|
+
code = "SIGNING_FAILED";
|
|
136
|
+
type = "server_error";
|
|
135
137
|
constructor(message) {
|
|
136
138
|
super(message);
|
|
137
|
-
this.name = "SigningError";
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
|
-
var SimulationError = class extends
|
|
141
|
+
var SimulationError = class extends PafiSdkError {
|
|
142
|
+
httpStatus = "unprocessable";
|
|
143
|
+
code = "SIMULATION_FAILED";
|
|
144
|
+
type = "business_logic_error";
|
|
145
|
+
operation;
|
|
146
|
+
reason;
|
|
141
147
|
constructor(operation, reason) {
|
|
142
148
|
super(`Simulation failed for ${operation}: ${reason}`);
|
|
143
149
|
this.operation = operation;
|
|
144
150
|
this.reason = reason;
|
|
145
|
-
this.name = "SimulationError";
|
|
146
151
|
}
|
|
147
|
-
operation;
|
|
148
|
-
reason;
|
|
149
152
|
};
|
|
150
|
-
var ApiError = class extends
|
|
151
|
-
|
|
153
|
+
var ApiError = class extends PafiSdkError {
|
|
154
|
+
httpStatus = "service_unavailable";
|
|
155
|
+
code = "API_ERROR";
|
|
156
|
+
type = "service_unavailable_error";
|
|
157
|
+
upstreamStatus;
|
|
158
|
+
constructor(message, upstreamStatus) {
|
|
152
159
|
super(message);
|
|
153
|
-
this.
|
|
154
|
-
this.name = "ApiError";
|
|
160
|
+
this.upstreamStatus = upstreamStatus;
|
|
155
161
|
}
|
|
156
|
-
status;
|
|
157
162
|
};
|
|
158
163
|
var OracleStaleError = class extends PafiSdkError {
|
|
159
164
|
httpStatus = "service_unavailable";
|
|
@@ -625,48 +630,6 @@ function getDummySignatureFor7702(impl) {
|
|
|
625
630
|
return DUMMY_SIGNATURE_V07;
|
|
626
631
|
}
|
|
627
632
|
|
|
628
|
-
// src/paymaster/config.ts
|
|
629
|
-
var _config = null;
|
|
630
|
-
var _deprecationWarned = false;
|
|
631
|
-
function warnDeprecated(fn) {
|
|
632
|
-
if (_deprecationWarned) return;
|
|
633
|
-
_deprecationWarned = true;
|
|
634
|
-
console.warn(
|
|
635
|
-
`[PAFI] DEPRECATION: \`${fn}\` from @pafi-dev/core/paymaster has been deprecated since v0.7.1 and will be removed in the next major bump (v1.0). Use \`PafiBackendClient\` from @pafi-dev/issuer/pafi-backend instead.`
|
|
636
|
-
);
|
|
637
|
-
}
|
|
638
|
-
function setPaymasterConfig(config) {
|
|
639
|
-
warnDeprecated("setPaymasterConfig");
|
|
640
|
-
if (!config.pafiBackendUrl) {
|
|
641
|
-
throw new Error("setPaymasterConfig: pafiBackendUrl is required");
|
|
642
|
-
}
|
|
643
|
-
if (!config.issuerId) {
|
|
644
|
-
throw new Error("setPaymasterConfig: issuerId is required");
|
|
645
|
-
}
|
|
646
|
-
if (!config.apiKey) {
|
|
647
|
-
throw new Error("setPaymasterConfig: apiKey is required");
|
|
648
|
-
}
|
|
649
|
-
if (!config.feeRecipient) {
|
|
650
|
-
throw new Error("setPaymasterConfig: feeRecipient is required");
|
|
651
|
-
}
|
|
652
|
-
_config = { ...config };
|
|
653
|
-
}
|
|
654
|
-
function getPaymasterConfig() {
|
|
655
|
-
warnDeprecated("getPaymasterConfig");
|
|
656
|
-
if (!_config) {
|
|
657
|
-
throw new Error(
|
|
658
|
-
"PaymasterConfig not initialized \u2014 call setPaymasterConfig() at application boot before invoking any batch builder"
|
|
659
|
-
);
|
|
660
|
-
}
|
|
661
|
-
return _config;
|
|
662
|
-
}
|
|
663
|
-
function _resetPaymasterConfigForTests() {
|
|
664
|
-
_config = null;
|
|
665
|
-
}
|
|
666
|
-
function isPaymasterConfigured() {
|
|
667
|
-
return _config !== null;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
633
|
// src/utils/checkEthAndBranch.ts
|
|
671
634
|
var DEFAULT_MARGIN_BPS = 11e3;
|
|
672
635
|
async function checkEthAndBranch(params) {
|
|
@@ -678,6 +641,70 @@ async function checkEthAndBranch(params) {
|
|
|
678
641
|
return balance >= required ? "normal" : "paymaster";
|
|
679
642
|
}
|
|
680
643
|
|
|
644
|
+
// src/utils/v3Path.ts
|
|
645
|
+
import { concatHex, getAddress as getAddress2, getContractAddress, keccak256 as keccak2562, pad as pad2, toHex as toHex2 } from "viem";
|
|
646
|
+
function encodeV3Path(path) {
|
|
647
|
+
const { tokens, fees } = path;
|
|
648
|
+
if (tokens.length < 2) {
|
|
649
|
+
throw new Error(
|
|
650
|
+
`encodeV3Path: tokens must contain at least 2 addresses, got ${tokens.length}`
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
if (tokens.length !== fees.length + 1) {
|
|
654
|
+
throw new Error(
|
|
655
|
+
`encodeV3Path: tokens.length must equal fees.length + 1, got tokens=${tokens.length} fees=${fees.length}`
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
const parts = [];
|
|
659
|
+
for (let i = 0; i < fees.length; i++) {
|
|
660
|
+
parts.push(tokens[i].toLowerCase());
|
|
661
|
+
const fee = fees[i];
|
|
662
|
+
if (!Number.isInteger(fee) || fee < 0 || fee > 16777215) {
|
|
663
|
+
throw new Error(
|
|
664
|
+
`encodeV3Path: fees[${i}] must be a uint24 (0..16777215), got ${fee}`
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
parts.push(pad2(toHex2(fee), { size: 3 }));
|
|
668
|
+
}
|
|
669
|
+
parts.push(tokens[tokens.length - 1].toLowerCase());
|
|
670
|
+
return concatHex(parts);
|
|
671
|
+
}
|
|
672
|
+
function encodeV3PathReversed(path) {
|
|
673
|
+
return encodeV3Path({
|
|
674
|
+
tokens: [...path.tokens].reverse(),
|
|
675
|
+
fees: [...path.fees].reverse()
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
function computeV3PoolAddress(params) {
|
|
679
|
+
const { factory, tokenA, tokenB, fee, initCodeHash } = params;
|
|
680
|
+
if (!Number.isInteger(fee) || fee < 0 || fee > 16777215) {
|
|
681
|
+
throw new Error(
|
|
682
|
+
`computeV3PoolAddress: fee must be a uint24, got ${fee}`
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
const a = getAddress2(tokenA).toLowerCase();
|
|
686
|
+
const b = getAddress2(tokenB).toLowerCase();
|
|
687
|
+
if (a === b) {
|
|
688
|
+
throw new Error(
|
|
689
|
+
`computeV3PoolAddress: tokenA and tokenB must differ, got ${a}`
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
const [token0, token1] = a < b ? [tokenA, tokenB] : [tokenB, tokenA];
|
|
693
|
+
const salt = keccak2562(
|
|
694
|
+
concatHex([
|
|
695
|
+
pad2(getAddress2(token0), { size: 32 }),
|
|
696
|
+
pad2(getAddress2(token1), { size: 32 }),
|
|
697
|
+
pad2(toHex2(fee), { size: 32 })
|
|
698
|
+
])
|
|
699
|
+
);
|
|
700
|
+
return getContractAddress({
|
|
701
|
+
opcode: "CREATE2",
|
|
702
|
+
from: factory,
|
|
703
|
+
bytecodeHash: initCodeHash,
|
|
704
|
+
salt
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
|
|
681
708
|
// src/delegation/checkDelegation.ts
|
|
682
709
|
var EIP7702_MAGIC = "0xef0100";
|
|
683
710
|
function parseEip7702DelegatedAddress(code) {
|
|
@@ -743,14 +770,14 @@ async function getAaNonce(client, userAddress) {
|
|
|
743
770
|
}
|
|
744
771
|
|
|
745
772
|
// src/delegation/computeAuthorizationHash.ts
|
|
746
|
-
import { concat as concat2, keccak256 as
|
|
773
|
+
import { concat as concat2, keccak256 as keccak2563, toRlp } from "viem";
|
|
747
774
|
function computeAuthorizationHash(chainId, address, nonce) {
|
|
748
775
|
const rlpEncoded = toRlp([
|
|
749
776
|
toMinimalHex(BigInt(chainId)),
|
|
750
777
|
address,
|
|
751
778
|
toMinimalHex(nonce)
|
|
752
779
|
]);
|
|
753
|
-
return
|
|
780
|
+
return keccak2563(concat2(["0x05", rlpEncoded]));
|
|
754
781
|
}
|
|
755
782
|
function isDelegatedToTarget(code, target) {
|
|
756
783
|
if (!code || code === "0x") return false;
|
|
@@ -797,31 +824,13 @@ function buildEip7702Authorization(params) {
|
|
|
797
824
|
// src/contracts/real/addresses.ts
|
|
798
825
|
var PLACEHOLDER_DEAD = (suffix) => `0x000000000000000000000000000000000000${suffix.toLowerCase().padStart(4, "0")}`;
|
|
799
826
|
var CONTRACT_ADDRESSES = {
|
|
800
|
-
// Base mainnet —
|
|
801
|
-
// registry: IssuerRegistry 0xAB1d1e117c41636f30bb10194Fe6B774B6Da9E01
|
|
802
|
-
// factory: PointTokenFactory 0xA08274458b43E7D6F4ff61ddFe8A9852c6531085
|
|
803
|
-
// oracle: MintingOracle 0x2f4cf8C5F8b41efC970c5b46a5d905CeA1f871a0
|
|
804
|
-
// tokenImpl: PointToken (impl) 0xc41c3F8A0380c7760Ee1209d6d19C4b81dE994e4
|
|
805
|
-
// mintFeeWrapper: MintFeeWrapper 0xD324EE2e3220B23d1b1BfbB85f5bC1EF2E917B93
|
|
806
|
-
// mockUsdt: MockERC20 0x3F7e71B150e97316Bb9f363A32c19CcD36ac2382
|
|
807
|
-
// batchExecutor: Pimlico Simple7702 0xe6Cae83BdE06E4c305530e199D7217f42808555B (unchanged from v1.5)
|
|
808
|
-
//
|
|
809
|
-
// pointToken: PER-ISSUER, not chain-level. Each issuer deploys their
|
|
810
|
-
// own clone via PointTokenFactory.createToken() and tracks the address
|
|
811
|
-
// separately (env var, DB, or factory readout). This field is a
|
|
812
|
-
// historical leftover from v1.4 single-issuer days and has no SDK
|
|
813
|
-
// consumer — kept as dead-zero so any code that mistakenly reads it
|
|
814
|
-
// fails loudly instead of silently routing to a stale token.
|
|
815
|
-
// Known clones (informational, NOT to be used as a default):
|
|
816
|
-
// gg56 (Test Point / TPT) — 0x855c2046AD49AcF9B3B32557176FfCB1a1A38A22
|
|
827
|
+
// Base mainnet — live deployment
|
|
817
828
|
8453: {
|
|
818
|
-
pointToken: PLACEHOLDER_DEAD("dead"),
|
|
819
829
|
batchExecutor: "0xe6Cae83BdE06E4c305530e199D7217f42808555B",
|
|
820
830
|
usdt: "0x3F7e71B150e97316Bb9f363A32c19CcD36ac2382",
|
|
821
831
|
issuerRegistry: "0xAB1d1e117c41636f30bb10194Fe6B774B6Da9E01",
|
|
822
832
|
mintingOracle: "0x2f4cf8C5F8b41efC970c5b46a5d905CeA1f871a0",
|
|
823
833
|
mintFeeWrapper: "0xD324EE2e3220B23d1b1BfbB85f5bC1EF2E917B93",
|
|
824
|
-
pafiHook: PLACEHOLDER_DEAD("dead"),
|
|
825
834
|
chainlinkEthUsd: "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70",
|
|
826
835
|
orderlyRelay: "0xDA082DAce1522c185aeB5A713FcA6fa6B6E99e7f",
|
|
827
836
|
pafiFeeRecipient: "0xa3F71eadEd101513a0151007590020dCFD7C495e",
|
|
@@ -830,13 +839,11 @@ var CONTRACT_ADDRESSES = {
|
|
|
830
839
|
// Base Sepolia — not in active use; placeholders kept so the map
|
|
831
840
|
// compiles for tooling that enumerates chains.
|
|
832
841
|
84532: {
|
|
833
|
-
pointToken: PLACEHOLDER_DEAD("dead"),
|
|
834
842
|
batchExecutor: PLACEHOLDER_DEAD("de01"),
|
|
835
843
|
usdt: PLACEHOLDER_DEAD("dead"),
|
|
836
844
|
issuerRegistry: PLACEHOLDER_DEAD("dead"),
|
|
837
845
|
mintingOracle: PLACEHOLDER_DEAD("dead"),
|
|
838
846
|
mintFeeWrapper: PLACEHOLDER_DEAD("dead"),
|
|
839
|
-
pafiHook: PLACEHOLDER_DEAD("dead"),
|
|
840
847
|
chainlinkEthUsd: PLACEHOLDER_DEAD("de02"),
|
|
841
848
|
orderlyRelay: PLACEHOLDER_DEAD("de03"),
|
|
842
849
|
pafiFeeRecipient: PLACEHOLDER_DEAD("de04"),
|
|
@@ -1004,7 +1011,7 @@ import { parseAbi as parseAbi3 } from "viem";
|
|
|
1004
1011
|
|
|
1005
1012
|
// src/subgraph/pools.ts
|
|
1006
1013
|
import { isAddress } from "viem";
|
|
1007
|
-
var PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-
|
|
1014
|
+
var PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-v4";
|
|
1008
1015
|
var POOL_QUERY = `
|
|
1009
1016
|
query GetPoolForPointToken($id: ID!) {
|
|
1010
1017
|
pafiToken(id: $id) {
|
|
@@ -1012,15 +1019,13 @@ var POOL_QUERY = `
|
|
|
1012
1019
|
pool {
|
|
1013
1020
|
id
|
|
1014
1021
|
feeTier
|
|
1015
|
-
tickSpacing
|
|
1016
|
-
hooks
|
|
1017
1022
|
token0 { id }
|
|
1018
1023
|
token1 { id }
|
|
1019
1024
|
}
|
|
1020
1025
|
}
|
|
1021
1026
|
}
|
|
1022
1027
|
`;
|
|
1023
|
-
function
|
|
1028
|
+
function sortTokens(a, b) {
|
|
1024
1029
|
return a.toLowerCase() < b.toLowerCase() ? [a, b] : [b, a];
|
|
1025
1030
|
}
|
|
1026
1031
|
async function fetchPafiPools(_chainId, pointTokenAddress, subgraphUrl = PAFI_SUBGRAPH_URL) {
|
|
@@ -1042,7 +1047,16 @@ async function fetchPafiPools(_chainId, pointTokenAddress, subgraphUrl = PAFI_SU
|
|
|
1042
1047
|
console.warn(`[fetchPafiPools] subgraph returned ${response.status}`);
|
|
1043
1048
|
return [];
|
|
1044
1049
|
}
|
|
1045
|
-
|
|
1050
|
+
let json;
|
|
1051
|
+
try {
|
|
1052
|
+
json = await response.json();
|
|
1053
|
+
} catch (err) {
|
|
1054
|
+
console.warn(
|
|
1055
|
+
"[fetchPafiPools] subgraph returned non-JSON:",
|
|
1056
|
+
err.message
|
|
1057
|
+
);
|
|
1058
|
+
return [];
|
|
1059
|
+
}
|
|
1046
1060
|
if (json.errors && json.errors.length > 0) {
|
|
1047
1061
|
console.warn(
|
|
1048
1062
|
"[fetchPafiPools] subgraph errors:",
|
|
@@ -1052,20 +1066,18 @@ async function fetchPafiPools(_chainId, pointTokenAddress, subgraphUrl = PAFI_SU
|
|
|
1052
1066
|
}
|
|
1053
1067
|
const pool = json.data?.pafiToken?.pool;
|
|
1054
1068
|
if (!pool) return [];
|
|
1055
|
-
if (!isAddress(pool.
|
|
1069
|
+
if (!isAddress(pool.token0.id) || !isAddress(pool.token1.id) || !Number.isFinite(Number(pool.feeTier))) {
|
|
1056
1070
|
console.error("[fetchPafiPools] invalid pool data in subgraph response \u2014 skipping");
|
|
1057
1071
|
return [];
|
|
1058
1072
|
}
|
|
1059
|
-
const [
|
|
1073
|
+
const [token0, token1] = sortTokens(
|
|
1060
1074
|
pool.token0.id,
|
|
1061
1075
|
pool.token1.id
|
|
1062
1076
|
);
|
|
1063
1077
|
return [{
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
fee: Number(pool.feeTier)
|
|
1067
|
-
tickSpacing: Number(pool.tickSpacing),
|
|
1068
|
-
hooks: pool.hooks
|
|
1078
|
+
token0,
|
|
1079
|
+
token1,
|
|
1080
|
+
fee: Number(pool.feeTier)
|
|
1069
1081
|
}];
|
|
1070
1082
|
}
|
|
1071
1083
|
|
|
@@ -1499,9 +1511,15 @@ var PafiSDK = class {
|
|
|
1499
1511
|
const domain = await this.getDomain();
|
|
1500
1512
|
return signMintRequest(this.requireSigner(), domain, message);
|
|
1501
1513
|
}
|
|
1502
|
-
async verifyMintRequest(message, signature, expectedMinter) {
|
|
1514
|
+
async verifyMintRequest(message, signature, expectedMinter, options) {
|
|
1503
1515
|
const domain = await this.getDomain();
|
|
1504
|
-
return verifyMintRequest(
|
|
1516
|
+
return verifyMintRequest(
|
|
1517
|
+
domain,
|
|
1518
|
+
message,
|
|
1519
|
+
signature,
|
|
1520
|
+
expectedMinter,
|
|
1521
|
+
options
|
|
1522
|
+
);
|
|
1505
1523
|
}
|
|
1506
1524
|
// -------------------------------------------------------------------------
|
|
1507
1525
|
// Contract reads
|
|
@@ -1558,13 +1576,14 @@ export {
|
|
|
1558
1576
|
PAFI_SERVICE_URLS,
|
|
1559
1577
|
PAFI_SUBGRAPH_URL,
|
|
1560
1578
|
PERMIT2_ADDRESS,
|
|
1579
|
+
pointTokenAbi as POINT_TOKEN_ABI,
|
|
1561
1580
|
POINT_TOKEN_FACTORY_ADDRESSES,
|
|
1562
1581
|
POINT_TOKEN_IMPL_ADDRESSES,
|
|
1563
1582
|
POINT_TOKEN_POOLS,
|
|
1564
1583
|
pointTokenAbi as POINT_TOKEN_V2_ABI,
|
|
1565
1584
|
PafiSDK,
|
|
1566
|
-
PafiSDKError,
|
|
1567
1585
|
PafiSdkError,
|
|
1586
|
+
QUOTER_V2_ADDRESSES,
|
|
1568
1587
|
SDK_ERROR_HTTP_STATUS_CODE,
|
|
1569
1588
|
SIMPLE_7702_IMPL_BASE_MAINNET,
|
|
1570
1589
|
SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET,
|
|
@@ -1575,10 +1594,11 @@ export {
|
|
|
1575
1594
|
SimulationError,
|
|
1576
1595
|
TOKEN_HASHES,
|
|
1577
1596
|
UNIVERSAL_ROUTER_ADDRESSES,
|
|
1578
|
-
|
|
1597
|
+
V3_FACTORY_ADDRESSES,
|
|
1598
|
+
V3_POOL_INIT_CODE_HASH,
|
|
1599
|
+
V3_SWAP_ROUTER_ADDRESSES,
|
|
1579
1600
|
ValidationError,
|
|
1580
1601
|
ZERO_VALUE,
|
|
1581
|
-
_resetPaymasterConfigForTests,
|
|
1582
1602
|
assembleUserOperation,
|
|
1583
1603
|
assertDomainMatchesContract,
|
|
1584
1604
|
buildAndSignSponsorAuth,
|
|
@@ -1600,6 +1620,7 @@ export {
|
|
|
1600
1620
|
computeAuthorizationHash,
|
|
1601
1621
|
computeCallDataHash,
|
|
1602
1622
|
computeUserOpHash,
|
|
1623
|
+
computeV3PoolAddress,
|
|
1603
1624
|
createLoginMessage,
|
|
1604
1625
|
createPafiProxyTransport,
|
|
1605
1626
|
decodeBatchExecuteCalls,
|
|
@@ -1607,6 +1628,8 @@ export {
|
|
|
1607
1628
|
delegateDirect,
|
|
1608
1629
|
detectDelegateImpl,
|
|
1609
1630
|
encodeBatchExecute,
|
|
1631
|
+
encodeV3Path,
|
|
1632
|
+
encodeV3PathReversed,
|
|
1610
1633
|
erc20Abi,
|
|
1611
1634
|
erc20ApproveOp,
|
|
1612
1635
|
erc20BurnOp,
|
|
@@ -1623,7 +1646,6 @@ export {
|
|
|
1623
1646
|
getMintRequestNonce,
|
|
1624
1647
|
getPafiServiceUrls,
|
|
1625
1648
|
getPafiWebModalAdapter,
|
|
1626
|
-
getPaymasterConfig,
|
|
1627
1649
|
getPointTokenBalance,
|
|
1628
1650
|
getPointTokenIssuer,
|
|
1629
1651
|
getIssuer as getPointTokenIssuerAddress,
|
|
@@ -1634,7 +1656,6 @@ export {
|
|
|
1634
1656
|
isDelegatedTo,
|
|
1635
1657
|
isDelegatedToTarget,
|
|
1636
1658
|
isMinter,
|
|
1637
|
-
isPaymasterConfigured,
|
|
1638
1659
|
isPaymasterError,
|
|
1639
1660
|
issuerRegistryAbi,
|
|
1640
1661
|
issuerRegistryGetIssuerFlatAbi,
|
|
@@ -1654,13 +1675,12 @@ export {
|
|
|
1654
1675
|
sendWithPaymasterFallback,
|
|
1655
1676
|
serializeUserOpToJsonRpc,
|
|
1656
1677
|
setPafiWebModalAdapter,
|
|
1657
|
-
setPaymasterConfig,
|
|
1658
1678
|
signBurnRequest,
|
|
1659
1679
|
signMintRequest,
|
|
1660
1680
|
signSponsorAuth,
|
|
1661
1681
|
splitAuthorizationSig,
|
|
1662
1682
|
universalRouterAbi,
|
|
1663
|
-
|
|
1683
|
+
v3QuoterV2Abi,
|
|
1664
1684
|
verifyBurnRequest,
|
|
1665
1685
|
verifyLoginMessage,
|
|
1666
1686
|
verifyMintCap,
|