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 @@
|
|
|
1
|
+
{"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../actions/smartAccount/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,SAAS,EAKjB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AACH,wBAAsB,aAAa,CAC/B,UAAU,SAAS,UAAU,EAC7B,KAAK,CAAC,UAAU,SAAS,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAC/D,YAAY,SAAS,MAAM,EAC3B,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SACF,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GACpD,SAAS,GACT,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GACpD,SAAS,EAEf,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,EACI,OAAO,EAAE,QAAyB,EAClC,MAAM,EACN,OAAO,EACP,WAAW,EACX,KAAK,EAAE,MAAM,EAChB,EAAE,uBAAuB,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,GAC/D,OAAO,CAAC,uBAAuB,CAAC,CAgClC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type Abi, type Chain, type Client, type ContractFunctionArgs, type ContractFunctionName, type Hash, type Transport, type WriteContractParameters } from "viem";
|
|
2
|
+
import type { SmartAccount } from "../../accounts/types";
|
|
3
|
+
import type { EntryPoint } from "../../types/entrypoint";
|
|
4
|
+
import type { Middleware } from "./prepareUserOperationRequest";
|
|
5
|
+
/**
|
|
6
|
+
* Executes a write function on a contract.
|
|
7
|
+
* This function also allows you to sponsor this transaction if sender is a smartAccount
|
|
8
|
+
*
|
|
9
|
+
* - Docs: https://viem.sh/docs/contract/writeContract.html
|
|
10
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
|
|
11
|
+
*
|
|
12
|
+
* A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state.
|
|
13
|
+
*
|
|
14
|
+
* Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
|
|
15
|
+
*
|
|
16
|
+
* __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.__
|
|
17
|
+
*
|
|
18
|
+
* @param client - Client to use
|
|
19
|
+
* @param parameters - {@link WriteContractParameters}
|
|
20
|
+
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { createWalletClient, custom, parseAbi } from 'viem'
|
|
24
|
+
* import { mainnet } from 'viem/chains'
|
|
25
|
+
* import { writeContract } from 'viem/contract'
|
|
26
|
+
*
|
|
27
|
+
* const client = createWalletClient({
|
|
28
|
+
* chain: mainnet,
|
|
29
|
+
* transport: custom(window.ethereum),
|
|
30
|
+
* })
|
|
31
|
+
* const hash = await writeContract(client, {
|
|
32
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
|
33
|
+
* abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
|
|
34
|
+
* functionName: 'mint',
|
|
35
|
+
* args: [69420],
|
|
36
|
+
* })
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // With Validation
|
|
40
|
+
* import { createWalletClient, http, parseAbi } from 'viem'
|
|
41
|
+
* import { mainnet } from 'viem/chains'
|
|
42
|
+
* import { simulateContract, writeContract } from 'viem/contract'
|
|
43
|
+
*
|
|
44
|
+
* const client = createWalletClient({
|
|
45
|
+
* chain: mainnet,
|
|
46
|
+
* transport: http(),
|
|
47
|
+
* })
|
|
48
|
+
* const { request } = await simulateContract(client, {
|
|
49
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
|
50
|
+
* abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),
|
|
51
|
+
* functionName: 'mint',
|
|
52
|
+
* args: [69420],
|
|
53
|
+
* }
|
|
54
|
+
* const hash = await writeContract(client, request)
|
|
55
|
+
*/
|
|
56
|
+
export type WriteContractWithPaymasterParameters<entryPoint extends EntryPoint, TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartAccount<entryPoint, string, TTransport, TChain> | undefined = SmartAccount<entryPoint, string, TTransport, TChain> | undefined, TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName<TAbi, "nonpayable" | "payable">, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName>, TChainOverride extends Chain | undefined = undefined> = WriteContractParameters<TAbi, TFunctionName, TArgs, TChain, TAccount, TChainOverride> & Middleware<entryPoint>;
|
|
57
|
+
export declare function writeContract<entryPoint extends EntryPoint, TTransport extends Transport, TChain extends Chain | undefined, TAccount extends SmartAccount<entryPoint, string, TTransport, TChain> | undefined, const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName<TAbi, "nonpayable" | "payable">, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName>, TChainOverride extends Chain | undefined = undefined>(client: Client<Transport, TChain, TAccount>, { abi, address, args, dataSuffix, functionName, ...request }: WriteContractWithPaymasterParameters<entryPoint, TTransport, TChain, TAccount, TAbi, TFunctionName, TArgs, TChainOverride>): Promise<Hash>;
|
|
58
|
+
//# sourceMappingURL=writeContract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeContract.d.ts","sourceRoot":"","sources":["../../../actions/smartAccount/writeContract.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,GAAG,EACR,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAEzB,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,uBAAuB,EAE/B,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,MAAM,oCAAoC,CAC5C,UAAU,SAAS,UAAU,EAC7B,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SACF,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GACpD,SAAS,GACT,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GACpD,SAAS,EACf,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,GAAG,SAAS,OAAO,EAAE,EAChE,aAAa,SAAS,oBAAoB,CACtC,IAAI,EACJ,YAAY,GAAG,SAAS,CAC3B,GAAG,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC,EACxD,KAAK,SAAS,oBAAoB,CAC9B,IAAI,EACJ,YAAY,GAAG,SAAS,EACxB,aAAa,CAChB,GAAG,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,EAAE,aAAa,CAAC,EACvE,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,IACpD,uBAAuB,CACvB,IAAI,EACJ,aAAa,EACb,KAAK,EACL,MAAM,EACN,QAAQ,EACR,cAAc,CACjB,GACG,UAAU,CAAC,UAAU,CAAC,CAAA;AAE1B,wBAAsB,aAAa,CAC/B,UAAU,SAAS,UAAU,EAC7B,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SACF,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GACpD,SAAS,EACf,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,aAAa,SAAS,oBAAoB,CACtC,IAAI,EACJ,YAAY,GAAG,SAAS,CAC3B,GAAG,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC,EACxD,KAAK,SAAS,oBAAoB,CAC9B,IAAI,EACJ,YAAY,GAAG,SAAS,EACxB,aAAa,CAChB,GAAG,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,EAAE,aAAa,CAAC,EACvE,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,EAEpD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,EACI,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,GAAG,OAAO,EACb,EAAE,oCAAoC,CACnC,UAAU,EACV,UAAU,EACV,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,KAAK,EACL,cAAc,CACjB,GACF,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DeployContractParametersWithPaymaster, deployContract } from "./smartAccount/deployContract";
|
|
2
|
+
import { type Middleware, type PrepareUserOperationRequestParameters, type PrepareUserOperationRequestReturnType, type SponsorUserOperationReturnType, prepareUserOperationRequest } from "./smartAccount/prepareUserOperationRequest";
|
|
3
|
+
import { type SendTransactionWithPaymasterParameters, sendTransaction } from "./smartAccount/sendTransaction";
|
|
4
|
+
import { type SendUserOperationParameters, sendUserOperation } from "./smartAccount/sendUserOperation";
|
|
5
|
+
import { signMessage } from "./smartAccount/signMessage";
|
|
6
|
+
import { signTypedData } from "./smartAccount/signTypedData";
|
|
7
|
+
import { type SendTransactionsWithPaymasterParameters, sendTransactions } from "./smartAccount/sendTransactions";
|
|
8
|
+
import { type WriteContractWithPaymasterParameters, writeContract } from "./smartAccount/writeContract";
|
|
9
|
+
export { deployContract, type DeployContractParametersWithPaymaster, prepareUserOperationRequest, type PrepareUserOperationRequestParameters, type PrepareUserOperationRequestReturnType, type SponsorUserOperationReturnType, sendTransaction, sendUserOperation, type SendUserOperationParameters, signMessage, signTypedData, type SendTransactionWithPaymasterParameters, type Middleware, sendTransactions, type SendTransactionsWithPaymasterParameters, type WriteContractWithPaymasterParameters, writeContract };
|
|
10
|
+
//# sourceMappingURL=smartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../actions/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,qCAAqC,EAC1C,cAAc,EACjB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACH,KAAK,UAAU,EACf,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,2BAA2B,EAC9B,MAAM,4CAA4C,CAAA;AAEnD,OAAO,EACH,KAAK,sCAAsC,EAC3C,eAAe,EAClB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EACH,KAAK,2BAA2B,EAChC,iBAAiB,EACpB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAE5D,OAAO,EACH,KAAK,uCAAuC,EAC5C,gBAAgB,EACnB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACH,KAAK,oCAAoC,EACzC,aAAa,EAChB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EACH,cAAc,EACd,KAAK,qCAAqC,EAC1C,2BAA2B,EAC3B,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,eAAe,EACf,iBAAiB,EACjB,KAAK,2BAA2B,EAChC,WAAW,EACX,aAAa,EACb,KAAK,sCAAsC,EAC3C,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,uCAAuC,EAC5C,KAAK,oCAAoC,EACzC,aAAa,EAChB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { StackupPaymasterClient } from "../../clients/stackup";
|
|
3
|
+
import type { EntryPoint } from "../../types";
|
|
4
|
+
export type AccountsParameters<entryPoint extends EntryPoint> = {
|
|
5
|
+
entryPoint: entryPoint;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Returns all the Paymaster addresses associated with an EntryPoint that’s owned by this service.
|
|
9
|
+
*
|
|
10
|
+
* https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_accounts
|
|
11
|
+
*
|
|
12
|
+
* @param args {@link AccountsParameters} entryPoint for which you want to get list of supported paymasters.
|
|
13
|
+
* @returns paymaster addresses
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { createClient } from "viem"
|
|
17
|
+
* import { accounts } from "permissionless/actions/stackup"
|
|
18
|
+
*
|
|
19
|
+
* const bundlerClient = createClient({
|
|
20
|
+
* chain: goerli,
|
|
21
|
+
* transport: http("https://api.stackup.sh/v2/paymaster/YOUR_API_KEY_HERE")
|
|
22
|
+
* })
|
|
23
|
+
*
|
|
24
|
+
* await accounts(bundlerClient, {
|
|
25
|
+
* entryPoint: entryPoint
|
|
26
|
+
* }})
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export declare const accounts: <entryPoint extends EntryPoint>(client: StackupPaymasterClient<entryPoint>, { entryPoint: entryPointAddress }: AccountsParameters<entryPoint>) => Promise<Address[]>;
|
|
30
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../actions/stackup/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,MAAM,kBAAkB,CAAC,UAAU,SAAS,UAAU,IAAI;IAC5D,UAAU,EAAE,UAAU,CAAA;CACzB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,QAAQ,0CACT,uBAAuB,UAAU,CAAC,qCACP,mBAAmB,UAAU,CAAC,KAClE,QAAQ,OAAO,EAAE,CAOnB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PartialBy } from "viem/types/utils";
|
|
2
|
+
import type { StackupPaymasterClient } from "../../clients/stackup";
|
|
3
|
+
import type { ENTRYPOINT_ADDRESS_V06_TYPE, EntryPoint } from "../../types/entrypoint";
|
|
4
|
+
import type { StackupPaymasterContext } from "../../types/stackup";
|
|
5
|
+
import type { UserOperation } from "../../types/userOperation";
|
|
6
|
+
export type SponsorUserOperationParameters<entryPoint extends EntryPoint> = {
|
|
7
|
+
userOperation: entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE ? PartialBy<UserOperation<"v0.6">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit"> : PartialBy<UserOperation<"v0.7">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit">;
|
|
8
|
+
entryPoint: entryPoint;
|
|
9
|
+
context: StackupPaymasterContext;
|
|
10
|
+
};
|
|
11
|
+
export type SponsorUserOperationReturnType<entryPoint extends EntryPoint> = entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE ? Pick<UserOperation<"v0.6">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymasterAndData"> : Pick<UserOperation<"v0.7">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymaster" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterData">;
|
|
12
|
+
/**
|
|
13
|
+
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
14
|
+
*
|
|
15
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/stackup-paymaster-actions/sponsorUserOperation
|
|
16
|
+
*
|
|
17
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
18
|
+
* @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
19
|
+
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { createClient } from "viem"
|
|
24
|
+
* import { sponsorUserOperation } from "permissionless/actions/stackup"
|
|
25
|
+
*
|
|
26
|
+
* const bundlerClient = createClient({
|
|
27
|
+
* chain: goerli,
|
|
28
|
+
* transport: http("https://api.stackup.sh/v2/paymaster/YOUR_API_KEY_HERE")
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* await sponsorUserOperation(bundlerClient, {
|
|
32
|
+
* userOperation: userOperationWithDummySignature,
|
|
33
|
+
* entryPoint: entryPoint
|
|
34
|
+
* }})
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare const sponsorUserOperation: <entryPoint extends EntryPoint>(client: StackupPaymasterClient<entryPoint>, args: SponsorUserOperationParameters<entryPoint>) => Promise<SponsorUserOperationReturnType<entryPoint>>;
|
|
38
|
+
//# sourceMappingURL=sponsorUserOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/stackup/sponsorUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EACR,2BAA2B,EAC3B,UAAU,EACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAI9D,MAAM,MAAM,8BAA8B,CAAC,UAAU,SAAS,UAAU,IAAI;IACxE,aAAa,EAAE,UAAU,SAAS,2BAA2B,GACvD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CACjE,GACD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,+BAA+B,GAC/B,yBAAyB,CAC9B,CAAA;IACP,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,uBAAuB,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,8BAA8B,CAAC,UAAU,SAAS,UAAU,IACpE,UAAU,SAAS,2BAA2B,GACxC,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,kBAAkB,CACvB,GACD,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,WAAW,GACX,+BAA+B,GAC/B,yBAAyB,GACzB,eAAe,CACpB,CAAA;AAEX;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,0CACrB,uBAAuB,UAAU,CAAC,QACpC,+BAA+B,UAAU,CAAC,KACjD,QAAQ,+BAA+B,UAAU,CAAC,CA+CpD,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StackupPaymasterClientActions } from "../clients/decorators/stackup";
|
|
2
|
+
import { stackupPaymasterActions } from "../clients/decorators/stackup";
|
|
3
|
+
import { type AccountsParameters, accounts } from "./stackup/accounts";
|
|
4
|
+
import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType, sponsorUserOperation } from "./stackup/sponsorUserOperation";
|
|
5
|
+
export type { SponsorUserOperationParameters, SponsorUserOperationReturnType, AccountsParameters, StackupPaymasterClientActions };
|
|
6
|
+
export { sponsorUserOperation, accounts, stackupPaymasterActions };
|
|
7
|
+
//# sourceMappingURL=stackup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../actions/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,KAAK,kBAAkB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,oBAAoB,EACvB,MAAM,gCAAgC,CAAA;AAEvC,YAAY,EACR,8BAA8B,EAC9B,8BAA8B,EAC9B,kBAAkB,EAClB,6BAA6B,EAChC,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Account, Chain, Client, PublicClientConfig, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../types/bundler";
|
|
3
|
+
import type { EntryPoint } from "../types/entrypoint";
|
|
4
|
+
import { type BundlerActions } from "./decorators/bundler";
|
|
5
|
+
export type BundlerClient<entryPoint extends EntryPoint, TChain extends Chain | undefined = Chain | undefined> = Client<Transport, TChain, Account | undefined, BundlerRpcSchema<entryPoint>, BundlerActions<entryPoint>>;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
8
|
+
*
|
|
9
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/bundlerClient
|
|
10
|
+
*
|
|
11
|
+
* A Bundler Client is an interface to "erc 4337" [JSON-RPC API](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace) methods such as sending user operation, estimating gas for a user operation, get user operation receipt, etc through Bundler Actions.
|
|
12
|
+
*
|
|
13
|
+
* @param config - {@link PublicClientConfig}
|
|
14
|
+
* @returns A Bundler Client. {@link BundlerClient}
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* import { createPublicClient, http } from 'viem'
|
|
18
|
+
* import { mainnet } from 'viem/chains'
|
|
19
|
+
*
|
|
20
|
+
* const bundlerClient = createBundlerClient({
|
|
21
|
+
* chain: mainnet,
|
|
22
|
+
* transport: http(BUNDLER_URL),
|
|
23
|
+
* })
|
|
24
|
+
*/
|
|
25
|
+
export declare const createBundlerClient: <entryPoint extends EntryPoint, transport extends Transport = Transport, chain extends Chain | undefined = undefined>(parameters: PublicClientConfig<transport, chain> & {
|
|
26
|
+
entryPoint: entryPoint;
|
|
27
|
+
}) => BundlerClient<entryPoint>;
|
|
28
|
+
//# sourceMappingURL=createBundlerClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBundlerClient.d.ts","sourceRoot":"","sources":["../../clients/createBundlerClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,SAAS,EACZ,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,sBAAsB,CAAA;AAE1E,MAAM,MAAM,aAAa,CACrB,UAAU,SAAS,UAAU,EAC7B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IACpD,MAAM,CACN,SAAS,EACT,MAAM,EACN,OAAO,GAAG,SAAS,EACnB,gBAAgB,CAAC,UAAU,CAAC,EAC5B,cAAc,CAAC,UAAU,CAAC,CAC7B,CAAA;AACD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,oIAKhB,mBAAmB,SAAS,EAAE,KAAK,CAAC,GAAG;IAC/C,YAAY,UAAU,CAAA;CACzB,KACF,cAAc,UAAU,CAS1B,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Chain, Client, ClientConfig, Transport } from "viem";
|
|
2
|
+
import type { SmartAccount } from "../accounts/types";
|
|
3
|
+
import type { Middleware } from "../actions/smartAccount/prepareUserOperationRequest";
|
|
4
|
+
import type { Prettify } from "../types";
|
|
5
|
+
import type { BundlerRpcSchema } from "../types/bundler";
|
|
6
|
+
import type { EntryPoint } from "../types/entrypoint";
|
|
7
|
+
import { type SmartAccountActions } from "./decorators/smartAccount";
|
|
8
|
+
/**
|
|
9
|
+
* TODO:
|
|
10
|
+
* - Add docs
|
|
11
|
+
* - Fix typing, 'accounts' is required to signMessage, signTypedData, signTransaction, but not needed here, since account is embedded in the client
|
|
12
|
+
*/
|
|
13
|
+
export type SmartAccountClient<entryPoint extends EntryPoint, transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount<entryPoint, string, transport, chain> | undefined = SmartAccount<entryPoint, string, transport, chain> | undefined> = Prettify<Client<transport, chain, account, BundlerRpcSchema<entryPoint>, SmartAccountActions<entryPoint, transport, chain, account>>>;
|
|
14
|
+
export type SmartAccountClientConfig<entryPoint extends EntryPoint, transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount<entryPoint, string, transport, chain> | undefined = SmartAccount<entryPoint, string, transport, chain> | undefined | undefined> = Prettify<Pick<ClientConfig<transport, chain>, "cacheTime" | "chain" | "key" | "name" | "pollingInterval"> & Middleware<entryPoint> & {
|
|
15
|
+
account: account;
|
|
16
|
+
bundlerTransport: Transport;
|
|
17
|
+
} & {
|
|
18
|
+
entryPoint?: entryPoint;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
22
|
+
*
|
|
23
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/smartAccountClient
|
|
24
|
+
*
|
|
25
|
+
* A Bundler Client is an interface to "erc 4337" [JSON-RPC API](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace) methods such as sending user operation, estimating gas for a user operation, get user operation receipt, etc through Bundler Actions.
|
|
26
|
+
*
|
|
27
|
+
* @param parameters - {@link WalletClientConfig}
|
|
28
|
+
* @returns A Bundler Client. {@link SmartAccountClient}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* import { createPublicClient, http } from 'viem'
|
|
32
|
+
* import { mainnet } from 'viem/chains'
|
|
33
|
+
*
|
|
34
|
+
* const smartAccountClient = createSmartAccountClient({
|
|
35
|
+
* chain: mainnet,
|
|
36
|
+
* transport: http(BUNDLER_URL),
|
|
37
|
+
* })
|
|
38
|
+
*/
|
|
39
|
+
export declare function createSmartAccountClient<TTransport extends Transport, TChain extends Chain | undefined, TEntryPoint extends EntryPoint, TSmartAccount extends SmartAccount<TEntryPoint, string, TTransport, TChain> | undefined = SmartAccount<TEntryPoint, string, TTransport, TChain> | undefined>(parameters: SmartAccountClientConfig<TEntryPoint, TTransport, TChain, TSmartAccount>): SmartAccountClient<TEntryPoint, TTransport, TChain, TSmartAccount>;
|
|
40
|
+
//# sourceMappingURL=createSmartAccountClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSmartAccountClient.d.ts","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EAEZ,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAA;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EACH,KAAK,mBAAmB,EAE3B,MAAM,2BAA2B,CAAA;AAElC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAC1B,UAAU,SAAS,UAAU,EAC7B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SACD,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,GAClD,SAAS,GACT,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,GAClD,SAAS,IACf,QAAQ,CACR,MAAM,CACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,CAAC,UAAU,CAAC,EAC5B,mBAAmB,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAC7D,CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,UAAU,SAAS,UAAU,EAC7B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SACD,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,GAClD,SAAS,GACT,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,GAClD,SAAS,GACT,SAAS,IACf,QAAQ,CACR,IAAI,CACA,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,EAC9B,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,CAC7D,GACG,UAAU,CAAC,UAAU,CAAC,GAAG;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,SAAS,CAAA;CAC9B,GAAG;IACA,UAAU,CAAC,EAAE,UAAU,CAAA;CAC1B,CACR,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,wBAAwB,CACpC,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,WAAW,SAAS,UAAU,EAC9B,aAAa,SACP,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GACrD,SAAS,GACT,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GACrD,SAAS,EAEf,UAAU,EAAE,wBAAwB,CAChC,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,CAChB,GACF,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAmBpE"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { Client, Hash } from "viem";
|
|
2
|
+
import { type EstimateUserOperationGasParameters, type EstimateUserOperationGasReturnType } from "../../actions/bundler/estimateUserOperationGas";
|
|
3
|
+
import { type GetUserOperationByHashParameters, type GetUserOperationByHashReturnType } from "../../actions/bundler/getUserOperationByHash";
|
|
4
|
+
import { type GetUserOperationReceiptParameters, type GetUserOperationReceiptReturnType } from "../../actions/bundler/getUserOperationReceipt";
|
|
5
|
+
import { type SendUserOperationParameters } from "../../actions/bundler/sendUserOperation";
|
|
6
|
+
import { type WaitForUserOperationReceiptParameters } from "../../actions/bundler/waitForUserOperationReceipt";
|
|
7
|
+
import type { Prettify } from "../../types";
|
|
8
|
+
import type { StateOverrides } from "../../types/bundler";
|
|
9
|
+
import type { EntryPoint } from "../../types/entrypoint";
|
|
10
|
+
export type BundlerActions<entryPoint extends EntryPoint> = {
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* Sends user operation to the bundler
|
|
14
|
+
*
|
|
15
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
|
|
16
|
+
*
|
|
17
|
+
* @param args {@link SendUserOperationParameters}.
|
|
18
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* import { createClient } from "viem"
|
|
22
|
+
* import { bundlerActions } from "permissionless"
|
|
23
|
+
*
|
|
24
|
+
* const bundlerClient = createClient({
|
|
25
|
+
* chain: goerli,
|
|
26
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
27
|
+
* }).extend(bundlerActions)
|
|
28
|
+
*
|
|
29
|
+
* const userOpHash = await bundlerClient.sendUserOperation({
|
|
30
|
+
* userOperation: signedUserOperation,
|
|
31
|
+
* entryPoint: entryPoint
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
35
|
+
*/
|
|
36
|
+
sendUserOperation: (args: Prettify<Omit<SendUserOperationParameters<entryPoint>, "entryPoint">>) => Promise<Hash>;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
|
|
40
|
+
*
|
|
41
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
|
|
42
|
+
*
|
|
43
|
+
* @param args {@link EstimateUserOperationGasParameters}
|
|
44
|
+
* @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* import { createClient } from "viem"
|
|
48
|
+
* import { bundlerActions } from "permissionless"
|
|
49
|
+
*
|
|
50
|
+
* const bundlerClient = createClient({
|
|
51
|
+
* chain: goerli,
|
|
52
|
+
* transport: http(BUNDLER_URL)
|
|
53
|
+
* }).extend(bundlerActions)
|
|
54
|
+
*
|
|
55
|
+
* const gasParameters = await bundlerClient.estimateUserOperationGas({
|
|
56
|
+
* userOperation: signedUserOperation,
|
|
57
|
+
* entryPoint: entryPoint
|
|
58
|
+
* })
|
|
59
|
+
*
|
|
60
|
+
* // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
|
|
61
|
+
*/
|
|
62
|
+
estimateUserOperationGas: (args: Prettify<Omit<EstimateUserOperationGasParameters<entryPoint>, "entryPoint">>, stateOverrides?: StateOverrides) => Promise<Prettify<EstimateUserOperationGasReturnType<entryPoint>>>;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* Returns the supported entrypoints by the bundler service
|
|
66
|
+
*
|
|
67
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
|
|
68
|
+
*
|
|
69
|
+
* @returns Supported entryPoints
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* import { createClient } from "viem"
|
|
73
|
+
* import { bundlerActions } from "permissionless"
|
|
74
|
+
*
|
|
75
|
+
* const bundlerClient = createClient({
|
|
76
|
+
* chain: goerli,
|
|
77
|
+
* transport: http(BUNDLER_URL)
|
|
78
|
+
* }).extend(bundlerActions)
|
|
79
|
+
*
|
|
80
|
+
* const supportedEntryPoints = await bundlerClient.supportedEntryPoints()
|
|
81
|
+
*
|
|
82
|
+
* // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
|
|
83
|
+
*/
|
|
84
|
+
supportedEntryPoints: () => Promise<EntryPoint[]>;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* Returns the supported chain id by the bundler service
|
|
88
|
+
*
|
|
89
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
|
|
90
|
+
*
|
|
91
|
+
* @returns Supported chain id
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* import { createClient } from "viem"
|
|
95
|
+
* import { bundlerActions } from "permissionless"
|
|
96
|
+
*
|
|
97
|
+
* const bundlerClient = createClient({
|
|
98
|
+
* chain: goerli,
|
|
99
|
+
* transport: http(BUNDLER_URL)
|
|
100
|
+
* }).extend(bundlerActions)
|
|
101
|
+
*
|
|
102
|
+
* const chainId = await bundlerClient.chainId()
|
|
103
|
+
* // Return 5n for Goerli
|
|
104
|
+
*/
|
|
105
|
+
chainId: () => Promise<number>;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* Returns the user operation from userOpHash
|
|
109
|
+
*
|
|
110
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
|
|
111
|
+
*
|
|
112
|
+
* @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
|
|
113
|
+
* @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* import { createClient } from "viem"
|
|
117
|
+
* import { bundlerActions } from "permissionless"
|
|
118
|
+
*
|
|
119
|
+
* const bundlerClient = createClient({
|
|
120
|
+
* chain: goerli,
|
|
121
|
+
* transport: http(BUNDLER_URL)
|
|
122
|
+
* }).extend(bundlerActions)
|
|
123
|
+
*
|
|
124
|
+
* await bundlerClient.getUserOperationByHash(userOpHash)
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
getUserOperationByHash: (args: Prettify<GetUserOperationByHashParameters>) => Promise<Prettify<GetUserOperationByHashReturnType<entryPoint>> | null>;
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* Returns the user operation receipt from userOpHash
|
|
131
|
+
*
|
|
132
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
|
|
133
|
+
*
|
|
134
|
+
* @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
135
|
+
* @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* import { createClient } from "viem"
|
|
139
|
+
* import { bundlerActions } from "permissionless"
|
|
140
|
+
*
|
|
141
|
+
* const bundlerClient = createClient({
|
|
142
|
+
* chain: goerli,
|
|
143
|
+
* transport: http(BUNDLER_URL)
|
|
144
|
+
* }).extend(bundlerActions)
|
|
145
|
+
*
|
|
146
|
+
* await bundlerClient.getUserOperationReceipt({hash: userOpHash})
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
getUserOperationReceipt: (args: Prettify<GetUserOperationReceiptParameters>) => Promise<Prettify<GetUserOperationReceiptReturnType> | null>;
|
|
150
|
+
/**
|
|
151
|
+
* Waits for the User Operation to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [User Operation Receipt](https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt).
|
|
152
|
+
*
|
|
153
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/waitForUserOperationReceipt
|
|
154
|
+
*
|
|
155
|
+
* @param client - Bundler Client to use
|
|
156
|
+
* @param parameters - {@link WaitForUserOperationReceiptParameters}
|
|
157
|
+
* @returns The transaction receipt. {@link GetUserOperationReceiptReturnType}
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* import { createBundlerClient, waitForUserOperationReceipt, http } from 'viem'
|
|
161
|
+
* import { mainnet } from 'viem/chains'
|
|
162
|
+
*
|
|
163
|
+
* const bundlerClient = createBundlerClient({
|
|
164
|
+
* chain: mainnet,
|
|
165
|
+
* transport: http(),
|
|
166
|
+
* })
|
|
167
|
+
* const userOperationReceipt = await bundlerClient.waitForUserOperationReceipt({
|
|
168
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
|
169
|
+
* })
|
|
170
|
+
*/
|
|
171
|
+
waitForUserOperationReceipt: (args: Prettify<WaitForUserOperationReceiptParameters>) => Promise<Prettify<GetUserOperationReceiptReturnType>>;
|
|
172
|
+
};
|
|
173
|
+
declare const bundlerActions: <entryPoint extends EntryPoint>(entryPointAddress: entryPoint) => (client: Client) => BundlerActions<entryPoint>;
|
|
174
|
+
export { bundlerActions };
|
|
175
|
+
//# sourceMappingURL=bundler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../clients/decorators/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,EACH,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EAE1C,MAAM,gDAAgD,CAAA;AACvD,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACH,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EAEzC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EACH,KAAK,2BAA2B,EAEnC,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,KAAK,qCAAqC,EAE7C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,MAAM,cAAc,CAAC,UAAU,SAAS,UAAU,IAAI;IACxD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,iBAAiB,EAAE,CACf,IAAI,EAAE,QAAQ,CACV,IAAI,CAAC,2BAA2B,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAC9D,KACA,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,wBAAwB,EAAE,CACtB,IAAI,EAAE,QAAQ,CACV,IAAI,CAAC,kCAAkC,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CACrE,EACD,cAAc,CAAC,EAAE,cAAc,KAC9B,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACtE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,oBAAoB,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACjD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,QAAQ,CAAC,gCAAgC,CAAC,KAC/C,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC3E;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,EAAE,CACrB,IAAI,EAAE,QAAQ,CAAC,iCAAiC,CAAC,KAChD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,GAAG,IAAI,CAAC,CAAA;IAEhE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2BAA2B,EAAE,CACzB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC,KACpD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,CAAA;CAC5D,CAAA;AAED,QAAA,MAAM,cAAc,qDACmC,UAAU,cACpD,MAAM,KAAG,eAAe,UAAU,CAqCzC,CAAA;AAEN,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { Client, Hash } from "viem";
|
|
2
|
+
import { type SendCompressedUserOperationParameters, type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico";
|
|
3
|
+
import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice";
|
|
4
|
+
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus";
|
|
5
|
+
import { type PimlicoSponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation";
|
|
6
|
+
import type { Prettify } from "../../types";
|
|
7
|
+
import type { EntryPoint } from "../../types/entrypoint";
|
|
8
|
+
export type PimlicoBundlerActions = {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the live gas prices that you can use to send a user operation.
|
|
11
|
+
*
|
|
12
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
|
|
13
|
+
*
|
|
14
|
+
* @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* import { createClient } from "viem"
|
|
19
|
+
* import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
|
|
20
|
+
*
|
|
21
|
+
* const bundlerClient = createClient({
|
|
22
|
+
* chain: goerli,
|
|
23
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
24
|
+
* }).extend(pimlicoBundlerActions)
|
|
25
|
+
*
|
|
26
|
+
* await bundlerClient.getUserOperationGasPrice()
|
|
27
|
+
*/
|
|
28
|
+
getUserOperationGasPrice: () => Promise<Prettify<GetUserOperationGasPriceReturnType>>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the status of the userOperation that is pending in the mempool.
|
|
31
|
+
*
|
|
32
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
|
|
33
|
+
*
|
|
34
|
+
* @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
|
|
35
|
+
* @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* import { createClient } from "viem"
|
|
39
|
+
* import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
|
|
40
|
+
*
|
|
41
|
+
* const bundlerClient = createClient({
|
|
42
|
+
* chain: goerli,
|
|
43
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
44
|
+
* }).extend(pimlicoBundlerActions)
|
|
45
|
+
*
|
|
46
|
+
* await bundlerClient.getUserOperationStatus({ hash: userOpHash })
|
|
47
|
+
*/
|
|
48
|
+
getUserOperationStatus: (args: Prettify<GetUserOperationStatusParameters>) => Promise<Prettify<GetUserOperationStatusReturnType>>;
|
|
49
|
+
/**
|
|
50
|
+
* Sends a compressed user operation to the bundler
|
|
51
|
+
*
|
|
52
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/sendCompressedUserOperation
|
|
53
|
+
*
|
|
54
|
+
* @param args {@link SendCompressedUserOperationParameters}.
|
|
55
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* import { createClient } from "viem"
|
|
59
|
+
* import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
|
|
60
|
+
*
|
|
61
|
+
* const bundlerClient = createClient({
|
|
62
|
+
* chain: goerli,
|
|
63
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
64
|
+
* }).extend(pimlicoBundlerActions)
|
|
65
|
+
*
|
|
66
|
+
* const userOpHash = await bundlerClient.sendCompressedUserOperation({
|
|
67
|
+
* compressedUserOperation,
|
|
68
|
+
* inflatorAddress,
|
|
69
|
+
* entryPoint
|
|
70
|
+
* })
|
|
71
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
72
|
+
*/
|
|
73
|
+
sendCompressedUserOperation: (args: Prettify<Omit<SendCompressedUserOperationParameters, "entryPoint">>) => Promise<Hash>;
|
|
74
|
+
};
|
|
75
|
+
export declare const pimlicoBundlerActions: <entryPoint extends EntryPoint>(entryPointAddress: entryPoint) => (client: Client) => PimlicoBundlerActions;
|
|
76
|
+
export type PimlicoPaymasterClientActions<entryPoint extends EntryPoint> = {
|
|
77
|
+
/**
|
|
78
|
+
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
79
|
+
*
|
|
80
|
+
* https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
81
|
+
*
|
|
82
|
+
* @param args {@link PimlicoSponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
83
|
+
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* import { createClient } from "viem"
|
|
87
|
+
* import { sponsorUserOperation } from "permissionless/actions/pimlico"
|
|
88
|
+
*
|
|
89
|
+
* const bundlerClient = createClient({
|
|
90
|
+
* chain: goerli,
|
|
91
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
92
|
+
* }).extend(pimlicoPaymasterActions)
|
|
93
|
+
*
|
|
94
|
+
* await bundlerClient.sponsorUserOperation(bundlerClient, {
|
|
95
|
+
* userOperation: userOperationWithDummySignature,
|
|
96
|
+
* entryPoint: entryPoint
|
|
97
|
+
* }})
|
|
98
|
+
*
|
|
99
|
+
*/
|
|
100
|
+
sponsorUserOperation: (args: Omit<PimlicoSponsorUserOperationParameters<entryPoint>, "entryPoint">) => Promise<Prettify<SponsorUserOperationReturnType<entryPoint>>>;
|
|
101
|
+
validateSponsorshipPolicies: (args: Prettify<Omit<ValidateSponsorshipPoliciesParameters<entryPoint>, "entryPoint">>) => Promise<Prettify<ValidateSponsorshipPolicies>[]>;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Returns valid sponsorship policies for a userOperation from the list of ids passed
|
|
105
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/ValidateSponsorshipPolicies
|
|
106
|
+
*
|
|
107
|
+
* @param args {@link ValidateSponsorshipPoliciesParameters} UserOperation you want to sponsor & entryPoint.
|
|
108
|
+
* @returns valid sponsorship policies, see {@link ValidateSponsorshipPolicies}
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* import { createClient } from "viem"
|
|
112
|
+
* import { validateSponsorshipPolicies } from "permissionless/actions/pimlico"
|
|
113
|
+
*
|
|
114
|
+
* const bundlerClient = createClient({
|
|
115
|
+
* chain: goerli,
|
|
116
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
117
|
+
* }).extend(pimlicoPaymasterActions)
|
|
118
|
+
|
|
119
|
+
*
|
|
120
|
+
* await bundlerClient.validateSponsorshipPolicies({
|
|
121
|
+
* userOperation: userOperationWithDummySignature,
|
|
122
|
+
* entryPoint: entryPoint,
|
|
123
|
+
* sponsorshipPolicyIds: ["sp_shiny_puma"]
|
|
124
|
+
* })
|
|
125
|
+
* Returns
|
|
126
|
+
* [
|
|
127
|
+
* {
|
|
128
|
+
* sponsorshipPolicyId: "sp_shiny_puma",
|
|
129
|
+
* data: {
|
|
130
|
+
* name: "Shiny Puma",
|
|
131
|
+
* author: "Pimlico",
|
|
132
|
+
* icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4...",
|
|
133
|
+
* description: "This policy is for testing purposes only"
|
|
134
|
+
* }
|
|
135
|
+
* }
|
|
136
|
+
* ]
|
|
137
|
+
*/
|
|
138
|
+
export declare const pimlicoPaymasterActions: <entryPoint extends EntryPoint>(entryPointAddress: entryPoint) => (client: Client) => PimlicoPaymasterClientActions<entryPoint>;
|
|
139
|
+
/**
|
|
140
|
+
* TODO: Add support for pimlicoActions after we support all the actions of v2 of the Pimlico API.
|
|
141
|
+
*/
|
|
142
|
+
//# sourceMappingURL=pimlico.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,2BAA2B,EAChC,KAAK,qCAAqC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,gDAAgD,CAAA;AACvD,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EAEtC,MAAM,4CAA4C,CAAA;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,EAAE,MAAM,OAAO,CACnC,QAAQ,CAAC,kCAAkC,CAAC,CAC/C,CAAA;IACD;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,QAAQ,CAAC,gCAAgC,CAAC,KAC/C,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC,CAAA;IACxD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,2BAA2B,EAAE,CACzB,IAAI,EAAE,QAAQ,CACV,IAAI,CAAC,qCAAqC,EAAE,YAAY,CAAC,CAC5D,KACA,OAAO,CAAC,IAAI,CAAC,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,qBAAqB,qDACqB,UAAU,cACpD,MAAM,KAAG,qBAsBhB,CAAA;AAEN,MAAM,MAAM,6BAA6B,CAAC,UAAU,SAAS,UAAU,IAAI;IACvE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAClB,IAAI,EAAE,IAAI,CACN,qCAAqC,CAAC,UAAU,CAAC,EACjD,YAAY,CACf,KACA,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IAElE,2BAA2B,EAAE,CACzB,IAAI,EAAE,QAAQ,CACV,IAAI,CACA,qCAAqC,CAAC,UAAU,CAAC,EACjD,YAAY,CACf,CACJ,KACA,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAA;CACxD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,uBAAuB,qDACmB,UAAU,cACpD,MAAM,KAAG,8BAA8B,UAAU,CAwBxD,CAAA;AAEN;;GAEG"}
|