permissionless 0.1.48 → 0.1.49
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/_cjs/accounts/biconomy/abi/BiconomySmartAccountAbi.js +102 -0
- package/_cjs/accounts/biconomy/abi/BiconomySmartAccountAbi.js.map +1 -0
- package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js +14 -0
- package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -0
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +233 -0
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -0
- package/_cjs/accounts/index.js +30 -0
- package/_cjs/accounts/index.js.map +1 -0
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js +84 -0
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
- package/_cjs/accounts/kernel/abi/KernelV3AccountAbi.js +110 -0
- package/_cjs/accounts/kernel/abi/KernelV3AccountAbi.js.map +1 -0
- package/_cjs/accounts/kernel/abi/KernelV3MetaFactoryAbi.js +21 -0
- package/_cjs/accounts/kernel/abi/KernelV3MetaFactoryAbi.js.map +1 -0
- package/_cjs/accounts/kernel/constants.js +27 -0
- package/_cjs/accounts/kernel/constants.js.map +1 -0
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +332 -0
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
- package/_cjs/accounts/kernel/utils/encodeCallData.js +90 -0
- package/_cjs/accounts/kernel/utils/encodeCallData.js.map +1 -0
- package/_cjs/accounts/kernel/utils/getExecMode.js +15 -0
- package/_cjs/accounts/kernel/utils/getExecMode.js.map +1 -0
- package/_cjs/accounts/kernel/utils/getNonceKey.js +25 -0
- package/_cjs/accounts/kernel/utils/getNonceKey.js.map +1 -0
- package/_cjs/accounts/kernel/utils/isKernelV2.js +9 -0
- package/_cjs/accounts/kernel/utils/isKernelV2.js.map +1 -0
- package/_cjs/accounts/kernel/utils/signMessage.js +29 -0
- package/_cjs/accounts/kernel/utils/signMessage.js.map +1 -0
- package/_cjs/accounts/kernel/utils/signTypedData.js +41 -0
- package/_cjs/accounts/kernel/utils/signTypedData.js.map +1 -0
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js +20 -0
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js.map +1 -0
- package/_cjs/accounts/light/privateKeyToLightSmartAccount.js +14 -0
- package/_cjs/accounts/light/privateKeyToLightSmartAccount.js.map +1 -0
- package/_cjs/accounts/light/signerToLightSmartAccount.js +256 -0
- package/_cjs/accounts/light/signerToLightSmartAccount.js.map +1 -0
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js +14 -0
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js +1012 -0
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js +14 -0
- package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -0
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js +259 -0
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js.map +1 -0
- package/_cjs/accounts/toSmartAccount.js +84 -0
- package/_cjs/accounts/toSmartAccount.js.map +1 -0
- package/_cjs/accounts/trust/privateKeyToTrustSmartAccount.js +14 -0
- package/_cjs/accounts/trust/privateKeyToTrustSmartAccount.js.map +1 -0
- package/_cjs/accounts/trust/signerToTrustSmartAccount.js +134 -0
- package/_cjs/accounts/trust/signerToTrustSmartAccount.js.map +1 -0
- package/_cjs/accounts/trust/utils/encodeCallData.js +74 -0
- package/_cjs/accounts/trust/utils/encodeCallData.js.map +1 -0
- package/_cjs/accounts/trust/utils/getAccountAddress.js +19 -0
- package/_cjs/accounts/trust/utils/getAccountAddress.js.map +1 -0
- package/_cjs/accounts/trust/utils/getDummySignature.js +8 -0
- package/_cjs/accounts/trust/utils/getDummySignature.js.map +1 -0
- package/_cjs/accounts/trust/utils/getFactoryData.js +43 -0
- package/_cjs/accounts/trust/utils/getFactoryData.js.map +1 -0
- package/_cjs/accounts/trust/utils/signMessage.js +9 -0
- package/_cjs/accounts/trust/utils/signMessage.js.map +1 -0
- package/_cjs/accounts/trust/utils/signTransaction.js +9 -0
- package/_cjs/accounts/trust/utils/signTransaction.js.map +1 -0
- package/_cjs/accounts/trust/utils/signUserOperation.js +19 -0
- package/_cjs/accounts/trust/utils/signUserOperation.js.map +1 -0
- package/_cjs/accounts/types.js +23 -0
- package/_cjs/accounts/types.js.map +1 -0
- package/_cjs/actions/bundler/chainId.js +11 -0
- package/_cjs/actions/bundler/chainId.js.map +1 -0
- package/_cjs/actions/bundler/estimateUserOperationGas.js +49 -0
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_cjs/actions/bundler/getUserOperationByHash.js +47 -0
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/_cjs/actions/bundler/getUserOperationReceipt.js +52 -0
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_cjs/actions/bundler/sendUserOperation.js +23 -0
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -0
- package/_cjs/actions/bundler/supportedEntryPoints.js +11 -0
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -0
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js +67 -0
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_cjs/actions/erc7579/accountId.js +66 -0
- package/_cjs/actions/erc7579/accountId.js.map +1 -0
- package/_cjs/actions/erc7579/installModule.js +65 -0
- package/_cjs/actions/erc7579/installModule.js.map +1 -0
- package/_cjs/actions/erc7579/installModules.js +65 -0
- package/_cjs/actions/erc7579/installModules.js.map +1 -0
- package/_cjs/actions/erc7579/isModuleInstalled.js +86 -0
- package/_cjs/actions/erc7579/isModuleInstalled.js.map +1 -0
- package/_cjs/actions/erc7579/supportsExecutionMode.js +95 -0
- package/_cjs/actions/erc7579/supportsExecutionMode.js.map +1 -0
- package/_cjs/actions/erc7579/supportsModule.js +84 -0
- package/_cjs/actions/erc7579/supportsModule.js.map +1 -0
- package/_cjs/actions/erc7579/uninstallModule.js +65 -0
- package/_cjs/actions/erc7579/uninstallModule.js.map +1 -0
- package/_cjs/actions/erc7579/uninstallModules.js +65 -0
- package/_cjs/actions/erc7579/uninstallModules.js.map +1 -0
- package/_cjs/actions/erc7579.js +33 -0
- package/_cjs/actions/erc7579.js.map +1 -0
- package/_cjs/actions/index.js +25 -0
- package/_cjs/actions/index.js.map +1 -0
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js +25 -0
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
- package/_cjs/actions/pimlico/getUserOperationStatus.js +11 -0
- package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -0
- package/_cjs/actions/pimlico/sendCompressedUserOperation.js +16 -0
- package/_cjs/actions/pimlico/sendCompressedUserOperation.js.map +1 -0
- package/_cjs/actions/pimlico/sponsorUserOperation.js +43 -0
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -0
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js +16 -0
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -0
- package/_cjs/actions/pimlico.js +17 -0
- package/_cjs/actions/pimlico.js.map +1 -0
- package/_cjs/actions/public/getAccountNonce.js +38 -0
- package/_cjs/actions/public/getAccountNonce.js.map +1 -0
- package/_cjs/actions/public/getSenderAddress.js +59 -0
- package/_cjs/actions/public/getSenderAddress.js.map +1 -0
- package/_cjs/actions/smartAccount/deployContract.js +38 -0
- package/_cjs/actions/smartAccount/deployContract.js.map +1 -0
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js +195 -0
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -0
- package/_cjs/actions/smartAccount/sendTransaction.js +43 -0
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -0
- package/_cjs/actions/smartAccount/sendTransactions.js +45 -0
- package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -0
- package/_cjs/actions/smartAccount/sendUserOperation.js +21 -0
- package/_cjs/actions/smartAccount/sendUserOperation.js.map +1 -0
- package/_cjs/actions/smartAccount/signMessage.js +16 -0
- package/_cjs/actions/smartAccount/signMessage.js.map +1 -0
- package/_cjs/actions/smartAccount/signTypedData.js +34 -0
- package/_cjs/actions/smartAccount/signTypedData.js.map +1 -0
- package/_cjs/actions/smartAccount/writeContract.js +21 -0
- package/_cjs/actions/smartAccount/writeContract.js.map +1 -0
- package/_cjs/actions/smartAccount.js +20 -0
- package/_cjs/actions/smartAccount.js.map +1 -0
- package/_cjs/actions/stackup/accounts.js +12 -0
- package/_cjs/actions/stackup/accounts.js.map +1 -0
- package/_cjs/actions/stackup/sponsorUserOperation.js +32 -0
- package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -0
- package/_cjs/actions/stackup.js +10 -0
- package/_cjs/actions/stackup.js.map +1 -0
- package/_cjs/clients/createBundlerClient.js +17 -0
- package/_cjs/clients/createBundlerClient.js.map +1 -0
- package/_cjs/clients/createSmartAccountClient.js +20 -0
- package/_cjs/clients/createSmartAccountClient.js.map +1 -0
- package/_cjs/clients/decorators/bundler.js +24 -0
- package/_cjs/clients/decorators/bundler.js.map +1 -0
- package/_cjs/clients/decorators/pimlico.js +25 -0
- package/_cjs/clients/decorators/pimlico.js.map +1 -0
- package/_cjs/clients/decorators/smartAccount.js +43 -0
- package/_cjs/clients/decorators/smartAccount.js.map +1 -0
- package/_cjs/clients/decorators/stackup.js +14 -0
- package/_cjs/clients/decorators/stackup.js.map +1 -0
- package/_cjs/clients/pimlico.js +31 -0
- package/_cjs/clients/pimlico.js.map +1 -0
- package/_cjs/clients/stackup.js +20 -0
- package/_cjs/clients/stackup.js.map +1 -0
- package/_cjs/errors/account.js +311 -0
- package/_cjs/errors/account.js.map +1 -0
- package/_cjs/errors/bundler.js +61 -0
- package/_cjs/errors/bundler.js.map +1 -0
- package/_cjs/errors/estimateUserOperationGas.js +53 -0
- package/_cjs/errors/estimateUserOperationGas.js.map +1 -0
- package/_cjs/errors/gas.js +113 -0
- package/_cjs/errors/gas.js.map +1 -0
- package/_cjs/errors/index.js +35 -0
- package/_cjs/errors/index.js.map +1 -0
- package/_cjs/errors/paymaster.js +228 -0
- package/_cjs/errors/paymaster.js.map +1 -0
- package/_cjs/errors/sendUserOperation.js +37 -0
- package/_cjs/errors/sendUserOperation.js.map +1 -0
- package/_cjs/errors/utils.js +18 -0
- package/_cjs/errors/utils.js.map +1 -0
- package/_cjs/experimental/eip7677/actions/getPaymasterData.js +41 -0
- package/_cjs/experimental/eip7677/actions/getPaymasterData.js.map +1 -0
- package/_cjs/experimental/eip7677/actions/getPaymasterStubData.js +51 -0
- package/_cjs/experimental/eip7677/actions/getPaymasterStubData.js.map +1 -0
- package/_cjs/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js +21 -0
- package/_cjs/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js.map +1 -0
- package/_cjs/experimental/eip7677/index.js +10 -0
- package/_cjs/experimental/eip7677/index.js.map +1 -0
- package/_cjs/experimental/eip7677/types/paymaster.js +3 -0
- package/_cjs/experimental/eip7677/types/paymaster.js.map +1 -0
- package/_cjs/experimental/index.js +5 -0
- package/_cjs/experimental/index.js.map +1 -0
- package/_cjs/index.js +37 -0
- package/_cjs/index.js.map +1 -0
- package/_cjs/package.json +1 -0
- package/_cjs/types/bundler.js +3 -0
- package/_cjs/types/bundler.js.map +1 -0
- package/_cjs/types/entrypoint.js +3 -0
- package/_cjs/types/entrypoint.js.map +1 -0
- package/_cjs/types/index.js +3 -0
- package/_cjs/types/index.js.map +1 -0
- package/_cjs/types/pimlico.js +3 -0
- package/_cjs/types/pimlico.js.map +1 -0
- package/_cjs/types/stackup.js +3 -0
- package/_cjs/types/stackup.js.map +1 -0
- package/_cjs/types/userOperation.js +3 -0
- package/_cjs/types/userOperation.js.map +1 -0
- package/_cjs/utils/decodeNonce.js +12 -0
- package/_cjs/utils/decodeNonce.js.map +1 -0
- package/_cjs/utils/deepHexlify.js +31 -0
- package/_cjs/utils/deepHexlify.js.map +1 -0
- package/_cjs/utils/encode7579CallData.js +81 -0
- package/_cjs/utils/encode7579CallData.js.map +1 -0
- package/_cjs/utils/encodeNonce.js +11 -0
- package/_cjs/utils/encodeNonce.js.map +1 -0
- package/_cjs/utils/errors/getBundlerError.js +124 -0
- package/_cjs/utils/errors/getBundlerError.js.map +1 -0
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js +19 -0
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js.map +1 -0
- package/_cjs/utils/errors/getSendUserOperationError.js +19 -0
- package/_cjs/utils/errors/getSendUserOperationError.js.map +1 -0
- package/_cjs/utils/getAddressFromInitCodeOrPaymasterAndData.js +15 -0
- package/_cjs/utils/getAddressFromInitCodeOrPaymasterAndData.js.map +1 -0
- package/_cjs/utils/getEntryPointVersion.js +16 -0
- package/_cjs/utils/getEntryPointVersion.js.map +1 -0
- package/_cjs/utils/getPackedUserOperation.js +106 -0
- package/_cjs/utils/getPackedUserOperation.js.map +1 -0
- package/_cjs/utils/getRequiredPrefund.js +27 -0
- package/_cjs/utils/getRequiredPrefund.js.map +1 -0
- package/_cjs/utils/getUserOperationHash.js +94 -0
- package/_cjs/utils/getUserOperationHash.js.map +1 -0
- package/_cjs/utils/index.js +38 -0
- package/_cjs/utils/index.js.map +1 -0
- package/_cjs/utils/isSmartAccountDeployed.js +15 -0
- package/_cjs/utils/isSmartAccountDeployed.js.map +1 -0
- package/_cjs/utils/observe.js +44 -0
- package/_cjs/utils/observe.js.map +1 -0
- package/_cjs/utils/providerToSmartAccountSigner.js +32 -0
- package/_cjs/utils/providerToSmartAccountSigner.js.map +1 -0
- package/_cjs/utils/signUserOperationHashWithECDSA.js +58 -0
- package/_cjs/utils/signUserOperationHashWithECDSA.js.map +1 -0
- package/_cjs/utils/walletClientToSmartAccountSigner.js +23 -0
- package/_cjs/utils/walletClientToSmartAccountSigner.js.map +1 -0
- package/_cjs/vitest.config.js +31 -0
- package/_cjs/vitest.config.js.map +1 -0
- package/_esm/accounts/biconomy/abi/BiconomySmartAccountAbi.js +105 -0
- package/_esm/accounts/biconomy/abi/BiconomySmartAccountAbi.js.map +1 -0
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js +15 -0
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -0
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +268 -0
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -0
- package/_esm/accounts/index.js +15 -0
- package/_esm/accounts/index.js.map +1 -0
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js +87 -0
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
- package/_esm/accounts/kernel/abi/KernelV3AccountAbi.js +107 -0
- package/_esm/accounts/kernel/abi/KernelV3AccountAbi.js.map +1 -0
- package/_esm/accounts/kernel/abi/KernelV3MetaFactoryAbi.js +18 -0
- package/_esm/accounts/kernel/abi/KernelV3MetaFactoryAbi.js.map +1 -0
- package/_esm/accounts/kernel/constants.js +24 -0
- package/_esm/accounts/kernel/constants.js.map +1 -0
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +395 -0
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
- package/_esm/accounts/kernel/utils/encodeCallData.js +89 -0
- package/_esm/accounts/kernel/utils/encodeCallData.js.map +1 -0
- package/_esm/accounts/kernel/utils/getExecMode.js +11 -0
- package/_esm/accounts/kernel/utils/getExecMode.js.map +1 -0
- package/_esm/accounts/kernel/utils/getNonceKey.js +21 -0
- package/_esm/accounts/kernel/utils/getNonceKey.js.map +1 -0
- package/_esm/accounts/kernel/utils/isKernelV2.js +5 -0
- package/_esm/accounts/kernel/utils/isKernelV2.js.map +1 -0
- package/_esm/accounts/kernel/utils/signMessage.js +25 -0
- package/_esm/accounts/kernel/utils/signMessage.js.map +1 -0
- package/_esm/accounts/kernel/utils/signTypedData.js +39 -0
- package/_esm/accounts/kernel/utils/signTypedData.js.map +1 -0
- package/_esm/accounts/kernel/utils/wrapMessageHash.js +16 -0
- package/_esm/accounts/kernel/utils/wrapMessageHash.js.map +1 -0
- package/_esm/accounts/light/privateKeyToLightSmartAccount.js +15 -0
- package/_esm/accounts/light/privateKeyToLightSmartAccount.js.map +1 -0
- package/_esm/accounts/light/signerToLightSmartAccount.js +258 -0
- package/_esm/accounts/light/signerToLightSmartAccount.js.map +1 -0
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js +15 -0
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/safe/signerToSafeSmartAccount.js +1014 -0
- package/_esm/accounts/safe/signerToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js +15 -0
- package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -0
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js +261 -0
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js.map +1 -0
- package/_esm/accounts/toSmartAccount.js +80 -0
- package/_esm/accounts/toSmartAccount.js.map +1 -0
- package/_esm/accounts/trust/privateKeyToTrustSmartAccount.js +15 -0
- package/_esm/accounts/trust/privateKeyToTrustSmartAccount.js.map +1 -0
- package/_esm/accounts/trust/signerToTrustSmartAccount.js +138 -0
- package/_esm/accounts/trust/signerToTrustSmartAccount.js.map +1 -0
- package/_esm/accounts/trust/utils/encodeCallData.js +70 -0
- package/_esm/accounts/trust/utils/encodeCallData.js.map +1 -0
- package/_esm/accounts/trust/utils/getAccountAddress.js +15 -0
- package/_esm/accounts/trust/utils/getAccountAddress.js.map +1 -0
- package/_esm/accounts/trust/utils/getDummySignature.js +4 -0
- package/_esm/accounts/trust/utils/getDummySignature.js.map +1 -0
- package/_esm/accounts/trust/utils/getFactoryData.js +42 -0
- package/_esm/accounts/trust/utils/getFactoryData.js.map +1 -0
- package/_esm/accounts/trust/utils/signMessage.js +5 -0
- package/_esm/accounts/trust/utils/signMessage.js.map +1 -0
- package/_esm/accounts/trust/utils/signTransaction.js +5 -0
- package/_esm/accounts/trust/utils/signTransaction.js.map +1 -0
- package/_esm/accounts/trust/utils/signUserOperation.js +15 -0
- package/_esm/accounts/trust/utils/signUserOperation.js.map +1 -0
- package/_esm/accounts/types.js +19 -0
- package/_esm/accounts/types.js.map +1 -0
- package/_esm/actions/bundler/chainId.js +29 -0
- package/_esm/actions/bundler/chainId.js.map +1 -0
- package/_esm/actions/bundler/estimateUserOperationGas.js +72 -0
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_esm/actions/bundler/getUserOperationByHash.js +65 -0
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/_esm/actions/bundler/getUserOperationReceipt.js +70 -0
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_esm/actions/bundler/sendUserOperation.js +44 -0
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -0
- package/_esm/actions/bundler/supportedEntryPoints.js +29 -0
- package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -0
- package/_esm/actions/bundler/waitForUserOperationReceipt.js +83 -0
- package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_esm/actions/erc7579/accountId.js +62 -0
- package/_esm/actions/erc7579/accountId.js.map +1 -0
- package/_esm/actions/erc7579/installModule.js +61 -0
- package/_esm/actions/erc7579/installModule.js.map +1 -0
- package/_esm/actions/erc7579/installModules.js +61 -0
- package/_esm/actions/erc7579/installModules.js.map +1 -0
- package/_esm/actions/erc7579/isModuleInstalled.js +82 -0
- package/_esm/actions/erc7579/isModuleInstalled.js.map +1 -0
- package/_esm/actions/erc7579/supportsExecutionMode.js +90 -0
- package/_esm/actions/erc7579/supportsExecutionMode.js.map +1 -0
- package/_esm/actions/erc7579/supportsModule.js +79 -0
- package/_esm/actions/erc7579/supportsModule.js.map +1 -0
- package/_esm/actions/erc7579/uninstallModule.js +61 -0
- package/_esm/actions/erc7579/uninstallModule.js.map +1 -0
- package/_esm/actions/erc7579/uninstallModules.js +61 -0
- package/_esm/actions/erc7579/uninstallModules.js.map +1 -0
- package/_esm/actions/erc7579.js +22 -0
- package/_esm/actions/erc7579.js.map +1 -0
- package/_esm/actions/index.js +12 -0
- package/_esm/actions/index.js.map +1 -0
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +42 -0
- package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
- package/_esm/actions/pimlico/getUserOperationStatus.js +30 -0
- package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -0
- package/_esm/actions/pimlico/sendCompressedUserOperation.js +37 -0
- package/_esm/actions/pimlico/sendCompressedUserOperation.js.map +1 -0
- package/_esm/actions/pimlico/sponsorUserOperation.js +64 -0
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -0
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js +47 -0
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -0
- package/_esm/actions/pimlico.js +8 -0
- package/_esm/actions/pimlico.js.map +1 -0
- package/_esm/actions/public/getAccountNonce.js +60 -0
- package/_esm/actions/public/getAccountNonce.js.map +1 -0
- package/_esm/actions/public/getSenderAddress.js +80 -0
- package/_esm/actions/public/getSenderAddress.js.map +1 -0
- package/_esm/actions/smartAccount/deployContract.js +62 -0
- package/_esm/actions/smartAccount/deployContract.js.map +1 -0
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js +195 -0
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -0
- package/_esm/actions/smartAccount/sendTransaction.js +85 -0
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -0
- package/_esm/actions/smartAccount/sendTransactions.js +87 -0
- package/_esm/actions/smartAccount/sendTransactions.js.map +1 -0
- package/_esm/actions/smartAccount/sendUserOperation.js +17 -0
- package/_esm/actions/smartAccount/sendUserOperation.js.map +1 -0
- package/_esm/actions/smartAccount/signMessage.js +58 -0
- package/_esm/actions/smartAccount/signMessage.js.map +1 -0
- package/_esm/actions/smartAccount/signTypedData.js +128 -0
- package/_esm/actions/smartAccount/signTypedData.js.map +1 -0
- package/_esm/actions/smartAccount/writeContract.js +17 -0
- package/_esm/actions/smartAccount/writeContract.js.map +1 -0
- package/_esm/actions/smartAccount.js +10 -0
- package/_esm/actions/smartAccount.js.map +1 -0
- package/_esm/actions/stackup/accounts.js +30 -0
- package/_esm/actions/stackup/accounts.js.map +1 -0
- package/_esm/actions/stackup/sponsorUserOperation.js +53 -0
- package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -0
- package/_esm/actions/stackup.js +5 -0
- package/_esm/actions/stackup.js.map +1 -0
- package/_esm/clients/createBundlerClient.js +32 -0
- package/_esm/clients/createBundlerClient.js.map +1 -0
- package/_esm/clients/createSmartAccountClient.js +35 -0
- package/_esm/clients/createSmartAccountClient.js.map +1 -0
- package/_esm/clients/decorators/bundler.js +21 -0
- package/_esm/clients/decorators/bundler.js.map +1 -0
- package/_esm/clients/decorators/pimlico.js +64 -0
- package/_esm/clients/decorators/pimlico.js.map +1 -0
- package/_esm/clients/decorators/smartAccount.js +39 -0
- package/_esm/clients/decorators/smartAccount.js.map +1 -0
- package/_esm/clients/decorators/stackup.js +10 -0
- package/_esm/clients/decorators/stackup.js.map +1 -0
- package/_esm/clients/pimlico.js +64 -0
- package/_esm/clients/pimlico.js.map +1 -0
- package/_esm/clients/stackup.js +35 -0
- package/_esm/clients/stackup.js.map +1 -0
- package/_esm/errors/account.js +298 -0
- package/_esm/errors/account.js.map +1 -0
- package/_esm/errors/bundler.js +56 -0
- package/_esm/errors/bundler.js.map +1 -0
- package/_esm/errors/estimateUserOperationGas.js +49 -0
- package/_esm/errors/estimateUserOperationGas.js.map +1 -0
- package/_esm/errors/gas.js +106 -0
- package/_esm/errors/gas.js.map +1 -0
- package/_esm/errors/index.js +8 -0
- package/_esm/errors/index.js.map +1 -0
- package/_esm/errors/paymaster.js +218 -0
- package/_esm/errors/paymaster.js.map +1 -0
- package/_esm/errors/sendUserOperation.js +33 -0
- package/_esm/errors/sendUserOperation.js.map +1 -0
- package/_esm/errors/utils.js +14 -0
- package/_esm/errors/utils.js.map +1 -0
- package/_esm/experimental/eip7677/actions/getPaymasterData.js +37 -0
- package/_esm/experimental/eip7677/actions/getPaymasterData.js.map +1 -0
- package/_esm/experimental/eip7677/actions/getPaymasterStubData.js +47 -0
- package/_esm/experimental/eip7677/actions/getPaymasterStubData.js.map +1 -0
- package/_esm/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js +18 -0
- package/_esm/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js.map +1 -0
- package/_esm/experimental/eip7677/index.js +5 -0
- package/_esm/experimental/eip7677/index.js.map +1 -0
- package/_esm/experimental/eip7677/types/paymaster.js +2 -0
- package/_esm/experimental/eip7677/types/paymaster.js.map +1 -0
- package/_esm/experimental/index.js +2 -0
- package/_esm/experimental/index.js.map +1 -0
- package/_esm/index.js +20 -0
- package/_esm/index.js.map +1 -0
- package/_esm/package.json +1 -0
- package/_esm/types/bundler.js +2 -0
- package/_esm/types/bundler.js.map +1 -0
- package/_esm/types/entrypoint.js +2 -0
- package/_esm/types/entrypoint.js.map +1 -0
- package/_esm/types/index.js +2 -0
- package/_esm/types/index.js.map +1 -0
- package/_esm/types/pimlico.js +2 -0
- package/_esm/types/pimlico.js.map +1 -0
- package/_esm/types/stackup.js +2 -0
- package/_esm/types/stackup.js.map +1 -0
- package/_esm/types/userOperation.js +2 -0
- package/_esm/types/userOperation.js.map +1 -0
- package/_esm/utils/decodeNonce.js +8 -0
- package/_esm/utils/decodeNonce.js.map +1 -0
- package/_esm/utils/deepHexlify.js +30 -0
- package/_esm/utils/deepHexlify.js.map +1 -0
- package/_esm/utils/encode7579CallData.js +77 -0
- package/_esm/utils/encode7579CallData.js.map +1 -0
- package/_esm/utils/encodeNonce.js +7 -0
- package/_esm/utils/encodeNonce.js.map +1 -0
- package/_esm/utils/errors/getBundlerError.js +121 -0
- package/_esm/utils/errors/getBundlerError.js.map +1 -0
- package/_esm/utils/errors/getEstimateUserOperationGasError.js +18 -0
- package/_esm/utils/errors/getEstimateUserOperationGasError.js.map +1 -0
- package/_esm/utils/errors/getSendUserOperationError.js +15 -0
- package/_esm/utils/errors/getSendUserOperationError.js.map +1 -0
- package/_esm/utils/getAddressFromInitCodeOrPaymasterAndData.js +11 -0
- package/_esm/utils/getAddressFromInitCodeOrPaymasterAndData.js.map +1 -0
- package/_esm/utils/getEntryPointVersion.js +11 -0
- package/_esm/utils/getEntryPointVersion.js.map +1 -0
- package/_esm/utils/getPackedUserOperation.js +94 -0
- package/_esm/utils/getPackedUserOperation.js.map +1 -0
- package/_esm/utils/getRequiredPrefund.js +37 -0
- package/_esm/utils/getRequiredPrefund.js.map +1 -0
- package/_esm/utils/getUserOperationHash.js +111 -0
- package/_esm/utils/getUserOperationHash.js.map +1 -0
- package/_esm/utils/index.js +19 -0
- package/_esm/utils/index.js.map +1 -0
- package/_esm/utils/isSmartAccountDeployed.js +11 -0
- package/_esm/utils/isSmartAccountDeployed.js.map +1 -0
- package/_esm/utils/observe.js +47 -0
- package/_esm/utils/observe.js.map +1 -0
- package/_esm/utils/providerToSmartAccountSigner.js +28 -0
- package/_esm/utils/providerToSmartAccountSigner.js.map +1 -0
- package/_esm/utils/signUserOperationHashWithECDSA.js +76 -0
- package/_esm/utils/signUserOperationHashWithECDSA.js.map +1 -0
- package/_esm/utils/walletClientToSmartAccountSigner.js +19 -0
- package/_esm/utils/walletClientToSmartAccountSigner.js.map +1 -0
- package/_esm/vitest.config.js +29 -0
- package/_esm/vitest.config.js.map +1 -0
- package/_types/accounts/biconomy/abi/BiconomySmartAccountAbi.d.ts +59 -0
- package/_types/accounts/biconomy/abi/BiconomySmartAccountAbi.d.ts.map +1 -0
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts +13 -0
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts.map +1 -0
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +29 -0
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -0
- package/_types/accounts/index.d.ts +15 -0
- package/_types/accounts/index.d.ts.map +1 -0
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts +68 -0
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/abi/KernelV3AccountAbi.d.ts +135 -0
- package/_types/accounts/kernel/abi/KernelV3AccountAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/abi/KernelV3MetaFactoryAbi.d.ts +24 -0
- package/_types/accounts/kernel/abi/KernelV3MetaFactoryAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/constants.d.ts +21 -0
- package/_types/accounts/kernel/constants.d.ts.map +1 -0
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +44 -0
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/encodeCallData.d.ts +13 -0
- package/_types/accounts/kernel/utils/encodeCallData.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/getExecMode.d.ts +7 -0
- package/_types/accounts/kernel/utils/getExecMode.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/getNonceKey.d.ts +5 -0
- package/_types/accounts/kernel/utils/getNonceKey.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/isKernelV2.d.ts +4 -0
- package/_types/accounts/kernel/utils/isKernelV2.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/signMessage.d.ts +4 -0
- package/_types/accounts/kernel/utils/signMessage.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/signTypedData.d.ts +4 -0
- package/_types/accounts/kernel/utils/signTypedData.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts +11 -0
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts.map +1 -0
- package/_types/accounts/light/privateKeyToLightSmartAccount.d.ts +14 -0
- package/_types/accounts/light/privateKeyToLightSmartAccount.d.ts.map +1 -0
- package/_types/accounts/light/signerToLightSmartAccount.d.ts +22 -0
- package/_types/accounts/light/signerToLightSmartAccount.d.ts.map +1 -0
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts +13 -0
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts +61 -0
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts +13 -0
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts.map +1 -0
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts +20 -0
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts.map +1 -0
- package/_types/accounts/toSmartAccount.d.ts +26 -0
- package/_types/accounts/toSmartAccount.d.ts.map +1 -0
- package/_types/accounts/trust/privateKeyToTrustSmartAccount.d.ts +13 -0
- package/_types/accounts/trust/privateKeyToTrustSmartAccount.d.ts.map +1 -0
- package/_types/accounts/trust/signerToTrustSmartAccount.d.ts +27 -0
- package/_types/accounts/trust/signerToTrustSmartAccount.d.ts.map +1 -0
- package/_types/accounts/trust/utils/encodeCallData.d.ts +12 -0
- package/_types/accounts/trust/utils/encodeCallData.d.ts.map +1 -0
- package/_types/accounts/trust/utils/getAccountAddress.d.ts +10 -0
- package/_types/accounts/trust/utils/getAccountAddress.d.ts.map +1 -0
- package/_types/accounts/trust/utils/getDummySignature.d.ts +3 -0
- package/_types/accounts/trust/utils/getDummySignature.d.ts.map +1 -0
- package/_types/accounts/trust/utils/getFactoryData.d.ts +10 -0
- package/_types/accounts/trust/utils/getFactoryData.d.ts.map +1 -0
- package/_types/accounts/trust/utils/signMessage.d.ts +4 -0
- package/_types/accounts/trust/utils/signMessage.d.ts.map +1 -0
- package/_types/accounts/trust/utils/signTransaction.d.ts +5 -0
- package/_types/accounts/trust/utils/signTransaction.d.ts.map +1 -0
- package/_types/accounts/trust/utils/signUserOperation.d.ts +9 -0
- package/_types/accounts/trust/utils/signUserOperation.d.ts.map +1 -0
- package/_types/accounts/types.d.ts +32 -0
- package/_types/accounts/types.d.ts.map +1 -0
- package/_types/actions/bundler/chainId.d.ts +27 -0
- package/_types/actions/bundler/chainId.d.ts.map +1 -0
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +91 -0
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
- package/_types/actions/bundler/getUserOperationByHash.d.ts +39 -0
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -0
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +58 -0
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
- package/_types/actions/bundler/sendUserOperation.d.ts +39 -0
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -0
- package/_types/actions/bundler/supportedEntryPoints.d.ts +27 -0
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -0
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +43 -0
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
- package/_types/actions/erc7579/accountId.d.ts +6 -0
- package/_types/actions/erc7579/accountId.d.ts.map +1 -0
- package/_types/actions/erc7579/installModule.d.ts +16 -0
- package/_types/actions/erc7579/installModule.d.ts.map +1 -0
- package/_types/actions/erc7579/installModules.d.ts +18 -0
- package/_types/actions/erc7579/installModules.d.ts.map +1 -0
- package/_types/actions/erc7579/isModuleInstalled.d.ts +12 -0
- package/_types/actions/erc7579/isModuleInstalled.d.ts.map +1 -0
- package/_types/actions/erc7579/supportsExecutionMode.d.ts +15 -0
- package/_types/actions/erc7579/supportsExecutionMode.d.ts.map +1 -0
- package/_types/actions/erc7579/supportsModule.d.ts +11 -0
- package/_types/actions/erc7579/supportsModule.d.ts.map +1 -0
- package/_types/actions/erc7579/uninstallModule.d.ts +16 -0
- package/_types/actions/erc7579/uninstallModule.d.ts.map +1 -0
- package/_types/actions/erc7579/uninstallModules.d.ts +20 -0
- package/_types/actions/erc7579/uninstallModules.d.ts.map +1 -0
- package/_types/actions/erc7579.d.ts +30 -0
- package/_types/actions/erc7579.d.ts.map +1 -0
- package/_types/actions/index.d.ts +20 -0
- package/_types/actions/index.d.ts.map +1 -0
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +40 -0
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -0
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +32 -0
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -0
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts +35 -0
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts.map +1 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +52 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -0
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +56 -0
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -0
- package/_types/actions/pimlico.d.ts +10 -0
- package/_types/actions/pimlico.d.ts.map +1 -0
- package/_types/actions/public/getAccountNonce.d.ts +36 -0
- package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
- package/_types/actions/public/getSenderAddress.d.ts +48 -0
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
- package/_types/actions/smartAccount/deployContract.d.ts +36 -0
- package/_types/actions/smartAccount/deployContract.d.ts.map +1 -0
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts +28 -0
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -0
- package/_types/actions/smartAccount/sendTransaction.d.ts +54 -0
- package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -0
- package/_types/actions/smartAccount/sendTransactions.d.ts +64 -0
- package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -0
- package/_types/actions/smartAccount/sendUserOperation.d.ts +10 -0
- package/_types/actions/smartAccount/sendUserOperation.d.ts.map +1 -0
- package/_types/actions/smartAccount/signMessage.d.ts +51 -0
- package/_types/actions/smartAccount/signMessage.d.ts.map +1 -0
- package/_types/actions/smartAccount/signTypedData.d.ts +105 -0
- package/_types/actions/smartAccount/signTypedData.d.ts.map +1 -0
- package/_types/actions/smartAccount/writeContract.d.ts +58 -0
- package/_types/actions/smartAccount/writeContract.d.ts.map +1 -0
- package/_types/actions/smartAccount.d.ts +10 -0
- package/_types/actions/smartAccount.d.ts.map +1 -0
- package/_types/actions/stackup/accounts.d.ts +30 -0
- package/_types/actions/stackup/accounts.d.ts.map +1 -0
- package/_types/actions/stackup/sponsorUserOperation.d.ts +38 -0
- package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -0
- package/_types/actions/stackup.d.ts +7 -0
- package/_types/actions/stackup.d.ts.map +1 -0
- package/_types/clients/createBundlerClient.d.ts +28 -0
- package/_types/clients/createBundlerClient.d.ts.map +1 -0
- package/_types/clients/createSmartAccountClient.d.ts +40 -0
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -0
- package/_types/clients/decorators/bundler.d.ts +175 -0
- package/_types/clients/decorators/bundler.d.ts.map +1 -0
- package/_types/clients/decorators/pimlico.d.ts +142 -0
- package/_types/clients/decorators/pimlico.d.ts.map +1 -0
- package/_types/clients/decorators/smartAccount.d.ts +330 -0
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -0
- package/_types/clients/decorators/stackup.d.ts +55 -0
- package/_types/clients/decorators/stackup.d.ts.map +1 -0
- package/_types/clients/pimlico.d.ts +52 -0
- package/_types/clients/pimlico.d.ts.map +1 -0
- package/_types/clients/stackup.d.ts +29 -0
- package/_types/clients/stackup.d.ts.map +1 -0
- package/_types/errors/account.d.ts +121 -0
- package/_types/errors/account.d.ts.map +1 -0
- package/_types/errors/bundler.d.ts +24 -0
- package/_types/errors/bundler.d.ts.map +1 -0
- package/_types/errors/estimateUserOperationGas.d.ts +14 -0
- package/_types/errors/estimateUserOperationGas.d.ts.map +1 -0
- package/_types/errors/gas.d.ts +47 -0
- package/_types/errors/gas.d.ts.map +1 -0
- package/_types/errors/index.d.ts +8 -0
- package/_types/errors/index.d.ts.map +1 -0
- package/_types/errors/paymaster.d.ts +85 -0
- package/_types/errors/paymaster.d.ts.map +1 -0
- package/_types/errors/sendUserOperation.d.ts +14 -0
- package/_types/errors/sendUserOperation.d.ts.map +1 -0
- package/_types/errors/utils.d.ts +5 -0
- package/_types/errors/utils.d.ts.map +1 -0
- package/_types/experimental/eip7677/actions/getPaymasterData.d.ts +51 -0
- package/_types/experimental/eip7677/actions/getPaymasterData.d.ts.map +1 -0
- package/_types/experimental/eip7677/actions/getPaymasterStubData.d.ts +63 -0
- package/_types/experimental/eip7677/actions/getPaymasterStubData.d.ts.map +1 -0
- package/_types/experimental/eip7677/clients/decorators/paymasterActionsEip7677.d.ts +11 -0
- package/_types/experimental/eip7677/clients/decorators/paymasterActionsEip7677.d.ts.map +1 -0
- package/_types/experimental/eip7677/index.d.ts +6 -0
- package/_types/experimental/eip7677/index.d.ts.map +1 -0
- package/_types/experimental/eip7677/types/paymaster.d.ts +52 -0
- package/_types/experimental/eip7677/types/paymaster.d.ts.map +1 -0
- package/_types/experimental/index.d.ts +2 -0
- package/_types/experimental/index.d.ts.map +1 -0
- package/_types/index.d.ts +33 -0
- package/_types/index.d.ts.map +1 -0
- package/_types/types/bundler.d.ts +110 -0
- package/_types/types/bundler.d.ts.map +1 -0
- package/_types/types/entrypoint.d.ts +6 -0
- package/_types/types/entrypoint.d.ts.map +1 -0
- package/_types/types/index.d.ts +27 -0
- package/_types/types/index.d.ts.map +1 -0
- package/_types/types/pimlico.d.ts +93 -0
- package/_types/types/pimlico.d.ts.map +1 -0
- package/_types/types/stackup.d.ts +49 -0
- package/_types/types/stackup.d.ts.map +1 -0
- package/_types/types/userOperation.d.ts +93 -0
- package/_types/types/userOperation.d.ts.map +1 -0
- package/_types/utils/decodeNonce.d.ts +5 -0
- package/_types/utils/decodeNonce.d.ts.map +1 -0
- package/_types/utils/deepHexlify.d.ts +6 -0
- package/_types/utils/deepHexlify.d.ts.map +1 -0
- package/_types/utils/encode7579CallData.d.ts +16 -0
- package/_types/utils/encode7579CallData.d.ts.map +1 -0
- package/_types/utils/encodeNonce.d.ts +5 -0
- package/_types/utils/encodeNonce.d.ts.map +1 -0
- package/_types/utils/errors/getBundlerError.d.ts +11 -0
- package/_types/utils/errors/getBundlerError.d.ts.map +1 -0
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts +10 -0
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts.map +1 -0
- package/_types/utils/errors/getSendUserOperationError.d.ts +5 -0
- package/_types/utils/errors/getSendUserOperationError.d.ts.map +1 -0
- package/_types/utils/getAddressFromInitCodeOrPaymasterAndData.d.ts +3 -0
- package/_types/utils/getAddressFromInitCodeOrPaymasterAndData.d.ts.map +1 -0
- package/_types/utils/getEntryPointVersion.d.ts +8 -0
- package/_types/utils/getEntryPointVersion.d.ts.map +1 -0
- package/_types/utils/getPackedUserOperation.d.ts +39 -0
- package/_types/utils/getPackedUserOperation.d.ts.map +1 -0
- package/_types/utils/getRequiredPrefund.d.ts +21 -0
- package/_types/utils/getRequiredPrefund.d.ts.map +1 -0
- package/_types/utils/getUserOperationHash.d.ts +31 -0
- package/_types/utils/getUserOperationHash.d.ts.map +1 -0
- package/_types/utils/index.d.ts +16 -0
- package/_types/utils/index.d.ts.map +1 -0
- package/_types/utils/isSmartAccountDeployed.d.ts +3 -0
- package/_types/utils/isSmartAccountDeployed.d.ts.map +1 -0
- package/_types/utils/observe.d.ts +17 -0
- package/_types/utils/observe.d.ts.map +1 -0
- package/_types/utils/providerToSmartAccountSigner.d.ts +5 -0
- package/_types/utils/providerToSmartAccountSigner.d.ts.map +1 -0
- package/_types/utils/signUserOperationHashWithECDSA.d.ts +45 -0
- package/_types/utils/signUserOperationHashWithECDSA.d.ts.map +1 -0
- package/_types/utils/walletClientToSmartAccountSigner.d.ts +4 -0
- package/_types/utils/walletClientToSmartAccountSigner.d.ts.map +1 -0
- package/_types/vitest.config.d.ts +3 -0
- package/_types/vitest.config.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserOperationGasPrice = void 0;
|
|
4
|
+
const getUserOperationGasPrice = async (client) => {
|
|
5
|
+
const gasPrice = await client.request({
|
|
6
|
+
method: "pimlico_getUserOperationGasPrice",
|
|
7
|
+
params: []
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
slow: {
|
|
11
|
+
maxFeePerGas: BigInt(gasPrice.slow.maxFeePerGas),
|
|
12
|
+
maxPriorityFeePerGas: BigInt(gasPrice.slow.maxPriorityFeePerGas)
|
|
13
|
+
},
|
|
14
|
+
standard: {
|
|
15
|
+
maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
|
|
16
|
+
maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
|
|
17
|
+
},
|
|
18
|
+
fast: {
|
|
19
|
+
maxFeePerGas: BigInt(gasPrice.fast.maxFeePerGas),
|
|
20
|
+
maxPriorityFeePerGas: BigInt(gasPrice.fast.maxPriorityFeePerGas)
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.getUserOperationGasPrice = getUserOperationGasPrice;
|
|
25
|
+
//# sourceMappingURL=getUserOperationGasPrice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationGasPrice.ts"],"names":[],"mappings":";;;AAwCO,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;AA1BY,QAAA,wBAAwB,4BA0BpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserOperationStatus = void 0;
|
|
4
|
+
const getUserOperationStatus = async (client, { hash }) => {
|
|
5
|
+
return client.request({
|
|
6
|
+
method: "pimlico_getUserOperationStatus",
|
|
7
|
+
params: [hash]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
exports.getUserOperationStatus = getUserOperationStatus;
|
|
11
|
+
//# sourceMappingURL=getUserOperationStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationStatus.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":";;;AAqCO,MAAM,sBAAsB,GAAG,KAAK,EAKvC,MAAqE,EACrE,EAAE,IAAI,EAA8C,EACD,EAAE;IACrD,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE,CAAC,IAAI,CAAC;KACjB,CAAC,CAAA;AACN,CAAC,CAAA;AAZY,QAAA,sBAAsB,0BAYlC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendCompressedUserOperation = void 0;
|
|
4
|
+
const sendCompressedUserOperation = async (client, args) => {
|
|
5
|
+
const { compressedUserOperation, inflatorAddress, entryPoint } = args;
|
|
6
|
+
return client.request({
|
|
7
|
+
method: "pimlico_sendCompressedUserOperation",
|
|
8
|
+
params: [
|
|
9
|
+
compressedUserOperation,
|
|
10
|
+
inflatorAddress,
|
|
11
|
+
entryPoint
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.sendCompressedUserOperation = sendCompressedUserOperation;
|
|
16
|
+
//# sourceMappingURL=sendCompressedUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendCompressedUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sendCompressedUserOperation.ts"],"names":[],"mappings":";;;AA2CO,MAAM,2BAA2B,GAAG,KAAK,EAK5C,MAAqE,EACrE,IAAqD,EACxC,EAAE;IACf,MAAM,EAAE,uBAAuB,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAErE,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,qCAAqC;QAC7C,MAAM,EAAE;YACJ,uBAA8B;YAC9B,eAA0B;YAC1B,UAAqB;SACxB;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAlBY,QAAA,2BAA2B,+BAkBvC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sponsorUserOperation = void 0;
|
|
4
|
+
const deepHexlify_1 = require("../../utils/deepHexlify.js");
|
|
5
|
+
const getEntryPointVersion_1 = require("../../utils/getEntryPointVersion.js");
|
|
6
|
+
const sponsorUserOperation = async (client, args) => {
|
|
7
|
+
const response = await client.request({
|
|
8
|
+
method: "pm_sponsorUserOperation",
|
|
9
|
+
params: args.sponsorshipPolicyId
|
|
10
|
+
? [
|
|
11
|
+
(0, deepHexlify_1.deepHexlify)(args.userOperation),
|
|
12
|
+
args.entryPoint,
|
|
13
|
+
{
|
|
14
|
+
sponsorshipPolicyId: args.sponsorshipPolicyId
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
: [
|
|
18
|
+
(0, deepHexlify_1.deepHexlify)(args.userOperation),
|
|
19
|
+
args.entryPoint
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
if (args.entryPoint === getEntryPointVersion_1.ENTRYPOINT_ADDRESS_V06) {
|
|
23
|
+
const responseV06 = response;
|
|
24
|
+
return {
|
|
25
|
+
paymasterAndData: responseV06.paymasterAndData,
|
|
26
|
+
preVerificationGas: BigInt(responseV06.preVerificationGas),
|
|
27
|
+
verificationGasLimit: BigInt(responseV06.verificationGasLimit),
|
|
28
|
+
callGasLimit: BigInt(responseV06.callGasLimit)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const responseV07 = response;
|
|
32
|
+
return {
|
|
33
|
+
callGasLimit: BigInt(responseV07.callGasLimit),
|
|
34
|
+
verificationGasLimit: BigInt(responseV07.verificationGasLimit),
|
|
35
|
+
preVerificationGas: BigInt(responseV07.preVerificationGas),
|
|
36
|
+
paymaster: responseV07.paymaster,
|
|
37
|
+
paymasterVerificationGasLimit: BigInt(responseV07.paymasterVerificationGasLimit),
|
|
38
|
+
paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit),
|
|
39
|
+
paymasterData: responseV07.paymasterData
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.sponsorUserOperation = sponsorUserOperation;
|
|
43
|
+
//# sourceMappingURL=sponsorUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAaA,yDAAqD;AACrD,2EAAyE;AAiElE,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,IAAA,yBAAW,EACP,IAAI,CAAC,aAAa,CAGrB;gBACD,IAAI,CAAC,UAAU;gBACf;oBACI,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;iBAChD;aACJ;YACH,CAAC,CAAC;gBACI,IAAA,yBAAW,EACP,IAAI,CAAC,aAAa,CAGrB;gBACD,IAAI,CAAC,UAAU;aAClB;KACV,CAAC,CAAA;IAEF,IAAI,IAAI,CAAC,UAAU,KAAK,6CAAsB,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;AA/EY,QAAA,oBAAoB,wBA+EhC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSponsorshipPolicies = void 0;
|
|
4
|
+
const deepHexlify_1 = require("../../utils/deepHexlify.js");
|
|
5
|
+
const validateSponsorshipPolicies = async (client, args) => {
|
|
6
|
+
return await client.request({
|
|
7
|
+
method: "pm_validateSponsorshipPolicies",
|
|
8
|
+
params: [
|
|
9
|
+
(0, deepHexlify_1.deepHexlify)(args.userOperation),
|
|
10
|
+
args.entryPoint,
|
|
11
|
+
args.sponsorshipPolicyIds
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.validateSponsorshipPolicies = validateSponsorshipPolicies;
|
|
16
|
+
//# sourceMappingURL=validateSponsorshipPolicies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":";;;AAQA,yDAAqD;AAuD9C,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,IAAA,yBAAW,EAAC,IAAI,CAAC,aAAa,CAE7B;YACD,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,oBAAoB;SAC5B;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAxBY,QAAA,2BAA2B,+BAwBvC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSponsorshipPolicies = exports.sponsorUserOperation = exports.sendCompressedUserOperation = exports.pimlicoPaymasterActions = exports.pimlicoBundlerActions = exports.getUserOperationStatus = exports.getUserOperationGasPrice = void 0;
|
|
4
|
+
const getUserOperationGasPrice_1 = require("./pimlico/getUserOperationGasPrice.js");
|
|
5
|
+
Object.defineProperty(exports, "getUserOperationGasPrice", { enumerable: true, get: function () { return getUserOperationGasPrice_1.getUserOperationGasPrice; } });
|
|
6
|
+
const getUserOperationStatus_1 = require("./pimlico/getUserOperationStatus.js");
|
|
7
|
+
Object.defineProperty(exports, "getUserOperationStatus", { enumerable: true, get: function () { return getUserOperationStatus_1.getUserOperationStatus; } });
|
|
8
|
+
const sendCompressedUserOperation_1 = require("./pimlico/sendCompressedUserOperation.js");
|
|
9
|
+
Object.defineProperty(exports, "sendCompressedUserOperation", { enumerable: true, get: function () { return sendCompressedUserOperation_1.sendCompressedUserOperation; } });
|
|
10
|
+
const sponsorUserOperation_1 = require("./pimlico/sponsorUserOperation.js");
|
|
11
|
+
Object.defineProperty(exports, "sponsorUserOperation", { enumerable: true, get: function () { return sponsorUserOperation_1.sponsorUserOperation; } });
|
|
12
|
+
const pimlico_1 = require("../clients/decorators/pimlico.js");
|
|
13
|
+
Object.defineProperty(exports, "pimlicoBundlerActions", { enumerable: true, get: function () { return pimlico_1.pimlicoBundlerActions; } });
|
|
14
|
+
Object.defineProperty(exports, "pimlicoPaymasterActions", { enumerable: true, get: function () { return pimlico_1.pimlicoPaymasterActions; } });
|
|
15
|
+
const validateSponsorshipPolicies_1 = require("./pimlico/validateSponsorshipPolicies.js");
|
|
16
|
+
Object.defineProperty(exports, "validateSponsorshipPolicies", { enumerable: true, get: function () { return validateSponsorshipPolicies_1.validateSponsorshipPolicies; } });
|
|
17
|
+
//# sourceMappingURL=pimlico.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAAA,iFAG2C;AA6CvC,yGA9CA,mDAAwB,OA8CA;AA5C5B,6EAIyC;AAyCrC,uGA1CA,+CAAsB,OA0CA;AAxC1B,uFAG8C;AAwC1C,4GAzCA,yDAA2B,OAyCA;AAvC/B,yEAIuC;AAoCnC,qGArCA,2CAAoB,OAqCA;AA9BxB,2DAGsC;AAwBlC,sGA1BA,+BAAqB,OA0BA;AACrB,wGA1BA,iCAAuB,OA0BA;AAvB3B,uFAI8C;AAsB1C,4GAvBA,yDAA2B,OAuBA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccountNonce = void 0;
|
|
4
|
+
const actions_1 = require("viem/actions");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
6
|
+
const getAccountNonce = async (client, args) => {
|
|
7
|
+
const { sender, entryPoint, key = BigInt(0) } = args;
|
|
8
|
+
return await (0, utils_1.getAction)(client, actions_1.readContract, "readContract")({
|
|
9
|
+
address: entryPoint,
|
|
10
|
+
abi: [
|
|
11
|
+
{
|
|
12
|
+
inputs: [
|
|
13
|
+
{
|
|
14
|
+
name: "sender",
|
|
15
|
+
type: "address"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "key",
|
|
19
|
+
type: "uint192"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
name: "getNonce",
|
|
23
|
+
outputs: [
|
|
24
|
+
{
|
|
25
|
+
name: "nonce",
|
|
26
|
+
type: "uint256"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
stateMutability: "view",
|
|
30
|
+
type: "function"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
functionName: "getNonce",
|
|
34
|
+
args: [sender, key]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.getAccountNonce = getAccountNonce;
|
|
38
|
+
//# sourceMappingURL=getAccountNonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAccountNonce.js","sourceRoot":"","sources":["../../../actions/public/getAccountNonce.ts"],"names":[],"mappings":";;;AACA,0CAA2C;AAC3C,sCAAsC;AAoC/B,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,IAAA,iBAAS,EAClB,MAAM,EACN,sBAAY,EACZ,cAAc,CACjB,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;AAzCY,QAAA,eAAe,mBAyC3B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSenderAddress = exports.InvalidEntryPointError = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const actions_1 = require("viem/actions");
|
|
6
|
+
const utils_1 = require("viem/utils");
|
|
7
|
+
const GetSenderAddressHelperByteCode = "0x608060405260405161058a38038061058a83398181016040528101906100259190610341565b5f808373ffffffffffffffffffffffffffffffffffffffff16639b249f6960e01b8460405160240161005791906103ed565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516100c19190610447565b5f604051808303815f865af19150503d805f81146100fa576040519150601f19603f3d011682016040523d82523d5f602084013e6100ff565b606091505b50915091505f8261015f576004825111156101245760248201519050805f526014600cf35b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610156906104dd565b60405180910390fd5b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101919061056b565b60405180910390fd5b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101d4826101ab565b9050919050565b6101e4816101ca565b81146101ee575f80fd5b50565b5f815190506101ff816101db565b92915050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6102538261020d565b810181811067ffffffffffffffff821117156102725761027161021d565b5b80604052505050565b5f61028461019a565b9050610290828261024a565b919050565b5f67ffffffffffffffff8211156102af576102ae61021d565b5b6102b88261020d565b9050602081019050919050565b8281835e5f83830152505050565b5f6102e56102e084610295565b61027b565b90508281526020810184848401111561030157610300610209565b5b61030c8482856102c5565b509392505050565b5f82601f83011261032857610327610205565b5b81516103388482602086016102d3565b91505092915050565b5f8060408385031215610357576103566101a3565b5b5f610364858286016101f1565b925050602083015167ffffffffffffffff811115610385576103846101a7565b5b61039185828601610314565b9150509250929050565b5f81519050919050565b5f82825260208201905092915050565b5f6103bf8261039b565b6103c981856103a5565b93506103d98185602086016102c5565b6103e28161020d565b840191505092915050565b5f6020820190508181035f83015261040581846103b5565b905092915050565b5f81905092915050565b5f6104218261039b565b61042b818561040d565b935061043b8185602086016102c5565b80840191505092915050565b5f6104528284610417565b915081905092915050565b5f82825260208201905092915050565b7f67657453656e64657241646472657373206661696c656420776974686f7574205f8201527f6461746100000000000000000000000000000000000000000000000000000000602082015250565b5f6104c760248361045d565b91506104d28261046d565b604082019050919050565b5f6020820190508181035f8301526104f4816104bb565b9050919050565b7f67657453656e6465724164647265737320646964206e6f7420726576657274205f8201527f6173206578706563746564000000000000000000000000000000000000000000602082015250565b5f610555602b8361045d565b9150610560826104fb565b604082019050919050565b5f6020820190508181035f83015261058281610549565b905091905056fe";
|
|
8
|
+
const GetSenderAddressHelperAbi = [
|
|
9
|
+
{
|
|
10
|
+
inputs: [
|
|
11
|
+
{
|
|
12
|
+
internalType: "address",
|
|
13
|
+
name: "_entryPoint",
|
|
14
|
+
type: "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
internalType: "bytes",
|
|
18
|
+
name: "initCode",
|
|
19
|
+
type: "bytes"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
stateMutability: "payable",
|
|
23
|
+
type: "constructor"
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
class InvalidEntryPointError extends viem_1.BaseError {
|
|
27
|
+
constructor({ cause, entryPoint } = {}) {
|
|
28
|
+
super(`The entry point address (\`entryPoint\`${entryPoint ? ` = ${entryPoint}` : ""}) is not a valid entry point. getSenderAddress did not revert with a SenderAddressResult error.`, {
|
|
29
|
+
cause
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(this, "name", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: "InvalidEntryPointError"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.InvalidEntryPointError = InvalidEntryPointError;
|
|
40
|
+
const getSenderAddress = async (client, args) => {
|
|
41
|
+
const { initCode, entryPoint, factory, factoryData } = args;
|
|
42
|
+
if (!initCode && !factory && !factoryData) {
|
|
43
|
+
throw new Error("Either `initCode` or `factory` and `factoryData` must be provided");
|
|
44
|
+
}
|
|
45
|
+
const formattedInitCode = initCode || (0, viem_1.concat)([factory, factoryData]);
|
|
46
|
+
const { data } = await (0, utils_1.getAction)(client, actions_1.call, "call")({
|
|
47
|
+
data: (0, viem_1.encodeDeployData)({
|
|
48
|
+
abi: GetSenderAddressHelperAbi,
|
|
49
|
+
bytecode: GetSenderAddressHelperByteCode,
|
|
50
|
+
args: [entryPoint, formattedInitCode]
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
if (!data) {
|
|
54
|
+
throw new Error("Failed to get sender address");
|
|
55
|
+
}
|
|
56
|
+
return (0, viem_1.getAddress)(data);
|
|
57
|
+
};
|
|
58
|
+
exports.getSenderAddress = getSenderAddress;
|
|
59
|
+
//# sourceMappingURL=getSenderAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSenderAddress.js","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":";;;AAAA,+BAUa;AAEb,0CAAmC;AACnC,sCAAsC;AAQtC,MAAM,8BAA8B,GAChC,wxFAAwxF,CAAA;AAE5xF,MAAM,yBAAyB,GAAG;IAC9B;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,aAAa;KACtB;CACJ,CAAA;AAiBD,MAAa,sBAAuB,SAAQ,gBAAS;IAGjD,YAAY,EACR,KAAK,EACL,UAAU,KACmC,EAAE;QAC/C,KAAK,CACD,0CACI,UAAU,CAAC,CAAC,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC,CAAC,EACtC,iGAAiG,EACjG;YACI,KAAK;SACR,CACJ,CAAA;QAbI;;;;mBAAO,wBAAwB;WAAA;IAcxC,CAAC;CACJ;AAhBD,wDAgBC;AA2BM,MAAM,gBAAgB,GAAG,KAAK,EAKjC,MAAkC,EAClC,IAAkD,EAClC,EAAE;IAClB,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAA;IAE3D,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACX,mEAAmE,CACtE,CAAA;IACL,CAAC;IAED,MAAM,iBAAiB,GACnB,QAAQ,IAAI,IAAA,aAAM,EAAC,CAAC,OAAc,EAAE,WAAkB,CAAC,CAAC,CAAA;IAE5D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,iBAAS,EAC5B,MAAM,EACN,cAAI,EACJ,MAAM,CACT,CAAC;QACE,IAAI,EAAE,IAAA,uBAAgB,EAAC;YACnB,GAAG,EAAE,yBAAyB;YAC9B,QAAQ,EAAE,8BAA8B;YACxC,IAAI,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC;SACxC,CAAC;KACL,CAAC,CAAA;IAEF,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;IACnD,CAAC;IAED,OAAO,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAA;AAC3B,CAAC,CAAA;AApCY,QAAA,gBAAgB,oBAoC5B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployContract = void 0;
|
|
4
|
+
const utils_1 = require("viem/utils");
|
|
5
|
+
const utils_2 = require("../../utils/index.js");
|
|
6
|
+
const signUserOperationHashWithECDSA_1 = require("../../utils/signUserOperationHashWithECDSA.js");
|
|
7
|
+
const waitForUserOperationReceipt_1 = require("../bundler/waitForUserOperationReceipt.js");
|
|
8
|
+
const sendUserOperation_1 = require("./sendUserOperation.js");
|
|
9
|
+
async function deployContract(client, args) {
|
|
10
|
+
const { abi, args: constructorArgs, bytecode, middleware, ...request } = args;
|
|
11
|
+
const { account: account_ = client.account } = request;
|
|
12
|
+
if (!account_) {
|
|
13
|
+
throw new signUserOperationHashWithECDSA_1.AccountOrClientNotFoundError({
|
|
14
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const account = (0, utils_2.parseAccount)(account_);
|
|
18
|
+
const userOpHash = await (0, utils_1.getAction)(client, (sendUserOperation_1.sendUserOperation), "sendUserOperation")({
|
|
19
|
+
userOperation: {
|
|
20
|
+
sender: account.address,
|
|
21
|
+
maxFeePerGas: request.maxFeePerGas,
|
|
22
|
+
maxPriorityFeePerGas: request.maxPriorityFeePerGas,
|
|
23
|
+
callData: await account.encodeDeployCallData({
|
|
24
|
+
abi,
|
|
25
|
+
bytecode,
|
|
26
|
+
args: constructorArgs
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
account: account,
|
|
30
|
+
middleware
|
|
31
|
+
});
|
|
32
|
+
const userOperationReceipt = await (0, utils_1.getAction)(client, waitForUserOperationReceipt_1.waitForUserOperationReceipt, "waitForUserOperationReceipt")({
|
|
33
|
+
hash: userOpHash
|
|
34
|
+
});
|
|
35
|
+
return userOperationReceipt?.receipt.transactionHash;
|
|
36
|
+
}
|
|
37
|
+
exports.deployContract = deployContract;
|
|
38
|
+
//# sourceMappingURL=deployContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployContract.js","sourceRoot":"","sources":["../../../actions/smartAccount/deployContract.ts"],"names":[],"mappings":";;;AASA,sCAAsC;AAItC,wCAA2C;AAC3C,+FAAyF;AACzF,wFAAoF;AAEpF,2DAG4B;AA4CrB,KAAK,UAAU,cAAc,CAUhC,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,6DAA4B,CAAC;YACnC,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAKpC,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,IAAA,iBAAS,EAC9B,MAAM,EACN,CAAA,qCAA2D,CAAA,EAC3D,mBAAmB,CACtB,CAAC;QACE,aAAa,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;YAClD,QAAQ,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC;gBACzC,GAAG;gBACH,QAAQ;gBACR,IAAI,EAAE,eAAe;aACM,CAAC;SACnC;QACD,OAAO,EAAE,OAAO;QAChB,UAAU;KAC4D,CAAC,CAAA;IAE3E,MAAM,oBAAoB,GAAG,MAAM,IAAA,iBAAS,EACxC,MAAM,EACN,yDAA2B,EAC3B,6BAA6B,CAChC,CAAC;QACE,IAAI,EAAE,UAAU;KACnB,CAAC,CAAA;IAEF,OAAO,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAA;AACxD,CAAC;AAhED,wCAgEC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareUserOperationRequest = void 0;
|
|
4
|
+
const actions_1 = require("viem/actions");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
6
|
+
const utils_2 = require("../../utils/index.js");
|
|
7
|
+
const getEntryPointVersion_1 = require("../../utils/getEntryPointVersion.js");
|
|
8
|
+
const estimateUserOperationGas_1 = require("../bundler/estimateUserOperationGas.js");
|
|
9
|
+
async function prepareUserOperationRequestForEntryPointV06(client, args, stateOverrides) {
|
|
10
|
+
const { account: account_ = client.account, userOperation: partialUserOperation, middleware } = args;
|
|
11
|
+
if (!account_)
|
|
12
|
+
throw new utils_2.AccountOrClientNotFoundError();
|
|
13
|
+
const account = (0, utils_2.parseAccount)(account_);
|
|
14
|
+
const [sender, nonce, initCode, callData] = await Promise.all([
|
|
15
|
+
partialUserOperation.sender || account.address,
|
|
16
|
+
partialUserOperation.nonce || account.getNonce(),
|
|
17
|
+
partialUserOperation.initCode || account.getInitCode(),
|
|
18
|
+
partialUserOperation.callData
|
|
19
|
+
]);
|
|
20
|
+
const userOperation = {
|
|
21
|
+
sender,
|
|
22
|
+
nonce,
|
|
23
|
+
initCode,
|
|
24
|
+
callData,
|
|
25
|
+
paymasterAndData: "0x",
|
|
26
|
+
signature: partialUserOperation.signature || "0x",
|
|
27
|
+
maxFeePerGas: partialUserOperation.maxFeePerGas || BigInt(0),
|
|
28
|
+
maxPriorityFeePerGas: partialUserOperation.maxPriorityFeePerGas || BigInt(0),
|
|
29
|
+
callGasLimit: partialUserOperation.callGasLimit || BigInt(0),
|
|
30
|
+
verificationGasLimit: partialUserOperation.verificationGasLimit || BigInt(0),
|
|
31
|
+
preVerificationGas: partialUserOperation.preVerificationGas || BigInt(0)
|
|
32
|
+
};
|
|
33
|
+
if (userOperation.signature === "0x") {
|
|
34
|
+
userOperation.signature = await account.getDummySignature(userOperation);
|
|
35
|
+
}
|
|
36
|
+
if (typeof middleware === "function") {
|
|
37
|
+
return middleware({
|
|
38
|
+
userOperation,
|
|
39
|
+
entryPoint: account.entryPoint
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (middleware && typeof middleware !== "function" && middleware.gasPrice) {
|
|
43
|
+
const gasPrice = await middleware.gasPrice();
|
|
44
|
+
userOperation.maxFeePerGas = gasPrice.maxFeePerGas;
|
|
45
|
+
userOperation.maxPriorityFeePerGas = gasPrice.maxPriorityFeePerGas;
|
|
46
|
+
}
|
|
47
|
+
if (!userOperation.maxFeePerGas || !userOperation.maxPriorityFeePerGas) {
|
|
48
|
+
const estimateGas = await (0, actions_1.estimateFeesPerGas)(account.client);
|
|
49
|
+
userOperation.maxFeePerGas =
|
|
50
|
+
userOperation.maxFeePerGas || estimateGas.maxFeePerGas;
|
|
51
|
+
userOperation.maxPriorityFeePerGas =
|
|
52
|
+
userOperation.maxPriorityFeePerGas ||
|
|
53
|
+
estimateGas.maxPriorityFeePerGas;
|
|
54
|
+
}
|
|
55
|
+
if (middleware &&
|
|
56
|
+
typeof middleware !== "function" &&
|
|
57
|
+
middleware.sponsorUserOperation) {
|
|
58
|
+
const sponsorUserOperationData = (await middleware.sponsorUserOperation({
|
|
59
|
+
userOperation,
|
|
60
|
+
entryPoint: account.entryPoint
|
|
61
|
+
}));
|
|
62
|
+
userOperation.callGasLimit = sponsorUserOperationData.callGasLimit;
|
|
63
|
+
userOperation.verificationGasLimit =
|
|
64
|
+
sponsorUserOperationData.verificationGasLimit;
|
|
65
|
+
userOperation.preVerificationGas =
|
|
66
|
+
sponsorUserOperationData.preVerificationGas;
|
|
67
|
+
userOperation.paymasterAndData =
|
|
68
|
+
sponsorUserOperationData.paymasterAndData;
|
|
69
|
+
userOperation.maxFeePerGas =
|
|
70
|
+
sponsorUserOperationData.maxFeePerGas || userOperation.maxFeePerGas;
|
|
71
|
+
userOperation.maxPriorityFeePerGas =
|
|
72
|
+
sponsorUserOperationData.maxPriorityFeePerGas ||
|
|
73
|
+
userOperation.maxPriorityFeePerGas;
|
|
74
|
+
return userOperation;
|
|
75
|
+
}
|
|
76
|
+
if (!userOperation.callGasLimit ||
|
|
77
|
+
!userOperation.verificationGasLimit ||
|
|
78
|
+
!userOperation.preVerificationGas) {
|
|
79
|
+
const gasParameters = await (0, utils_1.getAction)(client, estimateUserOperationGas_1.estimateUserOperationGas, "estimateUserOperationGas")({
|
|
80
|
+
userOperation,
|
|
81
|
+
entryPoint: account.entryPoint
|
|
82
|
+
}, stateOverrides);
|
|
83
|
+
userOperation.callGasLimit |= gasParameters.callGasLimit;
|
|
84
|
+
userOperation.verificationGasLimit =
|
|
85
|
+
userOperation.verificationGasLimit ||
|
|
86
|
+
gasParameters.verificationGasLimit;
|
|
87
|
+
userOperation.preVerificationGas =
|
|
88
|
+
userOperation.preVerificationGas || gasParameters.preVerificationGas;
|
|
89
|
+
}
|
|
90
|
+
return userOperation;
|
|
91
|
+
}
|
|
92
|
+
async function prepareUserOperationRequestEntryPointV07(client, args, stateOverrides) {
|
|
93
|
+
const { account: account_ = client.account, userOperation: partialUserOperation, middleware } = args;
|
|
94
|
+
if (!account_)
|
|
95
|
+
throw new utils_2.AccountOrClientNotFoundError();
|
|
96
|
+
const account = (0, utils_2.parseAccount)(account_);
|
|
97
|
+
const [sender, nonce, factory, factoryData, callData] = await Promise.all([
|
|
98
|
+
partialUserOperation.sender || account.address,
|
|
99
|
+
partialUserOperation.nonce || account.getNonce(),
|
|
100
|
+
partialUserOperation.factory || account.getFactory(),
|
|
101
|
+
partialUserOperation.factoryData || account.getFactoryData(),
|
|
102
|
+
partialUserOperation.callData
|
|
103
|
+
]);
|
|
104
|
+
const userOperation = {
|
|
105
|
+
sender,
|
|
106
|
+
nonce,
|
|
107
|
+
factory: factory,
|
|
108
|
+
factoryData: factoryData,
|
|
109
|
+
callData,
|
|
110
|
+
callGasLimit: partialUserOperation.callGasLimit || BigInt(0),
|
|
111
|
+
verificationGasLimit: partialUserOperation.verificationGasLimit || BigInt(0),
|
|
112
|
+
preVerificationGas: partialUserOperation.preVerificationGas || BigInt(0),
|
|
113
|
+
maxFeePerGas: partialUserOperation.maxFeePerGas || BigInt(0),
|
|
114
|
+
maxPriorityFeePerGas: partialUserOperation.maxPriorityFeePerGas || BigInt(0),
|
|
115
|
+
signature: partialUserOperation.signature || "0x"
|
|
116
|
+
};
|
|
117
|
+
if (userOperation.signature === "0x") {
|
|
118
|
+
userOperation.signature = await account.getDummySignature(userOperation);
|
|
119
|
+
}
|
|
120
|
+
if (typeof middleware === "function") {
|
|
121
|
+
return middleware({
|
|
122
|
+
userOperation,
|
|
123
|
+
entryPoint: account.entryPoint
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (middleware && typeof middleware !== "function" && middleware.gasPrice) {
|
|
127
|
+
const gasPrice = await middleware.gasPrice();
|
|
128
|
+
userOperation.maxFeePerGas = gasPrice.maxFeePerGas;
|
|
129
|
+
userOperation.maxPriorityFeePerGas = gasPrice.maxPriorityFeePerGas;
|
|
130
|
+
}
|
|
131
|
+
if (!userOperation.maxFeePerGas || !userOperation.maxPriorityFeePerGas) {
|
|
132
|
+
const estimateGas = await (0, actions_1.estimateFeesPerGas)(account.client);
|
|
133
|
+
userOperation.maxFeePerGas =
|
|
134
|
+
userOperation.maxFeePerGas || estimateGas.maxFeePerGas;
|
|
135
|
+
userOperation.maxPriorityFeePerGas =
|
|
136
|
+
userOperation.maxPriorityFeePerGas ||
|
|
137
|
+
estimateGas.maxPriorityFeePerGas;
|
|
138
|
+
}
|
|
139
|
+
if (middleware &&
|
|
140
|
+
typeof middleware !== "function" &&
|
|
141
|
+
middleware.sponsorUserOperation) {
|
|
142
|
+
const sponsorUserOperationData = (await middleware.sponsorUserOperation({
|
|
143
|
+
userOperation,
|
|
144
|
+
entryPoint: account.entryPoint
|
|
145
|
+
}));
|
|
146
|
+
userOperation.callGasLimit = sponsorUserOperationData.callGasLimit;
|
|
147
|
+
userOperation.verificationGasLimit =
|
|
148
|
+
sponsorUserOperationData.verificationGasLimit;
|
|
149
|
+
userOperation.preVerificationGas =
|
|
150
|
+
sponsorUserOperationData.preVerificationGas;
|
|
151
|
+
userOperation.paymaster = sponsorUserOperationData.paymaster;
|
|
152
|
+
userOperation.paymasterVerificationGasLimit =
|
|
153
|
+
sponsorUserOperationData.paymasterVerificationGasLimit;
|
|
154
|
+
userOperation.paymasterPostOpGasLimit =
|
|
155
|
+
sponsorUserOperationData.paymasterPostOpGasLimit;
|
|
156
|
+
userOperation.paymasterData = sponsorUserOperationData.paymasterData;
|
|
157
|
+
userOperation.maxFeePerGas =
|
|
158
|
+
sponsorUserOperationData.maxFeePerGas || userOperation.maxFeePerGas;
|
|
159
|
+
userOperation.maxPriorityFeePerGas =
|
|
160
|
+
sponsorUserOperationData.maxPriorityFeePerGas ||
|
|
161
|
+
userOperation.maxPriorityFeePerGas;
|
|
162
|
+
return userOperation;
|
|
163
|
+
}
|
|
164
|
+
if (!userOperation.callGasLimit ||
|
|
165
|
+
!userOperation.verificationGasLimit ||
|
|
166
|
+
!userOperation.preVerificationGas) {
|
|
167
|
+
const gasParameters = await (0, utils_1.getAction)(client, (estimateUserOperationGas_1.estimateUserOperationGas), "estimateUserOperationGas")({
|
|
168
|
+
userOperation,
|
|
169
|
+
entryPoint: account.entryPoint
|
|
170
|
+
}, stateOverrides);
|
|
171
|
+
userOperation.callGasLimit |= gasParameters.callGasLimit;
|
|
172
|
+
userOperation.verificationGasLimit =
|
|
173
|
+
userOperation.verificationGasLimit ||
|
|
174
|
+
gasParameters.verificationGasLimit;
|
|
175
|
+
userOperation.preVerificationGas =
|
|
176
|
+
userOperation.preVerificationGas || gasParameters.preVerificationGas;
|
|
177
|
+
userOperation.paymasterPostOpGasLimit =
|
|
178
|
+
userOperation.paymasterPostOpGasLimit ||
|
|
179
|
+
gasParameters.paymasterPostOpGasLimit;
|
|
180
|
+
}
|
|
181
|
+
return userOperation;
|
|
182
|
+
}
|
|
183
|
+
async function prepareUserOperationRequest(client, args, stateOverrides) {
|
|
184
|
+
const { account: account_ = client.account } = args;
|
|
185
|
+
if (!account_)
|
|
186
|
+
throw new utils_2.AccountOrClientNotFoundError();
|
|
187
|
+
const account = (0, utils_2.parseAccount)(account_);
|
|
188
|
+
const entryPointVersion = (0, getEntryPointVersion_1.getEntryPointVersion)(account.entryPoint);
|
|
189
|
+
if (entryPointVersion === "v0.6") {
|
|
190
|
+
return prepareUserOperationRequestForEntryPointV06(client, args, stateOverrides);
|
|
191
|
+
}
|
|
192
|
+
return prepareUserOperationRequestEntryPointV07(client, args, stateOverrides);
|
|
193
|
+
}
|
|
194
|
+
exports.prepareUserOperationRequest = prepareUserOperationRequest;
|
|
195
|
+
//# sourceMappingURL=prepareUserOperationRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareUserOperationRequest.js","sourceRoot":"","sources":["../../../actions/smartAccount/prepareUserOperationRequest.ts"],"names":[],"mappings":";;;AACA,0CAAiD;AACjD,sCAAsC;AAgBtC,wCAAyE;AACzE,2EAAuE;AACvE,kFAA8E;AAoG9E,KAAK,UAAU,2CAA2C,CAUtD,MAA4C,EAC5C,IAOC,EACD,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,oCAA4B,EAAE,CAAA;IAEvD,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAKpC,CAAA;IAED,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,EAA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AAEM,KAAK,UAAU,2BAA2B,CAU7C,MAA4C,EAC5C,IAOC,EACD,cAA+B;IAE/B,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAA;IACnD,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,oCAA4B,EAAE,CAAA;IAEvD,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAKpC,CAAA;IAED,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,EAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IAElE,IAAI,iBAAiB,KAAK,MAAM,EAAE,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;AA9CD,kEA8CC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendTransaction = void 0;
|
|
4
|
+
const utils_1 = require("viem/utils");
|
|
5
|
+
const utils_2 = require("../../utils/index.js");
|
|
6
|
+
const waitForUserOperationReceipt_1 = require("../bundler/waitForUserOperationReceipt.js");
|
|
7
|
+
const sendUserOperation_1 = require("./sendUserOperation.js");
|
|
8
|
+
async function sendTransaction(client, args) {
|
|
9
|
+
const { account: account_ = client.account, data, maxFeePerGas, maxPriorityFeePerGas, to, value, nonce, middleware } = args;
|
|
10
|
+
if (!account_) {
|
|
11
|
+
throw new utils_2.AccountOrClientNotFoundError({
|
|
12
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const account = (0, utils_2.parseAccount)(account_);
|
|
16
|
+
if (!to)
|
|
17
|
+
throw new Error("Missing to address");
|
|
18
|
+
if (account.type !== "local") {
|
|
19
|
+
throw new Error("RPC account type not supported");
|
|
20
|
+
}
|
|
21
|
+
const callData = await account.encodeCallData({
|
|
22
|
+
to,
|
|
23
|
+
value: value || BigInt(0),
|
|
24
|
+
data: data || "0x"
|
|
25
|
+
});
|
|
26
|
+
const userOpHash = await (0, utils_1.getAction)(client, (sendUserOperation_1.sendUserOperation), "sendUserOperation")({
|
|
27
|
+
userOperation: {
|
|
28
|
+
sender: account.address,
|
|
29
|
+
maxFeePerGas: maxFeePerGas,
|
|
30
|
+
maxPriorityFeePerGas: maxPriorityFeePerGas,
|
|
31
|
+
callData: callData,
|
|
32
|
+
nonce: nonce ? BigInt(nonce) : undefined
|
|
33
|
+
},
|
|
34
|
+
account,
|
|
35
|
+
middleware
|
|
36
|
+
});
|
|
37
|
+
const userOperationReceipt = await (0, utils_1.getAction)(client, waitForUserOperationReceipt_1.waitForUserOperationReceipt, "waitForUserOperationReceipt")({
|
|
38
|
+
hash: userOpHash
|
|
39
|
+
});
|
|
40
|
+
return userOperationReceipt?.receipt.transactionHash;
|
|
41
|
+
}
|
|
42
|
+
exports.sendTransaction = sendTransaction;
|
|
43
|
+
//# sourceMappingURL=sendTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":";;;AAOA,sCAAsC;AAItC,wCAAyE;AACzE,wFAAoF;AAEpF,2DAAuD;AA6DhD,KAAK,UAAU,eAAe,CASjC,MAA2C,EAC3C,IAQC;IAED,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,EAAE,EACF,KAAK,EACL,KAAK,EACL,UAAU,EACb,GAAG,IAAI,CAAA;IAER,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oCAA4B,CAAC;YACnC,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAKpC,CAAA;IAED,IAAI,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAE9C,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACrD,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC;QAC1C,EAAE;QACF,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;QACzB,IAAI,EAAE,IAAI,IAAI,IAAI;KACrB,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,MAAM,IAAA,iBAAS,EAC9B,MAAM,EACN,CAAA,qCAKC,CAAA,EACD,mBAAmB,CACtB,CAAC;QACE,aAAa,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,YAAY,EAAE,YAAY;YAC1B,oBAAoB,EAAE,oBAAoB;YAC1C,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SAC3C;QACD,OAAO;QACP,UAAU;KACb,CAAC,CAAA;IAEF,MAAM,oBAAoB,GAAG,MAAM,IAAA,iBAAS,EACxC,MAAM,EACN,yDAA2B,EAC3B,6BAA6B,CAChC,CAAC;QACE,IAAI,EAAE,UAAU;KACnB,CAAC,CAAA;IAEF,OAAO,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAA;AACxD,CAAC;AAtFD,0CAsFC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendTransactions = void 0;
|
|
4
|
+
const utils_1 = require("viem/utils");
|
|
5
|
+
const utils_2 = require("../../utils/index.js");
|
|
6
|
+
const waitForUserOperationReceipt_1 = require("../bundler/waitForUserOperationReceipt.js");
|
|
7
|
+
const sendUserOperation_1 = require("./sendUserOperation.js");
|
|
8
|
+
async function sendTransactions(client, args) {
|
|
9
|
+
const { account: account_ = client.account, transactions, middleware, maxFeePerGas, maxPriorityFeePerGas, nonce } = args;
|
|
10
|
+
if (!account_) {
|
|
11
|
+
throw new utils_2.AccountOrClientNotFoundError({
|
|
12
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const account = (0, utils_2.parseAccount)(account_);
|
|
16
|
+
if (account.type !== "local") {
|
|
17
|
+
throw new Error("RPC account type not supported");
|
|
18
|
+
}
|
|
19
|
+
const callData = await account.encodeCallData(transactions.map(({ to, value, data }) => {
|
|
20
|
+
if (!to)
|
|
21
|
+
throw new Error("Missing to address");
|
|
22
|
+
return {
|
|
23
|
+
to,
|
|
24
|
+
value: value || BigInt(0),
|
|
25
|
+
data: data || "0x"
|
|
26
|
+
};
|
|
27
|
+
}));
|
|
28
|
+
const userOpHash = await (0, utils_1.getAction)(client, (sendUserOperation_1.sendUserOperation), "sendUserOperation")({
|
|
29
|
+
userOperation: {
|
|
30
|
+
sender: account.address,
|
|
31
|
+
maxFeePerGas: maxFeePerGas,
|
|
32
|
+
maxPriorityFeePerGas: maxPriorityFeePerGas,
|
|
33
|
+
callData: callData,
|
|
34
|
+
nonce: nonce
|
|
35
|
+
},
|
|
36
|
+
account: account,
|
|
37
|
+
middleware
|
|
38
|
+
});
|
|
39
|
+
const userOperationReceipt = await (0, utils_1.getAction)(client, waitForUserOperationReceipt_1.waitForUserOperationReceipt, "waitForUserOperationReceipt")({
|
|
40
|
+
hash: userOpHash
|
|
41
|
+
});
|
|
42
|
+
return userOperationReceipt?.receipt.transactionHash;
|
|
43
|
+
}
|
|
44
|
+
exports.sendTransactions = sendTransactions;
|
|
45
|
+
//# sourceMappingURL=sendTransactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendTransactions.js","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransactions.ts"],"names":[],"mappings":";;;AASA,sCAAsC;AAItC,wCAAyE;AACzE,wFAAoF;AAEpF,2DAAuD;AAmEhD,KAAK,UAAU,gBAAgB,CAQlC,MAA2C,EAC3C,IAOC;IAED,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACR,GAAG,IAAI,CAAA;IAER,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oCAA4B,CAAC;YACnC,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAKpC,CAAA;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACrD,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,cAAc,CACzC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QACrC,IAAI,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAC9C,OAAO;YACH,EAAE;YACF,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;YACzB,IAAI,EAAE,IAAI,IAAI,IAAI;SACrB,CAAA;IACL,CAAC,CAAC,CACL,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,IAAA,iBAAS,EAC9B,MAAM,EACN,CAAA,qCAKC,CAAA,EACD,mBAAmB,CACtB,CAAC;QACE,aAAa,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,YAAY,EAAE,YAAY;YAC1B,oBAAoB,EAAE,oBAAoB;YAC1C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