@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,158 @@
|
|
|
1
|
+
import type { Hex, RpcTransactionRequest } from "viem";
|
|
2
|
+
import type {
|
|
3
|
+
GetAccountParameter,
|
|
4
|
+
GetEntryPointFromAccount,
|
|
5
|
+
SmartContractAccount,
|
|
6
|
+
} from "../../account/smartContractAccount";
|
|
7
|
+
import type { UpgradeToData } from "../../client/types";
|
|
8
|
+
import type { EntryPointVersion } from "../../entrypoint/types";
|
|
9
|
+
import type {
|
|
10
|
+
BatchUserOperationCallData,
|
|
11
|
+
UserOperationCallData,
|
|
12
|
+
UserOperationOverridesParameter,
|
|
13
|
+
UserOperationRequest,
|
|
14
|
+
UserOperationStruct,
|
|
15
|
+
} from "../../types";
|
|
16
|
+
import type { IsUndefined } from "../../utils";
|
|
17
|
+
|
|
18
|
+
// [!region UpgradeAccountParams]
|
|
19
|
+
export type UpgradeAccountParams<
|
|
20
|
+
TAccount extends SmartContractAccount | undefined,
|
|
21
|
+
TContext extends UserOperationContext | undefined =
|
|
22
|
+
| UserOperationContext
|
|
23
|
+
| undefined,
|
|
24
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
25
|
+
> = {
|
|
26
|
+
upgradeTo: UpgradeToData;
|
|
27
|
+
waitForTx?: boolean;
|
|
28
|
+
} & GetAccountParameter<TAccount> &
|
|
29
|
+
GetContextParameter<TContext> &
|
|
30
|
+
UserOperationOverridesParameter<TEntryPointVersion>;
|
|
31
|
+
// [!endregion UpgradeAccountParams]
|
|
32
|
+
|
|
33
|
+
// [!region SendUserOperationParameters]
|
|
34
|
+
export type SendUserOperationParameters<
|
|
35
|
+
TAccount extends SmartContractAccount | undefined,
|
|
36
|
+
TContext extends UserOperationContext | undefined =
|
|
37
|
+
| UserOperationContext
|
|
38
|
+
| undefined,
|
|
39
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
40
|
+
> = {
|
|
41
|
+
uo: UserOperationCallData | BatchUserOperationCallData;
|
|
42
|
+
} & GetAccountParameter<TAccount> &
|
|
43
|
+
GetContextParameter<TContext> &
|
|
44
|
+
UserOperationOverridesParameter<TEntryPointVersion>;
|
|
45
|
+
// [!endregion SendUserOperationParameters]
|
|
46
|
+
|
|
47
|
+
// [!region BuildUserOperationParameters]
|
|
48
|
+
export type BuildUserOperationParameters<
|
|
49
|
+
TAccount extends SmartContractAccount | undefined,
|
|
50
|
+
TContext extends UserOperationContext | undefined =
|
|
51
|
+
| UserOperationContext
|
|
52
|
+
| undefined,
|
|
53
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
54
|
+
> = SendUserOperationParameters<TAccount, TContext, TEntryPointVersion>;
|
|
55
|
+
// [!endregion BuildUserOperationParameters]
|
|
56
|
+
|
|
57
|
+
// [!region SignUserOperationParameters]
|
|
58
|
+
export type SignUserOperationParameters<
|
|
59
|
+
TAccount extends SmartContractAccount | undefined =
|
|
60
|
+
| SmartContractAccount
|
|
61
|
+
| undefined,
|
|
62
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
63
|
+
TContext extends UserOperationContext | undefined =
|
|
64
|
+
| UserOperationContext
|
|
65
|
+
| undefined
|
|
66
|
+
> = {
|
|
67
|
+
uoStruct: UserOperationStruct<TEntryPointVersion>;
|
|
68
|
+
} & GetAccountParameter<TAccount> &
|
|
69
|
+
GetContextParameter<TContext>;
|
|
70
|
+
// [!endregion SignUserOperationParameters]
|
|
71
|
+
|
|
72
|
+
// [!region SendTransactionsParameters]
|
|
73
|
+
export type SendTransactionsParameters<
|
|
74
|
+
TAccount extends SmartContractAccount | undefined,
|
|
75
|
+
TContext extends UserOperationContext | undefined =
|
|
76
|
+
| UserOperationContext
|
|
77
|
+
| undefined,
|
|
78
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
79
|
+
> = {
|
|
80
|
+
requests: RpcTransactionRequest[];
|
|
81
|
+
} & GetAccountParameter<TAccount> &
|
|
82
|
+
GetContextParameter<TContext> &
|
|
83
|
+
UserOperationOverridesParameter<TEntryPointVersion>;
|
|
84
|
+
// [!endregion SendTransactionsParameters]
|
|
85
|
+
|
|
86
|
+
// [!region BuildTransactionParameters]
|
|
87
|
+
export type BuildTransactionParameters<
|
|
88
|
+
TAccount extends SmartContractAccount | undefined,
|
|
89
|
+
TContext extends UserOperationContext | undefined =
|
|
90
|
+
| UserOperationContext
|
|
91
|
+
| undefined,
|
|
92
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
93
|
+
> = SendTransactionsParameters<TAccount, TContext, TEntryPointVersion>;
|
|
94
|
+
// [!endregion BuildTransactionParameters]
|
|
95
|
+
|
|
96
|
+
// [!region DropAndReplaceUserOperationParameters]
|
|
97
|
+
export type DropAndReplaceUserOperationParameters<
|
|
98
|
+
TAccount extends SmartContractAccount | undefined,
|
|
99
|
+
TContext extends UserOperationContext | undefined =
|
|
100
|
+
| UserOperationContext
|
|
101
|
+
| undefined,
|
|
102
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
103
|
+
> = {
|
|
104
|
+
uoToDrop: UserOperationRequest<TEntryPointVersion>;
|
|
105
|
+
} & GetAccountParameter<TAccount> &
|
|
106
|
+
GetContextParameter<TContext> &
|
|
107
|
+
UserOperationOverridesParameter<TEntryPointVersion>;
|
|
108
|
+
// [!endregion DropAndReplaceUserOperationParameters]
|
|
109
|
+
|
|
110
|
+
// [!region WaitForUserOperationTxParameters]
|
|
111
|
+
export type WaitForUserOperationTxParameters = {
|
|
112
|
+
hash: Hex;
|
|
113
|
+
/**
|
|
114
|
+
* Exponential backoff paramters that can be used to override
|
|
115
|
+
* the configuration on the client. If not provided, this method
|
|
116
|
+
* will use the paramters passed via the `opts` parameter on the
|
|
117
|
+
* smart account client.
|
|
118
|
+
*/
|
|
119
|
+
retries?: {
|
|
120
|
+
/**
|
|
121
|
+
* the base retry interval or delay between requests
|
|
122
|
+
*/
|
|
123
|
+
intervalMs: number;
|
|
124
|
+
/**
|
|
125
|
+
* the multiplier to exponentiate based on the number retries
|
|
126
|
+
* setting this to one will result in a linear backoff
|
|
127
|
+
*/
|
|
128
|
+
multiplier: number;
|
|
129
|
+
/** the maximum number of retries before failing */
|
|
130
|
+
maxRetries: number;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
// [!endregion WaitForUserOperationTxParameters]
|
|
134
|
+
|
|
135
|
+
// [!region BuildUserOperationFromTransactionsResult]
|
|
136
|
+
export type BuildUserOperationFromTransactionsResult<
|
|
137
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
138
|
+
> = {
|
|
139
|
+
uoStruct: UserOperationStruct<TEntryPointVersion>;
|
|
140
|
+
batch: BatchUserOperationCallData;
|
|
141
|
+
} & UserOperationOverridesParameter<TEntryPointVersion, true>;
|
|
142
|
+
// [!endregion BuildUserOperationFromTransactionsResult]
|
|
143
|
+
|
|
144
|
+
// [!region UserOperationContext]
|
|
145
|
+
export type UserOperationContext = Record<string, any>;
|
|
146
|
+
// [!endregion UserOperationContext]
|
|
147
|
+
|
|
148
|
+
// [!region GetContextParameter]
|
|
149
|
+
export type GetContextParameter<
|
|
150
|
+
TContext extends UserOperationContext | undefined =
|
|
151
|
+
| UserOperationContext
|
|
152
|
+
| undefined
|
|
153
|
+
> = IsUndefined<TContext> extends true
|
|
154
|
+
? {
|
|
155
|
+
context?: TContext;
|
|
156
|
+
}
|
|
157
|
+
: { context: TContext };
|
|
158
|
+
// [!endregion GetContextParameter]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Chain, Client, Hash, Transport } from "viem";
|
|
2
|
+
import type { SmartContractAccount } from "../../account/smartContractAccount.js";
|
|
3
|
+
import { isBaseSmartAccountClient } from "../../client/isSmartAccountClient.js";
|
|
4
|
+
import { AccountNotFoundError } from "../../errors/account.js";
|
|
5
|
+
import { IncompatibleClientError } from "../../errors/client.js";
|
|
6
|
+
import { sendUserOperation } from "./sendUserOperation.js";
|
|
7
|
+
import type { UpgradeAccountParams, UserOperationContext } from "./types.js";
|
|
8
|
+
import { waitForUserOperationTransaction } from "./waitForUserOperationTransacation.js";
|
|
9
|
+
|
|
10
|
+
export const upgradeAccount: <
|
|
11
|
+
TTransport extends Transport = Transport,
|
|
12
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
13
|
+
TAccount extends SmartContractAccount | undefined =
|
|
14
|
+
| SmartContractAccount
|
|
15
|
+
| undefined,
|
|
16
|
+
TContext extends UserOperationContext | undefined =
|
|
17
|
+
| UserOperationContext
|
|
18
|
+
| undefined
|
|
19
|
+
>(
|
|
20
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
21
|
+
args: UpgradeAccountParams<TAccount, TContext>
|
|
22
|
+
) => Promise<Hash> = async (client, args) => {
|
|
23
|
+
const {
|
|
24
|
+
account = client.account,
|
|
25
|
+
upgradeTo,
|
|
26
|
+
overrides,
|
|
27
|
+
waitForTx,
|
|
28
|
+
context,
|
|
29
|
+
} = args;
|
|
30
|
+
|
|
31
|
+
if (!account) {
|
|
32
|
+
throw new AccountNotFoundError();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (!isBaseSmartAccountClient(client)) {
|
|
36
|
+
throw new IncompatibleClientError(
|
|
37
|
+
"BaseSmartAccountClient",
|
|
38
|
+
"upgradeAccount",
|
|
39
|
+
client
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const { implAddress: accountImplAddress, initializationData } = upgradeTo;
|
|
44
|
+
|
|
45
|
+
const encodeUpgradeData = await account.encodeUpgradeToAndCall({
|
|
46
|
+
upgradeToAddress: accountImplAddress,
|
|
47
|
+
upgradeToInitData: initializationData,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const result = await sendUserOperation(client, {
|
|
51
|
+
uo: {
|
|
52
|
+
target: account.address,
|
|
53
|
+
data: encodeUpgradeData,
|
|
54
|
+
},
|
|
55
|
+
account,
|
|
56
|
+
overrides,
|
|
57
|
+
context,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
let hash = result.hash;
|
|
61
|
+
if (waitForTx) {
|
|
62
|
+
hash = await waitForUserOperationTransaction(client, result);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return hash;
|
|
66
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Chain, Client, Hex, Transport } from "viem";
|
|
2
|
+
import { getTransaction } from "viem/actions";
|
|
3
|
+
import { isBaseSmartAccountClient } from "../../client/isSmartAccountClient.js";
|
|
4
|
+
import { IncompatibleClientError } from "../../errors/client.js";
|
|
5
|
+
import { FailedToFindTransactionError } from "../../errors/transaction.js";
|
|
6
|
+
import { Logger } from "../../logger.js";
|
|
7
|
+
import type { WaitForUserOperationTxParameters } from "./types.js";
|
|
8
|
+
|
|
9
|
+
export const waitForUserOperationTransaction: <
|
|
10
|
+
TTransport extends Transport = Transport,
|
|
11
|
+
TChain extends Chain | undefined = Chain | undefined
|
|
12
|
+
>(
|
|
13
|
+
client: Client<TTransport, TChain, any>,
|
|
14
|
+
args: WaitForUserOperationTxParameters
|
|
15
|
+
) => Promise<Hex> = async (client, args) => {
|
|
16
|
+
if (!isBaseSmartAccountClient(client)) {
|
|
17
|
+
throw new IncompatibleClientError(
|
|
18
|
+
"BaseSmartAccountClient",
|
|
19
|
+
"waitForUserOperationTransaction",
|
|
20
|
+
client
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
hash,
|
|
26
|
+
retries = {
|
|
27
|
+
maxRetries: client.txMaxRetries,
|
|
28
|
+
intervalMs: client.txRetryIntervalMs,
|
|
29
|
+
multiplier: client.txRetryMultiplier,
|
|
30
|
+
},
|
|
31
|
+
} = args;
|
|
32
|
+
|
|
33
|
+
for (let i = 0; i < retries.maxRetries; i++) {
|
|
34
|
+
const txRetryIntervalWithJitterMs =
|
|
35
|
+
retries.intervalMs * Math.pow(retries.multiplier, i) +
|
|
36
|
+
Math.random() * 100;
|
|
37
|
+
|
|
38
|
+
await new Promise((resolve) =>
|
|
39
|
+
setTimeout(resolve, txRetryIntervalWithJitterMs)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const receipt = await client
|
|
43
|
+
.getUserOperationReceipt(hash as `0x${string}`)
|
|
44
|
+
.catch((e) => {
|
|
45
|
+
Logger.error(
|
|
46
|
+
`[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${hash}: ${e}`
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (receipt) {
|
|
51
|
+
return getTransaction(client, {
|
|
52
|
+
hash: receipt.receipt.transactionHash,
|
|
53
|
+
}).then((x) => x.hash);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
throw new FailedToFindTransactionError(hash);
|
|
58
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { defineChain, type Chain } from "viem";
|
|
2
|
+
import {
|
|
3
|
+
arbitrum as vab,
|
|
4
|
+
arbitrumGoerli as vabg,
|
|
5
|
+
arbitrumSepolia as vabs,
|
|
6
|
+
base as vbase,
|
|
7
|
+
baseGoerli as vbaseg,
|
|
8
|
+
baseSepolia as vbases,
|
|
9
|
+
goerli as vgo,
|
|
10
|
+
mainnet as vmain,
|
|
11
|
+
optimism as vop,
|
|
12
|
+
optimismGoerli as vopg,
|
|
13
|
+
optimismSepolia as vops,
|
|
14
|
+
polygon as vpg,
|
|
15
|
+
polygonMumbai as vpgm,
|
|
16
|
+
polygonAmoy as vpga,
|
|
17
|
+
sepolia as vsep,
|
|
18
|
+
fraxtal as vfrax,
|
|
19
|
+
zora as vzora,
|
|
20
|
+
zoraSepolia as vzoras,
|
|
21
|
+
} from "viem/chains";
|
|
22
|
+
|
|
23
|
+
export const arbitrum: Chain = {
|
|
24
|
+
...vab,
|
|
25
|
+
rpcUrls: {
|
|
26
|
+
...vab.rpcUrls,
|
|
27
|
+
alchemy: {
|
|
28
|
+
http: ["https://arb-mainnet.g.alchemy.com/v2"],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const arbitrumGoerli: Chain = {
|
|
34
|
+
...vabg,
|
|
35
|
+
rpcUrls: {
|
|
36
|
+
...vabg.rpcUrls,
|
|
37
|
+
alchemy: {
|
|
38
|
+
http: ["https://arb-goerli.g.alchemy.com/v2"],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const arbitrumSepolia: Chain = {
|
|
44
|
+
...vabs,
|
|
45
|
+
rpcUrls: {
|
|
46
|
+
...vabs.rpcUrls,
|
|
47
|
+
alchemy: {
|
|
48
|
+
http: ["https://arb-sepolia.g.alchemy.com/v2"],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const goerli: Chain = {
|
|
53
|
+
...vgo,
|
|
54
|
+
rpcUrls: {
|
|
55
|
+
...vgo.rpcUrls,
|
|
56
|
+
alchemy: {
|
|
57
|
+
http: ["https://eth-goerli.g.alchemy.com/v2"],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const mainnet: Chain = {
|
|
62
|
+
...vmain,
|
|
63
|
+
rpcUrls: {
|
|
64
|
+
...vmain.rpcUrls,
|
|
65
|
+
alchemy: {
|
|
66
|
+
http: ["https://eth-mainnet.g.alchemy.com/v2"],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
export const optimism: Chain = {
|
|
71
|
+
...vop,
|
|
72
|
+
rpcUrls: {
|
|
73
|
+
...vop.rpcUrls,
|
|
74
|
+
alchemy: {
|
|
75
|
+
http: ["https://opt-mainnet.g.alchemy.com/v2"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
export const optimismGoerli: Chain = {
|
|
80
|
+
...vopg,
|
|
81
|
+
rpcUrls: {
|
|
82
|
+
...vopg.rpcUrls,
|
|
83
|
+
alchemy: {
|
|
84
|
+
http: ["https://opt-goerli.g.alchemy.com/v2"],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export const optimismSepolia: Chain = {
|
|
89
|
+
...vops,
|
|
90
|
+
rpcUrls: {
|
|
91
|
+
...vops.rpcUrls,
|
|
92
|
+
alchemy: {
|
|
93
|
+
http: ["https://opt-sepolia.g.alchemy.com/v2"],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
export const sepolia: Chain = {
|
|
98
|
+
...vsep,
|
|
99
|
+
rpcUrls: {
|
|
100
|
+
...vsep.rpcUrls,
|
|
101
|
+
alchemy: {
|
|
102
|
+
http: ["https://eth-sepolia.g.alchemy.com/v2"],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
export const base: Chain = {
|
|
107
|
+
...vbase,
|
|
108
|
+
rpcUrls: {
|
|
109
|
+
...vbase.rpcUrls,
|
|
110
|
+
alchemy: {
|
|
111
|
+
http: ["https://base-mainnet.g.alchemy.com/v2"],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
export const baseGoerli: Chain = {
|
|
116
|
+
...vbaseg,
|
|
117
|
+
rpcUrls: {
|
|
118
|
+
...vbaseg.rpcUrls,
|
|
119
|
+
alchemy: {
|
|
120
|
+
http: ["https://base-goerli.g.alchemy.com/v2"],
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
export const baseSepolia: Chain = {
|
|
125
|
+
...vbases,
|
|
126
|
+
rpcUrls: {
|
|
127
|
+
...vbases.rpcUrls,
|
|
128
|
+
alchemy: {
|
|
129
|
+
http: ["https://base-sepolia.g.alchemy.com/v2"],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const polygonMumbai: Chain = {
|
|
135
|
+
...vpgm,
|
|
136
|
+
rpcUrls: {
|
|
137
|
+
...vpgm.rpcUrls,
|
|
138
|
+
alchemy: {
|
|
139
|
+
http: ["https://polygon-mumbai.g.alchemy.com/v2"],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const polygonAmoy: Chain = {
|
|
145
|
+
...vpga,
|
|
146
|
+
rpcUrls: {
|
|
147
|
+
...vpga.rpcUrls,
|
|
148
|
+
alchemy: {
|
|
149
|
+
http: ["https://polygon-amoy.g.alchemy.com/v2"],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const polygon: Chain = {
|
|
155
|
+
...vpg,
|
|
156
|
+
rpcUrls: {
|
|
157
|
+
...vpg.rpcUrls,
|
|
158
|
+
alchemy: {
|
|
159
|
+
http: ["https://polygon-mainnet.g.alchemy.com/v2"],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const fraxtal: Chain = {
|
|
165
|
+
...vfrax,
|
|
166
|
+
rpcUrls: {
|
|
167
|
+
...vfrax.rpcUrls,
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const fraxtalSepolia: Chain = defineChain({
|
|
172
|
+
id: 2523,
|
|
173
|
+
name: "Fraxtal Sepolia",
|
|
174
|
+
nativeCurrency: { name: "Frax Ether", symbol: "frxETH", decimals: 18 },
|
|
175
|
+
rpcUrls: {
|
|
176
|
+
default: {
|
|
177
|
+
http: ["https://rpc.testnet-sepolia.frax.com"],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
export const zora: Chain = {
|
|
183
|
+
...vzora,
|
|
184
|
+
rpcUrls: {
|
|
185
|
+
...vzora.rpcUrls,
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const zoraSepolia: Chain = {
|
|
190
|
+
...vzoras,
|
|
191
|
+
rpcUrls: {
|
|
192
|
+
...vzoras.rpcUrls,
|
|
193
|
+
},
|
|
194
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createClient,
|
|
3
|
+
http,
|
|
4
|
+
publicActions,
|
|
5
|
+
type Chain,
|
|
6
|
+
type Client,
|
|
7
|
+
type FallbackTransport,
|
|
8
|
+
type HttpTransportConfig,
|
|
9
|
+
type PublicActions,
|
|
10
|
+
type PublicClient,
|
|
11
|
+
type PublicClientConfig,
|
|
12
|
+
type PublicRpcSchema,
|
|
13
|
+
type Transport,
|
|
14
|
+
} from "viem";
|
|
15
|
+
import { ChainNotFoundError } from "../errors/client.js";
|
|
16
|
+
import { VERSION } from "../version.js";
|
|
17
|
+
import {
|
|
18
|
+
bundlerActions,
|
|
19
|
+
type BundlerActions,
|
|
20
|
+
type BundlerRpcSchema,
|
|
21
|
+
} from "./decorators/bundlerClient.js";
|
|
22
|
+
|
|
23
|
+
// [!region BundlerClient]
|
|
24
|
+
export type BundlerClient<T extends Transport = Transport> = Client<
|
|
25
|
+
T,
|
|
26
|
+
Chain,
|
|
27
|
+
undefined,
|
|
28
|
+
[...PublicRpcSchema, ...BundlerRpcSchema],
|
|
29
|
+
PublicActions<T, Chain> & BundlerActions
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
export const createBundlerClientFromExisting: <
|
|
33
|
+
T extends Transport | FallbackTransport = Transport
|
|
34
|
+
>(
|
|
35
|
+
client: PublicClient<T, Chain>
|
|
36
|
+
) => BundlerClient<T> = <T extends Transport | FallbackTransport = Transport>(
|
|
37
|
+
client: PublicClient<T, Chain>
|
|
38
|
+
): BundlerClient<T> => {
|
|
39
|
+
return client.extend(bundlerActions);
|
|
40
|
+
};
|
|
41
|
+
// [!endregion BundlerClient]
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Creates a PublicClient with methods for calling Bundler RPC methods
|
|
45
|
+
*
|
|
46
|
+
* @param args - configuration for the client
|
|
47
|
+
* @returns a PublicClient with methods for calling Bundler RPC methods
|
|
48
|
+
*/
|
|
49
|
+
export function createBundlerClient<TTransport extends Transport>(
|
|
50
|
+
args: PublicClientConfig<TTransport, Chain> & { type?: string }
|
|
51
|
+
): BundlerClient<TTransport>;
|
|
52
|
+
|
|
53
|
+
export function createBundlerClient(
|
|
54
|
+
args: PublicClientConfig & { type?: string }
|
|
55
|
+
): BundlerClient {
|
|
56
|
+
if (!args.chain) {
|
|
57
|
+
throw new ChainNotFoundError();
|
|
58
|
+
}
|
|
59
|
+
const {
|
|
60
|
+
key = "bundler-public",
|
|
61
|
+
name = "Public Bundler Client",
|
|
62
|
+
type = "bundlerClient",
|
|
63
|
+
} = args;
|
|
64
|
+
|
|
65
|
+
const { transport, ...opts } = args;
|
|
66
|
+
const resolvedTransport = transport({
|
|
67
|
+
chain: args.chain,
|
|
68
|
+
pollingInterval: opts.pollingInterval,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const baseParameters = {
|
|
72
|
+
...args,
|
|
73
|
+
key,
|
|
74
|
+
name,
|
|
75
|
+
type,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const client = (() => {
|
|
79
|
+
if (resolvedTransport.config.type === "http") {
|
|
80
|
+
const { url, fetchOptions: fetchOptions_ } = resolvedTransport.value as {
|
|
81
|
+
fetchOptions: HttpTransportConfig["fetchOptions"];
|
|
82
|
+
url: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const fetchOptions = fetchOptions_ ?? {};
|
|
86
|
+
|
|
87
|
+
if (url.toLowerCase().indexOf("alchemy") > -1) {
|
|
88
|
+
fetchOptions.headers = {
|
|
89
|
+
...fetchOptions.headers,
|
|
90
|
+
"Alchemy-AA-Sdk-Version": VERSION,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return createClient<Transport, Chain>({
|
|
95
|
+
...baseParameters,
|
|
96
|
+
transport: http(url, {
|
|
97
|
+
...resolvedTransport.config,
|
|
98
|
+
fetchOptions,
|
|
99
|
+
}),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return createClient<Transport, Chain>(baseParameters);
|
|
104
|
+
})();
|
|
105
|
+
|
|
106
|
+
return client.extend(publicActions).extend(bundlerActions);
|
|
107
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Address,
|
|
3
|
+
Chain,
|
|
4
|
+
Client,
|
|
5
|
+
Hash,
|
|
6
|
+
PublicRpcSchema,
|
|
7
|
+
RpcStateOverride,
|
|
8
|
+
StateOverride,
|
|
9
|
+
Transport,
|
|
10
|
+
} from "viem";
|
|
11
|
+
import { estimateUserOperationGas } from "../../actions/bundler/estimateUserOperationGas.js";
|
|
12
|
+
import { getSupportedEntryPoints } from "../../actions/bundler/getSupportedEntryPoints.js";
|
|
13
|
+
import { getUserOperationByHash } from "../../actions/bundler/getUserOperationByHash.js";
|
|
14
|
+
import { getUserOperationReceipt } from "../../actions/bundler/getUserOperationReceipt.js";
|
|
15
|
+
import { sendRawUserOperation } from "../../actions/bundler/sendRawUserOperation.js";
|
|
16
|
+
import type { EntryPointVersion } from "../../entrypoint/types.js";
|
|
17
|
+
import type {
|
|
18
|
+
UserOperationEstimateGasResponse,
|
|
19
|
+
UserOperationReceipt,
|
|
20
|
+
UserOperationRequest,
|
|
21
|
+
UserOperationResponse,
|
|
22
|
+
} from "../../types.js";
|
|
23
|
+
|
|
24
|
+
// Reference: https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace
|
|
25
|
+
export type BundlerRpcSchema = [
|
|
26
|
+
{
|
|
27
|
+
Method: "eth_sendUserOperation";
|
|
28
|
+
Parameters: [UserOperationRequest, Address];
|
|
29
|
+
ReturnType: Hash;
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
Method: "eth_estimateUserOperationGas";
|
|
33
|
+
Parameters: [UserOperationRequest, Address, RpcStateOverride?];
|
|
34
|
+
ReturnType: UserOperationEstimateGasResponse;
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
Method: "eth_getUserOperationReceipt";
|
|
38
|
+
Parameters: [Hash];
|
|
39
|
+
ReturnType: UserOperationReceipt | null;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
Method: "eth_getUserOperationByHash";
|
|
43
|
+
Parameters: [Hash];
|
|
44
|
+
ReturnType: UserOperationResponse | null;
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
Method: "eth_supportedEntryPoints";
|
|
48
|
+
Parameters: [];
|
|
49
|
+
ReturnType: Address[];
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
// [!region BundlerActions]
|
|
54
|
+
export type BundlerActions = {
|
|
55
|
+
/**
|
|
56
|
+
* calls `eth_estimateUserOperationGas` and returns the result
|
|
57
|
+
*
|
|
58
|
+
* @param request - the {@link UserOperationRequest} to estimate gas for
|
|
59
|
+
* @param entryPoint - the entry point address the op will be sent to
|
|
60
|
+
* @param stateOverride - the state override to use for the estimation
|
|
61
|
+
* @returns the gas estimates for the given response (see: {@link UserOperationEstimateGasResponse})
|
|
62
|
+
*/
|
|
63
|
+
estimateUserOperationGas<
|
|
64
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
65
|
+
>(
|
|
66
|
+
request: UserOperationRequest<TEntryPointVersion>,
|
|
67
|
+
entryPoint: Address,
|
|
68
|
+
stateOverride?: StateOverride
|
|
69
|
+
): Promise<UserOperationEstimateGasResponse<TEntryPointVersion>>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* calls `eth_sendUserOperation` and returns the hash of the sent UserOperation
|
|
73
|
+
*
|
|
74
|
+
* @param request - the {@link UserOperationRequest} to send
|
|
75
|
+
* @param entryPoint - the entry point address the op will be sent to
|
|
76
|
+
* @returns the hash of the sent UserOperation
|
|
77
|
+
*/
|
|
78
|
+
sendRawUserOperation<
|
|
79
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
80
|
+
>(
|
|
81
|
+
request: UserOperationRequest<TEntryPointVersion>,
|
|
82
|
+
entryPoint: Address
|
|
83
|
+
): Promise<Hash>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* calls `eth_getUserOperationByHash` and returns the {@link UserOperationResponse}
|
|
87
|
+
*
|
|
88
|
+
* @param hash - the hash of the UserOperation to fetch
|
|
89
|
+
* @returns - {@link UserOperationResponse}
|
|
90
|
+
*/
|
|
91
|
+
getUserOperationByHash(hash: Hash): Promise<UserOperationResponse | null>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* calls `eth_getUserOperationReceipt` and returns the {@link UserOperationReceipt}
|
|
95
|
+
*
|
|
96
|
+
* @param hash - the hash of the UserOperation to get the receipt for
|
|
97
|
+
* @returns - {@link UserOperationReceipt}
|
|
98
|
+
*/
|
|
99
|
+
getUserOperationReceipt(hash: Hash): Promise<UserOperationReceipt | null>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* calls `eth_supportedEntryPoints` and returns the entry points the RPC supports
|
|
103
|
+
*
|
|
104
|
+
* @returns - {@link Address}[]
|
|
105
|
+
*/
|
|
106
|
+
getSupportedEntryPoints(): Promise<Address[]>;
|
|
107
|
+
};
|
|
108
|
+
// [!endregion BundlerActions]
|
|
109
|
+
|
|
110
|
+
export const bundlerActions: <
|
|
111
|
+
TClient extends Client<
|
|
112
|
+
Transport,
|
|
113
|
+
Chain | undefined,
|
|
114
|
+
any,
|
|
115
|
+
[...PublicRpcSchema, ...BundlerRpcSchema]
|
|
116
|
+
>
|
|
117
|
+
>(
|
|
118
|
+
client: TClient
|
|
119
|
+
) => BundlerActions = (client) => ({
|
|
120
|
+
estimateUserOperationGas: async (request, entryPoint, stateOverride) =>
|
|
121
|
+
estimateUserOperationGas(client, { request, entryPoint, stateOverride }),
|
|
122
|
+
sendRawUserOperation: async (request, entryPoint) =>
|
|
123
|
+
sendRawUserOperation(client, { request, entryPoint }),
|
|
124
|
+
getUserOperationByHash: async (hash) =>
|
|
125
|
+
getUserOperationByHash(client, { hash }),
|
|
126
|
+
getSupportedEntryPoints: async () => getSupportedEntryPoints(client),
|
|
127
|
+
getUserOperationReceipt: async (hash) =>
|
|
128
|
+
getUserOperationReceipt(client, { hash }),
|
|
129
|
+
});
|