@aa-sdk/core 4.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +54 -0
- package/dist/cjs/abis/EntryPointAbi_v6.d.ts +1018 -0
- package/dist/cjs/abis/EntryPointAbi_v6.js +1313 -0
- package/dist/cjs/abis/EntryPointAbi_v6.js.map +1 -0
- package/dist/cjs/abis/EntryPointAbi_v7.d.ts +775 -0
- package/dist/cjs/abis/EntryPointAbi_v7.js +661 -0
- package/dist/cjs/abis/EntryPointAbi_v7.js.map +1 -0
- package/dist/cjs/abis/SimpleAccountAbi_v6.d.ts +405 -0
- package/dist/cjs/abis/SimpleAccountAbi_v6.js +528 -0
- package/dist/cjs/abis/SimpleAccountAbi_v6.js.map +1 -0
- package/dist/cjs/abis/SimpleAccountAbi_v7.d.ts +410 -0
- package/dist/cjs/abis/SimpleAccountAbi_v7.js +538 -0
- package/dist/cjs/abis/SimpleAccountAbi_v7.js.map +1 -0
- package/dist/cjs/abis/SimpleAccountFactoryAbi.d.ts +55 -0
- package/dist/cjs/abis/SimpleAccountFactoryAbi.js +78 -0
- package/dist/cjs/abis/SimpleAccountFactoryAbi.js.map +1 -0
- package/dist/cjs/account/base.d.ts +49 -0
- package/dist/cjs/account/base.js +257 -0
- package/dist/cjs/account/base.js.map +1 -0
- package/dist/cjs/account/schema.d.ts +100 -0
- package/dist/cjs/account/schema.js +43 -0
- package/dist/cjs/account/schema.js.map +1 -0
- package/dist/cjs/account/simple.d.ts +14 -0
- package/dist/cjs/account/simple.js +119 -0
- package/dist/cjs/account/simple.js.map +1 -0
- package/dist/cjs/account/smartContractAccount.d.ts +68 -0
- package/dist/cjs/account/smartContractAccount.js +174 -0
- package/dist/cjs/account/smartContractAccount.js.map +1 -0
- package/dist/cjs/account/types.d.ts +30 -0
- package/dist/cjs/account/types.js +3 -0
- package/dist/cjs/account/types.js.map +1 -0
- package/dist/cjs/actions/bundler/estimateUserOperationGas.d.ts +8 -0
- package/dist/cjs/actions/bundler/estimateUserOperationGas.js +18 -0
- package/dist/cjs/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.d.ts +3 -0
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.js +11 -0
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.js.map +1 -0
- package/dist/cjs/actions/bundler/getUserOperationByHash.d.ts +6 -0
- package/dist/cjs/actions/bundler/getUserOperationByHash.js +11 -0
- package/dist/cjs/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/dist/cjs/actions/bundler/getUserOperationReceipt.d.ts +6 -0
- package/dist/cjs/actions/bundler/getUserOperationReceipt.js +11 -0
- package/dist/cjs/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/dist/cjs/actions/bundler/sendRawUserOperation.d.ts +7 -0
- package/dist/cjs/actions/bundler/sendRawUserOperation.js +11 -0
- package/dist/cjs/actions/bundler/sendRawUserOperation.js.map +1 -0
- package/dist/cjs/actions/smartAccount/buildUserOperation.d.ts +5 -0
- package/dist/cjs/actions/smartAccount/buildUserOperation.js +25 -0
- package/dist/cjs/actions/smartAccount/buildUserOperation.js.map +1 -0
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.d.ts +5 -0
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js +39 -0
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +1 -0
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.d.ts +4 -0
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js +62 -0
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -0
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +4 -0
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js +34 -0
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -0
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.d.ts +5 -0
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js +64 -0
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -0
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.d.ts +5 -0
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js +23 -0
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +1 -0
- package/dist/cjs/actions/smartAccount/getAddress.d.ts +4 -0
- package/dist/cjs/actions/smartAccount/getAddress.js +13 -0
- package/dist/cjs/actions/smartAccount/getAddress.js.map +1 -0
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.d.ts +7 -0
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js +42 -0
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +1 -0
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.d.ts +10 -0
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js +47 -0
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -0
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.d.ts +10 -0
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js +28 -0
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +1 -0
- package/dist/cjs/actions/smartAccount/sendTransaction.d.ts +5 -0
- package/dist/cjs/actions/smartAccount/sendTransaction.js +35 -0
- package/dist/cjs/actions/smartAccount/sendTransaction.js.map +1 -0
- package/dist/cjs/actions/smartAccount/sendTransactions.d.ts +4 -0
- package/dist/cjs/actions/smartAccount/sendTransactions.js +36 -0
- package/dist/cjs/actions/smartAccount/sendTransactions.js.map +1 -0
- package/dist/cjs/actions/smartAccount/sendUserOperation.d.ts +5 -0
- package/dist/cjs/actions/smartAccount/sendUserOperation.js +31 -0
- package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +1 -0
- package/dist/cjs/actions/smartAccount/signMessage.d.ts +6 -0
- package/dist/cjs/actions/smartAccount/signMessage.js +12 -0
- package/dist/cjs/actions/smartAccount/signMessage.js.map +1 -0
- package/dist/cjs/actions/smartAccount/signMessageWith6492.d.ts +4 -0
- package/dist/cjs/actions/smartAccount/signMessageWith6492.js +12 -0
- package/dist/cjs/actions/smartAccount/signMessageWith6492.js.map +1 -0
- package/dist/cjs/actions/smartAccount/signTypedData.d.ts +10 -0
- package/dist/cjs/actions/smartAccount/signTypedData.js +12 -0
- package/dist/cjs/actions/smartAccount/signTypedData.js.map +1 -0
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.d.ts +6 -0
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js +12 -0
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js.map +1 -0
- package/dist/cjs/actions/smartAccount/signUserOperation.d.ts +5 -0
- package/dist/cjs/actions/smartAccount/signUserOperation.js +30 -0
- package/dist/cjs/actions/smartAccount/signUserOperation.js.map +1 -0
- package/dist/cjs/actions/smartAccount/types.d.ts +42 -0
- package/dist/cjs/actions/smartAccount/types.js +3 -0
- package/dist/cjs/actions/smartAccount/types.js.map +1 -0
- package/dist/cjs/actions/smartAccount/upgradeAccount.d.ts +4 -0
- package/dist/cjs/actions/smartAccount/upgradeAccount.js +38 -0
- package/dist/cjs/actions/smartAccount/upgradeAccount.js.map +1 -0
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.d.ts +3 -0
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js +36 -0
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -0
- package/dist/cjs/chains/index.d.ts +20 -0
- package/dist/cjs/chains/index.js +169 -0
- package/dist/cjs/chains/index.js.map +1 -0
- package/dist/cjs/client/bundlerClient.d.ts +10 -0
- package/dist/cjs/client/bundlerClient.js +51 -0
- package/dist/cjs/client/bundlerClient.js.map +1 -0
- package/dist/cjs/client/decorators/bundlerClient.d.ts +41 -0
- package/dist/cjs/client/decorators/bundlerClient.js +17 -0
- package/dist/cjs/client/decorators/bundlerClient.js.map +1 -0
- package/dist/cjs/client/decorators/smartAccountClient.d.ts +35 -0
- package/dist/cjs/client/decorators/smartAccountClient.js +43 -0
- package/dist/cjs/client/decorators/smartAccountClient.js.map +1 -0
- package/dist/cjs/client/isSmartAccountClient.d.ts +5 -0
- package/dist/cjs/client/isSmartAccountClient.js +18 -0
- package/dist/cjs/client/isSmartAccountClient.js.map +1 -0
- package/dist/cjs/client/schema.d.ts +767 -0
- package/dist/cjs/client/schema.js +63 -0
- package/dist/cjs/client/schema.js.map +1 -0
- package/dist/cjs/client/smartAccountClient.d.ts +33 -0
- package/dist/cjs/client/smartAccountClient.js +93 -0
- package/dist/cjs/client/smartAccountClient.js.map +1 -0
- package/dist/cjs/client/types.d.ts +26 -0
- package/dist/cjs/client/types.js +3 -0
- package/dist/cjs/client/types.js.map +1 -0
- package/dist/cjs/ens/utils.d.ts +6 -0
- package/dist/cjs/ens/utils.js +53 -0
- package/dist/cjs/ens/utils.js.map +1 -0
- package/dist/cjs/entrypoint/0.6.d.ts +1029 -0
- package/dist/cjs/entrypoint/0.6.js +49 -0
- package/dist/cjs/entrypoint/0.6.js.map +1 -0
- package/dist/cjs/entrypoint/0.7.d.ts +792 -0
- package/dist/cjs/entrypoint/0.7.js +88 -0
- package/dist/cjs/entrypoint/0.7.js.map +1 -0
- package/dist/cjs/entrypoint/index.d.ts +8 -0
- package/dist/cjs/entrypoint/index.js +53 -0
- package/dist/cjs/entrypoint/index.js.map +1 -0
- package/dist/cjs/entrypoint/types.d.ts +46 -0
- package/dist/cjs/entrypoint/types.js +3 -0
- package/dist/cjs/entrypoint/types.js.map +1 -0
- package/dist/cjs/errors/account.d.ts +47 -0
- package/dist/cjs/errors/account.js +140 -0
- package/dist/cjs/errors/account.js.map +1 -0
- package/dist/cjs/errors/base.d.ts +18 -0
- package/dist/cjs/errors/base.js +39 -0
- package/dist/cjs/errors/base.js.map +1 -0
- package/dist/cjs/errors/client.d.ts +14 -0
- package/dist/cjs/errors/client.js +44 -0
- package/dist/cjs/errors/client.js.map +1 -0
- package/dist/cjs/errors/entrypoint.d.ts +10 -0
- package/dist/cjs/errors/entrypoint.js +32 -0
- package/dist/cjs/errors/entrypoint.js.map +1 -0
- package/dist/cjs/errors/signer.d.ts +5 -0
- package/dist/cjs/errors/signer.js +20 -0
- package/dist/cjs/errors/signer.js.map +1 -0
- package/dist/cjs/errors/transaction.d.ts +10 -0
- package/dist/cjs/errors/transaction.js +29 -0
- package/dist/cjs/errors/transaction.js.map +1 -0
- package/dist/cjs/errors/useroperation.d.ts +10 -0
- package/dist/cjs/errors/useroperation.js +34 -0
- package/dist/cjs/errors/useroperation.js.map +1 -0
- package/dist/cjs/index.d.ts +63 -0
- package/dist/cjs/index.js +198 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/logger.d.ts +20 -0
- package/dist/cjs/logger.js +60 -0
- package/dist/cjs/logger.js.map +1 -0
- package/dist/cjs/middleware/actions.d.ts +12 -0
- package/dist/cjs/middleware/actions.js +37 -0
- package/dist/cjs/middleware/actions.js.map +1 -0
- package/dist/cjs/middleware/defaults/feeEstimator.d.ts +3 -0
- package/dist/cjs/middleware/defaults/feeEstimator.js +21 -0
- package/dist/cjs/middleware/defaults/feeEstimator.js.map +1 -0
- package/dist/cjs/middleware/defaults/gasEstimator.d.ts +3 -0
- package/dist/cjs/middleware/defaults/gasEstimator.js +26 -0
- package/dist/cjs/middleware/defaults/gasEstimator.js.map +1 -0
- package/dist/cjs/middleware/defaults/paymasterAndData.d.ts +2 -0
- package/dist/cjs/middleware/defaults/paymasterAndData.js +12 -0
- package/dist/cjs/middleware/defaults/paymasterAndData.js.map +1 -0
- package/dist/cjs/middleware/defaults/userOpSigner.d.ts +2 -0
- package/dist/cjs/middleware/defaults/userOpSigner.js +26 -0
- package/dist/cjs/middleware/defaults/userOpSigner.js.map +1 -0
- package/dist/cjs/middleware/noopMiddleware.d.ts +2 -0
- package/dist/cjs/middleware/noopMiddleware.js +8 -0
- package/dist/cjs/middleware/noopMiddleware.js.map +1 -0
- package/dist/cjs/middleware/types.d.ts +21 -0
- package/dist/cjs/middleware/types.js +3 -0
- package/dist/cjs/middleware/types.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/signer/local-account.d.ts +219 -0
- package/dist/cjs/signer/local-account.js +56 -0
- package/dist/cjs/signer/local-account.js.map +1 -0
- package/dist/cjs/signer/schema.d.ts +4 -0
- package/dist/cjs/signer/schema.js +16 -0
- package/dist/cjs/signer/schema.js.map +1 -0
- package/dist/cjs/signer/types.d.ts +15 -0
- package/dist/cjs/signer/types.js +3 -0
- package/dist/cjs/signer/types.js.map +1 -0
- package/dist/cjs/signer/utils.d.ts +15 -0
- package/dist/cjs/signer/utils.js +31 -0
- package/dist/cjs/signer/utils.js.map +1 -0
- package/dist/cjs/signer/wallet-client.d.ts +217 -0
- package/dist/cjs/signer/wallet-client.js +58 -0
- package/dist/cjs/signer/wallet-client.js.map +1 -0
- package/dist/cjs/transport/split.d.ts +9 -0
- package/dist/cjs/transport/split.js +26 -0
- package/dist/cjs/transport/split.js.map +1 -0
- package/dist/cjs/types.d.ts +158 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/bigint.d.ts +10 -0
- package/dist/cjs/utils/bigint.js +55 -0
- package/dist/cjs/utils/bigint.js.map +1 -0
- package/dist/cjs/utils/bytes.d.ts +7 -0
- package/dist/cjs/utils/bytes.js +11 -0
- package/dist/cjs/utils/bytes.js.map +1 -0
- package/dist/cjs/utils/defaults.d.ts +6 -0
- package/dist/cjs/utils/defaults.js +59 -0
- package/dist/cjs/utils/defaults.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +23 -0
- package/dist/cjs/utils/index.js +127 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/schema.d.ts +25 -0
- package/dist/cjs/utils/schema.js +35 -0
- package/dist/cjs/utils/schema.js.map +1 -0
- package/dist/cjs/utils/stateOverride.d.ts +4 -0
- package/dist/cjs/utils/stateOverride.js +52 -0
- package/dist/cjs/utils/stateOverride.js.map +1 -0
- package/dist/cjs/utils/testUtils.d.ts +6 -0
- package/dist/cjs/utils/testUtils.js +33 -0
- package/dist/cjs/utils/testUtils.js.map +1 -0
- package/dist/cjs/utils/types.d.ts +16 -0
- package/dist/cjs/utils/types.js +3 -0
- package/dist/cjs/utils/types.js.map +1 -0
- package/dist/cjs/utils/userop.d.ts +49 -0
- package/dist/cjs/utils/userop.js +75 -0
- package/dist/cjs/utils/userop.js.map +1 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/esm/abis/EntryPointAbi_v6.d.ts +1018 -0
- package/dist/esm/abis/EntryPointAbi_v6.js +1310 -0
- package/dist/esm/abis/EntryPointAbi_v6.js.map +1 -0
- package/dist/esm/abis/EntryPointAbi_v7.d.ts +775 -0
- package/dist/esm/abis/EntryPointAbi_v7.js +658 -0
- package/dist/esm/abis/EntryPointAbi_v7.js.map +1 -0
- package/dist/esm/abis/SimpleAccountAbi_v6.d.ts +405 -0
- package/dist/esm/abis/SimpleAccountAbi_v6.js +525 -0
- package/dist/esm/abis/SimpleAccountAbi_v6.js.map +1 -0
- package/dist/esm/abis/SimpleAccountAbi_v7.d.ts +410 -0
- package/dist/esm/abis/SimpleAccountAbi_v7.js +535 -0
- package/dist/esm/abis/SimpleAccountAbi_v7.js.map +1 -0
- package/dist/esm/abis/SimpleAccountFactoryAbi.d.ts +55 -0
- package/dist/esm/abis/SimpleAccountFactoryAbi.js +75 -0
- package/dist/esm/abis/SimpleAccountFactoryAbi.js.map +1 -0
- package/dist/esm/account/base.d.ts +49 -0
- package/dist/esm/account/base.js +253 -0
- package/dist/esm/account/base.js.map +1 -0
- package/dist/esm/account/schema.d.ts +100 -0
- package/dist/esm/account/schema.js +35 -0
- package/dist/esm/account/schema.js.map +1 -0
- package/dist/esm/account/simple.d.ts +14 -0
- package/dist/esm/account/simple.js +115 -0
- package/dist/esm/account/simple.js.map +1 -0
- package/dist/esm/account/smartContractAccount.d.ts +68 -0
- package/dist/esm/account/smartContractAccount.js +167 -0
- package/dist/esm/account/smartContractAccount.js.map +1 -0
- package/dist/esm/account/types.d.ts +30 -0
- package/dist/esm/account/types.js +2 -0
- package/dist/esm/account/types.js.map +1 -0
- package/dist/esm/actions/bundler/estimateUserOperationGas.d.ts +8 -0
- package/dist/esm/actions/bundler/estimateUserOperationGas.js +14 -0
- package/dist/esm/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/dist/esm/actions/bundler/getSupportedEntryPoints.d.ts +3 -0
- package/dist/esm/actions/bundler/getSupportedEntryPoints.js +7 -0
- package/dist/esm/actions/bundler/getSupportedEntryPoints.js.map +1 -0
- package/dist/esm/actions/bundler/getUserOperationByHash.d.ts +6 -0
- package/dist/esm/actions/bundler/getUserOperationByHash.js +7 -0
- package/dist/esm/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/dist/esm/actions/bundler/getUserOperationReceipt.d.ts +6 -0
- package/dist/esm/actions/bundler/getUserOperationReceipt.js +7 -0
- package/dist/esm/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/dist/esm/actions/bundler/sendRawUserOperation.d.ts +7 -0
- package/dist/esm/actions/bundler/sendRawUserOperation.js +7 -0
- package/dist/esm/actions/bundler/sendRawUserOperation.js.map +1 -0
- package/dist/esm/actions/smartAccount/buildUserOperation.d.ts +5 -0
- package/dist/esm/actions/smartAccount/buildUserOperation.js +22 -0
- package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.d.ts +5 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js +36 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.d.ts +4 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js +58 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -0
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +4 -0
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js +30 -0
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -0
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.d.ts +5 -0
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js +60 -0
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -0
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.d.ts +5 -0
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js +20 -0
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -0
- package/dist/esm/actions/smartAccount/getAddress.d.ts +4 -0
- package/dist/esm/actions/smartAccount/getAddress.js +9 -0
- package/dist/esm/actions/smartAccount/getAddress.js.map +1 -0
- package/dist/esm/actions/smartAccount/internal/initUserOperation.d.ts +7 -0
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js +38 -0
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -0
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.d.ts +10 -0
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js +43 -0
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -0
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.d.ts +10 -0
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js +24 -0
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -0
- package/dist/esm/actions/smartAccount/sendTransaction.d.ts +5 -0
- package/dist/esm/actions/smartAccount/sendTransaction.js +31 -0
- package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -0
- package/dist/esm/actions/smartAccount/sendTransactions.d.ts +4 -0
- package/dist/esm/actions/smartAccount/sendTransactions.js +32 -0
- package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -0
- package/dist/esm/actions/smartAccount/sendUserOperation.d.ts +5 -0
- package/dist/esm/actions/smartAccount/sendUserOperation.js +27 -0
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -0
- package/dist/esm/actions/smartAccount/signMessage.d.ts +6 -0
- package/dist/esm/actions/smartAccount/signMessage.js +8 -0
- package/dist/esm/actions/smartAccount/signMessage.js.map +1 -0
- package/dist/esm/actions/smartAccount/signMessageWith6492.d.ts +4 -0
- package/dist/esm/actions/smartAccount/signMessageWith6492.js +8 -0
- package/dist/esm/actions/smartAccount/signMessageWith6492.js.map +1 -0
- package/dist/esm/actions/smartAccount/signTypedData.d.ts +10 -0
- package/dist/esm/actions/smartAccount/signTypedData.js +8 -0
- package/dist/esm/actions/smartAccount/signTypedData.js.map +1 -0
- package/dist/esm/actions/smartAccount/signTypedDataWith6492.d.ts +6 -0
- package/dist/esm/actions/smartAccount/signTypedDataWith6492.js +8 -0
- package/dist/esm/actions/smartAccount/signTypedDataWith6492.js.map +1 -0
- package/dist/esm/actions/smartAccount/signUserOperation.d.ts +5 -0
- package/dist/esm/actions/smartAccount/signUserOperation.js +26 -0
- package/dist/esm/actions/smartAccount/signUserOperation.js.map +1 -0
- package/dist/esm/actions/smartAccount/types.d.ts +42 -0
- package/dist/esm/actions/smartAccount/types.js +2 -0
- package/dist/esm/actions/smartAccount/types.js.map +1 -0
- package/dist/esm/actions/smartAccount/upgradeAccount.d.ts +4 -0
- package/dist/esm/actions/smartAccount/upgradeAccount.js +34 -0
- package/dist/esm/actions/smartAccount/upgradeAccount.js.map +1 -0
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.d.ts +3 -0
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js +32 -0
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -0
- package/dist/esm/chains/index.d.ts +20 -0
- package/dist/esm/chains/index.js +166 -0
- package/dist/esm/chains/index.js.map +1 -0
- package/dist/esm/client/bundlerClient.d.ts +10 -0
- package/dist/esm/client/bundlerClient.js +46 -0
- package/dist/esm/client/bundlerClient.js.map +1 -0
- package/dist/esm/client/decorators/bundlerClient.d.ts +41 -0
- package/dist/esm/client/decorators/bundlerClient.js +13 -0
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -0
- package/dist/esm/client/decorators/smartAccountClient.d.ts +35 -0
- package/dist/esm/client/decorators/smartAccountClient.js +40 -0
- package/dist/esm/client/decorators/smartAccountClient.js.map +1 -0
- package/dist/esm/client/isSmartAccountClient.d.ts +5 -0
- package/dist/esm/client/isSmartAccountClient.js +13 -0
- package/dist/esm/client/isSmartAccountClient.js.map +1 -0
- package/dist/esm/client/schema.d.ts +767 -0
- package/dist/esm/client/schema.js +59 -0
- package/dist/esm/client/schema.js.map +1 -0
- package/dist/esm/client/smartAccountClient.d.ts +33 -0
- package/dist/esm/client/smartAccountClient.js +90 -0
- package/dist/esm/client/smartAccountClient.js.map +1 -0
- package/dist/esm/client/types.d.ts +26 -0
- package/dist/esm/client/types.js +2 -0
- package/dist/esm/client/types.js.map +1 -0
- package/dist/esm/ens/utils.d.ts +6 -0
- package/dist/esm/ens/utils.js +24 -0
- package/dist/esm/ens/utils.js.map +1 -0
- package/dist/esm/entrypoint/0.6.d.ts +1029 -0
- package/dist/esm/entrypoint/0.6.js +47 -0
- package/dist/esm/entrypoint/0.6.js.map +1 -0
- package/dist/esm/entrypoint/0.7.d.ts +792 -0
- package/dist/esm/entrypoint/0.7.js +82 -0
- package/dist/esm/entrypoint/0.7.js.map +1 -0
- package/dist/esm/entrypoint/index.d.ts +8 -0
- package/dist/esm/entrypoint/index.js +46 -0
- package/dist/esm/entrypoint/index.js.map +1 -0
- package/dist/esm/entrypoint/types.d.ts +46 -0
- package/dist/esm/entrypoint/types.js +2 -0
- package/dist/esm/entrypoint/types.js.map +1 -0
- package/dist/esm/errors/account.d.ts +47 -0
- package/dist/esm/errors/account.js +126 -0
- package/dist/esm/errors/account.js.map +1 -0
- package/dist/esm/errors/base.d.ts +18 -0
- package/dist/esm/errors/base.js +35 -0
- package/dist/esm/errors/base.js.map +1 -0
- package/dist/esm/errors/client.d.ts +14 -0
- package/dist/esm/errors/client.js +38 -0
- package/dist/esm/errors/client.js.map +1 -0
- package/dist/esm/errors/entrypoint.d.ts +10 -0
- package/dist/esm/errors/entrypoint.js +27 -0
- package/dist/esm/errors/entrypoint.js.map +1 -0
- package/dist/esm/errors/signer.d.ts +5 -0
- package/dist/esm/errors/signer.js +16 -0
- package/dist/esm/errors/signer.js.map +1 -0
- package/dist/esm/errors/transaction.d.ts +10 -0
- package/dist/esm/errors/transaction.js +24 -0
- package/dist/esm/errors/transaction.js.map +1 -0
- package/dist/esm/errors/useroperation.d.ts +10 -0
- package/dist/esm/errors/useroperation.js +29 -0
- package/dist/esm/errors/useroperation.js.map +1 -0
- package/dist/esm/index.d.ts +63 -0
- package/dist/esm/index.js +48 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +20 -0
- package/dist/esm/logger.js +56 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/middleware/actions.d.ts +12 -0
- package/dist/esm/middleware/actions.js +33 -0
- package/dist/esm/middleware/actions.js.map +1 -0
- package/dist/esm/middleware/defaults/feeEstimator.d.ts +3 -0
- package/dist/esm/middleware/defaults/feeEstimator.js +17 -0
- package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -0
- package/dist/esm/middleware/defaults/gasEstimator.d.ts +3 -0
- package/dist/esm/middleware/defaults/gasEstimator.js +22 -0
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -0
- package/dist/esm/middleware/defaults/paymasterAndData.d.ts +2 -0
- package/dist/esm/middleware/defaults/paymasterAndData.js +8 -0
- package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -0
- package/dist/esm/middleware/defaults/userOpSigner.d.ts +2 -0
- package/dist/esm/middleware/defaults/userOpSigner.js +22 -0
- package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -0
- package/dist/esm/middleware/noopMiddleware.d.ts +2 -0
- package/dist/esm/middleware/noopMiddleware.js +4 -0
- package/dist/esm/middleware/noopMiddleware.js.map +1 -0
- package/dist/esm/middleware/types.d.ts +21 -0
- package/dist/esm/middleware/types.js +2 -0
- package/dist/esm/middleware/types.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/signer/local-account.d.ts +219 -0
- package/dist/esm/signer/local-account.js +53 -0
- package/dist/esm/signer/local-account.js.map +1 -0
- package/dist/esm/signer/schema.d.ts +4 -0
- package/dist/esm/signer/schema.js +12 -0
- package/dist/esm/signer/schema.js.map +1 -0
- package/dist/esm/signer/types.d.ts +15 -0
- package/dist/esm/signer/types.js +2 -0
- package/dist/esm/signer/types.js.map +1 -0
- package/dist/esm/signer/utils.d.ts +15 -0
- package/dist/esm/signer/utils.js +26 -0
- package/dist/esm/signer/utils.js.map +1 -0
- package/dist/esm/signer/wallet-client.d.ts +217 -0
- package/dist/esm/signer/wallet-client.js +54 -0
- package/dist/esm/signer/wallet-client.js.map +1 -0
- package/dist/esm/transport/split.d.ts +9 -0
- package/dist/esm/transport/split.js +22 -0
- package/dist/esm/transport/split.js.map +1 -0
- package/dist/esm/types.d.ts +158 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/bigint.d.ts +10 -0
- package/dist/esm/utils/bigint.js +47 -0
- package/dist/esm/utils/bigint.js.map +1 -0
- package/dist/esm/utils/bytes.d.ts +7 -0
- package/dist/esm/utils/bytes.js +7 -0
- package/dist/esm/utils/bytes.js.map +1 -0
- package/dist/esm/utils/defaults.d.ts +6 -0
- package/dist/esm/utils/defaults.js +55 -0
- package/dist/esm/utils/defaults.js.map +1 -0
- package/dist/esm/utils/index.d.ts +23 -0
- package/dist/esm/utils/index.js +88 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/schema.d.ts +25 -0
- package/dist/esm/utils/schema.js +30 -0
- package/dist/esm/utils/schema.js.map +1 -0
- package/dist/esm/utils/stateOverride.d.ts +4 -0
- package/dist/esm/utils/stateOverride.js +48 -0
- package/dist/esm/utils/stateOverride.js.map +1 -0
- package/dist/esm/utils/testUtils.d.ts +6 -0
- package/dist/esm/utils/testUtils.js +28 -0
- package/dist/esm/utils/testUtils.js.map +1 -0
- package/dist/esm/utils/types.d.ts +16 -0
- package/dist/esm/utils/types.js +2 -0
- package/dist/esm/utils/types.js.map +1 -0
- package/dist/esm/utils/userop.d.ts +49 -0
- package/dist/esm/utils/userop.js +62 -0
- package/dist/esm/utils/userop.js.map +1 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/types/abis/EntryPointAbi_v6.d.ts +1019 -0
- package/dist/types/abis/EntryPointAbi_v6.d.ts.map +1 -0
- package/dist/types/abis/EntryPointAbi_v7.d.ts +776 -0
- package/dist/types/abis/EntryPointAbi_v7.d.ts.map +1 -0
- package/dist/types/abis/SimpleAccountAbi_v6.d.ts +406 -0
- package/dist/types/abis/SimpleAccountAbi_v6.d.ts.map +1 -0
- package/dist/types/abis/SimpleAccountAbi_v7.d.ts +411 -0
- package/dist/types/abis/SimpleAccountAbi_v7.d.ts.map +1 -0
- package/dist/types/abis/SimpleAccountFactoryAbi.d.ts +56 -0
- package/dist/types/abis/SimpleAccountFactoryAbi.d.ts.map +1 -0
- package/dist/types/account/base.d.ts +128 -0
- package/dist/types/account/base.d.ts.map +1 -0
- package/dist/types/account/schema.d.ts +101 -0
- package/dist/types/account/schema.d.ts.map +1 -0
- package/dist/types/account/simple.d.ts +15 -0
- package/dist/types/account/simple.d.ts.map +1 -0
- package/dist/types/account/smartContractAccount.d.ts +69 -0
- package/dist/types/account/smartContractAccount.d.ts.map +1 -0
- package/dist/types/account/types.d.ts +144 -0
- package/dist/types/account/types.d.ts.map +1 -0
- package/dist/types/actions/bundler/estimateUserOperationGas.d.ts +9 -0
- package/dist/types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
- package/dist/types/actions/bundler/getSupportedEntryPoints.d.ts +4 -0
- package/dist/types/actions/bundler/getSupportedEntryPoints.d.ts.map +1 -0
- package/dist/types/actions/bundler/getUserOperationByHash.d.ts +7 -0
- package/dist/types/actions/bundler/getUserOperationByHash.d.ts.map +1 -0
- package/dist/types/actions/bundler/getUserOperationReceipt.d.ts +7 -0
- package/dist/types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
- package/dist/types/actions/bundler/sendRawUserOperation.d.ts +8 -0
- package/dist/types/actions/bundler/sendRawUserOperation.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/buildUserOperation.d.ts +6 -0
- package/dist/types/actions/smartAccount/buildUserOperation.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts +45 -0
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts +75 -0
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +33 -0
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts +6 -0
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts +19 -0
- package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/getAddress.d.ts +5 -0
- package/dist/types/actions/smartAccount/getAddress.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts +22 -0
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts +25 -0
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts +18 -0
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/sendTransaction.d.ts +6 -0
- package/dist/types/actions/smartAccount/sendTransaction.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/sendTransactions.d.ts +5 -0
- package/dist/types/actions/smartAccount/sendTransactions.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts +13 -0
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/signMessage.d.ts +7 -0
- package/dist/types/actions/smartAccount/signMessage.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/signMessageWith6492.d.ts +5 -0
- package/dist/types/actions/smartAccount/signMessageWith6492.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/signTypedData.d.ts +11 -0
- package/dist/types/actions/smartAccount/signTypedData.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/signTypedDataWith6492.d.ts +7 -0
- package/dist/types/actions/smartAccount/signTypedDataWith6492.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/signUserOperation.d.ts +6 -0
- package/dist/types/actions/smartAccount/signUserOperation.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/types.d.ts +57 -0
- package/dist/types/actions/smartAccount/types.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/upgradeAccount.d.ts +5 -0
- package/dist/types/actions/smartAccount/upgradeAccount.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts +4 -0
- package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts.map +1 -0
- package/dist/types/chains/index.d.ts +21 -0
- package/dist/types/chains/index.d.ts.map +1 -0
- package/dist/types/client/bundlerClient.d.ts +17 -0
- package/dist/types/client/bundlerClient.d.ts.map +1 -0
- package/dist/types/client/decorators/bundlerClient.d.ts +74 -0
- package/dist/types/client/decorators/bundlerClient.d.ts.map +1 -0
- package/dist/types/client/decorators/smartAccountClient.d.ts +36 -0
- package/dist/types/client/decorators/smartAccountClient.d.ts.map +1 -0
- package/dist/types/client/isSmartAccountClient.d.ts +22 -0
- package/dist/types/client/isSmartAccountClient.d.ts.map +1 -0
- package/dist/types/client/schema.d.ts +780 -0
- package/dist/types/client/schema.d.ts.map +1 -0
- package/dist/types/client/smartAccountClient.d.ts +34 -0
- package/dist/types/client/smartAccountClient.d.ts.map +1 -0
- package/dist/types/client/types.d.ts +27 -0
- package/dist/types/client/types.d.ts.map +1 -0
- package/dist/types/ens/utils.d.ts +7 -0
- package/dist/types/ens/utils.d.ts.map +1 -0
- package/dist/types/entrypoint/0.6.d.ts +1030 -0
- package/dist/types/entrypoint/0.6.d.ts.map +1 -0
- package/dist/types/entrypoint/0.7.d.ts +793 -0
- package/dist/types/entrypoint/0.7.d.ts.map +1 -0
- package/dist/types/entrypoint/index.d.ts +9 -0
- package/dist/types/entrypoint/index.d.ts.map +1 -0
- package/dist/types/entrypoint/types.d.ts +64 -0
- package/dist/types/entrypoint/types.d.ts.map +1 -0
- package/dist/types/errors/account.d.ts +48 -0
- package/dist/types/errors/account.d.ts.map +1 -0
- package/dist/types/errors/base.d.ts +19 -0
- package/dist/types/errors/base.d.ts.map +1 -0
- package/dist/types/errors/client.d.ts +15 -0
- package/dist/types/errors/client.d.ts.map +1 -0
- package/dist/types/errors/entrypoint.d.ts +11 -0
- package/dist/types/errors/entrypoint.d.ts.map +1 -0
- package/dist/types/errors/signer.d.ts +6 -0
- package/dist/types/errors/signer.d.ts.map +1 -0
- package/dist/types/errors/transaction.d.ts +11 -0
- package/dist/types/errors/transaction.d.ts.map +1 -0
- package/dist/types/errors/useroperation.d.ts +36 -0
- package/dist/types/errors/useroperation.d.ts.map +1 -0
- package/dist/types/index.d.ts +64 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/logger.d.ts +21 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/middleware/actions.d.ts +27 -0
- package/dist/types/middleware/actions.d.ts.map +1 -0
- package/dist/types/middleware/defaults/feeEstimator.d.ts +4 -0
- package/dist/types/middleware/defaults/feeEstimator.d.ts.map +1 -0
- package/dist/types/middleware/defaults/gasEstimator.d.ts +12 -0
- package/dist/types/middleware/defaults/gasEstimator.d.ts.map +1 -0
- package/dist/types/middleware/defaults/paymasterAndData.d.ts +3 -0
- package/dist/types/middleware/defaults/paymasterAndData.d.ts.map +1 -0
- package/dist/types/middleware/defaults/userOpSigner.d.ts +3 -0
- package/dist/types/middleware/defaults/userOpSigner.d.ts.map +1 -0
- package/dist/types/middleware/noopMiddleware.d.ts +10 -0
- package/dist/types/middleware/noopMiddleware.d.ts.map +1 -0
- package/dist/types/middleware/types.d.ts +22 -0
- package/dist/types/middleware/types.d.ts.map +1 -0
- package/dist/types/signer/local-account.d.ts +220 -0
- package/dist/types/signer/local-account.d.ts.map +1 -0
- package/dist/types/signer/schema.d.ts +5 -0
- package/dist/types/signer/schema.d.ts.map +1 -0
- package/dist/types/signer/types.d.ts +28 -0
- package/dist/types/signer/types.d.ts.map +1 -0
- package/dist/types/signer/utils.d.ts +16 -0
- package/dist/types/signer/utils.d.ts.map +1 -0
- package/dist/types/signer/wallet-client.d.ts +218 -0
- package/dist/types/signer/wallet-client.d.ts.map +1 -0
- package/dist/types/transport/split.d.ts +42 -0
- package/dist/types/transport/split.d.ts.map +1 -0
- package/dist/types/types.d.ts +176 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/bigint.d.ts +56 -0
- package/dist/types/utils/bigint.d.ts.map +1 -0
- package/dist/types/utils/bytes.d.ts +17 -0
- package/dist/types/utils/bytes.d.ts.map +1 -0
- package/dist/types/utils/defaults.d.ts +15 -0
- package/dist/types/utils/defaults.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +63 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/schema.d.ts +29 -0
- package/dist/types/utils/schema.d.ts.map +1 -0
- package/dist/types/utils/stateOverride.d.ts +5 -0
- package/dist/types/utils/stateOverride.d.ts.map +1 -0
- package/dist/types/utils/testUtils.d.ts +7 -0
- package/dist/types/utils/testUtils.d.ts.map +1 -0
- package/dist/types/utils/types.d.ts +39 -0
- package/dist/types/utils/types.d.ts.map +1 -0
- package/dist/types/utils/userop.d.ts +129 -0
- package/dist/types/utils/userop.d.ts.map +1 -0
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +70 -0
- package/src/abis/EntryPointAbi_v6.ts +1309 -0
- package/src/abis/EntryPointAbi_v7.ts +658 -0
- package/src/abis/SimpleAccountAbi_v6.ts +524 -0
- package/src/abis/SimpleAccountAbi_v7.ts +534 -0
- package/src/abis/SimpleAccountFactoryAbi.ts +74 -0
- package/src/account/base.ts +415 -0
- package/src/account/schema.ts +51 -0
- package/src/account/simple.ts +215 -0
- package/src/account/smartContractAccount.ts +406 -0
- package/src/account/types.ts +184 -0
- package/src/actions/bundler/estimateUserOperationGas.ts +32 -0
- package/src/actions/bundler/getSupportedEntryPoints.ts +13 -0
- package/src/actions/bundler/getUserOperationByHash.ts +17 -0
- package/src/actions/bundler/getUserOperationReceipt.ts +17 -0
- package/src/actions/bundler/sendRawUserOperation.ts +20 -0
- package/src/actions/smartAccount/buildUserOperation.ts +52 -0
- package/src/actions/smartAccount/buildUserOperationFromTx.ts +112 -0
- package/src/actions/smartAccount/buildUserOperationFromTxs.ts +168 -0
- package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +86 -0
- package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +111 -0
- package/src/actions/smartAccount/estimateUserOperationGas.ts +65 -0
- package/src/actions/smartAccount/getAddress.ts +25 -0
- package/src/actions/smartAccount/internal/initUserOperation.ts +93 -0
- package/src/actions/smartAccount/internal/runMiddlewareStack.ts +121 -0
- package/src/actions/smartAccount/internal/sendUserOperation.ts +64 -0
- package/src/actions/smartAccount/sendTransaction.ts +73 -0
- package/src/actions/smartAccount/sendTransactions.ts +53 -0
- package/src/actions/smartAccount/sendUserOperation.ts +65 -0
- package/src/actions/smartAccount/signMessage.ts +28 -0
- package/src/actions/smartAccount/signMessageWith6492.ts +21 -0
- package/src/actions/smartAccount/signTypedData.ts +42 -0
- package/src/actions/smartAccount/signTypedDataWith6492.ts +23 -0
- package/src/actions/smartAccount/signUserOperation.ts +54 -0
- package/src/actions/smartAccount/types.ts +158 -0
- package/src/actions/smartAccount/upgradeAccount.ts +66 -0
- package/src/actions/smartAccount/waitForUserOperationTransacation.ts +58 -0
- package/src/chains/index.ts +194 -0
- package/src/client/bundlerClient.ts +107 -0
- package/src/client/decorators/bundlerClient.ts +129 -0
- package/src/client/decorators/smartAccountClient.ts +177 -0
- package/src/client/isSmartAccountClient.ts +53 -0
- package/src/client/schema.ts +92 -0
- package/src/client/smartAccountClient.ts +276 -0
- package/src/client/types.ts +51 -0
- package/src/ens/utils.ts +37 -0
- package/src/entrypoint/0.6.ts +74 -0
- package/src/entrypoint/0.7.ts +153 -0
- package/src/entrypoint/index.ts +152 -0
- package/src/entrypoint/types.ts +120 -0
- package/src/errors/account.ts +87 -0
- package/src/errors/base.ts +48 -0
- package/src/errors/client.ts +28 -0
- package/src/errors/entrypoint.ts +25 -0
- package/src/errors/signer.ts +13 -0
- package/src/errors/transaction.ts +16 -0
- package/src/errors/useroperation.ts +54 -0
- package/src/index.ts +172 -0
- package/src/logger.ts +58 -0
- package/src/middleware/actions.ts +92 -0
- package/src/middleware/defaults/feeEstimator.ts +50 -0
- package/src/middleware/defaults/gasEstimator.ts +66 -0
- package/src/middleware/defaults/paymasterAndData.ts +13 -0
- package/src/middleware/defaults/userOpSigner.ts +35 -0
- package/src/middleware/noopMiddleware.ts +12 -0
- package/src/middleware/types.ts +49 -0
- package/src/signer/local-account.ts +59 -0
- package/src/signer/schema.ts +16 -0
- package/src/signer/types.ts +46 -0
- package/src/signer/utils.ts +68 -0
- package/src/signer/wallet-client.ts +49 -0
- package/src/transport/split.ts +69 -0
- package/src/types.ts +411 -0
- package/src/utils/bigint.ts +118 -0
- package/src/utils/bytes.ts +23 -0
- package/src/utils/defaults.ts +93 -0
- package/src/utils/index.ts +173 -0
- package/src/utils/schema.ts +52 -0
- package/src/utils/stateOverride.ts +80 -0
- package/src/utils/testUtils.ts +42 -0
- package/src/utils/types.ts +94 -0
- package/src/utils/userop.ts +220 -0
- package/src/version.ts +3 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Address,
|
|
3
|
+
type Hash,
|
|
4
|
+
type Hex,
|
|
5
|
+
type StateOverride,
|
|
6
|
+
type TransactionReceipt,
|
|
7
|
+
} from "viem";
|
|
8
|
+
import type { z } from "zod";
|
|
9
|
+
import type {
|
|
10
|
+
UserOperationFeeOptionsFieldSchema,
|
|
11
|
+
UserOperationFeeOptionsSchema,
|
|
12
|
+
UserOperationFeeOptionsSchema_v6,
|
|
13
|
+
UserOperationFeeOptionsSchema_v7,
|
|
14
|
+
} from "./client/schema";
|
|
15
|
+
import type { EntryPointVersion } from "./entrypoint/types";
|
|
16
|
+
import type {
|
|
17
|
+
BigNumberishRangeSchema,
|
|
18
|
+
BigNumberishSchema,
|
|
19
|
+
MultiplierSchema,
|
|
20
|
+
NoUndefined,
|
|
21
|
+
} from "./utils";
|
|
22
|
+
|
|
23
|
+
export type EmptyHex = `0x`;
|
|
24
|
+
export type NullAddress = `0x0`;
|
|
25
|
+
|
|
26
|
+
// based on @account-abstraction/common
|
|
27
|
+
export type PromiseOrValue<T> = T | Promise<T>;
|
|
28
|
+
export type BytesLike = Uint8Array | Hex;
|
|
29
|
+
export type Multiplier = z.input<typeof MultiplierSchema>;
|
|
30
|
+
|
|
31
|
+
export type BigNumberish = z.input<typeof BigNumberishSchema>;
|
|
32
|
+
export type BigNumberishRange = z.input<typeof BigNumberishRangeSchema>;
|
|
33
|
+
|
|
34
|
+
// [!region UserOperationCallData]
|
|
35
|
+
export type UserOperationCallData =
|
|
36
|
+
| {
|
|
37
|
+
/* the target of the call */
|
|
38
|
+
target: Address;
|
|
39
|
+
/* the data passed to the target */
|
|
40
|
+
data: Hex;
|
|
41
|
+
/* the amount of native token to send to the target (default: 0) */
|
|
42
|
+
value?: bigint;
|
|
43
|
+
}
|
|
44
|
+
| Hex;
|
|
45
|
+
// [!endregion UserOperationCallData]
|
|
46
|
+
|
|
47
|
+
// [!region BatchUserOperationCallData]
|
|
48
|
+
export type BatchUserOperationCallData = Exclude<UserOperationCallData, Hex>[];
|
|
49
|
+
// [!endregion BatchUserOperationCallData]
|
|
50
|
+
|
|
51
|
+
export type UserOperationFeeOptionsField = z.input<
|
|
52
|
+
typeof UserOperationFeeOptionsFieldSchema
|
|
53
|
+
>;
|
|
54
|
+
|
|
55
|
+
export type UserOperationFeeOptions<
|
|
56
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
57
|
+
> = TEntryPointVersion extends "0.6.0"
|
|
58
|
+
? z.input<typeof UserOperationFeeOptionsSchema_v6>
|
|
59
|
+
: TEntryPointVersion extends "0.7.0"
|
|
60
|
+
? z.input<typeof UserOperationFeeOptionsSchema_v7>
|
|
61
|
+
: z.input<typeof UserOperationFeeOptionsSchema>;
|
|
62
|
+
|
|
63
|
+
export type UserOperationOverridesParameter<
|
|
64
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
65
|
+
Required extends boolean = false
|
|
66
|
+
> = Required extends true
|
|
67
|
+
? { overrides: UserOperationOverrides<TEntryPointVersion> }
|
|
68
|
+
: { overrides?: UserOperationOverrides<TEntryPointVersion> };
|
|
69
|
+
|
|
70
|
+
// [!region UserOperationPaymasterOverrides]
|
|
71
|
+
export type UserOperationPaymasterOverrides<
|
|
72
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
73
|
+
> = TEntryPointVersion extends "0.6.0"
|
|
74
|
+
? {
|
|
75
|
+
// paymasterData overrides to bypass paymaster middleware
|
|
76
|
+
paymasterAndData: Hex;
|
|
77
|
+
}
|
|
78
|
+
: TEntryPointVersion extends "0.7.0"
|
|
79
|
+
? {
|
|
80
|
+
// paymasterData overrides to bypass paymaster middleware
|
|
81
|
+
// if set to '0x', all paymaster related fields are omitted from the user op request
|
|
82
|
+
paymasterData: Hex;
|
|
83
|
+
paymaster: Address;
|
|
84
|
+
paymasterVerificationGasLimit:
|
|
85
|
+
| NoUndefined<
|
|
86
|
+
UserOperationStruct<"0.7.0">["paymasterVerificationGasLimit"]
|
|
87
|
+
>
|
|
88
|
+
| Multiplier;
|
|
89
|
+
paymasterPostOpGasLimit:
|
|
90
|
+
| NoUndefined<UserOperationStruct<"0.7.0">["paymasterPostOpGasLimit"]>
|
|
91
|
+
| Multiplier;
|
|
92
|
+
}
|
|
93
|
+
: {};
|
|
94
|
+
// [!endregion UserOperationOverridesParameter]
|
|
95
|
+
|
|
96
|
+
// [!region UserOperationOverrides]
|
|
97
|
+
export type UserOperationOverrides<
|
|
98
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
99
|
+
> = Partial<
|
|
100
|
+
{
|
|
101
|
+
callGasLimit:
|
|
102
|
+
| UserOperationStruct<TEntryPointVersion>["callGasLimit"]
|
|
103
|
+
| Multiplier;
|
|
104
|
+
maxFeePerGas:
|
|
105
|
+
| UserOperationStruct<TEntryPointVersion>["maxFeePerGas"]
|
|
106
|
+
| Multiplier;
|
|
107
|
+
maxPriorityFeePerGas:
|
|
108
|
+
| UserOperationStruct<TEntryPointVersion>["maxPriorityFeePerGas"]
|
|
109
|
+
| Multiplier;
|
|
110
|
+
preVerificationGas:
|
|
111
|
+
| UserOperationStruct<TEntryPointVersion>["preVerificationGas"]
|
|
112
|
+
| Multiplier;
|
|
113
|
+
verificationGasLimit:
|
|
114
|
+
| UserOperationStruct<TEntryPointVersion>["verificationGasLimit"]
|
|
115
|
+
| Multiplier;
|
|
116
|
+
/**
|
|
117
|
+
* This can be used to override the key used when calling `entryPoint.getNonce`
|
|
118
|
+
* It is useful when you want to use parallel nonces for user operations
|
|
119
|
+
*
|
|
120
|
+
* NOTE: not all bundlers fully support this feature and it could be that your bundler will still only include
|
|
121
|
+
* one user operation for your account in a bundle
|
|
122
|
+
*/
|
|
123
|
+
nonceKey: bigint;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The same state overrides for
|
|
127
|
+
* [`eth_call`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-eth#eth-call) method.
|
|
128
|
+
* An address-to-state mapping, where each entry specifies some state to be ephemerally overridden
|
|
129
|
+
* prior to executing the call. State overrides allow you to customize the network state for
|
|
130
|
+
* the purpose of the simulation, so this feature is useful when you need to estimate gas
|
|
131
|
+
* for user operation scenarios under conditions that aren’t currently present on the live network.
|
|
132
|
+
*/
|
|
133
|
+
stateOverride: StateOverride;
|
|
134
|
+
} & UserOperationPaymasterOverrides<TEntryPointVersion>
|
|
135
|
+
>;
|
|
136
|
+
// [!endregion UserOperationOverrides]
|
|
137
|
+
|
|
138
|
+
// [!region UserOperationRequest_v6]
|
|
139
|
+
// represents the request as it needs to be formatted for v0.6 RPC requests
|
|
140
|
+
// Reference: https://github.com/ethereum/ERCs/blob/8dd085d159cb123f545c272c0d871a5339550e79/ERCS/erc-4337.md#definitions
|
|
141
|
+
export interface UserOperationRequest_v6 {
|
|
142
|
+
/* the origin of the request */
|
|
143
|
+
sender: Address;
|
|
144
|
+
/* nonce (as hex) of the transaction, returned from the entry point for this Address */
|
|
145
|
+
nonce: Hex;
|
|
146
|
+
/* the initCode for creating the sender if it does not exist yet, otherwise "0x" */
|
|
147
|
+
initCode: Hex | EmptyHex;
|
|
148
|
+
/* the callData passed to the target */
|
|
149
|
+
callData: Hex;
|
|
150
|
+
/* Gas value (as hex) used by inner account execution */
|
|
151
|
+
callGasLimit: Hex;
|
|
152
|
+
/* Actual gas (as hex) used by the validation of this UserOperation */
|
|
153
|
+
verificationGasLimit: Hex;
|
|
154
|
+
/* Gas overhead (as hex) of this UserOperation */
|
|
155
|
+
preVerificationGas: Hex;
|
|
156
|
+
/* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) (as hex)*/
|
|
157
|
+
maxFeePerGas: Hex;
|
|
158
|
+
/* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) (as hex)*/
|
|
159
|
+
maxPriorityFeePerGas: Hex;
|
|
160
|
+
/* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster ("0x" for self-sponsored transaction) */
|
|
161
|
+
paymasterAndData: Hex | EmptyHex;
|
|
162
|
+
/* Data passed into the account along with the nonce during the verification step */
|
|
163
|
+
signature: Hex;
|
|
164
|
+
}
|
|
165
|
+
// [!endregion UserOperationRequest_v6]
|
|
166
|
+
|
|
167
|
+
// [!region UserOperationRequest_v7]
|
|
168
|
+
// represents the request as it needs to be formatted for v0.7 RPC requests
|
|
169
|
+
// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
170
|
+
export interface UserOperationRequest_v7 {
|
|
171
|
+
/* the account making the operation */
|
|
172
|
+
sender: Address;
|
|
173
|
+
/* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */
|
|
174
|
+
nonce: Hex;
|
|
175
|
+
/* account factory, only for new accounts */
|
|
176
|
+
factory?: Address;
|
|
177
|
+
/* data for account factory (only if account factory exists) */
|
|
178
|
+
factoryData?: Hex;
|
|
179
|
+
/* the data to pass to the sender during the main execution call */
|
|
180
|
+
callData: Hex;
|
|
181
|
+
/* the amount of gas to allocate the main execution call */
|
|
182
|
+
callGasLimit: Hex;
|
|
183
|
+
/* the amount of gas to allocate for the verification step */
|
|
184
|
+
verificationGasLimit: Hex;
|
|
185
|
+
/* extra gas to pay the bunder */
|
|
186
|
+
preVerificationGas: Hex;
|
|
187
|
+
/* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */
|
|
188
|
+
maxFeePerGas: Hex;
|
|
189
|
+
/* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */
|
|
190
|
+
maxPriorityFeePerGas: Hex;
|
|
191
|
+
/* address of paymaster contract, (or empty, if account pays for itself) */
|
|
192
|
+
paymaster?: Address;
|
|
193
|
+
/* the amount of gas to allocate for the paymaster validation code */
|
|
194
|
+
paymasterVerificationGasLimit?: Hex;
|
|
195
|
+
/* the amount of gas to allocate for the paymaster post-operation code */
|
|
196
|
+
paymasterPostOpGasLimit?: Hex;
|
|
197
|
+
/* data for paymaster (only if paymaster exists) */
|
|
198
|
+
paymasterData?: Hex;
|
|
199
|
+
/* data passed into the account to verify authorization */
|
|
200
|
+
signature: Hex;
|
|
201
|
+
}
|
|
202
|
+
// [!endregion UserOperationRequest_v7]
|
|
203
|
+
|
|
204
|
+
// [!region UserOperationRequest]
|
|
205
|
+
// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
206
|
+
export type UserOperationRequest<
|
|
207
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
208
|
+
> = TEntryPointVersion extends "0.6.0"
|
|
209
|
+
? UserOperationRequest_v6
|
|
210
|
+
: TEntryPointVersion extends "0.7.0"
|
|
211
|
+
? UserOperationRequest_v7
|
|
212
|
+
: never;
|
|
213
|
+
|
|
214
|
+
// [!endregion UserOperationRequest]
|
|
215
|
+
|
|
216
|
+
// [!region UserOperationEstimateGasResponse]
|
|
217
|
+
export interface UserOperationEstimateGasResponse<
|
|
218
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
219
|
+
> {
|
|
220
|
+
/* Gas overhead of this UserOperation */
|
|
221
|
+
preVerificationGas: BigNumberish;
|
|
222
|
+
/* Actual gas used by the validation of this UserOperation */
|
|
223
|
+
verificationGasLimit: BigNumberish;
|
|
224
|
+
/* Value used by inner account execution */
|
|
225
|
+
callGasLimit: BigNumberish;
|
|
226
|
+
/*
|
|
227
|
+
* EntryPoint v0.7.0 operations only.
|
|
228
|
+
* The amount of gas to allocate for the paymaster validation code.
|
|
229
|
+
* Note: `eth_estimateUserOperationGas` does not return paymasterPostOpGasLimit.
|
|
230
|
+
*/
|
|
231
|
+
paymasterVerificationGasLimit: TEntryPointVersion extends "0.7.0"
|
|
232
|
+
? BigNumberish | undefined
|
|
233
|
+
: never;
|
|
234
|
+
}
|
|
235
|
+
// [!endregion UserOperationEstimateGasResponse]
|
|
236
|
+
|
|
237
|
+
// [!region UserOperationResponse]
|
|
238
|
+
export interface UserOperationResponse<
|
|
239
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
240
|
+
> {
|
|
241
|
+
/* the User Operation */
|
|
242
|
+
userOperation: UserOperationRequest<TEntryPointVersion>;
|
|
243
|
+
/* the address of the entry point contract that executed the user operation */
|
|
244
|
+
entryPoint: Address;
|
|
245
|
+
/* the block number the user operation was included in */
|
|
246
|
+
blockNumber: BigNumberish;
|
|
247
|
+
/* the hash of the block the user operation was included in */
|
|
248
|
+
blockHash: Hash;
|
|
249
|
+
/* the hash of the transaction that included the user operation */
|
|
250
|
+
transactionHash: Hash;
|
|
251
|
+
}
|
|
252
|
+
// [!endregion UserOperationResponse]
|
|
253
|
+
|
|
254
|
+
// [!region UserOperationReceipt]
|
|
255
|
+
export interface UserOperationReceipt {
|
|
256
|
+
/* The request hash of the UserOperation. */
|
|
257
|
+
userOpHash: Hash;
|
|
258
|
+
/* The entry point address used for the UserOperation. */
|
|
259
|
+
entryPoint: Address;
|
|
260
|
+
/* The account initiating the UserOperation. */
|
|
261
|
+
sender: Address;
|
|
262
|
+
/* The nonce used in the UserOperation. */
|
|
263
|
+
nonce: BigNumberish;
|
|
264
|
+
/* The paymaster used for this UserOperation (or empty). */
|
|
265
|
+
paymaster?: Address;
|
|
266
|
+
/* The actual amount paid (by account or paymaster) for this UserOperation. */
|
|
267
|
+
actualGasCost: BigNumberish;
|
|
268
|
+
/* The total gas used by this UserOperation (including preVerification, creation, validation, and execution). */
|
|
269
|
+
actualGasUsed: BigNumberish;
|
|
270
|
+
/* Indicates whether the execution completed without reverting. */
|
|
271
|
+
success: boolean;
|
|
272
|
+
/* In case of revert, this is the revert reason. */
|
|
273
|
+
reason?: string;
|
|
274
|
+
/* The logs generated by this UserOperation (not including logs of other UserOperations in the same bundle). */
|
|
275
|
+
logs: string[];
|
|
276
|
+
/* The TransactionReceipt object for the entire bundle, not only for this UserOperation. */
|
|
277
|
+
receipt: TransactionReceipt;
|
|
278
|
+
}
|
|
279
|
+
// [!endregion UserOperationReceipt]
|
|
280
|
+
|
|
281
|
+
/** @deprecated use viem type TransactionReceipt instead */
|
|
282
|
+
export interface UserOperationReceiptObject {
|
|
283
|
+
/* 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log */
|
|
284
|
+
blockHash: Hash;
|
|
285
|
+
/* The block number where this log was in. null when its pending. null when its pending log. */
|
|
286
|
+
blockNumber: BigNumberish;
|
|
287
|
+
/* The index of the transaction within the block. */
|
|
288
|
+
transactionIndex: BigNumberish;
|
|
289
|
+
/* 32 Bytes - hash of the transaction. null when its pending. */
|
|
290
|
+
transactionHash: Hash;
|
|
291
|
+
/* 20 Bytes - address of the sender */
|
|
292
|
+
from: Address;
|
|
293
|
+
/* 20 Bytes - address of the receiver. null when its a contract creation transaction */
|
|
294
|
+
to: Address;
|
|
295
|
+
/* The total amount of gas used when this transaction was executed in the block. */
|
|
296
|
+
cumulativeGasUsed: BigNumberish;
|
|
297
|
+
/* The amount of gas used by this specific transaction alone */
|
|
298
|
+
gasUsed: BigNumberish;
|
|
299
|
+
/* 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null */
|
|
300
|
+
contractAddress: Address;
|
|
301
|
+
logs: UserOperationReceiptLog[];
|
|
302
|
+
/* 256 Bytes - Bloom filter for light clients to quickly retrieve related logs */
|
|
303
|
+
logsBloom: Hex;
|
|
304
|
+
/* 32 bytes of post-transaction stateroot. (pre Byzantium hard fork at block 4,370,000) */
|
|
305
|
+
root: Hex;
|
|
306
|
+
/* Either 1 (success) or 0 (failure). (post Byzantium hard fork at block 4,370,000) */
|
|
307
|
+
status: number;
|
|
308
|
+
/* The cumulative gas used in the block containing this UserOperation. */
|
|
309
|
+
effectiveGasPrice: BigNumberish;
|
|
310
|
+
/* The type of the recipt object */
|
|
311
|
+
type: string;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** @deprecated use viem type Log instead */
|
|
315
|
+
/* https://github.com/wevm/viem/blob/6ef4ac131a878bf1dc4b335f5dc127e62618dda0/src/types/log.ts#L15 */
|
|
316
|
+
export interface UserOperationReceiptLog {
|
|
317
|
+
/* The hash of the block where the given transaction was included. */
|
|
318
|
+
blockHash: Hash;
|
|
319
|
+
/* The number of the block where the given transaction was included. */
|
|
320
|
+
blockNumber: BigNumberish;
|
|
321
|
+
/* The index of the transaction within the block. */
|
|
322
|
+
transactionIndex: BigNumberish;
|
|
323
|
+
/* 20 Bytes - address from which this log originated. */
|
|
324
|
+
address: Address;
|
|
325
|
+
/* Integer of the log index position in the block. null when its pending log. */
|
|
326
|
+
logIndex: BigNumberish;
|
|
327
|
+
/* Contains one or more 32 Bytes non-indexed arguments of the log. */
|
|
328
|
+
data: Hex;
|
|
329
|
+
/* true when the log was removed, due to a chain reorganization. false if its a valid log. */
|
|
330
|
+
removed: boolean;
|
|
331
|
+
/* Array of zero to four 32 Bytes DATA of indexed log arguments. */
|
|
332
|
+
topics: string[];
|
|
333
|
+
/* hash of the transaction */
|
|
334
|
+
transactionHash: Hash;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// [!region UserOperationStruct_v6]
|
|
338
|
+
// https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOperation.ts
|
|
339
|
+
// this is used for building requests for v0.6 entry point contract
|
|
340
|
+
export interface UserOperationStruct_v6 {
|
|
341
|
+
/* the origin of the request */
|
|
342
|
+
sender: string;
|
|
343
|
+
/* nonce of the transaction, returned from the entry point for this address */
|
|
344
|
+
nonce: BigNumberish;
|
|
345
|
+
/* the initCode for creating the sender if it does not exist yet, otherwise "0x" */
|
|
346
|
+
initCode: BytesLike | "0x";
|
|
347
|
+
/* the callData passed to the target */
|
|
348
|
+
callData: BytesLike;
|
|
349
|
+
/* Value used by inner account execution */
|
|
350
|
+
callGasLimit?: BigNumberish;
|
|
351
|
+
/* Actual gas used by the validation of this UserOperation */
|
|
352
|
+
verificationGasLimit?: BigNumberish;
|
|
353
|
+
/* Gas overhead of this UserOperation */
|
|
354
|
+
preVerificationGas?: BigNumberish;
|
|
355
|
+
/* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */
|
|
356
|
+
maxFeePerGas?: BigNumberish;
|
|
357
|
+
/* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */
|
|
358
|
+
maxPriorityFeePerGas?: BigNumberish;
|
|
359
|
+
/* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster ("0x" for self-sponsored transaction) */
|
|
360
|
+
paymasterAndData: BytesLike | "0x";
|
|
361
|
+
/* Data passed into the account along with the nonce during the verification step */
|
|
362
|
+
signature: BytesLike;
|
|
363
|
+
}
|
|
364
|
+
// [!endregion UserOperationStruct_v6]
|
|
365
|
+
|
|
366
|
+
// [!region UserOperationStruct_v7]
|
|
367
|
+
// based on https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/test/UserOperation.ts
|
|
368
|
+
// this is used for building requests for v0.7 entry point contract
|
|
369
|
+
export interface UserOperationStruct_v7 {
|
|
370
|
+
/* the account making the operation */
|
|
371
|
+
sender: string;
|
|
372
|
+
/* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */
|
|
373
|
+
nonce: BigNumberish;
|
|
374
|
+
/* account factory, only for new accounts */
|
|
375
|
+
factory?: string;
|
|
376
|
+
/* data for account factory (only if account factory exists) */
|
|
377
|
+
factoryData?: BytesLike;
|
|
378
|
+
/* the data to pass to the sender during the main execution call */
|
|
379
|
+
callData: BytesLike;
|
|
380
|
+
/* the amount of gas to allocate the main execution call */
|
|
381
|
+
callGasLimit?: BigNumberish;
|
|
382
|
+
/* the amount of gas to allocate for the verification step */
|
|
383
|
+
verificationGasLimit?: BigNumberish;
|
|
384
|
+
/* extra gas to pay the bunder */
|
|
385
|
+
preVerificationGas?: BigNumberish;
|
|
386
|
+
/* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */
|
|
387
|
+
maxFeePerGas?: BigNumberish;
|
|
388
|
+
/* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */
|
|
389
|
+
maxPriorityFeePerGas?: BigNumberish;
|
|
390
|
+
/* address of paymaster contract, (or empty, if account pays for itself) */
|
|
391
|
+
paymaster?: string;
|
|
392
|
+
/* the amount of gas to allocate for the paymaster validation code */
|
|
393
|
+
paymasterVerificationGasLimit?: BigNumberish;
|
|
394
|
+
/* the amount of gas to allocate for the paymaster post-operation code */
|
|
395
|
+
paymasterPostOpGasLimit?: BigNumberish;
|
|
396
|
+
/* data for paymaster (only if paymaster exists) */
|
|
397
|
+
paymasterData?: BytesLike;
|
|
398
|
+
/* data passed into the account to verify authorization */
|
|
399
|
+
signature: BytesLike;
|
|
400
|
+
}
|
|
401
|
+
// [!endregion UserOperationStruct_v7]
|
|
402
|
+
|
|
403
|
+
// [!region UserOperationStruct]
|
|
404
|
+
export type UserOperationStruct<
|
|
405
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
406
|
+
> = TEntryPointVersion extends "0.6.0"
|
|
407
|
+
? UserOperationStruct_v6
|
|
408
|
+
: TEntryPointVersion extends "0.7.0"
|
|
409
|
+
? UserOperationStruct_v7
|
|
410
|
+
: never;
|
|
411
|
+
// [!endregion UserOperationStruct]
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { keccak256, toHex } from "viem";
|
|
2
|
+
import type { BigNumberish, Multiplier } from "../types";
|
|
3
|
+
import { isMultiplier } from "./schema.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the max bigint in a list of bigints
|
|
7
|
+
*
|
|
8
|
+
* @param args a list of bigints to get the max of
|
|
9
|
+
* @returns the max bigint in the list
|
|
10
|
+
*/
|
|
11
|
+
export const bigIntMax = (...args: bigint[]): bigint => {
|
|
12
|
+
if (!args.length) {
|
|
13
|
+
throw new Error("bigIntMax requires at least one argument");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return args.reduce((m, c) => (m > c ? m : c));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns the min bigint in a list of bigints
|
|
21
|
+
*
|
|
22
|
+
* @param args a list of bigints to get the max of
|
|
23
|
+
* @returns the min bigint in the list
|
|
24
|
+
*/
|
|
25
|
+
export const bigIntMin = (...args: bigint[]): bigint => {
|
|
26
|
+
if (!args.length) {
|
|
27
|
+
throw new Error("bigIntMin requires at least one argument");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return args.reduce((m, c) => (m < c ? m : c));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Given a bigint and a min-max range, returns the min-max clamped bigint value
|
|
35
|
+
*
|
|
36
|
+
* @param value a bigint value to clamp
|
|
37
|
+
* @param lower lower bound min max tuple value
|
|
38
|
+
* @param upper upper bound min max tuple value
|
|
39
|
+
* @returns the clamped bigint value per given range
|
|
40
|
+
*/
|
|
41
|
+
export const bigIntClamp = (
|
|
42
|
+
value: BigNumberish,
|
|
43
|
+
lower: BigNumberish | null | undefined,
|
|
44
|
+
upper: BigNumberish | null | undefined
|
|
45
|
+
) => {
|
|
46
|
+
lower = lower != null ? BigInt(lower) : null;
|
|
47
|
+
upper = upper != null ? BigInt(upper) : null;
|
|
48
|
+
|
|
49
|
+
if (upper != null && lower != null && upper < lower) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
`invalid range: upper bound ${upper} is less than lower bound ${lower}`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let ret = BigInt(value);
|
|
56
|
+
if (lower != null && lower > ret) {
|
|
57
|
+
ret = lower;
|
|
58
|
+
}
|
|
59
|
+
if (upper != null && upper < ret) {
|
|
60
|
+
ret = upper;
|
|
61
|
+
}
|
|
62
|
+
return ret;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export enum RoundingMode {
|
|
66
|
+
ROUND_DOWN = 0,
|
|
67
|
+
ROUND_UP = 1,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Given a bigint and a number (which can be a float), returns the bigint value.
|
|
72
|
+
* Note: this function has loss and will round down to the nearest integer.
|
|
73
|
+
*
|
|
74
|
+
* @param base - the number to be multiplied
|
|
75
|
+
* @param multiplier - the amount to multiply by
|
|
76
|
+
* @param roundingMode - the rounding mode to use when calculating the percent. defaults to ROUND_UP
|
|
77
|
+
* @returns the bigint value of the multiplication with the number rounded by the rounding mode
|
|
78
|
+
*/
|
|
79
|
+
export const bigIntMultiply = (
|
|
80
|
+
base: BigNumberish,
|
|
81
|
+
multiplier: Multiplier["multiplier"],
|
|
82
|
+
roundingMode: RoundingMode = RoundingMode.ROUND_UP
|
|
83
|
+
) => {
|
|
84
|
+
if (!isMultiplier({ multiplier })) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
"bigIntMultiply requires a multiplier validated number as the second argument"
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Get decimal places of b. Max decimal places is defined by the MultiplerSchema.
|
|
91
|
+
const decimalPlaces = multiplier.toString().split(".")[1]?.length ?? 0;
|
|
92
|
+
const val =
|
|
93
|
+
roundingMode === RoundingMode.ROUND_UP
|
|
94
|
+
? BigInt(base) * BigInt(multiplier * 10 ** decimalPlaces) +
|
|
95
|
+
BigInt(10 ** decimalPlaces - 1)
|
|
96
|
+
: BigInt(base) * BigInt(multiplier * 10 ** decimalPlaces);
|
|
97
|
+
|
|
98
|
+
return val / BigInt(10 ** decimalPlaces);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Useful if you want to use a string, such as a user's email address, as salt to generate a unique SmartAccount per user.
|
|
103
|
+
*
|
|
104
|
+
* example:
|
|
105
|
+
* ```
|
|
106
|
+
* const salt = stringToIndex("alice@example.com");
|
|
107
|
+
*
|
|
108
|
+
* export const account = new SimpleSmartContractAccount({
|
|
109
|
+
* index: salt,
|
|
110
|
+
* // other args omitted...
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @param phrase -- any string value.
|
|
115
|
+
* @returns the bigint value of the hashed string
|
|
116
|
+
*/
|
|
117
|
+
export const stringToIndex = (phrase: string): bigint =>
|
|
118
|
+
BigInt(keccak256(toHex(phrase)));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Hex } from "viem";
|
|
2
|
+
|
|
3
|
+
type TakeBytesOpts = {
|
|
4
|
+
count?: number;
|
|
5
|
+
offset?: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Given a bytes string, returns a slice of the bytes
|
|
10
|
+
*
|
|
11
|
+
* @param bytes - the hex string representing bytes
|
|
12
|
+
* @param opts - optional parameters for slicing the bytes
|
|
13
|
+
* @param opts.offset - the offset in bytes to start slicing from
|
|
14
|
+
* @param opts.count - the number of bytes to slice
|
|
15
|
+
* @returns the sliced bytes
|
|
16
|
+
*/
|
|
17
|
+
export const takeBytes = (bytes: Hex, opts: TakeBytesOpts = {}): Hex => {
|
|
18
|
+
const { offset, count } = opts;
|
|
19
|
+
const start = (offset ? offset * 2 : 0) + 2; // add 2 to skip the 0x prefix
|
|
20
|
+
const end = count ? start + count * 2 : undefined;
|
|
21
|
+
|
|
22
|
+
return `0x${bytes.slice(start, end)}`;
|
|
23
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Address, type Chain } from "viem";
|
|
2
|
+
import {
|
|
3
|
+
arbitrum,
|
|
4
|
+
arbitrumGoerli,
|
|
5
|
+
arbitrumSepolia,
|
|
6
|
+
base,
|
|
7
|
+
baseGoerli,
|
|
8
|
+
baseSepolia,
|
|
9
|
+
fraxtal,
|
|
10
|
+
fraxtalSepolia,
|
|
11
|
+
goerli,
|
|
12
|
+
mainnet,
|
|
13
|
+
optimism,
|
|
14
|
+
optimismGoerli,
|
|
15
|
+
optimismSepolia,
|
|
16
|
+
polygon,
|
|
17
|
+
polygonAmoy,
|
|
18
|
+
polygonMumbai,
|
|
19
|
+
sepolia,
|
|
20
|
+
zora,
|
|
21
|
+
zoraSepolia,
|
|
22
|
+
} from "../chains/index.js";
|
|
23
|
+
import { defaultEntryPointVersion } from "../entrypoint/index.js";
|
|
24
|
+
import type { EntryPointVersion } from "../entrypoint/types.js";
|
|
25
|
+
import { DefaultFactoryNotDefinedError } from "../errors/account.js";
|
|
26
|
+
import type { UserOperationFeeOptions } from "../types";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Utility method returning the default simple account factory address given a {@link Chain} object
|
|
30
|
+
*
|
|
31
|
+
* @param chain - a {@link Chain} object
|
|
32
|
+
* @param version - {@link EntryPointVersion} value that defaults to `defaultEntryPointVersion`
|
|
33
|
+
* @returns a {@link abi.Address} for the given chain
|
|
34
|
+
* @throws if the chain doesn't have an address currently deployed
|
|
35
|
+
*/
|
|
36
|
+
export const getDefaultSimpleAccountFactoryAddress = (
|
|
37
|
+
chain: Chain,
|
|
38
|
+
version: EntryPointVersion = defaultEntryPointVersion
|
|
39
|
+
): Address => {
|
|
40
|
+
switch (version) {
|
|
41
|
+
case "0.6.0":
|
|
42
|
+
switch (chain.id) {
|
|
43
|
+
case mainnet.id:
|
|
44
|
+
case polygon.id:
|
|
45
|
+
case polygonAmoy.id:
|
|
46
|
+
case optimism.id:
|
|
47
|
+
case optimismSepolia.id:
|
|
48
|
+
case arbitrum.id:
|
|
49
|
+
case arbitrumSepolia.id:
|
|
50
|
+
case base.id:
|
|
51
|
+
case baseGoerli.id:
|
|
52
|
+
case baseSepolia.id:
|
|
53
|
+
case fraxtal.id:
|
|
54
|
+
case fraxtalSepolia.id:
|
|
55
|
+
case zora.id:
|
|
56
|
+
case zoraSepolia.id:
|
|
57
|
+
return "0x15Ba39375ee2Ab563E8873C8390be6f2E2F50232";
|
|
58
|
+
case sepolia.id:
|
|
59
|
+
case goerli.id:
|
|
60
|
+
case polygonMumbai.id:
|
|
61
|
+
case optimismGoerli.id:
|
|
62
|
+
case arbitrumGoerli.id:
|
|
63
|
+
return "0x9406Cc6185a346906296840746125a0E44976454";
|
|
64
|
+
default:
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
68
|
+
case "0.7.0":
|
|
69
|
+
switch (chain.id) {
|
|
70
|
+
default:
|
|
71
|
+
return "0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
throw new DefaultFactoryNotDefinedError("SimpleAccount", chain, version);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const minPriorityFeePerBidDefaults = new Map<number, bigint>([
|
|
79
|
+
[arbitrum.id, 10_000_000n],
|
|
80
|
+
[arbitrumGoerli.id, 10_000_000n],
|
|
81
|
+
[arbitrumSepolia.id, 10_000_000n],
|
|
82
|
+
]);
|
|
83
|
+
|
|
84
|
+
export const getDefaultUserOperationFeeOptions = (
|
|
85
|
+
chain: Chain
|
|
86
|
+
): UserOperationFeeOptions => {
|
|
87
|
+
return {
|
|
88
|
+
maxPriorityFeePerGas: {
|
|
89
|
+
min: minPriorityFeePerBidDefaults.get(chain.id) ?? 100_000_000n,
|
|
90
|
+
multiplier: 1.33,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
};
|