@pafi-dev/core 0.5.11 → 0.5.13

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/index.d.ts CHANGED
@@ -490,13 +490,16 @@ declare function rawCallOp(target: Address, data: `0x${string}`, value?: bigint)
490
490
  * Standard BatchExecutor ABI — a contract that takes an array of calls
491
491
  * and invokes each one in sequence, reverting all if any fail.
492
492
  *
493
- * Compatible with OpenZeppelin `Account.execute(Call[])`, Biconomy
494
- * `executeBatch`, Safe `MultiSend`, and most EIP-7702 delegation
495
- * targets. The exact deployed address is supplied by the infra team
496
- * (see [V1.4_V1.5_READINESS.md B2]).
493
+ * Function name is `executeBatch` (selector `0x34fcd5be`) to match
494
+ * Pimlico's `Simple7702Account` and Coinbase Smart Wallet v2 — both
495
+ * EIP-7702 delegate impls expose `executeBatch(Call[])`, not `execute`.
496
+ * The shorter `execute(Call[])` (selector `0x3f707e6b`) only exists on
497
+ * legacy/standalone batch executor contracts; calling it on a 7702
498
+ * delegated EOA falls through to the fallback function and reverts
499
+ * with "account: not from EntryPoint" (AA23).
497
500
  */
498
501
  declare const BATCH_EXECUTOR_ABI: readonly [{
499
- readonly name: "execute";
502
+ readonly name: "executeBatch";
500
503
  readonly type: "function";
501
504
  readonly stateMutability: "nonpayable";
502
505
  readonly inputs: readonly [{
@@ -633,6 +636,55 @@ declare function computeUserOpHash(userOp: {
633
636
  paymasterData?: Hex;
634
637
  }, chainId: number): Hex;
635
638
 
639
+ /**
640
+ * EIP-7702 delegate impls supported by the PAFI mobile prepare/submit
641
+ * flow. Each impl exposes `execute((address,uint256,bytes)[])` (same
642
+ * selector `0x34fcd5be...`) so callData encoding is identical, but
643
+ * each may use a slightly different dummy-signature pattern that
644
+ * Pimlico's `pm_sponsorUserOperation` simulation accepts.
645
+ */
646
+ type DelegateImpl = "simple7702" | "batchExecutor" | "unknown";
647
+ /**
648
+ * Pimlico's `Simple7702Account` implementation address on Base mainnet.
649
+ * Used by `permissionless.to7702SimpleSmartAccount`.
650
+ */
651
+ declare const SIMPLE_7702_IMPL_BASE_MAINNET: Address;
652
+ /**
653
+ * Coinbase Smart Wallet v2 BatchExecutor — original PAFI delegation
654
+ * target. Same on Base mainnet + Base Sepolia.
655
+ */
656
+ declare const BATCH_EXECUTOR_7702_IMPL: Address;
657
+ /**
658
+ * Standard ERC-4337 v0.7 ECDSA dummy signature — 65 bytes that
659
+ * are well-formed (so signature recovery doesn't crash) but
660
+ * obviously invalid (so they can't accidentally authorize a real
661
+ * tx). Both Simple7702 and BatchExecutor accept this pattern as
662
+ * the "estimating" signature during paymaster simulation.
663
+ *
664
+ * Source: viem-account-abstraction's default; matches what
665
+ * `permissionless.toSimpleSmartAccount` and `to7702SimpleSmartAccount`
666
+ * use for `getStubSignature()`.
667
+ */
668
+ declare const DUMMY_SIGNATURE_V07: Hex;
669
+ /**
670
+ * Map an EIP-7702 delegate target address to its `DelegateImpl` kind.
671
+ * Returns `'unknown'` when the address isn't a recognised PAFI-supported
672
+ * impl — caller should reject or fall back to a default behaviour.
673
+ */
674
+ declare function detectDelegateImpl(delegate: Address | null | undefined): DelegateImpl;
675
+ /**
676
+ * Return a dummy signature appropriate for a given delegate impl. Used
677
+ * by sponsor-relayer's `pm_sponsorUserOperation` forwarding so Pimlico
678
+ * can simulate validateUserOp without the user's actual signature
679
+ * (which is supplied later via `personal_sign(userOpHash)`).
680
+ *
681
+ * Currently both Simple7702 and BatchExecutor use the same v0.7 ECDSA
682
+ * dummy. Kept impl-keyed so future impls (Safe, Kernel, Biconomy) can
683
+ * supply their own pattern (e.g. ERC-1271 stubs) without forcing a
684
+ * sponsor-relayer redeploy.
685
+ */
686
+ declare function getDummySignatureFor7702(impl: DelegateImpl): Hex;
687
+
636
688
  /**
637
689
  * Module-level paymaster config shared by all batch builders and the
638
690
  * `@pafi/issuer` RelayService. Holds the fee recipient address and the
@@ -1438,4 +1490,4 @@ declare class PafiSDK {
1438
1490
  signLoginMessage(message: string): Promise<Hex>;
1439
1491
  }
1440
1492
 
1441
- export { ApiError, 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, EIP712Signature, ENTRY_POINT_V07, 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 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, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, webPopupAdapter };
1493
+ 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, 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 PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, PartialUserOperation, type PaymasterConfig, PointTokenDomainConfig, PoolKey, 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, UserOperation, V4_QUOTER_ADDRESSES, type VaultDepositFE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, 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, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, webPopupAdapter };
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ import {
82
82
  erc20TransferOp,
83
83
  rawCallOp,
84
84
  simulateSwap
85
- } from "./chunk-MWKJODJE.js";
85
+ } from "./chunk-PYIJO5XF.js";
86
86
  import {
87
87
  erc20Abi,
88
88
  permit2Abi,
@@ -440,6 +440,23 @@ function pack128(hi, lo) {
440
440
  return `0x${(hi << 128n | lo).toString(16).padStart(64, "0")}`;
441
441
  }
442
442
 
443
+ // src/userop/eip7702Helpers.ts
444
+ import { getAddress } from "viem";
445
+ var SIMPLE_7702_IMPL_BASE_MAINNET = "0xe6Cae83BdE06E4c305530e199D7217f42808555B";
446
+ var BATCH_EXECUTOR_7702_IMPL = "0x7702cb554e6bFb442cb743A7dF23154544a7176C";
447
+ var DUMMY_SIGNATURE_V07 = "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
448
+ function detectDelegateImpl(delegate) {
449
+ if (!delegate) return "unknown";
450
+ const addr = getAddress(delegate).toLowerCase();
451
+ if (addr === SIMPLE_7702_IMPL_BASE_MAINNET.toLowerCase()) return "simple7702";
452
+ if (addr === BATCH_EXECUTOR_7702_IMPL.toLowerCase()) return "batchExecutor";
453
+ return "unknown";
454
+ }
455
+ function getDummySignatureFor7702(impl) {
456
+ void impl;
457
+ return DUMMY_SIGNATURE_V07;
458
+ }
459
+
443
460
  // src/paymaster/config.ts
444
461
  var _config = null;
445
462
  function setPaymasterConfig(config) {
@@ -1077,6 +1094,7 @@ var PafiSDK = class {
1077
1094
  };
1078
1095
  export {
1079
1096
  ApiError,
1097
+ BATCH_EXECUTOR_7702_IMPL,
1080
1098
  BATCH_EXECUTOR_ABI,
1081
1099
  BATCH_EXECUTOR_ADDRESS_BASE_MAINNET,
1082
1100
  BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA,
@@ -1085,6 +1103,7 @@ export {
1085
1103
  COMMON_TOKENS,
1086
1104
  CONTRACT_ADDRESSES,
1087
1105
  ConfigurationError,
1106
+ DUMMY_SIGNATURE_V07,
1088
1107
  ENTRY_POINT_V07,
1089
1108
  ORDERLY_RELAY_ABI,
1090
1109
  ORDERLY_VAULT_ABI,
@@ -1099,6 +1118,7 @@ export {
1099
1118
  PafiSDK,
1100
1119
  PafiSDKError,
1101
1120
  SETTLE_ALL,
1121
+ SIMPLE_7702_IMPL_BASE_MAINNET,
1102
1122
  SPONSOR_AUTH_DOMAIN_NAME,
1103
1123
  SPONSOR_AUTH_TYPES,
1104
1124
  SUPPORTED_CHAINS,
@@ -1142,6 +1162,7 @@ export {
1142
1162
  createLoginMessage,
1143
1163
  createPafiProxyTransport,
1144
1164
  decodeBatchExecuteCalls,
1165
+ detectDelegateImpl,
1145
1166
  encodeBatchExecute,
1146
1167
  erc20Abi,
1147
1168
  erc20ApproveOp,
@@ -1152,6 +1173,7 @@ export {
1152
1173
  getAaNonce,
1153
1174
  getBurnRequestNonce,
1154
1175
  getContractAddresses,
1176
+ getDummySignatureFor7702,
1155
1177
  getIssuer2 as getIssuer,
1156
1178
  getMintRequestNonce,
1157
1179
  getPafiWebModalAdapter,