@pafi-dev/core 0.5.22 → 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.
Files changed (60) hide show
  1. package/dist/abi/index.cjs +3 -7
  2. package/dist/abi/index.cjs.map +1 -1
  3. package/dist/abi/index.js +6 -10
  4. package/dist/chunk-3QDZFDEL.cjs +223 -0
  5. package/dist/chunk-3QDZFDEL.cjs.map +1 -0
  6. package/dist/{chunk-Y2MZ7MKJ.js → chunk-6CXTFOIH.js} +196 -2
  7. package/dist/chunk-6CXTFOIH.js.map +1 -0
  8. package/dist/{chunk-R6OFGVMP.cjs → chunk-Q6WCDZXI.cjs} +196 -2
  9. package/dist/chunk-Q6WCDZXI.cjs.map +1 -0
  10. package/dist/{chunk-TXA4GK5C.js → chunk-UOKI5GG6.js} +87 -7
  11. package/dist/chunk-UOKI5GG6.js.map +1 -0
  12. package/dist/eip712/index.cjs +2 -3
  13. package/dist/eip712/index.cjs.map +1 -1
  14. package/dist/eip712/index.js +1 -2
  15. package/dist/index.cjs +184 -168
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +69 -48
  18. package/dist/index.d.ts +69 -48
  19. package/dist/index.js +164 -148
  20. package/dist/index.js.map +1 -1
  21. package/package.json +1 -31
  22. package/dist/chunk-2PIXFXA2.js +0 -135
  23. package/dist/chunk-2PIXFXA2.js.map +0 -1
  24. package/dist/chunk-CL3QSI4O.cjs +0 -65
  25. package/dist/chunk-CL3QSI4O.cjs.map +0 -1
  26. package/dist/chunk-DX73FB4P.cjs +0 -143
  27. package/dist/chunk-DX73FB4P.cjs.map +0 -1
  28. package/dist/chunk-IPXARZ6F.cjs +0 -135
  29. package/dist/chunk-IPXARZ6F.cjs.map +0 -1
  30. package/dist/chunk-JJ2LGENO.cjs +0 -373
  31. package/dist/chunk-JJ2LGENO.cjs.map +0 -1
  32. package/dist/chunk-KFWZRL7I.js +0 -65
  33. package/dist/chunk-KFWZRL7I.js.map +0 -1
  34. package/dist/chunk-L5UHQQVC.cjs +0 -136
  35. package/dist/chunk-L5UHQQVC.cjs.map +0 -1
  36. package/dist/chunk-R6OFGVMP.cjs.map +0 -1
  37. package/dist/chunk-TXA4GK5C.js.map +0 -1
  38. package/dist/chunk-VG23GIWQ.js +0 -373
  39. package/dist/chunk-VG23GIWQ.js.map +0 -1
  40. package/dist/chunk-WAFUL62X.js +0 -136
  41. package/dist/chunk-WAFUL62X.js.map +0 -1
  42. package/dist/chunk-X2JZFK4C.cjs +0 -87
  43. package/dist/chunk-X2JZFK4C.cjs.map +0 -1
  44. package/dist/chunk-Y2MZ7MKJ.js.map +0 -1
  45. package/dist/chunk-Y3HMGOYW.js +0 -87
  46. package/dist/chunk-Y3HMGOYW.js.map +0 -1
  47. package/dist/index-3C_HdEIm.d.cts +0 -227
  48. package/dist/index-DKtVEoRC.d.ts +0 -227
  49. package/dist/quoting/index.cjs +0 -19
  50. package/dist/quoting/index.cjs.map +0 -1
  51. package/dist/quoting/index.d.cts +0 -59
  52. package/dist/quoting/index.d.ts +0 -59
  53. package/dist/quoting/index.js +0 -19
  54. package/dist/quoting/index.js.map +0 -1
  55. package/dist/swap/index.cjs +0 -31
  56. package/dist/swap/index.cjs.map +0 -1
  57. package/dist/swap/index.d.cts +0 -3
  58. package/dist/swap/index.d.ts +0 -3
  59. package/dist/swap/index.js +0 -31
  60. 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, B as BestQuote, Q as QuoteResult } from './types-JyuXUM8C.cjs';
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
- * Coinbase Paymaster sponsors GAS, **not `msg.value`**. The LayerZero
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 Coinbase Paymaster. See [SPONSORED_PATH_FLOW.md].
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 → Coinbase Paymaster
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 + Coinbase Paymaster).
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.
@@ -1528,13 +1587,6 @@ declare class PafiSDK {
1528
1587
  verify: PafiSDK["verifyReceiverConsent"];
1529
1588
  getNonce: PafiSDK["getReceiverConsentNonce"];
1530
1589
  };
