@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.d.ts
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-
|
|
3
|
-
export { B as BestQuote,
|
|
4
|
-
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi,
|
|
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.js';
|
|
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.js';
|
|
4
|
+
export { pointTokenAbi as POINT_TOKEN_ABI, pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v3QuoterV2Abi } from './abi/index.js';
|
|
5
5
|
export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, signBurnRequest, signMintRequest, verifyBurnRequest, verifyMintRequest } from './eip712/index.js';
|
|
6
6
|
export { getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getTokenCap, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.js';
|
|
7
7
|
import { LoginMessageParams } from './auth/index.js';
|
|
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.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* EIP-712 typed data for the
|
|
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
|
-
|
|
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
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
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
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
*
|
|
417
|
-
*
|
|
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
|
-
*
|
|
602
|
-
*
|
|
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
|
|
664
|
-
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
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
|
|
873
|
-
*
|
|
874
|
-
*
|
|
875
|
-
*
|
|
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
|
|
882
|
-
*
|
|
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
|
|
887
|
-
* delegation target. Same on Base mainnet + Base Sepolia. Detected
|
|
888
|
-
*
|
|
889
|
-
*
|
|
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
|
-
*
|
|
930
|
-
*
|
|
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
|
|
1613
|
-
*
|
|
1614
|
-
* ## Status (2026-05-07)
|
|
1690
|
+
* Per-chain deployed contract addresses.
|
|
1615
1691
|
*
|
|
1616
|
-
* Base mainnet (8453):
|
|
1617
|
-
*
|
|
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 —
|
|
1700
|
+
* usdt — Stablecoin used by Uniswap pools
|
|
1634
1701
|
* issuerRegistry — registry of all issuers on this chain
|
|
1635
|
-
* mintingOracle — per-token mint cap enforcer
|
|
1636
|
-
* mintFeeWrapper —
|
|
1637
|
-
*
|
|
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
|
-
*
|
|
1640
|
-
*
|
|
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
|
-
*
|
|
1652
|
-
*
|
|
1653
|
-
*
|
|
1654
|
-
*
|
|
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,17 +1808,20 @@ 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
|
-
* ##
|
|
1811
|
+
* ## Sig-gated mint / burn (no Relayer contract)
|
|
1747
1812
|
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
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_ABI` — full mint + burn + admin surface
|
|
1822
|
+
* (canonical name; not version-suffixed
|
|
1823
|
+
* so future Uniswap fork bumps don't
|
|
1824
|
+
* collide with PointToken internals)
|
|
1757
1825
|
* - `BATCH_EXECUTOR_*` — EIP-7702 delegation target (ABI real,
|
|
1758
1826
|
* address still placeholder on all
|
|
1759
1827
|
* chains until SC delivers)
|
|
@@ -1768,8 +1836,8 @@ declare function getPafiServiceUrls(chainId: number): PafiServiceUrls;
|
|
|
1768
1836
|
|
|
1769
1837
|
/**
|
|
1770
1838
|
* Signature struct — kept for consumers that want the tuple form.
|
|
1771
|
-
*
|
|
1772
|
-
* contract; this struct is only needed if you're manually splitting
|
|
1839
|
+
* The canonical paths pass `bytes` (serialized signature) directly to
|
|
1840
|
+
* the contract; this struct is only needed if you're manually splitting
|
|
1773
1841
|
* for other on-chain verifiers.
|
|
1774
1842
|
*/
|
|
1775
1843
|
interface SignatureStruct {
|
|
@@ -1961,23 +2029,25 @@ declare function getPafiWebModalAdapter(): PafiWebModalAdapter | null;
|
|
|
1961
2029
|
declare function openPafiWebModal(url: string, options?: ModalOpenOptions): Promise<PafiWebModalHandle>;
|
|
1962
2030
|
|
|
1963
2031
|
/**
|
|
1964
|
-
* PAFI-hosted subgraph endpoint — single source of truth across all
|
|
2032
|
+
* PAFI-hosted subgraph endpoint — single source of truth across all
|
|
2033
|
+
* SDK packages.
|
|
1965
2034
|
*
|
|
1966
|
-
*
|
|
1967
|
-
*
|
|
1968
|
-
*
|
|
1969
|
-
* `MintFeeWrapper`, `MintFeeConfig`, `FeeRecipient`, `MintWithFeeEvent`,
|
|
1970
|
-
* `FeeDistribution`. v2 endpoint is kept live as rollback for ~1 week before
|
|
1971
|
-
* removal.
|
|
2035
|
+
* Indexes IssuerRegistry, PointTokenFactory, MintingOracle, and
|
|
2036
|
+
* MintFeeWrapper. Schema entities: `MintFeeWrapper`, `MintFeeConfig`,
|
|
2037
|
+
* `FeeRecipient`, `MintWithFeeEvent`, `FeeDistribution`.
|
|
1972
2038
|
*/
|
|
1973
|
-
declare const PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-
|
|
2039
|
+
declare const PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-v4";
|
|
1974
2040
|
/**
|
|
1975
|
-
* Fetch the Uniswap
|
|
2041
|
+
* Fetch the Uniswap V3 pool(s) for a PAFI PointToken from the subgraph.
|
|
1976
2042
|
*
|
|
1977
2043
|
* Browser and Node compatible — uses globalThis.fetch. Returns an empty
|
|
1978
2044
|
* array (never throws) when the token has no pool yet or the subgraph is
|
|
1979
2045
|
* unreachable, so callers can show "quote unavailable" without crashing.
|
|
1980
2046
|
*
|
|
2047
|
+
* Tolerates subgraph responses still carrying the V4-era `tickSpacing`
|
|
2048
|
+
* and `hooks` fields — those are silently ignored. Subgraph migration
|
|
2049
|
+
* can land independently of the SDK migration.
|
|
2050
|
+
*
|
|
1981
2051
|
* @param chainId - Chain ID (reserved for multi-subgraph routing; currently unused)
|
|
1982
2052
|
* @param pointTokenAddress - The PointToken contract address
|
|
1983
2053
|
* @param subgraphUrl - Override the default PAFI subgraph URL
|
|
@@ -2037,11 +2107,11 @@ declare class PafiSDK {
|
|
|
2037
2107
|
message: MintRequest;
|
|
2038
2108
|
}>;
|
|
2039
2109
|
signMintRequest(message: MintRequest): Promise<EIP712Signature>;
|
|
2040
|
-
verifyMintRequest(message: MintRequest, signature: Hex, expectedMinter: Address): Promise<SignatureVerification>;
|
|
2110
|
+
verifyMintRequest(message: MintRequest, signature: Hex, expectedMinter: Address, options?: SignatureVerifyOptions): Promise<SignatureVerification>;
|
|
2041
2111
|
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
2042
2112
|
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
2043
2113
|
/** Sign a login message string with the current signer (personal_sign) */
|
|
2044
2114
|
signLoginMessage(message: string): Promise<Hex>;
|
|
2045
2115
|
}
|
|
2046
2116
|
|
|
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,
|
|
2117
|
+
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 };
|