@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
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type Transport } from "viem";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import type { SmartAccountSigner } from "../signer/types.js";
|
|
4
|
+
export declare const createBaseSmartAccountParamsSchema: <TTransport extends Transport = Transport, TSigner extends SmartAccountSigner<any> = SmartAccountSigner<any>>() => z.ZodObject<{
|
|
5
|
+
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
6
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
7
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
8
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
9
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
10
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
11
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
12
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, { [k_1 in keyof z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
14
|
+
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
15
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
16
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
17
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
18
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
19
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
20
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
21
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
22
|
+
}>, "chain" | "factoryAddress" | "rpcClient" | (undefined extends TSigner ? never : "signer")>]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
23
|
+
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
24
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
25
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
26
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
27
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
28
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
29
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
30
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
31
|
+
}>, "chain" | "factoryAddress" | "rpcClient" | (undefined extends TSigner ? never : "signer")>[k_1]; }, { [k_2 in keyof z.baseObjectInputType<{
|
|
32
|
+
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
33
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
34
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
35
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
36
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
37
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
38
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
39
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
40
|
+
}>]: z.baseObjectInputType<{
|
|
41
|
+
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
42
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
43
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
44
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
45
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
46
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
47
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
48
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
49
|
+
}>[k_2]; }>;
|
|
50
|
+
export declare const SimpleSmartAccountParamsSchema: <TTransport extends Transport = Transport, TSigner extends SmartAccountSigner<any> = SmartAccountSigner<any>>() => z.ZodObject<{
|
|
51
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
52
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
53
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
54
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
55
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
56
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
57
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
58
|
+
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
59
|
+
salt: z.ZodOptional<z.ZodBigInt>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
61
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
62
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
63
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
64
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
65
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
66
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
67
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
68
|
+
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
69
|
+
salt: z.ZodOptional<z.ZodBigInt>;
|
|
70
|
+
}>, "chain" | "factoryAddress" | (undefined extends TTransport ? never : "transport") | (undefined extends TSigner ? never : "signer")> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
71
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
72
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
73
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
74
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
75
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
76
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
77
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
78
|
+
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
79
|
+
salt: z.ZodOptional<z.ZodBigInt>;
|
|
80
|
+
}>, "chain" | "factoryAddress" | (undefined extends TTransport ? never : "transport") | (undefined extends TSigner ? never : "signer")>[k]; } : never, z.baseObjectInputType<{
|
|
81
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
82
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
83
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
84
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
85
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
86
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
87
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
88
|
+
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
89
|
+
salt: z.ZodOptional<z.ZodBigInt>;
|
|
90
|
+
}> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<{
|
|
91
|
+
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
92
|
+
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
93
|
+
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
94
|
+
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
95
|
+
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
96
|
+
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
97
|
+
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
98
|
+
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
99
|
+
salt: z.ZodOptional<z.ZodBigInt>;
|
|
100
|
+
}>[k_1]; } : never>;
|
|
101
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/account/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2B3C,CAAC;AAEL,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAWrC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Address } from "abitype";
|
|
2
|
+
import { type Chain, type Hex, type Transport } from "viem";
|
|
3
|
+
import type { DefaultEntryPointVersion, EntryPointParameter, EntryPointVersion } from "../entrypoint/types.js";
|
|
4
|
+
import type { SmartAccountSigner } from "../signer/types.js";
|
|
5
|
+
import { type SmartContractAccountWithSigner, type ToSmartContractAccountParams } from "./smartContractAccount.js";
|
|
6
|
+
export type SimpleSmartAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = SmartContractAccountWithSigner<"SimpleAccount", TSigner, TEntryPointVersion>;
|
|
7
|
+
export type CreateSimpleAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion> = Pick<ToSmartContractAccountParams<"SimpleAccount", TTransport, Chain, TEntryPointVersion>, "chain" | "transport"> & {
|
|
8
|
+
signer: TSigner;
|
|
9
|
+
salt?: bigint;
|
|
10
|
+
accountAddress?: Address;
|
|
11
|
+
factoryAddress?: Address;
|
|
12
|
+
initCode?: Hex;
|
|
13
|
+
} & EntryPointParameter<TEntryPointVersion, Chain>;
|
|
14
|
+
export declare function createSimpleSmartAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion>(config: CreateSimpleAccountParams<TTransport, TSigner, TEntryPointVersion>): Promise<SimpleSmartAccount<TSigner, TEntryPointVersion>>;
|
|
15
|
+
//# sourceMappingURL=simple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../src/account/simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAIL,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AASd,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAK7D,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EAClC,MAAM,2BAA2B,CAAC;AAuFnC,MAAM,MAAM,kBAAkB,CAC5B,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,kBAAkB,SAAS,iBAAiB,GAAG,iBAAiB,IAC9D,8BAA8B,CAChC,eAAe,EACf,OAAO,EACP,kBAAkB,CACnB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CACnC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,kBAAkB,SAAS,iBAAiB,GAAG,wBAAwB,IACrE,IAAI,CACN,4BAA4B,CAC1B,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,CACnB,EACD,OAAO,GAAG,WAAW,CACtB,GAAG;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAEnD,wBAAsB,wBAAwB,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,kBAAkB,SAAS,iBAAiB,GAAG,wBAAwB,EAEvE,MAAM,EAAE,yBAAyB,CAAC,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,GACzE,OAAO,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type Address, type Chain, type CustomSource, type Hex, type LocalAccount, type PublicClient, type SignableMessage, type Transport, type TypedData, type TypedDataDefinition } from "viem";
|
|
2
|
+
import type { EntryPointDef, EntryPointRegistryBase, EntryPointVersion } from "../entrypoint/types.js";
|
|
3
|
+
import type { SmartAccountSigner } from "../signer/types.js";
|
|
4
|
+
import type { NullAddress } from "../types.js";
|
|
5
|
+
import type { IsUndefined } from "../utils/types.js";
|
|
6
|
+
export type AccountOp = {
|
|
7
|
+
target: Address;
|
|
8
|
+
value?: bigint;
|
|
9
|
+
data: Hex | "0x";
|
|
10
|
+
};
|
|
11
|
+
export type GetEntryPointFromAccount<TAccount extends SmartContractAccount | undefined, TAccountOverride extends SmartContractAccount = SmartContractAccount> = GetAccountParameter<TAccount, TAccountOverride> extends SmartContractAccount<string, infer TEntryPointVersion> ? TEntryPointVersion : EntryPointVersion;
|
|
12
|
+
export type GetAccountParameter<TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TAccountOverride extends SmartContractAccount = SmartContractAccount> = IsUndefined<TAccount> extends true ? {
|
|
13
|
+
account: TAccountOverride;
|
|
14
|
+
} : {
|
|
15
|
+
account?: TAccountOverride;
|
|
16
|
+
};
|
|
17
|
+
export type UpgradeToAndCallParams = {
|
|
18
|
+
upgradeToAddress: Address;
|
|
19
|
+
upgradeToInitData: Hex;
|
|
20
|
+
};
|
|
21
|
+
export type SmartContractAccountWithSigner<Name extends string = string, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = SmartContractAccount<Name, TEntryPointVersion> & {
|
|
22
|
+
getSigner: () => TSigner;
|
|
23
|
+
};
|
|
24
|
+
export declare const isSmartAccountWithSigner: (account: SmartContractAccount) => account is SmartContractAccountWithSigner<string, SmartAccountSigner<any>, keyof EntryPointRegistryBase<unknown>>;
|
|
25
|
+
export type SmartContractAccount<Name extends string = string, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = LocalAccount<Name> & {
|
|
26
|
+
source: Name;
|
|
27
|
+
getDummySignature: () => Hex | Promise<Hex>;
|
|
28
|
+
encodeExecute: (tx: AccountOp) => Promise<Hex>;
|
|
29
|
+
encodeBatchExecute: (txs: AccountOp[]) => Promise<Hex>;
|
|
30
|
+
signUserOperationHash: (uoHash: Hex) => Promise<Hex>;
|
|
31
|
+
signMessageWith6492: (params: {
|
|
32
|
+
message: SignableMessage;
|
|
33
|
+
}) => Promise<Hex>;
|
|
34
|
+
signTypedDataWith6492: <const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
|
|
35
|
+
encodeUpgradeToAndCall: (params: UpgradeToAndCallParams) => Promise<Hex>;
|
|
36
|
+
getNonce(nonceKey?: bigint): Promise<bigint>;
|
|
37
|
+
getInitCode: () => Promise<Hex>;
|
|
38
|
+
isAccountDeployed: () => Promise<boolean>;
|
|
39
|
+
getFactoryAddress: () => Promise<Address>;
|
|
40
|
+
getFactoryData: () => Promise<Hex>;
|
|
41
|
+
getEntryPoint: () => EntryPointDef<TEntryPointVersion>;
|
|
42
|
+
getImplementationAddress: () => Promise<NullAddress | Address>;
|
|
43
|
+
};
|
|
44
|
+
export interface AccountEntryPointRegistry<Name extends string = string> extends EntryPointRegistryBase<SmartContractAccount<Name, EntryPointVersion>> {
|
|
45
|
+
"0.6.0": SmartContractAccount<Name, "0.6.0">;
|
|
46
|
+
"0.7.0": SmartContractAccount<Name, "0.7.0">;
|
|
47
|
+
}
|
|
48
|
+
export type ToSmartContractAccountParams<Name extends string = string, TTransport extends Transport = Transport, TChain extends Chain = Chain, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = {
|
|
49
|
+
source: Name;
|
|
50
|
+
transport: TTransport;
|
|
51
|
+
chain: TChain;
|
|
52
|
+
entryPoint: EntryPointDef<TEntryPointVersion, TChain>;
|
|
53
|
+
accountAddress?: Address;
|
|
54
|
+
getAccountInitCode: () => Promise<Hex>;
|
|
55
|
+
getDummySignature: () => Hex | Promise<Hex>;
|
|
56
|
+
encodeExecute: (tx: AccountOp) => Promise<Hex>;
|
|
57
|
+
encodeBatchExecute?: (txs: AccountOp[]) => Promise<Hex>;
|
|
58
|
+
signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;
|
|
59
|
+
encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;
|
|
60
|
+
} & Omit<CustomSource, "signTransaction" | "address">;
|
|
61
|
+
export declare const parseFactoryAddressFromAccountInitCode: (initCode: Hex) => [Address, Hex];
|
|
62
|
+
export declare const getAccountAddress: ({ client, entryPoint, accountAddress, getAccountInitCode, }: {
|
|
63
|
+
client: PublicClient;
|
|
64
|
+
entryPoint: EntryPointDef;
|
|
65
|
+
accountAddress?: `0x${string}` | undefined;
|
|
66
|
+
getAccountInitCode: () => Promise<Hex>;
|
|
67
|
+
}) => Promise<`0x${string}`>;
|
|
68
|
+
export declare function toSmartContractAccount<Name extends string = string, TTransport extends Transport = Transport, TChain extends Chain = Chain, TEntryPointVersion extends EntryPointVersion = EntryPointVersion>({ transport, chain, entryPoint, source, accountAddress, getAccountInitCode, signMessage, signTypedData, encodeBatchExecute, encodeExecute, getDummySignature, signUserOperationHash, encodeUpgradeToAndCall, }: ToSmartContractAccountParams<Name, TTransport, TChain, TEntryPointVersion>): Promise<SmartContractAccount<Name, TEntryPointVersion>>;
|
|
69
|
+
//# sourceMappingURL=smartContractAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartContractAccount.d.ts","sourceRoot":"","sources":["../../../src/account/smartContractAccount.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { Address } from "abitype";
|
|
2
|
+
import type { Hash, Hex, HttpTransport, Transport } from "viem";
|
|
3
|
+
import type { SignTypedDataParameters } from "viem/accounts";
|
|
4
|
+
import type { z } from "zod";
|
|
5
|
+
import type { BundlerClient } from "../client/bundlerClient";
|
|
6
|
+
import type { SmartAccountSigner } from "../signer/types";
|
|
7
|
+
import type { BatchUserOperationCallData } from "../types";
|
|
8
|
+
import type { SimpleSmartAccountParamsSchema, createBaseSmartAccountParamsSchema } from "./schema";
|
|
9
|
+
/** @deprecated */
|
|
10
|
+
export type SignTypedDataParams = Omit<SignTypedDataParameters, "privateKey">;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated don't use base smart account anymore, migrate to using toSmartContractAccount instead
|
|
13
|
+
*/
|
|
14
|
+
export type BaseSmartAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> = z.input<ReturnType<typeof createBaseSmartAccountParamsSchema<TTransport, TSigner>>>;
|
|
15
|
+
export type SimpleSmartAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> = z.input<ReturnType<typeof SimpleSmartAccountParamsSchema<TTransport, TSigner>>>;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated use `toSmartContractAccount` instead for creating instances of smart accounts
|
|
18
|
+
*/
|
|
19
|
+
export interface ISmartContractAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> {
|
|
20
|
+
/**
|
|
21
|
+
* The RPC provider the account uses to make RPC calls
|
|
22
|
+
*/
|
|
23
|
+
readonly rpcProvider: BundlerClient<TTransport> | BundlerClient<HttpTransport>;
|
|
24
|
+
/**
|
|
25
|
+
* @returns the init code for the account
|
|
26
|
+
*/
|
|
27
|
+
getInitCode(): Promise<Hex>;
|
|
28
|
+
/**
|
|
29
|
+
* This is useful for estimating gas costs. It should return a signature that doesn't cause the account to revert
|
|
30
|
+
* when validation is run during estimation.
|
|
31
|
+
*
|
|
32
|
+
* @returns a dummy signature that doesn't cause the account to revert during estimation
|
|
33
|
+
*/
|
|
34
|
+
getDummySignature(): Hex | Promise<Hex>;
|
|
35
|
+
/**
|
|
36
|
+
* Encodes a call to the account's execute function.
|
|
37
|
+
*
|
|
38
|
+
* @param target - the address receiving the call data
|
|
39
|
+
* @param value - optionally the amount of native token to send
|
|
40
|
+
* @param data - the call data or "0x" if empty
|
|
41
|
+
*/
|
|
42
|
+
encodeExecute(target: string, value: bigint, data: string): Promise<Hex>;
|
|
43
|
+
/**
|
|
44
|
+
* Encodes a batch of transactions to the account's batch execute function.
|
|
45
|
+
* NOTE: not all accounts support batching.
|
|
46
|
+
*
|
|
47
|
+
* @param txs - An Array of objects containing the target, value, and data for each transaction
|
|
48
|
+
* @returns the encoded callData for a UserOperation
|
|
49
|
+
*/
|
|
50
|
+
encodeBatchExecute(txs: BatchUserOperationCallData): Promise<Hex>;
|
|
51
|
+
/**
|
|
52
|
+
* @returns the nonce of the account
|
|
53
|
+
*/
|
|
54
|
+
getNonce(): Promise<bigint>;
|
|
55
|
+
/**
|
|
56
|
+
* If your account handles 1271 signatures of personal_sign differently
|
|
57
|
+
* than it does UserOperations, you can implement two different approaches to signing
|
|
58
|
+
*
|
|
59
|
+
* @param uoHash -- The hash of the UserOperation to sign
|
|
60
|
+
* @returns the signature of the UserOperation
|
|
61
|
+
*/
|
|
62
|
+
signUserOperationHash(uoHash: Hash): Promise<Hash>;
|
|
63
|
+
/**
|
|
64
|
+
* Returns a signed and prefixed message.
|
|
65
|
+
*
|
|
66
|
+
* @param msg - the message to sign
|
|
67
|
+
* @returns the signature of the message
|
|
68
|
+
*/
|
|
69
|
+
signMessage(msg: string | Uint8Array | Hex): Promise<Hex>;
|
|
70
|
+
/**
|
|
71
|
+
* Signs a typed data object as per ERC-712
|
|
72
|
+
*
|
|
73
|
+
* @param params - {@link SignTypedDataParams}
|
|
74
|
+
* @returns the signed hash for the message passed
|
|
75
|
+
*/
|
|
76
|
+
signTypedData(params: SignTypedDataParams): Promise<Hash>;
|
|
77
|
+
/**
|
|
78
|
+
* If the account is not deployed, it will sign the message and then wrap it in 6492 format
|
|
79
|
+
*
|
|
80
|
+
* @param msg - the message to sign
|
|
81
|
+
* @returns ths signature wrapped in 6492 format
|
|
82
|
+
*/
|
|
83
|
+
signMessageWith6492(msg: string | Uint8Array | Hex): Promise<Hex>;
|
|
84
|
+
/**
|
|
85
|
+
* If the account is not deployed, it will sign the typed data blob and then wrap it in 6492 format
|
|
86
|
+
*
|
|
87
|
+
* @param params - {@link SignTypedDataParams}
|
|
88
|
+
* @returns the signed hash for the params passed in wrapped in 6492 format
|
|
89
|
+
*/
|
|
90
|
+
signTypedDataWith6492(params: SignTypedDataParams): Promise<Hash>;
|
|
91
|
+
/**
|
|
92
|
+
* @returns the address of the account
|
|
93
|
+
*/
|
|
94
|
+
getAddress(): Promise<Address>;
|
|
95
|
+
/**
|
|
96
|
+
* @returns the current account signer instance that the smart account client
|
|
97
|
+
* operations are being signed with.
|
|
98
|
+
*
|
|
99
|
+
* The signer is expected to be the owner or one of the owners of the account
|
|
100
|
+
* for the signatures to be valid for the acting account.
|
|
101
|
+
*/
|
|
102
|
+
getSigner(): TSigner;
|
|
103
|
+
/**
|
|
104
|
+
* The factory address of the smart account created by the factory
|
|
105
|
+
*
|
|
106
|
+
* @returns the address of the factory contract for the smart account
|
|
107
|
+
*/
|
|
108
|
+
getFactoryAddress(): Address;
|
|
109
|
+
/**
|
|
110
|
+
* The entrypoint address is the address ERC 4337 entrypoint singleton contract
|
|
111
|
+
* that this smart account and the connected bundler client use
|
|
112
|
+
*
|
|
113
|
+
* @returns the address of the entry point contract for the smart account
|
|
114
|
+
*/
|
|
115
|
+
getEntryPointAddress(): Address;
|
|
116
|
+
/**
|
|
117
|
+
* Allows you to add additional functionality and utility methods to this account
|
|
118
|
+
* via a decorator pattern.
|
|
119
|
+
*
|
|
120
|
+
* NOTE: this method does not allow you to override existing methods on the account.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const account = new BaseSmartCobntractAccount(...).extend((account) => ({
|
|
125
|
+
* readAccountState: async (...args) => {
|
|
126
|
+
* return this.rpcProvider.readContract({
|
|
127
|
+
* address: await this.getAddress(),
|
|
128
|
+
* abi: ThisContractsAbi
|
|
129
|
+
* args: args
|
|
130
|
+
* });
|
|
131
|
+
* }
|
|
132
|
+
* }));
|
|
133
|
+
*
|
|
134
|
+
* account.debugSendUserOperation(...);
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @param extendFn -- this function gives you access to the created account instance and returns an object
|
|
138
|
+
* with the extension methods
|
|
139
|
+
* @returns -- the account with the extension methods added
|
|
140
|
+
*/
|
|
141
|
+
extend: <R>(extendFn: (self: this) => R) => this & R;
|
|
142
|
+
encodeUpgradeToAndCall: (upgradeToImplAddress: Address, upgradeToInitData: Hex) => Promise<Hex>;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/account/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Address, Chain, Client, StateOverride, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../client/decorators/bundlerClient";
|
|
3
|
+
import type { UserOperationEstimateGasResponse, UserOperationRequest } from "../../types";
|
|
4
|
+
export declare const estimateUserOperationGas: <TClient extends Client<Transport, Chain | undefined, any, BundlerRpcSchema>, TEntryPointVersion extends keyof import("../../entrypoint/types").EntryPointRegistryBase<unknown> = keyof import("../../entrypoint/types").EntryPointRegistryBase<unknown>>(client: TClient, args: {
|
|
5
|
+
request: UserOperationRequest<TEntryPointVersion>;
|
|
6
|
+
entryPoint: Address;
|
|
7
|
+
stateOverride?: StateOverride | undefined;
|
|
8
|
+
}) => Promise<UserOperationEstimateGasResponse<TEntryPointVersion>>;
|
|
9
|
+
//# sourceMappingURL=estimateUserOperationGas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../../../src/actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,KAAK,EACV,gCAAgC,EAChC,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,wBAAwB;;gBAOrB,OAAO;;mEAetB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Address, Chain, Client, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../client/decorators/bundlerClient";
|
|
3
|
+
export declare const getSupportedEntryPoints: <TClient extends Client<Transport, Chain | undefined, any, BundlerRpcSchema>>(client: TClient) => Promise<Address[]>;
|
|
4
|
+
//# sourceMappingURL=getSupportedEntryPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSupportedEntryPoints.d.ts","sourceRoot":"","sources":["../../../../src/actions/bundler/getSupportedEntryPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,eAAO,MAAM,uBAAuB,oGAIjC,QAAQ,OAAO,EAAE,CAKnB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Chain, Client, Hex, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../client/decorators/bundlerClient";
|
|
3
|
+
import type { UserOperationResponse } from "../../types";
|
|
4
|
+
export declare const getUserOperationByHash: <TClient extends Client<Transport, Chain | undefined, any, BundlerRpcSchema>>(client: TClient, args: {
|
|
5
|
+
hash: Hex;
|
|
6
|
+
}) => Promise<UserOperationResponse | null>;
|
|
7
|
+
//# sourceMappingURL=getUserOperationByHash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationByHash.d.ts","sourceRoot":"","sources":["../../../../src/actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,sBAAsB,uGAI3B;IACJ,IAAI,EAAE,GAAG,CAAC;CACX,KACA,QAAQ,qBAAqB,GAAG,IAAI,CAKtC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Chain, Client, Hex, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../client/decorators/bundlerClient";
|
|
3
|
+
import type { UserOperationReceipt } from "../../types";
|
|
4
|
+
export declare const getUserOperationReceipt: <TClient extends Client<Transport, Chain | undefined, any, BundlerRpcSchema>>(client: TClient, args: {
|
|
5
|
+
hash: Hex;
|
|
6
|
+
}) => Promise<UserOperationReceipt | null>;
|
|
7
|
+
//# sourceMappingURL=getUserOperationReceipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../../src/actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,uBAAuB,uGAI5B;IACJ,IAAI,EAAE,GAAG,CAAC;CACX,KACA,QAAQ,oBAAoB,GAAG,IAAI,CAKrC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Address, Chain, Client, Hex, Transport } from "viem";
|
|
2
|
+
import type { BundlerRpcSchema } from "../../client/decorators/bundlerClient";
|
|
3
|
+
import type { UserOperationRequest } from "../../types";
|
|
4
|
+
export declare const sendRawUserOperation: <TClient extends Client<Transport, Chain | undefined, any, BundlerRpcSchema>, TEntryPointVersion extends keyof import("../../entrypoint/types").EntryPointRegistryBase<unknown> = keyof import("../../entrypoint/types").EntryPointRegistryBase<unknown>>(client: TClient, args: {
|
|
5
|
+
request: UserOperationRequest<TEntryPointVersion>;
|
|
6
|
+
entryPoint: Address;
|
|
7
|
+
}) => Promise<Hex>;
|
|
8
|
+
//# sourceMappingURL=sendRawUserOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendRawUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/bundler/sendRawUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,oBAAoB;;gBAOjB,OAAO;MAEpB,QAAQ,GAAG,CAKb,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Chain, Client, Transport } from "viem";
|
|
2
|
+
import { type GetEntryPointFromAccount, type SmartContractAccount } from "../../account/smartContractAccount.js";
|
|
3
|
+
import type { UserOperationStruct } from "../../types.js";
|
|
4
|
+
import type { BuildUserOperationParameters, UserOperationContext } from "./types";
|
|
5
|
+
export declare function buildUserOperation<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<TTransport, TChain, TAccount>, args: BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>): Promise<UserOperationStruct<TEntryPointVersion>>;
|
|
6
|
+
//# sourceMappingURL=buildUserOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAI/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EACV,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACzE,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAsBlD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Chain, type Client, type SendTransactionParameters, type Transport } from "viem";
|
|
2
|
+
import type { GetEntryPointFromAccount, SmartContractAccount } from "../../account/smartContractAccount.js";
|
|
3
|
+
import type { UserOperationOverrides, UserOperationStruct } from "../../types.js";
|
|
4
|
+
import type { UserOperationContext } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Performs [`buildUserOperationFromTx`](./buildUserOperationFromTx.md) in batch and builds into a single, yet to be signed `UserOperation` (UO) struct. The output user operation struct will be filled with all gas fields (and paymaster data if a paymaster is used) based on the transactions data (`to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas`) computed using the configured [`ClientMiddlewares`](/packages/aa-core/smart-account-client/middleware/index) on the `SmartAccountClient`
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
import type { RpcTransactionRequest } from "viem";
|
|
11
|
+
import { smartAccountClient } from "./smartAccountClient";
|
|
12
|
+
// [!code focus:99]
|
|
13
|
+
// buildUserOperationFromTx converts a traditional Ethereum transaction and returns
|
|
14
|
+
// the unsigned user operation struct after constructing the user operation struct
|
|
15
|
+
// through the middleware pipeline
|
|
16
|
+
const tx: RpcTransactionRequest = {
|
|
17
|
+
from, // ignored
|
|
18
|
+
to,
|
|
19
|
+
data: encodeFunctionData({
|
|
20
|
+
abi: ContractABI.abi,
|
|
21
|
+
functionName: "func",
|
|
22
|
+
args: [arg1, arg2, ...],
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
const uoStruct = await smartAccountClient.buildUserOperationFromTx(tx);
|
|
26
|
+
|
|
27
|
+
// signUserOperation signs the above unsigned user operation struct built
|
|
28
|
+
// using the account connected to the smart account client
|
|
29
|
+
const request = await smartAccountClient.signUserOperation({ uoStruct });
|
|
30
|
+
|
|
31
|
+
// You can use the BundlerAction `sendRawUserOperation` (packages/core/src/actions/bundler/sendRawUserOperation.ts)
|
|
32
|
+
// to send the signed user operation request to the bundler, requesting the bundler to send the signed uo to the
|
|
33
|
+
// EntryPoint contract pointed at by the entryPoint address parameter
|
|
34
|
+
const entryPointAddress = client.account.getEntryPoint().address;
|
|
35
|
+
const uoHash = await smartAccountClient.sendRawUserOperation({ request, entryPoint: entryPointAddress });
|
|
36
|
+
```
|
|
37
|
+
*
|
|
38
|
+
* @param client the smart account client to use for RPC requests
|
|
39
|
+
* @param args {@link SendTransactionParameters}
|
|
40
|
+
* @param overrides optional {@link UserOperationOverrides} to use for any of the fields
|
|
41
|
+
* @param context if the smart account client requires additinoal context for building UOs
|
|
42
|
+
* @returns a Promise containing the built user operation
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildUserOperationFromTx<TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TChainOverride extends Chain | undefined = Chain | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<Transport, TChain, TAccount>, args: SendTransactionParameters<TChain, TAccount, TChainOverride>, overrides?: UserOperationOverrides<TEntryPointVersion>, context?: TContext): Promise<UserOperationStruct<TEntryPointVersion>>;
|
|
45
|
+
//# sourceMappingURL=buildUserOperationFromTx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildUserOperationFromTx.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperationFromTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,yBAAyB,EAC9B,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAK/C,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAC5D,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,IAAI,EAAE,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,EACjE,SAAS,CAAC,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,EACtD,OAAO,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAoClD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type Chain, type Client, type Transport } from "viem";
|
|
2
|
+
import type { GetEntryPointFromAccount, SmartContractAccount } from "../../account/smartContractAccount";
|
|
3
|
+
import type { BuildTransactionParameters, BuildUserOperationFromTransactionsResult, UserOperationContext } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Performs {@link buildUserOperationFromTx} in batch and builds into a single,
|
|
6
|
+
* yet to be signed `UserOperation` (UO) struct. The output user operation struct
|
|
7
|
+
* will be filled with all gas fields (and paymaster data if a paymaster is used)
|
|
8
|
+
* based on the transactions data (`to`, `data`, `value`, `maxFeePerGas`,
|
|
9
|
+
* `maxPriorityFeePerGas`) computed using the configured
|
|
10
|
+
* [`ClientMiddlewares`](/packages/aa-core/smart-account-client/middleware/index) on the `SmartAccountClient`
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import type { RpcTransactionRequest } from "viem";
|
|
15
|
+
import { smartAccountClient } from "./smartAccountClient";
|
|
16
|
+
// [!code focus:99]
|
|
17
|
+
// buildUserOperationFromTxs converts traditional Ethereum transactions in batch and returns
|
|
18
|
+
// the unsigned user operation struct after constructing the user operation struct
|
|
19
|
+
// through the middleware pipeline
|
|
20
|
+
const requests: RpcTransactionRequest[] = [
|
|
21
|
+
{
|
|
22
|
+
from, // ignored
|
|
23
|
+
to,
|
|
24
|
+
data: encodeFunctionData({
|
|
25
|
+
abi: ContractABI.abi,
|
|
26
|
+
functionName: "func",
|
|
27
|
+
args: [arg1, arg2, ...],
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
from, // ignored
|
|
32
|
+
to,
|
|
33
|
+
data: encodeFunctionData({
|
|
34
|
+
abi: ContractABI.abi,
|
|
35
|
+
functionName: "func",
|
|
36
|
+
args: [arg1, arg2, ...],
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
...
|
|
40
|
+
{
|
|
41
|
+
from, // ignored
|
|
42
|
+
to,
|
|
43
|
+
data: encodeFunctionData({
|
|
44
|
+
abi: ContractABI.abi,
|
|
45
|
+
functionName: "func",
|
|
46
|
+
args: [arg1, arg2, ...],
|
|
47
|
+
}),
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
const uoStruct = await smartAccountClient.buildUserOperationFromTxs({
|
|
51
|
+
requests,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// signUserOperation signs the above unsigned user operation struct built
|
|
55
|
+
// using the account connected to the smart account client
|
|
56
|
+
const request = await smartAccountClient.signUserOperation({ uoStruct });
|
|
57
|
+
|
|
58
|
+
// You can use the BundlerAction `sendRawUserOperation` (packages/core/src/actions/bundler/sendRawUserOperation.ts)
|
|
59
|
+
// to send the signed user operation request to the bundler, requesting the bundler to send the signed uo to the
|
|
60
|
+
// EntryPoint contract pointed at by the entryPoint address parameter
|
|
61
|
+
const entryPointAddress = client.account.getEntryPoint().address;
|
|
62
|
+
const uoHash = await smartAccountClient.sendRawUserOperation({
|
|
63
|
+
request,
|
|
64
|
+
entryPoint: entryPointAddress,
|
|
65
|
+
});
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @param client the smart account client to use to make RPC calls
|
|
69
|
+
* @param args {@link BuildTransactionParameters} an object containing the requests
|
|
70
|
+
* to build as well as, the account if not hoisted, the context, the overrides, and
|
|
71
|
+
* optionally a flag to enable signing of the UO via the underlying middleware
|
|
72
|
+
* @returns a Promise containing the built user operation
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildUserOperationFromTxs<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(client: Client<TTransport, TChain, TAccount>, args: BuildTransactionParameters<TAccount, TContext, TEntryPointVersion>): Promise<BuildUserOperationFromTransactionsResult<TEntryPointVersion>>;
|
|
75
|
+
//# sourceMappingURL=buildUserOperationFromTxs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildUserOperationFromTxs.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperationFromTxs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAQ5C,OAAO,KAAK,EACV,0BAA0B,EAC1B,wCAAwC,EACxC,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAClG,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EAEb,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACvE,OAAO,CAAC,wCAAwC,CAAC,kBAAkB,CAAC,CAAC,CAkEvE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Chain, Client, Transport } from "viem";
|
|
2
|
+
import type { SmartContractAccount } from "../../account/smartContractAccount.js";
|
|
3
|
+
import type { SendUserOperationParameters, UserOperationContext } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* This function verifies the eligibility of the connected account for gas sponsorship concerning the upcoming `UserOperation` (UO) that is intended to be sent.
|
|
6
|
+
* Internally, this method invokes [`buildUserOperation`](./buildUserOperation.md), which navigates through the middleware pipeline, including the `PaymasterMiddleware`. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty `paymasterAndData` field.
|
|
7
|
+
* You can utilize this method before sending the user operation to confirm its eligibility for gas sponsorship. Depending on the outcome, it allows you to tailor the user experience accordingly, based on eligibility.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { smartAccountClient } from "./smartAccountClient";
|
|
12
|
+
// [!code focus:99]
|
|
13
|
+
const eligible = await smartAccountClient.checkGasSponsorshipEligibility({
|
|
14
|
+
uo: {
|
|
15
|
+
data: "0xCalldata",
|
|
16
|
+
target: "0xTarget",
|
|
17
|
+
value: 0n,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
console.log(
|
|
22
|
+
`User Operation is ${
|
|
23
|
+
eligible ? "eligible" : "ineligible"
|
|
24
|
+
} for gas sponsorship.`
|
|
25
|
+
);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @param client the smart account client to use for making RPC calls
|
|
29
|
+
* @param args {@link SendUserOperationParameters} containing the user operation, account, context, and overrides
|
|
30
|
+
* @returns a Promise containing a boolean indicating if the account is elgibile for sponsorship
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkGasSponsorshipEligibility<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(client: Client<TTransport, TChain, TAccount>, args: SendUserOperationParameters<TAccount, TContext>): Promise<boolean>;
|
|
33
|
+
//# sourceMappingURL=checkGasSponsorshipEligibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkGasSponsorshipEligibility.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/checkGasSponsorshipEligibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAMlF,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EAEb,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,GACpD,OAAO,CAAC,OAAO,CAAC,CAiClB"}
|