1531
- readonly swap: {
1532
- buildFromQuote: PafiSDK["buildSwapFromQuote"];
1533
- simulate: PafiSDK["simulateSwap"];
1534
- };
1535
- readonly quote: {
1536
- findBest: PafiSDK["findBestQuote"];
1537
- };
1538
1590
  readonly auth: {
1539
1591
  createLoginMessage: PafiSDK["createLoginMessage"];
1540
1592
  signMessage: PafiSDK["signLoginMessage"];
@@ -1610,40 +1662,9 @@ declare class PafiSDK {
1610
1662
  verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
1611
1663
  getMintRequestNonce(receiver: Address): Promise<bigint>;
1612
1664
  getReceiverConsentNonce(receiver: Address): Promise<bigint>;
1613
- /**
1614
- * Find the best swap route from `tokenIn` to `tokenOut`.
1615
- * Merges `pools` with COMMON_POOLS for the configured chain, builds all
1616
- * paths, and quotes via a single multicall RPC call.
1617
- */
1618
- findBestQuote(tokenIn: Address, tokenOut: Address, exactAmount: bigint, pools?: PoolKey[], quoterAddress?: Address, maxHops?: number): Promise<BestQuote>;
1619
- /**
1620
- * Build UniversalRouter execute args from a quote result.
1621
- * The caller provides `minAmountOut` after applying their own slippage.
1622
- */
1623
- buildSwapFromQuote(params: {
1624
- quote: QuoteResult;
1625
- currencyIn: Address;
1626
- currencyOut: Address;
1627
- amountIn: bigint;
1628
- minAmountOut: bigint;
1629
- }): {
1630
- commands: Hex;
1631
- inputs: Hex[];
1632
- };
1633
- /**
1634
- * Simulate a UniversalRouter.execute swap call. Catches reverts (bad
1635
- * approvals, insufficient balance, pool errors) before submitting.
1636
- *
1637
- * @param routerAddress - UniversalRouter contract address
1638
- * @param commands - Packed command bytes (from buildSwapFromQuote)
1639
- * @param inputs - Encoded inputs (from buildSwapFromQuote)
1640
- * @param deadline - Unix timestamp
1641
- * @param from - Address that will execute the swap
1642
- */
1643
- simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
1644
1665
  createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
1645
1666
  /** Sign a login message string with the current signer (personal_sign) */
1646
1667
  signLoginMessage(message: string): Promise<Hex>;
1647
1668
  }
1648
1669
 
1649
- export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, BestQuote, 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, 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, PartialUserOperation, type PaymasterConfig, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, QuoteResult, ReceiverConsent, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SendWithPaymasterFallbackParams, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, SwapSimulationResult, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpTypedData, UserOperation, V4_QUOTER_ADDRESSES, type VaultDepositFE, _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 };
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, B as BestQuote, Q as QuoteResult } from './types-JyuXUM8C.js';
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
- * Coinbase Paymaster sponsors GAS, **not `msg.value`**. The LayerZero
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 Coinbase Paymaster. See [SPONSORED_PATH_FLOW.md].
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 → Coinbase Paymaster
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 + Coinbase Paymaster).
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.
@@ -1528,13 +1587,6 @@ declare class PafiSDK {
1528
1587
  verify: PafiSDK["verifyReceiverConsent"];
1529
1588
  getNonce: PafiSDK["getReceiverConsentNonce"];
1530
1589
  };
1531
- readonly swap: {
1532
- buildFromQuote: PafiSDK["buildSwapFromQuote"];
1533
- simulate: PafiSDK["simulateSwap"];
1534
- };
1535
- readonly quote: {
1536
- findBest: PafiSDK["findBestQuote"];
1537
- };
1538
1590
  readonly auth: {
1539
1591
  createLoginMessage: PafiSDK["createLoginMessage"];
1540
1592
  signMessage: PafiSDK["signLoginMessage"];
@@ -1610,40 +1662,9 @@ declare class PafiSDK {
1610
1662
  verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
1611
1663
  getMintRequestNonce(receiver: Address): Promise<bigint>;
1612
1664
  getReceiverConsentNonce(receiver: Address): Promise<bigint>;
1613
- /**
1614
- * Find the best swap route from `tokenIn` to `tokenOut`.
1615
- * Merges `pools` with COMMON_POOLS for the configured chain, builds all
1616
- * paths, and quotes via a single multicall RPC call.
1617
- */
1618
- findBestQuote(tokenIn: Address, tokenOut: Address, exactAmount: bigint, pools?: PoolKey[], quoterAddress?: Address, maxHops?: number): Promise<BestQuote>;
1619
- /**
1620
- * Build UniversalRouter execute args from a quote result.
1621
- * The caller provides `minAmountOut` after applying their own slippage.
1622
- */
1623
- buildSwapFromQuote(params: {
1624
- quote: QuoteResult;
1625
- currencyIn: Address;
1626
- currencyOut: Address;
1627
- amountIn: bigint;
1628
- minAmountOut: bigint;
1629
- }): {
1630
- commands: Hex;
1631
- inputs: Hex[];
1632
- };
1633
- /**
1634
- * Simulate a UniversalRouter.execute swap call. Catches reverts (bad
1635
- * approvals, insufficient balance, pool errors) before submitting.
1636
- *
1637
- * @param routerAddress - UniversalRouter contract address
1638
- * @param commands - Packed command bytes (from buildSwapFromQuote)
1639
- * @param inputs - Encoded inputs (from buildSwapFromQuote)
1640
- * @param deadline - Unix timestamp
1641
- * @param from - Address that will execute the swap
1642
- */
1643
- simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
1644
1665
  createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
1645
1666
  /** Sign a login message string with the current signer (personal_sign) */
1646
1667
  signLoginMessage(message: string): Promise<Hex>;
1647
1668
  }
1648
1669
 
1649
- export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, BestQuote, 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, 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, PartialUserOperation, type PaymasterConfig, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, QuoteResult, ReceiverConsent, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SendWithPaymasterFallbackParams, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, SwapSimulationResult, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpTypedData, UserOperation, V4_QUOTER_ADDRESSES, type VaultDepositFE, _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 };
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 };