@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,219 @@
|
|
|
1
|
+
import { type HDAccount, type HDOptions, type Hex, type LocalAccount, type PrivateKeyAccount, type SignableMessage, type TypedDataDefinition } from "viem";
|
|
2
|
+
import type { SmartAccountSigner } from "./types.js";
|
|
3
|
+
export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount | LocalAccount> implements SmartAccountSigner<T> {
|
|
4
|
+
inner: T;
|
|
5
|
+
signerType: string;
|
|
6
|
+
constructor(inner: T);
|
|
7
|
+
readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`>;
|
|
8
|
+
readonly signTypedData: <const TTypedData extends {
|
|
9
|
+
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
10
|
+
[x: `string[${string}]`]: undefined;
|
|
11
|
+
[x: `function[${string}]`]: undefined;
|
|
12
|
+
[x: `uint256[${string}]`]: undefined;
|
|
13
|
+
[x: `uint48[${string}]`]: undefined;
|
|
14
|
+
[x: `bool[${string}]`]: undefined;
|
|
15
|
+
[x: `bytes[${string}]`]: undefined;
|
|
16
|
+
[x: `address[${string}]`]: undefined;
|
|
17
|
+
[x: `bytes32[${string}]`]: undefined;
|
|
18
|
+
[x: `uint32[${string}]`]: undefined;
|
|
19
|
+
[x: `uint112[${string}]`]: undefined;
|
|
20
|
+
[x: `uint192[${string}]`]: undefined;
|
|
21
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
22
|
+
[x: `uint8[${string}]`]: undefined;
|
|
23
|
+
[x: `uint64[${string}]`]: undefined;
|
|
24
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
25
|
+
[x: `bytes2[${string}]`]: undefined;
|
|
26
|
+
[x: `bytes1[${string}]`]: undefined;
|
|
27
|
+
[x: `bytes5[${string}]`]: undefined;
|
|
28
|
+
[x: `bytes3[${string}]`]: undefined;
|
|
29
|
+
[x: `bytes7[${string}]`]: undefined;
|
|
30
|
+
[x: `bytes11[${string}]`]: undefined;
|
|
31
|
+
[x: `bytes8[${string}]`]: undefined;
|
|
32
|
+
[x: `bytes9[${string}]`]: undefined;
|
|
33
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
34
|
+
[x: `bytes25[${string}]`]: undefined;
|
|
35
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
36
|
+
[x: `bytes12[${string}]`]: undefined;
|
|
37
|
+
[x: `bytes13[${string}]`]: undefined;
|
|
38
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
39
|
+
[x: `bytes15[${string}]`]: undefined;
|
|
40
|
+
[x: `bytes16[${string}]`]: undefined;
|
|
41
|
+
[x: `bytes17[${string}]`]: undefined;
|
|
42
|
+
[x: `bytes19[${string}]`]: undefined;
|
|
43
|
+
[x: `bytes20[${string}]`]: undefined;
|
|
44
|
+
[x: `bytes21[${string}]`]: undefined;
|
|
45
|
+
[x: `bytes22[${string}]`]: undefined;
|
|
46
|
+
[x: `bytes23[${string}]`]: undefined;
|
|
47
|
+
[x: `bytes24[${string}]`]: undefined;
|
|
48
|
+
[x: `bytes26[${string}]`]: undefined;
|
|
49
|
+
[x: `bytes27[${string}]`]: undefined;
|
|
50
|
+
[x: `bytes28[${string}]`]: undefined;
|
|
51
|
+
[x: `bytes29[${string}]`]: undefined;
|
|
52
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
53
|
+
[x: `bytes31[${string}]`]: undefined;
|
|
54
|
+
[x: `int[${string}]`]: undefined;
|
|
55
|
+
[x: `int8[${string}]`]: undefined;
|
|
56
|
+
[x: `int16[${string}]`]: undefined;
|
|
57
|
+
[x: `int24[${string}]`]: undefined;
|
|
58
|
+
[x: `int32[${string}]`]: undefined;
|
|
59
|
+
[x: `int40[${string}]`]: undefined;
|
|
60
|
+
[x: `int48[${string}]`]: undefined;
|
|
61
|
+
[x: `int56[${string}]`]: undefined;
|
|
62
|
+
[x: `int64[${string}]`]: undefined;
|
|
63
|
+
[x: `int72[${string}]`]: undefined;
|
|
64
|
+
[x: `int80[${string}]`]: undefined;
|
|
65
|
+
[x: `int88[${string}]`]: undefined;
|
|
66
|
+
[x: `int96[${string}]`]: undefined;
|
|
67
|
+
[x: `int104[${string}]`]: undefined;
|
|
68
|
+
[x: `int112[${string}]`]: undefined;
|
|
69
|
+
[x: `int120[${string}]`]: undefined;
|
|
70
|
+
[x: `int128[${string}]`]: undefined;
|
|
71
|
+
[x: `int136[${string}]`]: undefined;
|
|
72
|
+
[x: `int144[${string}]`]: undefined;
|
|
73
|
+
[x: `int152[${string}]`]: undefined;
|
|
74
|
+
[x: `int160[${string}]`]: undefined;
|
|
75
|
+
[x: `int168[${string}]`]: undefined;
|
|
76
|
+
[x: `int176[${string}]`]: undefined;
|
|
77
|
+
[x: `int184[${string}]`]: undefined;
|
|
78
|
+
[x: `int192[${string}]`]: undefined;
|
|
79
|
+
[x: `int200[${string}]`]: undefined;
|
|
80
|
+
[x: `int208[${string}]`]: undefined;
|
|
81
|
+
[x: `int216[${string}]`]: undefined;
|
|
82
|
+
[x: `int224[${string}]`]: undefined;
|
|
83
|
+
[x: `int232[${string}]`]: undefined;
|
|
84
|
+
[x: `int240[${string}]`]: undefined;
|
|
85
|
+
[x: `int248[${string}]`]: undefined;
|
|
86
|
+
[x: `int256[${string}]`]: undefined;
|
|
87
|
+
[x: `uint[${string}]`]: undefined;
|
|
88
|
+
[x: `uint16[${string}]`]: undefined;
|
|
89
|
+
[x: `uint24[${string}]`]: undefined;
|
|
90
|
+
[x: `uint40[${string}]`]: undefined;
|
|
91
|
+
[x: `uint56[${string}]`]: undefined;
|
|
92
|
+
[x: `uint72[${string}]`]: undefined;
|
|
93
|
+
[x: `uint80[${string}]`]: undefined;
|
|
94
|
+
[x: `uint88[${string}]`]: undefined;
|
|
95
|
+
[x: `uint96[${string}]`]: undefined;
|
|
96
|
+
[x: `uint104[${string}]`]: undefined;
|
|
97
|
+
[x: `uint120[${string}]`]: undefined;
|
|
98
|
+
[x: `uint128[${string}]`]: undefined;
|
|
99
|
+
[x: `uint136[${string}]`]: undefined;
|
|
100
|
+
[x: `uint144[${string}]`]: undefined;
|
|
101
|
+
[x: `uint152[${string}]`]: undefined;
|
|
102
|
+
[x: `uint160[${string}]`]: undefined;
|
|
103
|
+
[x: `uint168[${string}]`]: undefined;
|
|
104
|
+
[x: `uint176[${string}]`]: undefined;
|
|
105
|
+
[x: `uint184[${string}]`]: undefined;
|
|
106
|
+
[x: `uint200[${string}]`]: undefined;
|
|
107
|
+
[x: `uint208[${string}]`]: undefined;
|
|
108
|
+
[x: `uint216[${string}]`]: undefined;
|
|
109
|
+
[x: `uint224[${string}]`]: undefined;
|
|
110
|
+
[x: `uint232[${string}]`]: undefined;
|
|
111
|
+
[x: `uint240[${string}]`]: undefined;
|
|
112
|
+
[x: `uint248[${string}]`]: undefined;
|
|
113
|
+
string?: undefined;
|
|
114
|
+
uint256?: undefined;
|
|
115
|
+
uint48?: undefined;
|
|
116
|
+
bool?: undefined;
|
|
117
|
+
bytes?: undefined;
|
|
118
|
+
address?: undefined;
|
|
119
|
+
bytes32?: undefined;
|
|
120
|
+
uint32?: undefined;
|
|
121
|
+
uint112?: undefined;
|
|
122
|
+
uint192?: undefined;
|
|
123
|
+
bytes4?: undefined;
|
|
124
|
+
uint8?: undefined;
|
|
125
|
+
uint64?: undefined;
|
|
126
|
+
bytes6?: undefined;
|
|
127
|
+
bytes2?: undefined;
|
|
128
|
+
bytes1?: undefined;
|
|
129
|
+
bytes5?: undefined;
|
|
130
|
+
bytes3?: undefined;
|
|
131
|
+
bytes7?: undefined;
|
|
132
|
+
bytes11?: undefined;
|
|
133
|
+
bytes8?: undefined;
|
|
134
|
+
bytes9?: undefined;
|
|
135
|
+
bytes10?: undefined;
|
|
136
|
+
bytes25?: undefined;
|
|
137
|
+
bytes18?: undefined;
|
|
138
|
+
bytes12?: undefined;
|
|
139
|
+
bytes13?: undefined;
|
|
140
|
+
bytes14?: undefined;
|
|
141
|
+
bytes15?: undefined;
|
|
142
|
+
bytes16?: undefined;
|
|
143
|
+
bytes17?: undefined;
|
|
144
|
+
bytes19?: undefined;
|
|
145
|
+
bytes20?: undefined;
|
|
146
|
+
bytes21?: undefined;
|
|
147
|
+
bytes22?: undefined;
|
|
148
|
+
bytes23?: undefined;
|
|
149
|
+
bytes24?: undefined;
|
|
150
|
+
bytes26?: undefined;
|
|
151
|
+
bytes27?: undefined;
|
|
152
|
+
bytes28?: undefined;
|
|
153
|
+
bytes29?: undefined;
|
|
154
|
+
bytes30?: undefined;
|
|
155
|
+
bytes31?: undefined;
|
|
156
|
+
int8?: undefined;
|
|
157
|
+
int16?: undefined;
|
|
158
|
+
int24?: undefined;
|
|
159
|
+
int32?: undefined;
|
|
160
|
+
int40?: undefined;
|
|
161
|
+
int48?: undefined;
|
|
162
|
+
int56?: undefined;
|
|
163
|
+
int64?: undefined;
|
|
164
|
+
int72?: undefined;
|
|
165
|
+
int80?: undefined;
|
|
166
|
+
int88?: undefined;
|
|
167
|
+
int96?: undefined;
|
|
168
|
+
int104?: undefined;
|
|
169
|
+
int112?: undefined;
|
|
170
|
+
int120?: undefined;
|
|
171
|
+
int128?: undefined;
|
|
172
|
+
int136?: undefined;
|
|
173
|
+
int144?: undefined;
|
|
174
|
+
int152?: undefined;
|
|
175
|
+
int160?: undefined;
|
|
176
|
+
int168?: undefined;
|
|
177
|
+
int176?: undefined;
|
|
178
|
+
int184?: undefined;
|
|
179
|
+
int192?: undefined;
|
|
180
|
+
int200?: undefined;
|
|
181
|
+
int208?: undefined;
|
|
182
|
+
int216?: undefined;
|
|
183
|
+
int224?: undefined;
|
|
184
|
+
int232?: undefined;
|
|
185
|
+
int240?: undefined;
|
|
186
|
+
int248?: undefined;
|
|
187
|
+
int256?: undefined;
|
|
188
|
+
uint16?: undefined;
|
|
189
|
+
uint24?: undefined;
|
|
190
|
+
uint40?: undefined;
|
|
191
|
+
uint56?: undefined;
|
|
192
|
+
uint72?: undefined;
|
|
193
|
+
uint80?: undefined;
|
|
194
|
+
uint88?: undefined;
|
|
195
|
+
uint96?: undefined;
|
|
196
|
+
uint104?: undefined;
|
|
197
|
+
uint120?: undefined;
|
|
198
|
+
uint128?: undefined;
|
|
199
|
+
uint136?: undefined;
|
|
200
|
+
uint144?: undefined;
|
|
201
|
+
uint152?: undefined;
|
|
202
|
+
uint160?: undefined;
|
|
203
|
+
uint168?: undefined;
|
|
204
|
+
uint176?: undefined;
|
|
205
|
+
uint184?: undefined;
|
|
206
|
+
uint200?: undefined;
|
|
207
|
+
uint208?: undefined;
|
|
208
|
+
uint216?: undefined;
|
|
209
|
+
uint224?: undefined;
|
|
210
|
+
uint232?: undefined;
|
|
211
|
+
uint240?: undefined;
|
|
212
|
+
uint248?: undefined;
|
|
213
|
+
} | {
|
|
214
|
+
[key: string]: unknown;
|
|
215
|
+
}, TPrimaryType extends string = string>(params: TypedDataDefinition<TTypedData, TPrimaryType>) => Promise<Hex>;
|
|
216
|
+
readonly getAddress: () => Promise<`0x${string}`>;
|
|
217
|
+
static mnemonicToAccountSigner(key: string, opts?: HDOptions): LocalAccountSigner<HDAccount>;
|
|
218
|
+
static privateKeyToAccountSigner(key: Hex): LocalAccountSigner<PrivateKeyAccount>;
|
|
219
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {} from "viem";
|
|
2
|
+
import { mnemonicToAccount, privateKeyToAccount } from "viem/accounts";
|
|
3
|
+
export class LocalAccountSigner {
|
|
4
|
+
constructor(inner) {
|
|
5
|
+
Object.defineProperty(this, "inner", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value: void 0
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(this, "signerType", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "signMessage", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: (message) => {
|
|
22
|
+
return this.inner.signMessage({ message });
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(this, "signTypedData", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: async (params) => {
|
|
30
|
+
return this.inner.signTypedData(params);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(this, "getAddress", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: async () => {
|
|
38
|
+
return this.inner.address;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
this.inner = inner;
|
|
42
|
+
this.signerType = inner.type;
|
|
43
|
+
}
|
|
44
|
+
static mnemonicToAccountSigner(key, opts) {
|
|
45
|
+
const signer = mnemonicToAccount(key, opts);
|
|
46
|
+
return new LocalAccountSigner(signer);
|
|
47
|
+
}
|
|
48
|
+
static privateKeyToAccountSigner(key) {
|
|
49
|
+
const signer = privateKeyToAccount(key);
|
|
50
|
+
return new LocalAccountSigner(signer);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=local-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-account.js","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":"AAAA,OAAO,EASN,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGvE,MAAM,OAAO,kBAAkB;IAO7B,YAAY,KAAQ;QAHpB;;;;;WAAS;QACT;;;;;WAAmB;QAOV;;;;mBAAoE,CAC3E,OAAO,EACP,EAAE;gBACF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7C,CAAC;WAAC;QAEO;;;;mBAAgB,KAAK,EAI5B,MAAqD,EACvC,EAAE;gBAChB,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC;WAAC;QAEO;;;;mBAA2C,KAAK,IAAI,EAAE;gBAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,CAAC;WAAC;QArBA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;IAC/B,CAAC;IAqBD,MAAM,CAAC,uBAAuB,CAC5B,GAAW,EACX,IAAgB;QAEhB,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5C,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,yBAAyB,CAC9B,GAAQ;QAER,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import {\n type HDAccount,\n type HDOptions,\n type Hex,\n type LocalAccount,\n type PrivateKeyAccount,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n} from \"viem\";\nimport { mnemonicToAccount, privateKeyToAccount } from \"viem/accounts\";\nimport type { SmartAccountSigner } from \"./types.js\";\n\nexport class LocalAccountSigner<\n T extends HDAccount | PrivateKeyAccount | LocalAccount\n> implements SmartAccountSigner<T>\n{\n inner: T;\n signerType: string;\n\n constructor(inner: T) {\n this.inner = inner;\n this.signerType = inner.type; // type: \"local\"\n }\n\n readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> = (\n message\n ) => {\n return this.inner.signMessage({ message });\n };\n\n readonly signTypedData = async <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n params: TypedDataDefinition<TTypedData, TPrimaryType>\n ): Promise<Hex> => {\n return this.inner.signTypedData(params);\n };\n\n readonly getAddress: () => Promise<`0x${string}`> = async () => {\n return this.inner.address;\n };\n\n static mnemonicToAccountSigner(\n key: string,\n opts?: HDOptions\n ): LocalAccountSigner<HDAccount> {\n const signer = mnemonicToAccount(key, opts);\n return new LocalAccountSigner(signer);\n }\n\n static privateKeyToAccountSigner(\n key: Hex\n ): LocalAccountSigner<PrivateKeyAccount> {\n const signer = privateKeyToAccount(key);\n return new LocalAccountSigner(signer);\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { SmartAccountSigner } from "./types";
|
|
3
|
+
export declare const isSigner: (signer: any) => signer is SmartAccountSigner<any>;
|
|
4
|
+
export declare const SignerSchema: z.ZodType<SmartAccountSigner<any>, z.ZodTypeDef, SmartAccountSigner<any>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const isSigner = (signer) => {
|
|
3
|
+
return (signer != null &&
|
|
4
|
+
typeof signer === "object" &&
|
|
5
|
+
"signerType" in signer &&
|
|
6
|
+
"signMessage" in signer &&
|
|
7
|
+
"signTypedData" in signer &&
|
|
8
|
+
"getAddress" in signer &&
|
|
9
|
+
"inner" in signer);
|
|
10
|
+
};
|
|
11
|
+
export const SignerSchema = z.custom(isSigner);
|
|
12
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/signer/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAW,EAAgC,EAAE;IACpE,OAAO,CACL,MAAM,IAAI,IAAI;QACd,OAAO,MAAM,KAAK,QAAQ;QAC1B,YAAY,IAAI,MAAM;QACtB,aAAa,IAAI,MAAM;QACvB,eAAe,IAAI,MAAM;QACzB,YAAY,IAAI,MAAM;QACtB,OAAO,IAAI,MAAM,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAqB,QAAQ,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { SmartAccountSigner } from \"./types\";\n\nexport const isSigner = (signer: any): signer is SmartAccountSigner => {\n return (\n signer != null &&\n typeof signer === \"object\" &&\n \"signerType\" in signer &&\n \"signMessage\" in signer &&\n \"signTypedData\" in signer &&\n \"getAddress\" in signer &&\n \"inner\" in signer\n );\n};\n\nexport const SignerSchema = z.custom<SmartAccountSigner>(isSigner);\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Address } from "abitype";
|
|
2
|
+
import type { Hex, SignableMessage, TypedData, TypedDataDefinition } from "viem";
|
|
3
|
+
export interface SmartAccountAuthenticator<AuthParams, AuthDetails, Inner = any> extends SmartAccountSigner<Inner> {
|
|
4
|
+
authenticate: (params: AuthParams) => Promise<AuthDetails>;
|
|
5
|
+
getAuthDetails: () => Promise<AuthDetails>;
|
|
6
|
+
}
|
|
7
|
+
export interface SmartAccountSigner<Inner = any> {
|
|
8
|
+
signerType: string;
|
|
9
|
+
inner: Inner;
|
|
10
|
+
getAddress: () => Promise<Address>;
|
|
11
|
+
signMessage: (message: SignableMessage) => Promise<Hex>;
|
|
12
|
+
signTypedData: <const TTypedData extends TypedData | {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}, TPrimaryType extends string = string>(params: TypedDataDefinition<TTypedData, TPrimaryType>) => Promise<Hex>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/signer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Address } from \"abitype\";\nimport type {\n Hex,\n SignableMessage,\n TypedData,\n TypedDataDefinition,\n} from \"viem\";\n\n// [!region SmartAccountAuthenticator]\n/**\n * Extends the @interface SmartAccountSigner interface with authentication.\n *\n * @template AuthParams - the generic type of the authentication parameters\n * @template AuthDetails - the generic type of the authentication details\n * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.\n */\nexport interface SmartAccountAuthenticator<AuthParams, AuthDetails, Inner = any>\n extends SmartAccountSigner<Inner> {\n authenticate: (params: AuthParams) => Promise<AuthDetails>;\n\n getAuthDetails: () => Promise<AuthDetails>;\n}\n// [!endregion SmartAccountAuthenticator]\n\n// [!region SmartAccountSigner]\n/**\n * A signer that can sign messages and typed data.\n *\n * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.\n */\nexport interface SmartAccountSigner<Inner = any> {\n signerType: string;\n inner: Inner;\n\n getAddress: () => Promise<Address>;\n\n signMessage: (message: SignableMessage) => Promise<Hex>;\n\n signTypedData: <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n params: TypedDataDefinition<TTypedData, TPrimaryType>\n ) => Promise<Hex>;\n}\n// [!endregion SmartAccountSigner]\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Address, type Hash, type Hex, type PublicClient } from "viem";
|
|
2
|
+
export type SignWith6492Params = {
|
|
3
|
+
factoryAddress: Address;
|
|
4
|
+
factoryCalldata: Hex;
|
|
5
|
+
signature: Hash;
|
|
6
|
+
};
|
|
7
|
+
type VerifyEIP6492SignatureParams = {
|
|
8
|
+
signer: Address;
|
|
9
|
+
hash: Hash;
|
|
10
|
+
signature: Hash;
|
|
11
|
+
client: PublicClient;
|
|
12
|
+
};
|
|
13
|
+
export declare const wrapSignatureWith6492: ({ factoryAddress, factoryCalldata, signature, }: SignWith6492Params) => Hash;
|
|
14
|
+
export declare const verifyEIP6492Signature: ({ signer, hash, signature, client, }: VerifyEIP6492SignatureParams) => Promise<boolean>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { concat, encodeAbiParameters, parseAbiParameters, } from "viem";
|
|
2
|
+
export const wrapSignatureWith6492 = ({ factoryAddress, factoryCalldata, signature, }) => {
|
|
3
|
+
return concat([
|
|
4
|
+
encodeAbiParameters(parseAbiParameters("address, bytes, bytes"), [
|
|
5
|
+
factoryAddress,
|
|
6
|
+
factoryCalldata,
|
|
7
|
+
signature,
|
|
8
|
+
]),
|
|
9
|
+
"0x6492649264926492649264926492649264926492649264926492649264926492",
|
|
10
|
+
]);
|
|
11
|
+
};
|
|
12
|
+
const universalValidatorByteCode = "0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
|
|
13
|
+
export const verifyEIP6492Signature = async ({ signer, hash, signature, client, }) => {
|
|
14
|
+
const result = await client.call({
|
|
15
|
+
data: concat([
|
|
16
|
+
universalValidatorByteCode,
|
|
17
|
+
encodeAbiParameters(parseAbiParameters("address, bytes32, bytes"), [
|
|
18
|
+
signer,
|
|
19
|
+
hash,
|
|
20
|
+
signature,
|
|
21
|
+
]),
|
|
22
|
+
]),
|
|
23
|
+
});
|
|
24
|
+
return result.data === "0x01";
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/signer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,kBAAkB,GAKnB,MAAM,MAAM,CAAC;AAed,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACpC,cAAc,EACd,eAAe,EACf,SAAS,GACU,EAAQ,EAAE;IAQ7B,OAAO,MAAM,CAAC;QACZ,mBAAmB,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,EAAE;YAC/D,cAAc;YACd,eAAe;YACf,SAAS;SACV,CAAC;QACF,oEAAoE;KACrE,CAAC,CAAC;AACL,CAAC,CAAC;AAGF,MAAM,0BAA0B,GAC9B,ogHAAogH,CAAC;AAEvgH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAAE,EAC3C,MAAM,EACN,IAAI,EACJ,SAAS,EACT,MAAM,GACuB,EAAoB,EAAE;IACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;QAC/B,IAAI,EAAE,MAAM,CAAC;YACX,0BAA0B;YAC1B,mBAAmB,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,EAAE;gBACjE,MAAM;gBACN,IAAI;gBACJ,SAAS;aACV,CAAC;SACH,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC;AAChC,CAAC,CAAC","sourcesContent":["import {\n concat,\n encodeAbiParameters,\n parseAbiParameters,\n type Address,\n type Hash,\n type Hex,\n type PublicClient,\n} from \"viem\";\n\nexport type SignWith6492Params = {\n factoryAddress: Address;\n factoryCalldata: Hex;\n signature: Hash;\n};\n\ntype VerifyEIP6492SignatureParams = {\n signer: Address;\n hash: Hash;\n signature: Hash;\n client: PublicClient;\n};\n\nexport const wrapSignatureWith6492 = ({\n factoryAddress,\n factoryCalldata,\n signature,\n}: SignWith6492Params): Hash => {\n // wrap the signature as follows: https://eips.ethereum.org/EIPS/eip-6492\n // concat(\n // abi.encode(\n // (create2Factory, factoryCalldata, originalERC1271Signature),\n // (address, bytes, bytes)),\n // magicBytes\n // )\n return concat([\n encodeAbiParameters(parseAbiParameters(\"address, bytes, bytes\"), [\n factoryAddress,\n factoryCalldata,\n signature,\n ]),\n \"0x6492649264926492649264926492649264926492649264926492649264926492\",\n ]);\n};\n\n// defined in https://github.com/AmbireTech/signature-validator/blob/main/index.ts#L13C17-L13C17\nconst universalValidatorByteCode =\n \"0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572\";\n\nexport const verifyEIP6492Signature = async ({\n signer,\n hash,\n signature,\n client,\n}: VerifyEIP6492SignatureParams): Promise<boolean> => {\n const result = await client.call({\n data: concat([\n universalValidatorByteCode,\n encodeAbiParameters(parseAbiParameters(\"address, bytes32, bytes\"), [\n signer,\n hash,\n signature,\n ]),\n ]),\n });\n\n return result.data === \"0x01\";\n};\n"]}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { type Hex, type SignableMessage, type TypedDataDefinition, type WalletClient } from "viem";
|
|
2
|
+
import type { SmartAccountSigner } from "./types";
|
|
3
|
+
export declare class WalletClientSigner implements SmartAccountSigner<WalletClient> {
|
|
4
|
+
signerType: string;
|
|
5
|
+
inner: WalletClient;
|
|
6
|
+
constructor(client: WalletClient, signerType: string);
|
|
7
|
+
getAddress: () => Promise<`0x${string}`>;
|
|
8
|
+
readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`>;
|
|
9
|
+
signTypedData: <const TTypedData extends {
|
|
10
|
+
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
11
|
+
[x: `string[${string}]`]: undefined;
|
|
12
|
+
[x: `function[${string}]`]: undefined;
|
|
13
|
+
[x: `uint256[${string}]`]: undefined;
|
|
14
|
+
[x: `uint48[${string}]`]: undefined;
|
|
15
|
+
[x: `bool[${string}]`]: undefined;
|
|
16
|
+
[x: `bytes[${string}]`]: undefined;
|
|
17
|
+
[x: `address[${string}]`]: undefined;
|
|
18
|
+
[x: `bytes32[${string}]`]: undefined;
|
|
19
|
+
[x: `uint32[${string}]`]: undefined;
|
|
20
|
+
[x: `uint112[${string}]`]: undefined;
|
|
21
|
+
[x: `uint192[${string}]`]: undefined;
|
|
22
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
23
|
+
[x: `uint8[${string}]`]: undefined;
|
|
24
|
+
[x: `uint64[${string}]`]: undefined;
|
|
25
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
26
|
+
[x: `bytes2[${string}]`]: undefined;
|
|
27
|
+
[x: `bytes1[${string}]`]: undefined;
|
|
28
|
+
[x: `bytes5[${string}]`]: undefined;
|
|
29
|
+
[x: `bytes3[${string}]`]: undefined;
|
|
30
|
+
[x: `bytes7[${string}]`]: undefined;
|
|
31
|
+
[x: `bytes11[${string}]`]: undefined;
|
|
32
|
+
[x: `bytes8[${string}]`]: undefined;
|
|
33
|
+
[x: `bytes9[${string}]`]: undefined;
|
|
34
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
35
|
+
[x: `bytes25[${string}]`]: undefined;
|
|
36
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
37
|
+
[x: `bytes12[${string}]`]: undefined;
|
|
38
|
+
[x: `bytes13[${string}]`]: undefined;
|
|
39
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
40
|
+
[x: `bytes15[${string}]`]: undefined;
|
|
41
|
+
[x: `bytes16[${string}]`]: undefined;
|
|
42
|
+
[x: `bytes17[${string}]`]: undefined;
|
|
43
|
+
[x: `bytes19[${string}]`]: undefined;
|
|
44
|
+
[x: `bytes20[${string}]`]: undefined;
|
|
45
|
+
[x: `bytes21[${string}]`]: undefined;
|
|
46
|
+
[x: `bytes22[${string}]`]: undefined;
|
|
47
|
+
[x: `bytes23[${string}]`]: undefined;
|
|
48
|
+
[x: `bytes24[${string}]`]: undefined;
|
|
49
|
+
[x: `bytes26[${string}]`]: undefined;
|
|
50
|
+
[x: `bytes27[${string}]`]: undefined;
|
|
51
|
+
[x: `bytes28[${string}]`]: undefined;
|
|
52
|
+
[x: `bytes29[${string}]`]: undefined;
|
|
53
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
54
|
+
[x: `bytes31[${string}]`]: undefined;
|
|
55
|
+
[x: `int[${string}]`]: undefined;
|
|
56
|
+
[x: `int8[${string}]`]: undefined;
|
|
57
|
+
[x: `int16[${string}]`]: undefined;
|
|
58
|
+
[x: `int24[${string}]`]: undefined;
|
|
59
|
+
[x: `int32[${string}]`]: undefined;
|
|
60
|
+
[x: `int40[${string}]`]: undefined;
|
|
61
|
+
[x: `int48[${string}]`]: undefined;
|
|
62
|
+
[x: `int56[${string}]`]: undefined;
|
|
63
|
+
[x: `int64[${string}]`]: undefined;
|
|
64
|
+
[x: `int72[${string}]`]: undefined;
|
|
65
|
+
[x: `int80[${string}]`]: undefined;
|
|
66
|
+
[x: `int88[${string}]`]: undefined;
|
|
67
|
+
[x: `int96[${string}]`]: undefined;
|
|
68
|
+
[x: `int104[${string}]`]: undefined;
|
|
69
|
+
[x: `int112[${string}]`]: undefined;
|
|
70
|
+
[x: `int120[${string}]`]: undefined;
|
|
71
|
+
[x: `int128[${string}]`]: undefined;
|
|
72
|
+
[x: `int136[${string}]`]: undefined;
|
|
73
|
+
[x: `int144[${string}]`]: undefined;
|
|
74
|
+
[x: `int152[${string}]`]: undefined;
|
|
75
|
+
[x: `int160[${string}]`]: undefined;
|
|
76
|
+
[x: `int168[${string}]`]: undefined;
|
|
77
|
+
[x: `int176[${string}]`]: undefined;
|
|
78
|
+
[x: `int184[${string}]`]: undefined;
|
|
79
|
+
[x: `int192[${string}]`]: undefined;
|
|
80
|
+
[x: `int200[${string}]`]: undefined;
|
|
81
|
+
[x: `int208[${string}]`]: undefined;
|
|
82
|
+
[x: `int216[${string}]`]: undefined;
|
|
83
|
+
[x: `int224[${string}]`]: undefined;
|
|
84
|
+
[x: `int232[${string}]`]: undefined;
|
|
85
|
+
[x: `int240[${string}]`]: undefined;
|
|
86
|
+
[x: `int248[${string}]`]: undefined;
|
|
87
|
+
[x: `int256[${string}]`]: undefined;
|
|
88
|
+
[x: `uint[${string}]`]: undefined;
|
|
89
|
+
[x: `uint16[${string}]`]: undefined;
|
|
90
|
+
[x: `uint24[${string}]`]: undefined;
|
|
91
|
+
[x: `uint40[${string}]`]: undefined;
|
|
92
|
+
[x: `uint56[${string}]`]: undefined;
|
|
93
|
+
[x: `uint72[${string}]`]: undefined;
|
|
94
|
+
[x: `uint80[${string}]`]: undefined;
|
|
95
|
+
[x: `uint88[${string}]`]: undefined;
|
|
96
|
+
[x: `uint96[${string}]`]: undefined;
|
|
97
|
+
[x: `uint104[${string}]`]: undefined;
|
|
98
|
+
[x: `uint120[${string}]`]: undefined;
|
|
99
|
+
[x: `uint128[${string}]`]: undefined;
|
|
100
|
+
[x: `uint136[${string}]`]: undefined;
|
|
101
|
+
[x: `uint144[${string}]`]: undefined;
|
|
102
|
+
[x: `uint152[${string}]`]: undefined;
|
|
103
|
+
[x: `uint160[${string}]`]: undefined;
|
|
104
|
+
[x: `uint168[${string}]`]: undefined;
|
|
105
|
+
[x: `uint176[${string}]`]: undefined;
|
|
106
|
+
[x: `uint184[${string}]`]: undefined;
|
|
107
|
+
[x: `uint200[${string}]`]: undefined;
|
|
108
|
+
[x: `uint208[${string}]`]: undefined;
|
|
109
|
+
[x: `uint216[${string}]`]: undefined;
|
|
110
|
+
[x: `uint224[${string}]`]: undefined;
|
|
111
|
+
[x: `uint232[${string}]`]: undefined;
|
|
112
|
+
[x: `uint240[${string}]`]: undefined;
|
|
113
|
+
[x: `uint248[${string}]`]: undefined;
|
|
114
|
+
string?: undefined;
|
|
115
|
+
uint256?: undefined;
|
|
116
|
+
uint48?: undefined;
|
|
117
|
+
bool?: undefined;
|
|
118
|
+
bytes?: undefined;
|
|
119
|
+
address?: undefined;
|
|
120
|
+
bytes32?: undefined;
|
|
121
|
+
uint32?: undefined;
|
|
122
|
+
uint112?: undefined;
|
|
123
|
+
uint192?: undefined;
|
|
124
|
+
bytes4?: undefined;
|
|
125
|
+
uint8?: undefined;
|
|
126
|
+
uint64?: undefined;
|
|
127
|
+
bytes6?: undefined;
|
|
128
|
+
bytes2?: undefined;
|
|
129
|
+
bytes1?: undefined;
|
|
130
|
+
bytes5?: undefined;
|
|
131
|
+
bytes3?: undefined;
|
|
132
|
+
bytes7?: undefined;
|
|
133
|
+
bytes11?: undefined;
|
|
134
|
+
bytes8?: undefined;
|
|
135
|
+
bytes9?: undefined;
|
|
136
|
+
bytes10?: undefined;
|
|
137
|
+
bytes25?: undefined;
|
|
138
|
+
bytes18?: undefined;
|
|
139
|
+
bytes12?: undefined;
|
|
140
|
+
bytes13?: undefined;
|
|
141
|
+
bytes14?: undefined;
|
|
142
|
+
bytes15?: undefined;
|
|
143
|
+
bytes16?: undefined;
|
|
144
|
+
bytes17?: undefined;
|
|
145
|
+
bytes19?: undefined;
|
|
146
|
+
bytes20?: undefined;
|
|
147
|
+
bytes21?: undefined;
|
|
148
|
+
bytes22?: undefined;
|
|
149
|
+
bytes23?: undefined;
|
|
150
|
+
bytes24?: undefined;
|
|
151
|
+
bytes26?: undefined;
|
|
152
|
+
bytes27?: undefined;
|
|
153
|
+
bytes28?: undefined;
|
|
154
|
+
bytes29?: undefined;
|
|
155
|
+
bytes30?: undefined;
|
|
156
|
+
bytes31?: undefined;
|
|
157
|
+
int8?: undefined;
|
|
158
|
+
int16?: undefined;
|
|
159
|
+
int24?: undefined;
|
|
160
|
+
int32?: undefined;
|
|
161
|
+
int40?: undefined;
|
|
162
|
+
int48?: undefined;
|
|
163
|
+
int56?: undefined;
|
|
164
|
+
int64?: undefined;
|
|
165
|
+
int72?: undefined;
|
|
166
|
+
int80?: undefined;
|
|
167
|
+
int88?: undefined;
|
|
168
|
+
int96?: undefined;
|
|
169
|
+
int104?: undefined;
|
|
170
|
+
int112?: undefined;
|
|
171
|
+
int120?: undefined;
|
|
172
|
+
int128?: undefined;
|
|
173
|
+
int136?: undefined;
|
|
174
|
+
int144?: undefined;
|
|
175
|
+
int152?: undefined;
|
|
176
|
+
int160?: undefined;
|
|
177
|
+
int168?: undefined;
|
|
178
|
+
int176?: undefined;
|
|
179
|
+
int184?: undefined;
|
|
180
|
+
int192?: undefined;
|
|
181
|
+
int200?: undefined;
|
|
182
|
+
int208?: undefined;
|
|
183
|
+
int216?: undefined;
|
|
184
|
+
int224?: undefined;
|
|
185
|
+
int232?: undefined;
|
|
186
|
+
int240?: undefined;
|
|
187
|
+
int248?: undefined;
|
|
188
|
+
int256?: undefined;
|
|
189
|
+
uint16?: undefined;
|
|
190
|
+
uint24?: undefined;
|
|
191
|
+
uint40?: undefined;
|
|
192
|
+
uint56?: undefined;
|
|
193
|
+
uint72?: undefined;
|
|
194
|
+
uint80?: undefined;
|
|
195
|
+
uint88?: undefined;
|
|
196
|
+
uint96?: undefined;
|
|
197
|
+
uint104?: undefined;
|
|
198
|
+
uint120?: undefined;
|
|
199
|
+
uint128?: undefined;
|
|
200
|
+
uint136?: undefined;
|
|
201
|
+
uint144?: undefined;
|
|
202
|
+
uint152?: undefined;
|
|
203
|
+
uint160?: undefined;
|
|
204
|
+
uint168?: undefined;
|
|
205
|
+
uint176?: undefined;
|
|
206
|
+
uint184?: undefined;
|
|
207
|
+
uint200?: undefined;
|
|
208
|
+
uint208?: undefined;
|
|
209
|
+
uint216?: undefined;
|
|
210
|
+
uint224?: undefined;
|
|
211
|
+
uint232?: undefined;
|
|
212
|
+
uint240?: undefined;
|
|
213
|
+
uint248?: undefined;
|
|
214
|
+
} | {
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
}, TPrimaryType extends string = string>(typedData: TypedDataDefinition<TTypedData, TPrimaryType>) => Promise<Hex>;
|
|
217
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getAddress, } from "viem";
|
|
2
|
+
import { InvalidSignerTypeError } from "../errors/signer.js";
|
|
3
|
+
export class WalletClientSigner {
|
|
4
|
+
constructor(client, signerType) {
|
|
5
|
+
Object.defineProperty(this, "signerType", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value: void 0
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(this, "inner", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "getAddress", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: async () => {
|
|
22
|
+
let addresses = await this.inner.getAddresses();
|
|
23
|
+
return getAddress(addresses[0]);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(this, "signMessage", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: async (message) => {
|
|
31
|
+
const account = this.inner.account ?? (await this.getAddress());
|
|
32
|
+
return this.inner.signMessage({ message, account });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "signTypedData", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: async (typedData) => {
|
|
40
|
+
const account = this.inner.account ?? (await this.getAddress());
|
|
41
|
+
return this.inner.signTypedData({
|
|
42
|
+
account,
|
|
43
|
+
...typedData,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
this.inner = client;
|
|
48
|
+
if (!signerType) {
|
|
49
|
+
throw new InvalidSignerTypeError(signerType);
|
|
50
|
+
}
|
|
51
|
+
this.signerType = signerType;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=wallet-client.js.map
|