@aa-sdk/core 4.0.0-alpha.0 → 4.0.0-alpha.2
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/cjs/account/simple.js.map +1 -1
- package/dist/cjs/account/smartContractAccount.js +2 -1
- package/dist/cjs/account/smartContractAccount.js.map +1 -1
- package/dist/cjs/actions/smartAccount/buildUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/dist/cjs/actions/smartAccount/sendTransactions.js.map +1 -1
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
- package/dist/cjs/client/bundlerClient.js.map +1 -1
- package/dist/cjs/client/decorators/bundlerClient.js.map +1 -1
- package/dist/cjs/client/decorators/smartAccountClient.js.map +1 -1
- package/dist/cjs/client/smartAccountClient.js.map +1 -1
- package/dist/cjs/ens/utils.d.ts +1 -1
- package/dist/cjs/ens/utils.js +3 -3
- package/dist/cjs/ens/utils.js.map +1 -1
- package/dist/cjs/entrypoint/index.js.map +1 -1
- package/dist/cjs/errors/account.js.map +1 -1
- package/dist/cjs/errors/base.js.map +1 -1
- package/dist/cjs/errors/client.js.map +1 -1
- package/dist/cjs/errors/entrypoint.js.map +1 -1
- package/dist/cjs/errors/signer.js.map +1 -1
- package/dist/cjs/errors/transaction.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -3
- package/dist/cjs/index.js +35 -60
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger.js.map +1 -1
- package/dist/cjs/middleware/defaults/feeEstimator.d.ts +1 -1
- package/dist/cjs/middleware/defaults/feeEstimator.js +17 -15
- package/dist/cjs/middleware/defaults/feeEstimator.js.map +1 -1
- package/dist/cjs/middleware/defaults/paymasterAndData.js.map +1 -1
- package/dist/cjs/middleware/defaults/userOpSigner.js.map +1 -1
- package/dist/cjs/signer/local-account.d.ts +2 -2
- package/dist/cjs/signer/local-account.js.map +1 -1
- package/dist/cjs/signer/schema.js.map +1 -1
- package/dist/cjs/signer/utils.d.ts +1 -9
- package/dist/cjs/signer/utils.js +1 -16
- package/dist/cjs/signer/utils.js.map +1 -1
- package/dist/cjs/signer/wallet-client.d.ts +2 -2
- package/dist/cjs/signer/wallet-client.js.map +1 -1
- package/dist/cjs/utils/defaults.d.ts +1 -1
- package/dist/cjs/utils/defaults.js +25 -25
- package/dist/cjs/utils/defaults.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +0 -4
- package/dist/cjs/utils/index.js +1 -33
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/account/simple.js.map +1 -1
- package/dist/esm/account/smartContractAccount.js +2 -1
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
- package/dist/esm/client/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/ens/utils.d.ts +1 -1
- package/dist/esm/ens/utils.js +1 -1
- package/dist/esm/ens/utils.js.map +1 -1
- package/dist/esm/entrypoint/index.js.map +1 -1
- package/dist/esm/errors/account.js.map +1 -1
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/client.js.map +1 -1
- package/dist/esm/errors/entrypoint.js.map +1 -1
- package/dist/esm/errors/signer.js.map +1 -1
- package/dist/esm/errors/transaction.js.map +1 -1
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/middleware/defaults/feeEstimator.d.ts +1 -1
- package/dist/esm/middleware/defaults/feeEstimator.js +17 -15
- package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
- package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +2 -2
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/schema.js.map +1 -1
- package/dist/esm/signer/utils.d.ts +1 -9
- package/dist/esm/signer/utils.js +0 -14
- package/dist/esm/signer/utils.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +2 -2
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/utils/defaults.d.ts +1 -1
- package/dist/esm/utils/defaults.js +2 -2
- package/dist/esm/utils/defaults.js.map +1 -1
- package/dist/esm/utils/index.d.ts +0 -4
- package/dist/esm/utils/index.js +0 -18
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/account/smartContractAccount.d.ts +49 -0
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperation.d.ts +23 -0
- package/dist/types/actions/smartAccount/buildUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts +22 -0
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendTransaction.d.ts +24 -0
- package/dist/types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendTransactions.d.ts +23 -0
- package/dist/types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts +24 -0
- package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts.map +1 -1
- package/dist/types/client/bundlerClient.d.ts +15 -0
- package/dist/types/client/bundlerClient.d.ts.map +1 -1
- package/dist/types/client/decorators/bundlerClient.d.ts +9 -0
- package/dist/types/client/decorators/bundlerClient.d.ts.map +1 -1
- package/dist/types/client/decorators/smartAccountClient.d.ts +8 -0
- package/dist/types/client/decorators/smartAccountClient.d.ts.map +1 -1
- package/dist/types/client/smartAccountClient.d.ts.map +1 -1
- package/dist/types/ens/utils.d.ts +46 -1
- package/dist/types/ens/utils.d.ts.map +1 -1
- package/dist/types/entrypoint/index.d.ts +14 -0
- package/dist/types/entrypoint/index.d.ts.map +1 -1
- package/dist/types/errors/account.d.ts +34 -0
- package/dist/types/errors/account.d.ts.map +1 -1
- package/dist/types/errors/base.d.ts +5 -0
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/errors/client.d.ts +9 -0
- package/dist/types/errors/client.d.ts.map +1 -1
- package/dist/types/errors/entrypoint.d.ts +6 -0
- package/dist/types/errors/entrypoint.d.ts.map +1 -1
- package/dist/types/errors/signer.d.ts +3 -0
- package/dist/types/errors/signer.d.ts.map +1 -1
- package/dist/types/errors/transaction.d.ts +6 -0
- package/dist/types/errors/transaction.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logger.d.ts +3 -0
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/middleware/defaults/feeEstimator.d.ts +21 -1
- package/dist/types/middleware/defaults/feeEstimator.d.ts.map +1 -1
- package/dist/types/middleware/defaults/paymasterAndData.d.ts +8 -0
- package/dist/types/middleware/defaults/paymasterAndData.d.ts.map +1 -1
- package/dist/types/middleware/defaults/userOpSigner.d.ts +10 -0
- package/dist/types/middleware/defaults/userOpSigner.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +5 -2
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/schema.d.ts +14 -0
- package/dist/types/signer/schema.d.ts.map +1 -1
- package/dist/types/signer/utils.d.ts +21 -9
- package/dist/types/signer/utils.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +5 -2
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/utils/defaults.d.ts +1 -1
- package/dist/types/utils/defaults.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +54 -11
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/account/simple.ts +6 -0
- package/src/account/smartContractAccount.ts +120 -15
- package/src/actions/smartAccount/buildUserOperation.ts +23 -0
- package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +22 -0
- package/src/actions/smartAccount/sendTransaction.ts +24 -0
- package/src/actions/smartAccount/sendTransactions.ts +23 -0
- package/src/actions/smartAccount/waitForUserOperationTransacation.ts +24 -0
- package/src/client/bundlerClient.ts +32 -0
- package/src/client/decorators/bundlerClient.ts +9 -0
- package/src/client/decorators/smartAccountClient.ts +8 -0
- package/src/client/smartAccountClient.ts +41 -0
- package/src/ens/utils.ts +46 -2
- package/src/entrypoint/index.ts +30 -62
- package/src/errors/account.ts +34 -0
- package/src/errors/base.ts +5 -2
- package/src/errors/client.ts +9 -0
- package/src/errors/entrypoint.ts +6 -0
- package/src/errors/signer.ts +3 -0
- package/src/errors/transaction.ts +6 -0
- package/src/index.ts +1 -28
- package/src/logger.ts +3 -0
- package/src/middleware/defaults/feeEstimator.ts +24 -4
- package/src/middleware/defaults/paymasterAndData.ts +8 -0
- package/src/middleware/defaults/userOpSigner.ts +10 -0
- package/src/signer/local-account.ts +3 -0
- package/src/signer/schema.ts +14 -0
- package/src/signer/utils.ts +20 -32
- package/src/signer/wallet-client.ts +3 -0
- package/src/utils/defaults.ts +3 -4
- package/src/utils/index.ts +54 -36
- package/src/version.ts +1 -1
- package/dist/cjs/chains/index.d.ts +0 -20
- package/dist/cjs/chains/index.js +0 -169
- package/dist/cjs/chains/index.js.map +0 -1
- package/dist/esm/chains/index.d.ts +0 -20
- package/dist/esm/chains/index.js +0 -166
- package/dist/esm/chains/index.js.map +0 -1
- package/dist/types/chains/index.d.ts +0 -21
- package/dist/types/chains/index.d.ts.map +0 -1
- package/src/chains/index.ts +0 -194
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/errors/account.ts"],"names":[],"mappings":";;;AAEA,uCAAsC;
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/errors/account.ts"],"names":[],"mappings":";;;AAEA,uCAAsC;AAKtC,MAAa,oBAAqB,SAAQ,mBAAS;IAIjD;QACE,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAJzD;;;;mBAAO,sBAAsB;WAAC;IAKvC,CAAC;CACF;AAPD,oDAOC;AAMD,MAAa,6BAA8B,SAAQ,mBAAS;IAE1D,YAAY,WAAmB,EAAE,KAAY,EAAE,OAA0B;QACvE,KAAK,CACH;YACE,0BAA0B,WAAW,mBAAmB,KAAK,CAAC,IAAI,2BAA2B,OAAO,EAAE;YACtG,gFAAgF;SACjF,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAPK;;;;mBAAO,+BAA+B;WAAC;IAQhD,CAAC;CACF;AAVD,sEAUC;AAKD,MAAa,6BAA8B,SAAQ,mBAAS;IAE1D;QACE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAFlC;;;;mBAAO,+BAA+B;WAAC;IAGhD,CAAC;CACF;AALD,sEAKC;AAKD,MAAa,yBAA0B,SAAQ,mBAAS;IAEtD,YAAY,WAAmB;QAC7B,KAAK,CAAC,iCAAiC,WAAW,EAAE,CAAC,CAAC;QAF/C;;;;mBAAO,sBAAsB;WAAC;IAGvC,CAAC;CACF;AALD,8DAKC;AAKD,MAAa,gCAAiC,SAAQ,mBAAS;IAE7D;QACE,KAAK,CAAC,qDAAqD,CAAC,CAAC;QAFtD;;;;mBAAO,6BAA6B;WAAC;IAG9C,CAAC;CACF;AALD,4EAKC;AAKD,MAAa,2BAA4B,SAAQ,mBAAS;IAExD,YAAY,IAAY,EAAE,cAAsB;QAC9C,KAAK,CAAC,8BAA8B,IAAI,KAAK,cAAc,GAAG,CAAC,CAAC;QAFzD;;;;mBAAO,6BAA6B;WAAC;IAG9C,CAAC;CACF;AALD,kEAKC;AAKD,MAAa,+BAAgC,SAAQ,mBAAS;IAE5D,YAAY,WAAmB;QAC7B,KAAK,CAAC,uCAAuC,WAAW,EAAE,CAAC,CAAC;QAFrD;;;;mBAAO,iCAAiC;WAAC;IAGlD,CAAC;CACF;AALD,0EAKC;AAKD,MAAa,yBAA0B,SAAQ,mBAAS;IAEtD,YAAY,WAAmB;QAC7B,KAAK,CAAC,mBAAmB,WAAW,+BAA+B,CAAC,CAAC;QAF9D;;;;mBAAO,2BAA2B;WAAC;IAG5C,CAAC;CACF;AALD,8DAKC;AAKD,MAAa,iCAAkC,SAAQ,mBAAS;IAE9D,YAAY,WAAmB;QAC7B,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;QAFtD;;;;mBAAO,mCAAmC;WAAC;IAGpD,CAAC;CACF;AALD,8EAKC;AAKD,MAAa,oBAAqB,SAAQ,mBAAS;IAEjD,YAAY,QAAgB,EAAE,MAAc;QAC1C,KAAK,CAAC,yBAAyB,QAAQ,SAAS,MAAM,EAAE,CAAC,CAAC;QAFnD;;;;mBAAO,2BAA2B;WAAC;IAG5C,CAAC;CACF;AALD,oDAKC;AAKD,MAAa,mCAAoC,SAAQ,mBAAS;IAEhE;QACE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAFlC;;;;mBAAO,qCAAqC;WAAC;IAGtD,CAAC;CACF;AALD,kFAKC","sourcesContent":["import type { Chain } from \"viem\";\nimport type { EntryPointVersion } from \"../entrypoint/types.js\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * This error is thrown when an account could not be found to execute a specific action. It extends the `BaseError` class.\n */\nexport class AccountNotFoundError extends BaseError {\n override name = \"AccountNotFoundError\";\n\n // TODO: extend this further using docs path as well\n constructor() {\n super(\"Could not find an Account to execute with this Action.\");\n }\n}\n\n/**\n * Represents an error that is thrown when no default factory is defined for a specific account type on a given chain and entry point version.\n * This error suggests providing an override via the `factoryAddress` parameter when creating an account.\n */\nexport class DefaultFactoryNotDefinedError extends BaseError {\n override name = \"DefaultFactoryNotDefinedError\";\n constructor(accountType: string, chain: Chain, version: EntryPointVersion) {\n super(\n [\n `No default factory for ${accountType} found on chain ${chain.name} for entrypoint version ${version}`,\n \"Supply an override via the `factoryAddress` parameter when creating an account\",\n ].join(\"\\n\")\n );\n }\n}\n\n/**\n * Custom error class for handling errors when getting a counterfactual address. This extends the `BaseError` class and provides a custom error message and name.\n */\nexport class GetCounterFactualAddressError extends BaseError {\n override name = \"GetCounterFactualAddressError\";\n constructor() {\n super(\"getCounterFactualAddress failed\");\n }\n}\n\n/**\n * An error class representing the condition where upgrades are not supported for a specific account type. This error extends the `BaseError` class and provides a custom error message based on the account type.\n */\nexport class UpgradesNotSupportedError extends BaseError {\n override name = \"UpgradesNotSupported\";\n constructor(accountType: string) {\n super(`Upgrades are not supported by ${accountType}`);\n }\n}\n\n/**\n * Error thrown when attempting to sign a transaction that is not supported by smart contracts.\n */\nexport class SignTransactionNotSupportedError extends BaseError {\n override name = \"SignTransactionNotSupported\";\n constructor() {\n super(`SignTransaction is not supported by smart contracts`);\n }\n}\n\n/**\n * Custom error class `FailedToGetStorageSlotError` which is used to signal a failure when attempting to retrieve a storage slot. This error includes the slot and slot descriptor in its message and inherits from `BaseError`.\n */\nexport class FailedToGetStorageSlotError extends BaseError {\n override name = \"FailedToGetStorageSlotError\";\n constructor(slot: string, slotDescriptor: string) {\n super(`Failed to get storage slot ${slot} (${slotDescriptor})`);\n }\n}\n\n/**\n * Represents an error indicating that batch execution is not supported for a specific account type.\n */\nexport class BatchExecutionNotSupportedError extends BaseError {\n override name = \"BatchExecutionNotSupportedError\";\n constructor(accountType: string) {\n super(`Batch execution is not supported by ${accountType}`);\n }\n}\n\n/**\n * Represents an error that occurs when an account requires an owner to execute but none is provided.\n */\nexport class AccountRequiresOwnerError extends BaseError {\n override name = \"AccountRequiresOwnerError\";\n constructor(accountType: string) {\n super(`Account of type ${accountType} requires an owner to execute`);\n }\n}\n\n/**\n * Represents an error that occurs when an attempt is made to call `UpgradeToAndCall` on an account type that does not support it. Includes the account type in the error message.\n */\nexport class UpgradeToAndCallNotSupportedError extends BaseError {\n override name = \"UpgradeToAndCallNotSupportedError\";\n constructor(accountType: string) {\n super(`UpgradeToAndCall is not supported by ${accountType}`);\n }\n}\n\n/**\n * Represents an error thrown when an account type does not match the expected type.\n */\nexport class IncorrectAccountType extends BaseError {\n override name = \"IncorrectAccountTypeError\";\n constructor(expected: string, actual: string) {\n super(`Expected account type ${expected}, got ${actual}`);\n }\n}\n\n/**\n * Error class indicating that a smart account operation requires a signer.\n */\nexport class SmartAccountWithSignerRequiredError extends BaseError {\n override name = \"SmartAccountWithSignerRequiredError\";\n constructor() {\n super(\"Smart account requires a signer\");\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/errors/base.ts"],"names":[],"mappings":";;;AAAA,+BAAkD;AAClD,8CAAwC;
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/errors/base.ts"],"names":[],"mappings":";;;AAAA,+BAAkD;AAClD,8CAAwC;AAsBxC,MAAa,SAAU,SAAQ,gBAAa;IAI1C,YAAY,YAAoB,EAAE,OAA4B,EAAE;QAC9D,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAJnB;;;;mBAAO,YAAY;WAAC;QACpB;;;;mBAAU,oBAAO;WAAC;QAKzB,MAAM,QAAQ,GACZ,IAAI,CAAC,KAAK,YAAY,SAAS;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;YACtC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QAEpB,IAAI,CAAC,OAAO,GAAG;YACb,YAAY,IAAI,oBAAoB;YACpC,EAAE;YACF,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,QAAQ;gBACV,CAAC,CAAC;oBACE,uCAAuC,QAAQ,GAC7C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EACxC,EAAE;iBACH;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACrD,YAAY,IAAI,CAAC,OAAO,EAAE;SAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;CACF;AA3BD,8BA2BC","sourcesContent":["import { BaseError as ViemBaseError } from \"viem\";\nimport { VERSION } from \"../version.js\";\n\ntype BaseErrorParameters = {\n docsPath?: string;\n docsSlug?: string;\n metaMessages?: string[];\n} & (\n | {\n cause?: never;\n details?: string;\n }\n | {\n cause: BaseError | Error;\n details?: never;\n }\n);\n\n/**\n * A custom error class that extends from `ViemBaseError`. This class allows for error messages to include links to relevant documentation based on provided `docsPath` and `docsSlug` parameters.\n * This is based on on viem's BaseError type (obviously from the import and extend)\n * we want the errors here to point to our docs if we supply a docsPath though\n */\nexport class BaseError extends ViemBaseError {\n override name = \"AASDKError\";\n override version = VERSION;\n\n constructor(shortMessage: string, args: BaseErrorParameters = {}) {\n super(shortMessage, args);\n\n const docsPath =\n args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n\n this.message = [\n shortMessage || \"An error occurred.\",\n \"\",\n ...(args.metaMessages ? [...args.metaMessages, \"\"] : []),\n ...(docsPath\n ? [\n `Docs: https://accountkit.alchemy.com${docsPath}${\n args.docsSlug ? `#${args.docsSlug}` : \"\"\n }`,\n ]\n : []),\n ...(this.details ? [`Details: ${this.details}`] : []),\n `Version: ${this.version}`,\n ].join(\"\\n\");\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/errors/client.ts"],"names":[],"mappings":";;;AACA,uCAAsC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/errors/client.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAKtC,MAAa,uBAAwB,SAAQ,mBAAS;IAEpD,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;QAPK;;;;mBAAO,yBAAyB;WAAC;IAQ1C,CAAC;CACF;AAVD,0DAUC;AAKD,MAAa,kBAAmB,SAAQ,mBAAS;IAE/C,YAAY,MAAe;QACzB,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;QAF5B;;;;mBAAO,oBAAoB;WAAC;IAGrC,CAAC;CACF;AALD,gDAKC;AAKD,MAAa,kBAAmB,SAAQ,mBAAS;IAE/C;QACE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAFlC;;;;mBAAO,oBAAoB;WAAC;IAGrC,CAAC;CACF;AALD,gDAKC","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 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 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 constructor() {\n super(\"No chain supplied to the client\");\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../../../src/errors/entrypoint.ts"],"names":[],"mappings":";;;AACA,uCAAsC;
|
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../../../src/errors/entrypoint.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAKtC,MAAa,uBAAwB,SAAQ,mBAAS;IAGpD,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;QARK;;;;mBAAO,yBAAyB;WAAC;IAS1C,CAAC;CACF;AAXD,0DAWC;AAKD,MAAa,sBAAuB,SAAQ,mBAAS;IAGnD,YAAY,KAAY,EAAE,iBAAsB;QAC9C,KAAK,CACH,2CAA2C,iBAAiB,QAAQ,KAAK,CAAC,IAAI,GAAG,CAClF,CAAC;QALK;;;;mBAAO,wBAAwB;WAAC;IAMzC,CAAC;CACF;AARD,wDAQC","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 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 constructor(chain: Chain, entryPointVersion: any) {\n super(\n `Invalid entry point: unexpected version ${entryPointVersion} for ${chain.name}.`\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../src/errors/signer.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../src/errors/signer.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAKtC,MAAa,sBAAuB,SAAQ,mBAAS;IAEnD,YAAY,UAAmB;QAC7B,KAAK,CACH;YACE,6DAA6D;YAC7D,UAAU,IAAI,gCAAgC;SAC/C,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAPK;;;;mBAAO,wBAAwB;WAAC;IAQzC,CAAC;CACF;AAVD,wDAUC","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 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/errors/transaction.ts"],"names":[],"mappings":";;;AACA,uCAAsC;
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/errors/transaction.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAKtC,MAAa,8BAA+B,SAAQ,mBAAS;IAE3D;QACE,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAFrD;;;;mBAAO,gCAAgC;WAAC;IAGjD,CAAC;CACF;AALD,wEAKC;AAKD,MAAa,4BAA6B,SAAQ,mBAAS;IAEzD,YAAY,IAAS;QACnB,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;QAFxD;;;;mBAAO,8BAA8B;WAAC;IAG/C,CAAC;CACF;AALD,oEAKC","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 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 constructor(hash: Hex) {\n super(`Failed to find transaction for user operation ${hash}`);\n }\n}\n"]}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ export { sendTransactions } from "./actions/smartAccount/sendTransactions.js";
|
|
|
22
22
|
export { sendUserOperation } from "./actions/smartAccount/sendUserOperation.js";
|
|
23
23
|
export type * from "./actions/smartAccount/types.js";
|
|
24
24
|
export { waitForUserOperationTransaction } from "./actions/smartAccount/waitForUserOperationTransacation.js";
|
|
25
|
-
export { arbitrum, arbitrumGoerli, arbitrumSepolia, base, baseGoerli, baseSepolia, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "./chains/index.js";
|
|
26
25
|
export type * from "./client/bundlerClient.js";
|
|
27
26
|
export { createBundlerClient, createBundlerClientFromExisting, } from "./client/bundlerClient.js";
|
|
28
27
|
export type * from "./client/decorators/bundlerClient.js";
|
|
@@ -55,9 +54,9 @@ export type * from "./middleware/types.js";
|
|
|
55
54
|
export { LocalAccountSigner } from "./signer/local-account.js";
|
|
56
55
|
export { SignerSchema, isSigner } from "./signer/schema.js";
|
|
57
56
|
export type { SmartAccountAuthenticator, SmartAccountSigner, } from "./signer/types.js";
|
|
58
|
-
export {
|
|
57
|
+
export { wrapSignatureWith6492 } from "./signer/utils.js";
|
|
59
58
|
export { WalletClientSigner } from "./signer/wallet-client.js";
|
|
60
59
|
export { split, type SplitTransportParams } from "./transport/split.js";
|
|
61
60
|
export type * from "./types.js";
|
|
62
61
|
export type * from "./utils/index.js";
|
|
63
|
-
export {
|
|
62
|
+
export { BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, filterUndefined, getDefaultSimpleAccountFactoryAddress, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -23,9 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.toRecord = exports.takeBytes = exports.resolveProperties = exports.pick = exports.parsePaymasterAndData = exports.isValidRequest = exports.isMultiplier = exports.isBigNumberish = exports.getDefaultUserOperationFeeOptions = exports.getDefaultSimpleAccountFactoryAddress = exports.getChain = exports.filterUndefined = exports.defineReadOnly = exports.deepHexlify = exports.concatPaymasterAndData = exports.bypassPaymasterAndDataEmptyHex = exports.bypassPaymasterAndData = exports.bigIntMultiply = exports.bigIntMax = exports.asyncPipe = exports.applyUserOpOverrideOrFeeOption = exports.applyUserOpOverride = exports.applyUserOpFeeOption = void 0;
|
|
26
|
+
exports.ChainNotFoundError = exports.BaseError = exports.UpgradesNotSupportedError = exports.UpgradeToAndCallNotSupportedError = exports.SmartAccountWithSignerRequiredError = exports.SignTransactionNotSupportedError = exports.IncorrectAccountType = exports.GetCounterFactualAddressError = exports.FailedToGetStorageSlotError = exports.DefaultFactoryNotDefinedError = exports.BatchExecutionNotSupportedError = exports.AccountRequiresOwnerError = exports.AccountNotFoundError = exports.isEntryPointVersion = exports.getEntryPoint = exports.entryPointRegistry = exports.defaultEntryPointVersion = exports.convertCoinTypeToChainId = exports.convertCoinTypeToChain = exports.convertChainIdToCoinType = exports.createSmartAccountClientFromExisting = exports.createSmartAccountClient = exports.SmartAccountClientOptsSchema = exports.ConnectionConfigSchema = exports.isSmartAccountClient = exports.smartAccountClientActions = exports.bundlerActions = exports.createBundlerClientFromExisting = exports.createBundlerClient = exports.waitForUserOperationTransaction = exports.sendUserOperation = exports.sendTransactions = exports.sendTransaction = exports.dropAndReplaceUserOperation = exports.checkGasSponsorshipEligibility = exports.buildUserOperationFromTxs = exports.buildUserOperationFromTx = exports.buildUserOperation = exports.toSmartContractAccount = exports.parseFactoryAddressFromAccountInitCode = exports.isSmartAccountWithSigner = exports.getAccountAddress = exports.createSimpleSmartAccount = exports.BaseSmartContractAccount = exports.SimpleAccountFactoryAbi = exports.SimpleAccountAbi_v7 = exports.SimpleAccountAbi_v6 = exports.EntryPointAbi_v7 = exports.EntryPointAbi_v6 = exports.chains = void 0;
|
|
27
|
+
exports.toRecord = exports.takeBytes = exports.resolveProperties = exports.pick = exports.parsePaymasterAndData = exports.isValidRequest = exports.isMultiplier = exports.isBigNumberish = exports.getDefaultUserOperationFeeOptions = exports.getDefaultSimpleAccountFactoryAddress = exports.filterUndefined = exports.deepHexlify = exports.concatPaymasterAndData = exports.bypassPaymasterAndDataEmptyHex = exports.bypassPaymasterAndData = exports.bigIntMultiply = exports.bigIntMax = exports.asyncPipe = exports.applyUserOpOverrideOrFeeOption = exports.applyUserOpOverride = exports.applyUserOpFeeOption = exports.allEqual = exports.MultiplierSchema = exports.HexSchema = exports.ChainSchema = exports.BigNumberishSchema = exports.BigNumberishRangeSchema = exports.split = exports.WalletClientSigner = exports.wrapSignatureWith6492 = exports.isSigner = exports.SignerSchema = exports.LocalAccountSigner = exports.noopMiddleware = exports.defaultUserOpSigner = exports.defaultPaymasterAndData = exports.defaultGasEstimator = exports.defaultFeeEstimator = exports.middlewareActions = exports.Logger = exports.LogLevel = exports.WaitForUserOperationError = exports.InvalidUserOperationError = exports.TransactionMissingToParamError = exports.FailedToFindTransactionError = exports.InvalidSignerTypeError = exports.InvalidEntryPointError = exports.EntryPointNotFoundError = exports.InvalidRpcUrlError = exports.IncompatibleClientError = void 0;
|
|
29
28
|
exports.chains = __importStar(require("viem/chains"));
|
|
30
29
|
var EntryPointAbi_v6_js_1 = require("./abis/EntryPointAbi_v6.js");
|
|
31
30
|
Object.defineProperty(exports, "EntryPointAbi_v6", { enumerable: true, get: function () { return EntryPointAbi_v6_js_1.EntryPointAbi_v6; } });
|
|
@@ -64,26 +63,6 @@ var sendUserOperation_js_1 = require("./actions/smartAccount/sendUserOperation.j
|
|
|
64
63
|
Object.defineProperty(exports, "sendUserOperation", { enumerable: true, get: function () { return sendUserOperation_js_1.sendUserOperation; } });
|
|
65
64
|
var waitForUserOperationTransacation_js_1 = require("./actions/smartAccount/waitForUserOperationTransacation.js");
|
|
66
65
|
Object.defineProperty(exports, "waitForUserOperationTransaction", { enumerable: true, get: function () { return waitForUserOperationTransacation_js_1.waitForUserOperationTransaction; } });
|
|
67
|
-
var index_js_1 = require("./chains/index.js");
|
|
68
|
-
Object.defineProperty(exports, "arbitrum", { enumerable: true, get: function () { return index_js_1.arbitrum; } });
|
|
69
|
-
Object.defineProperty(exports, "arbitrumGoerli", { enumerable: true, get: function () { return index_js_1.arbitrumGoerli; } });
|
|
70
|
-
Object.defineProperty(exports, "arbitrumSepolia", { enumerable: true, get: function () { return index_js_1.arbitrumSepolia; } });
|
|
71
|
-
Object.defineProperty(exports, "base", { enumerable: true, get: function () { return index_js_1.base; } });
|
|
72
|
-
Object.defineProperty(exports, "baseGoerli", { enumerable: true, get: function () { return index_js_1.baseGoerli; } });
|
|
73
|
-
Object.defineProperty(exports, "baseSepolia", { enumerable: true, get: function () { return index_js_1.baseSepolia; } });
|
|
74
|
-
Object.defineProperty(exports, "fraxtal", { enumerable: true, get: function () { return index_js_1.fraxtal; } });
|
|
75
|
-
Object.defineProperty(exports, "fraxtalSepolia", { enumerable: true, get: function () { return index_js_1.fraxtalSepolia; } });
|
|
76
|
-
Object.defineProperty(exports, "goerli", { enumerable: true, get: function () { return index_js_1.goerli; } });
|
|
77
|
-
Object.defineProperty(exports, "mainnet", { enumerable: true, get: function () { return index_js_1.mainnet; } });
|
|
78
|
-
Object.defineProperty(exports, "optimism", { enumerable: true, get: function () { return index_js_1.optimism; } });
|
|
79
|
-
Object.defineProperty(exports, "optimismGoerli", { enumerable: true, get: function () { return index_js_1.optimismGoerli; } });
|
|
80
|
-
Object.defineProperty(exports, "optimismSepolia", { enumerable: true, get: function () { return index_js_1.optimismSepolia; } });
|
|
81
|
-
Object.defineProperty(exports, "polygon", { enumerable: true, get: function () { return index_js_1.polygon; } });
|
|
82
|
-
Object.defineProperty(exports, "polygonAmoy", { enumerable: true, get: function () { return index_js_1.polygonAmoy; } });
|
|
83
|
-
Object.defineProperty(exports, "polygonMumbai", { enumerable: true, get: function () { return index_js_1.polygonMumbai; } });
|
|
84
|
-
Object.defineProperty(exports, "sepolia", { enumerable: true, get: function () { return index_js_1.sepolia; } });
|
|
85
|
-
Object.defineProperty(exports, "zora", { enumerable: true, get: function () { return index_js_1.zora; } });
|
|
86
|
-
Object.defineProperty(exports, "zoraSepolia", { enumerable: true, get: function () { return index_js_1.zoraSepolia; } });
|
|
87
66
|
var bundlerClient_js_1 = require("./client/bundlerClient.js");
|
|
88
67
|
Object.defineProperty(exports, "createBundlerClient", { enumerable: true, get: function () { return bundlerClient_js_1.createBundlerClient; } });
|
|
89
68
|
Object.defineProperty(exports, "createBundlerClientFromExisting", { enumerable: true, get: function () { return bundlerClient_js_1.createBundlerClientFromExisting; } });
|
|
@@ -103,11 +82,11 @@ var utils_js_1 = require("./ens/utils.js");
|
|
|
103
82
|
Object.defineProperty(exports, "convertChainIdToCoinType", { enumerable: true, get: function () { return utils_js_1.convertChainIdToCoinType; } });
|
|
104
83
|
Object.defineProperty(exports, "convertCoinTypeToChain", { enumerable: true, get: function () { return utils_js_1.convertCoinTypeToChain; } });
|
|
105
84
|
Object.defineProperty(exports, "convertCoinTypeToChainId", { enumerable: true, get: function () { return utils_js_1.convertCoinTypeToChainId; } });
|
|
106
|
-
var
|
|
107
|
-
Object.defineProperty(exports, "defaultEntryPointVersion", { enumerable: true, get: function () { return
|
|
108
|
-
Object.defineProperty(exports, "entryPointRegistry", { enumerable: true, get: function () { return
|
|
109
|
-
Object.defineProperty(exports, "getEntryPoint", { enumerable: true, get: function () { return
|
|
110
|
-
Object.defineProperty(exports, "isEntryPointVersion", { enumerable: true, get: function () { return
|
|
85
|
+
var index_js_1 = require("./entrypoint/index.js");
|
|
86
|
+
Object.defineProperty(exports, "defaultEntryPointVersion", { enumerable: true, get: function () { return index_js_1.defaultEntryPointVersion; } });
|
|
87
|
+
Object.defineProperty(exports, "entryPointRegistry", { enumerable: true, get: function () { return index_js_1.entryPointRegistry; } });
|
|
88
|
+
Object.defineProperty(exports, "getEntryPoint", { enumerable: true, get: function () { return index_js_1.getEntryPoint; } });
|
|
89
|
+
Object.defineProperty(exports, "isEntryPointVersion", { enumerable: true, get: function () { return index_js_1.isEntryPointVersion; } });
|
|
111
90
|
var account_js_1 = require("./errors/account.js");
|
|
112
91
|
Object.defineProperty(exports, "AccountNotFoundError", { enumerable: true, get: function () { return account_js_1.AccountNotFoundError; } });
|
|
113
92
|
Object.defineProperty(exports, "AccountRequiresOwnerError", { enumerable: true, get: function () { return account_js_1.AccountRequiresOwnerError; } });
|
|
@@ -158,41 +137,37 @@ var schema_js_2 = require("./signer/schema.js");
|
|
|
158
137
|
Object.defineProperty(exports, "SignerSchema", { enumerable: true, get: function () { return schema_js_2.SignerSchema; } });
|
|
159
138
|
Object.defineProperty(exports, "isSigner", { enumerable: true, get: function () { return schema_js_2.isSigner; } });
|
|
160
139
|
var utils_js_2 = require("./signer/utils.js");
|
|
161
|
-
Object.defineProperty(exports, "verifyEIP6492Signature", { enumerable: true, get: function () { return utils_js_2.verifyEIP6492Signature; } });
|
|
162
140
|
Object.defineProperty(exports, "wrapSignatureWith6492", { enumerable: true, get: function () { return utils_js_2.wrapSignatureWith6492; } });
|
|
163
141
|
var wallet_client_js_1 = require("./signer/wallet-client.js");
|
|
164
142
|
Object.defineProperty(exports, "WalletClientSigner", { enumerable: true, get: function () { return wallet_client_js_1.WalletClientSigner; } });
|
|
165
143
|
var split_js_1 = require("./transport/split.js");
|
|
166
144
|
Object.defineProperty(exports, "split", { enumerable: true, get: function () { return split_js_1.split; } });
|
|
167
|
-
var
|
|
168
|
-
Object.defineProperty(exports, "
|
|
169
|
-
Object.defineProperty(exports, "
|
|
170
|
-
Object.defineProperty(exports, "
|
|
171
|
-
Object.defineProperty(exports, "
|
|
172
|
-
Object.defineProperty(exports, "
|
|
173
|
-
Object.defineProperty(exports, "
|
|
174
|
-
Object.defineProperty(exports, "
|
|
175
|
-
Object.defineProperty(exports, "
|
|
176
|
-
Object.defineProperty(exports, "
|
|
177
|
-
Object.defineProperty(exports, "
|
|
178
|
-
Object.defineProperty(exports, "
|
|
179
|
-
Object.defineProperty(exports, "
|
|
180
|
-
Object.defineProperty(exports, "
|
|
181
|
-
Object.defineProperty(exports, "
|
|
182
|
-
Object.defineProperty(exports, "
|
|
183
|
-
Object.defineProperty(exports, "
|
|
184
|
-
Object.defineProperty(exports, "
|
|
185
|
-
Object.defineProperty(exports, "
|
|
186
|
-
Object.defineProperty(exports, "
|
|
187
|
-
Object.defineProperty(exports, "
|
|
188
|
-
Object.defineProperty(exports, "
|
|
189
|
-
Object.defineProperty(exports, "
|
|
190
|
-
Object.defineProperty(exports, "
|
|
191
|
-
Object.defineProperty(exports, "
|
|
192
|
-
Object.defineProperty(exports, "
|
|
193
|
-
Object.defineProperty(exports, "
|
|
194
|
-
Object.defineProperty(exports, "
|
|
195
|
-
Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return index_js_3.resolveProperties; } });
|
|
196
|
-
Object.defineProperty(exports, "takeBytes", { enumerable: true, get: function () { return index_js_3.takeBytes; } });
|
|
197
|
-
Object.defineProperty(exports, "toRecord", { enumerable: true, get: function () { return index_js_3.toRecord; } });
|
|
145
|
+
var index_js_2 = require("./utils/index.js");
|
|
146
|
+
Object.defineProperty(exports, "BigNumberishRangeSchema", { enumerable: true, get: function () { return index_js_2.BigNumberishRangeSchema; } });
|
|
147
|
+
Object.defineProperty(exports, "BigNumberishSchema", { enumerable: true, get: function () { return index_js_2.BigNumberishSchema; } });
|
|
148
|
+
Object.defineProperty(exports, "ChainSchema", { enumerable: true, get: function () { return index_js_2.ChainSchema; } });
|
|
149
|
+
Object.defineProperty(exports, "HexSchema", { enumerable: true, get: function () { return index_js_2.HexSchema; } });
|
|
150
|
+
Object.defineProperty(exports, "MultiplierSchema", { enumerable: true, get: function () { return index_js_2.MultiplierSchema; } });
|
|
151
|
+
Object.defineProperty(exports, "allEqual", { enumerable: true, get: function () { return index_js_2.allEqual; } });
|
|
152
|
+
Object.defineProperty(exports, "applyUserOpFeeOption", { enumerable: true, get: function () { return index_js_2.applyUserOpFeeOption; } });
|
|
153
|
+
Object.defineProperty(exports, "applyUserOpOverride", { enumerable: true, get: function () { return index_js_2.applyUserOpOverride; } });
|
|
154
|
+
Object.defineProperty(exports, "applyUserOpOverrideOrFeeOption", { enumerable: true, get: function () { return index_js_2.applyUserOpOverrideOrFeeOption; } });
|
|
155
|
+
Object.defineProperty(exports, "asyncPipe", { enumerable: true, get: function () { return index_js_2.asyncPipe; } });
|
|
156
|
+
Object.defineProperty(exports, "bigIntMax", { enumerable: true, get: function () { return index_js_2.bigIntMax; } });
|
|
157
|
+
Object.defineProperty(exports, "bigIntMultiply", { enumerable: true, get: function () { return index_js_2.bigIntMultiply; } });
|
|
158
|
+
Object.defineProperty(exports, "bypassPaymasterAndData", { enumerable: true, get: function () { return index_js_2.bypassPaymasterAndData; } });
|
|
159
|
+
Object.defineProperty(exports, "bypassPaymasterAndDataEmptyHex", { enumerable: true, get: function () { return index_js_2.bypassPaymasterAndDataEmptyHex; } });
|
|
160
|
+
Object.defineProperty(exports, "concatPaymasterAndData", { enumerable: true, get: function () { return index_js_2.concatPaymasterAndData; } });
|
|
161
|
+
Object.defineProperty(exports, "deepHexlify", { enumerable: true, get: function () { return index_js_2.deepHexlify; } });
|
|
162
|
+
Object.defineProperty(exports, "filterUndefined", { enumerable: true, get: function () { return index_js_2.filterUndefined; } });
|
|
163
|
+
Object.defineProperty(exports, "getDefaultSimpleAccountFactoryAddress", { enumerable: true, get: function () { return index_js_2.getDefaultSimpleAccountFactoryAddress; } });
|
|
164
|
+
Object.defineProperty(exports, "getDefaultUserOperationFeeOptions", { enumerable: true, get: function () { return index_js_2.getDefaultUserOperationFeeOptions; } });
|
|
165
|
+
Object.defineProperty(exports, "isBigNumberish", { enumerable: true, get: function () { return index_js_2.isBigNumberish; } });
|
|
166
|
+
Object.defineProperty(exports, "isMultiplier", { enumerable: true, get: function () { return index_js_2.isMultiplier; } });
|
|
167
|
+
Object.defineProperty(exports, "isValidRequest", { enumerable: true, get: function () { return index_js_2.isValidRequest; } });
|
|
168
|
+
Object.defineProperty(exports, "parsePaymasterAndData", { enumerable: true, get: function () { return index_js_2.parsePaymasterAndData; } });
|
|
169
|
+
Object.defineProperty(exports, "pick", { enumerable: true, get: function () { return index_js_2.pick; } });
|
|
170
|
+
Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return index_js_2.resolveProperties; } });
|
|
171
|
+
Object.defineProperty(exports, "takeBytes", { enumerable: true, get: function () { return index_js_2.takeBytes; } });
|
|
172
|
+
Object.defineProperty(exports, "toRecord", { enumerable: true, get: function () { return index_js_2.toRecord; } });
|
|
198
173
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/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":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,sDAAsC;AAEtC,kEAA8D;AAArD,uHAAA,gBAAgB,OAAA;AACzB,kEAA8D;AAArD,uHAAA,gBAAgB,OAAA;AACzB,wEAAoE;AAA3D,6HAAA,mBAAmB,OAAA;AAC5B,wEAAoE;AAA3D,6HAAA,mBAAmB,OAAA;AAC5B,gFAA4E;AAAnE,qIAAA,uBAAuB,OAAA;AAChC,6CAA6D;AAApD,mHAAA,wBAAwB,OAAA;AACjC,iDAA+D;AAAtD,qHAAA,wBAAwB,OAAA;AAGjC,6EAK2C;AAJzC,4HAAA,iBAAiB,OAAA;AACjB,mIAAA,wBAAwB,OAAA;AACxB,iJAAA,sCAAsC,OAAA;AACtC,iIAAA,sBAAsB,OAAA;AAMxB,sFAAkF;AAAzE,2HAAA,kBAAkB,OAAA;AAC3B,kGAA8F;AAArF,uIAAA,wBAAwB,OAAA;AACjC,oGAAgG;AAAvF,yIAAA,yBAAyB,OAAA;AAClC,8GAA0G;AAAjG,mJAAA,8BAA8B,OAAA;AACvC,wGAAoG;AAA3F,6IAAA,2BAA2B,OAAA;AACpC,gFAA4E;AAAnE,qHAAA,eAAe,OAAA;AACxB,kFAA8E;AAArE,uHAAA,gBAAgB,OAAA;AACzB,oFAAgF;AAAvE,yHAAA,iBAAiB,OAAA;AAE1B,kHAA6G;AAApG,sJAAA,+BAA+B,OAAA;AAExC,8DAGmC;AAFjC,uHAAA,mBAAmB,OAAA;AACnB,mIAAA,+BAA+B,OAAA;AAGjC,yEAAsE;AAA7D,kHAAA,cAAc,OAAA;AAEvB,mFAAsF;AAA7E,kIAAA,yBAAyB,OAAA;AAClC,4EAAwE;AAA/D,+HAAA,oBAAoB,OAAA;AAC7B,gDAG4B;AAF1B,mHAAA,sBAAsB,OAAA;AACtB,yHAAA,4BAA4B,OAAA;AAG9B,wEAGwC;AAFtC,iIAAA,wBAAwB,OAAA;AACxB,6IAAA,oCAAoC,OAAA;AAGtC,2CAIwB;AAHtB,oHAAA,wBAAwB,OAAA;AACxB,kHAAA,sBAAsB,OAAA;AACtB,oHAAA,wBAAwB,OAAA;AAE1B,kDAK+B;AAJ7B,oHAAA,wBAAwB,OAAA;AACxB,8GAAA,kBAAkB,OAAA;AAClB,yGAAA,aAAa,OAAA;AACb,+GAAA,mBAAmB,OAAA;AAGrB,kDAY6B;AAX3B,kHAAA,oBAAoB,OAAA;AACpB,uHAAA,yBAAyB,OAAA;AACzB,6HAAA,+BAA+B,OAAA;AAC/B,2HAAA,6BAA6B,OAAA;AAC7B,yHAAA,2BAA2B,OAAA;AAC3B,2HAAA,6BAA6B,OAAA;AAC7B,kHAAA,oBAAoB,OAAA;AACpB,8HAAA,gCAAgC,OAAA;AAChC,iIAAA,mCAAmC,OAAA;AACnC,+HAAA,iCAAiC,OAAA;AACjC,uHAAA,yBAAyB,OAAA;AAE3B,4CAA6C;AAApC,oGAAA,SAAS,OAAA;AAClB,gDAI4B;AAH1B,+GAAA,kBAAkB,OAAA;AAClB,oHAAA,uBAAuB,OAAA;AACvB,+GAAA,kBAAkB,OAAA;AAEpB,wDAGgC;AAF9B,wHAAA,uBAAuB,OAAA;AACvB,uHAAA,sBAAsB,OAAA;AAExB,gDAA4D;AAAnD,mHAAA,sBAAsB,OAAA;AAC/B,0DAGiC;AAF/B,8HAAA,4BAA4B,OAAA;AAC5B,gIAAA,8BAA8B,OAAA;AAEhC,8DAGmC;AAFjC,6HAAA,yBAAyB,OAAA;AACzB,6HAAA,yBAAyB,OAAA;AAE3B,yCAA+C;AAAtC,qGAAA,QAAQ,OAAA;AAAE,mGAAA,MAAM,OAAA;AACzB,sDAA4D;AAAnD,+GAAA,iBAAiB,OAAA;AAC1B,yEAA4E;AAAnE,sHAAA,mBAAmB,OAAA;AAC5B,yEAA4E;AAAnE,sHAAA,mBAAmB,OAAA;AAC5B,iFAAoF;AAA3E,8HAAA,uBAAuB,OAAA;AAChC,yEAA4E;AAAnE,sHAAA,mBAAmB,OAAA;AAC5B,oEAAgE;AAAvD,mHAAA,cAAc,OAAA;AAEvB,8DAA+D;AAAtD,sHAAA,kBAAkB,OAAA;AAC3B,gDAA4D;AAAnD,yGAAA,YAAY,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAK/B,8CAA0D;AAAjD,iHAAA,qBAAqB,OAAA;AAC9B,8DAA+D;AAAtD,sHAAA,kBAAkB,OAAA;AAC3B,iDAAwE;AAA/D,iGAAA,KAAK,OAAA;AAGd,6CA4B0B;AA3BxB,mHAAA,uBAAuB,OAAA;AACvB,8GAAA,kBAAkB,OAAA;AAClB,uGAAA,WAAW,OAAA;AACX,qGAAA,SAAS,OAAA;AACT,4GAAA,gBAAgB,OAAA;AAChB,oGAAA,QAAQ,OAAA;AACR,gHAAA,oBAAoB,OAAA;AACpB,+GAAA,mBAAmB,OAAA;AACnB,0HAAA,8BAA8B,OAAA;AAC9B,qGAAA,SAAS,OAAA;AACT,qGAAA,SAAS,OAAA;AACT,0GAAA,cAAc,OAAA;AACd,kHAAA,sBAAsB,OAAA;AACtB,0HAAA,8BAA8B,OAAA;AAC9B,kHAAA,sBAAsB,OAAA;AACtB,uGAAA,WAAW,OAAA;AACX,2GAAA,eAAe,OAAA;AACf,iIAAA,qCAAqC,OAAA;AACrC,6HAAA,iCAAiC,OAAA;AACjC,0GAAA,cAAc,OAAA;AACd,wGAAA,YAAY,OAAA;AACZ,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,gGAAA,IAAI,OAAA;AACJ,6GAAA,iBAAiB,OAAA;AACjB,qGAAA,SAAS,OAAA;AACT,oGAAA,QAAQ,OAAA","sourcesContent":["export type { Abi } from \"abitype\";\nexport type { Address, HttpTransport } from \"viem\";\nexport * as chains from \"viem/chains\";\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 { BaseSmartContractAccount } from \"./account/base.js\";\nexport { createSimpleSmartAccount } from \"./account/simple.js\";\nexport type { SimpleSmartAccount } from \"./account/simple.js\";\nexport type * from \"./account/smartContractAccount.js\";\nexport {\n getAccountAddress,\n isSmartAccountWithSigner,\n parseFactoryAddressFromAccountInitCode,\n toSmartContractAccount,\n} from \"./account/smartContractAccount.js\";\nexport type {\n BaseSmartAccountParams,\n SignTypedDataParams,\n} from \"./account/types.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 { 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 getDefaultSimpleAccountFactoryAddress,\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/cjs/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,6CAAW,CAAA;IACX,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;AACV,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,6CAAW,CAAA;IACX,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;AACV,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;AAKD,MAAa,MAAM;IAIjB,MAAM,CAAC,WAAW,CAAC,QAAkB;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAe;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAW,EAAE,GAAG,IAAW;QACtC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO;QAEjD,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,GAAG,IAAW;QACrC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO;QAEhD,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAW,EAAE,GAAG,IAAW;QACtC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO;QAEjD,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,GAAG,IAAW;QACrC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO;QAEhD,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,GAAW,EAAE,GAAG,IAAW;QACxC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO;QAEnD,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,GAAW,EAAE,KAAe;QACnD,IAAI,IAAI,CAAC,QAAQ,GAAG,KAAK;YAAE,OAAO,KAAK,CAAC;QACxC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;YAAE,OAAO,KAAK,CAAC;QAElE,OAAO,IAAI,CAAC;IACd,CAAC;;AA/CH,wBAgDC;AA/CQ;;;;WAAqB,QAAQ,CAAC,IAAI;GAAC","sourcesContent":["export enum LogLevel {\n VERBOSE = 5,\n DEBUG = 4,\n INFO = 3,\n WARN = 2,\n ERROR = 1,\n NONE = 0,\n}\n\n/**\n * 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.\n */\nexport class Logger {\n static logLevel: LogLevel = LogLevel.INFO;\n static logFilter?: string;\n\n static setLogLevel(logLevel: LogLevel) {\n this.logLevel = logLevel;\n }\n\n static setLogFilter(pattern: string) {\n this.logFilter = pattern;\n }\n\n static error(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.ERROR)) return;\n\n console.error(msg, ...args);\n }\n\n static warn(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.WARN)) return;\n\n console.warn(msg, ...args);\n }\n\n static debug(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.DEBUG)) return;\n\n console.debug(msg, ...args);\n }\n\n static info(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.INFO)) return;\n\n console.info(msg, ...args);\n }\n\n static verbose(msg: string, ...args: any[]) {\n if (!this.shouldLog(msg, LogLevel.VERBOSE)) return;\n\n console.log(msg, ...args);\n }\n\n private static shouldLog(msg: string, level: LogLevel) {\n if (this.logLevel < level) return false;\n if (this.logFilter && !msg.includes(this.logFilter)) return false;\n\n return true;\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { MiddlewareClient } from "../actions";
|
|
2
2
|
import type { ClientMiddlewareFn } from "../types";
|
|
3
|
-
export declare
|
|
3
|
+
export declare function defaultFeeEstimator<C extends MiddlewareClient>(client: C): ClientMiddlewareFn;
|
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultFeeEstimator = void 0;
|
|
4
4
|
const index_js_1 = require("../../utils/index.js");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
feeData.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
function defaultFeeEstimator(client) {
|
|
6
|
+
return async (struct, { overrides, feeOptions }) => {
|
|
7
|
+
const feeData = await client.estimateFeesPerGas();
|
|
8
|
+
if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {
|
|
9
|
+
throw new Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");
|
|
10
|
+
}
|
|
11
|
+
let maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas();
|
|
12
|
+
maxPriorityFeePerGas = (0, index_js_1.applyUserOpOverrideOrFeeOption)(maxPriorityFeePerGas, overrides?.maxPriorityFeePerGas, feeOptions?.maxPriorityFeePerGas);
|
|
13
|
+
let maxFeePerGas = feeData.maxFeePerGas -
|
|
14
|
+
feeData.maxPriorityFeePerGas +
|
|
15
|
+
BigInt(maxPriorityFeePerGas);
|
|
16
|
+
maxFeePerGas = (0, index_js_1.applyUserOpOverrideOrFeeOption)(maxFeePerGas, overrides?.maxFeePerGas, feeOptions?.maxFeePerGas);
|
|
17
|
+
struct.maxFeePerGas = maxFeePerGas;
|
|
18
|
+
struct.maxPriorityFeePerGas = maxPriorityFeePerGas;
|
|
19
|
+
return struct;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
20
22
|
exports.defaultFeeEstimator = defaultFeeEstimator;
|
|
21
23
|
//# sourceMappingURL=feeEstimator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feeEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/feeEstimator.ts"],"names":[],"mappings":";;;AACA,mDAAsE;
|
|
1
|
+
{"version":3,"file":"feeEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/feeEstimator.ts"],"names":[],"mappings":";;;AACA,mDAAsE;AAwBtE,SAAgB,mBAAmB,CACjC,MAAS;IAET,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;QAUjD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAClD,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,oBAAoB,IAAI,IAAI,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;QACJ,CAAC;QAED,IAAI,oBAAoB,GACtB,MAAM,MAAM,CAAC,4BAA4B,EAAE,CAAC;QAE9C,oBAAoB,GAAG,IAAA,yCAA8B,EACnD,oBAAoB,EACpB,SAAS,EAAE,oBAAoB,EAC/B,UAAU,EAAE,oBAAoB,CACjC,CAAC;QAEF,IAAI,YAAY,GACd,OAAO,CAAC,YAAY;YACpB,OAAO,CAAC,oBAAoB;YAC5B,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAE/B,YAAY,GAAG,IAAA,yCAA8B,EAC3C,YAAY,EACZ,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,YAAY,CACzB,CAAC;QAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;QACnC,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QACnD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AA5CD,kDA4CC","sourcesContent":["import type { BigNumberish } from \"../../types\";\nimport { applyUserOpOverrideOrFeeOption } from \"../../utils/index.js\";\nimport type { MiddlewareClient } from \"../actions\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\n/**\n * Default fee estimator middleware function that estimates the maximum fee per gas and maximum priority fee per gas for a given client and applies the necessary overrides and fee options.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient, defaultFeeEstimator, createBundlerClient } from \"@aa-sdk/core\";\n *\n * const bundlerClient = createBundlerClient(...);\n *\n * // NOTE: this is already provided by the smart account client\n * const client = createSmartAccountClient({\n * feeEstimator: defaultFeeEstimator(bundlerClient),\n * ...otherParams\n * });\n * ```\n *\n * @template {MiddlewareClient} C The type of the client\n * @param {C} client The client to perform the fee estimation\n * @returns {ClientMiddlewareFn} A middleware function that takes in the struct and options, estimates the fees, and updates the struct with the estimated fees\n */\nexport function defaultFeeEstimator<C extends MiddlewareClient>(\n client: C\n): ClientMiddlewareFn {\n return async (struct, { overrides, feeOptions }) => {\n // maxFeePerGas must be at least the sum of maxPriorityFeePerGas and baseFee\n // so we need to accommodate for the fee option applied maxPriorityFeePerGas for the maxFeePerGas\n //\n // Note that if maxFeePerGas is not at least the sum of maxPriorityFeePerGas and required baseFee\n // after applying the fee options, then the transaction will fail\n //\n // Refer to https://docs.alchemy.com/docs/maxpriorityfeepergas-vs-maxfeepergas\n // for more information about maxFeePerGas and maxPriorityFeePerGas\n\n const feeData = await client.estimateFeesPerGas();\n if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {\n throw new Error(\n \"feeData is missing maxFeePerGas or maxPriorityFeePerGas\"\n );\n }\n\n let maxPriorityFeePerGas: BigNumberish =\n await client.estimateMaxPriorityFeePerGas();\n\n maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(\n maxPriorityFeePerGas,\n overrides?.maxPriorityFeePerGas,\n feeOptions?.maxPriorityFeePerGas\n );\n\n let maxFeePerGas: BigNumberish =\n feeData.maxFeePerGas -\n feeData.maxPriorityFeePerGas +\n BigInt(maxPriorityFeePerGas);\n\n maxFeePerGas = applyUserOpOverrideOrFeeOption(\n maxFeePerGas,\n overrides?.maxFeePerGas,\n feeOptions?.maxFeePerGas\n );\n\n struct.maxFeePerGas = maxFeePerGas;\n struct.maxPriorityFeePerGas = maxPriorityFeePerGas;\n return struct;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymasterAndData.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/paymasterAndData.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"paymasterAndData.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/paymasterAndData.ts"],"names":[],"mappings":";;;AAWO,MAAM,uBAAuB,GAAuB,KAAK,EAC9D,MAAM,EACN,EAAE,OAAO,EAAE,EACX,EAAE;IACF,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAC3C,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAClC,MAAuC,CAAC,gBAAgB,GAAG,IAAI,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AATW,QAAA,uBAAuB,2BASlC","sourcesContent":["import type { UserOperationStruct } from \"../../types\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\n/**\n * Middleware function that sets the `paymasterAndData` field in the given struct based on the entry point version of the account.\n * This is the default used by `createSmartAccountClient` and is not necessary to be used directly.\n *\n * @param {UserOperationStruct} struct the user operation structure to be modified\n * @param {{ account: Account }} context an object containing the account information\n * @returns {Promise<UserOperationStruct>} a promise that resolves to the modified user operation structure\n */\nexport const defaultPaymasterAndData: ClientMiddlewareFn = async (\n struct,\n { account }\n) => {\n const entryPoint = account.getEntryPoint();\n if (entryPoint.version === \"0.6.0\") {\n (struct as UserOperationStruct<\"0.6.0\">).paymasterAndData = \"0x\";\n }\n return struct;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userOpSigner.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/userOpSigner.ts"],"names":[],"mappings":";;;AAAA,wDAA+D;AAC/D,sDAA4D;AAC5D,oEAA0E;AAC1E,mDAI8B;
|
|
1
|
+
{"version":3,"file":"userOpSigner.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/userOpSigner.ts"],"names":[],"mappings":";;;AAAA,wDAA+D;AAC/D,sDAA4D;AAC5D,oEAA0E;AAC1E,mDAI8B;AAavB,MAAM,mBAAmB,GAAuB,KAAK,EAC1D,MAAM,EACN,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EACpC,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,iCAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,8BAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,IAAA,4BAAiB,EAAC,MAAM,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAA,sBAAW,EAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAA,yBAAc,EAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,4CAAyB,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,OAAO;QACL,GAAG,cAAc;QACjB,SAAS,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAC5C,OAAO,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CACtD;KACF,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,mBAAmB,uBAwB9B","sourcesContent":["import { AccountNotFoundError } from \"../../errors/account.js\";\nimport { ChainNotFoundError } from \"../../errors/client.js\";\nimport { InvalidUserOperationError } from \"../../errors/useroperation.js\";\nimport {\n deepHexlify,\n isValidRequest,\n resolveProperties,\n} from \"../../utils/index.js\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\n/**\n * Provides a default middleware function for signing user operations with a client account. This function validates the request and adds the signature to it.\n * This is already included in the client returned from `createSmartAccountClient`\n *\n * @param {UserOperationStruct} struct The user operation structure to be signed\n * @param {*} context The middleware context containing the client and account information\n * @param {Client} context.client The client object, which should include account and chain information\n * @param {Account} [context.account] Optional, the account used for signing, defaults to the client's account if not provided\n * @returns {Promise<UserOperationStruct>} A promise that resolves to the signed user operation structure\n */\nexport const defaultUserOpSigner: ClientMiddlewareFn = async (\n struct,\n { client, account = client.account }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!client?.chain) {\n throw new ChainNotFoundError();\n }\n\n const resolvedStruct = await resolveProperties(struct);\n const request = deepHexlify(resolvedStruct);\n if (!isValidRequest(request)) {\n throw new InvalidUserOperationError(resolvedStruct);\n }\n\n return {\n ...resolvedStruct,\n signature: await account.signUserOperationHash(\n account.getEntryPoint().getUserOperationHash(request)\n ),\n };\n};\n"]}
|
|
@@ -32,13 +32,13 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
|
|
|
32
32
|
[x: `bytes9[${string}]`]: undefined;
|
|
33
33
|
[x: `bytes10[${string}]`]: undefined;
|
|
34
34
|
[x: `bytes25[${string}]`]: undefined;
|
|
35
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
36
35
|
[x: `bytes12[${string}]`]: undefined;
|
|
37
36
|
[x: `bytes13[${string}]`]: undefined;
|
|
38
37
|
[x: `bytes14[${string}]`]: undefined;
|
|
39
38
|
[x: `bytes15[${string}]`]: undefined;
|
|
40
39
|
[x: `bytes16[${string}]`]: undefined;
|
|
41
40
|
[x: `bytes17[${string}]`]: undefined;
|
|
41
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
42
42
|
[x: `bytes19[${string}]`]: undefined;
|
|
43
43
|
[x: `bytes20[${string}]`]: undefined;
|
|
44
44
|
[x: `bytes21[${string}]`]: undefined;
|
|
@@ -134,13 +134,13 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
|
|
|
134
134
|
bytes9?: undefined;
|
|
135
135
|
bytes10?: undefined;
|
|
136
136
|
bytes25?: undefined;
|
|
137
|
-
bytes18?: undefined;
|
|
138
137
|
bytes12?: undefined;
|
|
139
138
|
bytes13?: undefined;
|
|
140
139
|
bytes14?: undefined;
|
|
141
140
|
bytes15?: undefined;
|
|
142
141
|
bytes16?: undefined;
|
|
143
142
|
bytes17?: undefined;
|
|
143
|
+
bytes18?: undefined;
|
|
144
144
|
bytes19?: undefined;
|
|
145
145
|
bytes20?: undefined;
|
|
146
146
|
bytes21?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-account.js","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":";;;AAUA,4CAAuE;
|
|
1
|
+
{"version":3,"file":"local-account.js","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":";;;AAUA,4CAAuE;AAMvE,MAAa,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,IAAA,4BAAiB,EAAC,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,IAAA,8BAAmB,EAAC,GAAG,CAAC,CAAC;QACxC,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF;AA7CD,gDA6CC","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\n/**\n * Represents a local account signer and provides methods to sign messages and transactions, as well as static methods to create the signer from mnemonic or private key.\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/signer/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/signer/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAiBjB,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;AAVW,QAAA,QAAQ,YAUnB;AAEW,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,CAAqB,gBAAQ,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { SmartAccountSigner } from \"./types\";\n\n/**\n * Checks if the provided object is a `SmartAccountSigner`.\n *\n * @example\n * ```ts\n * import { isSigner, LocalAccountSigner } from \"@aa-sdk/core\";\n *\n * const signer = new LocalAccountSigner(...);\n * console.log(isSigner(signer)); // true\n * ```\n *\n * @param {any} signer the object to check\n * @returns {boolean} A boolean indicating whether the object is a `SmartAccountSigner`\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"]}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import { type Address, type Hash, type Hex
|
|
1
|
+
import { type Address, type Hash, type Hex } from "viem";
|
|
2
2
|
export type SignWith6492Params = {
|
|
3
3
|
factoryAddress: Address;
|
|
4
4
|
factoryCalldata: Hex;
|
|
5
5
|
signature: Hash;
|
|
6
6
|
};
|
|
7
|
-
type VerifyEIP6492SignatureParams = {
|
|
8
|
-
signer: Address;
|
|
9
|
-
hash: Hash;
|
|
10
|
-
signature: Hash;
|
|
11
|
-
client: PublicClient;
|
|
12
|
-
};
|
|
13
7
|
export declare const wrapSignatureWith6492: ({ factoryAddress, factoryCalldata, signature, }: SignWith6492Params) => Hash;
|
|
14
|
-
export declare const verifyEIP6492Signature: ({ signer, hash, signature, client, }: VerifyEIP6492SignatureParams) => Promise<boolean>;
|
|
15
|
-
export {};
|
package/dist/cjs/signer/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.wrapSignatureWith6492 = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const wrapSignatureWith6492 = ({ factoryAddress, factoryCalldata, signature, }) => {
|
|
6
6
|
return (0, viem_1.concat)([
|
|
@@ -13,19 +13,4 @@ const wrapSignatureWith6492 = ({ factoryAddress, factoryCalldata, signature, })
|
|
|
13
13
|
]);
|
|
14
14
|
};
|
|
15
15
|
exports.wrapSignatureWith6492 = wrapSignatureWith6492;
|
|
16
|
-
const universalValidatorByteCode = "0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
|
|
17
|
-
const verifyEIP6492Signature = async ({ signer, hash, signature, client, }) => {
|
|
18
|
-
const result = await client.call({
|
|
19
|
-
data: (0, viem_1.concat)([
|
|
20
|
-
universalValidatorByteCode,
|
|
21
|
-
(0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, bytes32, bytes"), [
|
|
22
|
-
signer,
|
|
23
|
-
hash,
|
|
24
|
-
signature,
|
|
25
|
-
]),
|
|
26
|
-
]),
|
|
27
|
-
});
|
|
28
|
-
return result.data === "0x01";
|
|
29
|
-
};
|
|
30
|
-
exports.verifyEIP6492Signature = verifyEIP6492Signature;
|
|
31
16
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/signer/utils.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/signer/utils.ts"],"names":[],"mappings":";;;AAAA,+BAOc;AA4BP,MAAM,qBAAqB,GAAG,CAAC,EACpC,cAAc,EACd,eAAe,EACf,SAAS,GACU,EAAQ,EAAE;IAQ7B,OAAO,IAAA,aAAM,EAAC;QACZ,IAAA,0BAAmB,EAAC,IAAA,yBAAkB,EAAC,uBAAuB,CAAC,EAAE;YAC/D,cAAc;YACd,eAAe;YACf,SAAS;SACV,CAAC;QACF,oEAAoE;KACrE,CAAC,CAAC;AACL,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC","sourcesContent":["import {\n concat,\n encodeAbiParameters,\n parseAbiParameters,\n type Address,\n type Hash,\n type Hex,\n} from \"viem\";\n\nexport type SignWith6492Params = {\n factoryAddress: Address;\n factoryCalldata: Hex;\n signature: Hash;\n};\n\n/**\n * Wraps a given signature with additional data following the EIP-6492 standard.\n *\n * @example\n * ```ts\n * import { wrapSignatureWith6492 } from \"@aa-sdk/core\";\n *\n * const signature = wrapSignatureWith6492({\n * factoryAddress: \"0x...\",\n * factoryCalldata: \"0x...\",\n * signature: \"0x...\",\n * });\n * ```\n *\n * @param {SignWith6492Params} params The parameters to wrap the signature\n * @param {Hex} params.factoryAddress The address of the factory\n * @param {Hex} params.factoryCalldata The calldata for the factory\n * @param {Hex} params.signature The original signature that needs to be wrapped\n * @returns {Hash} The wrapped signature\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"]}
|