@aa-sdk/core 4.0.0-alpha.0 → 4.0.0-alpha.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.
Files changed (169) hide show
  1. package/dist/cjs/account/simple.js.map +1 -1
  2. package/dist/cjs/account/smartContractAccount.js +2 -1
  3. package/dist/cjs/account/smartContractAccount.js.map +1 -1
  4. package/dist/cjs/actions/smartAccount/buildUserOperation.js.map +1 -1
  5. package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
  6. package/dist/cjs/actions/smartAccount/sendTransaction.js.map +1 -1
  7. package/dist/cjs/actions/smartAccount/sendTransactions.js.map +1 -1
  8. package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
  9. package/dist/cjs/client/bundlerClient.js.map +1 -1
  10. package/dist/cjs/client/decorators/bundlerClient.js.map +1 -1
  11. package/dist/cjs/client/decorators/smartAccountClient.js.map +1 -1
  12. package/dist/cjs/client/smartAccountClient.js.map +1 -1
  13. package/dist/cjs/ens/utils.js.map +1 -1
  14. package/dist/cjs/entrypoint/index.js.map +1 -1
  15. package/dist/cjs/errors/account.js.map +1 -1
  16. package/dist/cjs/errors/base.js.map +1 -1
  17. package/dist/cjs/errors/client.js.map +1 -1
  18. package/dist/cjs/errors/entrypoint.js.map +1 -1
  19. package/dist/cjs/errors/signer.js.map +1 -1
  20. package/dist/cjs/errors/transaction.js.map +1 -1
  21. package/dist/cjs/index.d.ts +2 -2
  22. package/dist/cjs/index.js +2 -4
  23. package/dist/cjs/index.js.map +1 -1
  24. package/dist/cjs/logger.js.map +1 -1
  25. package/dist/cjs/middleware/defaults/feeEstimator.d.ts +1 -1
  26. package/dist/cjs/middleware/defaults/feeEstimator.js +17 -15
  27. package/dist/cjs/middleware/defaults/feeEstimator.js.map +1 -1
  28. package/dist/cjs/middleware/defaults/paymasterAndData.js.map +1 -1
  29. package/dist/cjs/middleware/defaults/userOpSigner.js.map +1 -1
  30. package/dist/cjs/signer/local-account.js.map +1 -1
  31. package/dist/cjs/signer/schema.js.map +1 -1
  32. package/dist/cjs/signer/utils.d.ts +1 -9
  33. package/dist/cjs/signer/utils.js +1 -16
  34. package/dist/cjs/signer/utils.js.map +1 -1
  35. package/dist/cjs/signer/wallet-client.js.map +1 -1
  36. package/dist/cjs/utils/index.d.ts +0 -1
  37. package/dist/cjs/utils/index.js +1 -9
  38. package/dist/cjs/utils/index.js.map +1 -1
  39. package/dist/cjs/version.d.ts +1 -1
  40. package/dist/cjs/version.js +1 -1
  41. package/dist/cjs/version.js.map +1 -1
  42. package/dist/esm/account/simple.js.map +1 -1
  43. package/dist/esm/account/smartContractAccount.js +2 -1
  44. package/dist/esm/account/smartContractAccount.js.map +1 -1
  45. package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -1
  46. package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
  47. package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
  48. package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
  49. package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
  50. package/dist/esm/client/bundlerClient.js.map +1 -1
  51. package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
  52. package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
  53. package/dist/esm/client/smartAccountClient.js.map +1 -1
  54. package/dist/esm/ens/utils.js.map +1 -1
  55. package/dist/esm/entrypoint/index.js.map +1 -1
  56. package/dist/esm/errors/account.js.map +1 -1
  57. package/dist/esm/errors/base.js.map +1 -1
  58. package/dist/esm/errors/client.js.map +1 -1
  59. package/dist/esm/errors/entrypoint.js.map +1 -1
  60. package/dist/esm/errors/signer.js.map +1 -1
  61. package/dist/esm/errors/transaction.js.map +1 -1
  62. package/dist/esm/index.d.ts +2 -2
  63. package/dist/esm/index.js +2 -2
  64. package/dist/esm/index.js.map +1 -1
  65. package/dist/esm/logger.js.map +1 -1
  66. package/dist/esm/middleware/defaults/feeEstimator.d.ts +1 -1
  67. package/dist/esm/middleware/defaults/feeEstimator.js +17 -15
  68. package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
  69. package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
  70. package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
  71. package/dist/esm/signer/local-account.js.map +1 -1
  72. package/dist/esm/signer/schema.js.map +1 -1
  73. package/dist/esm/signer/utils.d.ts +1 -9
  74. package/dist/esm/signer/utils.js +0 -14
  75. package/dist/esm/signer/utils.js.map +1 -1
  76. package/dist/esm/signer/wallet-client.js.map +1 -1
  77. package/dist/esm/utils/index.d.ts +0 -1
  78. package/dist/esm/utils/index.js +0 -7
  79. package/dist/esm/utils/index.js.map +1 -1
  80. package/dist/esm/version.d.ts +1 -1
  81. package/dist/esm/version.js +1 -1
  82. package/dist/esm/version.js.map +1 -1
  83. package/dist/types/account/smartContractAccount.d.ts +49 -0
  84. package/dist/types/account/smartContractAccount.d.ts.map +1 -1
  85. package/dist/types/actions/smartAccount/buildUserOperation.d.ts +23 -0
  86. package/dist/types/actions/smartAccount/buildUserOperation.d.ts.map +1 -1
  87. package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts +22 -0
  88. package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
  89. package/dist/types/actions/smartAccount/sendTransaction.d.ts +24 -0
  90. package/dist/types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
  91. package/dist/types/actions/smartAccount/sendTransactions.d.ts +23 -0
  92. package/dist/types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
  93. package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts +24 -0
  94. package/dist/types/actions/smartAccount/waitForUserOperationTransacation.d.ts.map +1 -1
  95. package/dist/types/client/bundlerClient.d.ts +15 -0
  96. package/dist/types/client/bundlerClient.d.ts.map +1 -1
  97. package/dist/types/client/decorators/bundlerClient.d.ts +9 -0
  98. package/dist/types/client/decorators/bundlerClient.d.ts.map +1 -1
  99. package/dist/types/client/decorators/smartAccountClient.d.ts +8 -0
  100. package/dist/types/client/decorators/smartAccountClient.d.ts.map +1 -1
  101. package/dist/types/client/smartAccountClient.d.ts.map +1 -1
  102. package/dist/types/ens/utils.d.ts +45 -0
  103. package/dist/types/ens/utils.d.ts.map +1 -1
  104. package/dist/types/entrypoint/index.d.ts +14 -0
  105. package/dist/types/entrypoint/index.d.ts.map +1 -1
  106. package/dist/types/errors/account.d.ts +34 -0
  107. package/dist/types/errors/account.d.ts.map +1 -1
  108. package/dist/types/errors/base.d.ts +5 -0
  109. package/dist/types/errors/base.d.ts.map +1 -1
  110. package/dist/types/errors/client.d.ts +9 -0
  111. package/dist/types/errors/client.d.ts.map +1 -1
  112. package/dist/types/errors/entrypoint.d.ts +6 -0
  113. package/dist/types/errors/entrypoint.d.ts.map +1 -1
  114. package/dist/types/errors/signer.d.ts +3 -0
  115. package/dist/types/errors/signer.d.ts.map +1 -1
  116. package/dist/types/errors/transaction.d.ts +6 -0
  117. package/dist/types/errors/transaction.d.ts.map +1 -1
  118. package/dist/types/index.d.ts +2 -2
  119. package/dist/types/index.d.ts.map +1 -1
  120. package/dist/types/logger.d.ts +3 -0
  121. package/dist/types/logger.d.ts.map +1 -1
  122. package/dist/types/middleware/defaults/feeEstimator.d.ts +21 -1
  123. package/dist/types/middleware/defaults/feeEstimator.d.ts.map +1 -1
  124. package/dist/types/middleware/defaults/paymasterAndData.d.ts +8 -0
  125. package/dist/types/middleware/defaults/paymasterAndData.d.ts.map +1 -1
  126. package/dist/types/middleware/defaults/userOpSigner.d.ts +10 -0
  127. package/dist/types/middleware/defaults/userOpSigner.d.ts.map +1 -1
  128. package/dist/types/signer/local-account.d.ts +3 -0
  129. package/dist/types/signer/local-account.d.ts.map +1 -1
  130. package/dist/types/signer/schema.d.ts +14 -0
  131. package/dist/types/signer/schema.d.ts.map +1 -1
  132. package/dist/types/signer/utils.d.ts +21 -9
  133. package/dist/types/signer/utils.d.ts.map +1 -1
  134. package/dist/types/signer/wallet-client.d.ts +3 -0
  135. package/dist/types/signer/wallet-client.d.ts.map +1 -1
  136. package/dist/types/utils/index.d.ts +54 -1
  137. package/dist/types/utils/index.d.ts.map +1 -1
  138. package/dist/types/version.d.ts +1 -1
  139. package/package.json +2 -2
  140. package/src/account/simple.ts +6 -0
  141. package/src/account/smartContractAccount.ts +120 -15
  142. package/src/actions/smartAccount/buildUserOperation.ts +23 -0
  143. package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +22 -0
  144. package/src/actions/smartAccount/sendTransaction.ts +24 -0
  145. package/src/actions/smartAccount/sendTransactions.ts +23 -0
  146. package/src/actions/smartAccount/waitForUserOperationTransacation.ts +24 -0
  147. package/src/client/bundlerClient.ts +32 -0
  148. package/src/client/decorators/bundlerClient.ts +9 -0
  149. package/src/client/decorators/smartAccountClient.ts +8 -0
  150. package/src/client/smartAccountClient.ts +41 -0
  151. package/src/ens/utils.ts +45 -0
  152. package/src/entrypoint/index.ts +30 -62
  153. package/src/errors/account.ts +34 -0
  154. package/src/errors/base.ts +5 -2
  155. package/src/errors/client.ts +9 -0
  156. package/src/errors/entrypoint.ts +6 -0
  157. package/src/errors/signer.ts +3 -0
  158. package/src/errors/transaction.ts +6 -0
  159. package/src/index.ts +1 -5
  160. package/src/logger.ts +3 -0
  161. package/src/middleware/defaults/feeEstimator.ts +24 -4
  162. package/src/middleware/defaults/paymasterAndData.ts +8 -0
  163. package/src/middleware/defaults/userOpSigner.ts +10 -0
  164. package/src/signer/local-account.ts +3 -0
  165. package/src/signer/schema.ts +14 -0
  166. package/src/signer/utils.ts +20 -32
  167. package/src/signer/wallet-client.ts +3 -0
  168. package/src/utils/index.ts +54 -13
  169. package/src/version.ts +1 -1
