@pafi-dev/core 0.5.21 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abi/index.cjs +3 -7
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.js +6 -10
- package/dist/chunk-3QDZFDEL.cjs +223 -0
- package/dist/chunk-3QDZFDEL.cjs.map +1 -0
- package/dist/{chunk-Y2MZ7MKJ.js → chunk-6CXTFOIH.js} +196 -2
- package/dist/chunk-6CXTFOIH.js.map +1 -0
- package/dist/{chunk-R6OFGVMP.cjs → chunk-Q6WCDZXI.cjs} +196 -2
- package/dist/chunk-Q6WCDZXI.cjs.map +1 -0
- package/dist/{chunk-TXA4GK5C.js → chunk-UOKI5GG6.js} +87 -7
- package/dist/chunk-UOKI5GG6.js.map +1 -0
- package/dist/eip712/index.cjs +2 -3
- package/dist/eip712/index.cjs.map +1 -1
- package/dist/eip712/index.js +1 -2
- package/dist/index.cjs +215 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +116 -48
- package/dist/index.d.ts +116 -48
- package/dist/index.js +197 -148
- package/dist/index.js.map +1 -1
- package/package.json +1 -31
- package/dist/chunk-2PIXFXA2.js +0 -135
- package/dist/chunk-2PIXFXA2.js.map +0 -1
- package/dist/chunk-CL3QSI4O.cjs +0 -65
- package/dist/chunk-CL3QSI4O.cjs.map +0 -1
- package/dist/chunk-DX73FB4P.cjs +0 -143
- package/dist/chunk-DX73FB4P.cjs.map +0 -1
- package/dist/chunk-IPXARZ6F.cjs +0 -135
- package/dist/chunk-IPXARZ6F.cjs.map +0 -1
- package/dist/chunk-JJ2LGENO.cjs +0 -373
- package/dist/chunk-JJ2LGENO.cjs.map +0 -1
- package/dist/chunk-KFWZRL7I.js +0 -65
- package/dist/chunk-KFWZRL7I.js.map +0 -1
- package/dist/chunk-L5UHQQVC.cjs +0 -136
- package/dist/chunk-L5UHQQVC.cjs.map +0 -1
- package/dist/chunk-R6OFGVMP.cjs.map +0 -1
- package/dist/chunk-TXA4GK5C.js.map +0 -1
- package/dist/chunk-VG23GIWQ.js +0 -373
- package/dist/chunk-VG23GIWQ.js.map +0 -1
- package/dist/chunk-WAFUL62X.js +0 -136
- package/dist/chunk-WAFUL62X.js.map +0 -1
- package/dist/chunk-X2JZFK4C.cjs +0 -87
- package/dist/chunk-X2JZFK4C.cjs.map +0 -1
- package/dist/chunk-Y2MZ7MKJ.js.map +0 -1
- package/dist/chunk-Y3HMGOYW.js +0 -87
- package/dist/chunk-Y3HMGOYW.js.map +0 -1
- package/dist/index-3C_HdEIm.d.cts +0 -227
- package/dist/index-DKtVEoRC.d.ts +0 -227
- package/dist/quoting/index.cjs +0 -19
- package/dist/quoting/index.cjs.map +0 -1
- package/dist/quoting/index.d.cts +0 -59
- package/dist/quoting/index.d.ts +0 -59
- package/dist/quoting/index.js +0 -19
- package/dist/quoting/index.js.map +0 -1
- package/dist/swap/index.cjs +0 -31
- package/dist/swap/index.cjs.map +0 -1
- package/dist/swap/index.d.cts +0 -3
- package/dist/swap/index.d.ts +0 -3
- package/dist/swap/index.js +0 -31
- package/dist/swap/index.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Address, Hex, TypedDataDomain, 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
|
|
3
|
-
export { c as BurnRequest, I as Issuer, d as PathKey } from './types-JyuXUM8C.cjs';
|
|
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 } from './types-JyuXUM8C.cjs';
|
|
3
|
+
export { B as BestQuote, c as BurnRequest, I as Issuer, d as PathKey, Q as QuoteResult } from './types-JyuXUM8C.cjs';
|
|
4
4
|
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
|
|
5
5
|
export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.cjs';
|
|
6
6
|
export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, 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-3C_HdEIm.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-3C_HdEIm.cjs';
|
|
10
7
|
import { LoginMessageParams } from './auth/index.cjs';
|
|
11
8
|
export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.cjs';
|
|
12
9
|
|
|
@@ -267,6 +264,68 @@ interface VaultDepositFE {
|
|
|
267
264
|
tokenAmount: bigint;
|
|
268
265
|
}
|
|
269
266
|
|
|
267
|
+
/**
|
|
268
|
+
* A single call inside a batch. `BatchExecutor.execute(Call[])` iterates
|
|
269
|
+
* and invokes each one. When the batch runs via EIP-7702 delegation,
|
|
270
|
+
* `msg.sender` for each call is the user's EOA.
|
|
271
|
+
*/
|
|
272
|
+
interface Operation {
|
|
273
|
+
target: Address;
|
|
274
|
+
value: bigint;
|
|
275
|
+
data: Hex;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Paymaster fields attached to a UserOperation. Populated by the
|
|
279
|
+
* PAFI sponsor-relayer (via PAFI Backend proxy) before the user signs.
|
|
280
|
+
*/
|
|
281
|
+
interface PaymasterFields {
|
|
282
|
+
paymaster: Address;
|
|
283
|
+
paymasterData: Hex;
|
|
284
|
+
paymasterVerificationGasLimit: bigint;
|
|
285
|
+
paymasterPostOpGasLimit: bigint;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Partial UserOp used during preparation — before paymaster fields are
|
|
289
|
+
* attached or the user signs.
|
|
290
|
+
*/
|
|
291
|
+
interface PartialUserOperation {
|
|
292
|
+
sender: Address;
|
|
293
|
+
nonce: bigint;
|
|
294
|
+
callData: Hex;
|
|
295
|
+
callGasLimit: bigint;
|
|
296
|
+
verificationGasLimit: bigint;
|
|
297
|
+
preVerificationGas: bigint;
|
|
298
|
+
maxFeePerGas: bigint;
|
|
299
|
+
maxPriorityFeePerGas: bigint;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Full ERC-4337 v0.7 UserOperation, ready for bundler submission.
|
|
303
|
+
*/
|
|
304
|
+
interface UserOperation extends PartialUserOperation {
|
|
305
|
+
paymaster: Address;
|
|
306
|
+
paymasterData: Hex;
|
|
307
|
+
paymasterVerificationGasLimit: bigint;
|
|
308
|
+
paymasterPostOpGasLimit: bigint;
|
|
309
|
+
signature: Hex;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Receipt returned by a bundler after a UserOp lands on-chain.
|
|
313
|
+
*/
|
|
314
|
+
interface UserOpReceipt {
|
|
315
|
+
userOpHash: Hex;
|
|
316
|
+
success: boolean;
|
|
317
|
+
txHash: Hex;
|
|
318
|
+
blockNumber: bigint;
|
|
319
|
+
gasUsed: bigint;
|
|
320
|
+
/** Effective gas cost paid (wei). */
|
|
321
|
+
actualGasCost: bigint;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Sentinel operation value used in tests + docs when `Operation.value`
|
|
325
|
+
* is irrelevant (ERC-20 transfers, for example).
|
|
326
|
+
*/
|
|
327
|
+
declare const ZERO_VALUE = 0n;
|
|
328
|
+
|
|
270
329
|
/**
|
|
271
330
|
* v1.5 — Scenario 3: deposit USDC from the user's wallet into the
|
|
272
331
|
* Orderly perp Vault on Base mainnet.
|
|
@@ -280,7 +339,7 @@ interface VaultDepositFE {
|
|
|
280
339
|
*
|
|
281
340
|
* ## ⚠️ Native ETH constraint
|
|
282
341
|
*
|
|
283
|
-
*
|
|
342
|
+
* PAFI sponsor-relayer sponsors GAS, **not `msg.value`**. The LayerZero
|
|
284
343
|
* cross-chain fee MUST come from the user's own native ETH balance on
|
|
285
344
|
* Base — even when the rest of the UserOp is sponsored.
|
|
286
345
|
*
|
|
@@ -759,7 +818,7 @@ declare function getDummySignatureFor7702(impl: DelegateImpl): Hex;
|
|
|
759
818
|
* PAFI-assigned issuer identity.
|
|
760
819
|
*
|
|
761
820
|
* v1.4 update: the paymaster endpoint is **PAFI Backend**, which proxies
|
|
762
|
-
* to
|
|
821
|
+
* to PAFI sponsor-relayer. See [SPONSORED_PATH_FLOW.md].
|
|
763
822
|
*/
|
|
764
823
|
interface PaymasterConfig {
|
|
765
824
|
/**
|
|
@@ -812,7 +871,7 @@ declare function isPaymasterConfigured(): boolean;
|
|
|
812
871
|
* - `normal`: initiator has enough ETH; submit via `walletClient.writeContract`
|
|
813
872
|
* or a plain `eth_sendRawTransaction`. No paymaster round-trip.
|
|
814
873
|
* - `paymaster`: initiator doesn't have enough ETH; wrap the batch as a
|
|
815
|
-
* UserOperation and route through PAFI Backend →
|
|
874
|
+
* UserOperation and route through PAFI Backend → PAFI sponsor-relayer
|
|
816
875
|
* → Bundler.
|
|
817
876
|
*/
|
|
818
877
|
type SubmissionPath = "normal" | "paymaster";
|
|
@@ -835,7 +894,7 @@ interface CheckEthAndBranchParams {
|
|
|
835
894
|
/**
|
|
836
895
|
* Step 3 of the Generalized Flow ([SPONSORED_PATH_FLOW.md §2]):
|
|
837
896
|
* choose between the normal path (initiator pays ETH directly) and the
|
|
838
|
-
* paymaster path (bundler +
|
|
897
|
+
* paymaster path (bundler + PAFI sponsor-relayer).
|
|
839
898
|
*
|
|
840
899
|
* Intentionally synchronous in spirit — the only network call is
|
|
841
900
|
* `getBalance`. Callers can parallelize it with other reads.
|
|
@@ -972,6 +1031,53 @@ declare function computeAuthorizationHash(chainId: number, address: Address, non
|
|
|
972
1031
|
*/
|
|
973
1032
|
declare function isDelegatedToTarget(code: string | null | undefined, target: Address): boolean;
|
|
974
1033
|
|
|
1034
|
+
/**
|
|
1035
|
+
* EIP-7702 authorization tuple in the JSON-RPC wire format that bundlers
|
|
1036
|
+
* (Pimlico, Stackup, etc.) accept on `eth_sendUserOperation`. All
|
|
1037
|
+
* numeric fields are 0x-prefixed hex strings.
|
|
1038
|
+
*
|
|
1039
|
+
* Constructed from the user's secp256k1 signature over
|
|
1040
|
+
* `keccak256(0x05 || rlp([chainId, address, nonce]))` — see
|
|
1041
|
+
* `computeAuthorizationHash`.
|
|
1042
|
+
*/
|
|
1043
|
+
interface Eip7702AuthorizationJsonRpc {
|
|
1044
|
+
chainId: Hex;
|
|
1045
|
+
address: Address;
|
|
1046
|
+
nonce: Hex;
|
|
1047
|
+
r: Hex;
|
|
1048
|
+
s: Hex;
|
|
1049
|
+
yParity: Hex;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Split a serialized 65-byte ECDSA signature (`r || s || v`) into the
|
|
1053
|
+
* `{ r, s, yParity }` triple required by EIP-7702 authorization tuples
|
|
1054
|
+
* and EIP-1559+ transactions.
|
|
1055
|
+
*
|
|
1056
|
+
* Accepts the legacy `v ∈ {27, 28}` form and converts to `yParity ∈ {0, 1}`
|
|
1057
|
+
* automatically. Already-normalized `v ∈ {0, 1}` passes through unchanged.
|
|
1058
|
+
*
|
|
1059
|
+
* @throws when the signature is not 65 bytes (130 hex chars).
|
|
1060
|
+
*/
|
|
1061
|
+
declare function splitAuthorizationSig(authSig: Hex | string): {
|
|
1062
|
+
r: Hex;
|
|
1063
|
+
s: Hex;
|
|
1064
|
+
yParity: 0 | 1;
|
|
1065
|
+
};
|
|
1066
|
+
/**
|
|
1067
|
+
* Build the JSON-RPC EIP-7702 authorization tuple from raw fields and a
|
|
1068
|
+
* 65-byte secp256k1 signature.
|
|
1069
|
+
*
|
|
1070
|
+
* The `authSig` is the user's signature over `computeAuthorizationHash(
|
|
1071
|
+
* chainId, address, nonce )` — typically obtained via
|
|
1072
|
+
* `wallet.signAuthorization(...)` on the client.
|
|
1073
|
+
*/
|
|
1074
|
+
declare function buildEip7702Authorization(params: {
|
|
1075
|
+
chainId: number;
|
|
1076
|
+
address: Address;
|
|
1077
|
+
nonce: bigint;
|
|
1078
|
+
authSig: Hex | string;
|
|
1079
|
+
}): Eip7702AuthorizationJsonRpc;
|
|
1080
|
+
|
|
975
1081
|
/**
|
|
976
1082
|
* Parameters for `createPafiProxyTransport`.
|
|
977
1083
|
*/
|
|
@@ -1481,13 +1587,6 @@ declare class PafiSDK {
|
|
|
1481
1587
|
verify: PafiSDK["verifyReceiverConsent"];
|
|
1482
1588
|
getNonce: PafiSDK["getReceiverConsentNonce"];
|
|
1483
1589
|
};
|
|
1484
|
-
readonly swap: {
|
|
1485
|
-
buildFromQuote: PafiSDK["buildSwapFromQuote"];
|
|
1486
|
-
simulate: PafiSDK["simulateSwap"];
|
|
1487
|
-
};
|
|
1488
|
-
readonly quote: {
|
|
1489
|
-
findBest: PafiSDK["findBestQuote"];
|
|
1490
|
-
};
|
|
1491
1590
|
readonly auth: {
|
|
1492
1591
|
createLoginMessage: PafiSDK["createLoginMessage"];
|
|
1493
1592
|
signMessage: PafiSDK["signLoginMessage"];
|
|
@@ -1563,40 +1662,9 @@ declare class PafiSDK {
|
|
|
1563
1662
|
verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
|
|
1564
1663
|
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
1565
1664
|
getReceiverConsentNonce(receiver: Address): Promise<bigint>;
|
|
1566
|
-
/**
|
|
1567
|
-
* Find the best swap route from `tokenIn` to `tokenOut`.
|
|
1568
|
-
* Merges `pools` with COMMON_POOLS for the configured chain, builds all
|
|
1569
|
-
* paths, and quotes via a single multicall RPC call.
|
|
1570
|
-
*/
|
|
1571
|
-
findBestQuote(tokenIn: Address, tokenOut: Address, exactAmount: bigint, pools?: PoolKey[], quoterAddress?: Address, maxHops?: number): Promise<BestQuote>;
|
|
1572
|
-
/**
|
|
1573
|
-
* Build UniversalRouter execute args from a quote result.
|
|
1574
|
-
* The caller provides `minAmountOut` after applying their own slippage.
|
|
1575
|
-
*/
|
|
1576
|
-
buildSwapFromQuote(params: {
|
|
1577
|
-
quote: QuoteResult;
|
|
1578
|
-
currencyIn: Address;
|
|
1579
|
-
currencyOut: Address;
|
|
1580
|
-
amountIn: bigint;
|
|
1581
|
-
minAmountOut: bigint;
|
|
1582
|
-
}): {
|
|
1583
|
-
commands: Hex;
|
|
1584
|
-
inputs: Hex[];
|
|
1585
|
-
};
|
|
1586
|
-
/**
|
|
1587
|
-
* Simulate a UniversalRouter.execute swap call. Catches reverts (bad
|
|
1588
|
-
* approvals, insufficient balance, pool errors) before submitting.
|
|
1589
|
-
*
|
|
1590
|
-
* @param routerAddress - UniversalRouter contract address
|
|
1591
|
-
* @param commands - Packed command bytes (from buildSwapFromQuote)
|
|
1592
|
-
* @param inputs - Encoded inputs (from buildSwapFromQuote)
|
|
1593
|
-
* @param deadline - Unix timestamp
|
|
1594
|
-
* @param from - Address that will execute the swap
|
|
1595
|
-
*/
|
|
1596
|
-
simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
|
|
1597
1665
|
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
1598
1666
|
/** Sign a login message string with the current signer (personal_sign) */
|
|
1599
1667
|
signLoginMessage(message: string): Promise<Hex>;
|
|
1600
1668
|
}
|
|
1601
1669
|
|
|
1602
|
-
export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES,
|
|
1670
|
+
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 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, type OrderlyRelayDepositRequest, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, ReceiverConsent, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SendWithPaymasterFallbackParams, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Address, Hex, TypedDataDomain, 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
|
|
3
|
-
export { c as BurnRequest, I as Issuer, d as PathKey } from './types-JyuXUM8C.js';
|
|
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 } from './types-JyuXUM8C.js';
|
|
3
|
+
export { B as BestQuote, c as BurnRequest, I as Issuer, d as PathKey, Q as QuoteResult } from './types-JyuXUM8C.js';
|
|
4
4
|
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
|
|
5
5
|
export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
|
|
6
6
|
export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.js';
|
|
7
|
-
export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle } from './quoting/index.js';
|
|
8
|
-
import { P as PartialUserOperation, O as Operation, U as UserOperation, S as SwapSimulationResult } from './index-DKtVEoRC.js';
|
|
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-DKtVEoRC.js';
|
|
10
7
|
import { LoginMessageParams } from './auth/index.js';
|
|
11
8
|
export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.js';
|
|
12
9
|
|
|
@@ -267,6 +264,68 @@ interface VaultDepositFE {
|
|
|
267
264
|
tokenAmount: bigint;
|
|
268
265
|
}
|
|
269
266
|
|
|
267
|
+
/**
|
|
268
|
+
* A single call inside a batch. `BatchExecutor.execute(Call[])` iterates
|
|
269
|
+
* and invokes each one. When the batch runs via EIP-7702 delegation,
|
|
270
|
+
* `msg.sender` for each call is the user's EOA.
|
|
271
|
+
*/
|
|
272
|
+
interface Operation {
|
|
273
|
+
target: Address;
|
|
274
|
+
value: bigint;
|
|
275
|
+
data: Hex;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Paymaster fields attached to a UserOperation. Populated by the
|
|
279
|
+
* PAFI sponsor-relayer (via PAFI Backend proxy) before the user signs.
|
|
280
|
+
*/
|
|
281
|
+
interface PaymasterFields {
|
|
282
|
+
paymaster: Address;
|
|
283
|
+
paymasterData: Hex;
|
|
284
|
+
paymasterVerificationGasLimit: bigint;
|
|
285
|
+
paymasterPostOpGasLimit: bigint;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Partial UserOp used during preparation — before paymaster fields are
|
|
289
|
+
* attached or the user signs.
|
|
290
|
+
*/
|
|
291
|
+
interface PartialUserOperation {
|
|
292
|
+
sender: Address;
|
|
293
|
+
nonce: bigint;
|
|
294
|
+
callData: Hex;
|
|
295
|
+
callGasLimit: bigint;
|
|
296
|
+
verificationGasLimit: bigint;
|
|
297
|
+
preVerificationGas: bigint;
|
|
298
|
+
maxFeePerGas: bigint;
|
|
299
|
+
maxPriorityFeePerGas: bigint;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Full ERC-4337 v0.7 UserOperation, ready for bundler submission.
|
|
303
|
+
*/
|
|
304
|
+
interface UserOperation extends PartialUserOperation {
|
|
305
|
+
paymaster: Address;
|
|
306
|
+
paymasterData: Hex;
|
|
307
|
+
paymasterVerificationGasLimit: bigint;
|
|
308
|
+
paymasterPostOpGasLimit: bigint;
|
|
309
|
+
signature: Hex;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Receipt returned by a bundler after a UserOp lands on-chain.
|
|
313
|
+
*/
|
|
314
|
+
interface UserOpReceipt {
|
|
315
|
+
userOpHash: Hex;
|
|
316
|
+
success: boolean;
|
|
317
|
+
txHash: Hex;
|
|
318
|
+
blockNumber: bigint;
|
|
319
|
+
gasUsed: bigint;
|
|
320
|
+
/** Effective gas cost paid (wei). */
|
|
321
|
+
actualGasCost: bigint;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Sentinel operation value used in tests + docs when `Operation.value`
|
|
325
|
+
* is irrelevant (ERC-20 transfers, for example).
|
|
326
|
+
*/
|
|
327
|
+
declare const ZERO_VALUE = 0n;
|
|
328
|
+
|
|
270
329
|
/**
|
|
271
330
|
* v1.5 — Scenario 3: deposit USDC from the user's wallet into the
|
|
272
331
|
* Orderly perp Vault on Base mainnet.
|
|
@@ -280,7 +339,7 @@ interface VaultDepositFE {
|
|
|
280
339
|
*
|
|
281
340
|
* ## ⚠️ Native ETH constraint
|
|
282
341
|
*
|
|
283
|
-
*
|
|
342
|
+
* PAFI sponsor-relayer sponsors GAS, **not `msg.value`**. The LayerZero
|
|
284
343
|
* cross-chain fee MUST come from the user's own native ETH balance on
|
|
285
344
|
* Base — even when the rest of the UserOp is sponsored.
|
|
286
345
|
*
|
|
@@ -759,7 +818,7 @@ declare function getDummySignatureFor7702(impl: DelegateImpl): Hex;
|
|
|
759
818
|
* PAFI-assigned issuer identity.
|
|
760
819
|
*
|
|
761
820
|
* v1.4 update: the paymaster endpoint is **PAFI Backend**, which proxies
|
|
762
|
-
* to
|
|
821
|
+
* to PAFI sponsor-relayer. See [SPONSORED_PATH_FLOW.md].
|
|
763
822
|
*/
|
|
764
823
|
interface PaymasterConfig {
|
|
765
824
|
/**
|
|
@@ -812,7 +871,7 @@ declare function isPaymasterConfigured(): boolean;
|
|
|
812
871
|
* - `normal`: initiator has enough ETH; submit via `walletClient.writeContract`
|
|
813
872
|
* or a plain `eth_sendRawTransaction`. No paymaster round-trip.
|
|
814
873
|
* - `paymaster`: initiator doesn't have enough ETH; wrap the batch as a
|
|
815
|
-
* UserOperation and route through PAFI Backend →
|
|
874
|
+
* UserOperation and route through PAFI Backend → PAFI sponsor-relayer
|
|
816
875
|
* → Bundler.
|
|
817
876
|
*/
|
|
818
877
|
type SubmissionPath = "normal" | "paymaster";
|
|
@@ -835,7 +894,7 @@ interface CheckEthAndBranchParams {
|
|
|
835
894
|
/**
|
|
836
895
|
* Step 3 of the Generalized Flow ([SPONSORED_PATH_FLOW.md §2]):
|
|
837
896
|
* choose between the normal path (initiator pays ETH directly) and the
|
|
838
|
-
* paymaster path (bundler +
|
|
897
|
+
* paymaster path (bundler + PAFI sponsor-relayer).
|
|
839
898
|
*
|
|
840
899
|
* Intentionally synchronous in spirit — the only network call is
|
|
841
900
|
* `getBalance`. Callers can parallelize it with other reads.
|
|
@@ -972,6 +1031,53 @@ declare function computeAuthorizationHash(chainId: number, address: Address, non
|
|
|
972
1031
|
*/
|
|
973
1032
|
declare function isDelegatedToTarget(code: string | null | undefined, target: Address): boolean;
|
|
974
1033
|
|
|
1034
|
+
/**
|
|
1035
|
+
* EIP-7702 authorization tuple in the JSON-RPC wire format that bundlers
|
|
1036
|
+
* (Pimlico, Stackup, etc.) accept on `eth_sendUserOperation`. All
|
|
1037
|
+
* numeric fields are 0x-prefixed hex strings.
|
|
1038
|
+
*
|
|
1039
|
+
* Constructed from the user's secp256k1 signature over
|
|
1040
|
+
* `keccak256(0x05 || rlp([chainId, address, nonce]))` — see
|
|
1041
|
+
* `computeAuthorizationHash`.
|
|
1042
|
+
*/
|
|
1043
|
+
interface Eip7702AuthorizationJsonRpc {
|
|
1044
|
+
chainId: Hex;
|
|
1045
|
+
address: Address;
|
|
1046
|
+
nonce: Hex;
|
|
1047
|
+
r: Hex;
|
|
1048
|
+
s: Hex;
|
|
1049
|
+
yParity: Hex;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Split a serialized 65-byte ECDSA signature (`r || s || v`) into the
|
|
1053
|
+
* `{ r, s, yParity }` triple required by EIP-7702 authorization tuples
|
|
1054
|
+
* and EIP-1559+ transactions.
|
|
1055
|
+
*
|
|
1056
|
+
* Accepts the legacy `v ∈ {27, 28}` form and converts to `yParity ∈ {0, 1}`
|
|
1057
|
+
* automatically. Already-normalized `v ∈ {0, 1}` passes through unchanged.
|
|
1058
|
+
*
|
|
1059
|
+
* @throws when the signature is not 65 bytes (130 hex chars).
|
|
1060
|
+
*/
|
|
1061
|
+
declare function splitAuthorizationSig(authSig: Hex | string): {
|
|
1062
|
+
r: Hex;
|
|
1063
|
+
s: Hex;
|
|
1064
|
+
yParity: 0 | 1;
|
|
1065
|
+
};
|
|
1066
|
+
/**
|
|
1067
|
+
* Build the JSON-RPC EIP-7702 authorization tuple from raw fields and a
|
|
1068
|
+
* 65-byte secp256k1 signature.
|
|
1069
|
+
*
|
|
1070
|
+
* The `authSig` is the user's signature over `computeAuthorizationHash(
|
|
1071
|
+
* chainId, address, nonce )` — typically obtained via
|
|
1072
|
+
* `wallet.signAuthorization(...)` on the client.
|
|
1073
|
+
*/
|
|
1074
|
+
declare function buildEip7702Authorization(params: {
|
|
1075
|
+
chainId: number;
|
|
1076
|
+
address: Address;
|
|
1077
|
+
nonce: bigint;
|
|
1078
|
+
authSig: Hex | string;
|
|
1079
|
+
}): Eip7702AuthorizationJsonRpc;
|
|
1080
|
+
|
|
975
1081
|
/**
|
|
976
1082
|
* Parameters for `createPafiProxyTransport`.
|
|
977
1083
|
*/
|
|
@@ -1481,13 +1587,6 @@ declare class PafiSDK {
|
|
|
1481
1587
|
verify: PafiSDK["verifyReceiverConsent"];
|
|
1482
1588
|
getNonce: PafiSDK["getReceiverConsentNonce"];
|
|
1483
1589
|
};
|
|
1484
|
-
readonly swap: {
|
|
1485
|
-
buildFromQuote: PafiSDK["buildSwapFromQuote"];
|
|
1486
|
-
simulate: PafiSDK["simulateSwap"];
|
|
1487
|
-
};
|
|
1488
|
-
readonly quote: {
|
|
1489
|
-
findBest: PafiSDK["findBestQuote"];
|
|
1490
|
-
};
|
|
1491
1590
|
readonly auth: {
|
|
1492
1591
|
createLoginMessage: PafiSDK["createLoginMessage"];
|
|
1493
1592
|
signMessage: PafiSDK["signLoginMessage"];
|
|
@@ -1563,40 +1662,9 @@ declare class PafiSDK {
|
|
|
1563
1662
|
verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
|
|
1564
1663
|
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
1565
1664
|
getReceiverConsentNonce(receiver: Address): Promise<bigint>;
|
|
1566
|
-
/**
|
|
1567
|
-
* Find the best swap route from `tokenIn` to `tokenOut`.
|
|
1568
|
-
* Merges `pools` with COMMON_POOLS for the configured chain, builds all
|
|
1569
|
-
* paths, and quotes via a single multicall RPC call.
|
|
1570
|
-
*/
|
|
1571
|
-
findBestQuote(tokenIn: Address, tokenOut: Address, exactAmount: bigint, pools?: PoolKey[], quoterAddress?: Address, maxHops?: number): Promise<BestQuote>;
|
|
1572
|
-
/**
|
|
1573
|
-
* Build UniversalRouter execute args from a quote result.
|
|
1574
|
-
* The caller provides `minAmountOut` after applying their own slippage.
|
|
1575
|
-
*/
|
|
1576
|
-
buildSwapFromQuote(params: {
|
|
1577
|
-
quote: QuoteResult;
|
|
1578
|
-
currencyIn: Address;
|
|
1579
|
-
currencyOut: Address;
|
|
1580
|
-
amountIn: bigint;
|
|
1581
|
-
minAmountOut: bigint;
|
|
1582
|
-
}): {
|
|
1583
|
-
commands: Hex;
|
|
1584
|
-
inputs: Hex[];
|
|
1585
|
-
};
|
|
1586
|
-
/**
|
|
1587
|
-
* Simulate a UniversalRouter.execute swap call. Catches reverts (bad
|
|
1588
|
-
* approvals, insufficient balance, pool errors) before submitting.
|
|
1589
|
-
*
|
|
1590
|
-
* @param routerAddress - UniversalRouter contract address
|
|
1591
|
-
* @param commands - Packed command bytes (from buildSwapFromQuote)
|
|
1592
|
-
* @param inputs - Encoded inputs (from buildSwapFromQuote)
|
|
1593
|
-
* @param deadline - Unix timestamp
|
|
1594
|
-
* @param from - Address that will execute the swap
|
|
1595
|
-
*/
|
|
1596
|
-
simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
|
|
1597
1665
|
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
1598
1666
|
/** Sign a login message string with the current signer (personal_sign) */
|
|
1599
1667
|
signLoginMessage(message: string): Promise<Hex>;
|
|
1600
1668
|
}
|
|
1601
1669
|
|
|
1602
|
-
export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES,
|
|
1670
|
+
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 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, type OrderlyRelayDepositRequest, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, ReceiverConsent, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SendWithPaymasterFallbackParams, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|