@pafi-dev/core 0.5.10 → 0.5.12
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-YHUPQP6R.cjs → chunk-CLPRSQT2.cjs} +36 -4
- package/dist/chunk-CLPRSQT2.cjs.map +1 -0
- package/dist/{chunk-ZGA5EAFJ.js → chunk-YDLMVWDH.js} +35 -3
- package/dist/chunk-YDLMVWDH.js.map +1 -0
- package/dist/contract/index.cjs +4 -2
- package/dist/contract/index.cjs.map +1 -1
- package/dist/contract/index.d.cts +43 -1
- package/dist/contract/index.d.ts +43 -1
- package/dist/contract/index.js +3 -1
- package/dist/index.cjs +29 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -2
- package/dist/index.d.ts +51 -2
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-YHUPQP6R.cjs.map +0 -1
- package/dist/chunk-ZGA5EAFJ.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDoma
|
|
|
3
3
|
export { c as BurnRequest, I as Issuer, d as PathKey } 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
|
-
export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.js';
|
|
6
|
+
export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.js';
|
|
7
7
|
export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle } from './quoting/index.js';
|
|
8
8
|
import { P as PartialUserOperation, O as Operation, U as UserOperation, S as SwapSimulationResult } from './index-DKtVEoRC.js';
|
|
9
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';
|
|
@@ -633,6 +633,55 @@ declare function computeUserOpHash(userOp: {
|
|
|
633
633
|
paymasterData?: Hex;
|
|
634
634
|
}, chainId: number): Hex;
|
|
635
635
|
|
|
636
|
+
/**
|
|
637
|
+
* EIP-7702 delegate impls supported by the PAFI mobile prepare/submit
|
|
638
|
+
* flow. Each impl exposes `execute((address,uint256,bytes)[])` (same
|
|
639
|
+
* selector `0x34fcd5be...`) so callData encoding is identical, but
|
|
640
|
+
* each may use a slightly different dummy-signature pattern that
|
|
641
|
+
* Pimlico's `pm_sponsorUserOperation` simulation accepts.
|
|
642
|
+
*/
|
|
643
|
+
type DelegateImpl = "simple7702" | "batchExecutor" | "unknown";
|
|
644
|
+
/**
|
|
645
|
+
* Pimlico's `Simple7702Account` implementation address on Base mainnet.
|
|
646
|
+
* Used by `permissionless.to7702SimpleSmartAccount`.
|
|
647
|
+
*/
|
|
648
|
+
declare const SIMPLE_7702_IMPL_BASE_MAINNET: Address;
|
|
649
|
+
/**
|
|
650
|
+
* Coinbase Smart Wallet v2 BatchExecutor — original PAFI delegation
|
|
651
|
+
* target. Same on Base mainnet + Base Sepolia.
|
|
652
|
+
*/
|
|
653
|
+
declare const BATCH_EXECUTOR_7702_IMPL: Address;
|
|
654
|
+
/**
|
|
655
|
+
* Standard ERC-4337 v0.7 ECDSA dummy signature — 65 bytes that
|
|
656
|
+
* are well-formed (so signature recovery doesn't crash) but
|
|
657
|
+
* obviously invalid (so they can't accidentally authorize a real
|
|
658
|
+
* tx). Both Simple7702 and BatchExecutor accept this pattern as
|
|
659
|
+
* the "estimating" signature during paymaster simulation.
|
|
660
|
+
*
|
|
661
|
+
* Source: viem-account-abstraction's default; matches what
|
|
662
|
+
* `permissionless.toSimpleSmartAccount` and `to7702SimpleSmartAccount`
|
|
663
|
+
* use for `getStubSignature()`.
|
|
664
|
+
*/
|
|
665
|
+
declare const DUMMY_SIGNATURE_V07: Hex;
|
|
666
|
+
/**
|
|
667
|
+
* Map an EIP-7702 delegate target address to its `DelegateImpl` kind.
|
|
668
|
+
* Returns `'unknown'` when the address isn't a recognised PAFI-supported
|
|
669
|
+
* impl — caller should reject or fall back to a default behaviour.
|
|
670
|
+
*/
|
|
671
|
+
declare function detectDelegateImpl(delegate: Address | null | undefined): DelegateImpl;
|
|
672
|
+
/**
|
|
673
|
+
* Return a dummy signature appropriate for a given delegate impl. Used
|
|
674
|
+
* by sponsor-relayer's `pm_sponsorUserOperation` forwarding so Pimlico
|
|
675
|
+
* can simulate validateUserOp without the user's actual signature
|
|
676
|
+
* (which is supplied later via `personal_sign(userOpHash)`).
|
|
677
|
+
*
|
|
678
|
+
* Currently both Simple7702 and BatchExecutor use the same v0.7 ECDSA
|
|
679
|
+
* dummy. Kept impl-keyed so future impls (Safe, Kernel, Biconomy) can
|
|
680
|
+
* supply their own pattern (e.g. ERC-1271 stubs) without forcing a
|
|
681
|
+
* sponsor-relayer redeploy.
|
|
682
|
+
*/
|
|
683
|
+
declare function getDummySignatureFor7702(impl: DelegateImpl): Hex;
|
|
684
|
+
|
|
636
685
|
/**
|
|
637
686
|
* Module-level paymaster config shared by all batch builders and the
|
|
638
687
|
* `@pafi/issuer` RelayService. Holds the fee recipient address and the
|
|
@@ -1438,4 +1487,4 @@ declare class PafiSDK {
|
|
|
1438
1487
|
signLoginMessage(message: string): Promise<Hex>;
|
|
1439
1488
|
}
|
|
1440
1489
|
|
|
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 };
|
|
1490
|
+
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
|
@@ -24,8 +24,9 @@ import {
|
|
|
24
24
|
getTokenName,
|
|
25
25
|
isActiveIssuer,
|
|
26
26
|
isMinter,
|
|
27
|
+
issuerRegistryGetIssuerFlatAbi,
|
|
27
28
|
verifyMintCap
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YDLMVWDH.js";
|
|
29
30
|
import {
|
|
30
31
|
issuerRegistryAbi,
|
|
31
32
|
mintingOracleAbi,
|
|
@@ -439,6 +440,23 @@ function pack128(hi, lo) {
|
|
|
439
440
|
return `0x${(hi << 128n | lo).toString(16).padStart(64, "0")}`;
|
|
440
441
|
}
|
|
441
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
|
+
|
|
442
460
|
// src/paymaster/config.ts
|
|
443
461
|
var _config = null;
|
|
444
462
|
function setPaymasterConfig(config) {
|
|
@@ -1076,6 +1094,7 @@ var PafiSDK = class {
|
|
|
1076
1094
|
};
|
|
1077
1095
|
export {
|
|
1078
1096
|
ApiError,
|
|
1097
|
+
BATCH_EXECUTOR_7702_IMPL,
|
|
1079
1098
|
BATCH_EXECUTOR_ABI,
|
|
1080
1099
|
BATCH_EXECUTOR_ADDRESS_BASE_MAINNET,
|
|
1081
1100
|
BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA,
|
|
@@ -1084,6 +1103,7 @@ export {
|
|
|
1084
1103
|
COMMON_TOKENS,
|
|
1085
1104
|
CONTRACT_ADDRESSES,
|
|
1086
1105
|
ConfigurationError,
|
|
1106
|
+
DUMMY_SIGNATURE_V07,
|
|
1087
1107
|
ENTRY_POINT_V07,
|
|
1088
1108
|
ORDERLY_RELAY_ABI,
|
|
1089
1109
|
ORDERLY_VAULT_ABI,
|
|
@@ -1098,6 +1118,7 @@ export {
|
|
|
1098
1118
|
PafiSDK,
|
|
1099
1119
|
PafiSDKError,
|
|
1100
1120
|
SETTLE_ALL,
|
|
1121
|
+
SIMPLE_7702_IMPL_BASE_MAINNET,
|
|
1101
1122
|
SPONSOR_AUTH_DOMAIN_NAME,
|
|
1102
1123
|
SPONSOR_AUTH_TYPES,
|
|
1103
1124
|
SUPPORTED_CHAINS,
|
|
@@ -1141,6 +1162,7 @@ export {
|
|
|
1141
1162
|
createLoginMessage,
|
|
1142
1163
|
createPafiProxyTransport,
|
|
1143
1164
|
decodeBatchExecuteCalls,
|
|
1165
|
+
detectDelegateImpl,
|
|
1144
1166
|
encodeBatchExecute,
|
|
1145
1167
|
erc20Abi,
|
|
1146
1168
|
erc20ApproveOp,
|
|
@@ -1151,6 +1173,7 @@ export {
|
|
|
1151
1173
|
getAaNonce,
|
|
1152
1174
|
getBurnRequestNonce,
|
|
1153
1175
|
getContractAddresses,
|
|
1176
|
+
getDummySignatureFor7702,
|
|
1154
1177
|
getIssuer2 as getIssuer,
|
|
1155
1178
|
getMintRequestNonce,
|
|
1156
1179
|
getPafiWebModalAdapter,
|
|
@@ -1167,6 +1190,7 @@ export {
|
|
|
1167
1190
|
isPaymasterConfigured,
|
|
1168
1191
|
isPaymasterError,
|
|
1169
1192
|
issuerRegistryAbi,
|
|
1193
|
+
issuerRegistryGetIssuerFlatAbi,
|
|
1170
1194
|
mintRequestTypes,
|
|
1171
1195
|
mintingOracleAbi,
|
|
1172
1196
|
openPafiWebModal,
|