@@ -55,9 +55,9 @@ export type * from "./middleware/types.js";
55
55
  export { LocalAccountSigner } from "./signer/local-account.js";
56
56
  export { SignerSchema, isSigner } from "./signer/schema.js";
57
57
  export type { SmartAccountAuthenticator, SmartAccountSigner, } from "./signer/types.js";
58
- export { verifyEIP6492Signature, wrapSignatureWith6492, } from "./signer/utils.js";
58
+ export { wrapSignatureWith6492 } from "./signer/utils.js";
59
59
  export { WalletClientSigner } from "./signer/wallet-client.js";
60
60
  export { split, type SplitTransportParams } from "./transport/split.js";
61
61
  export type * from "./types.js";
62
62
  export type * from "./utils/index.js";
63
- export { AlchemyChainMap, BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, defineReadOnly, filterUndefined, getChain, getDefaultSimpleAccountFactoryAddress, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
63
+ export { AlchemyChainMap, BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, filterUndefined, getChain, getDefaultSimpleAccountFactoryAddress, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
package/dist/esm/index.js CHANGED
@@ -41,8 +41,8 @@ export { defaultUserOpSigner } from "./middleware/defaults/userOpSigner.js";
41
41
  export { noopMiddleware } from "./middleware/noopMiddleware.js";
42
42
  export { LocalAccountSigner } from "./signer/local-account.js";
43
43
  export { SignerSchema, isSigner } from "./signer/schema.js";
44
- export { verifyEIP6492Signature, wrapSignatureWith6492, } from "./signer/utils.js";
44
+ export { wrapSignatureWith6492 } from "./signer/utils.js";
45
45
  export { WalletClientSigner } from "./signer/wallet-client.js";
46
46
  export { split } from "./transport/split.js";
47
- export { AlchemyChainMap, BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, defineReadOnly, filterUndefined, getChain, getDefaultSimpleAccountFactoryAddress, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
47
+ export { AlchemyChainMap, BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema, allEqual, applyUserOpFeeOption, applyUserOpOverride, applyUserOpOverrideOrFeeOption, asyncPipe, bigIntMax, bigIntMultiply, bypassPaymasterAndData, bypassPaymasterAndDataEmptyHex, concatPaymasterAndData, deepHexlify, filterUndefined, getChain, getDefaultSimpleAccountFactoryAddress, getDefaultUserOperationFeeOptions, isBigNumberish, isMultiplier, isValidRequest, parsePaymasterAndData, pick, resolveProperties, takeBytes, toRecord, } from "./utils/index.js";
48
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,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;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OA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AE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK5D,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,KAAK,EAA6B,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EACL,eAAe,EACf,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,cAAc,EACd,eAAe,EACf,QAAQ,EACR,qCAAqC,EACrC,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\";\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 {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"./chains/index.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 {\n verifyEIP6492Signature,\n wrapSignatureWith6492,\n} 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 AlchemyChainMap,\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 defineReadOnly,\n filterUndefined,\n getChain,\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,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;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,sCAAsC,EACtC,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;A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,oBAAoB,EACpB,mBAAmB,EACnB,8BAA8B,EAC9B,SAAS,EACT,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,QAAQ,EACR,qCAAqC,EACrC,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\";\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 {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"./chains/index.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 AlchemyChainMap,\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 getChain,\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,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,KAAR,QAAQ,QAOnB;AAED,MAAM,OAAO,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;;AA9CM;;;;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\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
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,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,KAAR,QAAQ,QAOnB;AAKD,MAAM,OAAO,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;;AA9CM;;;;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 const defaultFeeEstimator: <C extends MiddlewareClient>(client: C) => ClientMiddlewareFn;
3
+ export declare function defaultFeeEstimator<C extends MiddlewareClient>(client: C): ClientMiddlewareFn;
@@ -1,17 +1,19 @@
1
1
  import { applyUserOpOverrideOrFeeOption } from "../../utils/index.js";
2
- export const defaultFeeEstimator = (client) => async (struct, { overrides, feeOptions }) => {
3
- const feeData = await client.estimateFeesPerGas();
4
- if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {
5
- throw new Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");
6
- }
7
- let maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas();
8
- maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(maxPriorityFeePerGas, overrides?.maxPriorityFeePerGas, feeOptions?.maxPriorityFeePerGas);
9
- let maxFeePerGas = feeData.maxFeePerGas -
10
- feeData.maxPriorityFeePerGas +
11
- BigInt(maxPriorityFeePerGas);
12
- maxFeePerGas = applyUserOpOverrideOrFeeOption(maxFeePerGas, overrides?.maxFeePerGas, feeOptions?.maxFeePerGas);
13
- struct.maxFeePerGas = maxFeePerGas;
14
- struct.maxPriorityFeePerGas = maxPriorityFeePerGas;
15
- return struct;
16
- };
2
+ export function defaultFeeEstimator(client) {
3
+ return async (struct, { overrides, feeOptions }) => {
4
+ const feeData = await client.estimateFeesPerGas();
5
+ if (!feeData.maxFeePerGas || feeData.maxPriorityFeePerGas == null) {
6
+ throw new Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");
7
+ }
8
+ let maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas();
9
+ maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(maxPriorityFeePerGas, overrides?.maxPriorityFeePerGas, feeOptions?.maxPriorityFeePerGas);
10
+ let maxFeePerGas = feeData.maxFeePerGas -
11
+ feeData.maxPriorityFeePerGas +
12
+ BigInt(maxPriorityFeePerGas);
13
+ maxFeePerGas = applyUserOpOverrideOrFeeOption(maxFeePerGas, overrides?.maxFeePerGas, feeOptions?.maxFeePerGas);
14
+ struct.maxFeePerGas = maxFeePerGas;
15
+ struct.maxPriorityFeePerGas = maxPriorityFeePerGas;
16
+ return struct;
17
+ };
18
+ }
17
19
  //# sourceMappingURL=feeEstimator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"feeEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/feeEstimator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAItE,MAAM,CAAC,MAAM,mBAAmB,GAG9B,CAAC,MAAM,EAAE,EAAE,CACX,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;IAU1C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAClD,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,oBAAoB,IAAI,IAAI,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,IAAI,oBAAoB,GACtB,MAAM,MAAM,CAAC,4BAA4B,EAAE,CAAC;IAE9C,oBAAoB,GAAG,8BAA8B,CACnD,oBAAoB,EACpB,SAAS,EAAE,oBAAoB,EAC/B,UAAU,EAAE,oBAAoB,CACjC,CAAC;IAEF,IAAI,YAAY,GACd,OAAO,CAAC,YAAY;QACpB,OAAO,CAAC,oBAAoB;QAC5B,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAE/B,YAAY,GAAG,8BAA8B,CAC3C,YAAY,EACZ,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,YAAY,CACzB,CAAC;IAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import type { BigNumberish } from \"../../types\";\nimport { applyUserOpOverrideOrFeeOption } from \"../../utils/index.js\";\nimport type { MiddlewareClient } from \"../actions\";\nimport type { ClientMiddlewareFn } from \"../types\";\n\nexport const defaultFeeEstimator: <C extends MiddlewareClient>(\n client: C\n) => ClientMiddlewareFn =\n (client) =>\n 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"]}
1
+ {"version":3,"file":"feeEstimator.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/feeEstimator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAwBtE,MAAM,UAAU,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,8BAA8B,CACnD,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,8BAA8B,CAC3C,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","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":"AAGA,MAAM,CAAC,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","sourcesContent":["import type { UserOperationStruct } from \"../../types\";\nimport type { ClientMiddlewareFn } from \"../types\";\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
+ {"version":3,"file":"paymasterAndData.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/paymasterAndData.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,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","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,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,CAAC,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,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,yBAAyB,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","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\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"]}
1
+ {"version":3,"file":"userOpSigner.js","sourceRoot":"","sources":["../../../../src/middleware/defaults/userOpSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAa9B,MAAM,CAAC,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,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,yBAAyB,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","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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"local-account.js","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":"AAAA,OAAO,EASN,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGvE,MAAM,OAAO,kBAAkB;IAO7B,YAAY,KAAQ;QAHpB;;;;;WAAS;QACT;;;;;WAAmB;QAOV;;;;mBAAoE,CAC3E,OAAO,EACP,EAAE;gBACF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7C,CAAC;WAAC;QAEO;;;;mBAAgB,KAAK,EAI5B,MAAqD,EACvC,EAAE;gBAChB,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC;WAAC;QAEO;;;;mBAA2C,KAAK,IAAI,EAAE;gBAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,CAAC;WAAC;QArBA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;IAC/B,CAAC;IAqBD,MAAM,CAAC,uBAAuB,CAC5B,GAAW,EACX,IAAgB;QAEhB,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5C,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,yBAAyB,CAC9B,GAAQ;QAER,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import {\n type HDAccount,\n type HDOptions,\n type Hex,\n type LocalAccount,\n type PrivateKeyAccount,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n} from \"viem\";\nimport { mnemonicToAccount, privateKeyToAccount } from \"viem/accounts\";\nimport type { SmartAccountSigner } from \"./types.js\";\n\nexport class LocalAccountSigner<\n T extends HDAccount | PrivateKeyAccount | LocalAccount\n> implements SmartAccountSigner<T>\n{\n inner: T;\n signerType: string;\n\n constructor(inner: T) {\n this.inner = inner;\n this.signerType = inner.type; // type: \"local\"\n }\n\n readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> = (\n message\n ) => {\n return this.inner.signMessage({ message });\n };\n\n readonly signTypedData = async <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n params: TypedDataDefinition<TTypedData, TPrimaryType>\n ): Promise<Hex> => {\n return this.inner.signTypedData(params);\n };\n\n readonly getAddress: () => Promise<`0x${string}`> = async () => {\n return this.inner.address;\n };\n\n static mnemonicToAccountSigner(\n key: string,\n opts?: HDOptions\n ): LocalAccountSigner<HDAccount> {\n const signer = mnemonicToAccount(key, opts);\n return new LocalAccountSigner(signer);\n }\n\n static privateKeyToAccountSigner(\n key: Hex\n ): LocalAccountSigner<PrivateKeyAccount> {\n const signer = privateKeyToAccount(key);\n return new LocalAccountSigner(signer);\n }\n}\n"]}
1
+ {"version":3,"file":"local-account.js","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":"AAAA,OAAO,EASN,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAMvE,MAAM,OAAO,kBAAkB;IAO7B,YAAY,KAAQ;QAHpB;;;;;WAAS;QACT;;;;;WAAmB;QAOV;;;;mBAAoE,CAC3E,OAAO,EACP,EAAE;gBACF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7C,CAAC;WAAC;QAEO;;;;mBAAgB,KAAK,EAI5B,MAAqD,EACvC,EAAE;gBAChB,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC;WAAC;QAEO;;;;mBAA2C,KAAK,IAAI,EAAE;gBAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,CAAC;WAAC;QArBA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;IAC/B,CAAC;IAqBD,MAAM,CAAC,uBAAuB,CAC5B,GAAW,EACX,IAAgB;QAEhB,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5C,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,yBAAyB,CAC9B,GAAQ;QAER,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import {\n type HDAccount,\n type HDOptions,\n type Hex,\n type LocalAccount,\n type PrivateKeyAccount,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n} from \"viem\";\nimport { mnemonicToAccount, privateKeyToAccount } from \"viem/accounts\";\nimport type { SmartAccountSigner } from \"./types.js\";\n\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,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAW,EAAgC,EAAE;IACpE,OAAO,CACL,MAAM,IAAI,IAAI;QACd,OAAO,MAAM,KAAK,QAAQ;QAC1B,YAAY,IAAI,MAAM;QACtB,aAAa,IAAI,MAAM;QACvB,eAAe,IAAI,MAAM;QACzB,YAAY,IAAI,MAAM;QACtB,OAAO,IAAI,MAAM,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAqB,QAAQ,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { SmartAccountSigner } from \"./types\";\n\nexport const isSigner = (signer: any): signer is SmartAccountSigner => {\n return (\n signer != null &&\n typeof signer === \"object\" &&\n \"signerType\" in signer &&\n \"signMessage\" in signer &&\n \"signTypedData\" in signer &&\n \"getAddress\" in signer &&\n \"inner\" in signer\n );\n};\n\nexport const SignerSchema = z.custom<SmartAccountSigner>(isSigner);\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/signer/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAW,EAAgC,EAAE;IACpE,OAAO,CACL,MAAM,IAAI,IAAI;QACd,OAAO,MAAM,KAAK,QAAQ;QAC1B,YAAY,IAAI,MAAM;QACtB,aAAa,IAAI,MAAM;QACvB,eAAe,IAAI,MAAM;QACzB,YAAY,IAAI,MAAM;QACtB,OAAO,IAAI,MAAM,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAqB,QAAQ,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { SmartAccountSigner } from \"./types\";\n\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, type PublicClient } from "viem";
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 {};
@@ -9,18 +9,4 @@ export const wrapSignatureWith6492 = ({ factoryAddress, factoryCalldata, signatu
9
9
  "0x6492649264926492649264926492649264926492649264926492649264926492",
10
10
  ]);
11
11
  };
12
- const universalValidatorByteCode = "0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
13
- export const verifyEIP6492Signature = async ({ signer, hash, signature, client, }) => {
14
- const result = await client.call({
15
- data: concat([
16
- universalValidatorByteCode,
17
- encodeAbiParameters(parseAbiParameters("address, bytes32, bytes"), [
18
- signer,
19
- hash,
20
- signature,
21
- ]),
22
- ]),
23
- });
24
- return result.data === "0x01";
25
- };
26
12
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/signer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,kBAAkB,GAKnB,MAAM,MAAM,CAAC;AAed,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACpC,cAAc,EACd,eAAe,EACf,SAAS,GACU,EAAQ,EAAE;IAQ7B,OAAO,MAAM,CAAC;QACZ,mBAAmB,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,EAAE;YAC/D,cAAc;YACd,eAAe;YACf,SAAS;SACV,CAAC;QACF,oEAAoE;KACrE,CAAC,CAAC;AACL,CAAC,CAAC;AAGF,MAAM,0BAA0B,GAC9B,ogHAAogH,CAAC;AAEvgH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAAE,EAC3C,MAAM,EACN,IAAI,EACJ,SAAS,EACT,MAAM,GACuB,EAAoB,EAAE;IACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;QAC/B,IAAI,EAAE,MAAM,CAAC;YACX,0BAA0B;YAC1B,mBAAmB,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,EAAE;gBACjE,MAAM;gBACN,IAAI;gBACJ,SAAS;aACV,CAAC;SACH,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC;AAChC,CAAC,CAAC","sourcesContent":["import {\n concat,\n encodeAbiParameters,\n parseAbiParameters,\n type Address,\n type Hash,\n type Hex,\n type PublicClient,\n} from \"viem\";\n\nexport type SignWith6492Params = {\n factoryAddress: Address;\n factoryCalldata: Hex;\n signature: Hash;\n};\n\ntype VerifyEIP6492SignatureParams = {\n signer: Address;\n hash: Hash;\n signature: Hash;\n client: PublicClient;\n};\n\nexport const wrapSignatureWith6492 = ({\n factoryAddress,\n factoryCalldata,\n signature,\n}: SignWith6492Params): Hash => {\n // wrap the signature as follows: https://eips.ethereum.org/EIPS/eip-6492\n // concat(\n // abi.encode(\n // (create2Factory, factoryCalldata, originalERC1271Signature),\n // (address, bytes, bytes)),\n // magicBytes\n // )\n return concat([\n encodeAbiParameters(parseAbiParameters(\"address, bytes, bytes\"), [\n factoryAddress,\n factoryCalldata,\n signature,\n ]),\n \"0x6492649264926492649264926492649264926492649264926492649264926492\",\n ]);\n};\n\n// defined in https://github.com/AmbireTech/signature-validator/blob/main/index.ts#L13C17-L13C17\nconst universalValidatorByteCode =\n \"0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572\";\n\nexport const verifyEIP6492Signature = async ({\n signer,\n hash,\n signature,\n client,\n}: VerifyEIP6492SignatureParams): Promise<boolean> => {\n const result = await client.call({\n data: concat([\n universalValidatorByteCode,\n encodeAbiParameters(parseAbiParameters(\"address, bytes32, bytes\"), [\n signer,\n hash,\n signature,\n ]),\n ]),\n });\n\n return result.data === \"0x01\";\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/signer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,kBAAkB,GAInB,MAAM,MAAM,CAAC;AA4Bd,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACpC,cAAc,EACd,eAAe,EACf,SAAS,GACU,EAAQ,EAAE;IAQ7B,OAAO,MAAM,CAAC;QACZ,mBAAmB,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,EAAE;YAC/D,cAAc;YACd,eAAe;YACf,SAAS;SACV,CAAC;QACF,oEAAoE;KACrE,CAAC,CAAC;AACL,CAAC,CAAC","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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-client.js","sourceRoot":"","sources":["../../../src/signer/wallet-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAMX,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,MAAM,OAAO,kBAAkB;IAI7B,YAAY,MAAoB,EAAE,UAAkB;QAHpD;;;;;WAAmB;QACnB;;;;;WAAoB;QAUpB;;;;mBAA2C,KAAK,IAAI,EAAE;gBACpD,IAAI,SAAS,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;gBAChD,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,CAAC;WAAC;QAEO;;;;mBACP,KAAK,EAAE,OAAO,EAAE,EAAE;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;YACtD,CAAC;WAAC;QAEJ;;;;mBAAgB,KAAK,EAInB,SAAwD,EAC1C,EAAE;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;oBAC9B,OAAO;oBACP,GAAG,SAAS;iBACb,CAAC,CAAC;YACL,CAAC;WAAC;QA/BA,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CA2BF","sourcesContent":["import {\n getAddress,\n type Hex,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n type WalletClient,\n} from \"viem\";\nimport { InvalidSignerTypeError } from \"../errors/signer.js\";\nimport type { SmartAccountSigner } from \"./types\";\n\nexport class WalletClientSigner implements SmartAccountSigner<WalletClient> {\n signerType: string;\n inner: WalletClient;\n\n constructor(client: WalletClient, signerType: string) {\n this.inner = client;\n if (!signerType) {\n throw new InvalidSignerTypeError(signerType);\n }\n this.signerType = signerType;\n }\n\n getAddress: () => Promise<`0x${string}`> = async () => {\n let addresses = await this.inner.getAddresses();\n return getAddress(addresses[0]);\n };\n\n readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> =\n async (message) => {\n const account = this.inner.account ?? (await this.getAddress());\n\n return this.inner.signMessage({ message, account });\n };\n\n signTypedData = async <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n typedData: TypedDataDefinition<TTypedData, TPrimaryType>\n ): Promise<Hex> => {\n const account = this.inner.account ?? (await this.getAddress());\n\n return this.inner.signTypedData({\n account,\n ...typedData,\n });\n };\n}\n"]}
1
+ {"version":3,"file":"wallet-client.js","sourceRoot":"","sources":["../../../src/signer/wallet-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAMX,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,MAAM,OAAO,kBAAkB;IAI7B,YAAY,MAAoB,EAAE,UAAkB;QAHpD;;;;;WAAmB;QACnB;;;;;WAAoB;QAUpB;;;;mBAA2C,KAAK,IAAI,EAAE;gBACpD,IAAI,SAAS,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;gBAChD,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,CAAC;WAAC;QAEO;;;;mBACP,KAAK,EAAE,OAAO,EAAE,EAAE;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;YACtD,CAAC;WAAC;QAEJ;;;;mBAAgB,KAAK,EAInB,SAAwD,EAC1C,EAAE;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;oBAC9B,OAAO;oBACP,GAAG,SAAS;iBACb,CAAC,CAAC;YACL,CAAC;WAAC;QA/BA,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CA2BF","sourcesContent":["import {\n getAddress,\n type Hex,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n type WalletClient,\n} from \"viem\";\nimport { InvalidSignerTypeError } from \"../errors/signer.js\";\nimport type { SmartAccountSigner } from \"./types\";\n\n/**\n * Represents a wallet client signer for smart accounts, providing methods to get the address, sign messages, and sign typed data.\n */\nexport class WalletClientSigner implements SmartAccountSigner<WalletClient> {\n signerType: string;\n inner: WalletClient;\n\n constructor(client: WalletClient, signerType: string) {\n this.inner = client;\n if (!signerType) {\n throw new InvalidSignerTypeError(signerType);\n }\n this.signerType = signerType;\n }\n\n getAddress: () => Promise<`0x${string}`> = async () => {\n let addresses = await this.inner.getAddresses();\n return getAddress(addresses[0]);\n };\n\n readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> =\n async (message) => {\n const account = this.inner.account ?? (await this.getAddress());\n\n return this.inner.signMessage({ message, account });\n };\n\n signTypedData = async <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n typedData: TypedDataDefinition<TTypedData, TPrimaryType>\n ): Promise<Hex> => {\n const account = this.inner.account ?? (await this.getAddress());\n\n return this.inner.signTypedData({\n account,\n ...typedData,\n });\n };\n}\n"]}
@@ -9,7 +9,6 @@ export type Deferrable<T> = {
9
9
  };
10
10
  export declare function resolveProperties<T>(object: Deferrable<T>): Promise<T>;
11
11
  export declare function deepHexlify(obj: any): any;
12
- export declare function defineReadOnly<T, K extends keyof T>(object: T, key: K, value: T[K]): void;
13
12
  export declare function filterUndefined<T>(obj: T): T;
14
13
  export declare function pick(obj: Record<string, unknown>, keys: string | string[]): {};
15
14
  export declare const allEqual: (...params: any[]) => boolean;
@@ -49,13 +49,6 @@ export function deepHexlify(obj) {
49
49
  [key]: deepHexlify(obj[key]),
50
50
  }), {});
51
51
  }
52
- export function defineReadOnly(object, key, value) {
53
- Object.defineProperty(object, key, {
54
- enumerable: true,
55
- value: value,
56
- writable: false,
57
- });
58
- }
59
52
  export function filterUndefined(obj) {
60
53
  for (const key in obj) {
61
54
  if (obj[key] == null) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAIpD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CACpC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CACnD,CAAC;AASF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAS,EAAE;IACjD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,C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AAG,CAKtB,KAAU,EACV,QAAW,EACX,EAAkB,EACD,EAAE,CACnB,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACzB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,GAAG,CAAC;AACb,CAAC,EAAE,EAAqB,CAAC,CAAC;AAE5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAE5B,cAAc,aAAa,CAAC","sourcesContent":["import type { Chain } from \"viem\";\nimport { toHex } from \"viem\";\nimport * as chains from \"viem/chains\";\nimport * as alchemyChains from \"../chains/index.js\";\nimport type { PromiseOrValue } from \"../types.js\";\nimport type { RecordableKeys } from \"./types.js\";\n\nexport const AlchemyChainMap = new Map<number, Chain>(\n Object.values(alchemyChains).map((c) => [c.id, c])\n);\n\n/**\n * Utility method for converting a chainId to a {@link Chain} object\n *\n * @param chainId - the chainId to convert\n * @returns a {@link Chain} object for the given chainId\n * @throws if the chainId is not found\n */\nexport const getChain = (chainId: number): Chain => {\n for (const chain of Object.values(chains)) {\n if (chain.id === chainId) {\n return AlchemyChainMap.get(chain.id) ?? chain;\n }\n }\n throw new Error(\"could not find chain\");\n};\n\n/**\n * Utility function that allows for piping a series of async functions together\n *\n * @param fns - functions to pipe\n * @returns result of the pipe\n */\nexport const asyncPipe =\n <S, O, F>(...fns: ((s: S, o?: O, f?: F) => Promise<S>)[]) =>\n async (s: S, o?: O, f?: F) => {\n let result = s;\n for (const fn of fns) {\n result = await fn(result, o, f);\n }\n return result;\n };\n\n// based on @ethersproject/properties, but pulled in here to minize the dependency on ethers\nexport type Deferrable<T> = {\n [K in keyof T]: PromiseOrValue<T[K]>;\n};\n\n/**\n * Await all of the properties of a {@link Deferrable} object\n *\n * @param object - a {@link Deferrable} object\n * @returns the object with its properties resolved\n */\nexport async function resolveProperties<T>(object: Deferrable<T>): Promise<T> {\n const promises = Object.keys(object).map((key) => {\n const value = object[key as keyof Deferrable<T>];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n\n const results = await Promise.all(promises);\n\n return filterUndefined<T>(\n results.reduce((accum, curr) => {\n accum[curr.key as keyof T] = curr.value;\n return accum;\n }, {} as T)\n );\n}\n\n/**\n * Recursively converts all values in an object to hex strings\n *\n * @param obj - obj to deep hexlify\n * @returns object with all of its values hexlified\n */\nexport function deepHexlify(obj: any): any {\n if (typeof obj === \"function\") {\n return undefined;\n }\n if (obj == null || typeof obj === \"string\" || typeof obj === \"boolean\") {\n return obj;\n } else if (typeof obj === \"bigint\") {\n return toHex(obj);\n } else if (obj._isBigNumber != null || typeof obj !== \"object\") {\n return toHex(obj).replace(/^0x0/, \"0x\");\n }\n if (Array.isArray(obj)) {\n return obj.map((member) => deepHexlify(member));\n }\n return Object.keys(obj).reduce(\n (set, key) => ({\n ...set,\n [key]: deepHexlify(obj[key]),\n }),\n {}\n );\n}\n\n// borrowed from ethers.js\nexport function defineReadOnly<T, K extends keyof T>(\n object: T,\n key: K,\n value: T[K]\n): void {\n Object.defineProperty(object, key, {\n enumerable: true,\n value: value,\n writable: false,\n });\n}\n\nexport function filterUndefined<T>(obj: T): T {\n for (const key in obj) {\n if (obj[key] == null) {\n delete obj[key];\n }\n }\n return obj as T;\n}\n\nexport function pick(obj: Record<string, unknown>, keys: string | string[]) {\n return Object.keys(obj)\n .filter((k) => keys.includes(k))\n .reduce((res, k) => Object.assign(res, { [k]: obj[k] }), {});\n}\n\n/**\n * Utility method for checking if the passed in values are all equal (strictly)\n *\n * @param params - values to check\n * @returns a boolean indicating if all values are the same\n * @throws if no values are passed in\n */\nexport const allEqual = (...params: any[]): boolean => {\n if (params.length === 0) {\n throw new Error(\"no values passed in\");\n }\n return params.every((v) => v === params[0]);\n};\n\n/**\n * Utility method for checking the condition and return the value if condition holds true, undefined if not.\n *\n * @param condition - condition to check\n * @param value - value to return when condition holds true\n * @returns the value if condition holds true, undefined if not\n */\nexport const conditionalReturn = <T>(\n condition: Promise<boolean>,\n value: () => Promise<T>\n): Promise<T | undefined> => condition.then((t) => (t ? value() : undefined));\n\nexport const toRecord = <\n T extends { [K in RecordableKeys<T>]: string | number | symbol },\n K extends RecordableKeys<T>,\n V\n>(\n array: T[],\n selector: K,\n fn: (item: T) => V\n): Record<T[K], V> =>\n array.reduce((acc, item) => {\n acc[item[selector]] = fn(item);\n return acc;\n }, {} as Record<T[K], V>);\n\nexport * from \"./bigint.js\";\nexport * from \"./bytes.js\";\nexport * from \"./defaults.js\";\nexport * from \"./schema.js\";\nexport type * from \"./types.js\";\nexport * from \"./userop.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAIpD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CACpC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CACnD,CAAC;AASF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAS,EAAE;IACjD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1C,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC;YACzB,OAAO,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;QAChD,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC,CAAC;AAQF,MAAM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port * as alchemyChains from \"../chains/index.js\";\nimport type { PromiseOrValue } from \"../types.js\";\nimport type { RecordableKeys } from \"./types.js\";\n\nexport const AlchemyChainMap = new Map<number, Chain>(\n Object.values(alchemyChains).map((c) => [c.id, c])\n);\n\n/**\n * Utility method for converting a chainId to a {@link Chain} object\n *\n * @param chainId - the chainId to convert\n * @returns a {@link Chain} object for the given chainId\n * @throws if the chainId is not found\n */\nexport const getChain = (chainId: number): Chain => {\n for (const chain of Object.values(chains)) {\n if (chain.id === chainId) {\n return AlchemyChainMap.get(chain.id) ?? chain;\n }\n }\n throw new Error(\"could not find chain\");\n};\n\n/**\n * Utility function that allows for piping a series of async functions together\n *\n * @param fns - functions to pipe\n * @returns result of the pipe\n */\nexport const asyncPipe =\n <S, O, F>(...fns: ((s: S, o?: O, f?: F) => Promise<S>)[]) =>\n async (s: S, o?: O, f?: F) => {\n let result = s;\n for (const fn of fns) {\n result = await fn(result, o, f);\n }\n return result;\n };\n\n// based on @ethersproject/properties, but pulled in here to minize the dependency on ethers\nexport type Deferrable<T> = {\n [K in keyof T]: PromiseOrValue<T[K]>;\n};\n\n/**\n * Await all of the properties of a {@link Deferrable} object\n *\n * @param object - a {@link Deferrable} object\n * @returns the object with its properties resolved\n */\nexport async function resolveProperties<T>(object: Deferrable<T>): Promise<T> {\n const promises = Object.keys(object).map((key) => {\n const value = object[key as keyof Deferrable<T>];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n\n const results = await Promise.all(promises);\n\n return filterUndefined<T>(\n results.reduce((accum, curr) => {\n accum[curr.key as keyof T] = curr.value;\n return accum;\n }, {} as T)\n );\n}\n\n/**\n * Recursively converts all values in an object to hex strings\n *\n * @param obj - obj to deep hexlify\n * @returns object with all of its values hexlified\n */\nexport function deepHexlify(obj: any): any {\n if (typeof obj === \"function\") {\n return undefined;\n }\n if (obj == null || typeof obj === \"string\" || typeof obj === \"boolean\") {\n return obj;\n } else if (typeof obj === \"bigint\") {\n return toHex(obj);\n } else if (obj._isBigNumber != null || typeof obj !== \"object\") {\n return toHex(obj).replace(/^0x0/, \"0x\");\n }\n if (Array.isArray(obj)) {\n return obj.map((member) => deepHexlify(member));\n }\n return Object.keys(obj).reduce(\n (set, key) => ({\n ...set,\n [key]: deepHexlify(obj[key]),\n }),\n {}\n );\n}\n\n/**\n * Filters out properties with undefined or null values from the provided object.\n *\n * @example\n * ```ts\n * import { filterUndefined } from \"@aa-sdk/core\";\n *\n * const result = filterUndefined({\n * foo: undefined,\n * bar: null,\n * baz: \"baz\",\n * }); // { baz: \"baz\" }\n * ```\n *\n * @param {T} obj the object from which to remove properties with undefined or null values\n * @returns {T} the object with undefined or null properties removed\n */\nexport function filterUndefined<T>(obj: T): T {\n for (const key in obj) {\n if (obj[key] == null) {\n delete obj[key];\n }\n }\n return obj as T;\n}\n\n/**\n * Picks the specified keys from an object and returns a new object containing only those key-value pairs.\n *\n * @example\n * ```ts\n * import { pick } from \"@aa-sdk/core\";\n *\n * const picked = pick({\n * foo: \"foo\",\n * bar: \"bar\",\n * }, [\"foo\"]); // { foo: \"foo\" }\n * ```\n *\n * @param {Record<string, unknown>} obj The object from which to pick keys\n * @param {string|string[]} keys A single key or an array of keys to pick from the object\n * @returns {Record<string, unknown>} A new object containing only the picked key-value pairs\n */\nexport function pick(obj: Record<string, unknown>, keys: string | string[]) {\n return Object.keys(obj)\n .filter((k) => keys.includes(k))\n .reduce((res, k) => Object.assign(res, { [k]: obj[k] }), {});\n}\n\n/**\n * Utility method for checking if the passed in values are all equal (strictly)\n *\n * @param params - values to check\n * @returns a boolean indicating if all values are the same\n * @throws if no values are passed in\n */\nexport const allEqual = (...params: any[]): boolean => {\n if (params.length === 0) {\n throw new Error(\"no values passed in\");\n }\n return params.every((v) => v === params[0]);\n};\n\n/**\n * Utility method for checking the condition and return the value if condition holds true, undefined if not.\n *\n * @param condition - condition to check\n * @param value - value to return when condition holds true\n * @returns the value if condition holds true, undefined if not\n */\nexport const conditionalReturn = <T>(\n condition: Promise<boolean>,\n value: () => Promise<T>\n): Promise<T | undefined> => condition.then((t) => (t ? value() : undefined));\n\n/**\n * Converts an array of objects into a record (object) where each key is determined by the specified selector and the value is determined by the provided function.\n *\n * @example\n * ```ts\n * import { toRecord } from \"@aa-sdk/core\";\n * import { sepolia, mainnet } from \"viem/chains\";\n *\n * const addressesByChain = toRecord(\n * [sepolia, mainnet],\n * \"id\",\n * () => \"0x...\"\n * ); // { [sepolia.id]: \"0x...\", [mainnet.id]: \"0x...\" }\n * ```\n *\n * @param {T[]} array The array of objects to convert to a record\n * @param {K} selector The key used to select the property that will become the record's key\n * @param {(item: T) => V} fn The function that transforms each item in the array into the record's value\n * @returns {Record<T[K], V>} The resulting record object\n */\nexport const toRecord = <\n T extends { [K in RecordableKeys<T>]: string | number | symbol },\n K extends RecordableKeys<T>,\n V\n>(\n array: T[],\n selector: K,\n fn: (item: T) => V\n): Record<T[K], V> =>\n array.reduce((acc, item) => {\n acc[item[selector]] = fn(item);\n return acc;\n }, {} as Record<T[K], V>);\n\nexport * from \"./bigint.js\";\nexport * from \"./bytes.js\";\nexport * from \"./defaults.js\";\nexport * from \"./schema.js\";\nexport type * from \"./types.js\";\nexport * from \"./userop.js\";\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.0-alpha.0";
1
+ export declare const VERSION = "4.0.0-alpha.1";
@@ -1,2 +1,2 @@
1
- export const VERSION = "4.0.0-alpha.0";
1
+ export const VERSION = "4.0.0-alpha.1";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-alpha.0\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-alpha.1\";\n"]}
@@ -21,6 +21,21 @@ export type UpgradeToAndCallParams = {
21
21
  export type SmartContractAccountWithSigner<Name extends string = string, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = SmartContractAccount<Name, TEntryPointVersion> & {
22
22
  getSigner: () => TSigner;
23
23
  };
24
+ /**
25
+ * Determines if the given SmartContractAccount has a signer associated with it.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * import { toSmartContractAccount } from "@aa-sdk/core";
30
+ *
31
+ * const account = await toSmartContractAccount(...);
32
+ *
33
+ * console.log(isSmartAccountWithSigner(account)); // false: the base account does not have a publicly accessible signer
34
+ * ```
35
+ *
36
+ * @param {SmartContractAccount} account The account to check.
37
+ * @returns {boolean} true if the account has a signer, otherwise false.
38
+ */
24
39
  export declare const isSmartAccountWithSigner: (account: SmartContractAccount) => account is SmartContractAccountWithSigner<string, SmartAccountSigner<any>, keyof EntryPointRegistryBase<unknown>>;
25
40
  export type SmartContractAccount<Name extends string = string, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = LocalAccount<Name> & {
26
41
  source: Name;
@@ -58,7 +73,41 @@ export type ToSmartContractAccountParams<Name extends string = string, TTranspor
58
73
  signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;
59
74
  encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;
60
75
  } & Omit<CustomSource, "signTransaction" | "address">;
76
+ /**
77
+ * Parses the factory address and factory calldata from the provided account initialization code (initCode).
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * import { parseFactoryAddressFromAccountInitCode } from "@aa-sdk/core";
82
+ *
83
+ * const [address, calldata] = parseFactoryAddressFromAccountInitCode("0xAddressCalldata");
84
+ * ```
85
+ *
86
+ * @param {Hex} initCode The initialization code from which to parse the factory address and calldata
87
+ * @returns {[Address, Hex]} A tuple containing the parsed factory address and factory calldata
88
+ */
61
89
  export declare const parseFactoryAddressFromAccountInitCode: (initCode: Hex) => [Address, Hex];
90
+ /**
91
+ * Retrieves the account address. Uses a provided `accountAddress` if available; otherwise, it computes the address using the entry point contract and the initial code.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * import { getEntryPoint, getAccountAddress } from "@aa-sdk/core";
96
+ *
97
+ * const accountAddress = await getAccountAddress({
98
+ * client,
99
+ * entryPoint: getEntryPoint(chain),
100
+ * getAccountInitCode: async () => "0x{factoryAddress}{factoryCallData}",
101
+ * });
102
+ * ```
103
+ *
104
+ * @param {object} config The configuration object
105
+ * @param {PublicClient} config.client A public client instance to interact with the blockchain
106
+ * @param {EntryPointDef} config.entryPoint The entry point definition which includes the address and ABI
107
+ * @param {Address} config.accountAddress Optional existing account address
108
+ * @param {function(): Promise<Hex>} config.getAccountInitCode A function that returns a Promise resolving to a Hex string representing the initial code of the account
109
+ * @returns {Promise<Address>} A promise that resolves to the account address
110
+ */
62
111
  export declare const getAccountAddress: ({ client, entryPoint, accountAddress, getAccountInitCode, }: {
63
112
  client: PublicClient;
64
113
  entryPoint: EntryPointDef;
@@ -1 +1 @@
1
- {"version":3,"file":"smartContractAccount.d.ts","sourceRoot":"","sources":["../../../src/account/smartContractAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAA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GAAG,IAAI,CAAC,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAC,CAAC;AAGtD,eAAO,MAAM,sCAAsC,aACvC,GAAG,KACZ,CAAC,OAAO,EAAE,GAAG,CAIf,CAAC;AAEF,eAAO,MAAM,iBAAiB;YAMpB,YAAY;gBACR,aAAa;;wBAEL,MAAM,QAAQ,GAAG,CAAC;4BAmCvC,CAAC;AAGF,wBAAsB,sBAAsB,CAC1C,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,KAAK,EAC5B,kBAAkB,SAAS,iBAAiB,GAAG,iBAAiB,EAChE,EACA,SAAS,EACT,KAAK,EACL,UAAU,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,GACvB,EAAE,4BAA4B,CAC7B,IAAI,EACJ,UAAU,EACV,MAAM,EACN,kBAAkB,CACnB,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"smartContractAccount.d.ts","sourceRoot":"","sources":["../../../src/account/smartContractAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC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,GAAG,IAAI,CAAC,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAC,CAAC;AAGtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sCAAsC,aACvC,GAAG,KACZ,CAAC,OAAO,EAAE,GAAG,CAIf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB;YAMpB,YAAY;gBACR,aAAa;;wBAEL,MAAM,QAAQ,GAAG,CAAC;4BAmCvC,CAAC;AAGF,wBAAsB,sBAAsB,CAC1C,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,KAAK,EAC5B,kBAAkB,SAAS,iBAAiB,GAAG,iBAAiB,EAChE,EACA,SAAS,EACT,KAAK,EACL,UAAU,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,GACvB,EAAE,4BAA4B,CAC7B,IAAI,EACJ,UAAU,EACV,MAAM,EACN,kBAAkB,CACnB,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC"}
@@ -2,5 +2,28 @@ import type { Chain, Client, Transport } from "viem";
2
2
  import { type GetEntryPointFromAccount, type SmartContractAccount } from "../../account/smartContractAccount.js";
3
3
  import type { UserOperationStruct } from "../../types.js";
4
4
  import type { BuildUserOperationParameters, UserOperationContext } from "./types";
5
+ /**
6
+ * Builds a user operation using the provided client and operation parameters. Ensures that the account exists and the client is compatible.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import { createSmartAccountClient } from "@aa-sdk/core";
11
+ *
12
+ * // smart account client is already extended with buildUserOperation
13
+ * const client = createSmartAccountClient(...);
14
+ * const result = await client.buildUserOperation({
15
+ * uo: {
16
+ * target: "0x...",
17
+ * data: "0x...", // or "0x",
18
+ * value: 0n, // optional
19
+ * },
20
+ * account, // only required if the client above is not connected to an account
21
+ * });
22
+ * ```
23
+ *
24
+ * @param {Client<TTransport, TChain, TAccount>} client the client instance used to build the user operation
25
+ * @param {BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>} args the parameters required to build the user operation, including account, overrides, and context
26
+ * @returns {Promise<UserOperationStruct<TEntryPointVersion>>} a promise that resolves to a `UserOperationStruct` object containing the built user operation details
27
+ */
5
28
  export declare function buildUserOperation<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<TTransport, TChain, TAccount>, args: BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>): Promise<UserOperationStruct<TEntryPointVersion>>;
6
29
  //# sourceMappingURL=buildUserOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/buildUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAI/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EACV,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAsB,kBAAkB,CACtC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAA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,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAsBlD"}
@@ -2,5 +2,27 @@ import type { Chain, Client, Transport } from "viem";
2
2
  import type { GetEntryPointFromAccount, SmartContractAccount } from "../../account/smartContractAccount";
3
3
  import type { SendUserOperationResult } from "../../client/types";
4
4
  import type { DropAndReplaceUserOperationParameters, UserOperationContext } from "./types";
5
+ /**
6
+ * Drops an existing user operation and replaces it with a new one while ensuring the appropriate fees and overrides are applied.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import {
11
+ * createSmartAccountClient,
12
+ * } from "@aa-sdk/core";
13
+ *
14
+ * // smart account client is already extended with dropAndReplaceUserOperation
15
+ * const client = createSmartAccountClient(...);
16
+ * const { request } = await client.sendUserOperation(...);
17
+ * const result = await client.dropAndReplaceUserOperation({
18
+ * uoToDrop: request,
19
+ * account, // only required if the client above is not connected to an account
20
+ * });
21
+ * ```
22
+ *
23
+ * @param {Client<TTransport, TChain, TAccount>} client The client instance with the transport, chain, and account information
24
+ * @param {DropAndReplaceUserOperationParameters<TAccount, TContext>} args The parameters required for dropping and replacing the user operation including the account, operation to drop, overrides, and context
25
+ * @returns {Promise<SendUserOperationResult<TEntryPointVersion>>} A promise that resolves to the result of sending the new user operation
26
+ */
5
27
  export declare function dropAndReplaceUserOperation<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<TTransport, TChain, TAccount>, args: DropAndReplaceUserOperationParameters<TAccount, TContext>): Promise<SendUserOperationResult<TEntryPointVersion>>;
6
28
  //# sourceMappingURL=dropAndReplaceUserOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropAndReplaceUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/dropAndReplaceUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAWlE,OAAO,KAAK,EACV,qCAAqC,EACrC,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAsB,2BAA2B,CAC/C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,qCAAqC,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC9D,OAAO,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,CA2EtD"}
1
+ {"version":3,"file":"dropAndReplaceUserOperation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/dropAndReplaceUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAWlE,OAAO,KAAK,EACV,qCAAqC,EACrC,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5C,IAAI,EAAE,qCAAqC,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC9D,OAAO,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,CA2EtD"}
@@ -2,5 +2,29 @@ import type { Chain, Client, Hex, SendTransactionParameters, Transport } from "v
2
2
  import type { GetEntryPointFromAccount, SmartContractAccount } from "../../account/smartContractAccount.js";
3
3
  import type { UserOperationOverrides } from "../../types.js";
4
4
  import type { UserOperationContext } from "./types.js";
5
+ /**
6
+ * Sends a transaction using the provided client, arguments, optional overrides, and context.
7
+ * This sends a UO and then waits for it to be mined
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { createSmartAccountClient } from "@aa-sdk/core";
12
+ *
13
+ * // smart account client is already extended with sendTransaction
14
+ * const client = createSmartAccountClient(...);
15
+ * const result = await client.sendTransaction({
16
+ * to: "0x...",
17
+ * data: "0x...", // or "0x",
18
+ * value: 0n, // optional
19
+ * account, // only required if the client above is not connected to an account
20
+ * });
21
+ * ```
22
+ *
23
+ * @param {Client<Transport, TChain, TAccount>} client The client to send the transaction through
24
+ * @param {SendTransactionParameters<TChain, TAccount, TChainOverride>} args The parameters required to send the transaction
25
+ * @param {UserOperationOverrides<TEntryPointVersion>} [overrides] Optional overrides for the user operation
26
+ * @param {UserOperationContext} [context] Optional context for the user operation
27
+ * @returns {Promise<Hex>} A promise that resolves to a hex string representing the transaction hash
28
+ */
5
29
  export declare function sendTransaction<TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TChainOverride extends Chain | undefined = Chain | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<Transport, TChain, TAccount>, args: SendTransactionParameters<TChain, TAccount, TChainOverride>, overrides?: UserOperationOverrides<TEntryPointVersion>, context?: TContext): Promise<Hex>;
6
30
  //# sourceMappingURL=sendTransaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sendTransaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACN,GAAG,EACH,yBAAyB,EACzB,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAM/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAG7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGvD,wBAAsB,eAAe,CACnC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAC5D,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,kBAAkB,SAAS,wBAAwB,CAAC,QAAQ,CAAC,GAAG,wBAAwB,CAAC,QAAQ,CAAC,EAElG,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,IAAI,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