permissionless 0.0.36 → 0.1.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/CHANGELOG.md +8 -0
- package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +32 -15
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +38 -20
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js +40 -9
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js +104 -44
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/types.js.map +1 -1
- package/_cjs/actions/bundler/chainId.js.map +1 -1
- package/_cjs/actions/bundler/estimateUserOperationGas.js +20 -3
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationByHash.js +28 -11
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js +7 -7
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
- package/_cjs/actions/pimlico/sponsorUserOperation.js +19 -7
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_cjs/actions/public/getAccountNonce.js.map +1 -1
- package/_cjs/actions/public/getSenderAddress.js +5 -2
- package/_cjs/actions/public/getSenderAddress.js.map +1 -1
- package/_cjs/actions/smartAccount/deployContract.js +3 -4
- package/_cjs/actions/smartAccount/deployContract.js.map +1 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js +142 -19
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransaction.js +3 -4
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransactions.js +3 -4
- package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -1
- package/_cjs/actions/smartAccount/sendUserOperation.js +1 -1
- package/_cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/_cjs/actions/smartAccount/signMessage.js.map +1 -1
- package/_cjs/actions/smartAccount/signTypedData.js.map +1 -1
- package/_cjs/actions/smartAccount/writeContract.js.map +1 -1
- package/_cjs/actions/stackup/accounts.js +2 -2
- package/_cjs/actions/stackup/accounts.js.map +1 -1
- package/_cjs/actions/stackup/sponsorUserOperation.js +20 -12
- package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -1
- package/_cjs/clients/createBundlerClient.js +1 -1
- package/_cjs/clients/createBundlerClient.js.map +1 -1
- package/_cjs/clients/createSmartAccountClient.js +3 -3
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/bundler.js +6 -3
- package/_cjs/clients/decorators/bundler.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +6 -3
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/decorators/smartAccount.js +7 -7
- package/_cjs/clients/decorators/smartAccount.js.map +1 -1
- package/_cjs/clients/decorators/stackup.js.map +1 -1
- package/_cjs/clients/pimlico.js +4 -2
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/clients/stackup.js +3 -1
- package/_cjs/clients/stackup.js.map +1 -1
- package/_cjs/errors/estimateUserOperationGas.js.map +1 -1
- package/_cjs/errors/sendUserOperation.js.map +1 -1
- package/_cjs/types/entrypoint.js +3 -0
- package/_cjs/types/entrypoint.js.map +1 -0
- package/_cjs/utils/errors/getBundlerError.js.map +1 -1
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js.map +1 -1
- package/_cjs/utils/errors/getSendUserOperationError.js.map +1 -1
- package/_cjs/utils/getEntryPointVersion.js +8 -0
- package/_cjs/utils/getEntryPointVersion.js.map +1 -0
- package/_cjs/utils/getRequiredPrefund.js +19 -6
- package/_cjs/utils/getRequiredPrefund.js.map +1 -1
- package/_cjs/utils/getUserOperationHash.js +81 -17
- package/_cjs/utils/getUserOperationHash.js.map +1 -1
- package/_cjs/utils/index.js +5 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/providerToSmartAccountSigner.js +1 -1
- package/_cjs/utils/providerToSmartAccountSigner.js.map +1 -1
- package/_cjs/utils/signUserOperationHashWithECDSA.js +2 -2
- package/_cjs/utils/signUserOperationHashWithECDSA.js.map +1 -1
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +32 -15
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +38 -21
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/signerToSafeSmartAccount.js +40 -9
- package/_esm/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js +105 -44
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/types.js +0 -1
- package/_esm/accounts/types.js.map +1 -1
- package/_esm/actions/bundler/chainId.js.map +1 -1
- package/_esm/actions/bundler/estimateUserOperationGas.js +20 -3
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationByHash.js +28 -11
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
- package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +7 -7
- package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
- package/_esm/actions/pimlico/sponsorUserOperation.js +19 -7
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_esm/actions/public/getAccountNonce.js.map +1 -1
- package/_esm/actions/public/getSenderAddress.js +6 -3
- package/_esm/actions/public/getSenderAddress.js.map +1 -1
- package/_esm/actions/smartAccount/deployContract.js +3 -4
- package/_esm/actions/smartAccount/deployContract.js.map +1 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js +142 -19
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js +3 -4
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransactions.js +3 -4
- package/_esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/_esm/actions/smartAccount/sendUserOperation.js +1 -1
- package/_esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/_esm/actions/smartAccount/signMessage.js.map +1 -1
- package/_esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/_esm/actions/smartAccount/writeContract.js.map +1 -1
- package/_esm/actions/stackup/accounts.js +2 -2
- package/_esm/actions/stackup/accounts.js.map +1 -1
- package/_esm/actions/stackup/sponsorUserOperation.js +20 -12
- package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -1
- package/_esm/clients/createBundlerClient.js +1 -1
- package/_esm/clients/createBundlerClient.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js +22 -3
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/bundler.js +6 -3
- package/_esm/clients/decorators/bundler.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js +6 -3
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/decorators/smartAccount.js +7 -7
- package/_esm/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/clients/decorators/stackup.js.map +1 -1
- package/_esm/clients/pimlico.js +4 -2
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/clients/stackup.js +3 -1
- package/_esm/clients/stackup.js.map +1 -1
- package/_esm/errors/estimateUserOperationGas.js.map +1 -1
- package/_esm/errors/sendUserOperation.js.map +1 -1
- package/_esm/types/entrypoint.js +2 -0
- package/_esm/types/entrypoint.js.map +1 -0
- package/_esm/utils/errors/getBundlerError.js.map +1 -1
- package/_esm/utils/errors/getEstimateUserOperationGasError.js.map +1 -1
- package/_esm/utils/errors/getSendUserOperationError.js.map +1 -1
- package/_esm/utils/getEntryPointVersion.js +4 -0
- package/_esm/utils/getEntryPointVersion.js.map +1 -0
- package/_esm/utils/getRequiredPrefund.js +19 -6
- package/_esm/utils/getRequiredPrefund.js.map +1 -1
- package/_esm/utils/getUserOperationHash.js +82 -18
- package/_esm/utils/getUserOperationHash.js.map +1 -1
- package/_esm/utils/index.js +2 -1
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/providerToSmartAccountSigner.js +1 -1
- package/_esm/utils/providerToSmartAccountSigner.js.map +1 -1
- package/_esm/utils/signUserOperationHashWithECDSA.js +2 -3
- package/_esm/utils/signUserOperationHashWithECDSA.js.map +1 -1
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts +4 -4
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +5 -4
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +5 -4
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts +4 -4
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts +6 -5
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts +4 -4
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts +5 -4
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/types.d.ts +8 -5
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/bundler/chainId.d.ts +2 -1
- package/_types/actions/bundler/chainId.d.ts.map +1 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +14 -7
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationByHash.d.ts +10 -3
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +2 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/bundler/sendUserOperation.d.ts +6 -5
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/bundler/supportedEntryPoints.d.ts +3 -2
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +47 -6
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +10 -5
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -1
- package/_types/actions/public/getAccountNonce.d.ts +2 -1
- package/_types/actions/public/getAccountNonce.d.ts.map +1 -1
- package/_types/actions/public/getSenderAddress.d.ts +11 -3
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -1
- package/_types/actions/smartAccount/deployContract.d.ts +4 -3
- package/_types/actions/smartAccount/deployContract.d.ts.map +1 -1
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts +21 -11
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransaction.d.ts +4 -3
- package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransactions.d.ts +5 -4
- package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendUserOperation.d.ts +6 -5
- package/_types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/smartAccount/signMessage.d.ts +2 -1
- package/_types/actions/smartAccount/signMessage.d.ts.map +1 -1
- package/_types/actions/smartAccount/signTypedData.d.ts +3 -2
- package/_types/actions/smartAccount/signTypedData.d.ts.map +1 -1
- package/_types/actions/smartAccount/writeContract.d.ts +4 -3
- package/_types/actions/smartAccount/writeContract.d.ts.map +1 -1
- package/_types/actions/smartAccount.d.ts +2 -2
- package/_types/actions/smartAccount.d.ts.map +1 -1
- package/_types/actions/stackup/accounts.d.ts +4 -3
- package/_types/actions/stackup/accounts.d.ts.map +1 -1
- package/_types/actions/stackup/sponsorUserOperation.d.ts +6 -6
- package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -1
- package/_types/clients/createBundlerClient.d.ts +6 -3
- package/_types/clients/createBundlerClient.d.ts.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +9 -5
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +7 -7
- package/_types/clients/decorators/bundler.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +6 -5
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/decorators/smartAccount.d.ts +12 -12
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
- package/_types/clients/decorators/stackup.d.ts +5 -4
- package/_types/clients/decorators/stackup.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +11 -6
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/clients/stackup.d.ts +6 -3
- package/_types/clients/stackup.d.ts.map +1 -1
- package/_types/errors/estimateUserOperationGas.d.ts +4 -3
- package/_types/errors/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/errors/sendUserOperation.d.ts +4 -3
- package/_types/errors/sendUserOperation.d.ts.map +1 -1
- package/_types/types/bundler.d.ts +16 -21
- package/_types/types/bundler.d.ts.map +1 -1
- package/_types/types/entrypoint.d.ts +6 -0
- package/_types/types/entrypoint.d.ts.map +1 -0
- package/_types/types/index.d.ts +6 -4
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +20 -6
- package/_types/types/pimlico.d.ts.map +1 -1
- package/_types/types/stackup.d.ts +18 -4
- package/_types/types/stackup.d.ts.map +1 -1
- package/_types/types/userOperation.d.ts +51 -2
- package/_types/types/userOperation.d.ts.map +1 -1
- package/_types/utils/errors/getBundlerError.d.ts +4 -4
- package/_types/utils/errors/getBundlerError.d.ts.map +1 -1
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts +3 -2
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts.map +1 -1
- package/_types/utils/errors/getSendUserOperationError.d.ts +2 -1
- package/_types/utils/errors/getSendUserOperationError.d.ts.map +1 -1
- package/_types/utils/getEntryPointVersion.d.ts +6 -0
- package/_types/utils/getEntryPointVersion.d.ts.map +1 -0
- package/_types/utils/getRequiredPrefund.d.ts +5 -4
- package/_types/utils/getRequiredPrefund.d.ts.map +1 -1
- package/_types/utils/getUserOperationHash.d.ts +6 -5
- package/_types/utils/getUserOperationHash.d.ts.map +1 -1
- package/_types/utils/index.d.ts +2 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/providerToSmartAccountSigner.d.ts +4 -1
- package/_types/utils/providerToSmartAccountSigner.d.ts.map +1 -1
- package/_types/utils/signUserOperationHashWithECDSA.d.ts +6 -6
- package/_types/utils/signUserOperationHashWithECDSA.d.ts.map +1 -1
- package/accounts/biconomy/privateKeyToBiconomySmartAccount.ts +17 -6
- package/accounts/biconomy/signerToBiconomySmartAccount.ts +50 -21
- package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +64 -30
- package/accounts/safe/privateKeyToSafeSmartAccount.ts +8 -5
- package/accounts/safe/signerToSafeSmartAccount.ts +55 -15
- package/accounts/simple/privateKeyToSimpleSmartAccount.ts +25 -7
- package/accounts/simple/signerToSimpleSmartAccount.ts +127 -56
- package/accounts/types.ts +12 -4
- package/actions/bundler/chainId.ts +3 -1
- package/actions/bundler/estimateUserOperationGas.ts +77 -22
- package/actions/bundler/getUserOperationByHash.ts +44 -15
- package/actions/bundler/getUserOperationReceipt.ts +3 -1
- package/actions/bundler/sendUserOperation.ts +13 -17
- package/actions/bundler/supportedEntryPoints.ts +5 -3
- package/actions/pimlico/getUserOperationGasPrice.ts +7 -9
- package/actions/pimlico/sponsorUserOperation.ts +97 -23
- package/actions/pimlico/validateSponsorshipPolicies.ts +18 -7
- package/actions/public/getAccountNonce.ts +2 -1
- package/actions/public/getSenderAddress.ts +30 -5
- package/actions/smartAccount/deployContract.ts +14 -10
- package/actions/smartAccount/prepareUserOperationRequest.ts +339 -49
- package/actions/smartAccount/sendTransaction.ts +20 -11
- package/actions/smartAccount/sendTransactions.ts +17 -11
- package/actions/smartAccount/sendUserOperation.ts +56 -23
- package/actions/smartAccount/signMessage.ts +3 -1
- package/actions/smartAccount/signTypedData.ts +3 -1
- package/actions/smartAccount/writeContract.ts +12 -5
- package/actions/smartAccount.ts +2 -2
- package/actions/stackup/accounts.ts +7 -6
- package/actions/stackup/sponsorUserOperation.ts +85 -31
- package/clients/createBundlerClient.ts +11 -6
- package/clients/createSmartAccountClient.ts +34 -20
- package/clients/decorators/bundler.ts +51 -27
- package/clients/decorators/pimlico.ts +43 -17
- package/clients/decorators/smartAccount.ts +115 -37
- package/clients/decorators/stackup.ts +14 -10
- package/clients/pimlico.ts +22 -13
- package/clients/stackup.ts +13 -7
- package/errors/estimateUserOperationGas.ts +7 -4
- package/errors/sendUserOperation.ts +9 -5
- package/package.json +1 -1
- package/types/bundler.ts +40 -28
- package/types/entrypoint.ts +13 -0
- package/types/index.ts +15 -5
- package/types/pimlico.ts +43 -17
- package/types/stackup.ts +39 -15
- package/types/userOperation.ts +82 -26
- package/utils/errors/getBundlerError.ts +10 -6
- package/utils/errors/getEstimateUserOperationGasError.ts +13 -10
- package/utils/errors/getSendUserOperationError.ts +4 -3
- package/utils/getEntryPointVersion.ts +15 -0
- package/utils/getRequiredPrefund.ts +35 -11
- package/utils/getUserOperationHash.ts +113 -23
- package/utils/index.ts +9 -1
- package/utils/providerToSmartAccountSigner.ts +6 -3
- package/utils/signUserOperationHashWithECDSA.ts +13 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseError } from "viem";
|
|
2
|
+
import { getEntryPointVersion } from "../../utils/index.js";
|
|
2
3
|
import { deepHexlify } from "../../utils/deepHexlify.js";
|
|
3
4
|
import { getEstimateUserOperationGasError } from "../../utils/errors/getEstimateUserOperationGasError.js";
|
|
4
5
|
/**
|
|
@@ -43,10 +44,26 @@ export const estimateUserOperationGas = async (client, args, stateOverrides) =>
|
|
|
43
44
|
]
|
|
44
45
|
: [userOperationWithBigIntAsHex, entryPoint]
|
|
45
46
|
});
|
|
47
|
+
const entryPointVersion = getEntryPointVersion(entryPoint);
|
|
48
|
+
if (entryPointVersion === "v0.6") {
|
|
49
|
+
const responseV06 = response;
|
|
50
|
+
return {
|
|
51
|
+
preVerificationGas: BigInt(responseV06.preVerificationGas || 0),
|
|
52
|
+
verificationGasLimit: BigInt(responseV06.verificationGasLimit || 0),
|
|
53
|
+
callGasLimit: BigInt(responseV06.callGasLimit || 0)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const responseV07 = response;
|
|
46
57
|
return {
|
|
47
|
-
preVerificationGas: BigInt(
|
|
48
|
-
verificationGasLimit: BigInt(
|
|
49
|
-
callGasLimit: BigInt(
|
|
58
|
+
preVerificationGas: BigInt(responseV07.preVerificationGas || 0),
|
|
59
|
+
verificationGasLimit: BigInt(responseV07.verificationGasLimit || 0),
|
|
60
|
+
callGasLimit: BigInt(responseV07.callGasLimit || 0),
|
|
61
|
+
paymasterVerificationGasLimit: responseV07.paymasterVerificationGasLimit
|
|
62
|
+
? BigInt(responseV07.paymasterVerificationGasLimit)
|
|
63
|
+
: undefined,
|
|
64
|
+
paymasterPostOpGasLimit: responseV07.paymasterPostOpGasLimit
|
|
65
|
+
? BigInt(responseV07.paymasterPostOpGasLimit)
|
|
66
|
+
: undefined
|
|
50
67
|
};
|
|
51
68
|
}
|
|
52
69
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,SAAS,EAKZ,MAAM,MAAM,CAAA;AAOb,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAEH,gCAAgC,EACnC,MAAM,qDAAqD,CAAA;AAsC5D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAMzC,MAA0E,EAC1E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,SAAS;YACnB,uBAAuB,EAAE,WAAW,CAAC,uBAAuB;gBACxD,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;gBAC7C,CAAC,CAAC,SAAS;SACgC,CAAA;IACvD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,gCAAgC,CAAC,GAAgB,EAAE,IAAI,CAAC,CAAA;IAClE,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ENTRYPOINT_ADDRESS_V06 } from "../../utils/getEntryPointVersion.js";
|
|
1
2
|
/**
|
|
2
3
|
* Returns the user operation from userOpHash
|
|
3
4
|
*
|
|
@@ -28,18 +29,34 @@ export const getUserOperationByHash = async (client, { hash }) => {
|
|
|
28
29
|
});
|
|
29
30
|
if (!response)
|
|
30
31
|
return null;
|
|
31
|
-
const { userOperation, entryPoint, transactionHash, blockHash, blockNumber } = response;
|
|
32
|
+
const { userOperation, entryPoint: entryPointAddress, transactionHash, blockHash, blockNumber } = response;
|
|
32
33
|
return {
|
|
33
|
-
userOperation:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
userOperation: (entryPointAddress === ENTRYPOINT_ADDRESS_V06
|
|
35
|
+
? {
|
|
36
|
+
...userOperation,
|
|
37
|
+
nonce: BigInt(userOperation.nonce),
|
|
38
|
+
callGasLimit: BigInt(userOperation.callGasLimit),
|
|
39
|
+
verificationGasLimit: BigInt(userOperation.verificationGasLimit),
|
|
40
|
+
preVerificationGas: BigInt(userOperation.preVerificationGas),
|
|
41
|
+
maxFeePerGas: BigInt(userOperation.maxFeePerGas),
|
|
42
|
+
maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
...userOperation,
|
|
46
|
+
nonce: BigInt(userOperation.nonce),
|
|
47
|
+
callGasLimit: BigInt(userOperation.callGasLimit),
|
|
48
|
+
verificationGasLimit: BigInt(userOperation.verificationGasLimit),
|
|
49
|
+
preVerificationGas: BigInt(userOperation.preVerificationGas),
|
|
50
|
+
maxFeePerGas: BigInt(userOperation.maxFeePerGas),
|
|
51
|
+
maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas),
|
|
52
|
+
paymasterVerificationGasLimit: userOperation.paymasterVerificationGasLimit
|
|
53
|
+
? BigInt(userOperation.paymasterVerificationGasLimit)
|
|
54
|
+
: undefined,
|
|
55
|
+
paymasterPostOpGasLimit: userOperation.paymasterVerificationGasLimit
|
|
56
|
+
? BigInt(userOperation.paymasterPostOpGasLimit)
|
|
57
|
+
: undefined
|
|
58
|
+
}),
|
|
59
|
+
entryPoint: entryPointAddress,
|
|
43
60
|
transactionHash: transactionHash,
|
|
44
61
|
blockHash: blockHash,
|
|
45
62
|
blockNumber: BigInt(blockNumber)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationByHash.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getUserOperationByHash.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAczE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAMvC,MAA0E,EAC1E,EAAE,IAAI,EAA8C,EACkB,EAAE;IACxE,MAAM,MAAM,GAAW,CAAC,IAAI,CAAC,CAAA;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,4BAA4B;QACpC,MAAM;KACT,CAAC,CAAA;IAEF,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE1B,MAAM,EACF,aA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;QAChC,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC;KACnC,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationReceipt.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getUserOperationReceipt.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAuClE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAMxC,MAA0E,EAC1E,EAAE,IAAI,EAA+C,EACM,EAAE;IAC7D,MAAM,MAAM,GAAW,CAAC,IAAI,CAAC,CAAA;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM;KACT,CAAC,CAAA;IAEF,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE1B,MAAM,oBAAoB,GAAsC;QAC5D,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC7B,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC7C,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC7C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,OAAO,EAAE;YACL,eAAe,EAAE,QAAQ,CAAC,OAAO,CAAC,eAAe;YACjD,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC;YAC3D,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS;YACrC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;YACjD,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;YAC3B,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE;YACvB,iBAAiB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC;YAC7D,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;YACzD,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;YACzC,eAAe,EAAE,QAAQ,CAAC,OAAO,CAAC,eAAe;YACjD,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS;YACrC,iBAAiB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC;SAChE;QACD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC9B,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;YACpC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC9B,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC9C,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,MAAM,EAAE,GAAG,CAAC,MAAM;SACrB,CAAC,CAAC;KACN,CAAA;IAED,OAAO,oBAAoB,CAAA;AAC/B,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAA;AAOxF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAMlC,MAA0E,EAC1E,IAAuD,EAC1C,EAAE;IACf,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE1C,IAAI,CAAC;QACD,MAAM,iBAAiB,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YAC3C,MAAM,EAAE,uBAAuB;YAC/B,MAAM,EAAE;gBACJ,WAAW,CAAC,aAAa,CAExB;gBACD,UAAU;aACb;SACJ,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAA;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,yBAAyB,CAC3B,GAAgB,EAChB,IAA+C,CAClD,CAAA;IACL,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportedEntryPoints.js","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"supportedEntryPoints.js","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAMrC,MAA0E,EACrD,EAAE;IACvB,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -20,22 +20,22 @@
|
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
22
|
export const getUserOperationGasPrice = async (client) => {
|
|
23
|
-
const
|
|
23
|
+
const gasPrice = await client.request({
|
|
24
24
|
method: "pimlico_getUserOperationGasPrice",
|
|
25
25
|
params: []
|
|
26
26
|
});
|
|
27
27
|
return {
|
|
28
28
|
slow: {
|
|
29
|
-
maxFeePerGas: BigInt(
|
|
30
|
-
maxPriorityFeePerGas: BigInt(
|
|
29
|
+
maxFeePerGas: BigInt(gasPrice.slow.maxFeePerGas),
|
|
30
|
+
maxPriorityFeePerGas: BigInt(gasPrice.slow.maxPriorityFeePerGas)
|
|
31
31
|
},
|
|
32
32
|
standard: {
|
|
33
|
-
maxFeePerGas: BigInt(
|
|
34
|
-
maxPriorityFeePerGas: BigInt(
|
|
33
|
+
maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
|
|
34
|
+
maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
|
|
35
35
|
},
|
|
36
36
|
fast: {
|
|
37
|
-
maxFeePerGas: BigInt(
|
|
38
|
-
maxPriorityFeePerGas: BigInt(
|
|
37
|
+
maxFeePerGas: BigInt(gasPrice.fast.maxFeePerGas),
|
|
38
|
+
maxPriorityFeePerGas: BigInt(gasPrice.fast.maxPriorityFeePerGas)
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationGasPrice.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAAqE,EAChB,EAAE;IACvD,MAAM,
|
|
1
|
+
{"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationGasPrice.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAAqE,EAChB,EAAE;IACvD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,kCAAkC;QAC1C,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;IAEF,OAAO;QACH,IAAI,EAAE;YACF,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;YAChD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACnE;QACD,QAAQ,EAAE;YACN,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;YACpD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC;SACvE;QACD,IAAI,EAAE;YACF,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;YAChD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACnE;KACJ,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { deepHexlify } from "../../utils/deepHexlify.js";
|
|
2
|
+
import { ENTRYPOINT_ADDRESS_V06 } from "../../utils/getEntryPointVersion.js";
|
|
2
3
|
/**
|
|
3
4
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
4
5
|
*
|
|
@@ -40,13 +41,24 @@ export const sponsorUserOperation = async (client, args) => {
|
|
|
40
41
|
args.entryPoint
|
|
41
42
|
]
|
|
42
43
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
if (args.entryPoint === ENTRYPOINT_ADDRESS_V06) {
|
|
45
|
+
const responseV06 = response;
|
|
46
|
+
return {
|
|
47
|
+
paymasterAndData: responseV06.paymasterAndData,
|
|
48
|
+
preVerificationGas: BigInt(responseV06.preVerificationGas),
|
|
49
|
+
verificationGasLimit: BigInt(responseV06.verificationGasLimit),
|
|
50
|
+
callGasLimit: BigInt(responseV06.callGasLimit)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const responseV07 = response;
|
|
54
|
+
return {
|
|
55
|
+
callGasLimit: BigInt(responseV07.callGasLimit),
|
|
56
|
+
verificationGasLimit: BigInt(responseV07.verificationGasLimit),
|
|
57
|
+
preVerificationGas: BigInt(responseV07.preVerificationGas),
|
|
58
|
+
paymaster: responseV07.paymaster,
|
|
59
|
+
paymasterVerificationGasLimit: BigInt(responseV07.paymasterVerificationGasLimit),
|
|
60
|
+
paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit),
|
|
61
|
+
paymasterData: responseV07.paymasterData
|
|
49
62
|
};
|
|
50
|
-
return userOperation;
|
|
51
63
|
};
|
|
52
64
|
//# sourceMappingURL=sponsorUserOperation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AA0CzE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAMrC,MAKC,EACD,IAAiE,EACJ,EAAE;IAC/D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB;YAC5B,CAAC,CAAC;gBACI,WAAW,CACP,IAAI,CAAC,aAAa,CAGrB;gBACD,IAAI,CAAC,UAAU;gBACf;oBACI,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;iBAChD;aACJ;YACH,CAAC,CAAC;gBACI,WAAW,CACP,IAAI,CAAC,aAAa,CAGrB;gBACD,IAAI,CAAC,UAAU;aAClB;KACV,CAAC,CAAA;IAEF,IAAI,IAAI,CAAC,UAAU,KAAK,sBAAsB,EAAE,CAAC;QAC7C,MAAM,WAAW,GAAG,QASnB,CAAA;QACD,OAAO;YACH,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;YAC9C,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAC1D,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;YAC9D,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;SACH,CAAA;IACnD,CAAC;IAED,MAAM,WAAW,GAAG,QASnB,CAAA;IAED,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;QAC9D,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;QAC1D,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,6BAA6B,EAAE,MAAM,CACjC,WAAW,CAAC,6BAA6B,CAC5C;QACD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QACpE,aAAa,EAAE,WAAW,CAAC,aAAa;KACG,CAAA;AACnD,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAoBrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAM5C,MAKC,EACD,IAAiE,EACjB,EAAE;IAClD,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QACxB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE;YACJ,WAAW,CAAC,IAAI,CAAC,aAAa,CAE7B;YACD,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,oBAAoB;SAC5B;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccountNonce.js","sourceRoot":"","sources":["../../../actions/public/getAccountNonce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"getAccountNonce.js","sourceRoot":"","sources":["../../../actions/public/getAccountNonce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAQjD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAIhC,MAAkC,EAClC,IAAqC,EACtB,EAAE;IACjB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAA;IAEpD,OAAO,MAAM,SAAS,CAClB,MAAM,EACN,YAAY,CACf,CAAC;QACE,OAAO,EAAE,UAAU;QACnB,GAAG,EAAE;YACD;gBACI,MAAM,EAAE;oBACJ;wBACI,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,eAAe,EAAE,MAAM;gBACvB,IAAI,EAAE,UAAU;aACnB;SACJ;QACD,YAAY,EAAE,UAAU;QACxB,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC;KACtB,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "viem";
|
|
1
|
+
import { BaseError, concat } from "viem";
|
|
2
2
|
import { simulateContract } from "viem/actions";
|
|
3
3
|
import { getAction } from "../../utils/getAction.js";
|
|
4
4
|
export class InvalidEntryPointError extends BaseError {
|
|
@@ -40,7 +40,10 @@ export class InvalidEntryPointError extends BaseError {
|
|
|
40
40
|
* // Return '0x7a88a206ba40b37a8c07a2b5688cf8b287318b63'
|
|
41
41
|
*/
|
|
42
42
|
export const getSenderAddress = async (client, args) => {
|
|
43
|
-
const { initCode, entryPoint } = args;
|
|
43
|
+
const { initCode, entryPoint, factory, factoryData } = args;
|
|
44
|
+
if (!initCode && !factory && !factoryData) {
|
|
45
|
+
throw new Error("Either `initCode` or `factory` and `factoryData` must be provided");
|
|
46
|
+
}
|
|
44
47
|
try {
|
|
45
48
|
await getAction(client, simulateContract)({
|
|
46
49
|
address: entryPoint,
|
|
@@ -71,7 +74,7 @@ export const getSenderAddress = async (client, args) => {
|
|
|
71
74
|
}
|
|
72
75
|
],
|
|
73
76
|
functionName: "getSenderAddress",
|
|
74
|
-
args: [initCode]
|
|
77
|
+
args: [initCode || concat([factory, factoryData])]
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSenderAddress.js","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,SAAS,
|
|
1
|
+
{"version":3,"file":"getSenderAddress.js","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,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,EAAE,YAAY;oBAC7B,IAAI,EAAE,UAAU;iBACnB;aACJ;YACD,YAAY,EAAE,kBAAkB;YAChC,IAAI,EAAE,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,OAAc,EAAE,WAAkB,CAAC,CAAC,CAAC;SACnE,CAAC,CAAA;IACN,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,GAAG,GAAG,CAAuC,CAAA;QAEnD,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,+BAA+B,EAAE,CAAC;YACrD,MAAM,WAAW,GAAG,GAAG,CAAC,KAA0C,CAAA;YAClE,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAA;YACnD,IACI,SAAS,KAAK,qBAAqB;gBACnC,WAAW,CAAC,IAAI,EAAE,IAAI;gBACtB,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAC3B,CAAC;gBACC,OAAO,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAY,CAAA;YAC/C,CAAC;QACL,CAAC;QAED,MAAM,CAAC,CAAA;IACX,CAAC;IAED,MAAM,IAAI,sBAAsB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;AACpD,CAAC,CAAA"}
|
|
@@ -33,7 +33,7 @@ import { sendUserOperation } from "./sendUserOperation.js";
|
|
|
33
33
|
* })
|
|
34
34
|
*/
|
|
35
35
|
export async function deployContract(client, args) {
|
|
36
|
-
const { abi, args: constructorArgs, bytecode,
|
|
36
|
+
const { abi, args: constructorArgs, bytecode, middleware, ...request } = args;
|
|
37
37
|
const { account: account_ = client.account } = request;
|
|
38
38
|
if (!account_) {
|
|
39
39
|
throw new AccountOrClientNotFoundError({
|
|
@@ -41,10 +41,9 @@ export async function deployContract(client, args) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
const account = parseAccount(account_);
|
|
44
|
-
const userOpHash = await getAction(client, sendUserOperation)({
|
|
44
|
+
const userOpHash = await getAction(client, (sendUserOperation))({
|
|
45
45
|
userOperation: {
|
|
46
46
|
sender: account.address,
|
|
47
|
-
paymasterAndData: "0x",
|
|
48
47
|
maxFeePerGas: request.maxFeePerGas || 0n,
|
|
49
48
|
maxPriorityFeePerGas: request.maxPriorityFeePerGas || 0n,
|
|
50
49
|
callData: await account.encodeDeployCallData({
|
|
@@ -54,7 +53,7 @@ export async function deployContract(client, args) {
|
|
|
54
53
|
})
|
|
55
54
|
},
|
|
56
55
|
account: account,
|
|
57
|
-
|
|
56
|
+
middleware
|
|
58
57
|
});
|
|
59
58
|
const userOperationReceipt = await getAction(client, waitForUserOperationReceipt)({
|
|
60
59
|
hash: userOpHash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployContract.js","sourceRoot":"","sources":["../../../actions/smartAccount/deployContract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deployContract.js","sourceRoot":"","sources":["../../../actions/smartAccount/deployContract.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAA;AACpF,OAAO,EAAmB,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAavD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAKhC,MAA2C,EAC3C,IAAiE;IAEjE,MAAM,EACF,GAAG,EACH,IAAI,EAAE,eAAe,EACrB,QAAQ,EACR,UAAU,EACV,GAAG,OAAO,EACb,GAAG,IAAI,CAAA;IAER,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,OAAO,CAAA;IAEtD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,4BAA4B,CAAC;YACnC,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAA6B,CAAA;IAElE,MAAM,UAAU,GAAG,MAAM,SAAS,CAC9B,MAAM,EACN,CAAA,iBAA6B,CAAA,CAChC,CAAC;QACE,aAAa,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;YACxC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,EAAE;YACxD,QAAQ,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC;gBACzC,GAAG;gBACH,QAAQ;gBACR,IAAI,EAAE,eAAe;aACM,CAAC;SACnC;QACD,OAAO,EAAE,OAAO;QAChB,UAAU;KACb,CAAC,CAAA;IAEF,MAAM,oBAAoB,GAAG,MAAM,SAAS,CACxC,MAAM,EACN,2BAA2B,CAC9B,CAAC;QACE,IAAI,EAAE,UAAU;KACnB,CAAC,CAAA;IAEF,OAAO,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAA;AACxD,CAAC"}
|
|
@@ -1,59 +1,171 @@
|
|
|
1
1
|
import { estimateFeesPerGas } from "viem/actions";
|
|
2
2
|
import { AccountOrClientNotFoundError, parseAccount } from "../../utils/index.js";
|
|
3
3
|
import { getAction } from "../../utils/getAction.js";
|
|
4
|
+
import { getEntryPointVersion } from "../../utils/getEntryPointVersion.js";
|
|
4
5
|
import { estimateUserOperationGas } from "../bundler/estimateUserOperationGas.js";
|
|
5
|
-
|
|
6
|
-
const { account: account_ = client.account, userOperation: partialUserOperation,
|
|
6
|
+
async function prepareUserOperationRequestForEntryPointV06(client, args, stateOverrides) {
|
|
7
|
+
const { account: account_ = client.account, userOperation: partialUserOperation, middleware } = args;
|
|
7
8
|
if (!account_)
|
|
8
9
|
throw new AccountOrClientNotFoundError();
|
|
9
10
|
const account = parseAccount(account_);
|
|
10
|
-
const [sender, nonce, initCode, callData
|
|
11
|
+
const [sender, nonce, initCode, callData] = await Promise.all([
|
|
11
12
|
partialUserOperation.sender || account.address,
|
|
12
13
|
partialUserOperation.nonce || account.getNonce(),
|
|
13
14
|
partialUserOperation.initCode || account.getInitCode(),
|
|
15
|
+
partialUserOperation.callData
|
|
16
|
+
]);
|
|
17
|
+
const userOperation = {
|
|
18
|
+
sender,
|
|
19
|
+
nonce,
|
|
20
|
+
initCode,
|
|
21
|
+
callData,
|
|
22
|
+
paymasterAndData: "0x",
|
|
23
|
+
signature: partialUserOperation.signature || "0x",
|
|
24
|
+
maxFeePerGas: partialUserOperation.maxFeePerGas || 0n,
|
|
25
|
+
maxPriorityFeePerGas: partialUserOperation.maxPriorityFeePerGas || 0n,
|
|
26
|
+
callGasLimit: partialUserOperation.callGasLimit || 0n,
|
|
27
|
+
verificationGasLimit: partialUserOperation.verificationGasLimit || 0n,
|
|
28
|
+
preVerificationGas: partialUserOperation.preVerificationGas || 0n
|
|
29
|
+
};
|
|
30
|
+
if (userOperation.signature === "0x") {
|
|
31
|
+
userOperation.signature = await account.getDummySignature(userOperation);
|
|
32
|
+
}
|
|
33
|
+
if (typeof middleware === "function") {
|
|
34
|
+
return (await middleware({
|
|
35
|
+
userOperation,
|
|
36
|
+
entryPoint: account.entryPoint
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
if (middleware && typeof middleware !== "function" && middleware.gasPrice) {
|
|
40
|
+
const gasPrice = await middleware.gasPrice();
|
|
41
|
+
userOperation.maxFeePerGas = gasPrice.maxFeePerGas;
|
|
42
|
+
userOperation.maxPriorityFeePerGas = gasPrice.maxPriorityFeePerGas;
|
|
43
|
+
}
|
|
44
|
+
if (!userOperation.maxFeePerGas || !userOperation.maxPriorityFeePerGas) {
|
|
45
|
+
const estimateGas = await estimateFeesPerGas(account.client);
|
|
46
|
+
userOperation.maxFeePerGas =
|
|
47
|
+
userOperation.maxFeePerGas || estimateGas.maxFeePerGas;
|
|
48
|
+
userOperation.maxPriorityFeePerGas =
|
|
49
|
+
userOperation.maxPriorityFeePerGas ||
|
|
50
|
+
estimateGas.maxPriorityFeePerGas;
|
|
51
|
+
}
|
|
52
|
+
if (middleware &&
|
|
53
|
+
typeof middleware !== "function" &&
|
|
54
|
+
middleware.sponsorUserOperation) {
|
|
55
|
+
const sponsorUserOperationData = (await middleware.sponsorUserOperation({
|
|
56
|
+
userOperation,
|
|
57
|
+
entryPoint: account.entryPoint
|
|
58
|
+
}));
|
|
59
|
+
userOperation.callGasLimit = sponsorUserOperationData.callGasLimit;
|
|
60
|
+
userOperation.verificationGasLimit =
|
|
61
|
+
sponsorUserOperationData.verificationGasLimit;
|
|
62
|
+
userOperation.preVerificationGas =
|
|
63
|
+
sponsorUserOperationData.preVerificationGas;
|
|
64
|
+
userOperation.paymasterAndData =
|
|
65
|
+
sponsorUserOperationData.paymasterAndData;
|
|
66
|
+
}
|
|
67
|
+
if (!userOperation.callGasLimit ||
|
|
68
|
+
!userOperation.verificationGasLimit ||
|
|
69
|
+
!userOperation.preVerificationGas) {
|
|
70
|
+
const gasParameters = await getAction(client, estimateUserOperationGas)({
|
|
71
|
+
userOperation,
|
|
72
|
+
entryPoint: account.entryPoint
|
|
73
|
+
}, stateOverrides);
|
|
74
|
+
userOperation.callGasLimit |= gasParameters.callGasLimit;
|
|
75
|
+
userOperation.verificationGasLimit =
|
|
76
|
+
userOperation.verificationGasLimit ||
|
|
77
|
+
gasParameters.verificationGasLimit;
|
|
78
|
+
userOperation.preVerificationGas =
|
|
79
|
+
userOperation.preVerificationGas || gasParameters.preVerificationGas;
|
|
80
|
+
}
|
|
81
|
+
return userOperation;
|
|
82
|
+
}
|
|
83
|
+
async function prepareUserOperationRequestEntryPointV07(client, args, stateOverrides) {
|
|
84
|
+
const { account: account_ = client.account, userOperation: partialUserOperation, middleware } = args;
|
|
85
|
+
if (!account_)
|
|
86
|
+
throw new AccountOrClientNotFoundError();
|
|
87
|
+
const account = parseAccount(account_);
|
|
88
|
+
const [sender, nonce, factory, factoryData, callData, gasEstimation] = await Promise.all([
|
|
89
|
+
partialUserOperation.sender || account.address,
|
|
90
|
+
partialUserOperation.nonce || account.getNonce(),
|
|
91
|
+
partialUserOperation.factory || account.getFactory(),
|
|
92
|
+
partialUserOperation.factoryData || account.getFactoryData(),
|
|
14
93
|
partialUserOperation.callData,
|
|
15
94
|
!partialUserOperation.maxFeePerGas ||
|
|
16
95
|
!partialUserOperation.maxPriorityFeePerGas
|
|
17
96
|
? estimateFeesPerGas(account.client)
|
|
18
97
|
: undefined
|
|
19
98
|
]);
|
|
20
|
-
|
|
99
|
+
const userOperation = {
|
|
21
100
|
sender,
|
|
22
101
|
nonce,
|
|
23
|
-
|
|
102
|
+
factory: factory || undefined,
|
|
103
|
+
factoryData: factoryData || undefined,
|
|
24
104
|
callData,
|
|
25
|
-
|
|
26
|
-
|
|
105
|
+
callGasLimit: partialUserOperation.callGasLimit || 0n,
|
|
106
|
+
verificationGasLimit: partialUserOperation.verificationGasLimit || 0n,
|
|
107
|
+
preVerificationGas: partialUserOperation.preVerificationGas || 0n,
|
|
27
108
|
maxFeePerGas: partialUserOperation.maxFeePerGas ||
|
|
28
109
|
gasEstimation?.maxFeePerGas ||
|
|
29
110
|
0n,
|
|
30
111
|
maxPriorityFeePerGas: partialUserOperation.maxPriorityFeePerGas ||
|
|
31
112
|
gasEstimation?.maxPriorityFeePerGas ||
|
|
32
113
|
0n,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
114
|
+
paymaster: undefined,
|
|
115
|
+
paymasterVerificationGasLimit: undefined,
|
|
116
|
+
paymasterPostOpGasLimit: undefined,
|
|
117
|
+
paymasterData: undefined,
|
|
118
|
+
signature: partialUserOperation.signature || "0x"
|
|
36
119
|
};
|
|
37
120
|
if (userOperation.signature === "0x") {
|
|
38
121
|
userOperation.signature = await account.getDummySignature(userOperation);
|
|
39
122
|
}
|
|
40
|
-
if (
|
|
41
|
-
|
|
123
|
+
if (typeof middleware === "function") {
|
|
124
|
+
return (await middleware({
|
|
125
|
+
userOperation,
|
|
126
|
+
entryPoint: account.entryPoint
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
if (middleware &&
|
|
130
|
+
typeof middleware !== "function" &&
|
|
131
|
+
middleware.sponsorUserOperation) {
|
|
132
|
+
const sponsorUserOperationData = (await middleware.sponsorUserOperation({
|
|
42
133
|
userOperation,
|
|
43
134
|
entryPoint: account.entryPoint
|
|
44
|
-
});
|
|
135
|
+
}));
|
|
136
|
+
userOperation.callGasLimit = sponsorUserOperationData.callGasLimit;
|
|
137
|
+
userOperation.verificationGasLimit =
|
|
138
|
+
sponsorUserOperationData.verificationGasLimit;
|
|
139
|
+
userOperation.preVerificationGas =
|
|
140
|
+
sponsorUserOperationData.preVerificationGas;
|
|
141
|
+
userOperation.paymaster = sponsorUserOperationData.paymaster;
|
|
142
|
+
userOperation.paymasterVerificationGasLimit =
|
|
143
|
+
sponsorUserOperationData.paymasterVerificationGasLimit;
|
|
144
|
+
userOperation.paymasterPostOpGasLimit =
|
|
145
|
+
sponsorUserOperationData.paymasterPostOpGasLimit;
|
|
146
|
+
userOperation.paymasterData = sponsorUserOperationData.paymasterData;
|
|
147
|
+
}
|
|
148
|
+
if (middleware && typeof middleware !== "function" && middleware.gasPrice) {
|
|
149
|
+
const gasPrice = await middleware.gasPrice();
|
|
150
|
+
userOperation.maxFeePerGas = gasPrice.maxFeePerGas;
|
|
151
|
+
userOperation.maxPriorityFeePerGas = gasPrice.maxPriorityFeePerGas;
|
|
45
152
|
}
|
|
46
|
-
|
|
153
|
+
if (!userOperation.maxFeePerGas || !userOperation.maxPriorityFeePerGas) {
|
|
154
|
+
const estimateGas = await estimateFeesPerGas(account.client);
|
|
155
|
+
userOperation.maxFeePerGas =
|
|
156
|
+
userOperation.maxFeePerGas || estimateGas.maxFeePerGas;
|
|
157
|
+
userOperation.maxPriorityFeePerGas =
|
|
158
|
+
userOperation.maxPriorityFeePerGas ||
|
|
159
|
+
estimateGas.maxPriorityFeePerGas;
|
|
160
|
+
}
|
|
161
|
+
if (!userOperation.callGasLimit ||
|
|
47
162
|
!userOperation.verificationGasLimit ||
|
|
48
163
|
!userOperation.preVerificationGas) {
|
|
49
164
|
const gasParameters = await getAction(client, estimateUserOperationGas)({
|
|
50
|
-
userOperation
|
|
51
|
-
...userOperation
|
|
52
|
-
},
|
|
165
|
+
userOperation,
|
|
53
166
|
entryPoint: account.entryPoint
|
|
54
167
|
}, stateOverrides);
|
|
55
|
-
userOperation.callGasLimit
|
|
56
|
-
userOperation.callGasLimit || gasParameters.callGasLimit;
|
|
168
|
+
userOperation.callGasLimit |= gasParameters.callGasLimit;
|
|
57
169
|
userOperation.verificationGasLimit =
|
|
58
170
|
userOperation.verificationGasLimit ||
|
|
59
171
|
gasParameters.verificationGasLimit;
|
|
@@ -62,4 +174,15 @@ export async function prepareUserOperationRequest(client, args, stateOverrides)
|
|
|
62
174
|
}
|
|
63
175
|
return userOperation;
|
|
64
176
|
}
|
|
177
|
+
export async function prepareUserOperationRequest(client, args, stateOverrides) {
|
|
178
|
+
const { account: account_ = client.account } = args;
|
|
179
|
+
if (!account_)
|
|
180
|
+
throw new AccountOrClientNotFoundError();
|
|
181
|
+
const account = parseAccount(account_);
|
|
182
|
+
const entryPointVersion = getEntryPointVersion(account.entryPoint);
|
|
183
|
+
if (entryPointVersion === "v0.6") {
|
|
184
|
+
return prepareUserOperationRequestForEntryPointV06(client, args, stateOverrides);
|
|
185
|
+
}
|
|
186
|
+
return prepareUserOperationRequestEntryPointV07(client, args, stateOverrides);
|
|
187
|
+
}
|
|
65
188
|
//# sourceMappingURL=prepareUserOperationRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareUserOperationRequest.js","sourceRoot":"","sources":["../../../actions/smartAccount/prepareUserOperationRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"prepareUserOperationRequest.js","sourceRoot":"","sources":["../../../actions/smartAccount/prepareUserOperationRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAejD,OAAO,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAmF9E,KAAK,UAAU,2CAA2C,CAQtD,MAA4C,EAC5C,IAA2E,EAC3E,cAA+B;IAE/B,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,aAAa,EAAE,oBAAoB,EACnC,UAAU,EACb,GAAG,IAAI,CAAA;IACR,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,4BAA4B,EAAE,CAAA;IAEvD,MAAM,OAAO,GAAG,YAAY,CACxB,QAAQ,CACkC,CAAA;IAE9C,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1D,oBAAoB,CAAC,MAAM,IAAI,OAAO,CAAC,OAAO;QAC9C,oBAAoB,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,EAAE;QAChD,oBAAoB,CAAC,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE;QACtD,oBAAoB,CAAC,QAAQ;KAChC,CAAC,CAAA;IAEF,MAAM,aAAa,GAA0B;QACzC,MAAM;QACN,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,oBAAoB,CAAC,SAAS,IAAI,IAAI;QACjD,YAAY,EAAE,oBAAoB,CAAC,YAAY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E,CAAC;QAC/B,OAAO,2CAA2C,CAC9C,MAAM,EACN,IAAI,EACJ,cAAc,CAC6C,CAAA;IACnE,CAAC;IAED,OAAO,wCAAwC,CAC3C,MAAM,EACN,IAAI,EACJ,cAAc,CAC6C,CAAA;AACnE,CAAC"}
|
|
@@ -51,7 +51,7 @@ import { sendUserOperation } from "./sendUserOperation.js";
|
|
|
51
51
|
* })
|
|
52
52
|
*/
|
|
53
53
|
export async function sendTransaction(client, args) {
|
|
54
|
-
const { account: account_ = client.account, data, maxFeePerGas, maxPriorityFeePerGas, to, value, nonce,
|
|
54
|
+
const { account: account_ = client.account, data, maxFeePerGas, maxPriorityFeePerGas, to, value, nonce, middleware } = args;
|
|
55
55
|
if (!account_) {
|
|
56
56
|
throw new AccountOrClientNotFoundError({
|
|
57
57
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -68,17 +68,16 @@ export async function sendTransaction(client, args) {
|
|
|
68
68
|
value: value || 0n,
|
|
69
69
|
data: data || "0x"
|
|
70
70
|
});
|
|
71
|
-
const userOpHash = await getAction(client, sendUserOperation)({
|
|
71
|
+
const userOpHash = await getAction(client, (sendUserOperation))({
|
|
72
72
|
userOperation: {
|
|
73
73
|
sender: account.address,
|
|
74
|
-
paymasterAndData: "0x",
|
|
75
74
|
maxFeePerGas: maxFeePerGas || 0n,
|
|
76
75
|
maxPriorityFeePerGas: maxPriorityFeePerGas || 0n,
|
|
77
76
|
callData: callData,
|
|
78
77
|
nonce: nonce ? BigInt(nonce) : undefined
|
|
79
78
|
},
|
|
80
79
|
account: account,
|
|
81
|
-
|
|
80
|
+
middleware
|
|
82
81
|
});
|
|
83
82
|
const userOperationReceipt = await getAction(client, waitForUserOperationReceipt)({
|
|
84
83
|
hash: userOpHash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":"AAOA,OAAO,EAAqB,MAAM,sBAAs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,MAAM,UAAU,GAAG,MAAM,SAAS,CAC9B,MAAM,EACN,CAAA,iBAA6B,CAAA,CAChC,CAAC;QACE,aAAa,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,YAAY,EAAE,YAAY,IAAI,EAAE;YAChC,oBAAoB,EAAE,oBAAoB,IAAI,EAAE;YAChD,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SAC3C;QACD,OAAO,EAAE,OAAO;QAChB,UAAU;KACb,CAAC,CAAA;IAEF,MAAM,oBAAoB,GAAG,MAAM,SAAS,CACxC,MAAM,EACN,2BAA2B,CAC9B,CAAC;QACE,IAAI,EAAE,UAAU;KACnB,CAAC,CAAA;IAEF,OAAO,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAA;AACxD,CAAC"}
|
|
@@ -51,7 +51,7 @@ import { sendUserOperation } from "./sendUserOperation.js";
|
|
|
51
51
|
* }])
|
|
52
52
|
*/
|
|
53
53
|
export async function sendTransactions(client, args) {
|
|
54
|
-
const { account: account_ = client.account, transactions,
|
|
54
|
+
const { account: account_ = client.account, transactions, middleware, maxFeePerGas, maxPriorityFeePerGas, nonce } = args;
|
|
55
55
|
if (!account_) {
|
|
56
56
|
throw new AccountOrClientNotFoundError({
|
|
57
57
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -70,17 +70,16 @@ export async function sendTransactions(client, args) {
|
|
|
70
70
|
data: data || "0x"
|
|
71
71
|
};
|
|
72
72
|
}));
|
|
73
|
-
const userOpHash = await getAction(client, sendUserOperation)({
|
|
73
|
+
const userOpHash = await getAction(client, (sendUserOperation))({
|
|
74
74
|
userOperation: {
|
|
75
75
|
sender: account.address,
|
|
76
|
-
paymasterAndData: "0x",
|
|
77
76
|
maxFeePerGas: maxFeePerGas || 0n,
|
|
78
77
|
maxPriorityFeePerGas: maxPriorityFeePerGas || 0n,
|
|
79
78
|
callData: callData,
|
|
80
79
|
nonce: nonce
|
|
81
80
|
},
|
|
82
81
|
account: account,
|
|
83
|
-
|
|
82
|
+
middleware
|
|
84
83
|
});
|
|
85
84
|
const userOperationReceipt = await getAction(client, waitForUserOperationReceipt)({
|
|
86
85
|
hash: userOpHash
|