@pafi-dev/core 0.5.3 → 0.5.4
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/dist/{chunk-YU7MFR6Y.cjs → chunk-B3PYJGTH.cjs} +14 -2
- package/dist/chunk-B3PYJGTH.cjs.map +1 -0
- package/dist/{chunk-CQCSQPWG.cjs → chunk-G6IUSI5S.cjs} +1 -1
- package/dist/{chunk-CQCSQPWG.cjs.map → chunk-G6IUSI5S.cjs.map} +1 -1
- package/dist/{chunk-QGO6X6LG.js → chunk-HZTR4RHR.js} +1 -1
- package/dist/chunk-HZTR4RHR.js.map +1 -0
- package/dist/{chunk-T6Y32SNK.js → chunk-MWKJODJE.js} +14 -2
- package/dist/{chunk-T6Y32SNK.js.map → chunk-MWKJODJE.js.map} +1 -1
- package/dist/contract/index.cjs +2 -2
- package/dist/contract/index.js +1 -1
- package/dist/index.cjs +43 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -2
- package/dist/index.js.map +1 -1
- package/dist/swap/index.cjs +2 -2
- package/dist/swap/index.js +1 -1
- package/package.json +1 -1
- package/dist/abi/index.d.cts +0 -2194
- package/dist/abi/index.d.ts +0 -2194
- package/dist/auth/index.d.cts +0 -151
- package/dist/auth/index.d.ts +0 -151
- package/dist/chunk-QGO6X6LG.js.map +0 -1
- package/dist/chunk-YU7MFR6Y.cjs.map +0 -1
- package/dist/contract/index.d.cts +0 -22
- package/dist/contract/index.d.ts +0 -22
- package/dist/eip712/index.d.cts +0 -125
- package/dist/eip712/index.d.ts +0 -125
- package/dist/index-BEx-Q1bW.d.cts +0 -227
- package/dist/index-r4xCdQO7.d.ts +0 -227
- package/dist/index.d.cts +0 -1607
- package/dist/index.d.ts +0 -1607
- package/dist/quoting/index.d.cts +0 -59
- package/dist/quoting/index.d.ts +0 -59
- package/dist/swap/index.d.cts +0 -3
- package/dist/swap/index.d.ts +0 -3
- package/dist/types-b5_Tokjl.d.cts +0 -89
- package/dist/types-b5_Tokjl.d.ts +0 -89
package/dist/index.d.cts
DELETED
|
@@ -1,1607 +0,0 @@
|
|
|
1
|
-
import { Address, Hex, PublicClient, HttpTransport, WalletClient } from 'viem';
|
|
2
|
-
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification, B as BestQuote, Q as QuoteResult } from './types-b5_Tokjl.cjs';
|
|
3
|
-
export { c as BurnRequest, I as Issuer, d as PathKey } from './types-b5_Tokjl.cjs';
|
|
4
|
-
export { erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
|
|
5
|
-
export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.cjs';
|
|
6
|
-
export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.cjs';
|
|
7
|
-
export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle } from './quoting/index.cjs';
|
|
8
|
-
import { P as PartialUserOperation, O as Operation, U as UserOperation, S as SwapSimulationResult } from './index-BEx-Q1bW.cjs';
|
|
9
|
-
export { B as BuildSwapWithGasDeductionParams, a as PaymasterFields, b as SETTLE_ALL, c as SWAP_EXACT_IN, T as TAKE_ALL, d as UserOpReceipt, V as V4_SWAP, Z as ZERO_VALUE, e as buildErc20ApprovalCalldata, f as buildPermit2ApprovalCalldata, g as buildSwapFromQuote, h as buildSwapWithGasDeduction, i as buildUniversalRouterExecuteArgs, j as buildV4SwapInput, k as checkAllowance, s as simulateSwap } from './index-BEx-Q1bW.cjs';
|
|
10
|
-
import { LoginMessageParams } from './auth/index.cjs';
|
|
11
|
-
export { SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.cjs';
|
|
12
|
-
|
|
13
|
-
declare const mintRequestTypes: {
|
|
14
|
-
readonly MintRequest: readonly [{
|
|
15
|
-
readonly name: "to";
|
|
16
|
-
readonly type: "address";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "amount";
|
|
19
|
-
readonly type: "uint256";
|
|
20
|
-
}, {
|
|
21
|
-
readonly name: "nonce";
|
|
22
|
-
readonly type: "uint256";
|
|
23
|
-
}, {
|
|
24
|
-
readonly name: "deadline";
|
|
25
|
-
readonly type: "uint256";
|
|
26
|
-
}];
|
|
27
|
-
};
|
|
28
|
-
declare const burnRequestTypes: {
|
|
29
|
-
readonly BurnRequest: readonly [{
|
|
30
|
-
readonly name: "from";
|
|
31
|
-
readonly type: "address";
|
|
32
|
-
}, {
|
|
33
|
-
readonly name: "amount";
|
|
34
|
-
readonly type: "uint256";
|
|
35
|
-
}, {
|
|
36
|
-
readonly name: "nonce";
|
|
37
|
-
readonly type: "uint256";
|
|
38
|
-
}, {
|
|
39
|
-
readonly name: "deadline";
|
|
40
|
-
readonly type: "uint256";
|
|
41
|
-
}];
|
|
42
|
-
};
|
|
43
|
-
declare const receiverConsentTypes: {
|
|
44
|
-
readonly ReceiverConsent: readonly [{
|
|
45
|
-
readonly name: "onBehalfOf";
|
|
46
|
-
readonly type: "address";
|
|
47
|
-
}, {
|
|
48
|
-
readonly name: "originalReceiver";
|
|
49
|
-
readonly type: "address";
|
|
50
|
-
}, {
|
|
51
|
-
readonly name: "amount";
|
|
52
|
-
readonly type: "uint256";
|
|
53
|
-
}, {
|
|
54
|
-
readonly name: "nonce";
|
|
55
|
-
readonly type: "uint256";
|
|
56
|
-
}, {
|
|
57
|
-
readonly name: "deadline";
|
|
58
|
-
readonly type: "uint256";
|
|
59
|
-
}, {
|
|
60
|
-
readonly name: "extData";
|
|
61
|
-
readonly type: "bytes";
|
|
62
|
-
}];
|
|
63
|
-
};
|
|
64
|
-
declare const SUPPORTED_CHAINS: Record<number, ChainConfig>;
|
|
65
|
-
declare const V4_QUOTER_ADDRESSES: Record<number, Address>;
|
|
66
|
-
declare const UNIVERSAL_ROUTER_ADDRESSES: Record<number, Address>;
|
|
67
|
-
declare const COMMON_TOKENS: Record<number, Record<string, Address>>;
|
|
68
|
-
declare const COMMON_POOLS: Record<number, PoolKey[]>;
|
|
69
|
-
declare const POINT_TOKEN_POOLS: Record<number, Record<Address, PoolKey[]>>;
|
|
70
|
-
/** ERC-4337 v0.7 EntryPoint — deployed deterministically across all EVM chains. */
|
|
71
|
-
declare const ENTRY_POINT_V07: Address;
|
|
72
|
-
/** Permit2 — Uniswap's universal approval contract, same address on all EVM chains. */
|
|
73
|
-
declare const PERMIT2_ADDRESS: Address;
|
|
74
|
-
|
|
75
|
-
declare class PafiSDKError extends Error {
|
|
76
|
-
constructor(message: string);
|
|
77
|
-
}
|
|
78
|
-
declare class ConfigurationError extends PafiSDKError {
|
|
79
|
-
constructor(message: string);
|
|
80
|
-
}
|
|
81
|
-
declare class SigningError extends PafiSDKError {
|
|
82
|
-
constructor(message: string);
|
|
83
|
-
}
|
|
84
|
-
declare class SimulationError extends PafiSDKError {
|
|
85
|
-
operation: string;
|
|
86
|
-
reason: string;
|
|
87
|
-
constructor(operation: string, reason: string);
|
|
88
|
-
}
|
|
89
|
-
declare class ApiError extends PafiSDKError {
|
|
90
|
-
status?: number | undefined;
|
|
91
|
-
constructor(message: string, status?: number | undefined);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Orderly Network Vault — entrypoint for **perp deposit** flow on
|
|
96
|
-
* Base mainnet (Scenario 3).
|
|
97
|
-
*
|
|
98
|
-
* Source of truth for addresses + integration:
|
|
99
|
-
* https://orderly.network/docs/build-on-omnichain/addresses#base
|
|
100
|
-
*
|
|
101
|
-
* ## Architecture
|
|
102
|
-
*
|
|
103
|
-
* User wallet (Base)
|
|
104
|
-
* │ 1. USDC.approve(vault, amount)
|
|
105
|
-
* │ 2. vault.deposit{value: layerZeroFee}({
|
|
106
|
-
* │ accountId, brokerHash, tokenHash, tokenAmount
|
|
107
|
-
* │ })
|
|
108
|
-
* ▼
|
|
109
|
-
* OrderlyVault (Base)
|
|
110
|
-
* │ — locks USDC, emits LayerZero message
|
|
111
|
-
* ▼
|
|
112
|
-
* Orderly chain (off-chain matching engine)
|
|
113
|
-
* │ — credits the user's perp account
|
|
114
|
-
* ▼
|
|
115
|
-
* User can now place perp orders via Orderly REST/WS API
|
|
116
|
-
*
|
|
117
|
-
* **Important:** `value` is required and is the LayerZero cross-chain
|
|
118
|
-
* fee (paid in native ETH on Base). Quote it via
|
|
119
|
-
* `vault.getDepositFee(user, data)` BEFORE calling deposit. Fees vary
|
|
120
|
-
* with destination chain congestion.
|
|
121
|
-
*
|
|
122
|
-
* ## Sponsored vs direct
|
|
123
|
-
*
|
|
124
|
-
* ERC-4337 paymasters sponsor GAS, not `msg.value`. Even on the
|
|
125
|
-
* sponsored path the user MUST hold enough native ETH on Base to cover
|
|
126
|
-
* `getDepositFee()` (typically ~0.0002 ETH at quiet times).
|
|
127
|
-
*/
|
|
128
|
-
/** Orderly Vault on Base mainnet (EIP-55 checksum). */
|
|
129
|
-
declare const ORDERLY_VAULT_BASE_MAINNET: Address;
|
|
130
|
-
/**
|
|
131
|
-
* Per-chain registry of the Orderly Vault. Add chains here as Orderly
|
|
132
|
-
* deploys them.
|
|
133
|
-
*/
|
|
134
|
-
declare const ORDERLY_VAULT_ADDRESSES: Record<number, Address>;
|
|
135
|
-
/**
|
|
136
|
-
* Pre-computed broker hashes — `keccak256(abi.encodePacked(brokerId))`.
|
|
137
|
-
* Add new brokers as they launch.
|
|
138
|
-
*
|
|
139
|
-
* Reference: https://orderly.network/docs/build-on-omnichain/user-flows/accountId
|
|
140
|
-
*/
|
|
141
|
-
declare const BROKER_HASHES: {
|
|
142
|
-
/** Default partner broker on Base — most commonly whitelisted. */
|
|
143
|
-
readonly woofi_pro: `0x${string}`;
|
|
144
|
-
/** Orderly's own white-label broker. */
|
|
145
|
-
readonly orderly: `0x${string}`;
|
|
146
|
-
/** LogX. */
|
|
147
|
-
readonly logx: `0x${string}`;
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Pre-computed token hashes — `keccak256(abi.encodePacked(tokenSymbol))`.
|
|
151
|
-
* The hash maps to the actual ERC-20 address on each chain via
|
|
152
|
-
* `vault.getAllowedToken(tokenHash)`.
|
|
153
|
-
*
|
|
154
|
-
* Note: Orderly canonicalises by symbol (USDC, not "USD Coin").
|
|
155
|
-
*/
|
|
156
|
-
declare const TOKEN_HASHES: {
|
|
157
|
-
readonly USDC: `0x${string}`;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Compute Orderly's `accountId` — uniquely identifies a user+broker
|
|
161
|
-
* tuple. Matches the off-chain formula used by the Orderly SDK so
|
|
162
|
-
* deposits + future REST API calls reference the same account.
|
|
163
|
-
*
|
|
164
|
-
* accountId = keccak256(abi.encode(user, brokerHash))
|
|
165
|
-
*
|
|
166
|
-
* Note `abi.encode` (not `encodePacked`) — uses 32-byte left-padding.
|
|
167
|
-
*/
|
|
168
|
-
declare function computeAccountId(user: Address, brokerHash: Hex): Hex;
|
|
169
|
-
/**
|
|
170
|
-
* Minimal Orderly Vault ABI — just the functions PAFI needs for
|
|
171
|
-
* Scenario 3 (perp deposit). Full ABI is on Orderly's docs site.
|
|
172
|
-
*/
|
|
173
|
-
declare const ORDERLY_VAULT_ABI: readonly [{
|
|
174
|
-
readonly type: "function";
|
|
175
|
-
readonly name: "deposit";
|
|
176
|
-
readonly stateMutability: "payable";
|
|
177
|
-
readonly inputs: readonly [{
|
|
178
|
-
readonly name: "data";
|
|
179
|
-
readonly type: "tuple";
|
|
180
|
-
readonly components: readonly [{
|
|
181
|
-
readonly name: "accountId";
|
|
182
|
-
readonly type: "bytes32";
|
|
183
|
-
}, {
|
|
184
|
-
readonly name: "brokerHash";
|
|
185
|
-
readonly type: "bytes32";
|
|
186
|
-
}, {
|
|
187
|
-
readonly name: "tokenHash";
|
|
188
|
-
readonly type: "bytes32";
|
|
189
|
-
}, {
|
|
190
|
-
readonly name: "tokenAmount";
|
|
191
|
-
readonly type: "uint128";
|
|
192
|
-
}];
|
|
193
|
-
}];
|
|
194
|
-
readonly outputs: readonly [];
|
|
195
|
-
}, {
|
|
196
|
-
readonly type: "function";
|
|
197
|
-
readonly name: "getDepositFee";
|
|
198
|
-
readonly stateMutability: "view";
|
|
199
|
-
readonly inputs: readonly [{
|
|
200
|
-
readonly name: "user";
|
|
201
|
-
readonly type: "address";
|
|
202
|
-
}, {
|
|
203
|
-
readonly name: "data";
|
|
204
|
-
readonly type: "tuple";
|
|
205
|
-
readonly components: readonly [{
|
|
206
|
-
readonly name: "accountId";
|
|
207
|
-
readonly type: "bytes32";
|
|
208
|
-
}, {
|
|
209
|
-
readonly name: "brokerHash";
|
|
210
|
-
readonly type: "bytes32";
|
|
211
|
-
}, {
|
|
212
|
-
readonly name: "tokenHash";
|
|
213
|
-
readonly type: "bytes32";
|
|
214
|
-
}, {
|
|
215
|
-
readonly name: "tokenAmount";
|
|
216
|
-
readonly type: "uint128";
|
|
217
|
-
}];
|
|
218
|
-
}];
|
|
219
|
-
readonly outputs: readonly [{
|
|
220
|
-
readonly name: "";
|
|
221
|
-
readonly type: "uint256";
|
|
222
|
-
}];
|
|
223
|
-
}, {
|
|
224
|
-
readonly type: "function";
|
|
225
|
-
readonly name: "getAllowedBroker";
|
|
226
|
-
readonly stateMutability: "view";
|
|
227
|
-
readonly inputs: readonly [{
|
|
228
|
-
readonly name: "brokerHash";
|
|
229
|
-
readonly type: "bytes32";
|
|
230
|
-
}];
|
|
231
|
-
readonly outputs: readonly [{
|
|
232
|
-
readonly name: "";
|
|
233
|
-
readonly type: "bool";
|
|
234
|
-
}];
|
|
235
|
-
}, {
|
|
236
|
-
readonly type: "function";
|
|
237
|
-
readonly name: "getAllowedToken";
|
|
238
|
-
readonly stateMutability: "view";
|
|
239
|
-
readonly inputs: readonly [{
|
|
240
|
-
readonly name: "tokenHash";
|
|
241
|
-
readonly type: "bytes32";
|
|
242
|
-
}];
|
|
243
|
-
readonly outputs: readonly [{
|
|
244
|
-
readonly name: "";
|
|
245
|
-
readonly type: "address";
|
|
246
|
-
}];
|
|
247
|
-
}];
|
|
248
|
-
/** Struct mirror of `IOrderlyVault.VaultDepositFE` for type-safe builders. */
|
|
249
|
-
interface VaultDepositFE {
|
|
250
|
-
accountId: Hex;
|
|
251
|
-
brokerHash: Hex;
|
|
252
|
-
tokenHash: Hex;
|
|
253
|
-
/** uint128 — USDC has 6 decimals. */
|
|
254
|
-
tokenAmount: bigint;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* v1.5 — Scenario 3: deposit USDC from the user's wallet into the
|
|
259
|
-
* Orderly perp Vault on Base mainnet.
|
|
260
|
-
*
|
|
261
|
-
* Builds a `PartialUserOperation` packaging the 2 inner calls:
|
|
262
|
-
*
|
|
263
|
-
* 1. `USDC.approve(orderlyVault, amount)` — let the Vault pull USDC
|
|
264
|
-
* 2. `OrderlyVault.deposit{value: layerZeroFee}(VaultDepositFE)` —
|
|
265
|
-
* transfer USDC into the Vault + emit a LayerZero message that
|
|
266
|
-
* credits the user's perp account on the Orderly chain
|
|
267
|
-
*
|
|
268
|
-
* ## ⚠️ Native ETH constraint
|
|
269
|
-
*
|
|
270
|
-
* Coinbase Paymaster sponsors GAS, **not `msg.value`**. The LayerZero
|
|
271
|
-
* cross-chain fee MUST come from the user's own native ETH balance on
|
|
272
|
-
* Base — even when the rest of the UserOp is sponsored.
|
|
273
|
-
*
|
|
274
|
-
* Quote the fee BEFORE calling this builder via:
|
|
275
|
-
*
|
|
276
|
-
* const fee = await client.readContract({
|
|
277
|
-
* address: orderlyVault,
|
|
278
|
-
* abi: ORDERLY_VAULT_ABI,
|
|
279
|
-
* functionName: 'getDepositFee',
|
|
280
|
-
* args: [user, depositData],
|
|
281
|
-
* });
|
|
282
|
-
*
|
|
283
|
-
* If `user.eth < fee`, surface this error to the FE so the user can
|
|
284
|
-
* top up before retrying — the Vault `deposit{value: 0}` call will
|
|
285
|
-
* revert otherwise.
|
|
286
|
-
*
|
|
287
|
-
* ## Why no PT/USDC fee deduction?
|
|
288
|
-
*
|
|
289
|
-
* Unlike Scenario 1/2/4 which deduct an operator fee in PT/USDC inside
|
|
290
|
-
* the batch, perp deposit doesn't append a fee transfer because:
|
|
291
|
-
*
|
|
292
|
-
* - User is paying Orderly's LayerZero fee directly via `msg.value`
|
|
293
|
-
* - There's no PAFI-specific operator cost on top — Orderly handles
|
|
294
|
-
* the off-chain accounting once the LayerZero message lands
|
|
295
|
-
*
|
|
296
|
-
* If we want to charge a PAFI service fee on top later, append a
|
|
297
|
-
* `USDC.transfer(feeRecipient, fee)` op — same pattern as the swap
|
|
298
|
-
* builder.
|
|
299
|
-
*/
|
|
300
|
-
interface BuildPerpDepositWithGasDeductionParams {
|
|
301
|
-
/** User EOA (will be `msg.sender` via EIP-7702 delegation). */
|
|
302
|
-
userAddress: Address;
|
|
303
|
-
/** ERC-4337 account nonce — fetched from EntryPoint by the caller. */
|
|
304
|
-
aaNonce: bigint;
|
|
305
|
-
/** Chain ID for Orderly Vault address resolution. */
|
|
306
|
-
chainId: number;
|
|
307
|
-
/**
|
|
308
|
-
* Override Orderly Vault address (e.g. for fork tests). Defaults to
|
|
309
|
-
* `ORDERLY_VAULT_ADDRESSES[chainId]`.
|
|
310
|
-
*/
|
|
311
|
-
vaultAddress?: Address;
|
|
312
|
-
/**
|
|
313
|
-
* USDC ERC-20 address — the actual token Orderly accepts. Caller
|
|
314
|
-
* resolves this via `vault.getAllowedToken(TOKEN_HASHES.USDC)` so we
|
|
315
|
-
* don't hardcode the wrong USDC variant (native vs bridged).
|
|
316
|
-
*/
|
|
317
|
-
usdcAddress: Address;
|
|
318
|
-
/** USDC amount to deposit (uint128, 6 decimals). */
|
|
319
|
-
amount: bigint;
|
|
320
|
-
/**
|
|
321
|
-
* Pre-built `VaultDepositFE` struct — caller computes accountId via
|
|
322
|
-
* `computeAccountId(user, brokerHash)` and supplies tokenHash.
|
|
323
|
-
*/
|
|
324
|
-
depositData: VaultDepositFE;
|
|
325
|
-
/**
|
|
326
|
-
* LayerZero fee in wei — from `vault.getDepositFee(user, data)`.
|
|
327
|
-
* Becomes the `msg.value` on the `deposit()` call. User MUST hold
|
|
328
|
-
* ≥ this much native ETH or the call reverts.
|
|
329
|
-
*/
|
|
330
|
-
layerZeroFee: bigint;
|
|
331
|
-
gasLimits?: {
|
|
332
|
-
callGasLimit?: bigint;
|
|
333
|
-
verificationGasLimit?: bigint;
|
|
334
|
-
preVerificationGas?: bigint;
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Build an unsigned UserOp for Scenario 3. Returns a
|
|
339
|
-
* `PartialUserOperation` — caller attaches paymaster sponsorship for
|
|
340
|
-
* gas + the user's UserOp-hash signature, then submits to the Bundler.
|
|
341
|
-
*/
|
|
342
|
-
declare function buildPerpDepositWithGasDeduction(params: BuildPerpDepositWithGasDeductionParams): PartialUserOperation;
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Build an ERC-20 `transfer(to, amount)` operation. Used inside a batch
|
|
346
|
-
* to move fee tokens from the user to the fee recipient atomically with
|
|
347
|
-
* the main action.
|
|
348
|
-
*/
|
|
349
|
-
declare function erc20TransferOp(token: Address, to: Address, amount: bigint): Operation;
|
|
350
|
-
/**
|
|
351
|
-
* Build an ERC-20 `approve(spender, amount)` operation. Used inside a
|
|
352
|
-
* batch before a swap / deposit call so the AMM / protocol can pull
|
|
353
|
-
* tokens from the user.
|
|
354
|
-
*/
|
|
355
|
-
declare function erc20ApproveOp(token: Address, spender: Address, amount: bigint): Operation;
|
|
356
|
-
/**
|
|
357
|
-
* Build an ERC-20 `burn(amount)` operation (OpenZeppelin ERC20Burnable
|
|
358
|
-
* extension). Burns from `msg.sender`, which — via EIP-7702 — is the
|
|
359
|
-
* user's EOA.
|
|
360
|
-
*
|
|
361
|
-
* Requires the PointToken contract to expose a public `burn(uint256)`
|
|
362
|
-
* without a role check. See
|
|
363
|
-
* [SDK_V1.4_TASKS.md §11 — PointToken.burn callable via batch].
|
|
364
|
-
*/
|
|
365
|
-
declare function erc20BurnOp(token: Address, amount: bigint): Operation;
|
|
366
|
-
/**
|
|
367
|
-
* Build a raw call operation with caller-supplied calldata. Useful for
|
|
368
|
-
* non-ERC-20 contracts (PoolManager.swap, PerpDEX.deposit, Relayer.mint)
|
|
369
|
-
* where the encoding is specific to that protocol.
|
|
370
|
-
*/
|
|
371
|
-
declare function rawCallOp(target: Address, data: `0x${string}`, value?: bigint): Operation;
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Standard BatchExecutor ABI — a contract that takes an array of calls
|
|
375
|
-
* and invokes each one in sequence, reverting all if any fail.
|
|
376
|
-
*
|
|
377
|
-
* Compatible with OpenZeppelin `Account.execute(Call[])`, Biconomy
|
|
378
|
-
* `executeBatch`, Safe `MultiSend`, and most EIP-7702 delegation
|
|
379
|
-
* targets. The exact deployed address is supplied by the infra team
|
|
380
|
-
* (see [V1.4_V1.5_READINESS.md B2]).
|
|
381
|
-
*/
|
|
382
|
-
declare const BATCH_EXECUTOR_ABI: readonly [{
|
|
383
|
-
readonly name: "execute";
|
|
384
|
-
readonly type: "function";
|
|
385
|
-
readonly stateMutability: "nonpayable";
|
|
386
|
-
readonly inputs: readonly [{
|
|
387
|
-
readonly type: "tuple[]";
|
|
388
|
-
readonly components: readonly [{
|
|
389
|
-
readonly type: "address";
|
|
390
|
-
readonly name: "target";
|
|
391
|
-
}, {
|
|
392
|
-
readonly type: "uint256";
|
|
393
|
-
readonly name: "value";
|
|
394
|
-
}, {
|
|
395
|
-
readonly type: "bytes";
|
|
396
|
-
readonly name: "data";
|
|
397
|
-
}];
|
|
398
|
-
readonly name: "calls";
|
|
399
|
-
}];
|
|
400
|
-
readonly outputs: readonly [];
|
|
401
|
-
}];
|
|
402
|
-
/**
|
|
403
|
-
* Encode a batch of operations into calldata for `BatchExecutor.execute()`.
|
|
404
|
-
* The resulting calldata goes into `UserOperation.callData`.
|
|
405
|
-
*
|
|
406
|
-
* When the EOA has an EIP-7702 delegation to a BatchExecutor, calling
|
|
407
|
-
* this calldata against the EOA runs all operations with
|
|
408
|
-
* `msg.sender = EOA` for each inner call.
|
|
409
|
-
*
|
|
410
|
-
* @param operations batch of calls, in execution order
|
|
411
|
-
* @returns calldata bytes for `execute((address,uint256,bytes)[])`
|
|
412
|
-
*/
|
|
413
|
-
declare function encodeBatchExecute(operations: Operation[]): Hex;
|
|
414
|
-
|
|
415
|
-
interface BuildPartialUserOpParams {
|
|
416
|
-
/** User's EOA (with EIP-7702 delegation). */
|
|
417
|
-
sender: Address;
|
|
418
|
-
/** Batch of operations — encoded into callData via `encodeBatchExecute`. */
|
|
419
|
-
operations: Operation[];
|
|
420
|
-
/** EntryPoint nonce for this sender. Caller fetches from the EntryPoint contract. */
|
|
421
|
-
nonce: bigint;
|
|
422
|
-
/** Optional gas overrides; bundler re-estimates before submission. */
|
|
423
|
-
gasLimits?: {
|
|
424
|
-
callGasLimit?: bigint;
|
|
425
|
-
verificationGasLimit?: bigint;
|
|
426
|
-
preVerificationGas?: bigint;
|
|
427
|
-
};
|
|
428
|
-
/** Optional fee overrides; bundler usually fills these. */
|
|
429
|
-
feeOverrides?: {
|
|
430
|
-
maxFeePerGas?: bigint;
|
|
431
|
-
maxPriorityFeePerGas?: bigint;
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Build a partial ERC-4337 UserOperation from a batch of operations.
|
|
436
|
-
* Paymaster fields and signature are populated later:
|
|
437
|
-
* 1. Call `PafiBackendClient.requestSponsorship()` → get paymaster fields
|
|
438
|
-
* 2. Compute userOpHash and have the user sign it (via Privy)
|
|
439
|
-
* 3. Attach `signature` → submit to bundler
|
|
440
|
-
*
|
|
441
|
-
* This function is a pure struct builder — no network calls.
|
|
442
|
-
*/
|
|
443
|
-
declare function buildPartialUserOperation(params: BuildPartialUserOpParams): PartialUserOperation;
|
|
444
|
-
/**
|
|
445
|
-
* Assemble a full UserOperation once paymaster fields + signature are
|
|
446
|
-
* known. Used after `PafiBackendClient.requestSponsorship()` and user
|
|
447
|
-
* signing complete.
|
|
448
|
-
*/
|
|
449
|
-
declare function assembleUserOperation(partial: PartialUserOperation, paymaster: {
|
|
450
|
-
paymaster: Address;
|
|
451
|
-
paymasterData: `0x${string}`;
|
|
452
|
-
paymasterVerificationGasLimit: bigint;
|
|
453
|
-
paymasterPostOpGasLimit: bigint;
|
|
454
|
-
}, signature: `0x${string}`): UserOperation;
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* ERC-4337 v0.7 UserOp hash, matching EntryPoint._hashUserOp().
|
|
458
|
-
*
|
|
459
|
-
* The returned hash is what the user signs via personal_sign / eth_sign.
|
|
460
|
-
* Paymaster fields are included when present — they must match exactly
|
|
461
|
-
* what was sent to the bundler, or signature recovery fails on-chain.
|
|
462
|
-
*
|
|
463
|
-
* Use this on the **backend** (mobile prepare/submit pattern) to compute
|
|
464
|
-
* the hash before returning it to the mobile client for signing.
|
|
465
|
-
*/
|
|
466
|
-
declare function computeUserOpHash(userOp: {
|
|
467
|
-
sender: Address;
|
|
468
|
-
nonce: bigint;
|
|
469
|
-
callData: Hex;
|
|
470
|
-
callGasLimit: bigint;
|
|
471
|
-
verificationGasLimit: bigint;
|
|
472
|
-
preVerificationGas: bigint;
|
|
473
|
-
maxFeePerGas: bigint;
|
|
474
|
-
maxPriorityFeePerGas: bigint;
|
|
475
|
-
paymaster?: Address;
|
|
476
|
-
paymasterVerificationGasLimit?: bigint;
|
|
477
|
-
paymasterPostOpGasLimit?: bigint;
|
|
478
|
-
paymasterData?: Hex;
|
|
479
|
-
}, chainId: number): Hex;
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Module-level paymaster config shared by all batch builders and the
|
|
483
|
-
* `@pafi/issuer` RelayService. Holds the fee recipient address and the
|
|
484
|
-
* PAFI-assigned issuer identity.
|
|
485
|
-
*
|
|
486
|
-
* v1.4 update: the paymaster endpoint is **PAFI Backend**, which proxies
|
|
487
|
-
* to Coinbase Paymaster. See [SPONSORED_PATH_FLOW.md].
|
|
488
|
-
*/
|
|
489
|
-
interface PaymasterConfig {
|
|
490
|
-
/**
|
|
491
|
-
* PAFI Backend API base URL. Example:
|
|
492
|
-
* https://api.pacificfinance.org/paymaster
|
|
493
|
-
*/
|
|
494
|
-
pafiBackendUrl: string;
|
|
495
|
-
/** PAFI-assigned issuer ID. Passed in X-Issuer-Id header. */
|
|
496
|
-
issuerId: string;
|
|
497
|
-
/** Per-issuer API key (or JWT) for Authorization header. */
|
|
498
|
-
apiKey: string;
|
|
499
|
-
/**
|
|
500
|
-
* Where the fee transfer lands inside the batch call. Fee recovery is
|
|
501
|
-
* application-level — Paymaster sponsors gas, fee is a separate
|
|
502
|
-
* ERC-20 transfer inside the batch that reimburses the issuer.
|
|
503
|
-
*/
|
|
504
|
-
feeRecipient: Address;
|
|
505
|
-
/** EIP-4337 EntryPoint address. Default: v0.7 (same across chains). */
|
|
506
|
-
entryPoint?: Address;
|
|
507
|
-
/** Chain ID the paymaster sponsors on. Defaults to consumer config. */
|
|
508
|
-
chainId?: number;
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Which PAFI-defined scenario this UserOp represents. PAFI Backend
|
|
512
|
-
* validates the request's target contracts + function selectors
|
|
513
|
-
* match the expected pattern for the scenario.
|
|
514
|
-
*/
|
|
515
|
-
type SponsorshipScenario = "mint" | "burn" | "swap" | "perp-deposit";
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* Set the application-wide paymaster config. Safe to call multiple
|
|
519
|
-
* times (later calls override earlier). Throws if required fields
|
|
520
|
-
* are missing.
|
|
521
|
-
*/
|
|
522
|
-
declare function setPaymasterConfig(config: PaymasterConfig): void;
|
|
523
|
-
/**
|
|
524
|
-
* Get the current paymaster config. Throws if `setPaymasterConfig()`
|
|
525
|
-
* has not been called yet — this surfaces boot-order bugs early
|
|
526
|
-
* instead of failing with "paymaster.feeRecipient is undefined" at
|
|
527
|
-
* the point of use.
|
|
528
|
-
*/
|
|
529
|
-
declare function getPaymasterConfig(): PaymasterConfig;
|
|
530
|
-
/** Test helper — clear the singleton. */
|
|
531
|
-
declare function _resetPaymasterConfigForTests(): void;
|
|
532
|
-
/** Check whether paymaster config has been initialized. */
|
|
533
|
-
declare function isPaymasterConfigured(): boolean;
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Submission path chosen by `checkEthAndBranch`.
|
|
537
|
-
* - `normal`: initiator has enough ETH; submit via `walletClient.writeContract`
|
|
538
|
-
* or a plain `eth_sendRawTransaction`. No paymaster round-trip.
|
|
539
|
-
* - `paymaster`: initiator doesn't have enough ETH; wrap the batch as a
|
|
540
|
-
* UserOperation and route through PAFI Backend → Coinbase Paymaster
|
|
541
|
-
* → Bundler.
|
|
542
|
-
*/
|
|
543
|
-
type SubmissionPath = "normal" | "paymaster";
|
|
544
|
-
interface CheckEthAndBranchParams {
|
|
545
|
-
/** viem PublicClient bound to the target chain. */
|
|
546
|
-
client: PublicClient;
|
|
547
|
-
/** The address whose ETH balance we check. */
|
|
548
|
-
initiator: Address;
|
|
549
|
-
/** Estimated gas cost in wei for the upcoming tx. */
|
|
550
|
-
estimatedGasWei: bigint;
|
|
551
|
-
/**
|
|
552
|
-
* Optional safety margin multiplier (basis points). Defaults to
|
|
553
|
-
* 11_000 (110%) — the initiator needs 10% above the estimate to
|
|
554
|
-
* qualify for the normal path. Prevents edge cases where gas price
|
|
555
|
-
* spikes between estimation and submission cause a "has enough"
|
|
556
|
-
* decision to fail at broadcast time.
|
|
557
|
-
*/
|
|
558
|
-
marginBps?: number;
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* Step 3 of the Generalized Flow ([SPONSORED_PATH_FLOW.md §2]):
|
|
562
|
-
* choose between the normal path (initiator pays ETH directly) and the
|
|
563
|
-
* paymaster path (bundler + Coinbase Paymaster).
|
|
564
|
-
*
|
|
565
|
-
* Intentionally synchronous in spirit — the only network call is
|
|
566
|
-
* `getBalance`. Callers can parallelize it with other reads.
|
|
567
|
-
*/
|
|
568
|
-
declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<SubmissionPath>;
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* Parse the implementation address out of an EIP-7702 delegation designator.
|
|
572
|
-
*
|
|
573
|
-
* Returns `null` when:
|
|
574
|
-
* - `code` is undefined / empty / `"0x"` (plain EOA, no code)
|
|
575
|
-
* - `code` does not contain the EIP-7702 magic prefix (regular contract)
|
|
576
|
-
*
|
|
577
|
-
* @param code - bytecode returned by `eth_getCode` / `client.getCode()`
|
|
578
|
-
* @returns the 20-byte implementation address (checksummed), or `null`
|
|
579
|
-
*
|
|
580
|
-
* @example
|
|
581
|
-
* const code = await client.getCode({ address });
|
|
582
|
-
* const impl = parseEip7702DelegatedAddress(code);
|
|
583
|
-
* // null → not delegated
|
|
584
|
-
* // '0x7702cb554e6bFb442cb743A7dF23154544a7176C' → delegated to BatchExecutor
|
|
585
|
-
*/
|
|
586
|
-
declare function parseEip7702DelegatedAddress(code: Hex | string | null | undefined): Address | null;
|
|
587
|
-
/**
|
|
588
|
-
* Read the EIP-7702 delegation status of an EOA from the chain.
|
|
589
|
-
*
|
|
590
|
-
* @param client - viem PublicClient (any provider — only `eth_getCode` is called)
|
|
591
|
-
* @param address - EOA address to inspect
|
|
592
|
-
* @returns the implementation address the EOA is delegated to, or `null`
|
|
593
|
-
*
|
|
594
|
-
* @example
|
|
595
|
-
* const impl = await checkDelegation(publicClient, userAddress);
|
|
596
|
-
* if (impl === null) {
|
|
597
|
-
* // show "Setup Wallet" button
|
|
598
|
-
* } else {
|
|
599
|
-
* // EOA already delegated; safe to send UserOps
|
|
600
|
-
* }
|
|
601
|
-
*/
|
|
602
|
-
declare function checkDelegation(client: PublicClient, address: Address): Promise<Address | null>;
|
|
603
|
-
/**
|
|
604
|
-
* Return `true` when the EOA at `address` is currently delegated to `target`.
|
|
605
|
-
*
|
|
606
|
-
* Useful for asserting that the delegation points specifically at the expected
|
|
607
|
-
* BatchExecutor rather than some other implementation (e.g. old deployment).
|
|
608
|
-
*
|
|
609
|
-
* @example
|
|
610
|
-
* import { BATCH_EXECUTOR_ADDRESS_BASE_MAINNET } from '@pafi-dev/core';
|
|
611
|
-
* const ok = await isDelegatedTo(client, userAddress, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET);
|
|
612
|
-
*/
|
|
613
|
-
declare function isDelegatedTo(client: PublicClient, address: Address, target: Address): Promise<boolean>;
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* Parameters for building a delegation-only UserOperation.
|
|
617
|
-
*
|
|
618
|
-
* This UserOp carries no calldata — its sole purpose is to anchor the
|
|
619
|
-
* EIP-7702 authorization (signed externally via `signAuthorization`) into
|
|
620
|
-
* a sponsored transaction so the user doesn't need native ETH to delegate.
|
|
621
|
-
*/
|
|
622
|
-
interface BuildDelegationUserOpParams {
|
|
623
|
-
/** User EOA to delegate. */
|
|
624
|
-
userAddress: Address;
|
|
625
|
-
/** ERC-4337 account nonce — fetched from EntryPoint. Pass 0n on first ever op. */
|
|
626
|
-
aaNonce: bigint;
|
|
627
|
-
gasLimits?: {
|
|
628
|
-
callGasLimit?: bigint;
|
|
629
|
-
verificationGasLimit?: bigint;
|
|
630
|
-
preVerificationGas?: bigint;
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* Build the minimal `PartialUserOperation` used to sponsor the one-time
|
|
635
|
-
* EIP-7702 delegation.
|
|
636
|
-
*
|
|
637
|
-
* The caller must:
|
|
638
|
-
* 1. Sign the EIP-7702 authorization via `signAuthorization()` (Privy hook).
|
|
639
|
-
* 2. Pass the authorization as `authorization` alongside `calls` (or alone)
|
|
640
|
-
* to `smartClient.sendTransaction()`.
|
|
641
|
-
*
|
|
642
|
-
* The permissionless SDK + Pimlico bundler handle the rest: they detect the
|
|
643
|
-
* `authorization` field and submit an EIP-7702 type-4 transaction that sets
|
|
644
|
-
* the EOA's bytecode to `0xef0100<batchExecutorAddress>`.
|
|
645
|
-
*
|
|
646
|
-
* This builder is a convenience wrapper — in practice you can also pass
|
|
647
|
-
* `{ to: userAddress, value: 0n, data: '0x', authorization }` directly to
|
|
648
|
-
* `smartClient.sendTransaction()` without calling this function at all.
|
|
649
|
-
* Use it when you need a `PartialUserOperation` struct for inspection or
|
|
650
|
-
* custom paymaster flows.
|
|
651
|
-
*
|
|
652
|
-
* @example
|
|
653
|
-
* // Typical flow — no need to call this builder directly:
|
|
654
|
-
* const nonce = await publicClient.getTransactionCount({ address, blockTag: 'pending' });
|
|
655
|
-
* const authorization = await signAuthorization({ contractAddress: BATCH_EXECUTOR, chainId: 8453, nonce });
|
|
656
|
-
* const txHash = await smartClient.sendTransaction({
|
|
657
|
-
* to: address,
|
|
658
|
-
* value: 0n,
|
|
659
|
-
* data: '0x',
|
|
660
|
-
* authorization,
|
|
661
|
-
* paymasterContext: { sponsorshipPolicyId },
|
|
662
|
-
* });
|
|
663
|
-
*/
|
|
664
|
-
declare function buildDelegationUserOp(params: BuildDelegationUserOpParams): PartialUserOperation;
|
|
665
|
-
/**
|
|
666
|
-
* Fetch the AA nonce for a user EOA from the EntryPoint v0.7.
|
|
667
|
-
*
|
|
668
|
-
* Convenience helper so callers don't need to import the EntryPoint ABI
|
|
669
|
-
* themselves when building the delegation UserOp.
|
|
670
|
-
*
|
|
671
|
-
* @param client - viem PublicClient
|
|
672
|
-
* @param userAddress - EOA to query
|
|
673
|
-
* @returns bigint nonce (0n on first-ever UserOp)
|
|
674
|
-
*/
|
|
675
|
-
declare function getAaNonce(client: PublicClient, userAddress: Address): Promise<bigint>;
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* EIP-7702 authorization tuple hash.
|
|
679
|
-
*
|
|
680
|
-
* keccak256(0x05 || rlp([chain_id, address, nonce]))
|
|
681
|
-
*
|
|
682
|
-
* The user signs this hash with a **raw secp256k1 sign** (no EIP-191 prefix).
|
|
683
|
-
* On mobile, pass the result to the wallet's raw signing primitive.
|
|
684
|
-
*
|
|
685
|
-
* The resulting 65-byte signature is sent to `POST /delegate/submit` as `authSig`.
|
|
686
|
-
*
|
|
687
|
-
* Reference: EIP-7702 §3 — Authorization tuple
|
|
688
|
-
*/
|
|
689
|
-
declare function computeAuthorizationHash(chainId: number, address: Address, nonce: bigint): Hex;
|
|
690
|
-
/**
|
|
691
|
-
* Check whether an EOA code string carries an EIP-7702 delegation to `target`.
|
|
692
|
-
*
|
|
693
|
-
* Sync alternative to `isDelegatedTo()` for callers that already have the
|
|
694
|
-
* code from a prior `eth_getCode` call and don't want another RPC round-trip.
|
|
695
|
-
*
|
|
696
|
-
* Delegation designator format: 0xef0100 (3 bytes) || address (20 bytes)
|
|
697
|
-
*/
|
|
698
|
-
declare function isDelegatedToTarget(code: string | null | undefined, target: Address): boolean;
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* Parameters for `createPafiProxyTransport`.
|
|
702
|
-
*/
|
|
703
|
-
interface PafiProxyTransportParams {
|
|
704
|
-
/**
|
|
705
|
-
* Full URL of the PAFI sponsor-relayer Pimlico proxy endpoint.
|
|
706
|
-
* @example "https://sponsor-relayer.pacificfinance.org/pimlico"
|
|
707
|
-
* @example "http://localhost:4000/pimlico"
|
|
708
|
-
*/
|
|
709
|
-
proxyUrl: string;
|
|
710
|
-
/**
|
|
711
|
-
* Called on every request to get the current Privy identity token.
|
|
712
|
-
* Use a getter (or a ref's `.current`) so the transport always sends
|
|
713
|
-
* the latest token without needing to be rebuilt when it rotates.
|
|
714
|
-
*
|
|
715
|
-
* @example () => identityTokenRef.current
|
|
716
|
-
* @example () => privyHook.identityToken
|
|
717
|
-
*/
|
|
718
|
-
getIdentityToken: () => string | null | undefined;
|
|
719
|
-
/**
|
|
720
|
-
* Issuer ID sent as `X-Issuer-Id` header.
|
|
721
|
-
* sponsor-relayer uses this to look up per-issuer rate limits and policy.
|
|
722
|
-
* Obtain from PAFI team during onboarding.
|
|
723
|
-
*/
|
|
724
|
-
issuerId: string;
|
|
725
|
-
}
|
|
726
|
-
/**
|
|
727
|
-
* Create a viem `HttpTransport` that proxies all Pimlico JSON-RPC calls
|
|
728
|
-
* through the PAFI sponsor-relayer (`POST /pimlico`).
|
|
729
|
-
*
|
|
730
|
-
* The transport:
|
|
731
|
-
* - Sets `Authorization: Bearer <identityToken>` on every request
|
|
732
|
-
* - Sets `X-Issuer-Id: <issuerId>` on every request
|
|
733
|
-
* - Reads the identity token lazily via `getIdentityToken()` so it is
|
|
734
|
-
* always fresh without rebuilding the SmartAccountClient on each rotation
|
|
735
|
-
*
|
|
736
|
-
* Pass the returned transport to both `createPimlicoClient` and
|
|
737
|
-
* `createSmartAccountClient` so ALL Pimlico RPC calls (paymaster + bundler)
|
|
738
|
-
* go through the proxy with auth headers attached.
|
|
739
|
-
*
|
|
740
|
-
* @example
|
|
741
|
-
* ```ts
|
|
742
|
-
* import { createPafiProxyTransport, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET } from '@pafi-dev/core';
|
|
743
|
-
* import { createSmartAccountClient } from 'permissionless';
|
|
744
|
-
* import { createPimlicoClient } from 'permissionless/clients/pimlico';
|
|
745
|
-
* import { useIdentityToken } from '@privy-io/react-auth';
|
|
746
|
-
*
|
|
747
|
-
* const { identityToken } = useIdentityToken();
|
|
748
|
-
* const identityTokenRef = useRef<string | null>(null);
|
|
749
|
-
* useEffect(() => { identityTokenRef.current = identityToken; }, [identityToken]);
|
|
750
|
-
*
|
|
751
|
-
* const proxyTransport = createPafiProxyTransport({
|
|
752
|
-
* proxyUrl: process.env.NEXT_PUBLIC_PIMLICO_PROXY_URL!,
|
|
753
|
-
* getIdentityToken: () => identityTokenRef.current,
|
|
754
|
-
* issuerId: process.env.NEXT_PUBLIC_ISSUER_ID!,
|
|
755
|
-
* });
|
|
756
|
-
*
|
|
757
|
-
* const pimlicoClient = createPimlicoClient({ chain: base, transport: proxyTransport });
|
|
758
|
-
* const smartClient = createSmartAccountClient({
|
|
759
|
-
* client: publicClient,
|
|
760
|
-
* chain: base,
|
|
761
|
-
* account,
|
|
762
|
-
* paymaster: pimlicoClient,
|
|
763
|
-
* bundlerTransport: proxyTransport,
|
|
764
|
-
* });
|
|
765
|
-
* ```
|
|
766
|
-
*/
|
|
767
|
-
declare function createPafiProxyTransport(params: PafiProxyTransportParams): HttpTransport;
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* Minimal interface for any smart-account client capable of submitting
|
|
771
|
-
* transactions. Deliberately duck-typed so the SDK does not need a hard
|
|
772
|
-
* dependency on permissionless — any client with this shape works.
|
|
773
|
-
*/
|
|
774
|
-
interface SmartAccountSender {
|
|
775
|
-
sendTransaction(params: Record<string, unknown>): Promise<Hex>;
|
|
776
|
-
}
|
|
777
|
-
/**
|
|
778
|
-
* Returns true when `err` originates from the **paymaster layer** rather
|
|
779
|
-
* than the contract or bundler layer. Covers:
|
|
780
|
-
*
|
|
781
|
-
* - ERC-4337 AA3x validation errors (AA31–AA34)
|
|
782
|
-
* - Pimlico sponsorship rejections (`pm_*` methods, "sponsorship" messages)
|
|
783
|
-
* - PAFI proxy HTTP errors (401, 403, 429, 503)
|
|
784
|
-
* - Generic "rate limit" / "unauthorized" strings
|
|
785
|
-
*
|
|
786
|
-
* Use this to decide whether retrying without a paymaster makes sense.
|
|
787
|
-
* Contract reverts (AA23, AA24, AA25) and bundler errors are NOT matched.
|
|
788
|
-
*/
|
|
789
|
-
declare function isPaymasterError(err: unknown): boolean;
|
|
790
|
-
interface SendWithPaymasterFallbackParams {
|
|
791
|
-
/** Smart-account client with paymaster configured — tried first. */
|
|
792
|
-
primaryClient: SmartAccountSender;
|
|
793
|
-
/**
|
|
794
|
-
* Smart-account client without paymaster — used when `primaryClient`
|
|
795
|
-
* throws a paymaster error. User pays gas from their ETH balance.
|
|
796
|
-
* Pass `null` or `undefined` to disable fallback (error re-thrown as-is).
|
|
797
|
-
*/
|
|
798
|
-
fallbackClient: SmartAccountSender | null | undefined;
|
|
799
|
-
/** Transaction params forwarded verbatim to `sendTransaction`. */
|
|
800
|
-
txParams: Record<string, unknown>;
|
|
801
|
-
/**
|
|
802
|
-
* Called just before the fallback attempt so the caller can log or
|
|
803
|
-
* update UI. Receives the error message from the failed primary attempt.
|
|
804
|
-
*/
|
|
805
|
-
onFallback?: (errorMessage: string) => void;
|
|
806
|
-
}
|
|
807
|
-
/**
|
|
808
|
-
* Submit a UserOp with paymaster sponsorship, falling back to user-paid gas
|
|
809
|
-
* if the paymaster refuses.
|
|
810
|
-
*
|
|
811
|
-
* Flow:
|
|
812
|
-
* 1. Call `primaryClient.sendTransaction(txParams)`.
|
|
813
|
-
* 2. If it throws and `isPaymasterError` returns true, call `onFallback` then
|
|
814
|
-
* retry with `fallbackClient` (no paymaster — user pays gas).
|
|
815
|
-
* 3. All other errors (contract revert, bundler rejection, network) are
|
|
816
|
-
* re-thrown immediately without a retry.
|
|
817
|
-
*
|
|
818
|
-
* @example
|
|
819
|
-
* ```ts
|
|
820
|
-
* import { sendWithPaymasterFallback } from '@pafi-dev/core';
|
|
821
|
-
*
|
|
822
|
-
* const txHash = await sendWithPaymasterFallback({
|
|
823
|
-
* primaryClient: smartClientWithPaymaster,
|
|
824
|
-
* fallbackClient: smartClientNoPaymaster,
|
|
825
|
-
* txParams: { calls, paymasterContext: { sponsorshipPolicyId } },
|
|
826
|
-
* onFallback: (msg) => addLog(`Paymaster refused (${msg}) — you will pay gas.`),
|
|
827
|
-
* });
|
|
828
|
-
* ```
|
|
829
|
-
*/
|
|
830
|
-
declare function sendWithPaymasterFallback(params: SendWithPaymasterFallbackParams): Promise<Hex>;
|
|
831
|
-
|
|
832
|
-
/**
|
|
833
|
-
* Real `PointToken` ABI — matches the contract deployed on Base mainnet
|
|
834
|
-
* (POINT at `0x7d25E7156E51F865D522fd3ef257a6B5DD41b97e`). Sourced from
|
|
835
|
-
* the Solidity contract shipped by the SC team 2026-04-21.
|
|
836
|
-
*
|
|
837
|
-
* ## Mint — two paths
|
|
838
|
-
*
|
|
839
|
-
* Path 1 — Direct (whitelisted minter):
|
|
840
|
-
* mint(address to, uint256 amount)
|
|
841
|
-
* - msg.sender must be in minters[]
|
|
842
|
-
* - Used by off-chain services that hold a minter key
|
|
843
|
-
*
|
|
844
|
-
* Path 2 — Sig-gated (gasless, v1.4 sponsored flow):
|
|
845
|
-
* mint(address to, uint256 amount, uint256 deadline, bytes minterSig)
|
|
846
|
-
* - msg.sender MUST equal `to` (the receiver)
|
|
847
|
-
* - minterSig is an EIP-712 MintRequest signature from a whitelisted minter
|
|
848
|
-
* - Consumes `mintRequestNonces[to]`
|
|
849
|
-
* - This is the path v1.4 uses: issuer backend signs, user submits
|
|
850
|
-
* via EIP-7702 + Coinbase Paymaster
|
|
851
|
-
*
|
|
852
|
-
* ## Burn — mirror structure
|
|
853
|
-
*
|
|
854
|
-
* Path 1: burn(address from, uint256 amount) — whitelisted burner
|
|
855
|
-
* Path 2: burn(address from, uint256 amount, uint256 deadline, bytes burnerSig)
|
|
856
|
-
* — msg.sender must equal `from`, burnerSig from whitelisted burner,
|
|
857
|
-
* consumes `burnRequestNonces[from]`
|
|
858
|
-
*
|
|
859
|
-
* Either burn path emits `Transfer(from → 0x0)` so BurnIndexer semantics
|
|
860
|
-
* don't depend on which path was taken.
|
|
861
|
-
*
|
|
862
|
-
* ## EIP-712 type hashes (from contract source)
|
|
863
|
-
*
|
|
864
|
-
* MintRequest(address to,uint256 amount,uint256 nonce,uint256 deadline)
|
|
865
|
-
* BurnRequest(address from,uint256 amount,uint256 nonce,uint256 deadline)
|
|
866
|
-
*
|
|
867
|
-
* Domain: EIP-712 standard — name = ERC-20 token name, version = "1",
|
|
868
|
-
* chainId, verifyingContract = this PointToken address.
|
|
869
|
-
*/
|
|
870
|
-
declare const POINT_TOKEN_ABI: readonly [{
|
|
871
|
-
readonly name: "mint";
|
|
872
|
-
readonly type: "function";
|
|
873
|
-
readonly stateMutability: "nonpayable";
|
|
874
|
-
readonly inputs: readonly [{
|
|
875
|
-
readonly type: "address";
|
|
876
|
-
readonly name: "to";
|
|
877
|
-
}, {
|
|
878
|
-
readonly type: "uint256";
|
|
879
|
-
readonly name: "amount";
|
|
880
|
-
}];
|
|
881
|
-
readonly outputs: readonly [];
|
|
882
|
-
}, {
|
|
883
|
-
readonly name: "mint";
|
|
884
|
-
readonly type: "function";
|
|
885
|
-
readonly stateMutability: "nonpayable";
|
|
886
|
-
readonly inputs: readonly [{
|
|
887
|
-
readonly type: "address";
|
|
888
|
-
readonly name: "to";
|
|
889
|
-
}, {
|
|
890
|
-
readonly type: "uint256";
|
|
891
|
-
readonly name: "amount";
|
|
892
|
-
}, {
|
|
893
|
-
readonly type: "uint256";
|
|
894
|
-
readonly name: "deadline";
|
|
895
|
-
}, {
|
|
896
|
-
readonly type: "bytes";
|
|
897
|
-
readonly name: "minterSig";
|
|
898
|
-
}];
|
|
899
|
-
readonly outputs: readonly [];
|
|
900
|
-
}, {
|
|
901
|
-
readonly name: "burn";
|
|
902
|
-
readonly type: "function";
|
|
903
|
-
readonly stateMutability: "nonpayable";
|
|
904
|
-
readonly inputs: readonly [{
|
|
905
|
-
readonly type: "address";
|
|
906
|
-
readonly name: "from";
|
|
907
|
-
}, {
|
|
908
|
-
readonly type: "uint256";
|
|
909
|
-
readonly name: "amount";
|
|
910
|
-
}];
|
|
911
|
-
readonly outputs: readonly [];
|
|
912
|
-
}, {
|
|
913
|
-
readonly name: "burn";
|
|
914
|
-
readonly type: "function";
|
|
915
|
-
readonly stateMutability: "nonpayable";
|
|
916
|
-
readonly inputs: readonly [{
|
|
917
|
-
readonly type: "address";
|
|
918
|
-
readonly name: "from";
|
|
919
|
-
}, {
|
|
920
|
-
readonly type: "uint256";
|
|
921
|
-
readonly name: "amount";
|
|
922
|
-
}, {
|
|
923
|
-
readonly type: "uint256";
|
|
924
|
-
readonly name: "deadline";
|
|
925
|
-
}, {
|
|
926
|
-
readonly type: "bytes";
|
|
927
|
-
readonly name: "burnerSig";
|
|
928
|
-
}];
|
|
929
|
-
readonly outputs: readonly [];
|
|
930
|
-
}, {
|
|
931
|
-
readonly name: "minters";
|
|
932
|
-
readonly type: "function";
|
|
933
|
-
readonly stateMutability: "view";
|
|
934
|
-
readonly inputs: readonly [{
|
|
935
|
-
readonly type: "address";
|
|
936
|
-
readonly name: "account";
|
|
937
|
-
}];
|
|
938
|
-
readonly outputs: readonly [{
|
|
939
|
-
readonly type: "bool";
|
|
940
|
-
}];
|
|
941
|
-
}, {
|
|
942
|
-
readonly name: "burners";
|
|
943
|
-
readonly type: "function";
|
|
944
|
-
readonly stateMutability: "view";
|
|
945
|
-
readonly inputs: readonly [{
|
|
946
|
-
readonly type: "address";
|
|
947
|
-
readonly name: "account";
|
|
948
|
-
}];
|
|
949
|
-
readonly outputs: readonly [{
|
|
950
|
-
readonly type: "bool";
|
|
951
|
-
}];
|
|
952
|
-
}, {
|
|
953
|
-
readonly name: "addMinter";
|
|
954
|
-
readonly type: "function";
|
|
955
|
-
readonly stateMutability: "nonpayable";
|
|
956
|
-
readonly inputs: readonly [{
|
|
957
|
-
readonly type: "address";
|
|
958
|
-
readonly name: "minter";
|
|
959
|
-
}];
|
|
960
|
-
readonly outputs: readonly [];
|
|
961
|
-
}, {
|
|
962
|
-
readonly name: "removeMinter";
|
|
963
|
-
readonly type: "function";
|
|
964
|
-
readonly stateMutability: "nonpayable";
|
|
965
|
-
readonly inputs: readonly [{
|
|
966
|
-
readonly type: "address";
|
|
967
|
-
readonly name: "minter";
|
|
968
|
-
}];
|
|
969
|
-
readonly outputs: readonly [];
|
|
970
|
-
}, {
|
|
971
|
-
readonly name: "addBurner";
|
|
972
|
-
readonly type: "function";
|
|
973
|
-
readonly stateMutability: "nonpayable";
|
|
974
|
-
readonly inputs: readonly [{
|
|
975
|
-
readonly type: "address";
|
|
976
|
-
readonly name: "burner";
|
|
977
|
-
}];
|
|
978
|
-
readonly outputs: readonly [];
|
|
979
|
-
}, {
|
|
980
|
-
readonly name: "removeBurner";
|
|
981
|
-
readonly type: "function";
|
|
982
|
-
readonly stateMutability: "nonpayable";
|
|
983
|
-
readonly inputs: readonly [{
|
|
984
|
-
readonly type: "address";
|
|
985
|
-
readonly name: "burner";
|
|
986
|
-
}];
|
|
987
|
-
readonly outputs: readonly [];
|
|
988
|
-
}, {
|
|
989
|
-
readonly name: "mintRequestNonces";
|
|
990
|
-
readonly type: "function";
|
|
991
|
-
readonly stateMutability: "view";
|
|
992
|
-
readonly inputs: readonly [{
|
|
993
|
-
readonly type: "address";
|
|
994
|
-
readonly name: "receiver";
|
|
995
|
-
}];
|
|
996
|
-
readonly outputs: readonly [{
|
|
997
|
-
readonly type: "uint256";
|
|
998
|
-
}];
|
|
999
|
-
}, {
|
|
1000
|
-
readonly name: "burnRequestNonces";
|
|
1001
|
-
readonly type: "function";
|
|
1002
|
-
readonly stateMutability: "view";
|
|
1003
|
-
readonly inputs: readonly [{
|
|
1004
|
-
readonly type: "address";
|
|
1005
|
-
readonly name: "from";
|
|
1006
|
-
}];
|
|
1007
|
-
readonly outputs: readonly [{
|
|
1008
|
-
readonly type: "uint256";
|
|
1009
|
-
}];
|
|
1010
|
-
}, {
|
|
1011
|
-
readonly name: "mintingOracle";
|
|
1012
|
-
readonly type: "function";
|
|
1013
|
-
readonly stateMutability: "view";
|
|
1014
|
-
readonly inputs: readonly [];
|
|
1015
|
-
readonly outputs: readonly [{
|
|
1016
|
-
readonly type: "address";
|
|
1017
|
-
}];
|
|
1018
|
-
}, {
|
|
1019
|
-
readonly name: "setMintingOracle";
|
|
1020
|
-
readonly type: "function";
|
|
1021
|
-
readonly stateMutability: "nonpayable";
|
|
1022
|
-
readonly inputs: readonly [{
|
|
1023
|
-
readonly type: "address";
|
|
1024
|
-
readonly name: "_mintingOracle";
|
|
1025
|
-
}];
|
|
1026
|
-
readonly outputs: readonly [];
|
|
1027
|
-
}, {
|
|
1028
|
-
readonly name: "issuer";
|
|
1029
|
-
readonly type: "function";
|
|
1030
|
-
readonly stateMutability: "view";
|
|
1031
|
-
readonly inputs: readonly [];
|
|
1032
|
-
readonly outputs: readonly [{
|
|
1033
|
-
readonly type: "address";
|
|
1034
|
-
}];
|
|
1035
|
-
}, {
|
|
1036
|
-
readonly name: "balanceOf";
|
|
1037
|
-
readonly type: "function";
|
|
1038
|
-
readonly stateMutability: "view";
|
|
1039
|
-
readonly inputs: readonly [{
|
|
1040
|
-
readonly type: "address";
|
|
1041
|
-
readonly name: "account";
|
|
1042
|
-
}];
|
|
1043
|
-
readonly outputs: readonly [{
|
|
1044
|
-
readonly type: "uint256";
|
|
1045
|
-
}];
|
|
1046
|
-
}, {
|
|
1047
|
-
readonly name: "totalSupply";
|
|
1048
|
-
readonly type: "function";
|
|
1049
|
-
readonly stateMutability: "view";
|
|
1050
|
-
readonly inputs: readonly [];
|
|
1051
|
-
readonly outputs: readonly [{
|
|
1052
|
-
readonly type: "uint256";
|
|
1053
|
-
}];
|
|
1054
|
-
}, {
|
|
1055
|
-
readonly name: "name";
|
|
1056
|
-
readonly type: "function";
|
|
1057
|
-
readonly stateMutability: "view";
|
|
1058
|
-
readonly inputs: readonly [];
|
|
1059
|
-
readonly outputs: readonly [{
|
|
1060
|
-
readonly type: "string";
|
|
1061
|
-
}];
|
|
1062
|
-
}, {
|
|
1063
|
-
readonly name: "symbol";
|
|
1064
|
-
readonly type: "function";
|
|
1065
|
-
readonly stateMutability: "view";
|
|
1066
|
-
readonly inputs: readonly [];
|
|
1067
|
-
readonly outputs: readonly [{
|
|
1068
|
-
readonly type: "string";
|
|
1069
|
-
}];
|
|
1070
|
-
}, {
|
|
1071
|
-
readonly name: "decimals";
|
|
1072
|
-
readonly type: "function";
|
|
1073
|
-
readonly stateMutability: "view";
|
|
1074
|
-
readonly inputs: readonly [];
|
|
1075
|
-
readonly outputs: readonly [{
|
|
1076
|
-
readonly type: "uint8";
|
|
1077
|
-
}];
|
|
1078
|
-
}, {
|
|
1079
|
-
readonly name: "DOMAIN_SEPARATOR";
|
|
1080
|
-
readonly type: "function";
|
|
1081
|
-
readonly stateMutability: "view";
|
|
1082
|
-
readonly inputs: readonly [];
|
|
1083
|
-
readonly outputs: readonly [{
|
|
1084
|
-
readonly type: "bytes32";
|
|
1085
|
-
}];
|
|
1086
|
-
}, {
|
|
1087
|
-
readonly name: "eip712Domain";
|
|
1088
|
-
readonly type: "function";
|
|
1089
|
-
readonly stateMutability: "view";
|
|
1090
|
-
readonly inputs: readonly [];
|
|
1091
|
-
readonly outputs: readonly [{
|
|
1092
|
-
readonly type: "bytes1";
|
|
1093
|
-
readonly name: "fields";
|
|
1094
|
-
}, {
|
|
1095
|
-
readonly type: "string";
|
|
1096
|
-
readonly name: "name";
|
|
1097
|
-
}, {
|
|
1098
|
-
readonly type: "string";
|
|
1099
|
-
readonly name: "version";
|
|
1100
|
-
}, {
|
|
1101
|
-
readonly type: "uint256";
|
|
1102
|
-
readonly name: "chainId";
|
|
1103
|
-
}, {
|
|
1104
|
-
readonly type: "address";
|
|
1105
|
-
readonly name: "verifyingContract";
|
|
1106
|
-
}, {
|
|
1107
|
-
readonly type: "bytes32";
|
|
1108
|
-
readonly name: "salt";
|
|
1109
|
-
}, {
|
|
1110
|
-
readonly type: "uint256[]";
|
|
1111
|
-
readonly name: "extensions";
|
|
1112
|
-
}];
|
|
1113
|
-
}, {
|
|
1114
|
-
readonly name: "Transfer";
|
|
1115
|
-
readonly type: "event";
|
|
1116
|
-
readonly inputs: readonly [{
|
|
1117
|
-
readonly type: "address";
|
|
1118
|
-
readonly name: "from";
|
|
1119
|
-
readonly indexed: true;
|
|
1120
|
-
}, {
|
|
1121
|
-
readonly type: "address";
|
|
1122
|
-
readonly name: "to";
|
|
1123
|
-
readonly indexed: true;
|
|
1124
|
-
}, {
|
|
1125
|
-
readonly type: "uint256";
|
|
1126
|
-
readonly name: "value";
|
|
1127
|
-
}];
|
|
1128
|
-
}, {
|
|
1129
|
-
readonly name: "MinterAdded";
|
|
1130
|
-
readonly type: "event";
|
|
1131
|
-
readonly inputs: readonly [{
|
|
1132
|
-
readonly type: "address";
|
|
1133
|
-
readonly name: "minter";
|
|
1134
|
-
readonly indexed: true;
|
|
1135
|
-
}];
|
|
1136
|
-
}, {
|
|
1137
|
-
readonly name: "MinterRemoved";
|
|
1138
|
-
readonly type: "event";
|
|
1139
|
-
readonly inputs: readonly [{
|
|
1140
|
-
readonly type: "address";
|
|
1141
|
-
readonly name: "minter";
|
|
1142
|
-
readonly indexed: true;
|
|
1143
|
-
}];
|
|
1144
|
-
}, {
|
|
1145
|
-
readonly name: "BurnerAdded";
|
|
1146
|
-
readonly type: "event";
|
|
1147
|
-
readonly inputs: readonly [{
|
|
1148
|
-
readonly type: "address";
|
|
1149
|
-
readonly name: "burner";
|
|
1150
|
-
readonly indexed: true;
|
|
1151
|
-
}];
|
|
1152
|
-
}, {
|
|
1153
|
-
readonly name: "BurnerRemoved";
|
|
1154
|
-
readonly type: "event";
|
|
1155
|
-
readonly inputs: readonly [{
|
|
1156
|
-
readonly type: "address";
|
|
1157
|
-
readonly name: "burner";
|
|
1158
|
-
readonly indexed: true;
|
|
1159
|
-
}];
|
|
1160
|
-
}, {
|
|
1161
|
-
readonly name: "MintingOracleUpdated";
|
|
1162
|
-
readonly type: "event";
|
|
1163
|
-
readonly inputs: readonly [{
|
|
1164
|
-
readonly type: "address";
|
|
1165
|
-
readonly name: "mintingOracle";
|
|
1166
|
-
readonly indexed: true;
|
|
1167
|
-
}];
|
|
1168
|
-
}];
|
|
1169
|
-
|
|
1170
|
-
declare const BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: `0x${string}`;
|
|
1171
|
-
declare const BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: `0x${string}`;
|
|
1172
|
-
|
|
1173
|
-
/**
|
|
1174
|
-
* Per-chain deployed contract addresses — v1.4 flow.
|
|
1175
|
-
*
|
|
1176
|
-
* ## Status (2026-04-22)
|
|
1177
|
-
*
|
|
1178
|
-
* Base mainnet (8453): **all real**. BatchExecutor now points at the
|
|
1179
|
-
* canonical Coinbase Smart Wallet v2 contract which PAFI reuses as the
|
|
1180
|
-
* EIP-7702 delegation target (no per-app deploy required — one
|
|
1181
|
-
* contract, every issuer).
|
|
1182
|
-
*
|
|
1183
|
-
* Base Sepolia (84532): entire row is placeholder — not in active use.
|
|
1184
|
-
*
|
|
1185
|
-
* ## What lives where
|
|
1186
|
-
*
|
|
1187
|
-
* pointToken — live POINT instance (clone of PointToken impl)
|
|
1188
|
-
* batchExecutor — EIP-7702 delegation target (Coinbase Smart Wallet v2)
|
|
1189
|
-
* usdt — MockERC20 used by Uniswap pools
|
|
1190
|
-
* issuerRegistry — registry of all issuers on this chain
|
|
1191
|
-
* mintingOracle — per-issuer mint cap enforcer
|
|
1192
|
-
* pafiHook — Uniswap V4 hook enforcing the 10% PT→USDT fee
|
|
1193
|
-
*
|
|
1194
|
-
* PointTokenFactory + PointToken implementation addresses live in
|
|
1195
|
-
* separate exports below — they're only needed at provisioning /
|
|
1196
|
-
* observability time, not in the hot mint/burn path, so excluded from
|
|
1197
|
-
* the per-chain bundle.
|
|
1198
|
-
*/
|
|
1199
|
-
interface ContractAddresses {
|
|
1200
|
-
pointToken: Address;
|
|
1201
|
-
batchExecutor: Address;
|
|
1202
|
-
usdt: Address;
|
|
1203
|
-
issuerRegistry: Address;
|
|
1204
|
-
mintingOracle: Address;
|
|
1205
|
-
/**
|
|
1206
|
-
* Uniswap V4 hook that enforces the 10% fee on PT→USDT swaps
|
|
1207
|
-
* (USDT→PT is free). FE reads this to build `PoolKey.hooks` when
|
|
1208
|
-
* constructing a swap; quoters + routers need it to resolve the
|
|
1209
|
-
* correct pool.
|
|
1210
|
-
*/
|
|
1211
|
-
pafiHook: Address;
|
|
1212
|
-
}
|
|
1213
|
-
declare const CONTRACT_ADDRESSES: Record<number, ContractAddresses>;
|
|
1214
|
-
/**
|
|
1215
|
-
* PointTokenFactory address — separate from `ContractAddresses` because
|
|
1216
|
-
* it's only used at provisioning time (issuer onboard + token creation),
|
|
1217
|
-
* not in the hot mint/burn path.
|
|
1218
|
-
*/
|
|
1219
|
-
declare const POINT_TOKEN_FACTORY_ADDRESSES: Record<number, Address>;
|
|
1220
|
-
/**
|
|
1221
|
-
* PointToken implementation address — the EIP-1167 clone target used
|
|
1222
|
-
* by PointTokenFactory. Exposed for observability / proxy verification;
|
|
1223
|
-
* consumers should never call this directly.
|
|
1224
|
-
*/
|
|
1225
|
-
declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
|
|
1226
|
-
/**
|
|
1227
|
-
* Lookup helper — throws if the chain isn't in the map so callers fail
|
|
1228
|
-
* loudly on misconfiguration instead of silently using `undefined`.
|
|
1229
|
-
*/
|
|
1230
|
-
declare function getContractAddresses(chainId: number): ContractAddresses;
|
|
1231
|
-
|
|
1232
|
-
/**
|
|
1233
|
-
* Public contract surface for `@pafi-dev/core/contracts`.
|
|
1234
|
-
*
|
|
1235
|
-
* Consumers import ABIs + per-chain addresses from this module. EIP-712
|
|
1236
|
-
* helpers (`signMintRequest`, `signBurnRequest`, etc.) live under
|
|
1237
|
-
* `./eip712/` and are re-exported from the package root — not duplicated
|
|
1238
|
-
* here.
|
|
1239
|
-
*
|
|
1240
|
-
* ## v1.4 flow — no Relayer, sig-gated mint/burn
|
|
1241
|
-
*
|
|
1242
|
-
* Relayer contract dropped. Users call `PointToken.mint(to, amount,
|
|
1243
|
-
* deadline, minterSig)` directly via an EIP-7702 delegated UserOp —
|
|
1244
|
-
* `msg.sender == user == to`. `minterSig` is an EIP-712 `MintRequest`
|
|
1245
|
-
* signed off-chain by the issuer's minter signer (HSM/KMS). Mirror
|
|
1246
|
-
* structure on the burn side with `BurnRequest` + `burn(from, amount,
|
|
1247
|
-
* deadline, burnerSig)`.
|
|
1248
|
-
*
|
|
1249
|
-
* Exports:
|
|
1250
|
-
* - `POINT_TOKEN_V2_ABI` — full mint + burn + admin surface
|
|
1251
|
-
* - `BATCH_EXECUTOR_*` — EIP-7702 delegation target (ABI real,
|
|
1252
|
-
* address still placeholder on all
|
|
1253
|
-
* chains until SC delivers)
|
|
1254
|
-
* - `CONTRACT_ADDRESSES` — per-chain map (real on 8453 except
|
|
1255
|
-
* `batchExecutor` — pending SC)
|
|
1256
|
-
* - `POINT_TOKEN_FACTORY_ADDRESSES`, `POINT_TOKEN_IMPL_ADDRESSES`
|
|
1257
|
-
* — provisioning / observability helpers
|
|
1258
|
-
*
|
|
1259
|
-
* Status: all real except BatchExecutor address (single remaining
|
|
1260
|
-
* placeholder, flagged inline in `real/addresses.ts`).
|
|
1261
|
-
*/
|
|
1262
|
-
|
|
1263
|
-
/**
|
|
1264
|
-
* Signature struct — kept for consumers that want the tuple form.
|
|
1265
|
-
* Most v1.4 paths pass `bytes` (serialized signature) directly to the
|
|
1266
|
-
* contract; this struct is only needed if you're manually splitting
|
|
1267
|
-
* for other on-chain verifiers.
|
|
1268
|
-
*/
|
|
1269
|
-
interface SignatureStruct {
|
|
1270
|
-
v: number;
|
|
1271
|
-
r: `0x${string}`;
|
|
1272
|
-
s: `0x${string}`;
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
/**
|
|
1276
|
-
* Options for opening a PAFI Web modal — passed through by all adapters.
|
|
1277
|
-
* Web-only fields (width/height/windowName) are ignored by mobile
|
|
1278
|
-
* adapters that can't resize a system in-app browser.
|
|
1279
|
-
*/
|
|
1280
|
-
interface ModalOpenOptions {
|
|
1281
|
-
/** Web popup pixel width. Default 900. Ignored on mobile. */
|
|
1282
|
-
width?: number;
|
|
1283
|
-
/** Web popup pixel height. Default 700. Ignored on mobile. */
|
|
1284
|
-
height?: number;
|
|
1285
|
-
/**
|
|
1286
|
-
* `window.open()` target name. Same name across calls re-uses an
|
|
1287
|
-
* already-open popup. Default: `"pafi-web"`. Web-only.
|
|
1288
|
-
*/
|
|
1289
|
-
windowName?: string;
|
|
1290
|
-
/**
|
|
1291
|
-
* Called when the modal closes — either user-initiated (clicked
|
|
1292
|
-
* close, swiped down on mobile) or programmatically via `handle.close()`.
|
|
1293
|
-
*/
|
|
1294
|
-
onClose?: () => void;
|
|
1295
|
-
/**
|
|
1296
|
-
* Called when the opened window posts a message back to the parent
|
|
1297
|
-
* via `window.opener.postMessage(data, origin)`. PAFI Web uses this
|
|
1298
|
-
* to signal "swap complete" / "perp deposit complete" back to the
|
|
1299
|
-
* issuer app without needing a redirect.
|
|
1300
|
-
*
|
|
1301
|
-
* `origin` is the posting window's origin — caller MUST verify it
|
|
1302
|
-
* matches the expected PAFI Web host before trusting `data`.
|
|
1303
|
-
*/
|
|
1304
|
-
onMessage?: (data: unknown, origin: string) => void;
|
|
1305
|
-
/**
|
|
1306
|
-
* Allowed origins for `onMessage` — messages from other origins are
|
|
1307
|
-
* silently dropped. Pass the PAFI Web host(s), e.g.
|
|
1308
|
-
* `["https://app.pacificfinance.org", "https://app-dev.pacificfinance.org"]`.
|
|
1309
|
-
*
|
|
1310
|
-
* Default: empty (all messages rejected). Set explicitly for security.
|
|
1311
|
-
*/
|
|
1312
|
-
allowedOrigins?: string[];
|
|
1313
|
-
}
|
|
1314
|
-
/**
|
|
1315
|
-
* Handle to an open PAFI Web modal. Methods are no-ops when the modal
|
|
1316
|
-
* has already closed — safe to call without tracking state yourself.
|
|
1317
|
-
*/
|
|
1318
|
-
interface PafiWebModalHandle {
|
|
1319
|
-
/** True when the modal is still open. */
|
|
1320
|
-
readonly isOpen: boolean;
|
|
1321
|
-
/** Close the modal. Fires `onClose` if the callback was supplied. */
|
|
1322
|
-
close(): void;
|
|
1323
|
-
/** Bring the modal to focus (web popup only; mobile ignores). */
|
|
1324
|
-
focus(): void;
|
|
1325
|
-
/**
|
|
1326
|
-
* Post a message INTO the modal — useful for ping/pong handshakes
|
|
1327
|
-
* with PAFI Web. The modal page must be on the same origin or
|
|
1328
|
-
* explicitly listen for the message.
|
|
1329
|
-
*/
|
|
1330
|
-
postMessage(data: unknown): void;
|
|
1331
|
-
}
|
|
1332
|
-
/**
|
|
1333
|
-
* Adapter that knows how to open a URL in the right UX for the host
|
|
1334
|
-
* platform. Callers register one via `setPafiWebModalAdapter()`; if
|
|
1335
|
-
* none is registered, the core module falls back to `openWebPopup()`
|
|
1336
|
-
* (if `window` is present) or throws (in Node / React Native without
|
|
1337
|
-
* an adapter set).
|
|
1338
|
-
*
|
|
1339
|
-
* ## Mobile adapter example (React Native)
|
|
1340
|
-
*
|
|
1341
|
-
* ```ts
|
|
1342
|
-
* import { setPafiWebModalAdapter } from '@pafi-dev/core';
|
|
1343
|
-
* import InAppBrowser from 'react-native-inappbrowser-reborn';
|
|
1344
|
-
*
|
|
1345
|
-
* setPafiWebModalAdapter({
|
|
1346
|
-
* async open(url, options) {
|
|
1347
|
-
* const result = await InAppBrowser.open(url, {
|
|
1348
|
-
* // iOS: SFSafariViewController
|
|
1349
|
-
* dismissButtonStyle: 'close',
|
|
1350
|
-
* preferredBarTintColor: '#1a1a1a',
|
|
1351
|
-
* preferredControlTintColor: 'white',
|
|
1352
|
-
* // Android: Chrome Custom Tab
|
|
1353
|
-
* toolbarColor: '#1a1a1a',
|
|
1354
|
-
* secondaryToolbarColor: 'black',
|
|
1355
|
-
* });
|
|
1356
|
-
* options?.onClose?.();
|
|
1357
|
-
* return {
|
|
1358
|
-
* isOpen: false,
|
|
1359
|
-
* close: () => InAppBrowser.close(),
|
|
1360
|
-
* focus: () => {},
|
|
1361
|
-
* postMessage: () => {},
|
|
1362
|
-
* };
|
|
1363
|
-
* },
|
|
1364
|
-
* });
|
|
1365
|
-
* ```
|
|
1366
|
-
*
|
|
1367
|
-
* ## Expo adapter example
|
|
1368
|
-
*
|
|
1369
|
-
* ```ts
|
|
1370
|
-
* import * as WebBrowser from 'expo-web-browser';
|
|
1371
|
-
*
|
|
1372
|
-
* setPafiWebModalAdapter({
|
|
1373
|
-
* async open(url, options) {
|
|
1374
|
-
* await WebBrowser.openBrowserAsync(url);
|
|
1375
|
-
* options?.onClose?.();
|
|
1376
|
-
* return { isOpen: false, close: WebBrowser.dismissBrowser, focus: () => {}, postMessage: () => {} };
|
|
1377
|
-
* },
|
|
1378
|
-
* });
|
|
1379
|
-
* ```
|
|
1380
|
-
*/
|
|
1381
|
-
interface PafiWebModalAdapter {
|
|
1382
|
-
open(url: string, options?: ModalOpenOptions): PafiWebModalHandle | Promise<PafiWebModalHandle>;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* Web browser popup adapter. Opens the given URL in a centered
|
|
1387
|
-
* `window.open()` popup, polls for close, and optionally forwards
|
|
1388
|
-
* `postMessage` events back to the caller.
|
|
1389
|
-
*
|
|
1390
|
-
* Runtime requirement: `window.open` must exist. Throws if called
|
|
1391
|
-
* under Node / SSR / React Native — use `setPafiWebModalAdapter()` to
|
|
1392
|
-
* provide a platform-specific adapter in those environments.
|
|
1393
|
-
*
|
|
1394
|
-
* ## Popup blocking
|
|
1395
|
-
*
|
|
1396
|
-
* Browsers block `window.open()` unless it happens inside a user
|
|
1397
|
-
* gesture (click handler). Callers MUST wire this into a direct click
|
|
1398
|
-
* handler — wrapping it in a `setTimeout` or async await before the
|
|
1399
|
-
* open call will trigger the blocker.
|
|
1400
|
-
*/
|
|
1401
|
-
declare function openWebPopup(url: string, options?: ModalOpenOptions): PafiWebModalHandle;
|
|
1402
|
-
/**
|
|
1403
|
-
* The web popup packaged as a {@link PafiWebModalAdapter} so callers
|
|
1404
|
-
* can register it explicitly (e.g. in a test harness).
|
|
1405
|
-
*/
|
|
1406
|
-
declare const webPopupAdapter: PafiWebModalAdapter;
|
|
1407
|
-
|
|
1408
|
-
/**
|
|
1409
|
-
* Register the adapter used by `openPafiWebModal()`. Typically called
|
|
1410
|
-
* once during app initialization — mobile apps register a
|
|
1411
|
-
* SFSafariViewController / Chrome Custom Tabs adapter, desktop apps
|
|
1412
|
-
* can leave it unset (web popup is the default).
|
|
1413
|
-
*
|
|
1414
|
-
* Pass `null` to unregister and fall back to the default.
|
|
1415
|
-
*/
|
|
1416
|
-
declare function setPafiWebModalAdapter(adapter: PafiWebModalAdapter | null): void;
|
|
1417
|
-
/**
|
|
1418
|
-
* Return the currently registered adapter, or `null` when none is set.
|
|
1419
|
-
* Useful for tests that want to snapshot-and-restore the adapter.
|
|
1420
|
-
*/
|
|
1421
|
-
declare function getPafiWebModalAdapter(): PafiWebModalAdapter | null;
|
|
1422
|
-
/**
|
|
1423
|
-
* Open PAFI Web in the host platform's appropriate UX:
|
|
1424
|
-
*
|
|
1425
|
-
* - Browser (window.open): centered popup, 900×700 by default
|
|
1426
|
-
* - React Native (with adapter registered): SFSafariViewController
|
|
1427
|
-
* / Chrome Custom Tabs via `react-native-inappbrowser-reborn` or
|
|
1428
|
-
* `expo-web-browser`
|
|
1429
|
-
* - Desktop (with adapter registered): custom BrowserWindow / new tab
|
|
1430
|
-
*
|
|
1431
|
-
* Resolution order:
|
|
1432
|
-
* 1. If an adapter was registered via `setPafiWebModalAdapter()`, use it.
|
|
1433
|
-
* 2. Else if `window.open` is available, use the built-in web popup.
|
|
1434
|
-
* 3. Else throw with a clear error pointing at the adapter registry.
|
|
1435
|
-
*
|
|
1436
|
-
* @example
|
|
1437
|
-
* ```ts
|
|
1438
|
-
* // User clicks "Trade on PAFI" button
|
|
1439
|
-
* button.addEventListener('click', async () => {
|
|
1440
|
-
* const modal = await openPafiWebModal('https://app.pacificfinance.org', {
|
|
1441
|
-
* allowedOrigins: ['https://app.pacificfinance.org'],
|
|
1442
|
-
* onMessage: (data, origin) => {
|
|
1443
|
-
* if (typeof data === 'object' && data && 'txHash' in data) {
|
|
1444
|
-
* console.log('Swap confirmed:', data.txHash);
|
|
1445
|
-
* modal.close();
|
|
1446
|
-
* }
|
|
1447
|
-
* },
|
|
1448
|
-
* onClose: () => {
|
|
1449
|
-
* console.log('User closed modal');
|
|
1450
|
-
* },
|
|
1451
|
-
* });
|
|
1452
|
-
* });
|
|
1453
|
-
* ```
|
|
1454
|
-
*/
|
|
1455
|
-
declare function openPafiWebModal(url: string, options?: ModalOpenOptions): Promise<PafiWebModalHandle>;
|
|
1456
|
-
|
|
1457
|
-
/** PAFI-hosted subgraph endpoint — single source of truth across all SDK packages. */
|
|
1458
|
-
declare const PAFI_SUBGRAPH_URL = "https://graph-base-mainnet.pacificfinance.org/subgraphs/name/pafi-subgraph-v2";
|
|
1459
|
-
/**
|
|
1460
|
-
* Fetch the Uniswap V4 pool(s) for a PAFI PointToken from the subgraph.
|
|
1461
|
-
*
|
|
1462
|
-
* Browser and Node compatible — uses globalThis.fetch. Returns an empty
|
|
1463
|
-
* array (never throws) when the token has no pool yet or the subgraph is
|
|
1464
|
-
* unreachable, so callers can show "quote unavailable" without crashing.
|
|
1465
|
-
*
|
|
1466
|
-
* @param chainId - Chain ID (reserved for multi-subgraph routing; currently unused)
|
|
1467
|
-
* @param pointTokenAddress - The PointToken contract address
|
|
1468
|
-
* @param subgraphUrl - Override the default PAFI subgraph URL
|
|
1469
|
-
*/
|
|
1470
|
-
declare function fetchPafiPools(_chainId: number, pointTokenAddress: Address, subgraphUrl?: string): Promise<PoolKey[]>;
|
|
1471
|
-
|
|
1472
|
-
declare class PafiSDK {
|
|
1473
|
-
private _pointTokenAddress?;
|
|
1474
|
-
private _signer?;
|
|
1475
|
-
private _provider?;
|
|
1476
|
-
private _chainId?;
|
|
1477
|
-
readonly mint: {
|
|
1478
|
-
buildTypedData: PafiSDK["buildMintRequestTypedData"];
|
|
1479
|
-
sign: PafiSDK["signMintRequest"];
|
|
1480
|
-
verify: PafiSDK["verifyMintRequest"];
|
|
1481
|
-
getNonce: PafiSDK["getMintRequestNonce"];
|
|
1482
|
-
};
|
|
1483
|
-
readonly consent: {
|
|
1484
|
-
buildTypedData: PafiSDK["buildReceiverConsentTypedData"];
|
|
1485
|
-
sign: PafiSDK["signReceiverConsent"];
|
|
1486
|
-
verify: PafiSDK["verifyReceiverConsent"];
|
|
1487
|
-
getNonce: PafiSDK["getReceiverConsentNonce"];
|
|
1488
|
-
};
|
|
1489
|
-
readonly swap: {
|
|
1490
|
-
buildFromQuote: PafiSDK["buildSwapFromQuote"];
|
|
1491
|
-
simulate: PafiSDK["simulateSwap"];
|
|
1492
|
-
};
|
|
1493
|
-
readonly quote: {
|
|
1494
|
-
findBest: PafiSDK["findBestQuote"];
|
|
1495
|
-
};
|
|
1496
|
-
readonly auth: {
|
|
1497
|
-
createLoginMessage: PafiSDK["createLoginMessage"];
|
|
1498
|
-
signMessage: PafiSDK["signLoginMessage"];
|
|
1499
|
-
};
|
|
1500
|
-
constructor(config: PafiSDKConfig);
|
|
1501
|
-
setPointTokenAddress(address: Address): void;
|
|
1502
|
-
setSigner(signer: WalletClient): void;
|
|
1503
|
-
setProvider(provider: PublicClient): void;
|
|
1504
|
-
private requirePointToken;
|
|
1505
|
-
private requireProvider;
|
|
1506
|
-
private requireSigner;
|
|
1507
|
-
private requireChainId;
|
|
1508
|
-
getDomain(): Promise<PointTokenDomainConfig>;
|
|
1509
|
-
buildMintRequestTypedData(message: MintRequest): Promise<{
|
|
1510
|
-
domain: {
|
|
1511
|
-
name: string;
|
|
1512
|
-
version: "1";
|
|
1513
|
-
chainId: number;
|
|
1514
|
-
verifyingContract: `0x${string}`;
|
|
1515
|
-
};
|
|
1516
|
-
types: {
|
|
1517
|
-
readonly MintRequest: readonly [{
|
|
1518
|
-
readonly name: "to";
|
|
1519
|
-
readonly type: "address";
|
|
1520
|
-
}, {
|
|
1521
|
-
readonly name: "amount";
|
|
1522
|
-
readonly type: "uint256";
|
|
1523
|
-
}, {
|
|
1524
|
-
readonly name: "nonce";
|
|
1525
|
-
readonly type: "uint256";
|
|
1526
|
-
}, {
|
|
1527
|
-
readonly name: "deadline";
|
|
1528
|
-
readonly type: "uint256";
|
|
1529
|
-
}];
|
|
1530
|
-
};
|
|
1531
|
-
primaryType: "MintRequest";
|
|
1532
|
-
message: MintRequest;
|
|
1533
|
-
}>;
|
|
1534
|
-
buildReceiverConsentTypedData(message: ReceiverConsent): Promise<{
|
|
1535
|
-
domain: {
|
|
1536
|
-
name: string;
|
|
1537
|
-
version: "1";
|
|
1538
|
-
chainId: number;
|
|
1539
|
-
verifyingContract: `0x${string}`;
|
|
1540
|
-
};
|
|
1541
|
-
types: {
|
|
1542
|
-
readonly ReceiverConsent: readonly [{
|
|
1543
|
-
readonly name: "onBehalfOf";
|
|
1544
|
-
readonly type: "address";
|
|
1545
|
-
}, {
|
|
1546
|
-
readonly name: "originalReceiver";
|
|
1547
|
-
readonly type: "address";
|
|
1548
|
-
}, {
|
|
1549
|
-
readonly name: "amount";
|
|
1550
|
-
readonly type: "uint256";
|
|
1551
|
-
}, {
|
|
1552
|
-
readonly name: "nonce";
|
|
1553
|
-
readonly type: "uint256";
|
|
1554
|
-
}, {
|
|
1555
|
-
readonly name: "deadline";
|
|
1556
|
-
readonly type: "uint256";
|
|
1557
|
-
}, {
|
|
1558
|
-
readonly name: "extData";
|
|
1559
|
-
readonly type: "bytes";
|
|
1560
|
-
}];
|
|
1561
|
-
};
|
|
1562
|
-
primaryType: "ReceiverConsent";
|
|
1563
|
-
message: ReceiverConsent;
|
|
1564
|
-
}>;
|
|
1565
|
-
signMintRequest(message: MintRequest): Promise<EIP712Signature>;
|
|
1566
|
-
verifyMintRequest(message: MintRequest, signature: Hex, expectedMinter: Address): Promise<SignatureVerification>;
|
|
1567
|
-
signReceiverConsent(message: ReceiverConsent): Promise<EIP712Signature>;
|
|
1568
|
-
verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
|
|
1569
|
-
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
1570
|
-
getReceiverConsentNonce(receiver: Address): Promise<bigint>;
|
|
1571
|
-
/**
|
|
1572
|
-
* Find the best swap route from `tokenIn` to `tokenOut`.
|
|
1573
|
-
* Merges `pools` with COMMON_POOLS for the configured chain, builds all
|
|
1574
|
-
* paths, and quotes via a single multicall RPC call.
|
|
1575
|
-
*/
|
|
1576
|
-
findBestQuote(tokenIn: Address, tokenOut: Address, exactAmount: bigint, pools?: PoolKey[], quoterAddress?: Address, maxHops?: number): Promise<BestQuote>;
|
|
1577
|
-
/**
|
|
1578
|
-
* Build UniversalRouter execute args from a quote result.
|
|
1579
|
-
* The caller provides `minAmountOut` after applying their own slippage.
|
|
1580
|
-
*/
|
|
1581
|
-
buildSwapFromQuote(params: {
|
|
1582
|
-
quote: QuoteResult;
|
|
1583
|
-
currencyIn: Address;
|
|
1584
|
-
currencyOut: Address;
|
|
1585
|
-
amountIn: bigint;
|
|
1586
|
-
minAmountOut: bigint;
|
|
1587
|
-
}): {
|
|
1588
|
-
commands: Hex;
|
|
1589
|
-
inputs: Hex[];
|
|
1590
|
-
};
|
|
1591
|
-
/**
|
|
1592
|
-
* Simulate a UniversalRouter.execute swap call. Catches reverts (bad
|
|
1593
|
-
* approvals, insufficient balance, pool errors) before submitting.
|
|
1594
|
-
*
|
|
1595
|
-
* @param routerAddress - UniversalRouter contract address
|
|
1596
|
-
* @param commands - Packed command bytes (from buildSwapFromQuote)
|
|
1597
|
-
* @param inputs - Encoded inputs (from buildSwapFromQuote)
|
|
1598
|
-
* @param deadline - Unix timestamp
|
|
1599
|
-
* @param from - Address that will execute the swap
|
|
1600
|
-
*/
|
|
1601
|
-
simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
|
|
1602
|
-
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
1603
|
-
/** Sign a login message string with the current signer (personal_sign) */
|
|
1604
|
-
signLoginMessage(message: string): Promise<Hex>;
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
export { ApiError, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, BestQuote, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, EIP712Signature, ENTRY_POINT_V07, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, Operation, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, POINT_TOKEN_ABI as POINT_TOKEN_V2_ABI, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, PartialUserOperation, type PaymasterConfig, PointTokenDomainConfig, PoolKey, QuoteResult, ReceiverConsent, SUPPORTED_CHAINS, type SendWithPaymasterFallbackParams, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, SwapSimulationResult, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, UserOperation, V4_QUOTER_ADDRESSES, type VaultDepositFE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildPartialUserOperation, buildPerpDepositWithGasDeduction, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, setPafiWebModalAdapter, setPaymasterConfig, webPopupAdapter };
|