permissionless 0.1.45 → 0.2.0-rc-2
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/accounts/biconomy/abi/BiconomySmartAccountAbi.ts +61 -38
- package/accounts/biconomy/toBiconomySmartAccount.ts +256 -0
- package/accounts/index.ts +58 -89
- package/accounts/kernel/abi/KernelV3AccountAbi.ts +705 -0
- package/accounts/kernel/constants.ts +1 -9
- package/accounts/kernel/{signerToEcdsaKernelSmartAccount.ts → toEcdsaKernelSmartAccount.ts} +182 -273
- package/accounts/kernel/utils/encodeCallData.ts +28 -94
- package/accounts/kernel/utils/getNonceKey.ts +6 -7
- package/accounts/kernel/utils/isKernelV2.ts +2 -3
- package/accounts/kernel/utils/signMessage.ts +20 -29
- package/accounts/kernel/utils/signTypedData.ts +17 -33
- package/accounts/kernel/utils/wrapMessageHash.ts +5 -6
- package/accounts/light/toLightSmartAccount.ts +383 -0
- package/accounts/safe/{signerToSafeSmartAccount.ts → toSafeSmartAccount.ts} +489 -552
- package/accounts/simple/toSimpleSmartAccount.ts +317 -0
- package/accounts/trust/toTrustSmartAccount.ts +218 -0
- package/accounts/trust/utils/encodeCallData.ts +13 -33
- package/actions/erc7579/accountId.test.ts +7 -20
- package/actions/erc7579/accountId.ts +25 -29
- package/actions/erc7579/installModule.test.ts +32 -82
- package/actions/erc7579/installModule.ts +55 -90
- package/actions/erc7579/installModules.test.ts +32 -83
- package/actions/erc7579/installModules.ts +57 -103
- package/actions/erc7579/isModuleInstalled.test.ts +14 -57
- package/actions/erc7579/isModuleInstalled.ts +26 -42
- package/actions/erc7579/supportsExecutionMode.test.ts +17 -34
- package/actions/erc7579/supportsExecutionMode.ts +28 -45
- package/actions/erc7579/supportsModule.test.ts +7 -18
- package/actions/erc7579/supportsModule.ts +27 -39
- package/actions/erc7579/uninstallModule.test.ts +16 -62
- package/actions/erc7579/uninstallModule.ts +56 -95
- package/actions/erc7579/uninstallModules.test.ts +16 -62
- package/actions/erc7579/uninstallModules.ts +50 -99
- package/actions/erc7579.ts +24 -110
- package/actions/index.ts +2 -50
- package/actions/pimlico/getUserOperationGasPrice.test.ts +3 -4
- package/actions/pimlico/getUserOperationGasPrice.ts +9 -9
- package/actions/pimlico/getUserOperationStatus.test.ts +53 -67
- package/actions/pimlico/getUserOperationStatus.ts +11 -12
- package/actions/pimlico/sendCompressedUserOperation.ts +16 -16
- package/actions/pimlico/sponsorUserOperation.test.ts +52 -65
- package/actions/pimlico/sponsorUserOperation.ts +86 -93
- package/actions/pimlico/validateSponsorshipPolicies.test.ts +27 -26
- package/actions/pimlico/validateSponsorshipPolicies.ts +29 -22
- package/actions/pimlico.ts +4 -12
- package/actions/public/getAccountNonce.test.ts +36 -18
- package/actions/public/getAccountNonce.ts +9 -14
- package/actions/public/getSenderAddress.test.ts +64 -28
- package/actions/public/getSenderAddress.ts +26 -35
- package/actions/smartAccount/sendTransaction.test.ts +58 -48
- package/actions/smartAccount/sendTransaction.ts +58 -88
- package/actions/smartAccount/signMessage.test.ts +31 -86
- package/actions/smartAccount/signMessage.ts +8 -18
- package/actions/smartAccount/signTypedData.test.ts +23 -76
- package/actions/smartAccount/signTypedData.ts +14 -24
- package/actions/smartAccount/writeContract.ts +12 -110
- package/actions/smartAccount.ts +3 -50
- package/clients/createSmartAccountClient.ts +106 -78
- package/clients/decorators/pimlico.ts +55 -129
- package/clients/decorators/smartAccount.ts +31 -310
- package/clients/index.ts +2 -0
- package/clients/pimlico.ts +108 -74
- package/errors/index.ts +15 -116
- package/index.ts +1 -86
- package/package.json +3 -24
- package/types/pimlico.ts +37 -30
- package/utils/{encode7579CallData.test.ts → encode7579Calls.test.ts} +12 -11
- package/utils/{encode7579CallData.ts → encode7579Calls.ts} +13 -19
- package/utils/getPackedUserOperation.ts +11 -9
- package/utils/getRequiredPrefund.test.ts +7 -11
- package/utils/getRequiredPrefund.ts +13 -12
- package/utils/index.ts +1 -29
- package/utils/isSmartAccountDeployed.ts +3 -6
- package/utils/walletClientToSmartAccountSigner.ts +7 -5
- package/_cjs/accounts/biconomy/abi/BiconomySmartAccountAbi.js +0 -102
- package/_cjs/accounts/biconomy/abi/BiconomySmartAccountAbi.js.map +0 -1
- package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js +0 -14
- package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +0 -1
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +0 -233
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +0 -1
- package/_cjs/accounts/index.js +0 -30
- package/_cjs/accounts/index.js.map +0 -1
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js +0 -84
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js.map +0 -1
- package/_cjs/accounts/kernel/abi/KernelV3AccountAbi.js +0 -110
- package/_cjs/accounts/kernel/abi/KernelV3AccountAbi.js.map +0 -1
- package/_cjs/accounts/kernel/abi/KernelV3MetaFactoryAbi.js +0 -21
- package/_cjs/accounts/kernel/abi/KernelV3MetaFactoryAbi.js.map +0 -1
- package/_cjs/accounts/kernel/constants.js +0 -27
- package/_cjs/accounts/kernel/constants.js.map +0 -1
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +0 -332
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +0 -1
- package/_cjs/accounts/kernel/utils/encodeCallData.js +0 -90
- package/_cjs/accounts/kernel/utils/encodeCallData.js.map +0 -1
- package/_cjs/accounts/kernel/utils/getExecMode.js +0 -15
- package/_cjs/accounts/kernel/utils/getExecMode.js.map +0 -1
- package/_cjs/accounts/kernel/utils/getNonceKey.js +0 -25
- package/_cjs/accounts/kernel/utils/getNonceKey.js.map +0 -1
- package/_cjs/accounts/kernel/utils/isKernelV2.js +0 -9
- package/_cjs/accounts/kernel/utils/isKernelV2.js.map +0 -1
- package/_cjs/accounts/kernel/utils/signMessage.js +0 -29
- package/_cjs/accounts/kernel/utils/signMessage.js.map +0 -1
- package/_cjs/accounts/kernel/utils/signTypedData.js +0 -41
- package/_cjs/accounts/kernel/utils/signTypedData.js.map +0 -1
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js +0 -20
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js.map +0 -1
- package/_cjs/accounts/light/privateKeyToLightSmartAccount.js +0 -14
- package/_cjs/accounts/light/privateKeyToLightSmartAccount.js.map +0 -1
- package/_cjs/accounts/light/signerToLightSmartAccount.js +0 -256
- package/_cjs/accounts/light/signerToLightSmartAccount.js.map +0 -1
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js +0 -14
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js.map +0 -1
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js +0 -1012
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js.map +0 -1
- package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js +0 -14
- package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js.map +0 -1
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js +0 -259
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js.map +0 -1
- package/_cjs/accounts/toSmartAccount.js +0 -84
- package/_cjs/accounts/toSmartAccount.js.map +0 -1
- package/_cjs/accounts/trust/privateKeyToTrustSmartAccount.js +0 -14
- package/_cjs/accounts/trust/privateKeyToTrustSmartAccount.js.map +0 -1
- package/_cjs/accounts/trust/signerToTrustSmartAccount.js +0 -134
- package/_cjs/accounts/trust/signerToTrustSmartAccount.js.map +0 -1
- package/_cjs/accounts/trust/utils/encodeCallData.js +0 -74
- package/_cjs/accounts/trust/utils/encodeCallData.js.map +0 -1
- package/_cjs/accounts/trust/utils/getAccountAddress.js +0 -19
- package/_cjs/accounts/trust/utils/getAccountAddress.js.map +0 -1
- package/_cjs/accounts/trust/utils/getDummySignature.js +0 -8
- package/_cjs/accounts/trust/utils/getDummySignature.js.map +0 -1
- package/_cjs/accounts/trust/utils/getFactoryData.js +0 -43
- package/_cjs/accounts/trust/utils/getFactoryData.js.map +0 -1
- package/_cjs/accounts/trust/utils/signMessage.js +0 -9
- package/_cjs/accounts/trust/utils/signMessage.js.map +0 -1
- package/_cjs/accounts/trust/utils/signTransaction.js +0 -9
- package/_cjs/accounts/trust/utils/signTransaction.js.map +0 -1
- package/_cjs/accounts/trust/utils/signUserOperation.js +0 -19
- package/_cjs/accounts/trust/utils/signUserOperation.js.map +0 -1
- package/_cjs/accounts/types.js +0 -23
- package/_cjs/accounts/types.js.map +0 -1
- package/_cjs/actions/bundler/chainId.js +0 -11
- package/_cjs/actions/bundler/chainId.js.map +0 -1
- package/_cjs/actions/bundler/estimateUserOperationGas.js +0 -49
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +0 -1
- package/_cjs/actions/bundler/getUserOperationByHash.js +0 -47
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +0 -1
- package/_cjs/actions/bundler/getUserOperationReceipt.js +0 -52
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +0 -1
- package/_cjs/actions/bundler/sendUserOperation.js +0 -23
- package/_cjs/actions/bundler/sendUserOperation.js.map +0 -1
- package/_cjs/actions/bundler/supportedEntryPoints.js +0 -11
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +0 -1
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js +0 -67
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +0 -1
- package/_cjs/actions/erc7579/accountId.js +0 -66
- package/_cjs/actions/erc7579/accountId.js.map +0 -1
- package/_cjs/actions/erc7579/installModule.js +0 -65
- package/_cjs/actions/erc7579/installModule.js.map +0 -1
- package/_cjs/actions/erc7579/installModules.js +0 -65
- package/_cjs/actions/erc7579/installModules.js.map +0 -1
- package/_cjs/actions/erc7579/isModuleInstalled.js +0 -86
- package/_cjs/actions/erc7579/isModuleInstalled.js.map +0 -1
- package/_cjs/actions/erc7579/supportsExecutionMode.js +0 -95
- package/_cjs/actions/erc7579/supportsExecutionMode.js.map +0 -1
- package/_cjs/actions/erc7579/supportsModule.js +0 -84
- package/_cjs/actions/erc7579/supportsModule.js.map +0 -1
- package/_cjs/actions/erc7579/uninstallModule.js +0 -65
- package/_cjs/actions/erc7579/uninstallModule.js.map +0 -1
- package/_cjs/actions/erc7579/uninstallModules.js +0 -65
- package/_cjs/actions/erc7579/uninstallModules.js.map +0 -1
- package/_cjs/actions/erc7579.js +0 -33
- package/_cjs/actions/erc7579.js.map +0 -1
- package/_cjs/actions/index.js +0 -25
- package/_cjs/actions/index.js.map +0 -1
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js +0 -25
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +0 -1
- package/_cjs/actions/pimlico/getUserOperationStatus.js +0 -11
- package/_cjs/actions/pimlico/getUserOperationStatus.js.map +0 -1
- package/_cjs/actions/pimlico/sendCompressedUserOperation.js +0 -16
- package/_cjs/actions/pimlico/sendCompressedUserOperation.js.map +0 -1
- package/_cjs/actions/pimlico/sponsorUserOperation.js +0 -43
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +0 -1
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js +0 -16
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +0 -1
- package/_cjs/actions/pimlico.js +0 -17
- package/_cjs/actions/pimlico.js.map +0 -1
- package/_cjs/actions/public/getAccountNonce.js +0 -38
- package/_cjs/actions/public/getAccountNonce.js.map +0 -1
- package/_cjs/actions/public/getSenderAddress.js +0 -154
- package/_cjs/actions/public/getSenderAddress.js.map +0 -1
- package/_cjs/actions/smartAccount/deployContract.js +0 -38
- package/_cjs/actions/smartAccount/deployContract.js.map +0 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js +0 -195
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +0 -1
- package/_cjs/actions/smartAccount/sendTransaction.js +0 -43
- package/_cjs/actions/smartAccount/sendTransaction.js.map +0 -1
- package/_cjs/actions/smartAccount/sendTransactions.js +0 -45
- package/_cjs/actions/smartAccount/sendTransactions.js.map +0 -1
- package/_cjs/actions/smartAccount/sendUserOperation.js +0 -21
- package/_cjs/actions/smartAccount/sendUserOperation.js.map +0 -1
- package/_cjs/actions/smartAccount/signMessage.js +0 -16
- package/_cjs/actions/smartAccount/signMessage.js.map +0 -1
- package/_cjs/actions/smartAccount/signTypedData.js +0 -34
- package/_cjs/actions/smartAccount/signTypedData.js.map +0 -1
- package/_cjs/actions/smartAccount/writeContract.js +0 -21
- package/_cjs/actions/smartAccount/writeContract.js.map +0 -1
- package/_cjs/actions/smartAccount.js +0 -20
- package/_cjs/actions/smartAccount.js.map +0 -1
- package/_cjs/actions/stackup/accounts.js +0 -12
- package/_cjs/actions/stackup/accounts.js.map +0 -1
- package/_cjs/actions/stackup/sponsorUserOperation.js +0 -32
- package/_cjs/actions/stackup/sponsorUserOperation.js.map +0 -1
- package/_cjs/actions/stackup.js +0 -10
- package/_cjs/actions/stackup.js.map +0 -1
- package/_cjs/clients/createBundlerClient.js +0 -17
- package/_cjs/clients/createBundlerClient.js.map +0 -1
- package/_cjs/clients/createSmartAccountClient.js +0 -20
- package/_cjs/clients/createSmartAccountClient.js.map +0 -1
- package/_cjs/clients/decorators/bundler.js +0 -24
- package/_cjs/clients/decorators/bundler.js.map +0 -1
- package/_cjs/clients/decorators/pimlico.js +0 -25
- package/_cjs/clients/decorators/pimlico.js.map +0 -1
- package/_cjs/clients/decorators/smartAccount.js +0 -43
- package/_cjs/clients/decorators/smartAccount.js.map +0 -1
- package/_cjs/clients/decorators/stackup.js +0 -14
- package/_cjs/clients/decorators/stackup.js.map +0 -1
- package/_cjs/clients/pimlico.js +0 -31
- package/_cjs/clients/pimlico.js.map +0 -1
- package/_cjs/clients/stackup.js +0 -20
- package/_cjs/clients/stackup.js.map +0 -1
- package/_cjs/errors/account.js +0 -311
- package/_cjs/errors/account.js.map +0 -1
- package/_cjs/errors/bundler.js +0 -61
- package/_cjs/errors/bundler.js.map +0 -1
- package/_cjs/errors/estimateUserOperationGas.js +0 -53
- package/_cjs/errors/estimateUserOperationGas.js.map +0 -1
- package/_cjs/errors/gas.js +0 -113
- package/_cjs/errors/gas.js.map +0 -1
- package/_cjs/errors/index.js +0 -35
- package/_cjs/errors/index.js.map +0 -1
- package/_cjs/errors/paymaster.js +0 -228
- package/_cjs/errors/paymaster.js.map +0 -1
- package/_cjs/errors/sendUserOperation.js +0 -37
- package/_cjs/errors/sendUserOperation.js.map +0 -1
- package/_cjs/errors/utils.js +0 -18
- package/_cjs/errors/utils.js.map +0 -1
- package/_cjs/experimental/eip7677/actions/getPaymasterData.js +0 -41
- package/_cjs/experimental/eip7677/actions/getPaymasterData.js.map +0 -1
- package/_cjs/experimental/eip7677/actions/getPaymasterStubData.js +0 -51
- package/_cjs/experimental/eip7677/actions/getPaymasterStubData.js.map +0 -1
- package/_cjs/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js +0 -21
- package/_cjs/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js.map +0 -1
- package/_cjs/experimental/eip7677/index.js +0 -10
- package/_cjs/experimental/eip7677/index.js.map +0 -1
- package/_cjs/experimental/eip7677/types/paymaster.js +0 -3
- package/_cjs/experimental/eip7677/types/paymaster.js.map +0 -1
- package/_cjs/experimental/index.js +0 -5
- package/_cjs/experimental/index.js.map +0 -1
- package/_cjs/index.js +0 -37
- package/_cjs/index.js.map +0 -1
- package/_cjs/package.json +0 -1
- package/_cjs/types/bundler.js +0 -3
- package/_cjs/types/bundler.js.map +0 -1
- package/_cjs/types/entrypoint.js +0 -3
- package/_cjs/types/entrypoint.js.map +0 -1
- package/_cjs/types/index.js +0 -3
- package/_cjs/types/index.js.map +0 -1
- package/_cjs/types/pimlico.js +0 -3
- package/_cjs/types/pimlico.js.map +0 -1
- package/_cjs/types/stackup.js +0 -3
- package/_cjs/types/stackup.js.map +0 -1
- package/_cjs/types/userOperation.js +0 -3
- package/_cjs/types/userOperation.js.map +0 -1
- package/_cjs/utils/decodeNonce.js +0 -12
- package/_cjs/utils/decodeNonce.js.map +0 -1
- package/_cjs/utils/deepHexlify.js +0 -31
- package/_cjs/utils/deepHexlify.js.map +0 -1
- package/_cjs/utils/encode7579CallData.js +0 -81
- package/_cjs/utils/encode7579CallData.js.map +0 -1
- package/_cjs/utils/encodeNonce.js +0 -11
- package/_cjs/utils/encodeNonce.js.map +0 -1
- package/_cjs/utils/errors/getBundlerError.js +0 -124
- package/_cjs/utils/errors/getBundlerError.js.map +0 -1
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js +0 -19
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js.map +0 -1
- package/_cjs/utils/errors/getSendUserOperationError.js +0 -19
- package/_cjs/utils/errors/getSendUserOperationError.js.map +0 -1
- package/_cjs/utils/getAddressFromInitCodeOrPaymasterAndData.js +0 -15
- package/_cjs/utils/getAddressFromInitCodeOrPaymasterAndData.js.map +0 -1
- package/_cjs/utils/getEntryPointVersion.js +0 -16
- package/_cjs/utils/getEntryPointVersion.js.map +0 -1
- package/_cjs/utils/getPackedUserOperation.js +0 -106
- package/_cjs/utils/getPackedUserOperation.js.map +0 -1
- package/_cjs/utils/getRequiredPrefund.js +0 -27
- package/_cjs/utils/getRequiredPrefund.js.map +0 -1
- package/_cjs/utils/getUserOperationHash.js +0 -94
- package/_cjs/utils/getUserOperationHash.js.map +0 -1
- package/_cjs/utils/index.js +0 -38
- package/_cjs/utils/index.js.map +0 -1
- package/_cjs/utils/isSmartAccountDeployed.js +0 -15
- package/_cjs/utils/isSmartAccountDeployed.js.map +0 -1
- package/_cjs/utils/observe.js +0 -44
- package/_cjs/utils/observe.js.map +0 -1
- package/_cjs/utils/providerToSmartAccountSigner.js +0 -32
- package/_cjs/utils/providerToSmartAccountSigner.js.map +0 -1
- package/_cjs/utils/signUserOperationHashWithECDSA.js +0 -58
- package/_cjs/utils/signUserOperationHashWithECDSA.js.map +0 -1
- package/_cjs/utils/walletClientToSmartAccountSigner.js +0 -23
- package/_cjs/utils/walletClientToSmartAccountSigner.js.map +0 -1
- package/_cjs/vitest.config.js +0 -31
- package/_cjs/vitest.config.js.map +0 -1
- package/_esm/accounts/biconomy/abi/BiconomySmartAccountAbi.js +0 -105
- package/_esm/accounts/biconomy/abi/BiconomySmartAccountAbi.js.map +0 -1
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js +0 -15
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +0 -1
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +0 -268
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +0 -1
- package/_esm/accounts/index.js +0 -15
- package/_esm/accounts/index.js.map +0 -1
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js +0 -87
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js.map +0 -1
- package/_esm/accounts/kernel/abi/KernelV3AccountAbi.js +0 -107
- package/_esm/accounts/kernel/abi/KernelV3AccountAbi.js.map +0 -1
- package/_esm/accounts/kernel/abi/KernelV3MetaFactoryAbi.js +0 -18
- package/_esm/accounts/kernel/abi/KernelV3MetaFactoryAbi.js.map +0 -1
- package/_esm/accounts/kernel/constants.js +0 -24
- package/_esm/accounts/kernel/constants.js.map +0 -1
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +0 -395
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +0 -1
- package/_esm/accounts/kernel/utils/encodeCallData.js +0 -89
- package/_esm/accounts/kernel/utils/encodeCallData.js.map +0 -1
- package/_esm/accounts/kernel/utils/getExecMode.js +0 -11
- package/_esm/accounts/kernel/utils/getExecMode.js.map +0 -1
- package/_esm/accounts/kernel/utils/getNonceKey.js +0 -21
- package/_esm/accounts/kernel/utils/getNonceKey.js.map +0 -1
- package/_esm/accounts/kernel/utils/isKernelV2.js +0 -5
- package/_esm/accounts/kernel/utils/isKernelV2.js.map +0 -1
- package/_esm/accounts/kernel/utils/signMessage.js +0 -25
- package/_esm/accounts/kernel/utils/signMessage.js.map +0 -1
- package/_esm/accounts/kernel/utils/signTypedData.js +0 -39
- package/_esm/accounts/kernel/utils/signTypedData.js.map +0 -1
- package/_esm/accounts/kernel/utils/wrapMessageHash.js +0 -16
- package/_esm/accounts/kernel/utils/wrapMessageHash.js.map +0 -1
- package/_esm/accounts/light/privateKeyToLightSmartAccount.js +0 -15
- package/_esm/accounts/light/privateKeyToLightSmartAccount.js.map +0 -1
- package/_esm/accounts/light/signerToLightSmartAccount.js +0 -258
- package/_esm/accounts/light/signerToLightSmartAccount.js.map +0 -1
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js +0 -15
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js.map +0 -1
- package/_esm/accounts/safe/signerToSafeSmartAccount.js +0 -1014
- package/_esm/accounts/safe/signerToSafeSmartAccount.js.map +0 -1
- package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js +0 -15
- package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js.map +0 -1
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js +0 -261
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js.map +0 -1
- package/_esm/accounts/toSmartAccount.js +0 -80
- package/_esm/accounts/toSmartAccount.js.map +0 -1
- package/_esm/accounts/trust/privateKeyToTrustSmartAccount.js +0 -15
- package/_esm/accounts/trust/privateKeyToTrustSmartAccount.js.map +0 -1
- package/_esm/accounts/trust/signerToTrustSmartAccount.js +0 -138
- package/_esm/accounts/trust/signerToTrustSmartAccount.js.map +0 -1
- package/_esm/accounts/trust/utils/encodeCallData.js +0 -70
- package/_esm/accounts/trust/utils/encodeCallData.js.map +0 -1
- package/_esm/accounts/trust/utils/getAccountAddress.js +0 -15
- package/_esm/accounts/trust/utils/getAccountAddress.js.map +0 -1
- package/_esm/accounts/trust/utils/getDummySignature.js +0 -4
- package/_esm/accounts/trust/utils/getDummySignature.js.map +0 -1
- package/_esm/accounts/trust/utils/getFactoryData.js +0 -42
- package/_esm/accounts/trust/utils/getFactoryData.js.map +0 -1
- package/_esm/accounts/trust/utils/signMessage.js +0 -5
- package/_esm/accounts/trust/utils/signMessage.js.map +0 -1
- package/_esm/accounts/trust/utils/signTransaction.js +0 -5
- package/_esm/accounts/trust/utils/signTransaction.js.map +0 -1
- package/_esm/accounts/trust/utils/signUserOperation.js +0 -15
- package/_esm/accounts/trust/utils/signUserOperation.js.map +0 -1
- package/_esm/accounts/types.js +0 -19
- package/_esm/accounts/types.js.map +0 -1
- package/_esm/actions/bundler/chainId.js +0 -29
- package/_esm/actions/bundler/chainId.js.map +0 -1
- package/_esm/actions/bundler/estimateUserOperationGas.js +0 -72
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +0 -1
- package/_esm/actions/bundler/getUserOperationByHash.js +0 -65
- package/_esm/actions/bundler/getUserOperationByHash.js.map +0 -1
- package/_esm/actions/bundler/getUserOperationReceipt.js +0 -70
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +0 -1
- package/_esm/actions/bundler/sendUserOperation.js +0 -44
- package/_esm/actions/bundler/sendUserOperation.js.map +0 -1
- package/_esm/actions/bundler/supportedEntryPoints.js +0 -29
- package/_esm/actions/bundler/supportedEntryPoints.js.map +0 -1
- package/_esm/actions/bundler/waitForUserOperationReceipt.js +0 -83
- package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +0 -1
- package/_esm/actions/erc7579/accountId.js +0 -62
- package/_esm/actions/erc7579/accountId.js.map +0 -1
- package/_esm/actions/erc7579/installModule.js +0 -61
- package/_esm/actions/erc7579/installModule.js.map +0 -1
- package/_esm/actions/erc7579/installModules.js +0 -61
- package/_esm/actions/erc7579/installModules.js.map +0 -1
- package/_esm/actions/erc7579/isModuleInstalled.js +0 -82
- package/_esm/actions/erc7579/isModuleInstalled.js.map +0 -1
- package/_esm/actions/erc7579/supportsExecutionMode.js +0 -90
- package/_esm/actions/erc7579/supportsExecutionMode.js.map +0 -1
- package/_esm/actions/erc7579/supportsModule.js +0 -79
- package/_esm/actions/erc7579/supportsModule.js.map +0 -1
- package/_esm/actions/erc7579/uninstallModule.js +0 -61
- package/_esm/actions/erc7579/uninstallModule.js.map +0 -1
- package/_esm/actions/erc7579/uninstallModules.js +0 -61
- package/_esm/actions/erc7579/uninstallModules.js.map +0 -1
- package/_esm/actions/erc7579.js +0 -22
- package/_esm/actions/erc7579.js.map +0 -1
- package/_esm/actions/index.js +0 -12
- package/_esm/actions/index.js.map +0 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +0 -42
- package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +0 -1
- package/_esm/actions/pimlico/getUserOperationStatus.js +0 -30
- package/_esm/actions/pimlico/getUserOperationStatus.js.map +0 -1
- package/_esm/actions/pimlico/sendCompressedUserOperation.js +0 -37
- package/_esm/actions/pimlico/sendCompressedUserOperation.js.map +0 -1
- package/_esm/actions/pimlico/sponsorUserOperation.js +0 -64
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +0 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js +0 -47
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +0 -1
- package/_esm/actions/pimlico.js +0 -8
- package/_esm/actions/pimlico.js.map +0 -1
- package/_esm/actions/public/getAccountNonce.js +0 -60
- package/_esm/actions/public/getAccountNonce.js.map +0 -1
- package/_esm/actions/public/getSenderAddress.js +0 -177
- package/_esm/actions/public/getSenderAddress.js.map +0 -1
- package/_esm/actions/smartAccount/deployContract.js +0 -62
- package/_esm/actions/smartAccount/deployContract.js.map +0 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js +0 -195
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +0 -1
- package/_esm/actions/smartAccount/sendTransaction.js +0 -85
- package/_esm/actions/smartAccount/sendTransaction.js.map +0 -1
- package/_esm/actions/smartAccount/sendTransactions.js +0 -87
- package/_esm/actions/smartAccount/sendTransactions.js.map +0 -1
- package/_esm/actions/smartAccount/sendUserOperation.js +0 -17
- package/_esm/actions/smartAccount/sendUserOperation.js.map +0 -1
- package/_esm/actions/smartAccount/signMessage.js +0 -58
- package/_esm/actions/smartAccount/signMessage.js.map +0 -1
- package/_esm/actions/smartAccount/signTypedData.js +0 -128
- package/_esm/actions/smartAccount/signTypedData.js.map +0 -1
- package/_esm/actions/smartAccount/writeContract.js +0 -17
- package/_esm/actions/smartAccount/writeContract.js.map +0 -1
- package/_esm/actions/smartAccount.js +0 -10
- package/_esm/actions/smartAccount.js.map +0 -1
- package/_esm/actions/stackup/accounts.js +0 -30
- package/_esm/actions/stackup/accounts.js.map +0 -1
- package/_esm/actions/stackup/sponsorUserOperation.js +0 -53
- package/_esm/actions/stackup/sponsorUserOperation.js.map +0 -1
- package/_esm/actions/stackup.js +0 -5
- package/_esm/actions/stackup.js.map +0 -1
- package/_esm/clients/createBundlerClient.js +0 -32
- package/_esm/clients/createBundlerClient.js.map +0 -1
- package/_esm/clients/createSmartAccountClient.js +0 -35
- package/_esm/clients/createSmartAccountClient.js.map +0 -1
- package/_esm/clients/decorators/bundler.js +0 -21
- package/_esm/clients/decorators/bundler.js.map +0 -1
- package/_esm/clients/decorators/pimlico.js +0 -64
- package/_esm/clients/decorators/pimlico.js.map +0 -1
- package/_esm/clients/decorators/smartAccount.js +0 -39
- package/_esm/clients/decorators/smartAccount.js.map +0 -1
- package/_esm/clients/decorators/stackup.js +0 -10
- package/_esm/clients/decorators/stackup.js.map +0 -1
- package/_esm/clients/pimlico.js +0 -64
- package/_esm/clients/pimlico.js.map +0 -1
- package/_esm/clients/stackup.js +0 -35
- package/_esm/clients/stackup.js.map +0 -1
- package/_esm/errors/account.js +0 -298
- package/_esm/errors/account.js.map +0 -1
- package/_esm/errors/bundler.js +0 -56
- package/_esm/errors/bundler.js.map +0 -1
- package/_esm/errors/estimateUserOperationGas.js +0 -49
- package/_esm/errors/estimateUserOperationGas.js.map +0 -1
- package/_esm/errors/gas.js +0 -106
- package/_esm/errors/gas.js.map +0 -1
- package/_esm/errors/index.js +0 -8
- package/_esm/errors/index.js.map +0 -1
- package/_esm/errors/paymaster.js +0 -218
- package/_esm/errors/paymaster.js.map +0 -1
- package/_esm/errors/sendUserOperation.js +0 -33
- package/_esm/errors/sendUserOperation.js.map +0 -1
- package/_esm/errors/utils.js +0 -14
- package/_esm/errors/utils.js.map +0 -1
- package/_esm/experimental/eip7677/actions/getPaymasterData.js +0 -37
- package/_esm/experimental/eip7677/actions/getPaymasterData.js.map +0 -1
- package/_esm/experimental/eip7677/actions/getPaymasterStubData.js +0 -47
- package/_esm/experimental/eip7677/actions/getPaymasterStubData.js.map +0 -1
- package/_esm/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js +0 -18
- package/_esm/experimental/eip7677/clients/decorators/paymasterActionsEip7677.js.map +0 -1
- package/_esm/experimental/eip7677/index.js +0 -5
- package/_esm/experimental/eip7677/index.js.map +0 -1
- package/_esm/experimental/eip7677/types/paymaster.js +0 -2
- package/_esm/experimental/eip7677/types/paymaster.js.map +0 -1
- package/_esm/experimental/index.js +0 -2
- package/_esm/experimental/index.js.map +0 -1
- package/_esm/index.js +0 -20
- package/_esm/index.js.map +0 -1
- package/_esm/package.json +0 -1
- package/_esm/types/bundler.js +0 -2
- package/_esm/types/bundler.js.map +0 -1
- package/_esm/types/entrypoint.js +0 -2
- package/_esm/types/entrypoint.js.map +0 -1
- package/_esm/types/index.js +0 -2
- package/_esm/types/index.js.map +0 -1
- package/_esm/types/pimlico.js +0 -2
- package/_esm/types/pimlico.js.map +0 -1
- package/_esm/types/stackup.js +0 -2
- package/_esm/types/stackup.js.map +0 -1
- package/_esm/types/userOperation.js +0 -2
- package/_esm/types/userOperation.js.map +0 -1
- package/_esm/utils/decodeNonce.js +0 -8
- package/_esm/utils/decodeNonce.js.map +0 -1
- package/_esm/utils/deepHexlify.js +0 -30
- package/_esm/utils/deepHexlify.js.map +0 -1
- package/_esm/utils/encode7579CallData.js +0 -77
- package/_esm/utils/encode7579CallData.js.map +0 -1
- package/_esm/utils/encodeNonce.js +0 -7
- package/_esm/utils/encodeNonce.js.map +0 -1
- package/_esm/utils/errors/getBundlerError.js +0 -121
- package/_esm/utils/errors/getBundlerError.js.map +0 -1
- package/_esm/utils/errors/getEstimateUserOperationGasError.js +0 -18
- package/_esm/utils/errors/getEstimateUserOperationGasError.js.map +0 -1
- package/_esm/utils/errors/getSendUserOperationError.js +0 -15
- package/_esm/utils/errors/getSendUserOperationError.js.map +0 -1
- package/_esm/utils/getAddressFromInitCodeOrPaymasterAndData.js +0 -11
- package/_esm/utils/getAddressFromInitCodeOrPaymasterAndData.js.map +0 -1
- package/_esm/utils/getEntryPointVersion.js +0 -11
- package/_esm/utils/getEntryPointVersion.js.map +0 -1
- package/_esm/utils/getPackedUserOperation.js +0 -94
- package/_esm/utils/getPackedUserOperation.js.map +0 -1
- package/_esm/utils/getRequiredPrefund.js +0 -37
- package/_esm/utils/getRequiredPrefund.js.map +0 -1
- package/_esm/utils/getUserOperationHash.js +0 -111
- package/_esm/utils/getUserOperationHash.js.map +0 -1
- package/_esm/utils/index.js +0 -19
- package/_esm/utils/index.js.map +0 -1
- package/_esm/utils/isSmartAccountDeployed.js +0 -11
- package/_esm/utils/isSmartAccountDeployed.js.map +0 -1
- package/_esm/utils/observe.js +0 -47
- package/_esm/utils/observe.js.map +0 -1
- package/_esm/utils/providerToSmartAccountSigner.js +0 -28
- package/_esm/utils/providerToSmartAccountSigner.js.map +0 -1
- package/_esm/utils/signUserOperationHashWithECDSA.js +0 -76
- package/_esm/utils/signUserOperationHashWithECDSA.js.map +0 -1
- package/_esm/utils/walletClientToSmartAccountSigner.js +0 -19
- package/_esm/utils/walletClientToSmartAccountSigner.js.map +0 -1
- package/_esm/vitest.config.js +0 -29
- package/_esm/vitest.config.js.map +0 -1
- package/_types/accounts/biconomy/abi/BiconomySmartAccountAbi.d.ts +0 -59
- package/_types/accounts/biconomy/abi/BiconomySmartAccountAbi.d.ts.map +0 -1
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts +0 -13
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts.map +0 -1
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +0 -29
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +0 -1
- package/_types/accounts/index.d.ts +0 -15
- package/_types/accounts/index.d.ts.map +0 -1
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts +0 -68
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts.map +0 -1
- package/_types/accounts/kernel/abi/KernelV3AccountAbi.d.ts +0 -135
- package/_types/accounts/kernel/abi/KernelV3AccountAbi.d.ts.map +0 -1
- package/_types/accounts/kernel/abi/KernelV3MetaFactoryAbi.d.ts +0 -24
- package/_types/accounts/kernel/abi/KernelV3MetaFactoryAbi.d.ts.map +0 -1
- package/_types/accounts/kernel/constants.d.ts +0 -21
- package/_types/accounts/kernel/constants.d.ts.map +0 -1
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +0 -44
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +0 -1
- package/_types/accounts/kernel/utils/encodeCallData.d.ts +0 -13
- package/_types/accounts/kernel/utils/encodeCallData.d.ts.map +0 -1
- package/_types/accounts/kernel/utils/getExecMode.d.ts +0 -7
- package/_types/accounts/kernel/utils/getExecMode.d.ts.map +0 -1
- package/_types/accounts/kernel/utils/getNonceKey.d.ts +0 -5
- package/_types/accounts/kernel/utils/getNonceKey.d.ts.map +0 -1
- package/_types/accounts/kernel/utils/isKernelV2.d.ts +0 -4
- package/_types/accounts/kernel/utils/isKernelV2.d.ts.map +0 -1
- package/_types/accounts/kernel/utils/signMessage.d.ts +0 -4
- package/_types/accounts/kernel/utils/signMessage.d.ts.map +0 -1
- package/_types/accounts/kernel/utils/signTypedData.d.ts +0 -4
- package/_types/accounts/kernel/utils/signTypedData.d.ts.map +0 -1
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts +0 -11
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts.map +0 -1
- package/_types/accounts/light/privateKeyToLightSmartAccount.d.ts +0 -14
- package/_types/accounts/light/privateKeyToLightSmartAccount.d.ts.map +0 -1
- package/_types/accounts/light/signerToLightSmartAccount.d.ts +0 -22
- package/_types/accounts/light/signerToLightSmartAccount.d.ts.map +0 -1
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts +0 -13
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts.map +0 -1
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts +0 -61
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts.map +0 -1
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts +0 -13
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts.map +0 -1
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts +0 -20
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts.map +0 -1
- package/_types/accounts/toSmartAccount.d.ts +0 -26
- package/_types/accounts/toSmartAccount.d.ts.map +0 -1
- package/_types/accounts/trust/privateKeyToTrustSmartAccount.d.ts +0 -13
- package/_types/accounts/trust/privateKeyToTrustSmartAccount.d.ts.map +0 -1
- package/_types/accounts/trust/signerToTrustSmartAccount.d.ts +0 -27
- package/_types/accounts/trust/signerToTrustSmartAccount.d.ts.map +0 -1
- package/_types/accounts/trust/utils/encodeCallData.d.ts +0 -12
- package/_types/accounts/trust/utils/encodeCallData.d.ts.map +0 -1
- package/_types/accounts/trust/utils/getAccountAddress.d.ts +0 -10
- package/_types/accounts/trust/utils/getAccountAddress.d.ts.map +0 -1
- package/_types/accounts/trust/utils/getDummySignature.d.ts +0 -3
- package/_types/accounts/trust/utils/getDummySignature.d.ts.map +0 -1
- package/_types/accounts/trust/utils/getFactoryData.d.ts +0 -10
- package/_types/accounts/trust/utils/getFactoryData.d.ts.map +0 -1
- package/_types/accounts/trust/utils/signMessage.d.ts +0 -4
- package/_types/accounts/trust/utils/signMessage.d.ts.map +0 -1
- package/_types/accounts/trust/utils/signTransaction.d.ts +0 -5
- package/_types/accounts/trust/utils/signTransaction.d.ts.map +0 -1
- package/_types/accounts/trust/utils/signUserOperation.d.ts +0 -9
- package/_types/accounts/trust/utils/signUserOperation.d.ts.map +0 -1
- package/_types/accounts/types.d.ts +0 -32
- package/_types/accounts/types.d.ts.map +0 -1
- package/_types/actions/bundler/chainId.d.ts +0 -27
- package/_types/actions/bundler/chainId.d.ts.map +0 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +0 -91
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +0 -1
- package/_types/actions/bundler/getUserOperationByHash.d.ts +0 -39
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +0 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +0 -58
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +0 -1
- package/_types/actions/bundler/sendUserOperation.d.ts +0 -39
- package/_types/actions/bundler/sendUserOperation.d.ts.map +0 -1
- package/_types/actions/bundler/supportedEntryPoints.d.ts +0 -27
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +0 -1
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +0 -43
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +0 -1
- package/_types/actions/erc7579/accountId.d.ts +0 -6
- package/_types/actions/erc7579/accountId.d.ts.map +0 -1
- package/_types/actions/erc7579/installModule.d.ts +0 -16
- package/_types/actions/erc7579/installModule.d.ts.map +0 -1
- package/_types/actions/erc7579/installModules.d.ts +0 -18
- package/_types/actions/erc7579/installModules.d.ts.map +0 -1
- package/_types/actions/erc7579/isModuleInstalled.d.ts +0 -12
- package/_types/actions/erc7579/isModuleInstalled.d.ts.map +0 -1
- package/_types/actions/erc7579/supportsExecutionMode.d.ts +0 -15
- package/_types/actions/erc7579/supportsExecutionMode.d.ts.map +0 -1
- package/_types/actions/erc7579/supportsModule.d.ts +0 -11
- package/_types/actions/erc7579/supportsModule.d.ts.map +0 -1
- package/_types/actions/erc7579/uninstallModule.d.ts +0 -16
- package/_types/actions/erc7579/uninstallModule.d.ts.map +0 -1
- package/_types/actions/erc7579/uninstallModules.d.ts +0 -20
- package/_types/actions/erc7579/uninstallModules.d.ts.map +0 -1
- package/_types/actions/erc7579.d.ts +0 -30
- package/_types/actions/erc7579.d.ts.map +0 -1
- package/_types/actions/index.d.ts +0 -20
- package/_types/actions/index.d.ts.map +0 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +0 -40
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +0 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +0 -32
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +0 -1
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts +0 -35
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts.map +0 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +0 -52
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +0 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +0 -56
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +0 -1
- package/_types/actions/pimlico.d.ts +0 -10
- package/_types/actions/pimlico.d.ts.map +0 -1
- package/_types/actions/public/getAccountNonce.d.ts +0 -36
- package/_types/actions/public/getAccountNonce.d.ts.map +0 -1
- package/_types/actions/public/getSenderAddress.d.ts +0 -48
- package/_types/actions/public/getSenderAddress.d.ts.map +0 -1
- package/_types/actions/smartAccount/deployContract.d.ts +0 -36
- package/_types/actions/smartAccount/deployContract.d.ts.map +0 -1
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts +0 -28
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +0 -1
- package/_types/actions/smartAccount/sendTransaction.d.ts +0 -54
- package/_types/actions/smartAccount/sendTransaction.d.ts.map +0 -1
- package/_types/actions/smartAccount/sendTransactions.d.ts +0 -64
- package/_types/actions/smartAccount/sendTransactions.d.ts.map +0 -1
- package/_types/actions/smartAccount/sendUserOperation.d.ts +0 -10
- package/_types/actions/smartAccount/sendUserOperation.d.ts.map +0 -1
- package/_types/actions/smartAccount/signMessage.d.ts +0 -51
- package/_types/actions/smartAccount/signMessage.d.ts.map +0 -1
- package/_types/actions/smartAccount/signTypedData.d.ts +0 -105
- package/_types/actions/smartAccount/signTypedData.d.ts.map +0 -1
- package/_types/actions/smartAccount/writeContract.d.ts +0 -58
- package/_types/actions/smartAccount/writeContract.d.ts.map +0 -1
- package/_types/actions/smartAccount.d.ts +0 -10
- package/_types/actions/smartAccount.d.ts.map +0 -1
- package/_types/actions/stackup/accounts.d.ts +0 -30
- package/_types/actions/stackup/accounts.d.ts.map +0 -1
- package/_types/actions/stackup/sponsorUserOperation.d.ts +0 -38
- package/_types/actions/stackup/sponsorUserOperation.d.ts.map +0 -1
- package/_types/actions/stackup.d.ts +0 -7
- package/_types/actions/stackup.d.ts.map +0 -1
- package/_types/clients/createBundlerClient.d.ts +0 -28
- package/_types/clients/createBundlerClient.d.ts.map +0 -1
- package/_types/clients/createSmartAccountClient.d.ts +0 -40
- package/_types/clients/createSmartAccountClient.d.ts.map +0 -1
- package/_types/clients/decorators/bundler.d.ts +0 -175
- package/_types/clients/decorators/bundler.d.ts.map +0 -1
- package/_types/clients/decorators/pimlico.d.ts +0 -142
- package/_types/clients/decorators/pimlico.d.ts.map +0 -1
- package/_types/clients/decorators/smartAccount.d.ts +0 -330
- package/_types/clients/decorators/smartAccount.d.ts.map +0 -1
- package/_types/clients/decorators/stackup.d.ts +0 -55
- package/_types/clients/decorators/stackup.d.ts.map +0 -1
- package/_types/clients/pimlico.d.ts +0 -52
- package/_types/clients/pimlico.d.ts.map +0 -1
- package/_types/clients/stackup.d.ts +0 -29
- package/_types/clients/stackup.d.ts.map +0 -1
- package/_types/errors/account.d.ts +0 -121
- package/_types/errors/account.d.ts.map +0 -1
- package/_types/errors/bundler.d.ts +0 -24
- package/_types/errors/bundler.d.ts.map +0 -1
- package/_types/errors/estimateUserOperationGas.d.ts +0 -14
- package/_types/errors/estimateUserOperationGas.d.ts.map +0 -1
- package/_types/errors/gas.d.ts +0 -47
- package/_types/errors/gas.d.ts.map +0 -1
- package/_types/errors/index.d.ts +0 -8
- package/_types/errors/index.d.ts.map +0 -1
- package/_types/errors/paymaster.d.ts +0 -85
- package/_types/errors/paymaster.d.ts.map +0 -1
- package/_types/errors/sendUserOperation.d.ts +0 -14
- package/_types/errors/sendUserOperation.d.ts.map +0 -1
- package/_types/errors/utils.d.ts +0 -5
- package/_types/errors/utils.d.ts.map +0 -1
- package/_types/experimental/eip7677/actions/getPaymasterData.d.ts +0 -51
- package/_types/experimental/eip7677/actions/getPaymasterData.d.ts.map +0 -1
- package/_types/experimental/eip7677/actions/getPaymasterStubData.d.ts +0 -63
- package/_types/experimental/eip7677/actions/getPaymasterStubData.d.ts.map +0 -1
- package/_types/experimental/eip7677/clients/decorators/paymasterActionsEip7677.d.ts +0 -11
- package/_types/experimental/eip7677/clients/decorators/paymasterActionsEip7677.d.ts.map +0 -1
- package/_types/experimental/eip7677/index.d.ts +0 -6
- package/_types/experimental/eip7677/index.d.ts.map +0 -1
- package/_types/experimental/eip7677/types/paymaster.d.ts +0 -52
- package/_types/experimental/eip7677/types/paymaster.d.ts.map +0 -1
- package/_types/experimental/index.d.ts +0 -2
- package/_types/experimental/index.d.ts.map +0 -1
- package/_types/index.d.ts +0 -33
- package/_types/index.d.ts.map +0 -1
- package/_types/types/bundler.d.ts +0 -110
- package/_types/types/bundler.d.ts.map +0 -1
- package/_types/types/entrypoint.d.ts +0 -6
- package/_types/types/entrypoint.d.ts.map +0 -1
- package/_types/types/index.d.ts +0 -27
- package/_types/types/index.d.ts.map +0 -1
- package/_types/types/pimlico.d.ts +0 -93
- package/_types/types/pimlico.d.ts.map +0 -1
- package/_types/types/stackup.d.ts +0 -49
- package/_types/types/stackup.d.ts.map +0 -1
- package/_types/types/userOperation.d.ts +0 -93
- package/_types/types/userOperation.d.ts.map +0 -1
- package/_types/utils/decodeNonce.d.ts +0 -5
- package/_types/utils/decodeNonce.d.ts.map +0 -1
- package/_types/utils/deepHexlify.d.ts +0 -6
- package/_types/utils/deepHexlify.d.ts.map +0 -1
- package/_types/utils/encode7579CallData.d.ts +0 -16
- package/_types/utils/encode7579CallData.d.ts.map +0 -1
- package/_types/utils/encodeNonce.d.ts +0 -5
- package/_types/utils/encodeNonce.d.ts.map +0 -1
- package/_types/utils/errors/getBundlerError.d.ts +0 -11
- package/_types/utils/errors/getBundlerError.d.ts.map +0 -1
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts +0 -10
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts.map +0 -1
- package/_types/utils/errors/getSendUserOperationError.d.ts +0 -5
- package/_types/utils/errors/getSendUserOperationError.d.ts.map +0 -1
- package/_types/utils/getAddressFromInitCodeOrPaymasterAndData.d.ts +0 -3
- package/_types/utils/getAddressFromInitCodeOrPaymasterAndData.d.ts.map +0 -1
- package/_types/utils/getEntryPointVersion.d.ts +0 -8
- package/_types/utils/getEntryPointVersion.d.ts.map +0 -1
- package/_types/utils/getPackedUserOperation.d.ts +0 -39
- package/_types/utils/getPackedUserOperation.d.ts.map +0 -1
- package/_types/utils/getRequiredPrefund.d.ts +0 -21
- package/_types/utils/getRequiredPrefund.d.ts.map +0 -1
- package/_types/utils/getUserOperationHash.d.ts +0 -31
- package/_types/utils/getUserOperationHash.d.ts.map +0 -1
- package/_types/utils/index.d.ts +0 -16
- package/_types/utils/index.d.ts.map +0 -1
- package/_types/utils/isSmartAccountDeployed.d.ts +0 -3
- package/_types/utils/isSmartAccountDeployed.d.ts.map +0 -1
- package/_types/utils/observe.d.ts +0 -17
- package/_types/utils/observe.d.ts.map +0 -1
- package/_types/utils/providerToSmartAccountSigner.d.ts +0 -5
- package/_types/utils/providerToSmartAccountSigner.d.ts.map +0 -1
- package/_types/utils/signUserOperationHashWithECDSA.d.ts +0 -45
- package/_types/utils/signUserOperationHashWithECDSA.d.ts.map +0 -1
- package/_types/utils/walletClientToSmartAccountSigner.d.ts +0 -4
- package/_types/utils/walletClientToSmartAccountSigner.d.ts.map +0 -1
- package/_types/vitest.config.d.ts +0 -3
- package/_types/vitest.config.d.ts.map +0 -1
- package/accounts/biconomy/privateKeyToBiconomySmartAccount.ts +0 -57
- package/accounts/biconomy/signerToBiconomySmartAccount.ts +0 -454
- package/accounts/kernel/utils/getExecMode.ts +0 -18
- package/accounts/light/privateKeyToLightSmartAccount.ts +0 -51
- package/accounts/light/signerToLightSmartAccount.ts +0 -418
- package/accounts/safe/privateKeyToSafeSmartAccount.ts +0 -50
- package/accounts/simple/privateKeyToSimpleSmartAccount.ts +0 -60
- package/accounts/simple/signerToSimpleSmartAccount.ts +0 -374
- package/accounts/toSmartAccount.ts +0 -175
- package/accounts/trust/privateKeyToTrustSmartAccount.ts +0 -50
- package/accounts/trust/signerToTrustSmartAccount.ts +0 -242
- package/accounts/trust/utils/getAccountAddress.ts +0 -42
- package/accounts/trust/utils/getDummySignature.ts +0 -12
- package/accounts/trust/utils/signMessage.ts +0 -13
- package/accounts/trust/utils/signTransaction.ts +0 -15
- package/accounts/trust/utils/signUserOperation.ts +0 -38
- package/accounts/types.ts +0 -83
- package/actions/bundler/chainId.test.ts +0 -25
- package/actions/bundler/chainId.ts +0 -42
- package/actions/bundler/estimateUserOperationGas.test.ts +0 -205
- package/actions/bundler/estimateUserOperationGas.ts +0 -146
- package/actions/bundler/getUserOperationByHash.test.ts +0 -139
- package/actions/bundler/getUserOperationByHash.ts +0 -110
- package/actions/bundler/getUserOperationReceipt.test.ts +0 -127
- package/actions/bundler/getUserOperationReceipt.ts +0 -127
- package/actions/bundler/sendUserOperation.test.ts +0 -126
- package/actions/bundler/sendUserOperation.ts +0 -72
- package/actions/bundler/supportedEntryPoints.test.ts +0 -27
- package/actions/bundler/supportedEntryPoints.ts +0 -40
- package/actions/bundler/waitForUserOperationReceipt.test.ts +0 -130
- package/actions/bundler/waitForUserOperationReceipt.ts +0 -130
- package/actions/index.test.ts +0 -329
- package/actions/pimlico.test.ts +0 -222
- package/actions/smartAccount/deployContract.test.ts +0 -118
- package/actions/smartAccount/deployContract.ts +0 -129
- package/actions/smartAccount/prepareUserOperationRequest.test.ts +0 -520
- package/actions/smartAccount/prepareUserOperationRequest.ts +0 -472
- package/actions/smartAccount/sendTransactions.test.ts +0 -126
- package/actions/smartAccount/sendTransactions.ts +0 -169
- package/actions/smartAccount/sendUserOperation.test.ts +0 -133
- package/actions/smartAccount/sendUserOperation.ts +0 -113
- package/actions/smartAccount/writeContract.test.ts +0 -196
- package/actions/smartAccount.test.ts +0 -198
- package/actions/stackup/accounts.ts +0 -41
- package/actions/stackup/sponsorUserOperation.ts +0 -126
- package/actions/stackup.ts +0 -17
- package/clients/createBundlerClient.test.ts +0 -26
- package/clients/createBundlerClient.ts +0 -59
- package/clients/createSmartAccountClient.test.ts +0 -55
- package/clients/decorators/bundler.ts +0 -253
- package/clients/decorators/smartAccount.test.ts +0 -55
- package/clients/decorators/stackup.ts +0 -77
- package/clients/stackup.ts +0 -63
- package/errors/account.ts +0 -345
- package/errors/bundler.ts +0 -62
- package/errors/estimateUserOperationGas.ts +0 -60
- package/errors/gas.ts +0 -120
- package/errors/paymaster.ts +0 -257
- package/errors/sendUserOperation.ts +0 -43
- package/errors/utils.ts +0 -19
- package/experimental/eip7677/actions/getPaymasterData.test.ts +0 -137
- package/experimental/eip7677/actions/getPaymasterData.ts +0 -157
- package/experimental/eip7677/actions/getPaymasterStubData.test.ts +0 -90
- package/experimental/eip7677/actions/getPaymasterStubData.ts +0 -173
- package/experimental/eip7677/clients/decorators/paymasterActionsEip7677.ts +0 -77
- package/experimental/eip7677/index.ts +0 -27
- package/experimental/eip7677/types/paymaster.ts +0 -63
- package/experimental/index.ts +0 -1
- package/types/bundler.ts +0 -131
- package/types/entrypoint.ts +0 -13
- package/types/index.ts +0 -48
- package/types/stackup.ts +0 -63
- package/types/userOperation.ts +0 -102
- package/utils/errors/getBundlerError.ts +0 -224
- package/utils/errors/getEstimateUserOperationGasError.ts +0 -40
- package/utils/errors/getSendUserOperationError.ts +0 -26
- package/utils/getEntryPointVersion.test.ts +0 -52
- package/utils/getEntryPointVersion.ts +0 -31
- package/utils/getUserOperationHash.ts +0 -158
- package/utils/observe.ts +0 -74
- package/utils/signUserOperationHashWithECDSA.ts +0 -134
|
@@ -1,59 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
* The exeuctor abi, used to execute transactions on the Biconomy Modular Smart Account
|
|
3
|
-
*/
|
|
4
|
-
export const BiconomyExecuteAbi = [
|
|
1
|
+
export const FactoryAbi = [
|
|
5
2
|
{
|
|
6
3
|
inputs: [
|
|
7
4
|
{
|
|
8
5
|
internalType: "address",
|
|
9
|
-
name: "
|
|
6
|
+
name: "moduleSetupContract",
|
|
10
7
|
type: "address"
|
|
11
8
|
},
|
|
12
|
-
{
|
|
13
|
-
internalType: "uint256",
|
|
14
|
-
name: "value",
|
|
15
|
-
type: "uint256"
|
|
16
|
-
},
|
|
17
9
|
{
|
|
18
10
|
internalType: "bytes",
|
|
19
|
-
name: "
|
|
11
|
+
name: "moduleSetupData",
|
|
20
12
|
type: "bytes"
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
name: "execute_ncC",
|
|
24
|
-
outputs: [],
|
|
25
|
-
stateMutability: "nonpayable",
|
|
26
|
-
type: "function"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
inputs: [
|
|
30
|
-
{
|
|
31
|
-
internalType: "address[]",
|
|
32
|
-
name: "dest",
|
|
33
|
-
type: "address[]"
|
|
34
13
|
},
|
|
35
14
|
{
|
|
36
|
-
internalType: "uint256
|
|
37
|
-
name: "
|
|
38
|
-
type: "uint256
|
|
39
|
-
}
|
|
15
|
+
internalType: "uint256",
|
|
16
|
+
name: "index",
|
|
17
|
+
type: "uint256"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
name: "deployCounterFactualAccount",
|
|
21
|
+
outputs: [
|
|
40
22
|
{
|
|
41
|
-
internalType: "
|
|
42
|
-
name: "
|
|
43
|
-
type: "
|
|
23
|
+
internalType: "address",
|
|
24
|
+
name: "proxy",
|
|
25
|
+
type: "address"
|
|
44
26
|
}
|
|
45
27
|
],
|
|
46
|
-
name: "executeBatch_y6U",
|
|
47
|
-
outputs: [],
|
|
48
28
|
stateMutability: "nonpayable",
|
|
49
29
|
type: "function"
|
|
50
30
|
}
|
|
51
31
|
] as const
|
|
52
32
|
|
|
53
|
-
|
|
54
|
-
* The init abi, used to initialise Biconomy Modular Smart Account / setup default ECDSA module
|
|
55
|
-
*/
|
|
56
|
-
export const BiconomyInitAbi = [
|
|
33
|
+
export const BiconomyAbi = [
|
|
57
34
|
{
|
|
58
35
|
inputs: [
|
|
59
36
|
{
|
|
@@ -101,5 +78,51 @@ export const BiconomyInitAbi = [
|
|
|
101
78
|
],
|
|
102
79
|
stateMutability: "nonpayable",
|
|
103
80
|
type: "function"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
inputs: [
|
|
84
|
+
{
|
|
85
|
+
internalType: "address",
|
|
86
|
+
name: "dest",
|
|
87
|
+
type: "address"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
internalType: "uint256",
|
|
91
|
+
name: "value",
|
|
92
|
+
type: "uint256"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
internalType: "bytes",
|
|
96
|
+
name: "func",
|
|
97
|
+
type: "bytes"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
name: "execute_ncC",
|
|
101
|
+
outputs: [],
|
|
102
|
+
stateMutability: "nonpayable",
|
|
103
|
+
type: "function"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
inputs: [
|
|
107
|
+
{
|
|
108
|
+
internalType: "address[]",
|
|
109
|
+
name: "dest",
|
|
110
|
+
type: "address[]"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
internalType: "uint256[]",
|
|
114
|
+
name: "value",
|
|
115
|
+
type: "uint256[]"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
internalType: "bytes[]",
|
|
119
|
+
name: "func",
|
|
120
|
+
type: "bytes[]"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
name: "executeBatch_y6U",
|
|
124
|
+
outputs: [],
|
|
125
|
+
stateMutability: "nonpayable",
|
|
126
|
+
type: "function"
|
|
104
127
|
}
|
|
105
|
-
]
|
|
128
|
+
] as const
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import type { Assign, Prettify } from "viem"
|
|
2
|
+
import {
|
|
3
|
+
type Address,
|
|
4
|
+
type Client,
|
|
5
|
+
type Hex,
|
|
6
|
+
type LocalAccount,
|
|
7
|
+
encodeAbiParameters,
|
|
8
|
+
encodeFunctionData,
|
|
9
|
+
parseAbiParameters
|
|
10
|
+
} from "viem"
|
|
11
|
+
import {
|
|
12
|
+
type SmartAccount,
|
|
13
|
+
type SmartAccountImplementation,
|
|
14
|
+
entryPoint06Abi,
|
|
15
|
+
entryPoint06Address,
|
|
16
|
+
getUserOperationHash,
|
|
17
|
+
toSmartAccount
|
|
18
|
+
} from "viem/account-abstraction"
|
|
19
|
+
import { signMessage } from "viem/actions"
|
|
20
|
+
import { getAccountNonce } from "../../actions/public/getAccountNonce"
|
|
21
|
+
import { getSenderAddress } from "../../actions/public/getSenderAddress"
|
|
22
|
+
import { BiconomyAbi, FactoryAbi } from "./abi/BiconomySmartAccountAbi"
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The account creation ABI for Biconomy Smart Account (from the biconomy SmartAccountFactory)
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Default addresses for Biconomy Smart Account
|
|
30
|
+
*/
|
|
31
|
+
const BICONOMY_ADDRESSES: {
|
|
32
|
+
ECDSA_OWNERSHIP_REGISTRY_MODULE: Address
|
|
33
|
+
FACTORY_ADDRESS: Address
|
|
34
|
+
} = {
|
|
35
|
+
ECDSA_OWNERSHIP_REGISTRY_MODULE:
|
|
36
|
+
"0x0000001c5b32F37F5beA87BDD5374eB2aC54eA8e",
|
|
37
|
+
FACTORY_ADDRESS: "0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get the account initialization code for Biconomy smart account with ECDSA as default authorization module
|
|
42
|
+
* @param owner
|
|
43
|
+
* @param index
|
|
44
|
+
* @param factoryAddress
|
|
45
|
+
* @param ecdsaValidatorAddress
|
|
46
|
+
*/
|
|
47
|
+
const getAccountInitCode = async ({
|
|
48
|
+
owner,
|
|
49
|
+
index,
|
|
50
|
+
ecdsaModuleAddress
|
|
51
|
+
}: {
|
|
52
|
+
owner: Address
|
|
53
|
+
index: bigint
|
|
54
|
+
ecdsaModuleAddress: Address
|
|
55
|
+
}): Promise<Hex> => {
|
|
56
|
+
if (!owner) throw new Error("Owner account not found")
|
|
57
|
+
|
|
58
|
+
// Build the module setup data
|
|
59
|
+
const ecdsaOwnershipInitData = encodeFunctionData({
|
|
60
|
+
abi: BiconomyAbi,
|
|
61
|
+
functionName: "initForSmartAccount",
|
|
62
|
+
args: [owner]
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
// Build the account init code
|
|
66
|
+
return encodeFunctionData({
|
|
67
|
+
abi: FactoryAbi,
|
|
68
|
+
functionName: "deployCounterFactualAccount",
|
|
69
|
+
args: [ecdsaModuleAddress, ecdsaOwnershipInitData, index]
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type ToBiconomySmartAccountParameters = Prettify<{
|
|
74
|
+
client: Client
|
|
75
|
+
owner: LocalAccount
|
|
76
|
+
address?: Address | undefined
|
|
77
|
+
entryPoint?: {
|
|
78
|
+
address: Address
|
|
79
|
+
version: "0.6"
|
|
80
|
+
}
|
|
81
|
+
nonceKey?: bigint
|
|
82
|
+
index?: bigint
|
|
83
|
+
factoryAddress?: Address
|
|
84
|
+
ecdsaModuleAddress?: Address
|
|
85
|
+
}>
|
|
86
|
+
|
|
87
|
+
export type BiconomySmartAccountImplementation = Assign<
|
|
88
|
+
SmartAccountImplementation<typeof entryPoint06Abi, "0.6">,
|
|
89
|
+
{ sign: NonNullable<SmartAccountImplementation["sign"]> }
|
|
90
|
+
>
|
|
91
|
+
|
|
92
|
+
export type ToBiconomySmartAccountReturnType = Prettify<
|
|
93
|
+
SmartAccount<BiconomySmartAccountImplementation>
|
|
94
|
+
>
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Build a Biconomy modular smart account from a private key, that use the ECDSA signer behind the scene
|
|
98
|
+
* @param client
|
|
99
|
+
* @param privateKey
|
|
100
|
+
* @param entryPoint
|
|
101
|
+
* @param index
|
|
102
|
+
* @param factoryAddress
|
|
103
|
+
* @param ecdsaModuleAddress
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
export async function toBiconomySmartAccount(
|
|
107
|
+
parameters: ToBiconomySmartAccountParameters
|
|
108
|
+
): Promise<ToBiconomySmartAccountReturnType> {
|
|
109
|
+
const { owner, client, index = 0n, address } = parameters
|
|
110
|
+
|
|
111
|
+
const entryPoint = {
|
|
112
|
+
address: parameters.entryPoint?.address ?? entryPoint06Address,
|
|
113
|
+
abi: entryPoint06Abi,
|
|
114
|
+
version: parameters.entryPoint?.version ?? "0.6"
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const factoryAddress =
|
|
118
|
+
parameters.factoryAddress ?? BICONOMY_ADDRESSES.FACTORY_ADDRESS
|
|
119
|
+
|
|
120
|
+
let accountAddress: Address | undefined = address
|
|
121
|
+
|
|
122
|
+
const ecdsaModuleAddress =
|
|
123
|
+
parameters.ecdsaModuleAddress ??
|
|
124
|
+
BICONOMY_ADDRESSES.ECDSA_OWNERSHIP_REGISTRY_MODULE
|
|
125
|
+
|
|
126
|
+
const getFactoryArgs = async () => {
|
|
127
|
+
return {
|
|
128
|
+
factory: factoryAddress,
|
|
129
|
+
factoryData: await getAccountInitCode({
|
|
130
|
+
owner: owner.address,
|
|
131
|
+
index,
|
|
132
|
+
ecdsaModuleAddress
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return toSmartAccount({
|
|
138
|
+
client,
|
|
139
|
+
entryPoint,
|
|
140
|
+
getFactoryArgs,
|
|
141
|
+
async getAddress() {
|
|
142
|
+
if (accountAddress) return accountAddress
|
|
143
|
+
|
|
144
|
+
const { factory, factoryData } = await getFactoryArgs()
|
|
145
|
+
|
|
146
|
+
// Get the sender address based on the init code
|
|
147
|
+
accountAddress = await getSenderAddress(client, {
|
|
148
|
+
factory,
|
|
149
|
+
factoryData,
|
|
150
|
+
entryPointAddress: entryPoint.address
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
return accountAddress
|
|
154
|
+
},
|
|
155
|
+
async getNonce(args) {
|
|
156
|
+
const address = await this.getAddress()
|
|
157
|
+
return getAccountNonce(client, {
|
|
158
|
+
address,
|
|
159
|
+
entryPointAddress: entryPoint.address,
|
|
160
|
+
key: args?.key ?? parameters?.nonceKey
|
|
161
|
+
})
|
|
162
|
+
},
|
|
163
|
+
encodeCalls: async (calls) => {
|
|
164
|
+
if (calls.length > 1) {
|
|
165
|
+
// Encode a batched call
|
|
166
|
+
return encodeFunctionData({
|
|
167
|
+
abi: BiconomyAbi,
|
|
168
|
+
functionName: "executeBatch_y6U",
|
|
169
|
+
args: [
|
|
170
|
+
calls.map((a) => a.to),
|
|
171
|
+
calls.map((a) => a.value ?? 0n),
|
|
172
|
+
calls.map((a) => a.data ?? "0x")
|
|
173
|
+
]
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
const { to, value, data } = calls[0]
|
|
177
|
+
// Encode a simple call
|
|
178
|
+
return encodeFunctionData({
|
|
179
|
+
abi: BiconomyAbi,
|
|
180
|
+
functionName: "execute_ncC",
|
|
181
|
+
args: [to, value ?? 0n, data ?? "0x"]
|
|
182
|
+
})
|
|
183
|
+
},
|
|
184
|
+
// Get simple dummy signature for ECDSA module authorization
|
|
185
|
+
async getStubSignature() {
|
|
186
|
+
const dynamicPart = ecdsaModuleAddress.substring(2).padEnd(40, "0")
|
|
187
|
+
return `0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000${dynamicPart}000000000000000000000000000000000000000000000000000000000000004181d4b4981670cb18f99f0b4a66446df1bf5b204d24cfcb659bf38ba27a4359b5711649ec2423c5e1247245eba2964679b6a1dbb85c992ae40b9b00c6935b02ff1b00000000000000000000000000000000000000000000000000000000000000`
|
|
188
|
+
},
|
|
189
|
+
async sign({ hash }) {
|
|
190
|
+
return this.signMessage({ message: hash })
|
|
191
|
+
},
|
|
192
|
+
async signMessage({ message }) {
|
|
193
|
+
let signature = await owner.signMessage({
|
|
194
|
+
message
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
const potentiallyIncorrectV = Number.parseInt(
|
|
198
|
+
signature.slice(-2),
|
|
199
|
+
16
|
|
200
|
+
)
|
|
201
|
+
if (![27, 28].includes(potentiallyIncorrectV)) {
|
|
202
|
+
const correctV = potentiallyIncorrectV + 27
|
|
203
|
+
signature = (signature.slice(0, -2) +
|
|
204
|
+
correctV.toString(16)) as Hex
|
|
205
|
+
}
|
|
206
|
+
return encodeAbiParameters(
|
|
207
|
+
[{ type: "bytes" }, { type: "address" }],
|
|
208
|
+
[signature, ecdsaModuleAddress]
|
|
209
|
+
)
|
|
210
|
+
},
|
|
211
|
+
async signTypedData(typedData) {
|
|
212
|
+
let signature = await owner.signTypedData(typedData)
|
|
213
|
+
|
|
214
|
+
const potentiallyIncorrectV = Number.parseInt(
|
|
215
|
+
signature.slice(-2),
|
|
216
|
+
16
|
|
217
|
+
)
|
|
218
|
+
if (![27, 28].includes(potentiallyIncorrectV)) {
|
|
219
|
+
const correctV = potentiallyIncorrectV + 27
|
|
220
|
+
signature = (signature.slice(0, -2) +
|
|
221
|
+
correctV.toString(16)) as Hex
|
|
222
|
+
}
|
|
223
|
+
return encodeAbiParameters(
|
|
224
|
+
[{ type: "bytes" }, { type: "address" }],
|
|
225
|
+
[signature, ecdsaModuleAddress]
|
|
226
|
+
)
|
|
227
|
+
},
|
|
228
|
+
// Sign a user operation
|
|
229
|
+
async signUserOperation(parameters) {
|
|
230
|
+
const { chainId = client.chain?.id, ...userOperation } = parameters
|
|
231
|
+
|
|
232
|
+
if (!chainId) throw new Error("Chain id not found")
|
|
233
|
+
|
|
234
|
+
const hash = getUserOperationHash({
|
|
235
|
+
userOperation: {
|
|
236
|
+
...userOperation,
|
|
237
|
+
sender: userOperation.sender ?? (await this.getAddress()),
|
|
238
|
+
signature: "0x"
|
|
239
|
+
},
|
|
240
|
+
entryPointAddress: entryPoint.address,
|
|
241
|
+
entryPointVersion: entryPoint.version,
|
|
242
|
+
chainId: chainId
|
|
243
|
+
})
|
|
244
|
+
const signature = await signMessage(client, {
|
|
245
|
+
account: owner,
|
|
246
|
+
message: { raw: hash }
|
|
247
|
+
})
|
|
248
|
+
// userOp signature is encoded module signature + module address
|
|
249
|
+
const signatureWithModuleAddress = encodeAbiParameters(
|
|
250
|
+
parseAbiParameters("bytes, address"),
|
|
251
|
+
[signature, ecdsaModuleAddress]
|
|
252
|
+
)
|
|
253
|
+
return signatureWithModuleAddress
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
}
|
package/accounts/index.ts
CHANGED
|
@@ -1,105 +1,74 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type SimpleSmartAccountImplementation,
|
|
3
|
+
type ToSimpleSmartAccountParameters,
|
|
4
|
+
type ToSimpleSmartAccountReturnType,
|
|
5
|
+
toSimpleSmartAccount
|
|
6
|
+
} from "./simple/toSimpleSmartAccount"
|
|
5
7
|
|
|
6
8
|
import {
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type LightAccountVersion,
|
|
10
|
+
type LightSmartAccountImplementation,
|
|
11
|
+
type ToLightSmartAccountParameters,
|
|
12
|
+
type ToLightSmartAccountReturnType,
|
|
13
|
+
toLightSmartAccount
|
|
14
|
+
} from "./light/toLightSmartAccount"
|
|
11
15
|
|
|
12
16
|
import {
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
type ToTrustSmartAccountParameters,
|
|
18
|
+
type ToTrustSmartAccountReturnType,
|
|
19
|
+
type TrustSmartAccountImplementation,
|
|
20
|
+
toTrustSmartAccount
|
|
21
|
+
} from "./trust/toTrustSmartAccount"
|
|
16
22
|
|
|
17
23
|
import {
|
|
18
|
-
type
|
|
19
|
-
type SignerToLightSmartAccountParameters,
|
|
20
|
-
signerToLightSmartAccount
|
|
21
|
-
} from "./light/signerToLightSmartAccount"
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
type SignerToTrustSmartAccountParameters,
|
|
25
|
-
type TrustSmartAccount,
|
|
26
|
-
signerToTrustSmartAccount
|
|
27
|
-
} from "./trust/signerToTrustSmartAccount"
|
|
28
|
-
|
|
29
|
-
import {
|
|
30
|
-
type PrivateKeyToTrustSmartAccountParameters,
|
|
31
|
-
privateKeyToTrustSmartAccount
|
|
32
|
-
} from "./trust/privateKeyToTrustSmartAccount"
|
|
33
|
-
|
|
34
|
-
import {
|
|
35
|
-
type PrivateKeyToSafeSmartAccountParameters,
|
|
36
|
-
privateKeyToSafeSmartAccount
|
|
37
|
-
} from "./safe/privateKeyToSafeSmartAccount"
|
|
38
|
-
|
|
39
|
-
import {
|
|
40
|
-
type SafeSmartAccount,
|
|
24
|
+
type SafeSmartAccountImplementation,
|
|
41
25
|
type SafeVersion,
|
|
42
|
-
type
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
import {
|
|
47
|
-
type KernelEcdsaSmartAccount,
|
|
48
|
-
type SignerToEcdsaKernelSmartAccountParameters,
|
|
49
|
-
signerToEcdsaKernelSmartAccount
|
|
50
|
-
} from "./kernel/signerToEcdsaKernelSmartAccount"
|
|
26
|
+
type ToSafeSmartAccountParameters,
|
|
27
|
+
type ToSafeSmartAccountReturnType,
|
|
28
|
+
toSafeSmartAccount
|
|
29
|
+
} from "./safe/toSafeSmartAccount"
|
|
51
30
|
|
|
52
31
|
import {
|
|
53
|
-
type
|
|
54
|
-
type
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
type EcdsaKernelSmartAccountImplementation,
|
|
33
|
+
type KernelVersion,
|
|
34
|
+
type ToEcdsaKernelSmartAccountParameters,
|
|
35
|
+
type ToEcdsaKernelSmartAccountReturnType,
|
|
36
|
+
toEcdsaKernelSmartAccount
|
|
37
|
+
} from "./kernel/toEcdsaKernelSmartAccount"
|
|
57
38
|
|
|
58
39
|
import {
|
|
59
|
-
type
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
SignTransactionNotSupportedBySmartAccount,
|
|
65
|
-
type SmartAccount,
|
|
66
|
-
type SmartAccountSigner
|
|
67
|
-
} from "./types"
|
|
68
|
-
|
|
69
|
-
import { toSmartAccount } from "./toSmartAccount"
|
|
40
|
+
type BiconomySmartAccountImplementation,
|
|
41
|
+
type ToBiconomySmartAccountParameters,
|
|
42
|
+
type ToBiconomySmartAccountReturnType,
|
|
43
|
+
toBiconomySmartAccount
|
|
44
|
+
} from "./biconomy/toBiconomySmartAccount"
|
|
70
45
|
|
|
71
46
|
export {
|
|
47
|
+
type ToSimpleSmartAccountParameters,
|
|
48
|
+
type SimpleSmartAccountImplementation,
|
|
49
|
+
type ToSimpleSmartAccountReturnType,
|
|
50
|
+
toSimpleSmartAccount,
|
|
51
|
+
type LightAccountVersion,
|
|
52
|
+
type ToLightSmartAccountParameters,
|
|
53
|
+
type LightSmartAccountImplementation,
|
|
54
|
+
type ToLightSmartAccountReturnType,
|
|
55
|
+
toLightSmartAccount,
|
|
56
|
+
type ToTrustSmartAccountParameters,
|
|
57
|
+
type TrustSmartAccountImplementation,
|
|
58
|
+
type ToTrustSmartAccountReturnType,
|
|
59
|
+
toTrustSmartAccount,
|
|
60
|
+
type ToSafeSmartAccountParameters,
|
|
61
|
+
type SafeSmartAccountImplementation,
|
|
62
|
+
type ToSafeSmartAccountReturnType,
|
|
63
|
+
toSafeSmartAccount,
|
|
64
|
+
type ToEcdsaKernelSmartAccountParameters,
|
|
65
|
+
type EcdsaKernelSmartAccountImplementation,
|
|
66
|
+
type ToEcdsaKernelSmartAccountReturnType,
|
|
72
67
|
type SafeVersion,
|
|
73
|
-
type
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
type
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
signerToLightSmartAccount,
|
|
80
|
-
type TrustSmartAccount,
|
|
81
|
-
signerToTrustSmartAccount,
|
|
82
|
-
privateKeyToTrustSmartAccount,
|
|
83
|
-
SignTransactionNotSupportedBySmartAccount,
|
|
84
|
-
privateKeyToBiconomySmartAccount,
|
|
85
|
-
privateKeyToSimpleSmartAccount,
|
|
86
|
-
privateKeyToLightSmartAccount,
|
|
87
|
-
type SmartAccount,
|
|
88
|
-
privateKeyToSafeSmartAccount,
|
|
89
|
-
type KernelEcdsaSmartAccount,
|
|
90
|
-
signerToEcdsaKernelSmartAccount,
|
|
91
|
-
type BiconomySmartAccount,
|
|
92
|
-
signerToBiconomySmartAccount,
|
|
93
|
-
toSmartAccount,
|
|
94
|
-
type SignerToSimpleSmartAccountParameters,
|
|
95
|
-
type SignerToLightSmartAccountParameters,
|
|
96
|
-
type SignerToSafeSmartAccountParameters,
|
|
97
|
-
type PrivateKeyToSimpleSmartAccountParameters,
|
|
98
|
-
type PrivateKeyToLightSmartAccountParameters,
|
|
99
|
-
type PrivateKeyToSafeSmartAccountParameters,
|
|
100
|
-
type SignerToEcdsaKernelSmartAccountParameters,
|
|
101
|
-
type SignerToBiconomySmartAccountParameters,
|
|
102
|
-
type PrivateKeyToBiconomySmartAccountParameters,
|
|
103
|
-
type SignerToTrustSmartAccountParameters,
|
|
104
|
-
type PrivateKeyToTrustSmartAccountParameters
|
|
68
|
+
type KernelVersion,
|
|
69
|
+
toEcdsaKernelSmartAccount,
|
|
70
|
+
type ToBiconomySmartAccountReturnType,
|
|
71
|
+
type ToBiconomySmartAccountParameters,
|
|
72
|
+
type BiconomySmartAccountImplementation,
|
|
73
|
+
toBiconomySmartAccount
|
|
105
74
|
}
|