@aa-sdk/core 4.0.0-alpha.9 → 4.0.0-beta.1
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/dist/esm/abis/EntryPointAbi_v7.js +1 -0
- package/dist/esm/abis/EntryPointAbi_v7.js.map +1 -1
- package/dist/esm/account/smartContractAccount.d.ts +50 -1
- package/dist/esm/account/smartContractAccount.js +111 -2
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperation.d.ts +23 -0
- package/dist/esm/actions/smartAccount/buildUserOperation.js +23 -0
- package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.d.ts +39 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js +39 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.d.ts +54 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js +55 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +28 -0
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js +28 -0
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.d.ts +22 -0
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js +27 -6
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.d.ts +13 -0
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js +13 -0
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/initUserOperation.d.ts +13 -0
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js +14 -1
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js +2 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransaction.d.ts +24 -0
- package/dist/esm/actions/smartAccount/sendTransaction.js +24 -0
- package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransactions.d.ts +23 -0
- package/dist/esm/actions/smartAccount/sendTransactions.js +23 -0
- package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendUserOperation.d.ts +21 -0
- package/dist/esm/actions/smartAccount/sendUserOperation.js +21 -0
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/types.d.ts +14 -0
- package/dist/esm/actions/smartAccount/types.js +1 -0
- package/dist/esm/actions/smartAccount/types.js.map +1 -1
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.d.ts +24 -0
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js +24 -0
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
- package/dist/esm/client/bundlerClient.d.ts +21 -0
- package/dist/esm/client/bundlerClient.js +32 -0
- package/dist/esm/client/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/bundlerClient.d.ts +41 -0
- package/dist/esm/client/decorators/bundlerClient.js +10 -0
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/smartAccountClient.d.ts +8 -0
- package/dist/esm/client/decorators/smartAccountClient.js +12 -1
- package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
- package/dist/esm/client/isSmartAccountClient.d.ts +16 -0
- package/dist/esm/client/isSmartAccountClient.js +16 -0
- package/dist/esm/client/isSmartAccountClient.js.map +1 -1
- package/dist/esm/client/schema.d.ts +12 -0
- package/dist/esm/client/schema.js +14 -0
- package/dist/esm/client/schema.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js +53 -0
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/client/types.js +1 -0
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/ens/utils.d.ts +45 -0
- package/dist/esm/ens/utils.js +49 -0
- package/dist/esm/ens/utils.js.map +1 -1
- package/dist/esm/entrypoint/index.d.ts +14 -0
- package/dist/esm/entrypoint/index.js +30 -0
- package/dist/esm/entrypoint/index.js.map +1 -1
- package/dist/esm/entrypoint/types.d.ts +17 -0
- package/dist/esm/errors/account.d.ts +87 -4
- package/dist/esm/errors/account.js +88 -4
- package/dist/esm/errors/account.js.map +1 -1
- package/dist/esm/errors/base.d.ts +5 -0
- package/dist/esm/errors/base.js +5 -0
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/client.d.ts +24 -0
- package/dist/esm/errors/client.js +24 -0
- package/dist/esm/errors/client.js.map +1 -1
- package/dist/esm/errors/entrypoint.d.ts +18 -0
- package/dist/esm/errors/entrypoint.js +18 -0
- package/dist/esm/errors/entrypoint.js.map +1 -1
- package/dist/esm/errors/signer.d.ts +8 -0
- package/dist/esm/errors/signer.js +8 -0
- package/dist/esm/errors/signer.js.map +1 -1
- package/dist/esm/errors/transaction.d.ts +14 -1
- package/dist/esm/errors/transaction.js +14 -1
- package/dist/esm/errors/transaction.js.map +1 -1
- package/dist/esm/errors/useroperation.d.ts +25 -0
- package/dist/esm/errors/useroperation.js +26 -0
- package/dist/esm/errors/useroperation.js.map +1 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logger.d.ts +91 -0
- package/dist/esm/logger.js +91 -0
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/middleware/actions.d.ts +14 -0
- package/dist/esm/middleware/actions.js +7 -0
- package/dist/esm/middleware/actions.js.map +1 -1
- package/dist/esm/middleware/defaults/feeEstimator.d.ts +20 -0
- package/dist/esm/middleware/defaults/feeEstimator.js +28 -0
- package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/gasEstimator.d.ts +8 -0
- package/dist/esm/middleware/defaults/gasEstimator.js +8 -0
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/paymasterAndData.d.ts +8 -0
- package/dist/esm/middleware/defaults/paymasterAndData.js +8 -0
- package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
- package/dist/esm/middleware/defaults/userOpSigner.d.ts +10 -0
- package/dist/esm/middleware/defaults/userOpSigner.js +10 -0
- package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.d.ts +21 -0
- package/dist/esm/middleware/erc7677middleware.js +23 -0
- package/dist/esm/middleware/erc7677middleware.js.map +1 -1
- package/dist/esm/middleware/noopMiddleware.d.ts +6 -0
- package/dist/esm/middleware/noopMiddleware.js +6 -0
- package/dist/esm/middleware/noopMiddleware.js.map +1 -1
- package/dist/esm/middleware/types.js +1 -0
- package/dist/esm/middleware/types.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +98 -5
- package/dist/esm/signer/local-account.js +97 -2
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/schema.d.ts +14 -0
- package/dist/esm/signer/schema.js +14 -0
- package/dist/esm/signer/schema.js.map +1 -1
- package/dist/esm/signer/types.d.ts +13 -3
- package/dist/esm/signer/types.js +1 -0
- package/dist/esm/signer/types.js.map +1 -1
- package/dist/esm/signer/utils.d.ts +20 -0
- package/dist/esm/signer/utils.js +27 -0
- package/dist/esm/signer/utils.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +94 -4
- package/dist/esm/signer/wallet-client.js +95 -2
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/transport/split.d.ts +32 -0
- package/dist/esm/transport/split.js +32 -0
- package/dist/esm/transport/split.js.map +1 -1
- package/dist/esm/types.d.ts +17 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/bigint.d.ts +45 -0
- package/dist/esm/utils/bigint.js +46 -0
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/bytes.d.ts +9 -0
- package/dist/esm/utils/bytes.js +10 -1
- package/dist/esm/utils/bytes.js.map +1 -1
- package/dist/esm/utils/index.d.ts +86 -0
- package/dist/esm/utils/index.js +86 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/schema.d.ts +3 -0
- package/dist/esm/utils/schema.js +9 -0
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/stateOverride.js +2 -0
- package/dist/esm/utils/stateOverride.js.map +1 -1
- package/dist/esm/utils/types.d.ts +22 -0
- package/dist/esm/utils/types.js +1 -0
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/userop.d.ts +79 -0
- package/dist/esm/utils/userop.js +83 -0
- package/dist/esm/utils/userop.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +3 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/account/smartContractAccount.d.ts +1 -1
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
- package/dist/types/client/smartAccountClient.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +2 -4
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/types.d.ts +1 -3
- package/dist/types/signer/types.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +2 -4
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/transport/split.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +9 -11
- package/src/account/smartContractAccount.ts +3 -3
- package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +10 -10
- package/src/actions/smartAccount/internal/initUserOperation.ts +1 -1
- package/src/client/smartAccountClient.ts +7 -0
- package/src/index.ts +0 -1
- package/src/signer/local-account.ts +2 -2
- package/src/signer/types.ts +2 -2
- package/src/signer/wallet-client.ts +8 -4
- package/src/transport/split.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/cjs/abis/EntryPointAbi_v6.d.ts +0 -1018
- package/dist/cjs/abis/EntryPointAbi_v6.js +0 -1313
- package/dist/cjs/abis/EntryPointAbi_v6.js.map +0 -1
- package/dist/cjs/abis/EntryPointAbi_v7.d.ts +0 -775
- package/dist/cjs/abis/EntryPointAbi_v7.js +0 -661
- package/dist/cjs/abis/EntryPointAbi_v7.js.map +0 -1
- package/dist/cjs/abis/SimpleAccountAbi_v6.d.ts +0 -405
- package/dist/cjs/abis/SimpleAccountAbi_v6.js +0 -528
- package/dist/cjs/abis/SimpleAccountAbi_v6.js.map +0 -1
- package/dist/cjs/abis/SimpleAccountAbi_v7.d.ts +0 -410
- package/dist/cjs/abis/SimpleAccountAbi_v7.js +0 -538
- package/dist/cjs/abis/SimpleAccountAbi_v7.js.map +0 -1
- package/dist/cjs/abis/SimpleAccountFactoryAbi.d.ts +0 -55
- package/dist/cjs/abis/SimpleAccountFactoryAbi.js +0 -78
- package/dist/cjs/abis/SimpleAccountFactoryAbi.js.map +0 -1
- package/dist/cjs/account/smartContractAccount.d.ts +0 -74
- package/dist/cjs/account/smartContractAccount.js +0 -180
- package/dist/cjs/account/smartContractAccount.js.map +0 -1
- package/dist/cjs/actions/bundler/estimateUserOperationGas.d.ts +0 -8
- package/dist/cjs/actions/bundler/estimateUserOperationGas.js +0 -18
- package/dist/cjs/actions/bundler/estimateUserOperationGas.js.map +0 -1
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.d.ts +0 -3
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.js +0 -11
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.js.map +0 -1
- package/dist/cjs/actions/bundler/getUserOperationByHash.d.ts +0 -6
- package/dist/cjs/actions/bundler/getUserOperationByHash.js +0 -11
- package/dist/cjs/actions/bundler/getUserOperationByHash.js.map +0 -1
- package/dist/cjs/actions/bundler/getUserOperationReceipt.d.ts +0 -6
- package/dist/cjs/actions/bundler/getUserOperationReceipt.js +0 -11
- package/dist/cjs/actions/bundler/getUserOperationReceipt.js.map +0 -1
- package/dist/cjs/actions/bundler/sendRawUserOperation.d.ts +0 -7
- package/dist/cjs/actions/bundler/sendRawUserOperation.js +0 -11
- package/dist/cjs/actions/bundler/sendRawUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/buildUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/buildUserOperation.js +0 -25
- package/dist/cjs/actions/smartAccount/buildUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js +0 -39
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +0 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js +0 -62
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +0 -1
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js +0 -34
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +0 -1
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js +0 -64
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js +0 -23
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +0 -1
- package/dist/cjs/actions/smartAccount/getAddress.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/getAddress.js +0 -13
- package/dist/cjs/actions/smartAccount/getAddress.js.map +0 -1
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.d.ts +0 -7
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js +0 -42
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -10
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js +0 -47
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +0 -1
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.d.ts +0 -10
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js +0 -28
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/sendTransaction.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/sendTransaction.js +0 -35
- package/dist/cjs/actions/smartAccount/sendTransaction.js.map +0 -1
- package/dist/cjs/actions/smartAccount/sendTransactions.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/sendTransactions.js +0 -36
- package/dist/cjs/actions/smartAccount/sendTransactions.js.map +0 -1
- package/dist/cjs/actions/smartAccount/sendUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/sendUserOperation.js +0 -31
- package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signMessage.d.ts +0 -6
- package/dist/cjs/actions/smartAccount/signMessage.js +0 -12
- package/dist/cjs/actions/smartAccount/signMessage.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signMessageWith6492.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/signMessageWith6492.js +0 -12
- package/dist/cjs/actions/smartAccount/signMessageWith6492.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signTypedData.d.ts +0 -10
- package/dist/cjs/actions/smartAccount/signTypedData.js +0 -12
- package/dist/cjs/actions/smartAccount/signTypedData.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.d.ts +0 -6
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js +0 -12
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/signUserOperation.js +0 -30
- package/dist/cjs/actions/smartAccount/signUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/types.d.ts +0 -42
- package/dist/cjs/actions/smartAccount/types.js +0 -3
- package/dist/cjs/actions/smartAccount/types.js.map +0 -1
- package/dist/cjs/actions/smartAccount/upgradeAccount.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/upgradeAccount.js +0 -38
- package/dist/cjs/actions/smartAccount/upgradeAccount.js.map +0 -1
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.d.ts +0 -3
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js +0 -36
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js.map +0 -1
- package/dist/cjs/client/bundlerClient.d.ts +0 -10
- package/dist/cjs/client/bundlerClient.js +0 -51
- package/dist/cjs/client/bundlerClient.js.map +0 -1
- package/dist/cjs/client/decorators/bundlerClient.d.ts +0 -41
- package/dist/cjs/client/decorators/bundlerClient.js +0 -17
- package/dist/cjs/client/decorators/bundlerClient.js.map +0 -1
- package/dist/cjs/client/decorators/smartAccountClient.d.ts +0 -35
- package/dist/cjs/client/decorators/smartAccountClient.js +0 -43
- package/dist/cjs/client/decorators/smartAccountClient.js.map +0 -1
- package/dist/cjs/client/isSmartAccountClient.d.ts +0 -5
- package/dist/cjs/client/isSmartAccountClient.js +0 -18
- package/dist/cjs/client/isSmartAccountClient.js.map +0 -1
- package/dist/cjs/client/schema.d.ts +0 -767
- package/dist/cjs/client/schema.js +0 -63
- package/dist/cjs/client/schema.js.map +0 -1
- package/dist/cjs/client/smartAccountClient.d.ts +0 -33
- package/dist/cjs/client/smartAccountClient.js +0 -93
- package/dist/cjs/client/smartAccountClient.js.map +0 -1
- package/dist/cjs/client/types.d.ts +0 -21
- package/dist/cjs/client/types.js +0 -3
- package/dist/cjs/client/types.js.map +0 -1
- package/dist/cjs/ens/utils.d.ts +0 -6
- package/dist/cjs/ens/utils.js +0 -53
- package/dist/cjs/ens/utils.js.map +0 -1
- package/dist/cjs/entrypoint/0.6.d.ts +0 -1029
- package/dist/cjs/entrypoint/0.6.js +0 -49
- package/dist/cjs/entrypoint/0.6.js.map +0 -1
- package/dist/cjs/entrypoint/0.7.d.ts +0 -792
- package/dist/cjs/entrypoint/0.7.js +0 -88
- package/dist/cjs/entrypoint/0.7.js.map +0 -1
- package/dist/cjs/entrypoint/index.d.ts +0 -8
- package/dist/cjs/entrypoint/index.js +0 -53
- package/dist/cjs/entrypoint/index.js.map +0 -1
- package/dist/cjs/entrypoint/types.d.ts +0 -46
- package/dist/cjs/entrypoint/types.js +0 -3
- package/dist/cjs/entrypoint/types.js.map +0 -1
- package/dist/cjs/errors/account.d.ts +0 -47
- package/dist/cjs/errors/account.js +0 -140
- package/dist/cjs/errors/account.js.map +0 -1
- package/dist/cjs/errors/base.d.ts +0 -18
- package/dist/cjs/errors/base.js +0 -39
- package/dist/cjs/errors/base.js.map +0 -1
- package/dist/cjs/errors/client.d.ts +0 -14
- package/dist/cjs/errors/client.js +0 -44
- package/dist/cjs/errors/client.js.map +0 -1
- package/dist/cjs/errors/entrypoint.d.ts +0 -10
- package/dist/cjs/errors/entrypoint.js +0 -32
- package/dist/cjs/errors/entrypoint.js.map +0 -1
- package/dist/cjs/errors/signer.d.ts +0 -5
- package/dist/cjs/errors/signer.js +0 -20
- package/dist/cjs/errors/signer.js.map +0 -1
- package/dist/cjs/errors/transaction.d.ts +0 -10
- package/dist/cjs/errors/transaction.js +0 -29
- package/dist/cjs/errors/transaction.js.map +0 -1
- package/dist/cjs/errors/useroperation.d.ts +0 -10
- package/dist/cjs/errors/useroperation.js +0 -34
- package/dist/cjs/errors/useroperation.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -60
- package/dist/cjs/index.js +0 -170
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/logger.d.ts +0 -20
- package/dist/cjs/logger.js +0 -60
- package/dist/cjs/logger.js.map +0 -1
- package/dist/cjs/middleware/actions.d.ts +0 -12
- package/dist/cjs/middleware/actions.js +0 -21
- package/dist/cjs/middleware/actions.js.map +0 -1
- package/dist/cjs/middleware/defaults/feeEstimator.d.ts +0 -3
- package/dist/cjs/middleware/defaults/feeEstimator.js +0 -23
- package/dist/cjs/middleware/defaults/feeEstimator.js.map +0 -1
- package/dist/cjs/middleware/defaults/gasEstimator.d.ts +0 -3
- package/dist/cjs/middleware/defaults/gasEstimator.js +0 -28
- package/dist/cjs/middleware/defaults/gasEstimator.js.map +0 -1
- package/dist/cjs/middleware/defaults/paymasterAndData.d.ts +0 -2
- package/dist/cjs/middleware/defaults/paymasterAndData.js +0 -12
- package/dist/cjs/middleware/defaults/paymasterAndData.js.map +0 -1
- package/dist/cjs/middleware/defaults/userOpSigner.d.ts +0 -2
- package/dist/cjs/middleware/defaults/userOpSigner.js +0 -26
- package/dist/cjs/middleware/defaults/userOpSigner.js.map +0 -1
- package/dist/cjs/middleware/erc7677middleware.d.ts +0 -40
- package/dist/cjs/middleware/erc7677middleware.js +0 -77
- package/dist/cjs/middleware/erc7677middleware.js.map +0 -1
- package/dist/cjs/middleware/noopMiddleware.d.ts +0 -3
- package/dist/cjs/middleware/noopMiddleware.js +0 -8
- package/dist/cjs/middleware/noopMiddleware.js.map +0 -1
- package/dist/cjs/middleware/types.d.ts +0 -22
- package/dist/cjs/middleware/types.js +0 -3
- package/dist/cjs/middleware/types.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/signer/local-account.d.ts +0 -219
- package/dist/cjs/signer/local-account.js +0 -56
- package/dist/cjs/signer/local-account.js.map +0 -1
- package/dist/cjs/signer/schema.d.ts +0 -4
- package/dist/cjs/signer/schema.js +0 -16
- package/dist/cjs/signer/schema.js.map +0 -1
- package/dist/cjs/signer/types.d.ts +0 -15
- package/dist/cjs/signer/types.js +0 -3
- package/dist/cjs/signer/types.js.map +0 -1
- package/dist/cjs/signer/utils.d.ts +0 -7
- package/dist/cjs/signer/utils.js +0 -16
- package/dist/cjs/signer/utils.js.map +0 -1
- package/dist/cjs/signer/wallet-client.d.ts +0 -217
- package/dist/cjs/signer/wallet-client.js +0 -58
- package/dist/cjs/signer/wallet-client.js.map +0 -1
- package/dist/cjs/transport/split.d.ts +0 -9
- package/dist/cjs/transport/split.js +0 -26
- package/dist/cjs/transport/split.js.map +0 -1
- package/dist/cjs/types.d.ts +0 -158
- package/dist/cjs/types.js +0 -3
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/utils/bigint.d.ts +0 -10
- package/dist/cjs/utils/bigint.js +0 -55
- package/dist/cjs/utils/bigint.js.map +0 -1
- package/dist/cjs/utils/bytes.d.ts +0 -7
- package/dist/cjs/utils/bytes.js +0 -11
- package/dist/cjs/utils/bytes.js.map +0 -1
- package/dist/cjs/utils/defaults.d.ts +0 -4
- package/dist/cjs/utils/defaults.js +0 -19
- package/dist/cjs/utils/defaults.js.map +0 -1
- package/dist/cjs/utils/index.d.ts +0 -19
- package/dist/cjs/utils/index.js +0 -95
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/schema.d.ts +0 -25
- package/dist/cjs/utils/schema.js +0 -35
- package/dist/cjs/utils/schema.js.map +0 -1
- package/dist/cjs/utils/stateOverride.d.ts +0 -4
- package/dist/cjs/utils/stateOverride.js +0 -52
- package/dist/cjs/utils/stateOverride.js.map +0 -1
- package/dist/cjs/utils/testUtils.d.ts +0 -6
- package/dist/cjs/utils/testUtils.js +0 -33
- package/dist/cjs/utils/testUtils.js.map +0 -1
- package/dist/cjs/utils/types.d.ts +0 -16
- package/dist/cjs/utils/types.js +0 -3
- package/dist/cjs/utils/types.js.map +0 -1
- package/dist/cjs/utils/userop.d.ts +0 -49
- package/dist/cjs/utils/userop.js +0 -75
- package/dist/cjs/utils/userop.js.map +0 -1
- package/dist/cjs/version.d.ts +0 -1
- package/dist/cjs/version.js +0 -5
- package/dist/cjs/version.js.map +0 -1
- package/dist/esm/package.json +0 -1
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { BaseError } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error thrown when a client is not compatible with the expected client type for a specific method. The error message provides guidance on how to create a compatible client.
|
|
4
|
+
*/
|
|
2
5
|
export class IncompatibleClientError extends BaseError {
|
|
6
|
+
/**
|
|
7
|
+
* Throws an error when the client type does not match the expected client type.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} expectedClient The expected type of the client.
|
|
10
|
+
* @param {string} method The method that was called.
|
|
11
|
+
* @param {Client} client The client instance.
|
|
12
|
+
*/
|
|
3
13
|
constructor(expectedClient, method, client) {
|
|
4
14
|
super([
|
|
5
15
|
`Client of type (${client.type}) is not a ${expectedClient}.`,
|
|
@@ -13,7 +23,15 @@ export class IncompatibleClientError extends BaseError {
|
|
|
13
23
|
});
|
|
14
24
|
}
|
|
15
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Represents an error that occurs when an invalid RPC URL is provided. This class extends the `BaseError` class and includes the invalid URL in the error message.
|
|
28
|
+
*/
|
|
16
29
|
export class InvalidRpcUrlError extends BaseError {
|
|
30
|
+
/**
|
|
31
|
+
* Creates an instance of an error with a message indicating an invalid RPC URL.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} [rpcUrl] The invalid RPC URL that caused the error
|
|
34
|
+
*/
|
|
17
35
|
constructor(rpcUrl) {
|
|
18
36
|
super(`Invalid RPC URL ${rpcUrl}`);
|
|
19
37
|
Object.defineProperty(this, "name", {
|
|
@@ -24,7 +42,13 @@ export class InvalidRpcUrlError extends BaseError {
|
|
|
24
42
|
});
|
|
25
43
|
}
|
|
26
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Error class representing a "Chain Not Found" error, typically thrown when no chain is supplied to the client.
|
|
47
|
+
*/
|
|
27
48
|
export class ChainNotFoundError extends BaseError {
|
|
49
|
+
/**
|
|
50
|
+
* Initializes a new instance of the error message with a default message indicating that no chain was supplied to the client.
|
|
51
|
+
*/
|
|
28
52
|
constructor() {
|
|
29
53
|
super("No chain supplied to the client");
|
|
30
54
|
Object.defineProperty(this, "name", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/errors/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/errors/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IAGpD;;;;;;OAMG;IACH,YAAY,cAAsB,EAAE,MAAc,EAAE,MAAc;QAChE,KAAK,CACH;YACE,mBAAmB,MAAM,CAAC,IAAI,cAAc,cAAc,GAAG;YAC7D,qEAAqE,MAAM,IAAI;SAChF,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAfK;;;;mBAAO,yBAAyB;WAAC;IAgB1C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAG/C;;;;OAIG;IACH,YAAY,MAAe;QACzB,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;QAR5B;;;;mBAAO,oBAAoB;WAAC;IASrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAG/C;;OAEG;IACH;QACE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QANlC;;;;mBAAO,oBAAoB;WAAC;IAOrC,CAAC;CACF","sourcesContent":["import type { Client } from \"viem\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * Represents an error thrown when a client is not compatible with the expected client type for a specific method. The error message provides guidance on how to create a compatible client.\n */\nexport class IncompatibleClientError extends BaseError {\n override name = \"IncompatibleClientError\";\n\n /**\n * Throws an error when the client type does not match the expected client type.\n *\n * @param {string} expectedClient The expected type of the client.\n * @param {string} method The method that was called.\n * @param {Client} client The client instance.\n */\n constructor(expectedClient: string, method: string, client: Client) {\n super(\n [\n `Client of type (${client.type}) is not a ${expectedClient}.`,\n `Create one with \\`createSmartAccountClient\\` first before using \\`${method}\\``,\n ].join(\"\\n\")\n );\n }\n}\n\n/**\n * Represents an error that occurs when an invalid RPC URL is provided. This class extends the `BaseError` class and includes the invalid URL in the error message.\n */\nexport class InvalidRpcUrlError extends BaseError {\n override name = \"InvalidRpcUrlError\";\n\n /**\n * Creates an instance of an error with a message indicating an invalid RPC URL.\n *\n * @param {string} [rpcUrl] The invalid RPC URL that caused the error\n */\n constructor(rpcUrl?: string) {\n super(`Invalid RPC URL ${rpcUrl}`);\n }\n}\n\n/**\n * Error class representing a \"Chain Not Found\" error, typically thrown when no chain is supplied to the client.\n */\nexport class ChainNotFoundError extends BaseError {\n override name = \"ChainNotFoundError\";\n\n /**\n * Initializes a new instance of the error message with a default message indicating that no chain was supplied to the client.\n */\n constructor() {\n super(\"No chain supplied to the client\");\n }\n}\n"]}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import type { Chain } from "viem";
|
|
2
2
|
import { BaseError } from "./base.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents an error thrown when an entry point is not found for a specific chain and entry point version. This error indicates that a default entry point does not exist for the given chain and version, and suggests providing an override.
|
|
5
|
+
*/
|
|
3
6
|
export declare class EntryPointNotFoundError extends BaseError {
|
|
4
7
|
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Constructs an error message indicating that no default entry point exists for the given chain and entry point version.
|
|
10
|
+
*
|
|
11
|
+
* @param {Chain} chain The blockchain network for which the entry point is being queried
|
|
12
|
+
* @param {any} entryPointVersion The version of the entry point for which no default exists
|
|
13
|
+
*/
|
|
5
14
|
constructor(chain: Chain, entryPointVersion: any);
|
|
6
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents an error thrown when an invalid entry point version is encountered for a specific chain. This error extends the `BaseError` class.
|
|
18
|
+
*/
|
|
7
19
|
export declare class InvalidEntryPointError extends BaseError {
|
|
8
20
|
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Constructs an error indicating an invalid entry point version for a specific chain.
|
|
23
|
+
*
|
|
24
|
+
* @param {Chain} chain The chain object containing information about the blockchain
|
|
25
|
+
* @param {any} entryPointVersion The entry point version that is invalid
|
|
26
|
+
*/
|
|
9
27
|
constructor(chain: Chain, entryPointVersion: any);
|
|
10
28
|
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { BaseError } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error thrown when an entry point is not found for a specific chain and entry point version. This error indicates that a default entry point does not exist for the given chain and version, and suggests providing an override.
|
|
4
|
+
*/
|
|
2
5
|
export class EntryPointNotFoundError extends BaseError {
|
|
6
|
+
/**
|
|
7
|
+
* Constructs an error message indicating that no default entry point exists for the given chain and entry point version.
|
|
8
|
+
*
|
|
9
|
+
* @param {Chain} chain The blockchain network for which the entry point is being queried
|
|
10
|
+
* @param {any} entryPointVersion The version of the entry point for which no default exists
|
|
11
|
+
*/
|
|
3
12
|
constructor(chain, entryPointVersion) {
|
|
4
13
|
super([
|
|
5
14
|
`No default entry point v${entryPointVersion} exists for ${chain.name}.`,
|
|
@@ -13,7 +22,16 @@ export class EntryPointNotFoundError extends BaseError {
|
|
|
13
22
|
});
|
|
14
23
|
}
|
|
15
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents an error thrown when an invalid entry point version is encountered for a specific chain. This error extends the `BaseError` class.
|
|
27
|
+
*/
|
|
16
28
|
export class InvalidEntryPointError extends BaseError {
|
|
29
|
+
/**
|
|
30
|
+
* Constructs an error indicating an invalid entry point version for a specific chain.
|
|
31
|
+
*
|
|
32
|
+
* @param {Chain} chain The chain object containing information about the blockchain
|
|
33
|
+
* @param {any} entryPointVersion The entry point version that is invalid
|
|
34
|
+
*/
|
|
17
35
|
constructor(chain, entryPointVersion) {
|
|
18
36
|
super(`Invalid entry point: unexpected version ${entryPointVersion} for ${chain.name}.`);
|
|
19
37
|
Object.defineProperty(this, "name", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../../../src/errors/entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../../../src/errors/entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IAGpD;;;;;OAKG;IACH,YAAY,KAAY,EAAE,iBAAsB;QAC9C,KAAK,CACH;YACE,2BAA2B,iBAAiB,eAAe,KAAK,CAAC,IAAI,GAAG;YACxE,qBAAqB;SACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAdK;;;;mBAAO,yBAAyB;WAAC;IAe1C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IAGnD;;;;;OAKG;IACH,YAAY,KAAY,EAAE,iBAAsB;QAC9C,KAAK,CACH,2CAA2C,iBAAiB,QAAQ,KAAK,CAAC,IAAI,GAAG,CAClF,CAAC;QAXK;;;;mBAAO,wBAAwB;WAAC;IAYzC,CAAC;CACF","sourcesContent":["import type { Chain } from \"viem\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * Represents an error thrown when an entry point is not found for a specific chain and entry point version. This error indicates that a default entry point does not exist for the given chain and version, and suggests providing an override.\n */\nexport class EntryPointNotFoundError extends BaseError {\n override name = \"EntryPointNotFoundError\";\n\n /**\n * Constructs an error message indicating that no default entry point exists for the given chain and entry point version.\n *\n * @param {Chain} chain The blockchain network for which the entry point is being queried\n * @param {any} entryPointVersion The version of the entry point for which no default exists\n */\n constructor(chain: Chain, entryPointVersion: any) {\n super(\n [\n `No default entry point v${entryPointVersion} exists for ${chain.name}.`,\n `Supply an override.`,\n ].join(\"\\n\")\n );\n }\n}\n\n/**\n * Represents an error thrown when an invalid entry point version is encountered for a specific chain. This error extends the `BaseError` class.\n */\nexport class InvalidEntryPointError extends BaseError {\n override name = \"InvalidEntryPointError\";\n\n /**\n * Constructs an error indicating an invalid entry point version for a specific chain.\n *\n * @param {Chain} chain The chain object containing information about the blockchain\n * @param {any} entryPointVersion The entry point version that is invalid\n */\n constructor(chain: Chain, entryPointVersion: any) {\n super(\n `Invalid entry point: unexpected version ${entryPointVersion} for ${chain.name}.`\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { BaseError } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error thrown when an invalid signer type is provided to the SmartAccountSigner.
|
|
4
|
+
*/
|
|
2
5
|
export declare class InvalidSignerTypeError extends BaseError {
|
|
3
6
|
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* Constructs an error message when an invalid signer type is passed to SmartAccountSigner.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} [signerType] An optional parameter specifying the signer type. If not provided, a default error message will be used.
|
|
11
|
+
*/
|
|
4
12
|
constructor(signerType?: string);
|
|
5
13
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { BaseError } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error thrown when an invalid signer type is provided to the SmartAccountSigner.
|
|
4
|
+
*/
|
|
2
5
|
export class InvalidSignerTypeError extends BaseError {
|
|
6
|
+
/**
|
|
7
|
+
* Constructs an error message when an invalid signer type is passed to SmartAccountSigner.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} [signerType] An optional parameter specifying the signer type. If not provided, a default error message will be used.
|
|
10
|
+
*/
|
|
3
11
|
constructor(signerType) {
|
|
4
12
|
super([
|
|
5
13
|
"Invalid signer type parameter passed to SmartAccountSigner.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../src/errors/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../src/errors/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IAGnD;;;;OAIG;IACH,YAAY,UAAmB;QAC7B,KAAK,CACH;YACE,6DAA6D;YAC7D,UAAU,IAAI,gCAAgC;SAC/C,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAbK;;;;mBAAO,wBAAwB;WAAC;IAczC,CAAC;CACF","sourcesContent":["import { BaseError } from \"./base.js\";\n\n/**\n * Represents an error thrown when an invalid signer type is provided to the SmartAccountSigner.\n */\nexport class InvalidSignerTypeError extends BaseError {\n override name = \"InvalidSignerTypeError\";\n\n /**\n * Constructs an error message when an invalid signer type is passed to SmartAccountSigner.\n *\n * @param {string} [signerType] An optional parameter specifying the signer type. If not provided, a default error message will be used.\n */\n constructor(signerType?: string) {\n super(\n [\n \"Invalid signer type parameter passed to SmartAccountSigner.\",\n signerType ?? \"A signerType must be provided.\",\n ].join(\"\\n\")\n );\n }\n}\n"]}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import type { Hex } from "viem";
|
|
2
2
|
import { BaseError } from "./base.js";
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when a transaction is missing the `to` address parameter. This class extends the `BaseError` class.
|
|
5
|
+
*/
|
|
3
6
|
export declare class TransactionMissingToParamError extends BaseError {
|
|
4
7
|
name: string;
|
|
5
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Throws an error indicating that a transaction is missing the `to` address in the request.
|
|
10
|
+
*/ constructor();
|
|
6
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents an error that occurs when a transaction cannot be found for a given user operation. This error extends from `BaseError`. The `hash` of the transaction is provided to indicate which transaction could not be found.
|
|
14
|
+
*/
|
|
7
15
|
export declare class FailedToFindTransactionError extends BaseError {
|
|
8
16
|
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a new error message indicating a failure to find the transaction for the specified user operation hash.
|
|
19
|
+
*
|
|
20
|
+
* @param {Hex} hash The hexadecimal value representing the user operation hash.
|
|
21
|
+
*/
|
|
9
22
|
constructor(hash: Hex);
|
|
10
23
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { BaseError } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when a transaction is missing the `to` address parameter. This class extends the `BaseError` class.
|
|
4
|
+
*/
|
|
2
5
|
export class TransactionMissingToParamError extends BaseError {
|
|
3
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Throws an error indicating that a transaction is missing the `to` address in the request.
|
|
8
|
+
*/ constructor() {
|
|
4
9
|
super("Transaction is missing `to` address set on request");
|
|
5
10
|
Object.defineProperty(this, "name", {
|
|
6
11
|
enumerable: true,
|
|
@@ -10,7 +15,15 @@ export class TransactionMissingToParamError extends BaseError {
|
|
|
10
15
|
});
|
|
11
16
|
}
|
|
12
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Represents an error that occurs when a transaction cannot be found for a given user operation. This error extends from `BaseError`. The `hash` of the transaction is provided to indicate which transaction could not be found.
|
|
20
|
+
*/
|
|
13
21
|
export class FailedToFindTransactionError extends BaseError {
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a new error message indicating a failure to find the transaction for the specified user operation hash.
|
|
24
|
+
*
|
|
25
|
+
* @param {Hex} hash The hexadecimal value representing the user operation hash.
|
|
26
|
+
*/
|
|
14
27
|
constructor(hash) {
|
|
15
28
|
super(`Failed to find transaction for user operation ${hash}`);
|
|
16
29
|
Object.defineProperty(this, "name", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/errors/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/errors/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,SAAS;IAG3D;;OAEG,CAAC;QACF,KAAK,CAAC,oDAAoD,CAAC,CAAC;QALrD;;;;mBAAO,gCAAgC;WAAC;IAMjD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,SAAS;IAGzD;;;;OAIG;IACH,YAAY,IAAS;QACnB,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;QARxD;;;;mBAAO,8BAA8B;WAAC;IAS/C,CAAC;CACF","sourcesContent":["import type { Hex } from \"viem\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * Error thrown when a transaction is missing the `to` address parameter. This class extends the `BaseError` class.\n */\nexport class TransactionMissingToParamError extends BaseError {\n override name = \"TransactionMissingToParamError\";\n\n /**\n * Throws an error indicating that a transaction is missing the `to` address in the request.\n */ constructor() {\n super(\"Transaction is missing `to` address set on request\");\n }\n}\n\n/**\n * Represents an error that occurs when a transaction cannot be found for a given user operation. This error extends from `BaseError`. The `hash` of the transaction is provided to indicate which transaction could not be found.\n */\nexport class FailedToFindTransactionError extends BaseError {\n override name = \"FailedToFindTransactionError\";\n\n /**\n * Constructs a new error message indicating a failure to find the transaction for the specified user operation hash.\n *\n * @param {Hex} hash The hexadecimal value representing the user operation hash.\n */\n constructor(hash: Hex) {\n super(`Failed to find transaction for user operation ${hash}`);\n }\n}\n"]}
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import type { UserOperationRequest, UserOperationStruct } from "../types.js";
|
|
2
2
|
import { BaseError } from "./base.js";
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when a UserOperationStruct is not a valid request
|
|
5
|
+
*
|
|
6
|
+
* extends viem BaseError
|
|
7
|
+
*/
|
|
3
8
|
export declare class InvalidUserOperationError extends BaseError {
|
|
9
|
+
/**
|
|
10
|
+
* @inheritdoc
|
|
11
|
+
*/
|
|
4
12
|
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of InvalidUserOperationError.
|
|
15
|
+
*
|
|
16
|
+
* InvalidUserOperationError constructor
|
|
17
|
+
*
|
|
18
|
+
* @param {UserOperationStruct} uo the invalid user operation struct
|
|
19
|
+
*/
|
|
5
20
|
constructor(uo: UserOperationStruct);
|
|
6
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Error thrown when waiting for user operation request to be mined.
|
|
24
|
+
*
|
|
25
|
+
* Includes the internal error as well as the request that failed. This request
|
|
26
|
+
* can then be used with dropAndReplaceUserOperation to retry the operation.
|
|
27
|
+
*/
|
|
7
28
|
export declare class WaitForUserOperationError extends BaseError {
|
|
8
29
|
request: UserOperationRequest;
|
|
30
|
+
/**
|
|
31
|
+
* @param {UserOperationRequest} request the user operation request that failed
|
|
32
|
+
* @param {Error} error the underlying error that caused the failure
|
|
33
|
+
*/
|
|
9
34
|
constructor(request: UserOperationRequest, error: Error);
|
|
10
35
|
}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { BaseError } from "./base.js";
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when a UserOperationStruct is not a valid request
|
|
5
|
+
*
|
|
6
|
+
* extends viem BaseError
|
|
7
|
+
*/
|
|
2
8
|
export class InvalidUserOperationError extends BaseError {
|
|
9
|
+
/**
|
|
10
|
+
* Creates an instance of InvalidUserOperationError.
|
|
11
|
+
*
|
|
12
|
+
* InvalidUserOperationError constructor
|
|
13
|
+
*
|
|
14
|
+
* @param {UserOperationStruct} uo the invalid user operation struct
|
|
15
|
+
*/
|
|
3
16
|
constructor(uo) {
|
|
4
17
|
super(`Request is missing parameters. All properties on UserOperationStruct must be set. uo: ${JSON.stringify(uo, (_key, value) => typeof value === "bigint"
|
|
5
18
|
? {
|
|
@@ -7,6 +20,9 @@ export class InvalidUserOperationError extends BaseError {
|
|
|
7
20
|
value: value.toString(),
|
|
8
21
|
}
|
|
9
22
|
: value, 2)}`);
|
|
23
|
+
/**
|
|
24
|
+
* @inheritdoc
|
|
25
|
+
*/
|
|
10
26
|
Object.defineProperty(this, "name", {
|
|
11
27
|
enumerable: true,
|
|
12
28
|
configurable: true,
|
|
@@ -15,7 +31,17 @@ export class InvalidUserOperationError extends BaseError {
|
|
|
15
31
|
});
|
|
16
32
|
}
|
|
17
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Error thrown when waiting for user operation request to be mined.
|
|
36
|
+
*
|
|
37
|
+
* Includes the internal error as well as the request that failed. This request
|
|
38
|
+
* can then be used with dropAndReplaceUserOperation to retry the operation.
|
|
39
|
+
*/
|
|
18
40
|
export class WaitForUserOperationError extends BaseError {
|
|
41
|
+
/**
|
|
42
|
+
* @param {UserOperationRequest} request the user operation request that failed
|
|
43
|
+
* @param {Error} error the underlying error that caused the failure
|
|
44
|
+
*/
|
|
19
45
|
constructor(request, error) {
|
|
20
46
|
super(`Failed to find User Operation: ${error.message}`);
|
|
21
47
|
Object.defineProperty(this, "request", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useroperation.js","sourceRoot":"","sources":["../../../src/errors/useroperation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"useroperation.js","sourceRoot":"","sources":["../../../src/errors/useroperation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,6DAA6D;AAE7D;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,SAAS;IAKtD;;;;;;OAMG;IACH,YAAY,EAAuB;QACjC,KAAK,CACH,yFAAyF,IAAI,CAAC,SAAS,CACrG,EAAE,EACF,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,OAAO,KAAK,KAAK,QAAQ;YACvB,CAAC,CAAC;gBACE,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;aACxB;YACH,CAAC,CAAC,KAAK,EACX,CAAC,CACF,EAAE,CACJ,CAAC;QAxBJ;;WAEG;QACM;;;;mBAAO,2BAA2B;WAAC;IAsB5C,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,yBAA0B,SAAQ,SAAS;IACtD;;;OAGG;IACH,YAAmB,OAA6B,EAAE,KAAY;QAC5D,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAD/C;;;;mBAAO,OAAO;WAAsB;IAEhD,CAAC;CACF","sourcesContent":["import type { UserOperationRequest, UserOperationStruct } from \"../types.js\";\nimport { BaseError } from \"./base.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n/**\n * Thrown when a UserOperationStruct is not a valid request\n *\n * extends viem BaseError\n */\nexport class InvalidUserOperationError extends BaseError {\n /**\n * @inheritdoc\n */\n override name = \"InvalidUserOperationError\";\n /**\n * Creates an instance of InvalidUserOperationError.\n *\n * InvalidUserOperationError constructor\n *\n * @param {UserOperationStruct} uo the invalid user operation struct\n */\n constructor(uo: UserOperationStruct) {\n super(\n `Request is missing parameters. All properties on UserOperationStruct must be set. uo: ${JSON.stringify(\n uo,\n (_key, value) =>\n typeof value === \"bigint\"\n ? {\n type: \"bigint\",\n value: value.toString(),\n }\n : value,\n 2\n )}`\n );\n }\n}\n\n/**\n * Error thrown when waiting for user operation request to be mined.\n *\n * Includes the internal error as well as the request that failed. This request\n * can then be used with dropAndReplaceUserOperation to retry the operation.\n */\nexport class WaitForUserOperationError extends BaseError {\n /**\n * @param {UserOperationRequest} request the user operation request that failed\n * @param {Error} error the underlying error that caused the failure\n */\n constructor(public request: UserOperationRequest, error: Error) {\n super(`Failed to find User Operation: ${error.message}`);\n }\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export type { Abi } from "abitype";
|
|
2
2
|
export type { Address, HttpTransport } from "viem";
|
|
3
|
-
export * as chains from "viem/chains";
|
|
4
3
|
export { EntryPointAbi_v6 } from "./abis/EntryPointAbi_v6.js";
|
|
5
4
|
export { EntryPointAbi_v7 } from "./abis/EntryPointAbi_v7.js";
|
|
6
5
|
export { SimpleAccountAbi_v6 } from "./abis/SimpleAccountAbi_v6.js";
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0DAA0D,CAAC;AAC1G,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAEhF,OAAO,EAAE,+BAA+B,EAAE,MAAM,4DAA4D,CAAC;AAE7G,OAAO,EACL,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,wBAAwB,EACxB,oCAAoC,GACrC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,gCAAgC,EAChC,mCAAmC,EACnC,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,KAAK,EAA6B,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,8BAA8B,EAC9B,SAAS,EACT,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,iCAAiC,EACjC,cAAc,EACd,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,IAAI,EACJ,iBAAiB,EACjB,SAAS,EACT,QAAQ,GACT,MAAM,kBAAkB,CAAC","sourcesContent":["export type { Abi } from \"abitype\";\nexport type { Address, HttpTransport } from \"viem\";\n\nexport { EntryPointAbi_v6 } from \"./abis/EntryPointAbi_v6.js\";\nexport { EntryPointAbi_v7 } from \"./abis/EntryPointAbi_v7.js\";\nexport { SimpleAccountAbi_v6 } from \"./abis/SimpleAccountAbi_v6.js\";\nexport { SimpleAccountAbi_v7 } from \"./abis/SimpleAccountAbi_v7.js\";\nexport { SimpleAccountFactoryAbi } from \"./abis/SimpleAccountFactoryAbi.js\";\nexport type * from \"./account/smartContractAccount.js\";\nexport {\n getAccountAddress,\n isSmartAccountWithSigner,\n parseFactoryAddressFromAccountInitCode,\n toSmartContractAccount,\n} from \"./account/smartContractAccount.js\";\nexport { buildUserOperation } from \"./actions/smartAccount/buildUserOperation.js\";\nexport { buildUserOperationFromTx } from \"./actions/smartAccount/buildUserOperationFromTx.js\";\nexport { buildUserOperationFromTxs } from \"./actions/smartAccount/buildUserOperationFromTxs.js\";\nexport { checkGasSponsorshipEligibility } from \"./actions/smartAccount/checkGasSponsorshipEligibility.js\";\nexport { dropAndReplaceUserOperation } from \"./actions/smartAccount/dropAndReplaceUserOperation.js\";\nexport { sendTransaction } from \"./actions/smartAccount/sendTransaction.js\";\nexport { sendTransactions } from \"./actions/smartAccount/sendTransactions.js\";\nexport { sendUserOperation } from \"./actions/smartAccount/sendUserOperation.js\";\nexport type * from \"./actions/smartAccount/types.js\";\nexport { waitForUserOperationTransaction } from \"./actions/smartAccount/waitForUserOperationTransacation.js\";\nexport type * from \"./client/bundlerClient.js\";\nexport {\n createBundlerClient,\n createBundlerClientFromExisting,\n} from \"./client/bundlerClient.js\";\nexport type * from \"./client/decorators/bundlerClient.js\";\nexport { bundlerActions } from \"./client/decorators/bundlerClient.js\";\nexport type * from \"./client/decorators/smartAccountClient.js\";\nexport { smartAccountClientActions } from \"./client/decorators/smartAccountClient.js\";\nexport { isSmartAccountClient } from \"./client/isSmartAccountClient.js\";\nexport {\n ConnectionConfigSchema,\n SmartAccountClientOptsSchema,\n} from \"./client/schema.js\";\nexport type * from \"./client/smartAccountClient.js\";\nexport {\n createSmartAccountClient,\n createSmartAccountClientFromExisting,\n} from \"./client/smartAccountClient.js\";\nexport type * from \"./client/types.js\";\nexport {\n convertChainIdToCoinType,\n convertCoinTypeToChain,\n convertCoinTypeToChainId,\n} from \"./ens/utils.js\";\nexport {\n defaultEntryPointVersion,\n entryPointRegistry,\n getEntryPoint,\n isEntryPointVersion,\n} from \"./entrypoint/index.js\";\nexport type * from \"./entrypoint/types.js\";\nexport {\n AccountNotFoundError,\n AccountRequiresOwnerError,\n BatchExecutionNotSupportedError,\n DefaultFactoryNotDefinedError,\n FailedToGetStorageSlotError,\n GetCounterFactualAddressError,\n IncorrectAccountType,\n SignTransactionNotSupportedError,\n SmartAccountWithSignerRequiredError,\n UpgradeToAndCallNotSupportedError,\n UpgradesNotSupportedError,\n} from \"./errors/account.js\";\nexport { BaseError } from \"./errors/base.js\";\nexport {\n ChainNotFoundError,\n IncompatibleClientError,\n InvalidRpcUrlError,\n} from \"./errors/client.js\";\nexport {\n EntryPointNotFoundError,\n InvalidEntryPointError,\n} from \"./errors/entrypoint.js\";\nexport { InvalidSignerTypeError } from \"./errors/signer.js\";\nexport {\n FailedToFindTransactionError,\n TransactionMissingToParamError,\n} from \"./errors/transaction.js\";\nexport {\n InvalidUserOperationError,\n WaitForUserOperationError,\n} from \"./errors/useroperation.js\";\nexport { LogLevel, Logger } from \"./logger.js\";\nexport { middlewareActions } from \"./middleware/actions.js\";\nexport { defaultFeeEstimator } from \"./middleware/defaults/feeEstimator.js\";\nexport { defaultGasEstimator } from \"./middleware/defaults/gasEstimator.js\";\nexport { defaultPaymasterAndData } from \"./middleware/defaults/paymasterAndData.js\";\nexport { defaultUserOpSigner } from \"./middleware/defaults/userOpSigner.js\";\nexport type * from \"./middleware/erc7677middleware.js\";\nexport { erc7677Middleware } from \"./middleware/erc7677middleware.js\";\nexport { noopMiddleware } from \"./middleware/noopMiddleware.js\";\nexport type * from \"./middleware/types.js\";\nexport { LocalAccountSigner } from \"./signer/local-account.js\";\nexport { SignerSchema, isSigner } from \"./signer/schema.js\";\nexport type {\n SmartAccountAuthenticator,\n SmartAccountSigner,\n} from \"./signer/types.js\";\nexport { wrapSignatureWith6492 } from \"./signer/utils.js\";\nexport { WalletClientSigner } from \"./signer/wallet-client.js\";\nexport { split, type SplitTransportParams } from \"./transport/split.js\";\nexport type * from \"./types.js\";\nexport type * from \"./utils/index.js\";\nexport {\n BigNumberishRangeSchema,\n BigNumberishSchema,\n ChainSchema,\n HexSchema,\n MultiplierSchema,\n allEqual,\n applyUserOpFeeOption,\n applyUserOpOverride,\n applyUserOpOverrideOrFeeOption,\n asyncPipe,\n bigIntMax,\n bigIntMultiply,\n bypassPaymasterAndData,\n bypassPaymasterAndDataEmptyHex,\n concatPaymasterAndData,\n deepHexlify,\n filterUndefined,\n getDefaultUserOperationFeeOptions,\n isBigNumberish,\n isMultiplier,\n isValidRequest,\n parsePaymasterAndData,\n pick,\n resolveProperties,\n takeBytes,\n toRecord,\n} from \"./utils/index.js\";\n"]}
|
package/dist/esm/logger.d.ts
CHANGED
|
@@ -6,15 +6,106 @@ export declare enum LogLevel {
|
|
|
6
6
|
ERROR = 1,
|
|
7
7
|
NONE = 0
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Logger class provides static methods for logging at different levels such as error, warn, debug, info, and verbose. This class allows setting log levels and log filters to control the logging behavior.
|
|
11
|
+
*/
|
|
9
12
|
export declare class Logger {
|
|
10
13
|
static logLevel: LogLevel;
|
|
11
14
|
static logFilter?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Sets the log level for logging purposes.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { Logger, LogLevel } from "@aa-sdk/core";
|
|
21
|
+
* Logger.setLogLevel(LogLevel.DEBUG);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param {LogLevel} logLevel The desired log level
|
|
25
|
+
*/
|
|
12
26
|
static setLogLevel(logLevel: LogLevel): void;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the log filter pattern.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { Logger } from "@aa-sdk/core";
|
|
33
|
+
*
|
|
34
|
+
* Logger.setLogFilter("error");
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param {string} pattern The pattern to set as the log filter
|
|
38
|
+
*/
|
|
13
39
|
static setLogFilter(pattern: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Logs an error message to the console if the logging condition is met.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* import { Logger } from "@aa-sdk/core";
|
|
46
|
+
*
|
|
47
|
+
* Logger.error("An error occurred while processing the request");
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @param {string} msg The primary error message to be logged
|
|
51
|
+
* @param {...any[]} args Additional arguments to be logged along with the error message
|
|
52
|
+
*/
|
|
14
53
|
static error(msg: string, ...args: any[]): void;
|
|
54
|
+
/**
|
|
55
|
+
* Logs a warning message if the logging conditions are met.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { Logger } from "@aa-sdk/core";
|
|
60
|
+
*
|
|
61
|
+
* Logger.warn("Careful...");
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param {string} msg The message to log as a warning
|
|
65
|
+
* @param {...any[]} args Additional parameters to log along with the message
|
|
66
|
+
*/
|
|
15
67
|
static warn(msg: string, ...args: any[]): void;
|
|
68
|
+
/**
|
|
69
|
+
* Logs a debug message to the console if the log level allows it.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { Logger } from "@aa-sdk/core";
|
|
74
|
+
*
|
|
75
|
+
* Logger.debug("Something is happening");
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @param {string} msg The message to log
|
|
79
|
+
* @param {...any[]} args Additional arguments to pass to the console.debug method
|
|
80
|
+
*/
|
|
16
81
|
static debug(msg: string, ...args: any[]): void;
|
|
82
|
+
/**
|
|
83
|
+
* Logs an informational message to the console if the logging level is set to INFO.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* import { Logger } from "@aa-sdk/core";
|
|
88
|
+
*
|
|
89
|
+
* Logger.info("Something is happening");
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @param {string} msg the message to log
|
|
93
|
+
* @param {...any[]} args additional arguments to log alongside the message
|
|
94
|
+
*/
|
|
17
95
|
static info(msg: string, ...args: any[]): void;
|
|
96
|
+
/**
|
|
97
|
+
* Logs a message with additional arguments if the logging level permits it.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* import { Logger } from "@aa-sdk/core";
|
|
102
|
+
*
|
|
103
|
+
* Logger.verbose("Something is happening");
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @param {string} msg The message to log
|
|
107
|
+
* @param {...any[]} args Additional arguments to be logged
|
|
108
|
+
*/
|
|
18
109
|
static verbose(msg: string, ...args: any[]): void;
|
|
19
110
|
private static shouldLog;
|
|
20
111
|
}
|
package/dist/esm/logger.js
CHANGED
|
@@ -7,33 +7,124 @@ export var LogLevel;
|
|
|
7
7
|
LogLevel[LogLevel["ERROR"] = 1] = "ERROR";
|
|
8
8
|
LogLevel[LogLevel["NONE"] = 0] = "NONE";
|
|
9
9
|
})(LogLevel || (LogLevel = {}));
|
|
10
|
+
/**
|
|
11
|
+
* Logger class provides static methods for logging at different levels such as error, warn, debug, info, and verbose. This class allows setting log levels and log filters to control the logging behavior.
|
|
12
|
+
*/
|
|
10
13
|
export class Logger {
|
|
14
|
+
/**
|
|
15
|
+
* Sets the log level for logging purposes.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Logger, LogLevel } from "@aa-sdk/core";
|
|
20
|
+
* Logger.setLogLevel(LogLevel.DEBUG);
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param {LogLevel} logLevel The desired log level
|
|
24
|
+
*/
|
|
11
25
|
static setLogLevel(logLevel) {
|
|
12
26
|
this.logLevel = logLevel;
|
|
13
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Sets the log filter pattern.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { Logger } from "@aa-sdk/core";
|
|
34
|
+
*
|
|
35
|
+
* Logger.setLogFilter("error");
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param {string} pattern The pattern to set as the log filter
|
|
39
|
+
*/
|
|
14
40
|
static setLogFilter(pattern) {
|
|
15
41
|
this.logFilter = pattern;
|
|
16
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Logs an error message to the console if the logging condition is met.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { Logger } from "@aa-sdk/core";
|
|
49
|
+
*
|
|
50
|
+
* Logger.error("An error occurred while processing the request");
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @param {string} msg The primary error message to be logged
|
|
54
|
+
* @param {...any[]} args Additional arguments to be logged along with the error message
|
|
55
|
+
*/
|
|
17
56
|
static error(msg, ...args) {
|
|
18
57
|
if (!this.shouldLog(msg, LogLevel.ERROR))
|
|
19
58
|
return;
|
|
20
59
|
console.error(msg, ...args);
|
|
21
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Logs a warning message if the logging conditions are met.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { Logger } from "@aa-sdk/core";
|
|
67
|
+
*
|
|
68
|
+
* Logger.warn("Careful...");
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @param {string} msg The message to log as a warning
|
|
72
|
+
* @param {...any[]} args Additional parameters to log along with the message
|
|
73
|
+
*/
|
|
22
74
|
static warn(msg, ...args) {
|
|
23
75
|
if (!this.shouldLog(msg, LogLevel.WARN))
|
|
24
76
|
return;
|
|
25
77
|
console.warn(msg, ...args);
|
|
26
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Logs a debug message to the console if the log level allows it.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* import { Logger } from "@aa-sdk/core";
|
|
85
|
+
*
|
|
86
|
+
* Logger.debug("Something is happening");
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @param {string} msg The message to log
|
|
90
|
+
* @param {...any[]} args Additional arguments to pass to the console.debug method
|
|
91
|
+
*/
|
|
27
92
|
static debug(msg, ...args) {
|
|
28
93
|
if (!this.shouldLog(msg, LogLevel.DEBUG))
|
|
29
94
|
return;
|
|
30
95
|
console.debug(msg, ...args);
|
|
31
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Logs an informational message to the console if the logging level is set to INFO.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* import { Logger } from "@aa-sdk/core";
|
|
103
|
+
*
|
|
104
|
+
* Logger.info("Something is happening");
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @param {string} msg the message to log
|
|
108
|
+
* @param {...any[]} args additional arguments to log alongside the message
|
|
109
|
+
*/
|
|
32
110
|
static info(msg, ...args) {
|
|
33
111
|
if (!this.shouldLog(msg, LogLevel.INFO))
|
|
34
112
|
return;
|
|
35
113
|
console.info(msg, ...args);
|
|
36
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Logs a message with additional arguments if the logging level permits it.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* import { Logger } from "@aa-sdk/core";
|
|
121
|
+
*
|
|
122
|
+
* Logger.verbose("Something is happening");
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* @param {string} msg The message to log
|
|
126
|
+
* @param {...any[]} args Additional arguments to be logged
|
|
127
|
+
*/
|
|
37
128
|
static verbose(msg, ...args) {
|
|
38
129
|
if (!this.shouldLog(msg, LogLevel.VERBOSE))
|
|
39
130
|
return;
|